earthsdk3-cesium 3.5.0-beta.12 → 3.5.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -362,7 +362,7 @@ ${this.stack.toString()}`),t};function $(t,i,e,n,o,s,r,l,c,u,d,p,f,g,m,y){this[0
362
362
  `);for(let n=0;n<e.length;++n){const o=e[n],s=o.indexOf(": ");if(s>0){const r=o.substring(0,s),l=o.substring(s+2);i[r]=l}}return i}function Br(t,i,e){this.statusCode=t,this.response=i,this.responseHeaders=e,typeof this.responseHeaders=="string"&&(this.responseHeaders=ES(this.responseHeaders))}Br.prototype.toString=function(){let t="Request has failed.";return A(this.statusCode)&&(t+=` Status Code: ${this.statusCode}`),t};function Cs(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(Cs.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}}),Cs.prototype.addEventListener=function(t,i){b.typeOf.func("listener",t),this._listeners.push(t),this._scopes.push(i);const e=this;return function(){e.removeEventListener(t,i)}},Cs.prototype.removeEventListener=function(t,i){b.typeOf.func("listener",t);const e=this._listeners,n=this._scopes;let o=-1;for(let s=0;s<e.length;s++)if(e[s]===t&&n[s]===i){o=s;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),e[o]=void 0,n[o]=void 0):(e.splice(o,1),n.splice(o,1)),!0):!1};function xS(t,i){return i-t}Cs.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let t;const i=this._listeners,e=this._scopes;let n=i.length;for(t=0;t<n;t++){const s=i[t];A(s)&&i[t].apply(e[t],arguments)}const o=this._toRemove;if(n=o.length,n>0){for(o.sort(xS),t=0;t<n;t++){const s=o[t];i.splice(s,1),e.splice(s,1)}o.length=0}this._insideRaiseEvent=!1};function Co(t){b.typeOf.object("options",t),b.defined("options.comparator",t.comparator),this._comparator=t.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(Co.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(t){b.typeOf.number.greaterThanOrEquals("maximumLength",t,0);const i=this._length;if(t<i){const e=this._array;for(let n=t;n<i;++n)e[n]=void 0;this._length=t,e.length=t}this._maximumLength=t}},comparator:{get:function(){return this._comparator}}});function ad(t,i,e){const n=t[i];t[i]=t[e],t[e]=n}Co.prototype.reserve=function(t){t=t??this._length,this._array.length=t},Co.prototype.heapify=function(t){t=t??0;const i=this._length,e=this._comparator,n=this._array;let o=-1,s=!0;for(;s;){const r=2*(t+1),l=r-1;l<i&&e(n[l],n[t])<0?o=l:o=t,r<i&&e(n[r],n[o])<0&&(o=r),o!==t?(ad(n,o,t),t=o):s=!1}},Co.prototype.resort=function(){const t=this._length;for(let i=Math.ceil(t/2);i>=0;--i)this.heapify(i)},Co.prototype.insert=function(t){b.defined("element",t);const i=this._array,e=this._comparator,n=this._maximumLength;let o=this._length++;for(o<i.length?i[o]=t:i.push(t);o!==0;){const r=Math.floor((o-1)/2);if(e(i[o],i[r])<0)ad(i,o,r),o=r;else break}let s;return A(n)&&this._length>n&&(s=i[n],this._length=n),s},Co.prototype.pop=function(t){if(t=t??0,this._length===0)return;b.typeOf.number.lessThan("index",t,this._length);const i=this._array,e=i[t];return ad(i,t,--this._length),this.heapify(t),i[this._length]=void 0,e};function AS(t,i){return t.priority-i.priority}const Ce={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0};let _s=20;const mt=new Co({comparator:AS});mt.maximumLength=_s,mt.reserve(_s);const Ai=[];let ki={};const TS=typeof document<"u"?new Qi(document.location.href):new Qi,jc=new Cs;function Ae(){}Ae.maximumRequests=50,Ae.maximumRequestsPerServer=18,Ae.requestsByServer={},Ae.throttleRequests=!0,Ae.debugShowStatistics=!1,Ae.requestCompletedEvent=jc,Object.defineProperties(Ae,{statistics:{get:function(){return Ce}},priorityHeapLength:{get:function(){return _s},set:function(t){if(t<_s)for(;mt.length>t;){const i=mt.pop();_o(i)}_s=t,mt.maximumLength=t,mt.reserve(t)}}});function Pv(t){A(t.priorityFunction)&&(t.priority=t.priorityFunction())}Ae.serverHasOpenSlots=function(t,i){i=i??1;const e=Ae.requestsByServer[t]??Ae.maximumRequestsPerServer;return ki[t]+i<=e},Ae.heapHasOpenSlots=function(t){return mt.length+t<=_s};function bv(t){return t.state===Ge.UNISSUED&&(t.state=Ge.ISSUED,t.deferred=Or()),t.deferred.promise}function MS(t){return function(i){if(t.state===Ge.CANCELLED)return;const e=t.deferred;--Ce.numberOfActiveRequests,--ki[t.serverKey],jc.raiseEvent(),t.state=Ge.RECEIVED,t.deferred=void 0,e.resolve(i)}}function IS(t){return function(i){t.state!==Ge.CANCELLED&&(++Ce.numberOfFailedRequests,--Ce.numberOfActiveRequests,--ki[t.serverKey],jc.raiseEvent(i),t.state=Ge.FAILED,t.deferred.reject(i))}}function Sv(t){const i=bv(t);return t.state=Ge.ACTIVE,Ai.push(t),++Ce.numberOfActiveRequests,++Ce.numberOfActiveRequestsEver,++ki[t.serverKey],t.requestFunction().then(MS(t)).catch(IS(t)),i}function _o(t){const i=t.state===Ge.ACTIVE;if(t.state=Ge.CANCELLED,++Ce.numberOfCancelledRequests,A(t.deferred)){const e=t.deferred;t.deferred=void 0,e.reject()}i&&(--Ce.numberOfActiveRequests,--ki[t.serverKey],++Ce.numberOfCancelledActiveRequests),A(t.cancelFunction)&&t.cancelFunction()}Ae.update=function(){let t,i,e=0;const n=Ai.length;for(t=0;t<n;++t){if(i=Ai[t],i.cancelled&&_o(i),i.state!==Ge.ACTIVE){++e;continue}e>0&&(Ai[t-e]=i)}Ai.length-=e;const o=mt.internalArray,s=mt.length;for(t=0;t<s;++t)Pv(o[t]);mt.resort();const r=Math.max(Ae.maximumRequests-Ai.length,0);let l=0;for(;l<r&&mt.length>0;){if(i=mt.pop(),i.cancelled){_o(i);continue}if(i.throttleByServer&&!Ae.serverHasOpenSlots(i.serverKey)){_o(i);continue}Sv(i),++l}DS()},Ae.getServerKey=function(t){b.typeOf.string("url",t);let i=new Qi(t);i.scheme()===""&&(i=i.absoluteTo(TS),i.normalize());let e=i.authority();/:/.test(e)||(e=`${e}:${i.scheme()==="https"?"443":"80"}`);const n=ki[e];return A(n)||(ki[e]=0),e},Ae.request=function(t){if(b.typeOf.object("request",t),b.typeOf.string("request.url",t.url),b.typeOf.func("request.requestFunction",t.requestFunction),_v(t.url)||Cv(t.url))return jc.raiseEvent(),t.state=Ge.RECEIVED,t.requestFunction();if(++Ce.numberOfAttemptedRequests,A(t.serverKey)||(t.serverKey=Ae.getServerKey(t.url)),Ae.throttleRequests&&t.throttleByServer&&!Ae.serverHasOpenSlots(t.serverKey))return;if(!Ae.throttleRequests||!t.throttle)return Sv(t);if(Ai.length>=Ae.maximumRequests)return;Pv(t);const i=mt.insert(t);if(A(i)){if(i===t)return;_o(i)}return bv(t)};function DS(){Ae.debugShowStatistics&&(Ce.numberOfActiveRequests===0&&Ce.lastNumberOfActiveRequests>0&&(Ce.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ce.numberOfAttemptedRequests}`),Ce.numberOfAttemptedRequests=0),Ce.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ce.numberOfCancelledRequests}`),Ce.numberOfCancelledRequests=0),Ce.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ce.numberOfCancelledActiveRequests}`),Ce.numberOfCancelledActiveRequests=0),Ce.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ce.numberOfFailedRequests}`),Ce.numberOfFailedRequests=0)),Ce.lastNumberOfActiveRequests=Ce.numberOfActiveRequests)}Ae.clearForSpecs=function(){for(;mt.length>0;){const i=mt.pop();_o(i)}const t=Ai.length;for(let i=0;i<t;++i)_o(Ai[i]);Ai.length=0,ki={},Ce.numberOfAttemptedRequests=0,Ce.numberOfActiveRequests=0,Ce.numberOfCancelledRequests=0,Ce.numberOfCancelledActiveRequests=0,Ce.numberOfFailedRequests=0,Ce.numberOfActiveRequestsEver=0,Ce.lastNumberOfActiveRequests=0},Ae.numberOfActiveRequestsByServer=function(t){return ki[t]},Ae.requestHeap=mt;const Ps={};let bs={};Ps.add=function(t,i){if(!A(t))throw new W("host is required.");if(!A(i)||i<=0)throw new W("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;A(bs[e])||(bs[e]=!0)},Ps.remove=function(t,i){if(!A(t))throw new W("host is required.");if(!A(i)||i<=0)throw new W("port is required to be greater than 0.");const e=`${t.toLowerCase()}:${i}`;A(bs[e])&&delete bs[e]};function RS(t){const i=new Qi(t);i.normalize();let e=i.authority();if(e.length!==0){if(i.authority(e),e.indexOf("@")!==-1&&(e=e.split("@")[1]),e.indexOf(":")===-1){let n=i.scheme();if(n.length===0&&(n=window.location.protocol,n=n.substring(0,n.length-1)),n==="http")e+=":80";else if(n==="https")e+=":443";else return}return e}}Ps.contains=function(t){if(!A(t))throw new W("url is required.");const i=RS(t);return!!(A(i)&&A(bs[i]))},Ps.clear=function(){bs={}};const Ev=function(){try{const t=new XMLHttpRequest;return t.open("GET","#",!0),t.responseType="blob",t.responseType==="blob"}catch{return!1}}();function J(t){t=t??Ei.EMPTY_OBJECT,typeof t=="string"&&(t={url:t}),b.typeOf.string("options.url",t.url),this._url=void 0,this._templateValues=Ti(t.templateValues,{}),this._queryParameters=Ti(t.queryParameters,{}),this.headers=Ti(t.headers,{}),this.request=t.request??new Jc,this.proxy=t.proxy,this.retryCallback=t.retryCallback,this.retryAttempts=t.retryAttempts??0,this._retryCount=0,t.parseUrl??!0?this.parseUrl(t.url,!0,!0):this._url=t.url,this._credits=t.credits}function Ti(t,i){return A(t)?ws(t):i}J.createIfNeeded=function(t){return t instanceof J?t.getDerivedResource({request:t.request}):typeof t!="string"?t:new J({url:t})};let Ss;J.supportsImageBitmapOptions=function(){return A(Ss)?Ss:typeof createImageBitmap!="function"?(Ss=Promise.resolve(!1),Ss):(Ss=J.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(i){const e={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(i,e),createImageBitmap(i)])}).then(function(i){const e=wv(i[0]),n=wv(i[1]);return e[1]!==n[1]}).catch(function(){return!1}),Ss)},Object.defineProperties(J,{isBlobSupported:{get:function(){return Ev}}}),Object.defineProperties(J.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(t){this.parseUrl(t,!1,!1)}},extension:{get:function(){return yS(this._url)}},isDataUri:{get:function(){return _v(this._url)}},isBlobUri:{get:function(){return Cv(this._url)}},isCrossOriginUrl:{get:function(){return rd(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}}),J.prototype.toString=function(){return this.getUrlComponent(!0,!0)},J.prototype.parseUrl=function(t,i,e,n){let o=new Qi(t);const s=FS(o.query());this._queryParameters=i?eh(s,this.queryParameters,e):s,o.search(""),o.fragment(""),A(n)&&o.scheme()===""&&(o=o.absoluteTo(Nr(n))),this._url=o.toString()};function FS(t){return t.length===0?{}:t.indexOf("=")===-1?{[t]:void 0}:bS(t)}function eh(t,i,e){if(!e)return Dn(t,i);const n=ws(t,!0);for(const o in i)if(i.hasOwnProperty(o)){let s=n[o];const r=i[o];A(s)?(Array.isArray(s)||(s=n[o]=[s]),n[o]=s.concat(r)):n[o]=Array.isArray(r)?r.slice():r}return n}J.prototype.getUrlComponent=function(t,i){if(this.isDataUri)return this._url;let e=this._url;t&&(e=`${e}${zS(this.queryParameters)}`),e=e.replace(/%7B/g,"{").replace(/%7D/g,"}");const n=this._templateValues;return Object.keys(n).length>0&&(e=e.replace(/{(.*?)}/g,function(o,s){const r=n[s];return A(r)?encodeURIComponent(r):o})),i&&A(this.proxy)&&(e=this.proxy.getURL(e)),e};function zS(t){const i=Object.keys(t);return i.length===0?"":i.length===1&&!A(t[i[0]])?`?${i[0]}`:`?${PS(t)}`}J.prototype.setQueryParameters=function(t,i){i?this._queryParameters=eh(this._queryParameters,t,!1):this._queryParameters=eh(t,this._queryParameters,!1)},J.prototype.appendQueryParameters=function(t){this._queryParameters=eh(t,this._queryParameters,!0)},J.prototype.setTemplateValues=function(t,i){i?this._templateValues=Dn(this._templateValues,t):this._templateValues=Dn(t,this._templateValues)},J.prototype.getDerivedResource=function(t){const i=this.clone();if(i._retryCount=0,A(t.url)){const e=t.preserveQueryParameters??!1;i.parseUrl(t.url,!0,e,this._url)}return A(t.queryParameters)&&(i._queryParameters=Dn(t.queryParameters,i.queryParameters)),A(t.templateValues)&&(i._templateValues=Dn(t.templateValues,i.templateValues)),A(t.headers)&&(i.headers=Dn(t.headers,i.headers)),A(t.proxy)&&(i.proxy=t.proxy),A(t.request)&&(i.request=t.request),A(t.retryCallback)&&(i.retryCallback=t.retryCallback),A(t.retryAttempts)&&(i.retryAttempts=t.retryAttempts),i},J.prototype.retryOnError=function(t){const i=this.retryCallback;if(typeof i!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);const e=this;return Promise.resolve(i(this,t)).then(function(n){return++e._retryCount,n})},J.prototype.clone=function(t){return A(t)?(t._url=this._url,t._queryParameters=ws(this._queryParameters),t._templateValues=ws(this._templateValues),t.headers=ws(this.headers),t.proxy=this.proxy,t.retryCallback=this.retryCallback,t.retryAttempts=this.retryAttempts,t._retryCount=0,t.request=this.request.clone(),t):new J({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:A(this.credits)?this.credits.slice():void 0})},J.prototype.getBaseUri=function(t){return vS(this.getUrlComponent(t),t)},J.prototype.appendForwardSlash=function(){this._url=mS(this._url)},J.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})},J.fetchArrayBuffer=function(t){return new J(t).fetchArrayBuffer()},J.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})},J.fetchBlob=function(t){return new J(t).fetchBlob()},J.prototype.fetchImage=function(t){t=t??Ei.EMPTY_OBJECT;const i=t.preferImageBitmap??!1,e=t.preferBlob??!1,n=t.flipY??!1,o=t.skipColorSpaceConversion??!1;if(cd(this.request),!Ev||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!e)return ld({resource:this,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:i});const s=this.fetchBlob();if(!A(s))return;let r,l,c,u;return J.supportsImageBitmapOptions().then(function(d){return r=d,l=r&&i,s}).then(function(d){if(!A(d))return;if(u=d,l)return J.createImageBitmapFromBlob(d,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o});const p=window.URL.createObjectURL(d);return c=new J({url:p}),ld({resource:c,flipY:n,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(d){if(A(d))return d.blob=u,l||window.URL.revokeObjectURL(c.url),d}).catch(function(d){return A(c)&&window.URL.revokeObjectURL(c.url),d.blob=u,Promise.reject(d)})};function ld(t){const i=t.resource,e=t.flipY,n=t.skipColorSpaceConversion,o=t.preferImageBitmap,s=i.request;s.url=i.url,s.requestFunction=function(){let l=!1;!i.isDataUri&&!i.isBlobUri&&(l=i.isCrossOriginUrl);const c=Or();return J._Implementations.createImage(s,l,c,e,n,o),c.promise};const r=Ae.request(s);if(A(r))return r.catch(function(l){return s.state!==Ge.FAILED?Promise.reject(l):i.retryOnError(l).then(function(c){return c?(s.state=Ge.UNISSUED,s.deferred=void 0,ld({resource:i,flipY:e,skipColorSpaceConversion:n,preferImageBitmap:o})):Promise.reject(l)})})}J.fetchImage=function(t){return new J(t).fetchImage({flipY:t.flipY,skipColorSpaceConversion:t.skipColorSpaceConversion,preferBlob:t.preferBlob,preferImageBitmap:t.preferImageBitmap})},J.prototype.fetchText=function(){return this.fetch({responseType:"text"})},J.fetchText=function(t){return new J(t).fetchText()},J.prototype.fetchJson=function(){const t=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(A(t))return t.then(function(i){if(A(i))return JSON.parse(i)})},J.fetchJson=function(t){return new J(t).fetchJson()},J.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})},J.fetchXML=function(t){return new J(t).fetchXML()},J.prototype.fetchJsonp=function(t){t=t??"callback",cd(this.request);let i;do i=`loadJsonp${F.nextRandomNumber().toString().substring(2,8)}`;while(A(window[i]));return xv(this,t,i)};function xv(t,i,e){const n={};n[i]=e,t.setQueryParameters(n);const o=t.request,s=t.url;o.url=s,o.requestFunction=function(){const l=Or();return window[e]=function(c){l.resolve(c);try{delete window[e]}catch{window[e]=void 0}},J._Implementations.loadAndExecuteScript(s,e,l),l.promise};const r=Ae.request(o);if(A(r))return r.catch(function(l){return o.state!==Ge.FAILED?Promise.reject(l):t.retryOnError(l).then(function(c){return c?(o.state=Ge.UNISSUED,o.deferred=void 0,xv(t,i,e)):Promise.reject(l)})})}J.fetchJsonp=function(t){return new J(t).fetchJsonp(t.callbackParameterName)},J.prototype._makeRequest=function(t){const i=this;cd(i.request);const e=i.request,n=i.url;e.url=n,e.requestFunction=function(){const s=t.responseType,r=Dn(t.headers,i.headers),l=t.overrideMimeType,c=t.method,u=t.data,d=Or(),p=J._Implementations.loadWithXhr(n,s,c,u,r,d,l);return A(p)&&A(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise};const o=Ae.request(e);if(A(o))return o.then(function(s){return e.cancelFunction=void 0,s}).catch(function(s){return e.cancelFunction=void 0,e.state!==Ge.FAILED?Promise.reject(s):i.retryOnError(s).then(function(r){return r?(e.state=Ge.UNISSUED,e.deferred=void 0,i.fetch(t)):Promise.reject(s)})})};function cd(t){if(t.state===Ge.ISSUED||t.state===Ge.ACTIVE)throw new at("The Resource is already being fetched.");t.state=Ge.UNISSUED,t.deferred=void 0}const LS=/^data:(.*?)(;base64)?,(.*)$/;function th(t,i){const e=decodeURIComponent(i);return t?atob(e):e}function Av(t,i){const e=th(t,i),n=new ArrayBuffer(e.length),o=new Uint8Array(n);for(let s=0;s<e.length;s++)o[s]=e.charCodeAt(s);return n}function OS(t,i){i=i??"";const e=t[1],n=!!t[2],o=t[3];let s,r;switch(i){case"":case"text":return th(n,o);case"arraybuffer":return Av(n,o);case"blob":return s=Av(n,o),new Blob([s],{type:e});case"document":return r=new DOMParser,r.parseFromString(th(n,o),e);case"json":return JSON.parse(th(n,o));default:throw new W(`Unhandled responseType: ${i}`)}}J.prototype.fetch=function(t){return t=Ti(t,{}),t.method="GET",this._makeRequest(t)},J.fetch=function(t){return new J(t).fetch({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.delete=function(t){return t=Ti(t,{}),t.method="DELETE",this._makeRequest(t)},J.delete=function(t){return new J(t).delete({responseType:t.responseType,overrideMimeType:t.overrideMimeType,data:t.data})},J.prototype.head=function(t){return t=Ti(t,{}),t.method="HEAD",this._makeRequest(t)},J.head=function(t){return new J(t).head({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.options=function(t){return t=Ti(t,{}),t.method="OPTIONS",this._makeRequest(t)},J.options=function(t){return new J(t).options({responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.post=function(t,i){return b.defined("data",t),i=Ti(i,{}),i.method="POST",i.data=t,this._makeRequest(i)},J.post=function(t){return new J(t).post(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.put=function(t,i){return b.defined("data",t),i=Ti(i,{}),i.method="PUT",i.data=t,this._makeRequest(i)},J.put=function(t){return new J(t).put(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J.prototype.patch=function(t,i){return b.defined("data",t),i=Ti(i,{}),i.method="PATCH",i.data=t,this._makeRequest(i)},J.patch=function(t){return new J(t).patch(t.data,{responseType:t.responseType,overrideMimeType:t.overrideMimeType})},J._Implementations={},J._Implementations.loadImageElement=function(t,i,e){const n=new Image;n.onload=function(){n.naturalWidth===0&&n.naturalHeight===0&&n.width===0&&n.height===0&&(n.width=300,n.height=150),e.resolve(n)},n.onerror=function(o){e.reject(o)},i&&(Ps.contains(t)?n.crossOrigin="use-credentials":n.crossOrigin=""),n.src=t},J._Implementations.createImage=function(t,i,e,n,o,s){const r=t.url;J.supportsImageBitmapOptions().then(function(l){if(!(l&&s)){J._Implementations.loadImageElement(r,i,e);return}const c="blob",u="GET",d=Or(),p=J._Implementations.loadWithXhr(r,c,u,void 0,void 0,d,void 0,void 0,void 0);return A(p)&&A(p.abort)&&(t.cancelFunction=function(){p.abort()}),d.promise.then(function(f){if(!A(f)){e.reject(new at(`Successfully retrieved ${r} but it contained no content.`));return}return J.createImageBitmapFromBlob(f,{flipY:n,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(f){e.resolve(f)})}).catch(function(l){e.reject(l)})},J.createImageBitmapFromBlob=function(t,i){return b.defined("options",i),b.typeOf.bool("options.flipY",i.flipY),b.typeOf.bool("options.premultiplyAlpha",i.premultiplyAlpha),b.typeOf.bool("options.skipColorSpaceConversion",i.skipColorSpaceConversion),createImageBitmap(t,{imageOrientation:i.flipY?"flipY":"from-image",premultiplyAlpha:i.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:i.skipColorSpaceConversion?"none":"default"})};function NS(t,i,e,n,o,s,r){fetch(t,{method:e,headers:o}).then(async l=>{if(!l.ok){const c={};l.headers.forEach((u,d)=>{c[d]=u}),s.reject(new Br(l.status,l,c));return}switch(i){case"text":s.resolve(l.text());break;case"json":s.resolve(l.json());break;default:s.resolve(new Uint8Array(await l.arrayBuffer()).buffer);break}}).catch(()=>{s.reject(new Br)})}const BS=typeof XMLHttpRequest>"u";J._Implementations.loadWithXhr=function(t,i,e,n,o,s,r){const l=LS.exec(t);if(l!==null){s.resolve(OS(l,i));return}if(BS){NS(t,i,e,n,o,s);return}const c=new XMLHttpRequest;if(Ps.contains(t)&&(c.withCredentials=!0),c.open(e,t,!0),A(r)&&A(c.overrideMimeType)&&c.overrideMimeType(r),A(o))for(const d in o)o.hasOwnProperty(d)&&c.setRequestHeader(d,o[d]);A(i)&&(c.responseType=i);let u=!1;return typeof t=="string"&&(u=t.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){s.reject(new Br(c.status,c.response,c.getAllResponseHeaders()));return}const d=c.response,p=c.responseType;if(e==="HEAD"||e==="OPTIONS"){const g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){const _=y.split(": "),P=_.shift();m[P]=_.join(": ")}),s.resolve(m);return}if(c.status===204)s.resolve(void 0);else if(A(d)&&(!A(i)||p===i))s.resolve(d);else if(i==="json"&&typeof d=="string")try{s.resolve(JSON.parse(d))}catch(f){s.reject(f)}else(p===""||p==="document")&&A(c.responseXML)&&c.responseXML.hasChildNodes()?s.resolve(c.responseXML):(p===""||p==="text")&&A(c.responseText)?s.resolve(c.responseText):s.reject(new at("Invalid XMLHttpRequest response type."))},c.onerror=function(d){s.reject(new Br)},c.send(n),c},J._Implementations.loadAndExecuteScript=function(t,i,e){return _S(t).catch(function(n){e.reject(n)})},J._DefaultImplementations={},J._DefaultImplementations.createImage=J._Implementations.createImage,J._DefaultImplementations.loadWithXhr=J._Implementations.loadWithXhr,J._DefaultImplementations.loadAndExecuteScript=J._Implementations.loadAndExecuteScript,J.DEFAULT=Object.freeze(new J({url:typeof document>"u"?"":document.location.href.split("?")[0]}));function Vr(t){t=t??Ei.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=t.addNewLeapSeconds??!0,A(t.data)?Tv(this,t.data):Tv(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}Vr.fromUrl=async function(t,i){b.defined("url",t),i=i??Ei.EMPTY_OBJECT;const e=J.createIfNeeded(t);let n;try{n=await e.fetchJson()}catch{throw new at(`An error occurred while retrieving the EOP data from the URL ${e.url}.`)}return new Vr({addNewLeapSeconds:i.addNewLeapSeconds,data:n})},Vr.NONE=Object.freeze({compute:function(t,i){return A(i)?(i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0):i=new Ju(0,0,0,0,0),i}}),Vr.prototype.compute=function(t,i){if(!A(this._samples))return;if(A(i)||(i=new Ju(0,0,0,0,0)),this._samples.length===0)return i.xPoleWander=0,i.yPoleWander=0,i.xPoleOffset=0,i.yPoleOffset=0,i.ut1MinusUtc=0,i;const e=this._dates,n=this._lastIndex;let o=0,s=0;if(A(n)){const l=e[n],c=e[n+1],u=k.lessThanOrEquals(l,t),d=!A(c),p=d||k.greaterThanOrEquals(c,t);if(u&&p)return o=n,!d&&c.equals(t)&&++o,s=o+1,Iv(this,e,this._samples,t,o,s,i),i}let r=zr(e,t,k.compare,this._dateColumn);return r>=0?(r<e.length-1&&e[r+1].equals(t)&&++r,o=r,s=r):(s=~r,o=s-1,o<0&&(o=0)),this._lastIndex=o,Iv(this,e,this._samples,t,o,s,i),i};function VS(t,i){return k.compare(t.julianDate,i)}function Tv(t,i){if(!A(i.columnNames))throw new at("Error in loaded EOP data: The columnNames property is required.");if(!A(i.samples))throw new at("Error in loaded EOP data: The samples property is required.");const e=i.columnNames.indexOf("modifiedJulianDateUtc"),n=i.columnNames.indexOf("xPoleWanderRadians"),o=i.columnNames.indexOf("yPoleWanderRadians"),s=i.columnNames.indexOf("ut1MinusUtcSeconds"),r=i.columnNames.indexOf("xCelestialPoleOffsetRadians"),l=i.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=i.columnNames.indexOf("taiMinusUtcSeconds");if(e<0||n<0||o<0||s<0||r<0||l<0||c<0)throw new at("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");const u=t._samples=i.samples,d=t._dates=[];t._dateColumn=e,t._xPoleWanderRadiansColumn=n,t._yPoleWanderRadiansColumn=o,t._ut1MinusUtcSecondsColumn=s,t._xCelestialPoleOffsetRadiansColumn=r,t._yCelestialPoleOffsetRadiansColumn=l,t._taiMinusUtcSecondsColumn=c,t._columnCount=i.columnNames.length,t._lastIndex=void 0;let p;const f=t._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=t._columnCount){const y=u[g+e],_=u[g+c],P=y+Oe.MODIFIED_JULIAN_DATE_DIFFERENCE,C=new k(P,_,de.TAI);if(d.push(C),f){if(_!==p&&A(p)){const S=k.leapSeconds,x=zr(S,C,VS);if(x<0){const T=new Se(C,_);S.splice(~x,0,T)}}p=_}}}function Mv(t,i,e,n,o){const s=e*n;o.xPoleWander=i[s+t._xPoleWanderRadiansColumn],o.yPoleWander=i[s+t._yPoleWanderRadiansColumn],o.xPoleOffset=i[s+t._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=i[s+t._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=i[s+t._ut1MinusUtcSecondsColumn]}function Ur(t,i,e){return i+t*(e-i)}function Iv(t,i,e,n,o,s,r){const l=t._columnCount;if(s>i.length-1)return r.xPoleWander=0,r.yPoleWander=0,r.xPoleOffset=0,r.yPoleOffset=0,r.ut1MinusUtc=0,r;const c=i[o],u=i[s];if(c.equals(u)||n.equals(c))return Mv(t,e,o,l,r),r;if(n.equals(u))return Mv(t,e,s,l,r),r;const d=k.secondsDifference(n,c)/k.secondsDifference(u,c),p=o*l,f=s*l;let g=e[p+t._ut1MinusUtcSecondsColumn],m=e[f+t._ut1MinusUtcSecondsColumn];const y=m-g;if(y>.5||y<-.5){const _=e[p+t._taiMinusUtcSecondsColumn],P=e[f+t._taiMinusUtcSecondsColumn];_!==P&&(u.equals(n)?g=m:m-=P-_)}return r.xPoleWander=Ur(d,e[p+t._xPoleWanderRadiansColumn],e[f+t._xPoleWanderRadiansColumn]),r.yPoleWander=Ur(d,e[p+t._yPoleWanderRadiansColumn],e[f+t._yPoleWanderRadiansColumn]),r.xPoleOffset=Ur(d,e[p+t._xCelestialPoleOffsetRadiansColumn],e[f+t._xCelestialPoleOffsetRadiansColumn]),r.yPoleOffset=Ur(d,e[p+t._yCelestialPoleOffsetRadiansColumn],e[f+t._yCelestialPoleOffsetRadiansColumn]),r.ut1MinusUtc=Ur(d,g,m),r}function je(t,i,e){this.heading=t??0,this.pitch=i??0,this.roll=e??0}je.fromQuaternion=function(t,i){if(!A(t))throw new W("quaternion is required");A(i)||(i=new je);const e=2*(t.w*t.y-t.z*t.x),n=1-2*(t.x*t.x+t.y*t.y),o=2*(t.w*t.x+t.y*t.z),s=1-2*(t.y*t.y+t.z*t.z),r=2*(t.w*t.z+t.x*t.y);return i.heading=-Math.atan2(r,s),i.roll=Math.atan2(o,n),i.pitch=-F.asinClamped(e),i},je.fromDegrees=function(t,i,e,n){if(!A(t))throw new W("heading is required");if(!A(i))throw new W("pitch is required");if(!A(e))throw new W("roll is required");return A(n)||(n=new je),n.heading=t*F.RADIANS_PER_DEGREE,n.pitch=i*F.RADIANS_PER_DEGREE,n.roll=e*F.RADIANS_PER_DEGREE,n},je.clone=function(t,i){if(A(t))return A(i)?(i.heading=t.heading,i.pitch=t.pitch,i.roll=t.roll,i):new je(t.heading,t.pitch,t.roll)},je.equals=function(t,i){return t===i||A(t)&&A(i)&&t.heading===i.heading&&t.pitch===i.pitch&&t.roll===i.roll},je.equalsEpsilon=function(t,i,e,n){return t===i||A(t)&&A(i)&&F.equalsEpsilon(t.heading,i.heading,e,n)&&F.equalsEpsilon(t.pitch,i.pitch,e,n)&&F.equalsEpsilon(t.roll,i.roll,e,n)},je.prototype.clone=function(t){return je.clone(this,t)},je.prototype.equals=function(t){return je.equals(this,t)},je.prototype.equalsEpsilon=function(t,i,e){return je.equalsEpsilon(this,t,i,e)},je.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};const Dv=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function US(){const t=document.getElementsByTagName("script");for(let i=0,e=t.length;i<e;++i){const n=t[i].getAttribute("src"),o=Dv.exec(n);if(o!==null)return o[1]}}let ih;function Rv(t){return typeof document>"u"?t:(A(ih)||(ih=document.createElement("a")),ih.href=t,ih.href)}let Po;function Fv(){if(A(Po))return Po;let t;if(typeof CESIUM_BASE_URL<"u"?t=CESIUM_BASE_URL:A(typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Jo&&Jo.tagName.toUpperCase()==="SCRIPT"&&Jo.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href)?t=Nr(".",typeof document>"u"&&typeof location>"u"?require("url").pathToFileURL(__filename).href:typeof document>"u"?location.href:Jo&&Jo.tagName.toUpperCase()==="SCRIPT"&&Jo.src||new URL("earthsdk3-cesium.umd.cjs",document.baseURI).href):typeof define=="object"&&A(define.amd)&&!define.amd.toUrlUndefined&&A(require.toUrl)?t=Nr("..",ni("Core/buildModuleUrl.js")):t=US(),!A(t))throw new W("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return Po=new J({url:Rv(t)}),Po.appendForwardSlash(),Po}function WS(t){return Rv(require.toUrl(`../${t}`))}function zv(t){return Fv().getDerivedResource({url:t}).url}let nh;function ni(t){return A(nh)||(typeof define=="object"&&A(define.amd)&&!define.amd.toUrlUndefined&&A(require.toUrl)?nh=WS:nh=zv),nh(t)}ni._cesiumScriptRegex=Dv,ni._buildModuleUrlFromBaseUrl=zv,ni._clearBaseResource=function(){Po=void 0},ni.setBaseUrl=function(t){Po=J.DEFAULT.getDerivedResource({url:t})},ni.getCesiumBaseUrl=Fv;function Lv(t,i,e){this.x=t,this.y=i,this.s=e}function hd(t){t=t??Ei.EMPTY_OBJECT,this._xysFileUrlTemplate=J.createIfNeeded(t.xysFileUrlTemplate),this._interpolationOrder=t.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=t.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new k(this._sampleZeroJulianEphemerisDate,0,de.TAI),this._stepSizeDays=t.stepSizeDays??1,this._samplesPerXysFile=t.samplesPerXysFile??1e3,this._totalSamples=t.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];const i=this._interpolationOrder,e=this._denominators=new Array(i+1),n=this._xTable=new Array(i+1),o=Math.pow(this._stepSizeDays,i);for(let s=0;s<=i;++s){e[s]=o,n[s]=s*this._stepSizeDays;for(let r=0;r<=i;++r)r!==s&&(e[s]*=s-r);e[s]=1/e[s]}this._work=new Array(i+1),this._coef=new Array(i+1)}const GS=new k(0,0,de.TAI);function ud(t,i,e){const n=GS;return n.dayNumber=i,n.secondsOfDay=e,k.daysDifference(n,t._sampleZeroDateTT)}hd.prototype.preload=function(t,i,e,n){const o=ud(this,t,i),s=ud(this,e,n);let r=o/this._stepSizeDays-this._interpolationOrder/2|0;r<0&&(r=0);let l=s/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;l>=this._totalSamples&&(l=this._totalSamples-1);const c=r/this._samplesPerXysFile|0,u=l/this._samplesPerXysFile|0,d=[];for(let p=c;p<=u;++p)d.push(dd(this,p));return Promise.all(d)},hd.prototype.computeXysRadians=function(t,i,e){const n=ud(this,t,i);if(n<0)return;const o=n/this._stepSizeDays|0;if(o>=this._totalSamples)return;const s=this._interpolationOrder;let r=o-(s/2|0);r<0&&(r=0);let l=r+s;l>=this._totalSamples&&(l=this._totalSamples-1,r=l-s,r<0&&(r=0));let c=!1;const u=this._samples;if(A(u[r*3])||(dd(this,r/this._samplesPerXysFile|0),c=!0),A(u[l*3])||(dd(this,l/this._samplesPerXysFile|0),c=!0),c)return;A(e)?(e.x=0,e.y=0,e.s=0):e=new Lv(0,0,0);const d=n-r*this._stepSizeDays,p=this._work,f=this._denominators,g=this._coef,m=this._xTable;let y,_;for(y=0;y<=s;++y)p[y]=d-m[y];for(y=0;y<=s;++y){for(g[y]=1,_=0;_<=s;++_)_!==y&&(g[y]*=p[_]);g[y]*=f[y];let P=(r+y)*3;e.x+=g[y]*u[P++],e.y+=g[y]*u[P++],e.s+=g[y]*u[P]}return e};function dd(t,i){if(t._chunkDownloadsInProgress[i])return t._chunkDownloadsInProgress[i];let e;const n=t._xysFileUrlTemplate;A(n)?e=n.getDerivedResource({templateValues:{0:i}}):e=new J({url:ni(`Assets/IAU2006_XYS/IAU2006_XYS_${i}.json`)});const o=e.fetchJson().then(function(s){t._chunkDownloadsInProgress[i]=!1;const r=t._samples,l=s.samples,c=i*t._samplesPerXysFile*3;for(let u=0,d=l.length;u<d;++u)r[c+u]=l[u]});return t._chunkDownloadsInProgress[i]=o,o}function Z(t,i,e,n){this.x=t??0,this.y=i??0,this.z=e??0,this.w=n??0}let Wr=new I;Z.fromAxisAngle=function(t,i,e){b.typeOf.object("axis",t),b.typeOf.number("angle",i);const n=i/2,o=Math.sin(n);Wr=I.normalize(t,Wr);const s=Wr.x*o,r=Wr.y*o,l=Wr.z*o,c=Math.cos(n);return A(e)?(e.x=s,e.y=r,e.z=l,e.w=c,e):new Z(s,r,l,c)};const HS=[1,2,0],$S=new Array(3);Z.fromRotationMatrix=function(t,i){b.typeOf.object("matrix",t);let e,n,o,s,r;const l=t[H.COLUMN0ROW0],c=t[H.COLUMN1ROW1],u=t[H.COLUMN2ROW2],d=l+c+u;if(d>0)e=Math.sqrt(d+1),r=.5*e,e=.5/e,n=(t[H.COLUMN1ROW2]-t[H.COLUMN2ROW1])*e,o=(t[H.COLUMN2ROW0]-t[H.COLUMN0ROW2])*e,s=(t[H.COLUMN0ROW1]-t[H.COLUMN1ROW0])*e;else{const p=HS;let f=0;c>l&&(f=1),u>l&&u>c&&(f=2);const g=p[f],m=p[g];e=Math.sqrt(t[H.getElementIndex(f,f)]-t[H.getElementIndex(g,g)]-t[H.getElementIndex(m,m)]+1);const y=$S;y[f]=.5*e,e=.5/e,r=(t[H.getElementIndex(m,g)]-t[H.getElementIndex(g,m)])*e,y[g]=(t[H.getElementIndex(g,f)]+t[H.getElementIndex(f,g)])*e,y[m]=(t[H.getElementIndex(m,f)]+t[H.getElementIndex(f,m)])*e,n=-y[0],o=-y[1],s=-y[2]}return A(i)?(i.x=n,i.y=o,i.z=s,i.w=r,i):new Z(n,o,s,r)};const Ov=new Z;let Nv=new Z,pd=new Z,Bv=new Z;Z.fromHeadingPitchRoll=function(t,i){return b.typeOf.object("headingPitchRoll",t),Bv=Z.fromAxisAngle(I.UNIT_X,t.roll,Ov),pd=Z.fromAxisAngle(I.UNIT_Y,-t.pitch,i),i=Z.multiply(pd,Bv,pd),Nv=Z.fromAxisAngle(I.UNIT_Z,-t.heading,Ov),Z.multiply(Nv,i,i)};const oh=new I,fd=new I,gi=new Z,Vv=new Z,sh=new Z;Z.packedLength=4,Z.pack=function(t,i,e){return b.typeOf.object("value",t),b.defined("array",i),e=e??0,i[e++]=t.x,i[e++]=t.y,i[e++]=t.z,i[e]=t.w,i},Z.unpack=function(t,i,e){return b.defined("array",t),i=i??0,A(e)||(e=new Z),e.x=t[i],e.y=t[i+1],e.z=t[i+2],e.w=t[i+3],e},Z.packedInterpolationLength=3,Z.convertPackedArrayForInterpolation=function(t,i,e,n){Z.unpack(t,e*4,sh),Z.conjugate(sh,sh);for(let o=0,s=e-i+1;o<s;o++){const r=o*3;Z.unpack(t,(i+o)*4,gi),Z.multiply(gi,sh,gi),gi.w<0&&Z.negate(gi,gi),Z.computeAxis(gi,oh);const l=Z.computeAngle(gi);A(n)||(n=[]),n[r]=oh.x*l,n[r+1]=oh.y*l,n[r+2]=oh.z*l}},Z.unpackInterpolationResult=function(t,i,e,n,o){A(o)||(o=new Z),I.fromArray(t,0,fd);const s=I.magnitude(fd);return Z.unpack(i,n*4,Vv),s===0?Z.clone(Z.IDENTITY,gi):Z.fromAxisAngle(fd,s,gi),Z.multiply(gi,Vv,o)},Z.clone=function(t,i){if(A(t))return A(i)?(i.x=t.x,i.y=t.y,i.z=t.z,i.w=t.w,i):new Z(t.x,t.y,t.z,t.w)},Z.conjugate=function(t,i){return b.typeOf.object("quaternion",t),b.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=t.w,i},Z.magnitudeSquared=function(t){return b.typeOf.object("quaternion",t),t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w},Z.magnitude=function(t){return Math.sqrt(Z.magnitudeSquared(t))},Z.normalize=function(t,i){b.typeOf.object("result",i);const e=1/Z.magnitude(t),n=t.x*e,o=t.y*e,s=t.z*e,r=t.w*e;return i.x=n,i.y=o,i.z=s,i.w=r,i},Z.inverse=function(t,i){b.typeOf.object("result",i);const e=Z.magnitudeSquared(t);return i=Z.conjugate(t,i),Z.multiplyByScalar(i,1/e,i)},Z.add=function(t,i,e){return b.typeOf.object("left",t),b.typeOf.object("right",i),b.typeOf.object("result",e),e.x=t.x+i.x,e.y=t.y+i.y,e.z=t.z+i.z,e.w=t.w+i.w,e},Z.subtract=function(t,i,e){return b.typeOf.object("left",t),b.typeOf.object("right",i),b.typeOf.object("result",e),e.x=t.x-i.x,e.y=t.y-i.y,e.z=t.z-i.z,e.w=t.w-i.w,e},Z.negate=function(t,i){return b.typeOf.object("quaternion",t),b.typeOf.object("result",i),i.x=-t.x,i.y=-t.y,i.z=-t.z,i.w=-t.w,i},Z.dot=function(t,i){return b.typeOf.object("left",t),b.typeOf.object("right",i),t.x*i.x+t.y*i.y+t.z*i.z+t.w*i.w},Z.multiply=function(t,i,e){b.typeOf.object("left",t),b.typeOf.object("right",i),b.typeOf.object("result",e);const n=t.x,o=t.y,s=t.z,r=t.w,l=i.x,c=i.y,u=i.z,d=i.w,p=r*l+n*d+o*u-s*c,f=r*c-n*u+o*d+s*l,g=r*u+n*c-o*l+s*d,m=r*d-n*l-o*c-s*u;return e.x=p,e.y=f,e.z=g,e.w=m,e},Z.multiplyByScalar=function(t,i,e){return b.typeOf.object("quaternion",t),b.typeOf.number("scalar",i),b.typeOf.object("result",e),e.x=t.x*i,e.y=t.y*i,e.z=t.z*i,e.w=t.w*i,e},Z.divideByScalar=function(t,i,e){return b.typeOf.object("quaternion",t),b.typeOf.number("scalar",i),b.typeOf.object("result",e),e.x=t.x/i,e.y=t.y/i,e.z=t.z/i,e.w=t.w/i,e},Z.computeAxis=function(t,i){b.typeOf.object("quaternion",t),b.typeOf.object("result",i);const e=t.w;if(Math.abs(e-1)<F.EPSILON6||Math.abs(e+1)<F.EPSILON6)return i.x=1,i.y=i.z=0,i;const n=1/Math.sqrt(1-e*e);return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i},Z.computeAngle=function(t){return b.typeOf.object("quaternion",t),Math.abs(t.w-1)<F.EPSILON6?0:2*Math.acos(t.w)};let gd=new Z;Z.lerp=function(t,i,e,n){return b.typeOf.object("start",t),b.typeOf.object("end",i),b.typeOf.number("t",e),b.typeOf.object("result",n),gd=Z.multiplyByScalar(i,e,gd),n=Z.multiplyByScalar(t,1-e,n),Z.add(gd,n,n)};let Uv=new Z,md=new Z,vd=new Z;Z.slerp=function(t,i,e,n){b.typeOf.object("start",t),b.typeOf.object("end",i),b.typeOf.number("t",e),b.typeOf.object("result",n);let o=Z.dot(t,i),s=i;if(o<0&&(o=-o,s=Uv=Z.negate(i,Uv)),1-o<F.EPSILON6)return Z.lerp(t,s,e,n);const r=Math.acos(o);return md=Z.multiplyByScalar(t,Math.sin((1-e)*r),md),vd=Z.multiplyByScalar(s,Math.sin(e*r),vd),n=Z.add(md,vd,n),Z.multiplyByScalar(n,1/Math.sin(r),n)},Z.log=function(t,i){b.typeOf.object("quaternion",t),b.typeOf.object("result",i);const e=F.acosClamped(t.w);let n=0;return e!==0&&(n=e/Math.sin(e)),I.multiplyByScalar(t,n,i)},Z.exp=function(t,i){b.typeOf.object("cartesian",t),b.typeOf.object("result",i);const e=I.magnitude(t);let n=0;return e!==0&&(n=Math.sin(e)/e),i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=Math.cos(e),i};const qS=new I,XS=new I,Gr=new Z,Es=new Z;Z.computeInnerQuadrangle=function(t,i,e,n){b.typeOf.object("q0",t),b.typeOf.object("q1",i),b.typeOf.object("q2",e),b.typeOf.object("result",n);const o=Z.conjugate(i,Gr);Z.multiply(o,e,Es);const s=Z.log(Es,qS);Z.multiply(o,t,Es);const r=Z.log(Es,XS);return I.add(s,r,s),I.multiplyByScalar(s,.25,s),I.negate(s,s),Z.exp(s,Gr),Z.multiply(i,Gr,n)},Z.squad=function(t,i,e,n,o,s){b.typeOf.object("q0",t),b.typeOf.object("q1",i),b.typeOf.object("s0",e),b.typeOf.object("s1",n),b.typeOf.number("t",o),b.typeOf.object("result",s);const r=Z.slerp(t,i,o,Gr),l=Z.slerp(e,n,o,Es);return Z.slerp(r,l,2*o*(1-o),s)};const YS=new Z,Wv=1.9011074535173003,rh=lt.supportsTypedArrays()?new Float32Array(8):[],ah=lt.supportsTypedArrays()?new Float32Array(8):[],Ki=lt.supportsTypedArrays()?new Float32Array(8):[],Ji=lt.supportsTypedArrays()?new Float32Array(8):[];for(let t=0;t<7;++t){const i=t+1,e=2*i+1;rh[t]=1/(i*e),ah[t]=i/e}rh[7]=Wv/(8*17),ah[7]=Wv*8/17,Z.fastSlerp=function(t,i,e,n){b.typeOf.object("start",t),b.typeOf.object("end",i),b.typeOf.number("t",e),b.typeOf.object("result",n);let o=Z.dot(t,i),s;o>=0?s=1:(s=-1,o=-o);const r=o-1,l=1-e,c=e*e,u=l*l;for(let g=7;g>=0;--g)Ki[g]=(rh[g]*c-ah[g])*r,Ji[g]=(rh[g]*u-ah[g])*r;const d=s*e*(1+Ki[0]*(1+Ki[1]*(1+Ki[2]*(1+Ki[3]*(1+Ki[4]*(1+Ki[5]*(1+Ki[6]*(1+Ki[7])))))))),p=l*(1+Ji[0]*(1+Ji[1]*(1+Ji[2]*(1+Ji[3]*(1+Ji[4]*(1+Ji[5]*(1+Ji[6]*(1+Ji[7])))))))),f=Z.multiplyByScalar(t,p,YS);return Z.multiplyByScalar(i,d,n),Z.add(f,n,n)},Z.fastSquad=function(t,i,e,n,o,s){b.typeOf.object("q0",t),b.typeOf.object("q1",i),b.typeOf.object("s0",e),b.typeOf.object("s1",n),b.typeOf.number("t",o),b.typeOf.object("result",s);const r=Z.fastSlerp(t,i,o,Gr),l=Z.fastSlerp(e,n,o,Es);return Z.fastSlerp(r,l,2*o*(1-o),s)},Z.equals=function(t,i){return t===i||A(t)&&A(i)&&t.x===i.x&&t.y===i.y&&t.z===i.z&&t.w===i.w},Z.equalsEpsilon=function(t,i,e){return e=e??0,t===i||A(t)&&A(i)&&Math.abs(t.x-i.x)<=e&&Math.abs(t.y-i.y)<=e&&Math.abs(t.z-i.z)<=e&&Math.abs(t.w-i.w)<=e},Z.ZERO=Object.freeze(new Z(0,0,0,0)),Z.IDENTITY=Object.freeze(new Z(0,0,0,1)),Z.prototype.clone=function(t){return Z.clone(this,t)},Z.prototype.equals=function(t){return Z.equals(this,t)},Z.prototype.equalsEpsilon=function(t,i){return Z.equalsEpsilon(this,t,i)},Z.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};const le={},yd={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"}},xs={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},wd={},zt={east:new I,north:new I,up:new I,west:new I,south:new I,down:new I};let Rn=new I,Fn=new I,zn=new I;le.localFrameToFixedFrameGenerator=function(t,i){if(!yd.hasOwnProperty(t)||!yd[t].hasOwnProperty(i))throw new W("firstAxis and secondAxis must be east, north, up, west, south or down.");const e=yd[t][i];let n;const o=t+i;return A(wd[o])?n=wd[o]:(n=function(s,r,l){if(!A(s))throw new W("origin is required.");if(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))throw new W("origin has a NaN component");if(A(l)||(l=new $),I.equalsEpsilon(s,I.ZERO,F.EPSILON14))I.unpack(xs[t],0,Rn),I.unpack(xs[i],0,Fn),I.unpack(xs[e],0,zn);else if(F.equalsEpsilon(s.x,0,F.EPSILON14)&&F.equalsEpsilon(s.y,0,F.EPSILON14)){const c=F.sign(s.z);I.unpack(xs[t],0,Rn),t!=="east"&&t!=="west"&&I.multiplyByScalar(Rn,c,Rn),I.unpack(xs[i],0,Fn),i!=="east"&&i!=="west"&&I.multiplyByScalar(Fn,c,Fn),I.unpack(xs[e],0,zn),e!=="east"&&e!=="west"&&I.multiplyByScalar(zn,c,zn)}else{r=r??se.default,r.geodeticSurfaceNormal(s,zt.up);const c=zt.up,u=zt.east;u.x=-s.y,u.y=s.x,u.z=0,I.normalize(u,zt.east),I.cross(c,u,zt.north),I.multiplyByScalar(zt.up,-1,zt.down),I.multiplyByScalar(zt.east,-1,zt.west),I.multiplyByScalar(zt.north,-1,zt.south),Rn=zt[t],Fn=zt[i],zn=zt[e]}return l[0]=Rn.x,l[1]=Rn.y,l[2]=Rn.z,l[3]=0,l[4]=Fn.x,l[5]=Fn.y,l[6]=Fn.z,l[7]=0,l[8]=zn.x,l[9]=zn.y,l[10]=zn.z,l[11]=0,l[12]=s.x,l[13]=s.y,l[14]=s.z,l[15]=1,l},wd[o]=n),n},le.eastNorthUpToFixedFrame=le.localFrameToFixedFrameGenerator("east","north"),le.northEastDownToFixedFrame=le.localFrameToFixedFrameGenerator("north","east"),le.northUpEastToFixedFrame=le.localFrameToFixedFrameGenerator("north","up"),le.northWestUpToFixedFrame=le.localFrameToFixedFrameGenerator("north","west");const ZS=new Z,QS=new I(1,1,1),kS=new $;le.headingPitchRollToFixedFrame=function(t,i,e,n,o){b.typeOf.object("HeadingPitchRoll",i),n=n??le.eastNorthUpToFixedFrame;const s=Z.fromHeadingPitchRoll(i,ZS),r=$.fromTranslationQuaternionRotationScale(I.ZERO,s,QS,kS);return o=n(t,e,o),$.multiply(o,r,o)};const KS=new $,JS=new H;le.headingPitchRollQuaternion=function(t,i,e,n,o){b.typeOf.object("HeadingPitchRoll",i);const s=le.headingPitchRollToFixedFrame(t,i,e,n,KS),r=$.getMatrix3(s,JS);return Z.fromRotationMatrix(r,o)};const jS=new I(1,1,1),eE=new I,Gv=new $,tE=new $,iE=new H,nE=new Z;le.fixedFrameToHeadingPitchRoll=function(t,i,e,n){b.defined("transform",t),i=i??se.default,e=e??le.eastNorthUpToFixedFrame,A(n)||(n=new je);const o=$.getTranslation(t,eE);if(I.equals(o,I.ZERO))return n.heading=0,n.pitch=0,n.roll=0,n;let s=$.inverseTransformation(e(o,i,Gv),Gv),r=$.setScale(t,jS,tE);r=$.setTranslation(r,I.ZERO,r),s=$.multiply(s,r,s);let l=Z.fromRotationMatrix($.getMatrix3(s,iE),nE);return l=Z.normalize(l,l),je.fromQuaternion(l,n)};const oE=6*3600+41*60+50.54841,sE=8640184812866e-6,rE=.093104,aE=-62e-7,lE=11772758384668e-32,cE=72921158553e-15,hE=F.TWO_PI/86400;let lh=new k;le.computeIcrfToCentralBodyFixedMatrix=function(t,i){let e=le.computeIcrfToFixedMatrix(t,i);return A(e)||(e=le.computeTemeToPseudoFixedMatrix(t,i)),e},le.computeTemeToPseudoFixedMatrix=function(t,i){if(!A(t))throw new W("date is required.");lh=k.addSeconds(t,-k.computeTaiMinusUtc(t),lh);const e=lh.dayNumber,n=lh.secondsOfDay;let o;const s=e-2451545;n>=43200?o=(s+.5)/Oe.DAYS_PER_JULIAN_CENTURY:o=(s-.5)/Oe.DAYS_PER_JULIAN_CENTURY;const l=(oE+o*(sE+o*(rE+o*aE)))*hE%F.TWO_PI,c=cE+lE*(e-24515455e-1),u=(n+Oe.SECONDS_PER_DAY*.5)%Oe.SECONDS_PER_DAY,d=l+c*u,p=Math.cos(d),f=Math.sin(d);return A(i)?(i[0]=p,i[1]=-f,i[2]=0,i[3]=f,i[4]=p,i[5]=0,i[6]=0,i[7]=0,i[8]=1,i):new H(p,f,0,-f,p,0,0,0,1)},le.iau2006XysData=new hd,le.earthOrientationParameters=Vr.NONE;const Cd=32.184,uE=2451545;le.preloadIcrfFixed=function(t){const i=t.start.dayNumber,e=t.start.secondsOfDay+Cd,n=t.stop.dayNumber,o=t.stop.secondsOfDay+Cd;return le.iau2006XysData.preload(i,e,n,o)},le.computeIcrfToFixedMatrix=function(t,i){if(!A(t))throw new W("date is required.");A(i)||(i=new H);const e=le.computeFixedToIcrfMatrix(t,i);if(A(e))return H.transpose(e,i)};const dE=32.184,pE=2451545,ch=new je,fE=new H,gE=new k;le.computeMoonFixedToIcrfMatrix=function(t,i){if(!A(t))throw new W("date is required.");const e=k.addSeconds(t,dE,gE),n=k.totalDays(e)-pE,o=F.toRadians(12.112)-F.toRadians(.052992)*n,s=F.toRadians(24.224)-F.toRadians(.105984)*n,r=F.toRadians(227.645)+F.toRadians(13.012)*n,l=F.toRadians(261.105)+F.toRadians(13.340716)*n,c=F.toRadians(358)+F.toRadians(.9856)*n;return ch.pitch=F.toRadians(180)-F.toRadians(3.878)*Math.sin(o)-F.toRadians(.12)*Math.sin(s)+F.toRadians(.07)*Math.sin(r)-F.toRadians(.017)*Math.sin(l),ch.roll=F.toRadians(66.53-90)+F.toRadians(1.543)*Math.cos(o)+F.toRadians(.24)*Math.cos(s)-F.toRadians(.028)*Math.cos(r)+F.toRadians(.007)*Math.cos(l),ch.heading=F.toRadians(244.375-90)+F.toRadians(13.17635831)*n+F.toRadians(3.558)*Math.sin(o)+F.toRadians(.121)*Math.sin(s)-F.toRadians(.064)*Math.sin(r)+F.toRadians(.016)*Math.sin(l)+F.toRadians(.025)*Math.sin(c),H.fromHeadingPitchRoll(ch,fE)},le.computeIcrfToMoonFixedMatrix=function(t,i){if(!A(t))throw new W("date is required.");A(i)||(i=new H);const e=le.computeMoonFixedToIcrfMatrix(t,i);if(A(e))return H.transpose(e,i)};const mE=new Lv(0,0,0),vE=new Ju(0,0,0,0,0),_d=new H,Pd=new H;le.computeFixedToIcrfMatrix=function(t,i){if(!A(t))throw new W("date is required.");A(i)||(i=new H);const e=le.earthOrientationParameters.compute(t,vE);if(!A(e))return;const n=t.dayNumber,o=t.secondsOfDay+Cd,s=le.iau2006XysData.computeXysRadians(n,o,mE);if(!A(s))return;const r=s.x+e.xPoleOffset,l=s.y+e.yPoleOffset,c=1/(1+Math.sqrt(1-r*r-l*l)),u=_d;u[0]=1-c*r*r,u[3]=-c*r*l,u[6]=r,u[1]=-c*r*l,u[4]=1-c*l*l,u[7]=l,u[2]=-r,u[5]=-l,u[8]=1-c*(r*r+l*l);const d=H.fromRotationZ(-s.s,Pd),p=H.multiply(u,d,_d),f=t.dayNumber,g=t.secondsOfDay-k.computeTaiMinusUtc(t)+e.ut1MinusUtc,m=f-2451545,y=g/Oe.SECONDS_PER_DAY;let _=.779057273264+y+.00273781191135448*(m+y);_=_%1*F.TWO_PI;const P=H.fromRotationZ(_,Pd),C=H.multiply(p,P,_d),S=Math.cos(e.xPoleWander),x=Math.cos(e.yPoleWander),T=Math.sin(e.xPoleWander),R=Math.sin(e.yPoleWander);let O=n-uE+o/Oe.SECONDS_PER_DAY;O/=36525;const N=-47e-6*O*F.RADIANS_PER_DEGREE/3600,V=Math.cos(N),U=Math.sin(N),z=Pd;return z[0]=S*V,z[1]=S*U,z[2]=T,z[3]=-x*U+R*T*V,z[4]=x*V+R*T*U,z[5]=-R*S,z[6]=-R*U-x*T*V,z[7]=R*V-x*T*U,z[8]=x*S,H.multiply(C,z,i)};const yE=new K;le.pointToWindowCoordinates=function(t,i,e,n){return n=le.pointToGLWindowCoordinates(t,i,e,n),n.y=2*i[5]-n.y,n},le.pointToGLWindowCoordinates=function(t,i,e,n){if(!A(t))throw new W("modelViewProjectionMatrix is required.");if(!A(i))throw new W("viewportTransformation is required.");if(!A(e))throw new W("point is required.");A(n)||(n=new j);const o=yE;return $.multiplyByVector(t,K.fromElements(e.x,e.y,e.z,1,o),o),K.multiplyByScalar(o,1/o.w,o),$.multiplyByVector(i,o,o),j.fromCartesian4(o,n)};const wE=new I,CE=new I,_E=new I;le.rotationMatrixFromPositionVelocity=function(t,i,e,n){if(!A(t))throw new W("position is required.");if(!A(i))throw new W("velocity is required.");const o=(e??se.default).geodeticSurfaceNormal(t,wE);let s=I.cross(i,o,CE);I.equalsEpsilon(s,I.ZERO,F.EPSILON6)&&(s=I.clone(I.UNIT_X,s));const r=I.cross(s,i,_E);return I.normalize(r,r),I.cross(i,r,s),I.negate(s,s),I.normalize(s,s),A(n)||(n=new H),n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=s.x,n[4]=s.y,n[5]=s.z,n[6]=r.x,n[7]=r.y,n[8]=r.z,n};const Hv=new $(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),$v=new ce,bd=new I,PE=new I,bE=new H,Sd=new $,qv=new $;le.basisTo2D=function(t,i,e){if(!A(t))throw new W("projection is required.");if(!A(i))throw new W("matrix is required.");if(!A(e))throw new W("result is required.");const n=$.getTranslation(i,PE),o=t.ellipsoid;let s;if(I.equals(n,I.ZERO))s=I.clone(I.ZERO,bd);else{const d=o.cartesianToCartographic(n,$v);s=t.project(d,bd),I.fromElements(s.z,s.x,s.y,s)}const r=le.eastNorthUpToFixedFrame(n,o,Sd),l=$.inverseTransformation(r,qv),c=$.getMatrix3(i,bE),u=$.multiplyByMatrix3(l,c,e);return $.multiply(Hv,u,e),$.setTranslation(e,s,e),e},le.ellipsoidTo2DModelMatrix=function(t,i,e){if(!A(t))throw new W("projection is required.");if(!A(i))throw new W("center is required.");if(!A(e))throw new W("result is required.");const n=t.ellipsoid,o=le.eastNorthUpToFixedFrame(i,n,Sd),s=$.inverseTransformation(o,qv),r=n.cartesianToCartographic(i,$v),l=t.project(r,bd);I.fromElements(l.z,l.x,l.y,l);const c=$.fromTranslation(l,Sd);return $.multiply(Hv,s,e),$.multiply(c,e,e),e};function ie(t,i,e,n){this.west=t??0,this.south=i??0,this.east=e??0,this.north=n??0}Object.defineProperties(ie.prototype,{width:{get:function(){return ie.computeWidth(this)}},height:{get:function(){return ie.computeHeight(this)}}}),ie.packedLength=4,ie.pack=function(t,i,e){return b.typeOf.object("value",t),b.defined("array",i),e=e??0,i[e++]=t.west,i[e++]=t.south,i[e++]=t.east,i[e]=t.north,i},ie.unpack=function(t,i,e){return b.defined("array",t),i=i??0,A(e)||(e=new ie),e.west=t[i++],e.south=t[i++],e.east=t[i++],e.north=t[i],e},ie.computeWidth=function(t){b.typeOf.object("rectangle",t);let i=t.east;const e=t.west;return i<e&&(i+=F.TWO_PI),i-e},ie.computeHeight=function(t){return b.typeOf.object("rectangle",t),t.north-t.south},ie.fromDegrees=function(t,i,e,n,o){return t=F.toRadians(t??0),i=F.toRadians(i??0),e=F.toRadians(e??0),n=F.toRadians(n??0),A(o)?(o.west=t,o.south=i,o.east=e,o.north=n,o):new ie(t,i,e,n)},ie.fromRadians=function(t,i,e,n,o){return A(o)?(o.west=t??0,o.south=i??0,o.east=e??0,o.north=n??0,o):new ie(t,i,e,n)},ie.fromCartographicArray=function(t,i){b.defined("cartographics",t);let e=Number.MAX_VALUE,n=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,r=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let c=0,u=t.length;c<u;c++){const d=t[c];e=Math.min(e,d.longitude),n=Math.max(n,d.longitude),r=Math.min(r,d.latitude),l=Math.max(l,d.latitude);const p=d.longitude>=0?d.longitude:d.longitude+F.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return n-e>s-o&&(e=o,n=s,n>F.PI&&(n=n-F.TWO_PI),e>F.PI&&(e=e-F.TWO_PI)),A(i)?(i.west=e,i.south=r,i.east=n,i.north=l,i):new ie(e,r,n,l)},ie.fromCartesianArray=function(t,i,e){b.defined("cartesians",t),i=i??se.default;let n=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,r=-Number.MAX_VALUE,l=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,d=t.length;u<d;u++){const p=i.cartesianToCartographic(t[u]);n=Math.min(n,p.longitude),o=Math.max(o,p.longitude),l=Math.min(l,p.latitude),c=Math.max(c,p.latitude);const f=p.longitude>=0?p.longitude:p.longitude+F.TWO_PI;s=Math.min(s,f),r=Math.max(r,f)}return o-n>r-s&&(n=s,o=r,o>F.PI&&(o=o-F.TWO_PI),n>F.PI&&(n=n-F.TWO_PI)),A(e)?(e.west=n,e.south=l,e.east=o,e.north=c,e):new ie(n,l,o,c)};const SE=new I,EE=new I,xE=new I,AE=new I,TE=new I,Ed=new Array(5);for(let t=0;t<Ed.length;++t)Ed[t]=new I;ie.fromBoundingSphere=function(t,i,e){b.typeOf.object("boundingSphere",t);const n=t.center,o=t.radius;if(A(i)||(i=se.default),A(e)||(e=new ie),I.equals(n,I.ZERO))return ie.clone(ie.MAX_VALUE,e),e;const s=le.eastNorthUpToFixedFrame(n,i,SE),r=$.multiplyByPointAsVector(s,I.UNIT_X,EE);I.normalize(r,r);const l=$.multiplyByPointAsVector(s,I.UNIT_Y,xE);I.normalize(l,l),I.multiplyByScalar(l,o,l),I.multiplyByScalar(r,o,r);const c=I.negate(l,TE),u=I.negate(r,AE),d=Ed;let p=d[0];return I.add(n,l,p),p=d[1],I.add(n,u,p),p=d[2],I.add(n,c,p),p=d[3],I.add(n,r,p),d[4]=n,ie.fromCartesianArray(d,i,e)},ie.clone=function(t,i){if(A(t))return A(i)?(i.west=t.west,i.south=t.south,i.east=t.east,i.north=t.north,i):new ie(t.west,t.south,t.east,t.north)},ie.equalsEpsilon=function(t,i,e){return e=e??0,t===i||A(t)&&A(i)&&Math.abs(t.west-i.west)<=e&&Math.abs(t.south-i.south)<=e&&Math.abs(t.east-i.east)<=e&&Math.abs(t.north-i.north)<=e},ie.prototype.clone=function(t){return ie.clone(this,t)},ie.prototype.equals=function(t){return ie.equals(this,t)},ie.equals=function(t,i){return t===i||A(t)&&A(i)&&t.west===i.west&&t.south===i.south&&t.east===i.east&&t.north===i.north},ie.prototype.equalsEpsilon=function(t,i){return ie.equalsEpsilon(this,t,i)},ie._validate=function(t){b.typeOf.object("rectangle",t);const i=t.north;b.typeOf.number.greaterThanOrEquals("north",i,-F.PI_OVER_TWO),b.typeOf.number.lessThanOrEquals("north",i,F.PI_OVER_TWO);const e=t.south;b.typeOf.number.greaterThanOrEquals("south",e,-F.PI_OVER_TWO),b.typeOf.number.lessThanOrEquals("south",e,F.PI_OVER_TWO);const n=t.west;b.typeOf.number.greaterThanOrEquals("west",n,-Math.PI),b.typeOf.number.lessThanOrEquals("west",n,Math.PI);const o=t.east;b.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),b.typeOf.number.lessThanOrEquals("east",o,Math.PI)},ie.southwest=function(t,i){return b.typeOf.object("rectangle",t),A(i)?(i.longitude=t.west,i.latitude=t.south,i.height=0,i):new ce(t.west,t.south)},ie.northwest=function(t,i){return b.typeOf.object("rectangle",t),A(i)?(i.longitude=t.west,i.latitude=t.north,i.height=0,i):new ce(t.west,t.north)},ie.northeast=function(t,i){return b.typeOf.object("rectangle",t),A(i)?(i.longitude=t.east,i.latitude=t.north,i.height=0,i):new ce(t.east,t.north)},ie.southeast=function(t,i){return b.typeOf.object("rectangle",t),A(i)?(i.longitude=t.east,i.latitude=t.south,i.height=0,i):new ce(t.east,t.south)},ie.center=function(t,i){b.typeOf.object("rectangle",t);let e=t.east;const n=t.west;e<n&&(e+=F.TWO_PI);const o=F.negativePiToPi((n+e)*.5),s=(t.south+t.north)*.5;return A(i)?(i.longitude=o,i.latitude=s,i.height=0,i):new ce(o,s)},ie.intersection=function(t,i,e){b.typeOf.object("rectangle",t),b.typeOf.object("otherRectangle",i);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=F.TWO_PI:s<r&&n>0&&(s+=F.TWO_PI),n<o&&r<0?r+=F.TWO_PI:s<r&&o<0&&(o+=F.TWO_PI);const l=F.negativePiToPi(Math.max(o,r)),c=F.negativePiToPi(Math.min(n,s));if((t.west<t.east||i.west<i.east)&&c<=l)return;const u=Math.max(t.south,i.south),d=Math.min(t.north,i.north);if(!(u>=d))return A(e)?(e.west=l,e.south=u,e.east=c,e.north=d,e):new ie(l,u,c,d)},ie.simpleIntersection=function(t,i,e){b.typeOf.object("rectangle",t),b.typeOf.object("otherRectangle",i);const n=Math.max(t.west,i.west),o=Math.max(t.south,i.south),s=Math.min(t.east,i.east),r=Math.min(t.north,i.north);if(!(o>=r||n>=s))return A(e)?(e.west=n,e.south=o,e.east=s,e.north=r,e):new ie(n,o,s,r)},ie.union=function(t,i,e){b.typeOf.object("rectangle",t),b.typeOf.object("otherRectangle",i),A(e)||(e=new ie);let n=t.east,o=t.west,s=i.east,r=i.west;n<o&&s>0?n+=F.TWO_PI:s<r&&n>0&&(s+=F.TWO_PI),n<o&&r<0?r+=F.TWO_PI:s<r&&o<0&&(o+=F.TWO_PI);const l=F.negativePiToPi(Math.min(o,r)),c=F.negativePiToPi(Math.max(n,s));return e.west=l,e.south=Math.min(t.south,i.south),e.east=c,e.north=Math.max(t.north,i.north),e},ie.expand=function(t,i,e){return b.typeOf.object("rectangle",t),b.typeOf.object("cartographic",i),A(e)||(e=new ie),e.west=Math.min(t.west,i.longitude),e.south=Math.min(t.south,i.latitude),e.east=Math.max(t.east,i.longitude),e.north=Math.max(t.north,i.latitude),e},ie.contains=function(t,i){b.typeOf.object("rectangle",t),b.typeOf.object("cartographic",i);let e=i.longitude;const n=i.latitude,o=t.west;let s=t.east;return s<o&&(s+=F.TWO_PI,e<0&&(e+=F.TWO_PI)),(e>o||F.equalsEpsilon(e,o,F.EPSILON14))&&(e<s||F.equalsEpsilon(e,s,F.EPSILON14))&&n>=t.south&&n<=t.north};const ME=new ce;ie.subsample=function(t,i,e,n){b.typeOf.object("rectangle",t),i=i??se.default,e=e??0,A(n)||(n=[]);let o=0;const s=t.north,r=t.south,l=t.east,c=t.west,u=ME;u.height=e,u.longitude=c,u.latitude=s,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.latitude=r,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,s<0?u.latitude=s:r>0?u.latitude=r:u.latitude=0;for(let d=1;d<8;++d)u.longitude=-Math.PI+d*F.PI_OVER_TWO,ie.contains(t,u)&&(n[o]=i.cartographicToCartesian(u,n[o]),o++);return u.latitude===0&&(u.longitude=c,n[o]=i.cartographicToCartesian(u,n[o]),o++,u.longitude=l,n[o]=i.cartographicToCartesian(u,n[o]),o++),n.length=o,n},ie.subsection=function(t,i,e,n,o,s){if(b.typeOf.object("rectangle",t),b.typeOf.number.greaterThanOrEquals("westLerp",i,0),b.typeOf.number.lessThanOrEquals("westLerp",i,1),b.typeOf.number.greaterThanOrEquals("southLerp",e,0),b.typeOf.number.lessThanOrEquals("southLerp",e,1),b.typeOf.number.greaterThanOrEquals("eastLerp",n,0),b.typeOf.number.lessThanOrEquals("eastLerp",n,1),b.typeOf.number.greaterThanOrEquals("northLerp",o,0),b.typeOf.number.lessThanOrEquals("northLerp",o,1),b.typeOf.number.lessThanOrEquals("westLerp",i,n),b.typeOf.number.lessThanOrEquals("southLerp",e,o),A(s)||(s=new ie),t.west<=t.east){const l=t.east-t.west;s.west=t.west+i*l,s.east=t.west+n*l}else{const l=F.TWO_PI+t.east-t.west;s.west=F.negativePiToPi(t.west+i*l),s.east=F.negativePiToPi(t.west+n*l)}const r=t.north-t.south;return s.south=t.south+e*r,s.north=t.south+o*r,i===1&&(s.west=t.east),n===1&&(s.east=t.east),e===1&&(s.south=t.north),o===1&&(s.north=t.north),s},ie.MAX_VALUE=Object.freeze(new ie(-Math.PI,-F.PI_OVER_TWO,Math.PI,F.PI_OVER_TWO));function As(t,i,e,n,o){this._format=t,this._datatype=i,this._width=e,this._height=n,this._buffer=o}Object.defineProperties(As.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}}}),As.clone=function(t){if(A(t))return new As(t._format,t._datatype,t._width,t._height,t._buffer)},As.prototype.clone=function(){return As.clone(this)};function Xv(){if(!A(et._canTransferArrayBuffer)){const t=Td("transferTypedArrayTest");t.postMessage=t.webkitPostMessage??t.postMessage;const i=99,e=new Int8Array([i]);try{t.postMessage({array:e},[e.buffer])}catch{return et._canTransferArrayBuffer=!1,et._canTransferArrayBuffer}et._canTransferArrayBuffer=new Promise(n=>{t.onmessage=function(o){const s=o.data.array,r=A(s)&&s[0]===i;n(r),t.terminate(),et._canTransferArrayBuffer=r}})}return et._canTransferArrayBuffer}const xd=new Cs;function Ad(t){let i;try{i=new Blob([t],{type:"application/javascript"})}catch{const o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,s=new o;s.append(t),i=s.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(i)}function Td(t){const i=new Qi(t),e=i.scheme().length!==0&&i.fragment().length===0,n=t.replace(/\.js$/,""),o={};let s,r;if(rd(t))r=t;else if(!e){const l=ni(`${et._workerModulePrefix}/${n}.js`);rd(l)&&(r=l)}if(r){const l=`import "${r}";`;return s=Ad(l),o.type="module",new Worker(s,o)}if(!e&&typeof CESIUM_WORKERS<"u"){const l=`
363
363
  importScripts("${Ad(CESIUM_WORKERS)}");
364
364
  CesiumWorkers["${n}"]();
365
- `;return s=Ad(l),new Worker(s,o)}if(s=t,e||(s=ni(`${et._workerModulePrefix+n}.js`)),!lt.supportsEsmWebWorkers())throw new at("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function IE(t,i){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!lt.supportsWebAssembly()){if(!A(i.fallbackModulePath))throw new at(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=ni(i.fallbackModulePath),e}e.wasmBinaryFile=ni(i.wasmBinaryFile);const n=await J.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=n,e}function et(t,i){this._workerPath=t,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const DE=(t,i,e,n)=>{const o=({data:s})=>{if(s.id===i){if(A(s.error)){let r=s.error;r.name==="RuntimeError"?(r=new at(s.error.message),r.stack=s.error.stack):r.name==="DeveloperError"?(r=new W(s.error.message),r.stack=s.error.stack):r.name==="Error"&&(r=new Error(s.error.message),r.stack=s.error.stack),xd.raiseEvent(r),n(r)}else xd.raiseEvent(),e(s.result);t.removeEventListener("message",o)}};return o},RE=[];async function FE(t,i,e){const n=await Promise.resolve(Xv());A(e)?n||(e.length=0):e=RE;const o=t._nextID++,s=new Promise((r,l)=>{t._worker.addEventListener("message",DE(t._worker,o,r,l))});return t._worker.postMessage({id:o,baseUrl:ni.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:n},e),s}async function zE(t,i,e){++t._activeTasks;try{const n=await FE(t,i,e);return--t._activeTasks,n}catch(n){throw--t._activeTasks,n}}et.prototype.scheduleTask=function(t,i){if(A(this._worker)||(this._worker=Td(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return zE(this,t,i)},et.prototype.initWebAssemblyModule=async function(t){if(A(this._webAssemblyPromise))return this._webAssemblyPromise;const i=async()=>{const e=this._worker=Td(this._workerPath),n=await IE(this,t),o=await Promise.resolve(Xv());let s;const r=n.wasmBinary;A(r)&&o&&(s=[r]);const l=new Promise((c,u)=>{e.onmessage=function({data:d}){A(d)?c(d.result):u(new at("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:n}},s),l};return this._webAssemblyPromise=i(),this._webAssemblyPromise},et.prototype.isDestroyed=function(){return!1},et.prototype.destroy=function(){return A(this._worker)&&this._worker.terminate(),Fb(this)},et.taskCompletedEvent=xd,et._defaultWorkerModulePrefix="Workers/",et._workerModulePrefix=et._defaultWorkerModulePrefix,et._canTransferArrayBuffer=void 0;function ji(){}ji._transcodeTaskProcessor=new et("transcodeKTX2",Number.POSITIVE_INFINITY),ji._readyPromise=void 0;function LE(){const t=ji._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(i){if(i)return ji._transcodeTaskProcessor;throw new at("KTX2 transcoder could not be initialized.")});ji._readyPromise=t}ji.transcode=function(t,i){return b.defined("supportedTargetFormats",i),A(ji._readyPromise)||LE(),ji._readyPromise.then(function(e){let n=t;t instanceof ArrayBuffer&&(n=new Uint8Array(t));const o={supportedTargetFormats:i,ktx2Buffer:n};return e.scheduleTask(o,[n.buffer])}).then(function(e){const n=e.length,o=Object.keys(e[0]);for(let s=0;s<n;s++){const r=e[s];for(let l=0;l<o.length;l++){const c=r[o[l]];r[o[l]]=new As(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let s=0;s<n;++s)e[s]=e[s][o[0]];n===1&&(e=e[0])}return e}).catch(function(e){throw e})};let Yv;Zv.setKTX2SupportedFormats=function(t,i,e,n,o,s){Yv={s3tc:t,pvrtc:i,astc:e,etc:n,etc1:o,bc7:s}};function Zv(t){b.defined("resourceOrUrlOrBuffer",t);let i;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?i=Promise.resolve(t):i=J.createIfNeeded(t).fetchArrayBuffer(),i.then(function(e){return ji.transcode(e,Yv)})}function Lt(t){this._ellipsoid=t??se.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Lt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Lt.mercatorAngleToGeodeticLatitude=function(t){return F.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},Lt.geodeticLatitudeToMercatorAngle=function(t){t>Lt.MaximumLatitude?t=Lt.MaximumLatitude:t<-Lt.MaximumLatitude&&(t=-Lt.MaximumLatitude);const i=Math.sin(t);return .5*Math.log((1+i)/(1-i))},Lt.MaximumLatitude=Lt.mercatorAngleToGeodeticLatitude(Math.PI),Lt.prototype.project=function(t,i){const e=this._semimajorAxis,n=t.longitude*e,o=Lt.geodeticLatitudeToMercatorAngle(t.latitude)*e,s=t.height;return A(i)?(i.x=n,i.y=o,i.z=s,i):new I(n,o,s)},Lt.prototype.unproject=function(t,i){if(!A(t))throw new W("cartesian is required");const e=this._oneOverSemimajorAxis,n=t.x*e,o=Lt.mercatorAngleToGeodeticLatitude(t.y*e),s=t.z;return A(i)?(i.longitude=n,i.latitude=o,i.height=s,i):new ce(n,o,s)};const Qv={};function Hr(t,i){if(!A(t))throw new W("identifier is required.");A(Qv[t])||(Qv[t]=!0,console.warn(i??t))}Hr.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.",Hr.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Hr.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Hr.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function kv(t,i){if(!A(t)||!A(i))throw new W("identifier and message are required.");Hr(t,i)}function Ts(){W.throwInstantiationError()}Object.defineProperties(Ts.prototype,{rectangle:{get:W.throwInstantiationError},tileWidth:{get:W.throwInstantiationError},tileHeight:{get:W.throwInstantiationError},maximumLevel:{get:W.throwInstantiationError},minimumLevel:{get:W.throwInstantiationError},tilingScheme:{get:W.throwInstantiationError},tileDiscardPolicy:{get:W.throwInstantiationError},errorEvent:{get:W.throwInstantiationError},credit:{get:W.throwInstantiationError},proxy:{get:W.throwInstantiationError},hasAlphaChannel:{get:W.throwInstantiationError}}),Ts.prototype.getTileCredits=function(t,i,e){W.throwInstantiationError()},Ts.prototype.requestImage=function(t,i,e,n){W.throwInstantiationError()},Ts.prototype.pickFeatures=function(t,i,e,n,o){W.throwInstantiationError()};const OE=/\.ktx2$/i;Ts.loadImage=function(t,i){b.defined("url",i);const e=J.createIfNeeded(i);return OE.test(e.url)?Zv(e):A(t)&&A(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};function Kv(t,i){return kv("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"),t??i}Object.defineProperty(Kv,"EMPTY_OBJECT",{get:function(){return kv("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),Ei.EMPTY_OBJECT}});var hh=3.141592653589793*3e3/180,tt=3.141592653589793,uh=6378245,dh=.006693421622965943,Jv=function(n,o){var n=+n,o=+o,s=n-.0065,r=o-.006,l=Math.sqrt(s*s+r*r)-2e-5*Math.sin(r*hh),c=Math.atan2(r,s)-3e-6*Math.cos(s*hh),u=l*Math.cos(c),d=l*Math.sin(c);return[u,d]},jv=function(o,n){var n=+n,o=+o,s=Math.sqrt(o*o+n*n)+2e-5*Math.sin(n*hh),r=Math.atan2(n,o)+3e-6*Math.cos(o*hh),l=s*Math.cos(r)+.0065,c=s*Math.sin(r)+.006;return[l,c]},Md=function(o,n){var n=+n,o=+o;if(iy(o,n))return[o,n];var s=ey(o-105,n-35),r=ty(o-105,n-35),l=n/180*tt,c=Math.sin(l);c=1-dh*c*c;var u=Math.sqrt(c);s=s*180/(uh*(1-dh)/(c*u)*tt),r=r*180/(uh/u*Math.cos(l)*tt);var d=n+s,p=o+r;return[p,d]},Id=function(o,n){var n=+n,o=+o;if(iy(o,n))return[o,n];var s=ey(o-105,n-35),r=ty(o-105,n-35),l=n/180*tt,c=Math.sin(l);c=1-dh*c*c;var u=Math.sqrt(c);s=s*180/(uh*(1-dh)/(c*u)*tt),r=r*180/(uh/u*Math.cos(l)*tt);var d=n+s,p=o+r;return[o*2-p,n*2-d]},ey=function(o,n){var n=+n,o=+o,s=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*tt)+20*Math.sin(2*o*tt))*2/3,s+=(20*Math.sin(n*tt)+40*Math.sin(n/3*tt))*2/3,s+=(160*Math.sin(n/12*tt)+320*Math.sin(n*tt/30))*2/3,s},ty=function(o,n){var n=+n,o=+o,s=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*tt)+20*Math.sin(2*o*tt))*2/3,s+=(20*Math.sin(o*tt)+40*Math.sin(o/3*tt))*2/3,s+=(150*Math.sin(o/12*tt)+300*Math.sin(o/30*tt))*2/3,s},iy=function(o,n){var n=+n,o=+o;return!(o>73.66&&o<135.05&&n>3.86&&n<53.55)};function Dd(t,i){this.x=t||0,this.y=i||0,this.x=this.x,this.y=this.y}Dd.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function mi(t,i){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(i)&&(i=decode64(i),i=isNaN(i)?0:i),typeof t=="lat"&&(i=parseFloat(i)),this.lng=t,this.lat=i}mi.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},mi.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function Re(){}Re.EARTHRADIUS=637099681e-2,Re.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],Re.LLBAND=[75,60,45,30,15,0],Re.MC2LL=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],Re.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],Re.getDistanceByMC=function(t,i){if(!t||!i)return 0;var e,n,o,s;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.convertMC2LL(i),!i)?0:(o=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,o,n,s))},Re.getDistanceByLL=function(t,i){if(!t||!i)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),i.lng=this.getLoop(i.lng,-180,180),i.lat=this.getRange(i.lat,-74,74);var e,n,o,s;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),n=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,n,o,s)},Re.convertMC2LL=function(s){var i,e;i=new mi(Math.abs(s.lng),Math.abs(s.lat));for(var n=0;n<this.MCBAND.length;n++)if(i.lat>=this.MCBAND[n]){e=this.MC2LL[n];break}var o=this.convertor(s,e),s=new mi(o.lng.toFixed(6),o.lat.toFixed(6));return s},Re.convertLL2MC=function(s){var i,e;s.lng=this.getLoop(s.lng,-180,180),s.lat=this.getRange(s.lat,-74,74),i=new mi(s.lng,s.lat);for(var n=0;n<this.LLBAND.length;n++)if(i.lat>=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e){for(var n=this.LLBAND.length-1;n>=0;n--)if(i.lat<=-this.LLBAND[n]){e=this.LL2MC[n];break}}var o=this.convertor(s,e),s=new mi(o.lng.toFixed(2),o.lat.toFixed(2));return s},Re.convertor=function(t,i){if(!(!t||!i)){var e=i[0]+i[1]*Math.abs(t.lng),n=Math.abs(t.lat)/i[9],o=i[2]+i[3]*n+i[4]*n*n+i[5]*n*n*n+i[6]*n*n*n*n+i[7]*n*n*n*n*n+i[8]*n*n*n*n*n*n;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new mi(e,o)}},Re.getDistance=function(t,i,e,n){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(n)+Math.cos(e)*Math.cos(n)*Math.cos(i-t))},Re.toRadians=function(t){return Math.PI*t/180},Re.toDegrees=function(t){return 180*t/Math.PI},Re.getRange=function(t,i,e){return i!=null&&(t=Math.max(t,i)),e!=null&&(t=Math.min(t,e)),t},Re.getLoop=function(t,i,e){for(;t>e;)t-=e-i;for(;t<i;)t+=e-i;return t},Re.prototype.lngLatToMercator=function(t){return Re.convertLL2MC(t)},Re.prototype.lngLatToPoint=function(t){var i=Re.convertLL2MC(t);return new Dd(i.lng,i.lat)},Re.prototype.mercatorToLngLat=function(t){return Re.convertMC2LL(t)},Re.prototype.PointToLngLat=function(t){var i=new mi(t.x,t.y);return Re.convertMC2LL(i)},Re.prototype.PointToPixel=function(t,i,e,n,o){if(t){t=this.lngLatToMercator(t,o);var s=this.getZoomUnits(i),r=Math.round((t.lng-e.lng)/s+n[Twidth]/2),l=Math.round((e.lat-t.lat)/s+n[Theight]/2);return new Dd(r,l)}},Re.prototype.PixelToPoint=function(t,i,e,n,o){if(t){var s=this.getZoomUnits(i),r=e.lng+s*(t.x-n[Twidth]/2),l=e.lat-s*(t.y-n[Theight]/2),c=new mi(r,l);return this.mercatorToLngLat(c,o)}},Re.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function Ln(t){t=t||{},this._ellipsoid=Kv(t.ellipsoid,se.WGS84);var i=!0;A(t.wgs84)&&(i=t.wgs84),this._projection=new Lt(this._ellipsoid);var e=new Re;this._projection.project=function(r){var l={};return i?(l=Md(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l=jv(l[0],l[1])):l=jv(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l[0]=Math.min(l[0],180),l[0]=Math.max(l[0],-180),l[1]=Math.min(l[1],74.000022),l[1]=Math.max(l[1],-71.988531),l=e.lngLatToPoint(new mi(l[0],l[1])),new j(l.x,l.y)},this._projection.unproject=function(r){var l=e.mercatorToLngLat(new mi(r.x,r.y));return l[0]=(l[0]+180)%360-180,i?(l=Jv(l.lng,l.lat),l=Id(l[0],l[1])):l=Jv(l.lng,l.lat),new ce(F.toRadians(l[0]),F.toRadians(l[1]))},this._rectangleSouthwestInMeters=new j(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new j(2003772637e-2,1247410417e-2);var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ie(n.longitude,n.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var s=0;s<19;s++)this.levelWidth[s]=Math.pow(2,18-s)*256}Object.defineProperties(Ln.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Ln.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},Ln.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},Ln.prototype.rectangleToNativeRectangle=function(t,i){var e=this._projection,n=e.project(ie.southwest(t)),o=e.project(ie.northeast(t));return A(i)?(i.west=n.x,i.south=n.y,i.east=o.x,i.north=o.y,i):new ie(n.x,n.y,o.x,o.y)},Ln.prototype.tileXYToNativeRectangle=function(t,i,e,n){var o=this.levelWidth[e],s=t*o,r=(t+1)*o;i=-i;var l=(i+1)*o,c=i*o;return A(n)?(n.west=s,n.south=c,n.east=r,n.north=l,n):new ie(s,c,r,l)},Ln.prototype.tileXYToRectangle=function(t,i,e,n){var o=this.tileXYToNativeRectangle(t,i,e,n),s=this._projection,r=s.unproject(new j(o.west,o.south)),l=s.unproject(new j(o.east,o.north));return o.west=r.longitude,o.south=r.latitude,o.east=l.longitude,o.north=l.latitude,o},Ln.prototype.positionToTileXY=function(t,i,e){var n=this._rectangle;if(ie.contains(n,t)){var o=this._projection,s=o.project(t);if(A(s)){var r=this.levelWidth[i],l=Math.floor(s.x/r),c=-Math.floor(s.y/r);return A(e)?(e.x=l,e.y=c,e):new j(l,c)}}};function ph(t){this._url=t.url||"http://online2.map.bdimg.com/onlinelabel/?qt=tile&styles=pl&x={x}&y={y}&z={z}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new Ln(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function NE(t,i,e,n){var o=t._url;return o=o.replace("{x}",i).replace("{y}",-e).replace("{z}",n),o}Object.defineProperties(ph.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 3}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),ph.prototype.getTileCredits=function(t,i,e){},ph.prototype.requestImage=function(t,i,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=NE(this,t,i,e);return Ts.loadImage(this,n)};class BE extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new h.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,n,o,s){try{let r=this.buildImageUrl(this.indexTime,e,n,o);return h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://tileser.giiiis.com/timetile/${e}/${s}/${n}/${o}.jpg`}}class VE extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTimeID",0);e.url="https://wayback.maptiles.arcgis.com/",e.minimumLevel=1,e.maximumLevel=18,this.indexTimeID=e.indexTimeID||0}get indexTimeID(){return this._indexTimeID}set indexTimeID(e){this._indexTimeID=e}async requestImage(e,n,o,s){try{let r;return this.indexTimeID!==0?r=this.buildImageUrl(this.indexTimeID,e,n,o):r=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${n}/${e}`,h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${s}/${o}/${n}`}}const UE=document.createElement("canvas");class Rd{constructor(i){v(this,"mapboxRenderer");v(this,"ready");v(this,"readyPromise");v(this,"rectangle");v(this,"tileSize");v(this,"tileWidth");v(this,"tileHeight");v(this,"maximumLevel");v(this,"minimumLevel");v(this,"tileDiscardPolicy");v(this,"credit");v(this,"proxy");v(this,"layerStyle");v(this,"hasAlphaChannel");v(this,"sourceFilter");v(this,"tilingScheme");v(this,"_destroyed",!1);v(this,"_error");v(this,"_style");v(this,"_accessToken");v(this,"_enablePickFeatures");this.ready=!1,this.tilingScheme=i.tilingScheme??new ye.WebMercatorTilingScheme,this.rectangle=i.rectangle??this.tilingScheme.rectangle,this.rectangle=ye.Rectangle.intersection(this.rectangle,this.tilingScheme.rectangle),this.tileSize=this.tileWidth=this.tileHeight=i.tileSize||256,this.maximumLevel=i.maximumLevel??18,this.minimumLevel=i.minimumLevel??0,this.tileDiscardPolicy=void 0,this._error=new ye.Event,this.credit=new ye.Credit(i.credit||"",!1),this.proxy=new ye.DefaultProxy(""),this.hasAlphaChannel=i.hasAlphaChannel??!0,this.sourceFilter=i.sourceFilter,this._accessToken=i.accessToken,this._enablePickFeatures=i.enablePickFeatures??!0,this.layerStyle=i.layerStyle??[],ye.defined(i.style)&&(this.readyPromise=this._build(i.style,i).then(()=>!0))}get style(){return this._style}get isDestroyed(){return this._destroyed}get errorEvent(){return this._error}async _build(i,e={}){const n=await this._preLoad(i,e.scheme??"tms");n.layers=this.layerStyle.length!=0?this.layerStyle:n.layers,this._style=n,this.mapboxRenderer=new g_.BasicRenderer({style:n,canvas:UE,token:e.accessToken,transformRequest:e.transformRequest}),e.showCanvas&&this.mapboxRenderer.showCanvasForDebug(),await this.mapboxRenderer._style.loadedPromise,this.readyPromise=Promise.resolve(!0),this.ready=!0}static async fromUrl(i,e={}){const n=new Rd(e);return await n._build(i,e),n}_preLoad(i,e){let n=i;if(typeof i=="string"&&(i.endsWith(".json")||i.startsWith("mapbox://")?i=new ye.Resource({url:i}):(i={version:8,sources:{customSource:{type:"vector",scheme:e,tiles:[i]}},layers:this.layerStyle},n=i)),i instanceof ye.Resource){const o="https://api.mapbox.com/";i.url.startsWith("mapbox://")&&(i.url=i.url.replace("mapbox://",o)),this._accessToken&&i.appendQueryParameters({access_token:this._accessToken}),n=i.fetchJson()}return Promise.resolve(n).catch(o=>{throw this._error.raiseEvent(o),o})}_createTile(){const i=document.createElement("canvas");return i.width=this.tileSize,i.height=this.tileSize,i.style.imageRendering="pixelated",i}_resetTileCache(){Object.values(this.mapboxRenderer._style.sourceCaches).forEach(i=>i._tileCache.reset())}_getTilesSpec(i,e){const{x:n,y:o,level:s}=i,r=this.tileSize,l=[],c=this.tilingScheme.getNumberOfXTilesAtLevel(s)-1,u=this.tilingScheme.getNumberOfYTilesAtLevel(s)-1;for(let d=-1;d<=1;d++){let p=n+d;p<0&&(p=c),p>c&&(p=0);for(let f=-1;f<=1;f++){let g=o+f;g<0||g>u||l.push({source:e,z:s,x:p,y:g,left:0+d*r,top:0+f*r,size:r})}}return l}requestImage(i,e,n,o=!0){if(n<this.minimumLevel||n>this.maximumLevel)return;this.mapboxRenderer.filterForZoom(n);const s=this.mapboxRenderer.getVisibleSources(n).reduce((r,l)=>r.concat(this._getTilesSpec({x:i,y:e,level:n},l)),[]);return new Promise((r,l)=>{const c=this._createTile(),u=c.getContext("2d");u&&(u.globalCompositeOperation="copy");const d=this.mapboxRenderer.renderTiles(u,{srcLeft:0,srcTop:0,width:this.tileSize,height:this.tileSize,destLeft:0,destTop:0},s,p=>{typeof p=="string"&&!p.endsWith("tiles not available")?l(void 0):o?(d.consumer.ctx=null,r(c),this.mapboxRenderer.releaseRender(d),this._resetTileCache()):r(d)})})}pickFeatures(i,e,n,o,s){var r;if(this._enablePickFeatures)return(r=this.requestImage(i,e,n,!1))==null?void 0:r.then(l=>{let c=this.mapboxRenderer.getVisibleSources(n);c=this.sourceFilter?this.sourceFilter(c):c;const u=[],d=ye.Math.toDegrees(o),p=ye.Math.toDegrees(s);return c.forEach(f=>{const g=new ye.ImageryLayerFeatureInfo;g.data=this.mapboxRenderer.queryRenderedFeatures({source:f,renderedZoom:n,lng:d,lat:p,tileZ:n});const m=Object.keys(g.data)[0];g.name=m;const y=g.data[m];y&&(g.configureDescriptionFromProperties((y==null?void 0:y.length)===1?y[0]:y),u.push(g))}),l.consumer.ctx=void 0,this.mapboxRenderer.releaseRender(l),this._resetTileCache(),u.length?u:void 0})}destroy(){this.mapboxRenderer._cancelAllPendingRenders(),this._resetTileCache(),this._destroyed=!0}}function WE(t,i){let e;return i===0?e=h.JulianDate.toIso8601(t.stop):e=h.JulianDate.toIso8601(t.start),{Time:e}}function ny(t){if(t.type==="fromIso8601")return h.TimeIntervalCollection.fromIso8601({iso8601:t.iso8601,isStartIncluded:t.isStartIncluded,isStopIncluded:t.isStopIncluded,leadingInterval:t.leadingInterval,trailingInterval:t.trailingInterval,dataCallback:WE})}const{getStrFromEnv:fh}=a.ESSceneObject.context;function GE(t){const i=Object.entries(t).map(([e,n])=>{try{const o=n&&Function(`"use strict";return (${n})`)();return[e,o]}catch(o){console.error(`getCustomTagsFromJson error: ${o}`,o);return}}).filter(e=>!!e);return Object.fromEntries(i)}async function HE(t,i){var e,n;if(t.type==="WebMapTileServiceImageryProvider")return new h.WebMapTileServiceImageryProvider({url:Ht(t.url),format:t.format??"image/jpeg",layer:t.layer,style:t.style,tileMatrixSetID:t.tileMatrixSetID,tileMatrixLabels:t.tileMatrixLabels,clock:t.times&&((e=i.viewer)==null?void 0:e.clock),times:t.times&&ny(t.times),dimensions:t.dimensions,tileWidth:t.tileWidth??256,tileHeight:t.tileHeight??256,tilingScheme:t.tilingScheme&&wi(t.tilingScheme),rectangle:t.rectangle&&Ne(t.rectangle),minimumLevel:t.minimumLevel??0,maximumLevel:t.maximumLevel,ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit,subdomains:t.subdomains});if(t.type==="TileMapServiceImageryProvider")return t.url?await h.TileMapServiceImageryProvider.fromUrl(Ht(t.url),{fileExtension:t.fileExtension,credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,flipXY:t.flipXY}):void 0;if(t.type==="UrlTemplateImageryProvider"){const o=t.customTags&&GE(t.customTags);return console.log(Ht(t.url),"111"),new h.UrlTemplateImageryProvider({url:Ht(t.url),credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,subdomains:t.subdomains,hasAlphaChannel:t.hasAlphaChannel,pickFeaturesUrl:t.pickFeaturesUrl,enablePickFeatures:t.enablePickFeatures,urlSchemeZeroPadding:t.urlSchemeZeroPadding,customTags:o})}else{if(t.type==="GridImageryProvider")return new h.GridImageryProvider({tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,cells:t.cells,color:t.color&&te(t.color),glowColor:t.glowColor&&te(t.glowColor),backgroundColor:t.backgroundColor&&te(t.backgroundColor),canvasSize:t.canvasSize,glowWidth:t.glowWidth});if(t.type==="ArcGisMapServerImageryProvider")return t.url?await h.ArcGisMapServerImageryProvider.fromUrl(Ht(t.url),{token:t.token,usePreCachedTilesIfAvailable:t.usePreCachedTilesIfAvailable,layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit,tileWidth:t.tileWidth,tileHeight:t.tileHeight,maximumLevel:t.maximumLevel}):void 0;if(t.type==="BingMapsImageryProvider")return t.url?await h.BingMapsImageryProvider.fromUrl(Ht(t.url),{key:t.key,tileProtocol:t.tileProtocol,mapStyle:t.mapStyle&&h.BingMapsStyle[t.mapStyle],culture:t.culture,ellipsoid:t.ellipsoid&&we(t.ellipsoid)}):void 0;if(t.type==="GoogleEarthEnterpriseImageryProvider"){if(!t.url)return;const o=await h.GoogleEarthEnterpriseMetadata.fromUrl(Ht(t.url));return await h.GoogleEarthEnterpriseImageryProvider.fromMetadata(o,{ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit})}else{if(t.type==="IonImageryProvider")return await h.IonImageryProvider.fromAssetId(t.assetId,{accessToken:t.accessToken,server:t.server});if(t.type==="MapboxImageryProvider")return new h.MapboxImageryProvider({url:t.url&&fh(t.url),mapId:t.mapId,accessToken:t.accessToken,format:t.format,ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit});if(t.type==="MapboxStyleImageryProvider")return new h.MapboxStyleImageryProvider({url:t.url&&fh(t.url),username:t.username,styleId:t.styleId,accessToken:t.accessToken,tilesize:t.tilesize,scaleFactor:t.scaleFactor,rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel});if(t.type==="OpenStreetMapImageryProvider")return new h.OpenStreetMapImageryProvider({url:fh(t.url),rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,fileExtension:t.fileExtension});if(t.type==="SingleTileImageryProvider")return new h.SingleTileImageryProvider({url:Ht(t.url),rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&we(t.ellipsoid)});if(t.type==="TileCoordinatesImageryProvider")return new h.TileCoordinatesImageryProvider({tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),color:t.color&&te(t.color),tileWidth:t.tileWidth,tileHeight:t.tileHeight});if(t.type==="WebMapServiceImageryProvider")return new h.WebMapServiceImageryProvider({url:Ht(t.url),layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,tileWidth:t.tileWidth,tileHeight:t.tileHeight,crs:t.crs,srs:t.srs,credit:t.credit,subdomains:t.subdomains,clock:t.times&&((n=i.viewer)==null?void 0:n.clock),times:t.times&&ny(t.times),parameters:t.parameters,getFeatureInfoParameters:t.getFeatureInfoParameters});if(t.type==="BDImageryProvider")return new ph({url:t.url&&fh(t.url),ellipsoid:t.ellipsoid&&we(t.ellipsoid),wgs84:t.wgs84});if(t.type==="GeHistoryImagery")return new BE({indexTime:t.indexTime});if(t.type==="ArcgisHistoryImagery")return new VE({indexTimeID:t.indexTimeID});if(t.type==="MVTImageryProvider")return t.url?await Rd.fromUrl(t.url,{maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,tileSize:t.tileSize,accessToken:t.accessToken,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ne(t.rectangle),layerStyle:t.style,scheme:t.scheme}):void 0}}}function $E(t,i){i.type}class oy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(s){var r={};return r=Id(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(r[0]),h.Math.toRadians(r[1])))},e.s_unproject=e.unproject,e.unproject=function(s){var r=e.s_unproject(s),l={};return l=Md(h.Math.toDegrees(r.longitude),h.Math.toDegrees(r.latitude)),new h.Cartographic(h.Math.toRadians(l[0]),h.Math.toRadians(l[1]))};var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h.Rectangle(n.longitude,n.latitude,o.longitude,o.latitude)}}class sy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(n){var o={};return o=Md(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(o[0]),h.Math.toRadians(o[1])))},e.s_unproject=e.unproject,e.unproject=function(n){var o=e.s_unproject(n),s={};return s=Id(h.Math.toDegrees(o.longitude),h.Math.toDegrees(o.latitude)),new h.Cartographic(h.Math.toRadians(s[0]),h.Math.toRadians(s[1]))}}}function qE(t){if(t.type==="GeographicTilingScheme")return"new Cesium.GeographicTilingScheme()";if(t.type==="WebMercatorTilingScheme")return"new Cesium.WebMercatorTilingScheme()"}class On extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_innerImageryProvider",this.disposeVar(a.react(void 0)));v(this,"_layer",this.disposeVar(a.react(void 0)));const o=e.viewer;if(!o)return;const s=kt(o);if(!s)return;const{imageriesManager:r}=s;r.add(this),this.dispose(()=>{r.has(this)&&r.delete(this)});const l=()=>{this.layer&&(this.layer=void 0)};this.dispose(l);const c=()=>{this.layer&&(this.layer.alpha=this.alpha??1,this.layer.nightAlpha=this.nightAlpha??1,this.layer.dayAlpha=this.dayAlpha??1,this.layer.brightness=this.brightness??1,this.layer.contrast=this.contrast??1,this.layer.hue=this.hue??0,this.layer.saturation=this.saturation??1,this.layer.gamma=this.gamma??1,this.layer.splitDirection=this.splitDirection&&h.SplitDirection[this.splitDirection]||h.SplitDirection.NONE,this.layer.minificationFilter=this.minificationFilter&&h.TextureMinificationFilter[this.minificationFilter]||h.TextureMinificationFilter.LINEAR,this.layer.magnificationFilter=this.magnificationFilter&&h.TextureMagnificationFilter[this.magnificationFilter]||h.TextureMagnificationFilter.LINEAR,this.layer.show=this.show??!0,this.layer.maximumAnisotropy=this.maximumAnisotropy,this.layer.minimumTerrainLevel=this.minimumTerrainLevel,this.layer.maximumTerrainLevel=this.maximumTerrainLevel,this.layer.colorToAlpha=this.colorToAlpha&&toColor(this.colorToAlpha),this.layer.colorToAlphaThreshold=this.colorToAlphaThreshold??.004,this.imageryProvider&&$E(this.layer.imageryProvider,this.imageryProvider))};let u=!1;const d=this.disposeVar(a.createProcessingFromAsyncFunc(async(y,_)=>{if(_){if(u=!0,l(),!this.innerImageryProvider)return;const P=await y.promise(HE(this.innerImageryProvider,e));if(!P){console.error("createImageryProviderFromJson error!");return}this.layer=new h.ImageryLayer(P),h.ImageryLayer.prototype&&(this.layer.ESSceneObjectID=n),u=!1}c()}));d.restart(void 0,!0);const p=this.disposeVar(new a.Event),f=this.disposeVar(new a.Event);this.ad(this.layerChanged.don(()=>{if(!this.innerImageryProvider||!this.layer||!Reflect.has(this.innerImageryProvider,"rectangle")||this.innerImageryProvider.rectangle[0]!=this.imageryProvider.rectangle[0]||this.innerImageryProvider.rectangle[1]!=this.imageryProvider.rectangle[1]||this.innerImageryProvider.rectangle[2]!=this.imageryProvider.rectangle[2]||this.innerImageryProvider.rectangle[3]!=this.imageryProvider.rectangle[3])return;const y=this.layer.imageryProvider.tilingScheme.rectangle,_=this.innerImageryProvider.rectangle&&Ne(this.innerImageryProvider.rectangle);(_.west<y.west||_.south<y.south||_.east>y.east||_.north>y.north)&&(this.innerImageryProvider.rectangle=[h.Math.toDegrees(Math.max(y.west,_.west)),h.Math.toDegrees(Math.max(y.south,_.south)),h.Math.toDegrees(Math.min(y.east,_.east)),h.Math.toDegrees(Math.min(y.north,_.north))],p.emit())})),this.dispose(this.imageryProviderChanged.disposableOn(()=>{this.innerImageryProvider=structuredClone(this.imageryProvider),p.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{p.emit()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.rectangleChanged,p));this.dispose(g.disposableOn(()=>{d.restart(void 0,!0)}));const m=this.disposeVar(a.createNextAnimateFrameEvent(this.alphaChanged,this.nightAlphaChanged,this.dayAlphaChanged,this.brightnessChanged,this.contrastChanged,this.hueChanged,this.saturationChanged,this.gammaChanged,this.splitDirectionChanged,this.minificationFilterChanged,this.magnificationFilterChanged,this.showChanged,this.maximumAnisotropyChanged,this.minimumTerrainLevelChanged,this.maximumTerrainLevelChanged,this.cutoutRectangleChanged,this.colorToAlphaChanged,this.colorToAlphaThresholdChanged,f));this.dispose(m.disposableOn(()=>{u||d.restart(void 0,!1)})),this.dispose(this.flyToEvent.disposableOn(y=>{if(!e.actived)return;const{viewer:_}=e;_&&_.camera.flyTo({destination:this.rectangle&&!bu(this.rectangle)?Ne(this.rectangle):h.Camera.DEFAULT_VIEW_RECTANGLE,duration:y})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get innerImageryProvider(){return this._innerImageryProvider.value}set innerImageryProvider(e){this._innerImageryProvider.value=e}get innerImageryProviderChanged(){return this._innerImageryProvider.changed}get layer(){return this._layer.value}set layer(e){this._layer.value=e}get layerChanged(){return this._layer.changed}}v(On,"defaults",{show:!0,rectangle:[-180,-90,180,90],alpha:1,nightAlpha:1,dayAlpha:1,brightness:1,contrast:1,hue:0,saturation:1,gamma:1,splitDirection:"NONE",minificationFilter:"LINEAR",magnificationFilter:"LINEAR",maximumAnisotropy:0,minimumTerrainLevel:0,maximumTerrainLevel:0,cutoutRectangle:[1,1,1,1],colorToAlpha:[1,1,1,.5],colorToAlphaThreshold:.004,imageryProvider:{type:"TileMapServiceImageryProvider"},zIndex:0,hasAlphaChannel:!0,pickFeaturesUrl:""}),(t=>{t.createDefaultProps=()=>({show:void 0,rectangle:a.reactArrayWithUndefined(void 0),alpha:void 0,nightAlpha:void 0,dayAlpha:void 0,brightness:void 0,contrast:void 0,hue:void 0,saturation:void 0,gamma:void 0,splitDirection:void 0,minificationFilter:void 0,magnificationFilter:void 0,maximumAnisotropy:void 0,minimumTerrainLevel:void 0,maximumTerrainLevel:void 0,cutoutRectangle:a.reactArrayWithUndefined(void 0),colorToAlpha:a.reactArrayWithUndefined(void 0),colorToAlphaThreshold:void 0,imageryProvider:a.reactJsonWithUndefined(void 0),zIndex:0,hasAlphaChannel:void 0,pickFeaturesUrl:void 0,targetID:void 0})})(On||(On={})),a.extendClassProps(On.prototype,On.createDefaultProps);const Fd=h.ApproximateTerrainHeights,XE=h.ComponentDatatype,Mi=h.defaultValue,ct=h.defined,YE=h.destroyObject,zd=h.DeveloperError,ZE=h.deprecationWarning,QE=h.GeometryInstance,kE=h.GeometryInstanceAttribute,KE=h.GroundPolylineGeometry,$r=h.DrawCommand,ry=h.Pass,ay=h.RenderState,JE=h.ShaderProgram,qr=h.ShaderSource;let Ld=h._shadersPolylineShadowVolumeFS;const jE=h._shadersPolylineShadowVolumeMorphFS,ex=h._shadersPolylineShadowVolumeMorphVS;let Od=h._shadersPolylineShadowVolumeVS;const ly=h.BlendingState,Nd=h.ClassificationType,tx=h.CullFace,cy=h.PolylineColorAppearance,ix=h.PolylineMaterialAppearance,Nn=h.Primitive,Ms=h.SceneMode,hy=h.StencilConstants,uy=h.StencilFunction,Is=h.StencilOperation;Od=Od.replace("width = width * max(0.0, czm_metersPerPixel(positionEC));",""),Ld=Ld.replace("float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);","float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w;");function Ii(t){t=Mi(t,Mi.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let i=t.appearance;ct(i)||(i=new ix),this.appearance=i,this.show=Mi(t.show,!0),this.classificationType=Mi(t.classificationType,Nd.BOTH),this.debugShowBoundingVolume=Mi(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=Mi(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:Mi(t.interleave,!1),releaseGeometryInstances:Mi(t.releaseGeometryInstances,!0),allowPicking:Mi(t.allowPicking,!0),asynchronous:Mi(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const e=this;this._readyPromise=new Promise((n,o)=>{e._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const s=this._error;ct(s)?o(s):n(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=dy(!1),this._renderState3DTiles=dy(!0),this._renderStateMorph=ay.fromCache({cull:{enabled:!0,face:tx.FRONT},depthTest:{enabled:!0},blending:ly.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ii.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}},readyPromise:{get:function(){return ZE("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),Ii.initializeTerrainHeights=function(){return Fd.initialize()};function nx(t,i,e){const n=i.context,o=t._primitive,s=o._attributeLocations;let r=o._batchTable.getVertexShaderCallback()(Od);r=Nn._appendShowToShader(o,r),r=Nn._appendDistanceDisplayConditionToShader(o,r),r=Nn._modifyShaderPosition(t,r,i.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(ex);l=Nn._appendShowToShader(o,l),l=Nn._appendDistanceDisplayConditionToShader(o,l),l=Nn._modifyShaderPosition(t,l,i.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Ld);const u=[`GLOBE_MINIMUM_ALTITUDE ${i.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";ct(e.material)?(p=ct(e.material)?e.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);const f=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],g=new qr({defines:u,sources:[r]}),m=new qr({defines:f,sources:[p,c]});t._sp=JE.replaceCache({context:n,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:s});let y=n.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!ct(y)){const P=new qr({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[r]});y=n.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:n,shaderProgram:t._sp2D,vertexShaderSource:P,fragmentShaderSource:m,attributeLocations:s})}t._sp2D=y;let _=n.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!ct(_)){const P=new qr({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Fd._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[l]});c=o._batchTable.getVertexShaderCallback()(jE);const C=new qr({defines:f,sources:[p,c]});_=n.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:n,shaderProgram:t._spMorph,vertexShaderSource:P,fragmentShaderSource:C,attributeLocations:s})}t._spMorph=_}function dy(t){return ay.fromCache({cull:{enabled:!0},blending:ly.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:uy.EQUAL,frontOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},backFunction:uy.EQUAL,backOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},reference:hy.CESIUM_3D_TILE_MASK,mask:hy.CESIUM_3D_TILE_MASK}})}function ox(t,i,e,n,o,s){const r=t._primitive,l=r._va.length;o.length=l,s.length=l;const u=i instanceof cy?{}:e._uniforms,d=r._batchTable.getUniformMapCallback()(u);for(let p=0;p<l;p++){const f=r._va[p];let g=o[p];ct(g)||(g=o[p]=new $r({owner:t,primitiveType:r._primitiveType})),g.vertexArray=f,g.renderState=t._renderState,g.shaderProgram=t._sp,g.uniformMap=d,g.pass=ry.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const m=$r.shallowClone(g,g.derivedCommands.tileset);m.renderState=t._renderState3DTiles,m.pass=ry.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;const y=$r.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=t._sp2D,g.derivedCommands.color2D=y;const _=$r.shallowClone(m,m.derivedCommands.color2D);_.shaderProgram=t._sp2D,m.derivedCommands.color2D=_;const P=$r.shallowClone(g,g.derivedCommands.colorMorph);P.renderState=t._renderStateMorph,P.shaderProgram=t._spMorph,P.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=P}}function py(t,i,e,n,o,s,r){e.mode===Ms.MORPHING?i=i.derivedCommands.colorMorph:e.mode!==Ms.SCENE3D&&(i=i.derivedCommands.color2D),i.modelMatrix=n,i.boundingVolume=s,i.cull=o,i.debugShowBoundingVolume=r,e.commandList.push(i)}function sx(t,i,e,n,o,s,r){const l=t._primitive;Nn._updateBoundingVolumes(l,i,o);let c;i.mode===Ms.SCENE3D?c=l._boundingSphereWC:i.mode===Ms.COLUMBUS_VIEW?c=l._boundingSphereCV:i.mode===Ms.SCENE2D&&ct(l._boundingSphere2D)?c=l._boundingSphere2D:ct(l._boundingSphereMorph)&&(c=l._boundingSphereMorph);const u=i.mode===Ms.MORPHING,d=t.classificationType,p=d!==Nd.CESIUM_3D_TILE,f=d!==Nd.TERRAIN&&!u;let g;const m=i.passes;if(m.render||m.pick&&l.allowPicking){const y=e.length;for(let _=0;_<y;++_){const P=c[_];p&&(g=e[_],py(t,g,i,o,s,P,r)),f&&(g=e[_].derivedCommands.tileset,py(t,g,i,o,s,P,r))}}}Ii.prototype.update=function(t){if(!ct(this._primitive)&&!ct(this.geometryInstances))return;if(!Fd.initialized){if(!this.asynchronous)throw new zd("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");Ii.initializeTerrainHeights();return}let i;const e=this,n=this._primitiveOptions;if(!ct(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length,r=new Array(s);let l;for(i=0;i<s;++i)if(l=o[i].attributes,!ct(l)||!ct(l.color)){this._hasPerInstanceColors=!1;break}for(i=0;i<s;++i){const c=o[i];l={};const u=c.attributes;for(const d in u)u.hasOwnProperty(d)&&(l[d]=u[d]);ct(l.width)||(l.width=new kE({componentDatatype:XE.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=t.scene3DOnly,KE.setProjectionAndEllipsoid(c.geometry,t.mapProjection),r[i]=new QE({geometry:c.geometry,attributes:l,id:c.id,pickPrimitive:e})}n.geometryInstances=r,n.appearance=this.appearance,n._createShaderProgramFunction=function(c,u,d){nx(e,u,d)},n._createCommandsFunction=function(c,u,d,p,f,g,m){ox(e,u,d,p,g,m)},n._updateAndQueueCommandsFunction=function(c,u,d,p,f,g,m,y){sx(e,u,d,p,f,g,m)},this._primitive=new Nn(n)}if(this.appearance instanceof cy&&!this._hasPerInstanceColors)throw new zd("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(t),t.afterRender.push(()=>{!this._ready&&ct(this._primitive)&&this._primitive.ready&&this._completeLoad()})},Ii.prototype.getGeometryInstanceAttributes=function(t){if(!ct(this._primitive))throw new zd("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},Ii.isSupported=function(t){return t.frameState.context.depthTexture},Ii.prototype.isDestroyed=function(){return!1},Ii.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,YE(this)};class bo extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.globe,o=-414,s=8777;let r={};const l=()=>{var p,f,g,m,y;if(!e)return;let u;const d=this.shadingMode||"none";if((this.show??!0)&&!(d==="none"&&!this.enableContour)){let _;this.enableContour?(d==="elevation"?(u=rx(),_=u.materials.elevationRampMaterial.uniforms,_.minimumHeight=((p=this.elevationParam)==null?void 0:p.minHeight)??o,_.maximumHeight=((f=this.elevationParam)==null?void 0:f.maxHeight)??s,r=u.materials.contourMaterial.uniforms):d==="slope"?(u=ax(),_=u.materials.slopeRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):d==="aspect"?(u=lx(),_=u.materials.aspectRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):(u=h.Material.fromType("ElevationContour"),r=u.uniforms),r.width=this.contourWidth,r.spacing=this.contourSpacing,r.color=h.Color.fromCartesian4(h.Cartesian4.fromArray(this.contourColor))):d==="elevation"?(u=h.Material.fromType("ElevationRamp"),_=u.uniforms,_.minimumHeight=((g=this.elevationParam)==null?void 0:g.minHeight)??o,_.maximumHeight=((m=this.elevationParam)==null?void 0:m.maxHeight)??s):d==="slope"?(u=h.Material.fromType("SlopeRamp"),_=u.uniforms):d==="aspect"&&(u=h.Material.fromType("AspectRamp"),_=u.uniforms),d!=="none"&&(_.image=fy(d),d==="elevation"&&((y=this.elevationParam)==null?void 0:y.color)!==void 0&&(_.image=Array.isArray(this.elevationParam.color)?fy(d,this.elevationParam.color):this.elevationParam.color))}n.material=u};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.contourColorChanged,this.contourSpacingChanged,this.contourWidthChanged,this.enableContourChanged,this.shadingModeChanged,this.showChanged,this.elevationParamChanged));this.dispose(c.disposableOn(l)),this.dispose(()=>n.material=void 0)}}v(bo,"defaults",{show:!1,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],shadingMode:"none"}),(t=>{t.createDefaultProps=()=>({show:void 0,shadingMode:void 0,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],elevationParam:a.reactJsonWithUndefined(void 0)})})(bo||(bo={})),a.extendClassProps(bo.prototype,bo.createDefaultProps);function rx(){return new h.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function ax(){return new h.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function lx(){return new h.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}const cx=[0,.045,.1,.15,.37,.54,1],hx=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],ux=[0,.2,.4,.6,.8,.9,1];function fy(t,i){const e=document.createElement("canvas");e.width=100,e.height=1;const n=e.getContext("2d");let o;if(t==="elevation")o=cx;else if(t==="slope")o=hx;else if(t==="aspect")o=ux;else throw new Error("values未赋值!");const s=n.createLinearGradient(0,0,100,0);return s.addColorStop(o[0],i!=null&&i[0]?Cn(i==null?void 0:i[0]):"#000000"),s.addColorStop(o[1],i!=null&&i[1]?Cn(i==null?void 0:i[1]):"#2747E0"),s.addColorStop(o[2],i!=null&&i[2]?Cn(i==null?void 0:i[2]):"#D33B7D"),s.addColorStop(o[3],i!=null&&i[3]?Cn(i==null?void 0:i[3]):"#D33038"),s.addColorStop(o[4],i!=null&&i[4]?Cn(i==null?void 0:i[4]):"#FF9742"),s.addColorStop(o[5],i!=null&&i[5]?Cn(i==null?void 0:i[5]):"#ffd700"),s.addColorStop(o[6],i!=null&&i[6]?Cn(i==null?void 0:i[6]):"#ffffff"),n.fillStyle=s,n.fillRect(0,0,100,1),e}class Ds extends a.Destroyable{constructor(e){super();v(this,"_geoPath");v(this,"_geoPolyline");v(this,"_geoCanvasPointPoi");v(this,"_player");v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_currentDistance",this.disposeVar(a.react(0)));v(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new be(e)),this._geoCanvasPointPoi=this.disposeVar(new Pn(e)),this._player=this.disposeVar(new a.Player),this._geoPolyline.show=!1,this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.track([this._geoPath,"width"],[this,"width"])),this.dispose(a.track([this._geoPath,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPath,"color"],[this,"color"])),this.dispose(a.track([this._geoPath,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPath,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPath,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPath,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPath,"allowPicking"],[this,"allowPicking"]));{const n=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};n(),this.dispose(this.showChanged.disposableOn(n)),this.dispose(this.currentPoiShowChanged.disposableOn(n))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const n=()=>{if(this.positions){const s=this.granularity*Math.PI/180,r=mu(this.positions,this.arcType??"GEODESIC",s);if(r){this._geoPath.timePosRots=r.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};n();const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(o.disposableOn(n))}{const n=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const o=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(o-this.currentDistance)>.01&&(this.currentDistance=o)};n(),this.dispose(this._player.currentTimeChanged.disposableOn(n))}{const n=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const o=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(o-(this._player.currentTime??0))>.01&&(this._player.currentTime=o)};n(),this.dispose(this.currentDistanceChanged.disposableOn(n))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(n=>{this._geoPolyline.flyTo(n)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Ds||(Ds={})),a.extendClassProps(Ds.prototype,Ds.createDefaultProps);class fe extends Jt{constructor(e,n){super(e,n);v(this,"_smoothMoving");if(this._smoothMoving=this.disposeVar(new a.SmoothMoveController(this.czmViewer)),this.d(this._smoothMoving.currentPositionChanged.don(s=>{s&&(this.sceneObject.position=s)})),this.d(this._smoothMoving.currentRotationChanged.don(s=>{s&&this._smoothMoving.isRotating&&(this.sceneObject.rotation=s)})),this.d(this._smoothMoving.currentHeadingChanged.don(s=>{if(s!==void 0&&!this._smoothMoving.isRotating){const r=this.sceneObject.rotation;this.sceneObject.rotation=[s-90,r[1],r[2]]}})),!n.viewer){console.warn("viewer is undefined!");return}this.d(e.smoothMoveEvent.don((s,r)=>{this.smoothMove(s,r*1e3)})),this.d(e.smoothMoveWithRotationEvent.don((s,r,l)=>{this.smoothMoveWithRotation(s,r,l*1e3)})),this.d(e.smoothMoveOnGroundEvent.don((s,r,l)=>{this.smoothMoveOnGround(s,r,l*1e3)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((s,r,l,c)=>{this.smoothMoveWithRotationOnGround(s,r,l,c*1e3)})),this.d(e.calcFlyToParamEvent.don(()=>{if(!e.useCalcFlyToParamInESObjectWithLocation)return;if(!e.position){console.warn(`!sceneObject(${e.name}-${e.id}).position`);return}const s=n.calcFlyToParam(e.position);if(!s){console.warn("czmViewer.calcFlyToParam error.");return}e.flyToParam=s})),this.d(e.automaticLandingEvent.don(async s=>{const r=[e.position[0],e.position[1]],l=await n.getTerrainHeight(r);l?e.position=[...r,l]:console.warn("不存在相交"),e.collision=s}));{const s=this.dv(a.createNextAnimateFrameEvent(e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(s.don(()=>this.visibleDistance(e,n))),this.d(n.cameraChanged.don(()=>this.visibleDistance(e,n)))}}smoothMove(e,n){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,this.sceneObject.rotation,n)}smoothMoveWithRotation(e,n,o){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,n,o)}async smoothMoveOnGround(e,n,o){const s=await this.czmViewer.getTerrainHeight([e,n])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([e,n,s],this.sceneObject.rotation,o)}async smoothMoveWithRotationOnGround(e,n,o,s){const r=await this.czmViewer.getTerrainHeight([n,o])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([n,o,r],e,s)}visibleDistance(e,n){var s;const o=fe.getInnerCzmObjects(this);if((s=n.viewer)!=null&&s.camera&&e.show&&o.length!=0){const r=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let l=!1;e.minVisibleDistance<e.maxVisibleDistance?l=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(l=r>e.minVisibleDistance),o.forEach(c=>{if(c instanceof ze)return;const u=e.show&&l;Reflect.has(c,"showHelper")&&(c.showHelper=u),Reflect.has(c,"enabled")&&(c.enabled=u),Reflect.has(c,"show")&&(c.show=u)})}}static getInnerCzmObjects(e){const n=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(!o.includes("czmViewer")&&o.includes("czm")||!Number.isNaN(+o)?Array.isArray(e[o])?n.push(...fe.getInnerCzmObjects(e[o])):n.push(e[o]):e[o]&&e[o].obj&&n.push(...fe.getInnerCzmObjects(e[o].obj)));return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&o.position){const{position:r,flyToParam:l}=o,{distance:c,heading:u,pitch:d,flyDuration:p,hDelta:f,pDelta:g}=l;return this.flyToWithPromise(n,r,c,[u,d,0],e??p,f,g),!0}return super.flyTo(e,n)}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(!o.flyInParam&&o.position&&o.rotation){const r=e??1,l=[...o.rotation];return l[0]+=90,this.flyToWithPromise(n,o.position,void 0,l,r),!0}return super.flyIn(e,n)}}class vt extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}class Xr extends fe{constructor(e,n){super(e,n);v(this,"_lastHoverResult",this.disposeVar(a.react(void 0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.ad(a.createProcessingFromAsyncFunc(async(r,l)=>{const c=await r.promise(n.pick(l.screenPosition,"innerHoverEvent"));this.lastHoverResult=Object.assign({},c,l)}));this.ad(n.pointerMoveEvent.don(async r=>{!s.isRunning&&s.restart(void 0,r)}))}get lastHoverResult(){return this._lastHoverResult.value}set lastHoverResult(e){this._lastHoverResult.value=e}get lastHoverResultChanged(){return this._lastHoverResult.changed}}class gh extends fe{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}function dx(t,i,e){const n=t,o=i,s=(o[0]-n[0]+(o[1]-n[1]))/4,r=[[n[0],0,n[1]],[o[0],0,n[1]],[o[0],0,o[1]],[n[0],0,o[1]],[0,s,0]],l=h.Math.toDegrees,c=r.map(d=>{const p=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...d),new h.Cartesian3),f=h.Cartographic.fromCartesian(p);return[l(f.longitude),l(f.latitude),f.height]});return[[[c[0],c[1],c[2],c[3],c[0]]],c[4]]}class So extends a.Destroyable{constructor(e,n){super();v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_polylines");v(this,"_axis");n&&(this.id=n),this._polylines=this.disposeVar(new $t(e,n)),this._axis=this.disposeVar(new be(e,n)),this._axis.hasArrow=!0,this._axis.width=10,this._polylines.arcType=this._axis.arcType="NONE",this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Te)||!e.actived)return;if(!this.position){console.warn("CzmPlane warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{let r=[],l;if(this.position){const c=Ie({position:this.position,rotation:this.rotation});if(c){const u=dx(this.minSize,this.maxSize,c);r=u[0],l=u[1]}}this.polylines.positions=r,!(!this.position||!l)&&(this.axis.positions=[this.position,l])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}this.dispose(a.track([this.polylines,"color"],[this,"color"])),this.dispose(a.track([this.polylines,"width"],[this,"width"])),this.dispose(a.track([this.polylines,"show"],[this,"show"])),this.dispose(a.track([this.axis,"color"],[this,"color"]));{const o=()=>{this.axis.show=this.show&&this.showArrow};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.showArrowChanged.disposableOn(o))}}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylines(){return this._polylines}get axis(){return this._axis}}v(So,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,showArrow:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),color:a.reactArray([1,1,1,1]),width:2,minSize:a.reactArray([-100,-100]),maxSize:a.reactArray([100,100])})})(So||(So={})),a.extendClassProps(So.prototype,So.createDefaultProps);class px extends a.Destroyable{constructor(e,n,o){super();v(this,"_centerMatrix",this.disposeVar(a.react(void 0)));v(this,"_inverseCenterMatrix",this.disposeVar(a.react(void 0)));v(this,"_czmPlaneWrappers");v(this,"_czmPlaneWrappersChanged",this.disposeVar(a.createNextAnimateFrameEvent()));v(this,"_computedPlanesChanged",this.disposeVar(a.createNextAnimateFrameEvent()));this._czmClippingPlanes=n,this._planeIds=o,this._czmPlaneWrappers=this._planeIds.map(s=>this.disposeVar(new gx(e,this,s)));{const s=()=>{let r,l;const c=this._czmPlaneWrappers.filter(u=>u.position&&u.rotation);if(c.length!==0){const u=c.map(p=>p.position),d=a.getMinMaxCorner(u);r=Ie({position:d.center}),r&&(l=h.Matrix4.inverseTransformation(r,new h.Matrix4))}this.centerMatrix=r,this.inverseCenterMatrix=l};s(),this.dispose(this.czmPlaneWrappersChanged.disposableOn(s))}{const s=()=>{if(!this.centerMatrix){this._czmClippingPlanes.computedClippingPlanes=void 0;return}const l=h.Matrix4.toArray(this.centerMatrix),c=this._czmPlaneWrappers.filter(u=>!!u.computedPlane).map(u=>u.computedPlane);this._czmClippingPlanes.computedClippingPlanes={planes:c,enabled:this._czmClippingPlanes.enabled,modelMatrix:l,unionClippingRegions:this._czmClippingPlanes.unionClippingRegions,edgeColor:this._czmClippingPlanes.edgeColor,edgeWidth:this._czmClippingPlanes.edgeWidth}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._czmClippingPlanes.enabledChanged,this.centerMatrixChanged,this.inverseCenterMatrixChanged,this.computedPlanesChanged,this._czmClippingPlanes.unionClippingRegionsChanged,this._czmClippingPlanes.edgeColorChanged,this._czmClippingPlanes.edgeWidthChanged));this.dispose(r.disposableOn(s))}}get centerMatrix(){return this._centerMatrix.value}set centerMatrix(e){this._centerMatrix.value=e}get centerMatrixChanged(){return this._centerMatrix.changed}get inverseCenterMatrix(){return this._inverseCenterMatrix.value}set inverseCenterMatrix(e){this._inverseCenterMatrix.value=e}get inverseCenterMatrixChanged(){return this._inverseCenterMatrix.changed}get czmPlaneWrappers(){return this._czmPlaneWrappers}get czmPlaneWrappersChanged(){return this._czmPlaneWrappersChanged}get computedPlanesChanged(){return this._computedPlanesChanged}get czmClippingPlanes(){return this._czmClippingPlanes}}class fx extends a.Destroyable{constructor(i,e){super(),this._czmPlaneWrapper=i,this._czmPlane=e,this._czmPlaneWrapper.position=this._czmPlane.position,this.dispose(()=>this._czmPlaneWrapper.position=void 0),this.dispose(a.track([this._czmPlaneWrapper,"position"],[this._czmPlane,"position"])),this._czmPlaneWrapper.rotation=this._czmPlane.rotation,this.dispose(()=>this._czmPlaneWrapper.rotation=[0,0,0]),this.dispose(a.track([this._czmPlaneWrapper,"rotation"],[this._czmPlane,"rotation"]))}}class gx extends a.Destroyable{constructor(e,n,o){super();v(this,"_sowi");v(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_rotation",this.disposeVar(a.reactArray([0,0,0])));v(this,"_computedPlane",this.disposeVar(a.reactJson(void 0)));this._planesResetting=n,this._planeId=o,this._sowi=this.disposeVar(new a.ESSceneObjectWithId),this._sowi.id=this._planeId,this.disposeVar(new a.ObjResettingWithEvent(this.sowi.sceneObjectChanged,()=>{const{sceneObject:s}=this.sowi;if(!s)return;let r;a.registerCreatedEventUpdate(this,s,()=>{const l=e.getEngineObject(s);if(s instanceof a.ESClippingPlane&&(r=l.czmPlane),!!r&&r instanceof So)return new fx(this,r)})})),this.dispose(this.positionChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next())),this.dispose(this.rotationChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next()));{const s=()=>{const{inverseCenterMatrix:l}=this._planesResetting;if(!l)return this.computedPlane=void 0;const{position:c,rotation:u}=this;if(!c)return this.computedPlane=void 0;const d=Ie({position:c,rotation:u});if(!d)return this.computedPlane=void 0;const f=h.Matrix4.multiply(l,d,new h.Matrix4),g=new h.Cartesian3(f[4],f[5],f[6]),m=new h.Cartesian3(f[12],f[13],f[14]);h.Cartesian3.normalize(g,g);let y=-h.Cartesian3.dot(g,m);const _=[g.x,g.y,g.z];this._planesResetting.czmClippingPlanes.reverseNormal&&(a.Vector.negate(_,_),y=-y),this.computedPlane={normal:_,distance:y}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._planesResetting.inverseCenterMatrixChanged,this.positionChanged,this.rotationChanged,this._planesResetting.czmClippingPlanes.reverseNormalChanged));this.dispose(r.disposableOn(s))}this.dispose(this.computedPlaneChanged.disposableOn(()=>this._planesResetting.computedPlanesChanged.next()))}get sowi(){return this._sowi}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get rotation(){return this._rotation.value}set rotation(e){this._rotation.value=e}get rotationChanged(){return this._rotation.changed}get computedPlane(){return this._computedPlane.value}set computedPlane(e){this._computedPlane.value=e}get computedPlaneChanged(){return this._computedPlane.changed}}class Rs extends a.Destroyable{constructor(e,n){super();v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_computedClippingPlanes",this.disposeVar(a.react(void 0)));n&&(this.id=n),this.disposeVar(new a.ObjResettingWithEvent(this.planeIdsChanged,()=>new px(e,this,this.planeIds)))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,planeIds:a.reactArray([]),reverseNormal:!1,unionClippingRegions:!0,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Rs||(Rs={})),a.extendClassProps(Rs.prototype,Rs.createDefaultProps);let mx=class extends a.Destroyable{constructor(i,e){super(),this._czmESClippingPlane=i,this._eS3DTileset=e;const o=[this._czmESClippingPlane.czmPlane.id,...this._eS3DTileset.clippingPlaneIds];this._eS3DTileset.clippingPlaneIds=o,this.dispose(()=>{const s=[...this._eS3DTileset.clippingPlaneIds],r=this._czmESClippingPlane.czmPlane.id;s.includes(r)&&(s.splice(s.indexOf(r),1),this._eS3DTileset.clippingPlaneIds=s)})}},vx=class extends a.Destroyable{constructor(i){if(super(),this._czmESClippingPlane=i,!this._czmESClippingPlane.viewer)return;this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId=this._czmESClippingPlane.czmPlane.id;const e=()=>{if(!this._czmESClippingPlane.viewer)return;const o=Ie({position:this._czmESClippingPlane.sceneObject.position});if(!o)return;const s=em(this._czmESClippingPlane.sceneObject.rotation);this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes={planes:[{normal:s,distance:0}],enabled:!0,modelMatrix:h.Matrix4.toArray(o),unionClippingRegions:!1,edgeColor:this._czmESClippingPlane.sceneObject.edgeColor,edgeWidth:this._czmESClippingPlane.sceneObject.edgetWidth}};e();const n=this.dv(a.createNextAnimateFrameEvent(this._czmESClippingPlane.sceneObject.positionChanged,this._czmESClippingPlane.sceneObject.rotationChanged,this._czmESClippingPlane.sceneObject.edgeColorChanged,this._czmESClippingPlane.sceneObject.edgetWidthChanged));this.d(n.don(e)),this.dispose(()=>{this._czmESClippingPlane.viewer&&(this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId="",this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes=void 0)})}};const Sa=class Sa extends fe{constructor(e,n){super(e,n);v(this,"_innerPositionReact",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_czmPlane");v(this,"_tilesSceneObjectWithId");this._czmPlane=this.disposeVar(new So(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),!n.viewer)return;const r=this._czmPlane;a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmPlane.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(!(!this.sceneObject.show||!this.czmPlane.show))return u===""?new vx(this):!c||!(c instanceof a.ES3DTileset)?void 0:new mx(this,c)}))}),this.dispose(a.track([r,"show"],[e,"show"])),this.dispose(a.bind([r,"position"],[e,"position"])),this.dispose(Ke([r,"rotation"],[e,"rotation"])),this.dispose(a.track([r,"showArrow"],[e,"showArrow"])),this.dispose(a.track([r,"color"],[e,"edgeColor"])),this.dispose(a.track([r,"width"],[e,"edgetWidth"]));{const l=()=>{r.minSize=[-e.width/2,-e.height/2],r.maxSize=[e.width/2,e.height/2]};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.widthChanged,e.heightChanged));this.dispose(c.disposableOn(l))}{const l=()=>{a.Vector.equals(e.position,[0,0,0])?this._innerPositionReact.value=void 0:this._innerPositionReact.value=e.position};l(),this.dispose(this.sceneObject.positionChanged.disposableOn(l))}{const l=()=>{this._innerPositionReact.value==null?e.position=[0,0,0]:e.position=this._innerPositionReact.value};this.dispose(this._innerPositionReact.changed.disposableOn(l))}}get czmPlane(){return this._czmPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?(ei(s,o,n,o.position,Math.max(o.width,o.height),e,!0),!0):!1:!1}};v(Sa,"type",Sa.register("ESCesiumViewer",a.ESClippingPlane.type,Sa));let Bd=Sa;function yx(t){t.toBlob(i=>{if(!i){console.warn("canvas.toBlob error!");return}var e=new ClipboardItem({"image/png":i});navigator.clipboard.write([e]).then(function(){alert("图像已复制到剪切板")}).catch(function(n){console.error("复制到剪切板失败: ",n)})})}const Jh=class Jh extends a.Destroyable{constructor(i,e){super(),this._geoPolygonCanvas=i,this._geoPolygon=e;{const n=(r,l)=>{const{canvas:c,canvasCtx:u,canvasWidth:d}=this._geoPolygonCanvas,{toMercatorPos:p}=Jh,f=p(r),g=p(l),m=g[0]-f[0],y=g[1]-f[1],_=d>8192?8192:d;if(m<=0)return;const P=_*y/m|0;if(P<=0||P>8192)return;const{points:C}=this._geoPolygon;if(!C)throw new Error("!positions");const S=C.map(x=>{const T=p(x);return[(T[0]-f[0])*_/m,P-(T[1]-f[1])*P/y]});c.width=_,c.height=P,u.clearRect(0,0,_,P),u.beginPath();for(const x of S)u.lineTo(x[0],x[1]);u.closePath(),u.fillStyle="#FFFFFF",u.fill()},o=()=>{let r;const{canvas:l,canvasCtx:c,canvasWidth:u}=this._geoPolygonCanvas;c.clearRect(0,0,l.width,l.height);const{points:d}=this._geoPolygon;if(d&&d.length>=3){const p=a.getMinMaxCorner(d),{minPos:f,maxPos:g}=p;n(f,g),r={rect:[f[0],f[1],g[0],g[1]],height:d[0][2]}}this._geoPolygonCanvas.canvasGeoInfo=r,this.ad(a.nextAnimateFrame(()=>{this._geoPolygonCanvas.canvasChanged.emit()}))};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._geoPolygon.pointsChanged,this._geoPolygonCanvas.canvasWidthChanged));this.dispose(s.disposableOn(o))}}};v(Jh,"toMercatorPos",function(i){const[e,n,o]=i;return[e,n/Math.cos(n*Math.PI/180),o]});let Vd=Jh;const Ea=class Ea extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolygonWithId");v(this,"_canvas",document.createElement("canvas"));v(this,"_canvasCtx",this._canvas.getContext("2d"));v(this,"_canvasChanged",this.disposeVar(new a.Event));v(this,"_canvasGeoInfo",this.disposeVar(a.reactJsonWithUndefined(void 0)));this._geoPolygonWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._geoPolygonWithId,"id"],[this,"geoPolygonId"])),this.disposeVar(new a.ObjResettingWithEvent(this.geoPolygonWithId.sceneObjectChanged,()=>{const{sceneObject:o}=this.geoPolygonWithId;if(o&&o instanceof a.ESGeoPolygon)return new Ea.PolygonCanvasResetting(this,o)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygonWithId(){return this._geoPolygonWithId}get canvas(){return this._canvas}get canvasCtx(){return this._canvasCtx}get canvasChanged(){return this._canvasChanged}get canvasGeoInfo(){return this._canvasGeoInfo.value}set canvasGeoInfo(e){this._canvasGeoInfo.value=e}get canvasGeoInfoChanged(){return this._canvasGeoInfo.changed}};v(Ea,"saveCanvasToClipboard",yx),v(Ea,"PolygonCanvasResetting",Vd);let Eo=Ea;(t=>{t.createDefaultProps=()=>({enabled:!0,geoPolygonId:"",canvasWidth:512})})(Eo||(Eo={})),a.extendClassProps(Eo.prototype,Eo.createDefaultProps);function wx(t,i){return class extends a.Destroyable{constructor(o,s){super();v(this,"_customShader",this.disposeVar(new h.CustomShader({uniforms:{u_discardRatio:{value:new h.Cartesian2(0,1),type:h.UniformType.VEC2},u_topColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4},u_bottomColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4}},varyings:{v_xbsjPos:h.VaryingType.VEC3,v_m:h.VaryingType.FLOAT},vertexShaderText:` // IMPORTANT: the function signature must use these parameter names. This
365
+ `;return s=Ad(l),new Worker(s,o)}if(s=t,e||(s=ni(`${et._workerModulePrefix+n}.js`)),!lt.supportsEsmWebWorkers())throw new at("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(s,o)}async function IE(t,i){const e={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!lt.supportsWebAssembly()){if(!A(i.fallbackModulePath))throw new at(`This browser does not support Web Assembly, and no backup module was provided for ${t._workerPath}`);return e.modulePath=ni(i.fallbackModulePath),e}e.wasmBinaryFile=ni(i.wasmBinaryFile);const n=await J.fetchArrayBuffer({url:e.wasmBinaryFile});return e.wasmBinary=n,e}function et(t,i){this._workerPath=t,this._maximumActiveTasks=i??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}const DE=(t,i,e,n)=>{const o=({data:s})=>{if(s.id===i){if(A(s.error)){let r=s.error;r.name==="RuntimeError"?(r=new at(s.error.message),r.stack=s.error.stack):r.name==="DeveloperError"?(r=new W(s.error.message),r.stack=s.error.stack):r.name==="Error"&&(r=new Error(s.error.message),r.stack=s.error.stack),xd.raiseEvent(r),n(r)}else xd.raiseEvent(),e(s.result);t.removeEventListener("message",o)}};return o},RE=[];async function FE(t,i,e){const n=await Promise.resolve(Xv());A(e)?n||(e.length=0):e=RE;const o=t._nextID++,s=new Promise((r,l)=>{t._worker.addEventListener("message",DE(t._worker,o,r,l))});return t._worker.postMessage({id:o,baseUrl:ni.getCesiumBaseUrl().url,parameters:i,canTransferArrayBuffer:n},e),s}async function zE(t,i,e){++t._activeTasks;try{const n=await FE(t,i,e);return--t._activeTasks,n}catch(n){throw--t._activeTasks,n}}et.prototype.scheduleTask=function(t,i){if(A(this._worker)||(this._worker=Td(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return zE(this,t,i)},et.prototype.initWebAssemblyModule=async function(t){if(A(this._webAssemblyPromise))return this._webAssemblyPromise;const i=async()=>{const e=this._worker=Td(this._workerPath),n=await IE(this,t),o=await Promise.resolve(Xv());let s;const r=n.wasmBinary;A(r)&&o&&(s=[r]);const l=new Promise((c,u)=>{e.onmessage=function({data:d}){A(d)?c(d.result):u(new at("Could not configure wasm module"))}});return e.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:n}},s),l};return this._webAssemblyPromise=i(),this._webAssemblyPromise},et.prototype.isDestroyed=function(){return!1},et.prototype.destroy=function(){return A(this._worker)&&this._worker.terminate(),Fb(this)},et.taskCompletedEvent=xd,et._defaultWorkerModulePrefix="Workers/",et._workerModulePrefix=et._defaultWorkerModulePrefix,et._canTransferArrayBuffer=void 0;function ji(){}ji._transcodeTaskProcessor=new et("transcodeKTX2",Number.POSITIVE_INFINITY),ji._readyPromise=void 0;function LE(){const t=ji._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(i){if(i)return ji._transcodeTaskProcessor;throw new at("KTX2 transcoder could not be initialized.")});ji._readyPromise=t}ji.transcode=function(t,i){return b.defined("supportedTargetFormats",i),A(ji._readyPromise)||LE(),ji._readyPromise.then(function(e){let n=t;t instanceof ArrayBuffer&&(n=new Uint8Array(t));const o={supportedTargetFormats:i,ktx2Buffer:n};return e.scheduleTask(o,[n.buffer])}).then(function(e){const n=e.length,o=Object.keys(e[0]);for(let s=0;s<n;s++){const r=e[s];for(let l=0;l<o.length;l++){const c=r[o[l]];r[o[l]]=new As(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(o.length===1){for(let s=0;s<n;++s)e[s]=e[s][o[0]];n===1&&(e=e[0])}return e}).catch(function(e){throw e})};let Yv;Zv.setKTX2SupportedFormats=function(t,i,e,n,o,s){Yv={s3tc:t,pvrtc:i,astc:e,etc:n,etc1:o,bc7:s}};function Zv(t){b.defined("resourceOrUrlOrBuffer",t);let i;return t instanceof ArrayBuffer||ArrayBuffer.isView(t)?i=Promise.resolve(t):i=J.createIfNeeded(t).fetchArrayBuffer(),i.then(function(e){return ji.transcode(e,Yv)})}function Lt(t){this._ellipsoid=t??se.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(Lt.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Lt.mercatorAngleToGeodeticLatitude=function(t){return F.PI_OVER_TWO-2*Math.atan(Math.exp(-t))},Lt.geodeticLatitudeToMercatorAngle=function(t){t>Lt.MaximumLatitude?t=Lt.MaximumLatitude:t<-Lt.MaximumLatitude&&(t=-Lt.MaximumLatitude);const i=Math.sin(t);return .5*Math.log((1+i)/(1-i))},Lt.MaximumLatitude=Lt.mercatorAngleToGeodeticLatitude(Math.PI),Lt.prototype.project=function(t,i){const e=this._semimajorAxis,n=t.longitude*e,o=Lt.geodeticLatitudeToMercatorAngle(t.latitude)*e,s=t.height;return A(i)?(i.x=n,i.y=o,i.z=s,i):new I(n,o,s)},Lt.prototype.unproject=function(t,i){if(!A(t))throw new W("cartesian is required");const e=this._oneOverSemimajorAxis,n=t.x*e,o=Lt.mercatorAngleToGeodeticLatitude(t.y*e),s=t.z;return A(i)?(i.longitude=n,i.latitude=o,i.height=s,i):new ce(n,o,s)};const Qv={};function Hr(t,i){if(!A(t))throw new W("identifier is required.");A(Qv[t])||(Qv[t]=!0,console.warn(i??t))}Hr.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.",Hr.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored",Hr.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored",Hr.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";function kv(t,i){if(!A(t)||!A(i))throw new W("identifier and message are required.");Hr(t,i)}function Ts(){W.throwInstantiationError()}Object.defineProperties(Ts.prototype,{rectangle:{get:W.throwInstantiationError},tileWidth:{get:W.throwInstantiationError},tileHeight:{get:W.throwInstantiationError},maximumLevel:{get:W.throwInstantiationError},minimumLevel:{get:W.throwInstantiationError},tilingScheme:{get:W.throwInstantiationError},tileDiscardPolicy:{get:W.throwInstantiationError},errorEvent:{get:W.throwInstantiationError},credit:{get:W.throwInstantiationError},proxy:{get:W.throwInstantiationError},hasAlphaChannel:{get:W.throwInstantiationError}}),Ts.prototype.getTileCredits=function(t,i,e){W.throwInstantiationError()},Ts.prototype.requestImage=function(t,i,e,n){W.throwInstantiationError()},Ts.prototype.pickFeatures=function(t,i,e,n,o){W.throwInstantiationError()};const OE=/\.ktx2$/i;Ts.loadImage=function(t,i){b.defined("url",i);const e=J.createIfNeeded(i);return OE.test(e.url)?Zv(e):A(t)&&A(t.tileDiscardPolicy)?e.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):e.fetchImage({preferImageBitmap:!0,flipY:!0})};function Kv(t,i){return kv("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"),t??i}Object.defineProperty(Kv,"EMPTY_OBJECT",{get:function(){return kv("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),Ei.EMPTY_OBJECT}});var hh=3.141592653589793*3e3/180,tt=3.141592653589793,uh=6378245,dh=.006693421622965943,Jv=function(n,o){var n=+n,o=+o,s=n-.0065,r=o-.006,l=Math.sqrt(s*s+r*r)-2e-5*Math.sin(r*hh),c=Math.atan2(r,s)-3e-6*Math.cos(s*hh),u=l*Math.cos(c),d=l*Math.sin(c);return[u,d]},jv=function(o,n){var n=+n,o=+o,s=Math.sqrt(o*o+n*n)+2e-5*Math.sin(n*hh),r=Math.atan2(n,o)+3e-6*Math.cos(o*hh),l=s*Math.cos(r)+.0065,c=s*Math.sin(r)+.006;return[l,c]},Md=function(o,n){var n=+n,o=+o;if(iy(o,n))return[o,n];var s=ey(o-105,n-35),r=ty(o-105,n-35),l=n/180*tt,c=Math.sin(l);c=1-dh*c*c;var u=Math.sqrt(c);s=s*180/(uh*(1-dh)/(c*u)*tt),r=r*180/(uh/u*Math.cos(l)*tt);var d=n+s,p=o+r;return[p,d]},Id=function(o,n){var n=+n,o=+o;if(iy(o,n))return[o,n];var s=ey(o-105,n-35),r=ty(o-105,n-35),l=n/180*tt,c=Math.sin(l);c=1-dh*c*c;var u=Math.sqrt(c);s=s*180/(uh*(1-dh)/(c*u)*tt),r=r*180/(uh/u*Math.cos(l)*tt);var d=n+s,p=o+r;return[o*2-p,n*2-d]},ey=function(o,n){var n=+n,o=+o,s=-100+2*o+3*n+.2*n*n+.1*o*n+.2*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*tt)+20*Math.sin(2*o*tt))*2/3,s+=(20*Math.sin(n*tt)+40*Math.sin(n/3*tt))*2/3,s+=(160*Math.sin(n/12*tt)+320*Math.sin(n*tt/30))*2/3,s},ty=function(o,n){var n=+n,o=+o,s=300+o+2*n+.1*o*o+.1*o*n+.1*Math.sqrt(Math.abs(o));return s+=(20*Math.sin(6*o*tt)+20*Math.sin(2*o*tt))*2/3,s+=(20*Math.sin(o*tt)+40*Math.sin(o/3*tt))*2/3,s+=(150*Math.sin(o/12*tt)+300*Math.sin(o/30*tt))*2/3,s},iy=function(o,n){var n=+n,o=+o;return!(o>73.66&&o<135.05&&n>3.86&&n<53.55)};function Dd(t,i){this.x=t||0,this.y=i||0,this.x=this.x,this.y=this.y}Dd.prototype.equals=function(t){return t&&t.x==this.x&&t.y==this.y};function mi(t,i){isNaN(t)&&(t=decode64(t),t=isNaN(t)?0:t),typeof t=="string"&&(t=parseFloat(t)),isNaN(i)&&(i=decode64(i),i=isNaN(i)?0:i),typeof t=="lat"&&(i=parseFloat(i)),this.lng=t,this.lat=i}mi.isInRange=function(t){return t&&t.lng<=180&&t.lng>=-180&&t.lat<=74&&t.lat>=-74},mi.prototype.equals=function(t){return t&&this.lat==t.lat&&this.lng==t.lng};function Re(){}Re.EARTHRADIUS=637099681e-2,Re.MCBAND=[1289059486e-2,836237787e-2,5591021,348198983e-2,167804312e-2,0],Re.LLBAND=[75,60,45,30,15,0],Re.MC2LL=[[1410526172116255e-23,898305509648872e-20,-1.9939833816331,200.9824383106796,-187.2403703815547,91.6087516669843,-23.38765649603339,2.57121317296198,-.03801003308653,173379812e-1],[-7435856389565537e-24,8983055097726239e-21,-.78625201886289,96.32687599759846,-1.85204757529826,-59.36935905485877,47.40033549296737,-16.50741931063887,2.28786674699375,1026014486e-2],[-3030883460898826e-23,898305509983578e-20,.30071316287616,59.74293618442277,7.357984074871,-25.38371002664745,13.45380521110908,-3.29883767235584,.32710905363475,685681737e-2],[-1981981304930552e-23,8983055099779535e-21,.03278182852591,40.31678527705744,.65659298677277,-4.44255534477492,.85341911805263,.12923347998204,-.04625736007561,448277706e-2],[309191371068437e-23,8983055096812155e-21,6995724062e-14,23.10934304144901,-.00023663490511,-.6321817810242,-.00663494467273,.03430082397953,-.00466043876332,25551644e-1],[2890871144776878e-24,8983055095805407e-21,-3068298e-14,7.47137025468032,-353937994e-14,-.02145144861037,-1234426596e-14,.00010322952773,-323890364e-14,826088.5]],Re.LL2MC=[[-.0015702102444,111320.7020616939,0x60e374c3105a3,-0x24bb4115e2e164,0x5cc55543bb0ae8,-0x7ce070193f3784,0x5e7ca61ddf8150,-0x261a578d8b24d0,0x665d60f3742ca,82.5],[.0008277824516172526,111320.7020463578,6477955746671607e-7,-4082003173641316e-6,1077490566351142e-5,-1517187553151559e-5,1205306533862167e-5,-5124939663577472e-6,9133119359512032e-7,67.5],[.00337398766765,111320.7020202162,4481351045890365e-9,-2339375119931662e-8,7968221547186455e-8,-1159649932797253e-7,9723671115602145e-8,-4366194633752821e-8,8477230501135234e-9,52.5],[.00220636496208,111320.7020209128,51751.86112841131,3796837749470245e-9,992013.7397791013,-122195221711287e-8,1340652697009075e-9,-620943.6990984312,144416.9293806241,37.5],[-.0003441963504368392,111320.7020576856,278.2353980772752,2485758690035394e-9,6070.750963243378,54821.18345352118,9540.606633304236,-2710.55326746645,1405.483844121726,22.5],[-.0003218135878613132,111320.7020701615,.00369383431289,823725.6402795718,.46104986909093,2351.343141331292,1.58060784298199,8.77738589078284,.37238884252424,7.45]],Re.getDistanceByMC=function(t,i){if(!t||!i)return 0;var e,n,o,s;return t=this.convertMC2LL(t),!t||(e=this.toRadians(t.lng),n=this.toRadians(t.lat),i=this.convertMC2LL(i),!i)?0:(o=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,o,n,s))},Re.getDistanceByLL=function(t,i){if(!t||!i)return 0;t.lng=this.getLoop(t.lng,-180,180),t.lat=this.getRange(t.lat,-74,74),i.lng=this.getLoop(i.lng,-180,180),i.lat=this.getRange(i.lat,-74,74);var e,n,o,s;return e=this.toRadians(t.lng),o=this.toRadians(t.lat),n=this.toRadians(i.lng),s=this.toRadians(i.lat),this.getDistance(e,n,o,s)},Re.convertMC2LL=function(s){var i,e;i=new mi(Math.abs(s.lng),Math.abs(s.lat));for(var n=0;n<this.MCBAND.length;n++)if(i.lat>=this.MCBAND[n]){e=this.MC2LL[n];break}var o=this.convertor(s,e),s=new mi(o.lng.toFixed(6),o.lat.toFixed(6));return s},Re.convertLL2MC=function(s){var i,e;s.lng=this.getLoop(s.lng,-180,180),s.lat=this.getRange(s.lat,-74,74),i=new mi(s.lng,s.lat);for(var n=0;n<this.LLBAND.length;n++)if(i.lat>=this.LLBAND[n]){e=this.LL2MC[n];break}if(!e){for(var n=this.LLBAND.length-1;n>=0;n--)if(i.lat<=-this.LLBAND[n]){e=this.LL2MC[n];break}}var o=this.convertor(s,e),s=new mi(o.lng.toFixed(2),o.lat.toFixed(2));return s},Re.convertor=function(t,i){if(!(!t||!i)){var e=i[0]+i[1]*Math.abs(t.lng),n=Math.abs(t.lat)/i[9],o=i[2]+i[3]*n+i[4]*n*n+i[5]*n*n*n+i[6]*n*n*n*n+i[7]*n*n*n*n*n+i[8]*n*n*n*n*n*n;return e*=t.lng<0?-1:1,o*=t.lat<0?-1:1,new mi(e,o)}},Re.getDistance=function(t,i,e,n){return this.EARTHRADIUS*Math.acos(Math.sin(e)*Math.sin(n)+Math.cos(e)*Math.cos(n)*Math.cos(i-t))},Re.toRadians=function(t){return Math.PI*t/180},Re.toDegrees=function(t){return 180*t/Math.PI},Re.getRange=function(t,i,e){return i!=null&&(t=Math.max(t,i)),e!=null&&(t=Math.min(t,e)),t},Re.getLoop=function(t,i,e){for(;t>e;)t-=e-i;for(;t<i;)t+=e-i;return t},Re.prototype.lngLatToMercator=function(t){return Re.convertLL2MC(t)},Re.prototype.lngLatToPoint=function(t){var i=Re.convertLL2MC(t);return new Dd(i.lng,i.lat)},Re.prototype.mercatorToLngLat=function(t){return Re.convertMC2LL(t)},Re.prototype.PointToLngLat=function(t){var i=new mi(t.x,t.y);return Re.convertMC2LL(i)},Re.prototype.PointToPixel=function(t,i,e,n,o){if(t){t=this.lngLatToMercator(t,o);var s=this.getZoomUnits(i),r=Math.round((t.lng-e.lng)/s+n[Twidth]/2),l=Math.round((e.lat-t.lat)/s+n[Theight]/2);return new Dd(r,l)}},Re.prototype.PixelToPoint=function(t,i,e,n,o){if(t){var s=this.getZoomUnits(i),r=e.lng+s*(t.x-n[Twidth]/2),l=e.lat-s*(t.y-n[Theight]/2),c=new mi(r,l);return this.mercatorToLngLat(c,o)}},Re.prototype.getZoomUnits=function(t){return Math.pow(2,18-t)};function Ln(t){t=t||{},this._ellipsoid=Kv(t.ellipsoid,se.WGS84);var i=!0;A(t.wgs84)&&(i=t.wgs84),this._projection=new Lt(this._ellipsoid);var e=new Re;this._projection.project=function(r){var l={};return i?(l=Md(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l=jv(l[0],l[1])):l=jv(F.toDegrees(r.longitude),F.toDegrees(r.latitude)),l[0]=Math.min(l[0],180),l[0]=Math.max(l[0],-180),l[1]=Math.min(l[1],74.000022),l[1]=Math.max(l[1],-71.988531),l=e.lngLatToPoint(new mi(l[0],l[1])),new j(l.x,l.y)},this._projection.unproject=function(r){var l=e.mercatorToLngLat(new mi(r.x,r.y));return l[0]=(l[0]+180)%360-180,i?(l=Jv(l.lng,l.lat),l=Id(l[0],l[1])):l=Jv(l.lng,l.lat),new ce(F.toRadians(l[0]),F.toRadians(l[1]))},this._rectangleSouthwestInMeters=new j(-2003772637e-2,-1170804166e-2),this._rectangleNortheastInMeters=new j(2003772637e-2,1247410417e-2);var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ie(n.longitude,n.latitude,o.longitude,o.latitude),this.levelWidth=[];for(var s=0;s<19;s++)this.levelWidth[s]=Math.pow(2,18-s)*256}Object.defineProperties(Ln.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}}),Ln.prototype.getNumberOfXTilesAtLevel=function(t){return(1<<t)*.7},Ln.prototype.getNumberOfYTilesAtLevel=function(t){return 1<<t},Ln.prototype.rectangleToNativeRectangle=function(t,i){var e=this._projection,n=e.project(ie.southwest(t)),o=e.project(ie.northeast(t));return A(i)?(i.west=n.x,i.south=n.y,i.east=o.x,i.north=o.y,i):new ie(n.x,n.y,o.x,o.y)},Ln.prototype.tileXYToNativeRectangle=function(t,i,e,n){var o=this.levelWidth[e],s=t*o,r=(t+1)*o;i=-i;var l=(i+1)*o,c=i*o;return A(n)?(n.west=s,n.south=c,n.east=r,n.north=l,n):new ie(s,c,r,l)},Ln.prototype.tileXYToRectangle=function(t,i,e,n){var o=this.tileXYToNativeRectangle(t,i,e,n),s=this._projection,r=s.unproject(new j(o.west,o.south)),l=s.unproject(new j(o.east,o.north));return o.west=r.longitude,o.south=r.latitude,o.east=l.longitude,o.north=l.latitude,o},Ln.prototype.positionToTileXY=function(t,i,e){var n=this._rectangle;if(ie.contains(n,t)){var o=this._projection,s=o.project(t);if(A(s)){var r=this.levelWidth[i],l=Math.floor(s.x/r),c=-Math.floor(s.y/r);return A(e)?(e.x=l,e.y=c,e):new j(l,c)}}};function ph(t){this._url=t.url||"http://online2.map.bdimg.com/onlinelabel/?qt=tile&styles=pl&x={x}&y={y}&z={z}",this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._tilingScheme=new Ln(t),this._credit=void 0,this._rectangle=this._tilingScheme.rectangle,this._ready=!0}function NE(t,i,e,n){var o=t._url;return o=o.replace("{x}",i).replace("{y}",-e).replace("{z}",n),o}Object.defineProperties(ph.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},proxy:{get:function(){return this._proxy}},tileWidth:{get:function(){if(!this._ready)throw new DeveloperError("tileWidth must not be called before the imagery provider is ready.");return this._tileWidth}},tileHeight:{get:function(){if(!this._ready)throw new DeveloperError("tileHeight must not be called before the imagery provider is ready.");return this._tileHeight}},maximumLevel:{get:function(){if(!this._ready)throw new DeveloperError("maximumLevel must not be called before the imagery provider is ready.");return this._maximumLevel}},minimumLevel:{get:function(){if(!this._ready)throw new DeveloperError("minimumLevel must not be called before the imagery provider is ready.");return 3}},tilingScheme:{get:function(){if(!this._ready)throw new DeveloperError("tilingScheme must not be called before the imagery provider is ready.");return this._tilingScheme}},rectangle:{get:function(){if(!this._ready)throw new DeveloperError("rectangle must not be called before the imagery provider is ready.");return this._rectangle}},tileDiscardPolicy:{get:function(){if(!this._ready)throw new DeveloperError("tileDiscardPolicy must not be called before the imagery provider is ready.");return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},ready:{get:function(){return this._ready}},readyPromise:{get:function(){return this._readyPromise.promise}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}}),ph.prototype.getTileCredits=function(t,i,e){},ph.prototype.requestImage=function(t,i,e){if(!this._ready)throw new DeveloperError("requestImage must not be called before the imagery provider is ready.");var n=NE(this,t,i,e);return Ts.loadImage(this,n)};class BE extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTime",0);e.url="https://tileser.giiiis.com/timetile/",e.minimumLevel=1,e.maximumLevel=18,e.tilingScheme=new h.GeographicTilingScheme,this.indexTime=e.indexTime||0}get indexTime(){return this._indexTime}set indexTime(e){this._indexTime=e}async requestImage(e,n,o,s){try{let r=this.buildImageUrl(this.indexTime,e,n,o);return h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://tileser.giiiis.com/timetile/${e}/${s}/${n}/${o}.jpg`}}class VE extends h.UrlTemplateImageryProvider{constructor(e){super(e);v(this,"_indexTimeID",0);e.url="https://wayback.maptiles.arcgis.com/",e.minimumLevel=1,e.maximumLevel=18,this.indexTimeID=e.indexTimeID||0}get indexTimeID(){return this._indexTimeID}set indexTimeID(e){this._indexTimeID=e}async requestImage(e,n,o,s){try{let r;return this.indexTimeID!==0?r=this.buildImageUrl(this.indexTimeID,e,n,o):r=`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${o}/${n}/${e}`,h.ImageryProvider.loadImage(this,r)}catch{return}}buildImageUrl(e,n,o,s){return`https://wayback.maptiles.arcgis.com/arcgis/rest/services/World_Imagery/WMTS/1.0.0/default028mm/MapServer/tile/${e}/${s}/${o}/${n}`}}const UE=document.createElement("canvas");class Rd{constructor(i){v(this,"mapboxRenderer");v(this,"ready");v(this,"readyPromise");v(this,"rectangle");v(this,"tileSize");v(this,"tileWidth");v(this,"tileHeight");v(this,"maximumLevel");v(this,"minimumLevel");v(this,"tileDiscardPolicy");v(this,"credit");v(this,"proxy");v(this,"layerStyle");v(this,"hasAlphaChannel");v(this,"sourceFilter");v(this,"tilingScheme");v(this,"_destroyed",!1);v(this,"_error");v(this,"_style");v(this,"_accessToken");v(this,"_enablePickFeatures");this.ready=!1,this.tilingScheme=i.tilingScheme??new ye.WebMercatorTilingScheme,this.rectangle=i.rectangle??this.tilingScheme.rectangle,this.rectangle=ye.Rectangle.intersection(this.rectangle,this.tilingScheme.rectangle),this.tileSize=this.tileWidth=this.tileHeight=i.tileSize||256,this.maximumLevel=i.maximumLevel??18,this.minimumLevel=i.minimumLevel??0,this.tileDiscardPolicy=void 0,this._error=new ye.Event,this.credit=new ye.Credit(i.credit||"",!1),this.proxy=new ye.DefaultProxy(""),this.hasAlphaChannel=i.hasAlphaChannel??!0,this.sourceFilter=i.sourceFilter,this._accessToken=i.accessToken,this._enablePickFeatures=i.enablePickFeatures??!0,this.layerStyle=i.layerStyle??[],ye.defined(i.style)&&(this.readyPromise=this._build(i.style,i).then(()=>!0))}get style(){return this._style}get isDestroyed(){return this._destroyed}get errorEvent(){return this._error}async _build(i,e={}){const n=await this._preLoad(i,e.scheme??"tms");n.layers=this.layerStyle.length!=0?this.layerStyle:n.layers,this._style=n,this.mapboxRenderer=new g_.BasicRenderer({style:n,canvas:UE,token:e.accessToken,transformRequest:e.transformRequest}),e.showCanvas&&this.mapboxRenderer.showCanvasForDebug(),await this.mapboxRenderer._style.loadedPromise,this.readyPromise=Promise.resolve(!0),this.ready=!0}static async fromUrl(i,e={}){const n=new Rd(e);return await n._build(i,e),n}_preLoad(i,e){let n=i;if(typeof i=="string"&&(i.endsWith(".json")||i.startsWith("mapbox://")?i=new ye.Resource({url:i}):(i={version:8,sources:{customSource:{type:"vector",scheme:e,tiles:[i]}},layers:this.layerStyle},n=i)),i instanceof ye.Resource){const o="https://api.mapbox.com/";i.url.startsWith("mapbox://")&&(i.url=i.url.replace("mapbox://",o)),this._accessToken&&i.appendQueryParameters({access_token:this._accessToken}),n=i.fetchJson()}return Promise.resolve(n).catch(o=>{throw this._error.raiseEvent(o),o})}_createTile(){const i=document.createElement("canvas");return i.width=this.tileSize,i.height=this.tileSize,i.style.imageRendering="pixelated",i}_resetTileCache(){Object.values(this.mapboxRenderer._style.sourceCaches).forEach(i=>i._tileCache.reset())}_getTilesSpec(i,e){const{x:n,y:o,level:s}=i,r=this.tileSize,l=[],c=this.tilingScheme.getNumberOfXTilesAtLevel(s)-1,u=this.tilingScheme.getNumberOfYTilesAtLevel(s)-1;for(let d=-1;d<=1;d++){let p=n+d;p<0&&(p=c),p>c&&(p=0);for(let f=-1;f<=1;f++){let g=o+f;g<0||g>u||l.push({source:e,z:s,x:p,y:g,left:0+d*r,top:0+f*r,size:r})}}return l}requestImage(i,e,n,o=!0){if(n<this.minimumLevel||n>this.maximumLevel)return;this.mapboxRenderer.filterForZoom(n);const s=this.mapboxRenderer.getVisibleSources(n).reduce((r,l)=>r.concat(this._getTilesSpec({x:i,y:e,level:n},l)),[]);return new Promise((r,l)=>{const c=this._createTile(),u=c.getContext("2d");u&&(u.globalCompositeOperation="copy");const d=this.mapboxRenderer.renderTiles(u,{srcLeft:0,srcTop:0,width:this.tileSize,height:this.tileSize,destLeft:0,destTop:0},s,p=>{typeof p=="string"&&!p.endsWith("tiles not available")?l(void 0):o?(d.consumer.ctx=null,r(c),this.mapboxRenderer.releaseRender(d),this._resetTileCache()):r(d)})})}pickFeatures(i,e,n,o,s){var r;if(this._enablePickFeatures)return(r=this.requestImage(i,e,n,!1))==null?void 0:r.then(l=>{let c=this.mapboxRenderer.getVisibleSources(n);c=this.sourceFilter?this.sourceFilter(c):c;const u=[],d=ye.Math.toDegrees(o),p=ye.Math.toDegrees(s);return c.forEach(f=>{const g=new ye.ImageryLayerFeatureInfo;g.data=this.mapboxRenderer.queryRenderedFeatures({source:f,renderedZoom:n,lng:d,lat:p,tileZ:n});const m=Object.keys(g.data)[0];g.name=m;const y=g.data[m];y&&(g.configureDescriptionFromProperties((y==null?void 0:y.length)===1?y[0]:y),u.push(g))}),l.consumer.ctx=void 0,this.mapboxRenderer.releaseRender(l),this._resetTileCache(),u.length?u:void 0})}destroy(){this.mapboxRenderer._cancelAllPendingRenders(),this._resetTileCache(),this._destroyed=!0}}function WE(t,i){let e;return i===0?e=h.JulianDate.toIso8601(t.stop):e=h.JulianDate.toIso8601(t.start),{Time:e}}function ny(t){if(t.type==="fromIso8601")return h.TimeIntervalCollection.fromIso8601({iso8601:t.iso8601,isStartIncluded:t.isStartIncluded,isStopIncluded:t.isStopIncluded,leadingInterval:t.leadingInterval,trailingInterval:t.trailingInterval,dataCallback:WE})}const{getStrFromEnv:fh}=a.ESSceneObject.context;function GE(t){const i=Object.entries(t).map(([e,n])=>{try{const o=n&&Function(`"use strict";return (${n})`)();return[e,o]}catch(o){console.error(`getCustomTagsFromJson error: ${o}`,o);return}}).filter(e=>!!e);return Object.fromEntries(i)}async function HE(t,i){var e,n;if(t.type==="WebMapTileServiceImageryProvider")return new h.WebMapTileServiceImageryProvider({url:Ht(t.url),format:t.format??"image/jpeg",layer:t.layer,style:t.style,tileMatrixSetID:t.tileMatrixSetID,tileMatrixLabels:t.tileMatrixLabels,clock:t.times&&((e=i.viewer)==null?void 0:e.clock),times:t.times&&ny(t.times),dimensions:t.dimensions,tileWidth:t.tileWidth??256,tileHeight:t.tileHeight??256,tilingScheme:t.tilingScheme&&wi(t.tilingScheme),rectangle:t.rectangle&&Ne(t.rectangle),minimumLevel:t.minimumLevel??0,maximumLevel:t.maximumLevel,ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit,subdomains:t.subdomains});if(t.type==="TileMapServiceImageryProvider")return t.url?await h.TileMapServiceImageryProvider.fromUrl(Ht(t.url),{fileExtension:t.fileExtension,credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,flipXY:t.flipXY}):void 0;if(t.type==="UrlTemplateImageryProvider"){const o=t.customTags&&GE(t.customTags);return console.log(Ht(t.url),"111"),new h.UrlTemplateImageryProvider({url:Ht(t.url),credit:t.credit,minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,subdomains:t.subdomains,hasAlphaChannel:t.hasAlphaChannel,pickFeaturesUrl:t.pickFeaturesUrl,enablePickFeatures:t.enablePickFeatures,urlSchemeZeroPadding:t.urlSchemeZeroPadding,customTags:o})}else{if(t.type==="GridImageryProvider")return new h.GridImageryProvider({tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),tileWidth:t.tileWidth,tileHeight:t.tileHeight,cells:t.cells,color:t.color&&te(t.color),glowColor:t.glowColor&&te(t.glowColor),backgroundColor:t.backgroundColor&&te(t.backgroundColor),canvasSize:t.canvasSize,glowWidth:t.glowWidth});if(t.type==="ArcGisMapServerImageryProvider")return t.url?await h.ArcGisMapServerImageryProvider.fromUrl(Ht(t.url),{token:t.token,usePreCachedTilesIfAvailable:t.usePreCachedTilesIfAvailable,layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit,tileWidth:t.tileWidth,tileHeight:t.tileHeight,maximumLevel:t.maximumLevel}):void 0;if(t.type==="BingMapsImageryProvider")return t.url?await h.BingMapsImageryProvider.fromUrl(Ht(t.url),{key:t.key,tileProtocol:t.tileProtocol,mapStyle:t.mapStyle&&h.BingMapsStyle[t.mapStyle],culture:t.culture,ellipsoid:t.ellipsoid&&we(t.ellipsoid)}):void 0;if(t.type==="GoogleEarthEnterpriseImageryProvider"){if(!t.url)return;const o=await h.GoogleEarthEnterpriseMetadata.fromUrl(Ht(t.url));return await h.GoogleEarthEnterpriseImageryProvider.fromMetadata(o,{ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit})}else{if(t.type==="IonImageryProvider")return await h.IonImageryProvider.fromAssetId(t.assetId,{accessToken:t.accessToken,server:t.server});if(t.type==="MapboxImageryProvider")return new h.MapboxImageryProvider({url:t.url&&fh(t.url),mapId:t.mapId,accessToken:t.accessToken,format:t.format,ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit});if(t.type==="MapboxStyleImageryProvider")return new h.MapboxStyleImageryProvider({url:t.url&&fh(t.url),username:t.username,styleId:t.styleId,accessToken:t.accessToken,tilesize:t.tilesize,scaleFactor:t.scaleFactor,rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel});if(t.type==="OpenStreetMapImageryProvider")return new h.OpenStreetMapImageryProvider({url:fh(t.url),rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,fileExtension:t.fileExtension});if(t.type==="SingleTileImageryProvider")return new h.SingleTileImageryProvider({url:Ht(t.url),rectangle:t.rectangle&&Ne(t.rectangle),credit:t.credit,ellipsoid:t.ellipsoid&&we(t.ellipsoid)});if(t.type==="TileCoordinatesImageryProvider")return new h.TileCoordinatesImageryProvider({tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),color:t.color&&te(t.color),tileWidth:t.tileWidth,tileHeight:t.tileHeight});if(t.type==="WebMapServiceImageryProvider")return new h.WebMapServiceImageryProvider({url:Ht(t.url),layers:t.layers,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ne(t.rectangle),tilingScheme:t.tilingScheme&&wi(t.tilingScheme),ellipsoid:t.ellipsoid&&we(t.ellipsoid),minimumLevel:t.minimumLevel,maximumLevel:t.maximumLevel,tileWidth:t.tileWidth,tileHeight:t.tileHeight,crs:t.crs,srs:t.srs,credit:t.credit,subdomains:t.subdomains,clock:t.times&&((n=i.viewer)==null?void 0:n.clock),times:t.times&&ny(t.times),parameters:t.parameters,getFeatureInfoParameters:t.getFeatureInfoParameters});if(t.type==="BDImageryProvider")return new ph({url:t.url&&fh(t.url),ellipsoid:t.ellipsoid&&we(t.ellipsoid),wgs84:t.wgs84});if(t.type==="GeHistoryImagery")return new BE({indexTime:t.indexTime});if(t.type==="ArcgisHistoryImagery")return new VE({indexTimeID:t.indexTimeID});if(t.type==="MVTImageryProvider")return t.url?await Rd.fromUrl(t.url,{maximumLevel:t.maximumLevel,minimumLevel:t.minimumLevel,tileSize:t.tileSize,accessToken:t.accessToken,enablePickFeatures:t.enablePickFeatures,rectangle:t.rectangle&&Ne(t.rectangle),layerStyle:t.style,scheme:t.scheme}):void 0}}}function $E(t,i){i.type}class oy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(s){var r={};return r=Id(h.Math.toDegrees(s.longitude),h.Math.toDegrees(s.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(r[0]),h.Math.toRadians(r[1])))},e.s_unproject=e.unproject,e.unproject=function(s){var r=e.s_unproject(s),l={};return l=Md(h.Math.toDegrees(r.longitude),h.Math.toDegrees(r.latitude)),new h.Cartographic(h.Math.toRadians(l[0]),h.Math.toRadians(l[1]))};var n=this._projection.unproject(this._rectangleSouthwestInMeters),o=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new h.Rectangle(n.longitude,n.latitude,o.longitude,o.latitude)}}class sy extends h.WebMercatorTilingScheme{constructor(i){super(i);var e=this._projection;e.s_project=e.project,e.project=function(n){var o={};return o=Md(h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude)),e.s_project(new h.Cartographic(h.Math.toRadians(o[0]),h.Math.toRadians(o[1])))},e.s_unproject=e.unproject,e.unproject=function(n){var o=e.s_unproject(n),s={};return s=Id(h.Math.toDegrees(o.longitude),h.Math.toDegrees(o.latitude)),new h.Cartographic(h.Math.toRadians(s[0]),h.Math.toRadians(s[1]))}}}function qE(t){if(t.type==="GeographicTilingScheme")return"new Cesium.GeographicTilingScheme()";if(t.type==="WebMercatorTilingScheme")return"new Cesium.WebMercatorTilingScheme()"}class On extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_innerImageryProvider",this.disposeVar(a.react(void 0)));v(this,"_layer",this.disposeVar(a.react(void 0)));const o=e.viewer;if(!o)return;const s=kt(o);if(!s)return;const{imageriesManager:r}=s;r.add(this),this.dispose(()=>{r.has(this)&&r.delete(this)});const l=()=>{this.layer&&(this.layer=void 0)};this.dispose(l);const c=()=>{this.layer&&(this.layer.alpha=this.alpha??1,this.layer.nightAlpha=this.nightAlpha??1,this.layer.dayAlpha=this.dayAlpha??1,this.layer.brightness=this.brightness??1,this.layer.contrast=this.contrast??1,this.layer.hue=this.hue??0,this.layer.saturation=this.saturation??1,this.layer.gamma=this.gamma??1,this.layer.splitDirection=this.splitDirection&&h.SplitDirection[this.splitDirection]||h.SplitDirection.NONE,this.layer.minificationFilter=this.minificationFilter&&h.TextureMinificationFilter[this.minificationFilter]||h.TextureMinificationFilter.LINEAR,this.layer.magnificationFilter=this.magnificationFilter&&h.TextureMagnificationFilter[this.magnificationFilter]||h.TextureMagnificationFilter.LINEAR,this.layer.show=this.show??!0,this.layer.maximumAnisotropy=this.maximumAnisotropy,this.layer.minimumTerrainLevel=this.minimumTerrainLevel,this.layer.maximumTerrainLevel=this.maximumTerrainLevel,this.layer.colorToAlpha=this.colorToAlpha&&toColor(this.colorToAlpha),this.layer.colorToAlphaThreshold=this.colorToAlphaThreshold??.004,this.imageryProvider&&$E(this.layer.imageryProvider,this.imageryProvider))};let u=!1;const d=this.disposeVar(a.createProcessingFromAsyncFunc(async(y,_)=>{if(_){if(u=!0,l(),!this.innerImageryProvider)return;const P=await y.promise(HE(this.innerImageryProvider,e));if(!P){console.error("createImageryProviderFromJson error!");return}this.layer=new h.ImageryLayer(P),h.ImageryLayer.prototype&&(this.layer.ESSceneObjectID=n),u=!1}c()}));d.restart(void 0,!0);const p=this.disposeVar(new a.Event),f=this.disposeVar(new a.Event);this.ad(this.layerChanged.don(()=>{if(!this.innerImageryProvider||!this.layer||!Reflect.has(this.innerImageryProvider,"rectangle")||this.innerImageryProvider.rectangle[0]!=this.imageryProvider.rectangle[0]||this.innerImageryProvider.rectangle[1]!=this.imageryProvider.rectangle[1]||this.innerImageryProvider.rectangle[2]!=this.imageryProvider.rectangle[2]||this.innerImageryProvider.rectangle[3]!=this.imageryProvider.rectangle[3])return;const y=this.layer.imageryProvider.tilingScheme.rectangle,_=this.innerImageryProvider.rectangle&&Ne(this.innerImageryProvider.rectangle);(_.west<y.west||_.south<y.south||_.east>y.east||_.north>y.north)&&(this.innerImageryProvider.rectangle=[h.Math.toDegrees(Math.max(y.west,parseFloat(_.west.toFixed(7)))),h.Math.toDegrees(Math.max(y.south,parseFloat(_.south.toFixed(7)))),h.Math.toDegrees(Math.min(y.east,parseFloat(_.east.toFixed(7)))),h.Math.toDegrees(Math.min(y.north,parseFloat(_.north.toFixed(7))))],p.emit())})),this.dispose(this.imageryProviderChanged.disposableOn(()=>{this.innerImageryProvider=structuredClone(this.imageryProvider),p.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{p.emit()}));const g=this.disposeVar(a.createNextAnimateFrameEvent(this.rectangleChanged,p));this.dispose(g.disposableOn(()=>{d.restart(void 0,!0)}));const m=this.disposeVar(a.createNextAnimateFrameEvent(this.alphaChanged,this.nightAlphaChanged,this.dayAlphaChanged,this.brightnessChanged,this.contrastChanged,this.hueChanged,this.saturationChanged,this.gammaChanged,this.splitDirectionChanged,this.minificationFilterChanged,this.magnificationFilterChanged,this.showChanged,this.maximumAnisotropyChanged,this.minimumTerrainLevelChanged,this.maximumTerrainLevelChanged,this.cutoutRectangleChanged,this.colorToAlphaChanged,this.colorToAlphaThresholdChanged,f));this.dispose(m.disposableOn(()=>{u||d.restart(void 0,!1)})),this.dispose(this.flyToEvent.disposableOn(y=>{if(!e.actived)return;const{viewer:_}=e;_&&_.camera.flyTo({destination:this.rectangle&&!bu(this.rectangle)?Ne(this.rectangle):h.Camera.DEFAULT_VIEW_RECTANGLE,duration:y})}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get innerImageryProvider(){return this._innerImageryProvider.value}set innerImageryProvider(e){this._innerImageryProvider.value=e}get innerImageryProviderChanged(){return this._innerImageryProvider.changed}get layer(){return this._layer.value}set layer(e){this._layer.value=e}get layerChanged(){return this._layer.changed}}v(On,"defaults",{show:!0,rectangle:[-180,-90,180,90],alpha:1,nightAlpha:1,dayAlpha:1,brightness:1,contrast:1,hue:0,saturation:1,gamma:1,splitDirection:"NONE",minificationFilter:"LINEAR",magnificationFilter:"LINEAR",maximumAnisotropy:0,minimumTerrainLevel:0,maximumTerrainLevel:0,cutoutRectangle:[1,1,1,1],colorToAlpha:[1,1,1,.5],colorToAlphaThreshold:.004,imageryProvider:{type:"TileMapServiceImageryProvider"},zIndex:0,hasAlphaChannel:!0,pickFeaturesUrl:""}),(t=>{t.createDefaultProps=()=>({show:void 0,rectangle:a.reactArrayWithUndefined(void 0),alpha:void 0,nightAlpha:void 0,dayAlpha:void 0,brightness:void 0,contrast:void 0,hue:void 0,saturation:void 0,gamma:void 0,splitDirection:void 0,minificationFilter:void 0,magnificationFilter:void 0,maximumAnisotropy:void 0,minimumTerrainLevel:void 0,maximumTerrainLevel:void 0,cutoutRectangle:a.reactArrayWithUndefined(void 0),colorToAlpha:a.reactArrayWithUndefined(void 0),colorToAlphaThreshold:void 0,imageryProvider:a.reactJsonWithUndefined(void 0),zIndex:0,hasAlphaChannel:void 0,pickFeaturesUrl:void 0,targetID:void 0})})(On||(On={})),a.extendClassProps(On.prototype,On.createDefaultProps);const Fd=h.ApproximateTerrainHeights,XE=h.ComponentDatatype,Mi=h.defaultValue,ct=h.defined,YE=h.destroyObject,zd=h.DeveloperError,ZE=h.deprecationWarning,QE=h.GeometryInstance,kE=h.GeometryInstanceAttribute,KE=h.GroundPolylineGeometry,$r=h.DrawCommand,ry=h.Pass,ay=h.RenderState,JE=h.ShaderProgram,qr=h.ShaderSource;let Ld=h._shadersPolylineShadowVolumeFS;const jE=h._shadersPolylineShadowVolumeMorphFS,ex=h._shadersPolylineShadowVolumeMorphVS;let Od=h._shadersPolylineShadowVolumeVS;const ly=h.BlendingState,Nd=h.ClassificationType,tx=h.CullFace,cy=h.PolylineColorAppearance,ix=h.PolylineMaterialAppearance,Nn=h.Primitive,Ms=h.SceneMode,hy=h.StencilConstants,uy=h.StencilFunction,Is=h.StencilOperation;Od=Od.replace("width = width * max(0.0, czm_metersPerPixel(positionEC));",""),Ld=Ld.replace("float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);","float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w;");function Ii(t){t=Mi(t,Mi.EMPTY_OBJECT),this.geometryInstances=t.geometryInstances,this._hasPerInstanceColors=!0;let i=t.appearance;ct(i)||(i=new ix),this.appearance=i,this.show=Mi(t.show,!0),this.classificationType=Mi(t.classificationType,Nd.BOTH),this.debugShowBoundingVolume=Mi(t.debugShowBoundingVolume,!1),this._debugShowShadowVolume=Mi(t.debugShowShadowVolume,!1),this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:Mi(t.interleave,!1),releaseGeometryInstances:Mi(t.releaseGeometryInstances,!0),allowPicking:Mi(t.allowPicking,!0),asynchronous:Mi(t.asynchronous,!0),compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1;const e=this;this._readyPromise=new Promise((n,o)=>{e._completeLoad=()=>{this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0);const s=this._error;ct(s)?o(s):n(this)}}),this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=dy(!1),this._renderState3DTiles=dy(!0),this._renderStateMorph=ay.fromCache({cull:{enabled:!0,face:tx.FRONT},depthTest:{enabled:!0},blending:ly.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Ii.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}},readyPromise:{get:function(){return ZE("GroundPolylinePrimitive.readyPromise","GroundPolylinePrimitive.readyPromise was deprecated in CesiumJS 1.104. It will be removed in 1.107. Wait for GroundPolylinePrimitive.ready to return true instead."),this._readyPromise}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}}),Ii.initializeTerrainHeights=function(){return Fd.initialize()};function nx(t,i,e){const n=i.context,o=t._primitive,s=o._attributeLocations;let r=o._batchTable.getVertexShaderCallback()(Od);r=Nn._appendShowToShader(o,r),r=Nn._appendDistanceDisplayConditionToShader(o,r),r=Nn._modifyShaderPosition(t,r,i.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(ex);l=Nn._appendShowToShader(o,l),l=Nn._appendDistanceDisplayConditionToShader(o,l),l=Nn._modifyShaderPosition(t,l,i.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(Ld);const u=[`GLOBE_MINIMUM_ALTITUDE ${i.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`];let d="",p="";ct(e.material)?(p=ct(e.material)?e.material.shaderSource:"",p.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),p.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):d="PER_INSTANCE_COLOR",u.push(d);const f=t.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",d]:[d],g=new qr({defines:u,sources:[r]}),m=new qr({defines:f,sources:[p,c]});t._sp=JE.replaceCache({context:n,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:s});let y=n.shaderCache.getDerivedShaderProgram(t._sp,"2dColor");if(!ct(y)){const P=new qr({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[r]});y=n.shaderCache.createDerivedShaderProgram(t._sp,"2dColor",{context:n,shaderProgram:t._sp2D,vertexShaderSource:P,fragmentShaderSource:m,attributeLocations:s})}t._sp2D=y;let _=n.shaderCache.getDerivedShaderProgram(t._sp,"MorphColor");if(!ct(_)){const P=new qr({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Fd._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[l]});c=o._batchTable.getVertexShaderCallback()(jE);const C=new qr({defines:f,sources:[p,c]});_=n.shaderCache.createDerivedShaderProgram(t._sp,"MorphColor",{context:n,shaderProgram:t._spMorph,vertexShaderSource:P,fragmentShaderSource:C,attributeLocations:s})}t._spMorph=_}function dy(t){return ay.fromCache({cull:{enabled:!0},blending:ly.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:t,frontFunction:uy.EQUAL,frontOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},backFunction:uy.EQUAL,backOperation:{fail:Is.KEEP,zFail:Is.KEEP,zPass:Is.KEEP},reference:hy.CESIUM_3D_TILE_MASK,mask:hy.CESIUM_3D_TILE_MASK}})}function ox(t,i,e,n,o,s){const r=t._primitive,l=r._va.length;o.length=l,s.length=l;const u=i instanceof cy?{}:e._uniforms,d=r._batchTable.getUniformMapCallback()(u);for(let p=0;p<l;p++){const f=r._va[p];let g=o[p];ct(g)||(g=o[p]=new $r({owner:t,primitiveType:r._primitiveType})),g.vertexArray=f,g.renderState=t._renderState,g.shaderProgram=t._sp,g.uniformMap=d,g.pass=ry.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";const m=$r.shallowClone(g,g.derivedCommands.tileset);m.renderState=t._renderState3DTiles,m.pass=ry.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;const y=$r.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=t._sp2D,g.derivedCommands.color2D=y;const _=$r.shallowClone(m,m.derivedCommands.color2D);_.shaderProgram=t._sp2D,m.derivedCommands.color2D=_;const P=$r.shallowClone(g,g.derivedCommands.colorMorph);P.renderState=t._renderStateMorph,P.shaderProgram=t._spMorph,P.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=P}}function py(t,i,e,n,o,s,r){e.mode===Ms.MORPHING?i=i.derivedCommands.colorMorph:e.mode!==Ms.SCENE3D&&(i=i.derivedCommands.color2D),i.modelMatrix=n,i.boundingVolume=s,i.cull=o,i.debugShowBoundingVolume=r,e.commandList.push(i)}function sx(t,i,e,n,o,s,r){const l=t._primitive;Nn._updateBoundingVolumes(l,i,o);let c;i.mode===Ms.SCENE3D?c=l._boundingSphereWC:i.mode===Ms.COLUMBUS_VIEW?c=l._boundingSphereCV:i.mode===Ms.SCENE2D&&ct(l._boundingSphere2D)?c=l._boundingSphere2D:ct(l._boundingSphereMorph)&&(c=l._boundingSphereMorph);const u=i.mode===Ms.MORPHING,d=t.classificationType,p=d!==Nd.CESIUM_3D_TILE,f=d!==Nd.TERRAIN&&!u;let g;const m=i.passes;if(m.render||m.pick&&l.allowPicking){const y=e.length;for(let _=0;_<y;++_){const P=c[_];p&&(g=e[_],py(t,g,i,o,s,P,r)),f&&(g=e[_].derivedCommands.tileset,py(t,g,i,o,s,P,r))}}}Ii.prototype.update=function(t){if(!ct(this._primitive)&&!ct(this.geometryInstances))return;if(!Fd.initialized){if(!this.asynchronous)throw new zd("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");Ii.initializeTerrainHeights();return}let i;const e=this,n=this._primitiveOptions;if(!ct(this._primitive)){const o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],s=o.length,r=new Array(s);let l;for(i=0;i<s;++i)if(l=o[i].attributes,!ct(l)||!ct(l.color)){this._hasPerInstanceColors=!1;break}for(i=0;i<s;++i){const c=o[i];l={};const u=c.attributes;for(const d in u)u.hasOwnProperty(d)&&(l[d]=u[d]);ct(l.width)||(l.width=new kE({componentDatatype:XE.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=t.scene3DOnly,KE.setProjectionAndEllipsoid(c.geometry,t.mapProjection),r[i]=new QE({geometry:c.geometry,attributes:l,id:c.id,pickPrimitive:e})}n.geometryInstances=r,n.appearance=this.appearance,n._createShaderProgramFunction=function(c,u,d){nx(e,u,d)},n._createCommandsFunction=function(c,u,d,p,f,g,m){ox(e,u,d,p,g,m)},n._updateAndQueueCommandsFunction=function(c,u,d,p,f,g,m,y){sx(e,u,d,p,f,g,m)},this._primitive=new Nn(n)}if(this.appearance instanceof cy&&!this._hasPerInstanceColors)throw new zd("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(t),t.afterRender.push(()=>{!this._ready&&ct(this._primitive)&&this._primitive.ready&&this._completeLoad()})},Ii.prototype.getGeometryInstanceAttributes=function(t){if(!ct(this._primitive))throw new zd("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(t)},Ii.isSupported=function(t){return t.frameState.context.depthTexture},Ii.prototype.isDestroyed=function(){return!1},Ii.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,YE(this)};class bo extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.globe,o=-414,s=8777;let r={};const l=()=>{var p,f,g,m,y;if(!e)return;let u;const d=this.shadingMode||"none";if((this.show??!0)&&!(d==="none"&&!this.enableContour)){let _;this.enableContour?(d==="elevation"?(u=rx(),_=u.materials.elevationRampMaterial.uniforms,_.minimumHeight=((p=this.elevationParam)==null?void 0:p.minHeight)??o,_.maximumHeight=((f=this.elevationParam)==null?void 0:f.maxHeight)??s,r=u.materials.contourMaterial.uniforms):d==="slope"?(u=ax(),_=u.materials.slopeRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):d==="aspect"?(u=lx(),_=u.materials.aspectRampMaterial.uniforms,r=u.materials.contourMaterial.uniforms):(u=h.Material.fromType("ElevationContour"),r=u.uniforms),r.width=this.contourWidth,r.spacing=this.contourSpacing,r.color=h.Color.fromCartesian4(h.Cartesian4.fromArray(this.contourColor))):d==="elevation"?(u=h.Material.fromType("ElevationRamp"),_=u.uniforms,_.minimumHeight=((g=this.elevationParam)==null?void 0:g.minHeight)??o,_.maximumHeight=((m=this.elevationParam)==null?void 0:m.maxHeight)??s):d==="slope"?(u=h.Material.fromType("SlopeRamp"),_=u.uniforms):d==="aspect"&&(u=h.Material.fromType("AspectRamp"),_=u.uniforms),d!=="none"&&(_.image=fy(d),d==="elevation"&&((y=this.elevationParam)==null?void 0:y.color)!==void 0&&(_.image=Array.isArray(this.elevationParam.color)?fy(d,this.elevationParam.color):this.elevationParam.color))}n.material=u};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.contourColorChanged,this.contourSpacingChanged,this.contourWidthChanged,this.enableContourChanged,this.shadingModeChanged,this.showChanged,this.elevationParamChanged));this.dispose(c.disposableOn(l)),this.dispose(()=>n.material=void 0)}}v(bo,"defaults",{show:!1,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],shadingMode:"none"}),(t=>{t.createDefaultProps=()=>({show:void 0,shadingMode:void 0,enableContour:!1,contourSpacing:150,contourWidth:2,contourColor:[1,0,0,1],elevationParam:a.reactJsonWithUndefined(void 0)})})(bo||(bo={})),a.extendClassProps(bo.prototype,bo.createDefaultProps);function rx(){return new h.Material({fabric:{type:"ElevationColorContour",materials:{contourMaterial:{type:"ElevationContour"},elevationRampMaterial:{type:"ElevationRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? elevationRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, elevationRampMaterial.alpha)"}},translucent:!1})}function ax(){return new h.Material({fabric:{type:"SlopeColorContour",materials:{contourMaterial:{type:"ElevationContour"},slopeRampMaterial:{type:"SlopeRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? slopeRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, slopeRampMaterial.alpha)"}},translucent:!1})}function lx(){return new h.Material({fabric:{type:"AspectColorContour",materials:{contourMaterial:{type:"ElevationContour"},aspectRampMaterial:{type:"AspectRamp"}},components:{diffuse:"contourMaterial.alpha == 0.0 ? aspectRampMaterial.diffuse : contourMaterial.diffuse",alpha:"max(contourMaterial.alpha, aspectRampMaterial.alpha)"}},translucent:!1})}const cx=[0,.045,.1,.15,.37,.54,1],hx=[0,.29,.5,Math.sqrt(2)/2,.87,.91,1],ux=[0,.2,.4,.6,.8,.9,1];function fy(t,i){const e=document.createElement("canvas");e.width=100,e.height=1;const n=e.getContext("2d");let o;if(t==="elevation")o=cx;else if(t==="slope")o=hx;else if(t==="aspect")o=ux;else throw new Error("values未赋值!");const s=n.createLinearGradient(0,0,100,0);return s.addColorStop(o[0],i!=null&&i[0]?Cn(i==null?void 0:i[0]):"#000000"),s.addColorStop(o[1],i!=null&&i[1]?Cn(i==null?void 0:i[1]):"#2747E0"),s.addColorStop(o[2],i!=null&&i[2]?Cn(i==null?void 0:i[2]):"#D33B7D"),s.addColorStop(o[3],i!=null&&i[3]?Cn(i==null?void 0:i[3]):"#D33038"),s.addColorStop(o[4],i!=null&&i[4]?Cn(i==null?void 0:i[4]):"#FF9742"),s.addColorStop(o[5],i!=null&&i[5]?Cn(i==null?void 0:i[5]):"#ffd700"),s.addColorStop(o[6],i!=null&&i[6]?Cn(i==null?void 0:i[6]):"#ffffff"),n.fillStyle=s,n.fillRect(0,0,100,1),e}class Ds extends a.Destroyable{constructor(e){super();v(this,"_geoPath");v(this,"_geoPolyline");v(this,"_geoCanvasPointPoi");v(this,"_player");v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_currentDistance",this.disposeVar(a.react(0)));v(this,"_ratio",this.disposeVar(a.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new a.ESPathImpl),this._geoPolyline=this.disposeVar(new be(e)),this._geoCanvasPointPoi=this.disposeVar(new Pn(e)),this._player=this.disposeVar(new a.Player),this._geoPolyline.show=!1,this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(a.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPath,"show"],[this,"show"])),this.dispose(a.track([this._geoPath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.track([this._geoPath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.track([this._geoPath,"width"],[this,"width"])),this.dispose(a.track([this._geoPath,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPath,"color"],[this,"color"])),this.dispose(a.track([this._geoPath,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPath,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPath,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPath,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPath,"allowPicking"],[this,"allowPicking"]));{const n=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};n(),this.dispose(this.showChanged.disposableOn(n)),this.dispose(this.currentPoiShowChanged.disposableOn(n))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const n=()=>{if(this.positions){const s=this.granularity*Math.PI/180,r=mu(this.positions,this.arcType??"GEODESIC",s);if(r){this._geoPath.timePosRots=r.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};n();const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(o.disposableOn(n))}{const n=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const o=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(o-this.currentDistance)>.01&&(this.currentDistance=o)};n(),this.dispose(this._player.currentTimeChanged.disposableOn(n))}{const n=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const o=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(o-(this._player.currentTime??0))>.01&&(this._player.currentTime=o)};n(),this.dispose(this.currentDistanceChanged.disposableOn(n))}this.dispose(a.bind([this._player,"loop"],[this,"loop"])),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._player,"duration"],[this,"duration"])),this.dispose(a.bind([this._player,"playing"],[this,"playing"])),this.dispose(a.bind([this._player,"speed"],[this,"speed"])),this.dispose(this._flyToEvent.disposableOn(n=>{this._geoPolyline.flyTo(n)}))}get geoPath(){return this._geoPath}get geoPolyline(){return this._geoPolyline}get geoCanvasPointPoi(){return this._geoCanvasPointPoi}get player(){return this._player}get currentInfo(){return this._geoPath.currentInfo}get currentInfoChanged(){return this._geoPath.currentInfoChanged}get currentIndex(){return this._geoPath.currentIndex}get currentIndexChanged(){return this._geoPath.currentIndexChanged}get currentPosition(){return this._geoPath.currentPosition}get currentPositionChanged(){return this._geoPath.currentPositionChanged}get currentRotation(){return this._geoPath.currentRotation}get currentRotationChanged(){return this._geoPath.currentRotationChanged}get accumDistances(){return this._geoPath.accumDistances}get accumDistancesChanged(){return this._geoPath.accumDistancesChanged}get totalDistance(){return this._geoPath.totalDistance}get totalDistanceChanged(){return this._geoPath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}subPath(e,n){const o=this._geoPath.subPath(e,n);if(o)return o.map(s=>s[1])}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get ratio(){return this._ratio.value}set ratio(e){this._ratio.value=e}get ratioChanged(){return this._ratio.changed}get timePosRots(){return this.geoPath.timePosRots}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,currentPoiShow:!0,polylineShow:!0,positions:a.reactPositions(void 0),width:1,ground:!1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",granularity:1,loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,depthTest:!1,leadTime:0,trailTime:0,rotationRadius:[0],rotLerpMode:"Next"})})(Ds||(Ds={})),a.extendClassProps(Ds.prototype,Ds.createDefaultProps);class fe extends Jt{constructor(e,n){super(e,n);v(this,"_smoothMoving");if(this._smoothMoving=this.disposeVar(new a.SmoothMoveController(this.czmViewer)),this.d(this._smoothMoving.currentPositionChanged.don(s=>{s&&(this.sceneObject.position=s)})),this.d(this._smoothMoving.currentRotationChanged.don(s=>{s&&this._smoothMoving.isRotating&&(this.sceneObject.rotation=s)})),this.d(this._smoothMoving.currentHeadingChanged.don(s=>{if(s!==void 0&&!this._smoothMoving.isRotating){const r=this.sceneObject.rotation;this.sceneObject.rotation=[s-90,r[1],r[2]]}})),!n.viewer){console.warn("viewer is undefined!");return}this.d(e.smoothMoveEvent.don((s,r)=>{this.smoothMove(s,r*1e3)})),this.d(e.smoothMoveWithRotationEvent.don((s,r,l)=>{this.smoothMoveWithRotation(s,r,l*1e3)})),this.d(e.smoothMoveOnGroundEvent.don((s,r,l)=>{this.smoothMoveOnGround(s,r,l*1e3)})),this.d(e.smoothMoveWithRotationOnGroundEvent.don((s,r,l,c)=>{this.smoothMoveWithRotationOnGround(s,r,l,c*1e3)})),this.d(e.calcFlyToParamEvent.don(()=>{if(!e.useCalcFlyToParamInESObjectWithLocation)return;if(!e.position){console.warn(`!sceneObject(${e.name}-${e.id}).position`);return}const s=n.calcFlyToParam(e.position);if(!s){console.warn("czmViewer.calcFlyToParam error.");return}e.flyToParam=s})),this.d(e.automaticLandingEvent.don(async s=>{const r=[e.position[0],e.position[1]],l=await n.getTerrainHeight(r);l?e.position=[...r,l]:console.warn("不存在相交"),e.collision=s}));{const s=this.dv(a.createNextAnimateFrameEvent(e.minVisibleDistanceChanged,e.maxVisibleDistanceChanged));this.d(s.don(()=>this.visibleDistance(e,n))),this.d(n.cameraChanged.don(()=>this.visibleDistance(e,n)))}}smoothMove(e,n){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,this.sceneObject.rotation,n)}smoothMoveWithRotation(e,n,o){this._smoothMoving.isGround=!1,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart(e,n,o)}async smoothMoveOnGround(e,n,o){const s=await this.czmViewer.getTerrainHeight([e,n])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!1,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([e,n,s],this.sceneObject.rotation,o)}async smoothMoveWithRotationOnGround(e,n,o,s){const r=await this.czmViewer.getTerrainHeight([n,o])??0;this._smoothMoving.isGround=!0,this._smoothMoving.isRotating=!0,this._smoothMoving.restart(this.sceneObject.position,this.sceneObject.rotation,0),this._smoothMoving.restart([n,o,r],e,s)}visibleDistance(e,n){var s;const o=fe.getInnerCzmObjects(this);if((s=n.viewer)!=null&&s.camera&&e.show&&o.length!=0){const r=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let l=!1;e.minVisibleDistance<e.maxVisibleDistance?l=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(l=r>e.minVisibleDistance),o.forEach(c=>{if(c instanceof ze)return;const u=e.show&&l;Reflect.has(c,"showHelper")&&(c.showHelper=u),Reflect.has(c,"enabled")&&(c.enabled=u),Reflect.has(c,"show")&&(c.show=u)})}}static getInnerCzmObjects(e){const n=[];for(const o in e)Object.prototype.hasOwnProperty.call(e,o)&&(!o.includes("czmViewer")&&o.includes("czm")||!Number.isNaN(+o)?Array.isArray(e[o])?n.push(...fe.getInnerCzmObjects(e[o])):n.push(e[o]):e[o]&&e[o].obj&&n.push(...fe.getInnerCzmObjects(e[o].obj)));return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&o.position){const{position:r,flyToParam:l}=o,{distance:c,heading:u,pitch:d,flyDuration:p,hDelta:f,pDelta:g}=l;return this.flyToWithPromise(n,r,c,[u,d,0],e??p,f,g),!0}return super.flyTo(e,n)}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(!o.flyInParam&&o.position&&o.rotation){const r=e??1,l=[...o.rotation];return l[0]+=90,this.flyToWithPromise(n,o.position,void 0,l,r),!0}return super.flyIn(e,n)}}class vt extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}class Xr extends fe{constructor(e,n){super(e,n);v(this,"_lastHoverResult",this.disposeVar(a.react(void 0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.ad(a.createProcessingFromAsyncFunc(async(r,l)=>{const c=await r.promise(n.pick(l.screenPosition,"innerHoverEvent"));this.lastHoverResult=Object.assign({},c,l)}));this.ad(n.pointerMoveEvent.don(async r=>{!s.isRunning&&s.restart(void 0,r)}))}get lastHoverResult(){return this._lastHoverResult.value}set lastHoverResult(e){this._lastHoverResult.value=e}get lastHoverResultChanged(){return this._lastHoverResult.changed}}class gh extends fe{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}}function dx(t,i,e){const n=t,o=i,s=(o[0]-n[0]+(o[1]-n[1]))/4,r=[[n[0],0,n[1]],[o[0],0,n[1]],[o[0],0,o[1]],[n[0],0,o[1]],[0,s,0]],l=h.Math.toDegrees,c=r.map(d=>{const p=h.Matrix4.multiplyByPoint(e,h.Cartesian3.fromElements(...d),new h.Cartesian3),f=h.Cartographic.fromCartesian(p);return[l(f.longitude),l(f.latitude),f.height]});return[[[c[0],c[1],c[2],c[3],c[0]]],c[4]]}class So extends a.Destroyable{constructor(e,n){super();v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_polylines");v(this,"_axis");n&&(this.id=n),this._polylines=this.disposeVar(new $t(e,n)),this._axis=this.disposeVar(new be(e,n)),this._axis.hasArrow=!0,this._axis.width=10,this._polylines.arcType=this._axis.arcType="NONE",this.dispose(this.flyToEvent.disposableOn(o=>{if(!(e instanceof Te)||!e.actived)return;if(!this.position){console.warn("CzmPlane warning: 没有位置,无法飞入!");return}const s=this.minSize,r=this.maxSize,l=[r[0]-s[0],r[1]-s[1]],c=Math.sqrt(l[0]*l[0]+l[1]*l[1]);ne(e.viewer,this.position,c*2,void 0,o)}));{const o=()=>{let r=[],l;if(this.position){const c=Ie({position:this.position,rotation:this.rotation});if(c){const u=dx(this.minSize,this.maxSize,c);r=u[0],l=u[1]}}this.polylines.positions=r,!(!this.position||!l)&&(this.axis.positions=[this.position,l])};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(s.disposableOn(o))}this.dispose(a.track([this.polylines,"color"],[this,"color"])),this.dispose(a.track([this.polylines,"width"],[this,"width"])),this.dispose(a.track([this.polylines,"show"],[this,"show"])),this.dispose(a.track([this.axis,"color"],[this,"color"]));{const o=()=>{this.axis.show=this.show&&this.showArrow};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.showArrowChanged.disposableOn(o))}}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylines(){return this._polylines}get axis(){return this._axis}}v(So,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,showArrow:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),color:a.reactArray([1,1,1,1]),width:2,minSize:a.reactArray([-100,-100]),maxSize:a.reactArray([100,100])})})(So||(So={})),a.extendClassProps(So.prototype,So.createDefaultProps);class px extends a.Destroyable{constructor(e,n,o){super();v(this,"_centerMatrix",this.disposeVar(a.react(void 0)));v(this,"_inverseCenterMatrix",this.disposeVar(a.react(void 0)));v(this,"_czmPlaneWrappers");v(this,"_czmPlaneWrappersChanged",this.disposeVar(a.createNextAnimateFrameEvent()));v(this,"_computedPlanesChanged",this.disposeVar(a.createNextAnimateFrameEvent()));this._czmClippingPlanes=n,this._planeIds=o,this._czmPlaneWrappers=this._planeIds.map(s=>this.disposeVar(new gx(e,this,s)));{const s=()=>{let r,l;const c=this._czmPlaneWrappers.filter(u=>u.position&&u.rotation);if(c.length!==0){const u=c.map(p=>p.position),d=a.getMinMaxCorner(u);r=Ie({position:d.center}),r&&(l=h.Matrix4.inverseTransformation(r,new h.Matrix4))}this.centerMatrix=r,this.inverseCenterMatrix=l};s(),this.dispose(this.czmPlaneWrappersChanged.disposableOn(s))}{const s=()=>{if(!this.centerMatrix){this._czmClippingPlanes.computedClippingPlanes=void 0;return}const l=h.Matrix4.toArray(this.centerMatrix),c=this._czmPlaneWrappers.filter(u=>!!u.computedPlane).map(u=>u.computedPlane);this._czmClippingPlanes.computedClippingPlanes={planes:c,enabled:this._czmClippingPlanes.enabled,modelMatrix:l,unionClippingRegions:this._czmClippingPlanes.unionClippingRegions,edgeColor:this._czmClippingPlanes.edgeColor,edgeWidth:this._czmClippingPlanes.edgeWidth}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._czmClippingPlanes.enabledChanged,this.centerMatrixChanged,this.inverseCenterMatrixChanged,this.computedPlanesChanged,this._czmClippingPlanes.unionClippingRegionsChanged,this._czmClippingPlanes.edgeColorChanged,this._czmClippingPlanes.edgeWidthChanged));this.dispose(r.disposableOn(s))}}get centerMatrix(){return this._centerMatrix.value}set centerMatrix(e){this._centerMatrix.value=e}get centerMatrixChanged(){return this._centerMatrix.changed}get inverseCenterMatrix(){return this._inverseCenterMatrix.value}set inverseCenterMatrix(e){this._inverseCenterMatrix.value=e}get inverseCenterMatrixChanged(){return this._inverseCenterMatrix.changed}get czmPlaneWrappers(){return this._czmPlaneWrappers}get czmPlaneWrappersChanged(){return this._czmPlaneWrappersChanged}get computedPlanesChanged(){return this._computedPlanesChanged}get czmClippingPlanes(){return this._czmClippingPlanes}}class fx extends a.Destroyable{constructor(i,e){super(),this._czmPlaneWrapper=i,this._czmPlane=e,this._czmPlaneWrapper.position=this._czmPlane.position,this.dispose(()=>this._czmPlaneWrapper.position=void 0),this.dispose(a.track([this._czmPlaneWrapper,"position"],[this._czmPlane,"position"])),this._czmPlaneWrapper.rotation=this._czmPlane.rotation,this.dispose(()=>this._czmPlaneWrapper.rotation=[0,0,0]),this.dispose(a.track([this._czmPlaneWrapper,"rotation"],[this._czmPlane,"rotation"]))}}class gx extends a.Destroyable{constructor(e,n,o){super();v(this,"_sowi");v(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_rotation",this.disposeVar(a.reactArray([0,0,0])));v(this,"_computedPlane",this.disposeVar(a.reactJson(void 0)));this._planesResetting=n,this._planeId=o,this._sowi=this.disposeVar(new a.ESSceneObjectWithId),this._sowi.id=this._planeId,this.disposeVar(new a.ObjResettingWithEvent(this.sowi.sceneObjectChanged,()=>{const{sceneObject:s}=this.sowi;if(!s)return;let r;a.registerCreatedEventUpdate(this,s,()=>{const l=e.getEngineObject(s);if(s instanceof a.ESClippingPlane&&(r=l.czmPlane),!!r&&r instanceof So)return new fx(this,r)})})),this.dispose(this.positionChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next())),this.dispose(this.rotationChanged.disposableOn(()=>this._planesResetting.czmPlaneWrappersChanged.next()));{const s=()=>{const{inverseCenterMatrix:l}=this._planesResetting;if(!l)return this.computedPlane=void 0;const{position:c,rotation:u}=this;if(!c)return this.computedPlane=void 0;const d=Ie({position:c,rotation:u});if(!d)return this.computedPlane=void 0;const f=h.Matrix4.multiply(l,d,new h.Matrix4),g=new h.Cartesian3(f[4],f[5],f[6]),m=new h.Cartesian3(f[12],f[13],f[14]);h.Cartesian3.normalize(g,g);let y=-h.Cartesian3.dot(g,m);const _=[g.x,g.y,g.z];this._planesResetting.czmClippingPlanes.reverseNormal&&(a.Vector.negate(_,_),y=-y),this.computedPlane={normal:_,distance:y}};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this._planesResetting.inverseCenterMatrixChanged,this.positionChanged,this.rotationChanged,this._planesResetting.czmClippingPlanes.reverseNormalChanged));this.dispose(r.disposableOn(s))}this.dispose(this.computedPlaneChanged.disposableOn(()=>this._planesResetting.computedPlanesChanged.next()))}get sowi(){return this._sowi}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get rotation(){return this._rotation.value}set rotation(e){this._rotation.value=e}get rotationChanged(){return this._rotation.changed}get computedPlane(){return this._computedPlane.value}set computedPlane(e){this._computedPlane.value=e}get computedPlaneChanged(){return this._computedPlane.changed}}class Rs extends a.Destroyable{constructor(e,n){super();v(this,"_id",this.disposeVar(a.react(a.createGuid())));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_computedClippingPlanes",this.disposeVar(a.react(void 0)));n&&(this.id=n),this.disposeVar(new a.ObjResettingWithEvent(this.planeIdsChanged,()=>new px(e,this,this.planeIds)))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,planeIds:a.reactArray([]),reverseNormal:!1,unionClippingRegions:!0,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Rs||(Rs={})),a.extendClassProps(Rs.prototype,Rs.createDefaultProps);let mx=class extends a.Destroyable{constructor(i,e){super(),this._czmESClippingPlane=i,this._eS3DTileset=e;const o=[this._czmESClippingPlane.czmPlane.id,...this._eS3DTileset.clippingPlaneIds];this._eS3DTileset.clippingPlaneIds=o,this.dispose(()=>{const s=[...this._eS3DTileset.clippingPlaneIds],r=this._czmESClippingPlane.czmPlane.id;s.includes(r)&&(s.splice(s.indexOf(r),1),this._eS3DTileset.clippingPlaneIds=s)})}},vx=class extends a.Destroyable{constructor(i){if(super(),this._czmESClippingPlane=i,!this._czmESClippingPlane.viewer)return;this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId=this._czmESClippingPlane.czmPlane.id;const e=()=>{if(!this._czmESClippingPlane.viewer)return;const o=Ie({position:this._czmESClippingPlane.sceneObject.position});if(!o)return;const s=em(this._czmESClippingPlane.sceneObject.rotation);this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes={planes:[{normal:s,distance:0}],enabled:!0,modelMatrix:h.Matrix4.toArray(o),unionClippingRegions:!1,edgeColor:this._czmESClippingPlane.sceneObject.edgeColor,edgeWidth:this._czmESClippingPlane.sceneObject.edgetWidth}};e();const n=this.dv(a.createNextAnimateFrameEvent(this._czmESClippingPlane.sceneObject.positionChanged,this._czmESClippingPlane.sceneObject.rotationChanged,this._czmESClippingPlane.sceneObject.edgeColorChanged,this._czmESClippingPlane.sceneObject.edgetWidthChanged));this.d(n.don(e)),this.dispose(()=>{this._czmESClippingPlane.viewer&&(this._czmESClippingPlane.viewer.sceneGlobeClippingPlanesId="",this._czmESClippingPlane.viewer.sceneGlobeClippingPlanes=void 0)})}};const Sa=class Sa extends fe{constructor(e,n){super(e,n);v(this,"_innerPositionReact",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_czmPlane");v(this,"_tilesSceneObjectWithId");this._czmPlane=this.disposeVar(new So(n,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new a.ESSceneObjectWithId);const o=this.ad(a.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const l=a.ESSceneObject.getSceneObject(e.targetID);o.value=l?(l.components.main??l).id:""})),this.dispose(a.track([this._tilesSceneObjectWithId,"id"],o)),!n.viewer)return;const r=this._czmPlane;a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmPlane.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(!(!this.sceneObject.show||!this.czmPlane.show))return u===""?new vx(this):!c||!(c instanceof a.ES3DTileset)?void 0:new mx(this,c)}))}),this.dispose(a.track([r,"show"],[e,"show"])),this.dispose(a.bind([r,"position"],[e,"position"])),this.dispose(Ke([r,"rotation"],[e,"rotation"])),this.dispose(a.track([r,"showArrow"],[e,"showArrow"])),this.dispose(a.track([r,"color"],[e,"edgeColor"])),this.dispose(a.track([r,"width"],[e,"edgetWidth"]));{const l=()=>{r.minSize=[-e.width/2,-e.height/2],r.maxSize=[e.width/2,e.height/2]};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.widthChanged,e.heightChanged));this.dispose(c.disposableOn(l))}{const l=()=>{a.Vector.equals(e.position,[0,0,0])?this._innerPositionReact.value=void 0:this._innerPositionReact.value=e.position};l(),this.dispose(this.sceneObject.positionChanged.disposableOn(l))}{const l=()=>{this._innerPositionReact.value==null?e.position=[0,0,0]:e.position=this._innerPositionReact.value};this.dispose(this._innerPositionReact.changed.disposableOn(l))}}get czmPlane(){return this._czmPlane}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?(ei(s,o,n,o.position,Math.max(o.width,o.height),e,!0),!0):!1:!1}};v(Sa,"type",Sa.register("ESCesiumViewer",a.ESClippingPlane.type,Sa));let Bd=Sa;function yx(t){t.toBlob(i=>{if(!i){console.warn("canvas.toBlob error!");return}var e=new ClipboardItem({"image/png":i});navigator.clipboard.write([e]).then(function(){alert("图像已复制到剪切板")}).catch(function(n){console.error("复制到剪切板失败: ",n)})})}const Jh=class Jh extends a.Destroyable{constructor(i,e){super(),this._geoPolygonCanvas=i,this._geoPolygon=e;{const n=(r,l)=>{const{canvas:c,canvasCtx:u,canvasWidth:d}=this._geoPolygonCanvas,{toMercatorPos:p}=Jh,f=p(r),g=p(l),m=g[0]-f[0],y=g[1]-f[1],_=d>8192?8192:d;if(m<=0)return;const P=_*y/m|0;if(P<=0||P>8192)return;const{points:C}=this._geoPolygon;if(!C)throw new Error("!positions");const S=C.map(x=>{const T=p(x);return[(T[0]-f[0])*_/m,P-(T[1]-f[1])*P/y]});c.width=_,c.height=P,u.clearRect(0,0,_,P),u.beginPath();for(const x of S)u.lineTo(x[0],x[1]);u.closePath(),u.fillStyle="#FFFFFF",u.fill()},o=()=>{let r;const{canvas:l,canvasCtx:c,canvasWidth:u}=this._geoPolygonCanvas;c.clearRect(0,0,l.width,l.height);const{points:d}=this._geoPolygon;if(d&&d.length>=3){const p=a.getMinMaxCorner(d),{minPos:f,maxPos:g}=p;n(f,g),r={rect:[f[0],f[1],g[0],g[1]],height:d[0][2]}}this._geoPolygonCanvas.canvasGeoInfo=r,this.ad(a.nextAnimateFrame(()=>{this._geoPolygonCanvas.canvasChanged.emit()}))};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._geoPolygon.pointsChanged,this._geoPolygonCanvas.canvasWidthChanged));this.dispose(s.disposableOn(o))}}};v(Jh,"toMercatorPos",function(i){const[e,n,o]=i;return[e,n/Math.cos(n*Math.PI/180),o]});let Vd=Jh;const Ea=class Ea extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolygonWithId");v(this,"_canvas",document.createElement("canvas"));v(this,"_canvasCtx",this._canvas.getContext("2d"));v(this,"_canvasChanged",this.disposeVar(new a.Event));v(this,"_canvasGeoInfo",this.disposeVar(a.reactJsonWithUndefined(void 0)));this._geoPolygonWithId=this.disposeVar(new a.ESSceneObjectWithId),this.dispose(a.track([this._geoPolygonWithId,"id"],[this,"geoPolygonId"])),this.disposeVar(new a.ObjResettingWithEvent(this.geoPolygonWithId.sceneObjectChanged,()=>{const{sceneObject:o}=this.geoPolygonWithId;if(o&&o instanceof a.ESGeoPolygon)return new Ea.PolygonCanvasResetting(this,o)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygonWithId(){return this._geoPolygonWithId}get canvas(){return this._canvas}get canvasCtx(){return this._canvasCtx}get canvasChanged(){return this._canvasChanged}get canvasGeoInfo(){return this._canvasGeoInfo.value}set canvasGeoInfo(e){this._canvasGeoInfo.value=e}get canvasGeoInfoChanged(){return this._canvasGeoInfo.changed}};v(Ea,"saveCanvasToClipboard",yx),v(Ea,"PolygonCanvasResetting",Vd);let Eo=Ea;(t=>{t.createDefaultProps=()=>({enabled:!0,geoPolygonId:"",canvasWidth:512})})(Eo||(Eo={})),a.extendClassProps(Eo.prototype,Eo.createDefaultProps);function wx(t,i){return class extends a.Destroyable{constructor(o,s){super();v(this,"_customShader",this.disposeVar(new h.CustomShader({uniforms:{u_discardRatio:{value:new h.Cartesian2(0,1),type:h.UniformType.VEC2},u_topColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4},u_bottomColor:{value:new h.Color(1,1,1,1),type:h.UniformType.VEC4}},varyings:{v_xbsjPos:h.VaryingType.VEC3,v_m:h.VaryingType.FLOAT},vertexShaderText:` // IMPORTANT: the function signature must use these parameter names. This
366
366
  // makes it easier for the runtime to generate the shader and make optimizations.
367
367
  void vertexMain(VertexInput vsInput, inout czm_modelVertexOutput vsOutput) {
368
368
  // code goes here. An empty body is a no-op.
@@ -1854,7 +1854,7 @@ function (result, this, instanceIndex, frameState) {
1854
1854
  result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
1855
1855
  return result;
1856
1856
  }\`\`\`
1857
- `,kn=class kn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(a.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const g=kn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],m=>m??g.loop,m=>m??g.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],m=>m??g.currentTime,m=>m??g.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],m=>m??g.duration,m=>m??g.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],m=>m??g.playing,m=>m??g.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],m=>m??g.speed,m=>m??g.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const m=o.value;if(m)try{const _=await(await fetch(m)).json();this.routePaths=hM(_,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(_=>({positions:_,width:this.width}));return}}}));{const g=()=>{s.restart()};g();const m=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(m.disposableOn(g))}{const g=()=>{const m=Eu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);m&&(this.routePathCallback=m)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new os),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const m=Dm(r.scene.context).getTextureHandler(l.value);if(m instanceof os)c.reset(m);else{const y=await g.promise(m);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new xM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))ne(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,g);else{const m=computeBoundingSphere(this.routePaths[0].positions);if(!m)return;const[y,_]=m;ne(r,y,_*3,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};v(kn,"whiteGradientImageBase64",AM),v(kn,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),v(kn,"routePathCallbackStrMd",TM),v(kn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(kn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let nn=kn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(nn||(nn={})),a.extendClassProps(nn.prototype,nn.createDefaultProps);class Vn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new nn(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}v(Vn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Vn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Vn||(Vn={})),a.extendClassProps(Vn.prototype,Vn.createDefaultProps);const Bl=class Bl extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Vn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Bl,"type",Bl.register("ESCesiumViewer",Ph.type,Bl));let uf=Bl;function Oo(t){var i=[1/0,1/0,-1/0,-1/0];return zo(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}Oo.default=Oo;var c0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(yo,function(){function e(C,S,x,T,R){(function O(N,V,U,z,B){for(;z>U;){if(z-U>600){var w=z-U+1,E=V-U+1,D=Math.log(w),L=.5*Math.exp(2*D/3),G=.5*Math.sqrt(D*L*(w-L)/w)*(E-w/2<0?-1:1),Y=Math.max(U,Math.floor(V-E*L/w+G)),q=Math.min(z,Math.floor(V+(w-E)*L/w+G));O(N,V,Y,q,B)}var X=N[V],Q=U,ee=z;for(n(N,U,V),B(N[z],X)>0&&n(N,U,z);Q<ee;){for(n(N,Q,ee),Q++,ee--;B(N[Q],X)<0;)Q++;for(;B(N[ee],X)>0;)ee--}B(N[U],X)===0?n(N,U,ee):n(N,++ee,z),ee<=V&&(U=ee+1),V<=ee&&(z=ee-1)}})(C,S,x||0,T||C.length-1,R||o)}function n(C,S,x){var T=C[S];C[S]=C[x],C[x]=T}function o(C,S){return C<S?-1:C>S?1:0}var s=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(C,S,x){if(!x)return S.indexOf(C);for(var T=0;T<S.length;T++)if(x(C,S[T]))return T;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,T,R){R||(R=_(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var O=S;O<x;O++){var N=C.children[O];u(R,C.leaf?T(N):N)}return R}function u(C,S){return C.minX=Math.min(C.minX,S.minX),C.minY=Math.min(C.minY,S.minY),C.maxX=Math.max(C.maxX,S.maxX),C.maxY=Math.max(C.maxY,S.maxY),C}function d(C,S){return C.minX-S.minX}function p(C,S){return C.minY-S.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function m(C,S){return C.minX<=S.minX&&C.minY<=S.minY&&S.maxX<=C.maxX&&S.maxY<=C.maxY}function y(C,S){return S.minX<=C.maxX&&S.minY<=C.maxY&&S.maxX>=C.minX&&S.maxY>=C.minY}function _(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(C,S,x,T,R){for(var O=[S,x];O.length;)if(!((x=O.pop())-(S=O.pop())<=T)){var N=S+Math.ceil((x-S)/T/2)*T;e(C,N,S,x,R),O.push(S,N,N,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(C){var S=this.data,x=[];if(!y(C,S))return x;for(var T=this.toBBox,R=[];S;){for(var O=0;O<S.children.length;O++){var N=S.children[O],V=S.leaf?T(N):N;y(C,V)&&(S.leaf?x.push(N):m(C,V)?this._all(N,x):R.push(N))}S=R.pop()}return x},s.prototype.collides=function(C){var S=this.data;if(!y(C,S))return!1;for(var x=[];S;){for(var T=0;T<S.children.length;T++){var R=S.children[T],O=S.leaf?this.toBBox(R):R;if(y(C,O)){if(S.leaf||m(C,O))return!0;x.push(R)}}S=x.pop()}return!1},s.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var S=0;S<C.length;S++)this.insert(C[S]);return this}var x=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var T=this.data;this.data=x,x=T}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},s.prototype.clear=function(){return this.data=_([]),this},s.prototype.remove=function(C,S){if(!C)return this;for(var x,T,R,O=this.data,N=this.toBBox(C),V=[],U=[];O||V.length;){if(O||(O=V.pop(),T=V[V.length-1],x=U.pop(),R=!0),O.leaf){var z=r(C,O.children,S);if(z!==-1)return O.children.splice(z,1),V.push(O),this._condense(V),this}R||O.leaf||!m(O,N)?T?(x++,O=T.children[x],R=!1):O=null:(V.push(O),U.push(x),x=0,T=O,O=O.children[0])}return this},s.prototype.toBBox=function(C){return C},s.prototype.compareMinX=function(C,S){return C.minX-S.minX},s.prototype.compareMinY=function(C,S){return C.minY-S.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(C){return this.data=C,this},s.prototype._all=function(C,S){for(var x=[];C;)C.leaf?S.push.apply(S,C.children):x.push.apply(x,C.children),C=x.pop();return S},s.prototype._build=function(C,S,x,T){var R,O=x-S+1,N=this._maxEntries;if(O<=N)return l(R=_(C.slice(S,x+1)),this.toBBox),R;T||(T=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,T-1))),(R=_([])).leaf=!1,R.height=T;var V=Math.ceil(O/N),U=V*Math.ceil(Math.sqrt(N));P(C,S,x,U,this.compareMinX);for(var z=S;z<=x;z+=U){var B=Math.min(z+U-1,x);P(C,z,B,V,this.compareMinY);for(var w=z;w<=B;w+=V){var E=Math.min(w+V-1,B);R.children.push(this._build(C,w,E,T-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,T){for(;T.push(S),!S.leaf&&T.length-1!==x;){for(var R=1/0,O=1/0,N=void 0,V=0;V<S.children.length;V++){var U=S.children[V],z=f(U),B=(w=C,E=U,(Math.max(E.maxX,w.maxX)-Math.min(E.minX,w.minX))*(Math.max(E.maxY,w.maxY)-Math.min(E.minY,w.minY))-z);B<O?(O=B,R=z<R?z:R,N=U):B===O&&z<R&&(R=z,N=U)}S=N||S.children[0]}var w,E;return S},s.prototype._insert=function(C,S,x){var T=x?C:this.toBBox(C),R=[],O=this._chooseSubtree(T,this.data,S,R);for(O.children.push(C),u(O,T);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(T,R,S)},s.prototype._split=function(C,S){var x=C[S],T=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,T);var O=this._chooseSplitIndex(x,R,T),N=_(x.children.splice(O,x.children.length-O));N.height=x.height,N.leaf=x.leaf,l(x,this.toBBox),l(N,this.toBBox),S?C[S-1].children.push(N):this._splitRoot(x,N)},s.prototype._splitRoot=function(C,S){this.data=_([C,S]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(C,S,x){for(var T,R,O,N,V,U,z,B=1/0,w=1/0,E=S;E<=x-S;E++){var D=c(C,0,E,this.toBBox),L=c(C,E,x,this.toBBox),G=(R=D,O=L,N=void 0,V=void 0,U=void 0,z=void 0,N=Math.max(R.minX,O.minX),V=Math.max(R.minY,O.minY),U=Math.min(R.maxX,O.maxX),z=Math.min(R.maxY,O.maxY),Math.max(0,U-N)*Math.max(0,z-V)),Y=f(D)+f(L);G<B?(B=G,T=E,w=Y<w?Y:w):G===B&&Y<w&&(w=Y,T=E)}return T||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var T=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,T)<this._allDistMargin(C,S,x,R)&&C.children.sort(T)},s.prototype._allDistMargin=function(C,S,x,T){C.children.sort(T);for(var R=this.toBBox,O=c(C,0,S,R),N=c(C,x-S,x,R),V=g(O)+g(N),U=S;U<x-S;U++){var z=C.children[U];u(O,C.leaf?R(z):z),V+=g(O)}for(var B=x-S-1;B>=S;B--){var w=C.children[B];u(N,C.leaf?R(w):w),V+=g(N)}return V},s.prototype._adjustParentBBoxes=function(C,S,x){for(var T=x;T>=0;T--)u(S[T],C)},s.prototype._condense=function(C){for(var S=C.length-1,x=void 0;S>=0;S--)C[S].children.length===0?S>0?(x=C[S-1].children).splice(x.indexOf(C[S]),1):this.clear():l(C[S],this.toBBox)},s})})(c0);var MM=c0.exports;function Pt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=Ah(t),o=Fi(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&IM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(h0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)h0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function h0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function IM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function DM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return u0(t);case"FeatureCollection":return RM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return df(t);default:throw new Error("unknown GeoJSON type")}}function u0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=d0(t.properties),i.geometry=df(t.geometry),i}function d0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=d0(n):i[e]=n}),i}function RM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return u0(e)}),i}function df(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return df(e)}),i):(i.coordinates=p0(t.coordinates),i)}function p0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return p0(e)})}function f0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=QT(t),o=[];switch(n){case"LineString":o=pf(t);break;case"MultiLineString":case"Polygon":Ri(t).forEach(function(r){o.push(pf(r))});break;case"MultiPolygon":Ri(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(pf(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ri(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Xt({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function pf(t){var i=Ri(t);if(i.length===2&&!g0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&m0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,g0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return m0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function g0(t,i){return t[0]===i[0]&&t[1]===i[1]}function m0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,g=u*f-d*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function FM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return zo(t,function(s){e+=s[0],n+=s[1],o++},!0),ht([e/o,n/o],i.properties)}function v0(t){if(!t)throw new Error("geojson is required");var i=[];return en(t,function(e){zM(e,i)}),Ot(i)}function zM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ri(n);break;case"LineString":e=[Ri(n)]}e.forEach(function(o){var s=LM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function LM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=OM(n,o),e.push(s),o}),e}function OM(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var ff={exports:{}},y0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(z,B,w){w===void 0&&(w={});var E={type:"Feature"};return(w.id===0||w.id)&&(E.id=w.id),w.bbox&&(E.bbox=w.bbox),E.properties=B||{},E.geometry=z,E}t.feature=i;function e(z,B,w){switch(z){case"Point":return n(B).geometry;case"LineString":return l(B).geometry;case"Polygon":return s(B).geometry;case"MultiPoint":return p(B).geometry;case"MultiLineString":return d(B).geometry;case"MultiPolygon":return f(B).geometry;default:throw new Error(z+" is invalid")}}t.geometry=e;function n(z,B,w){if(w===void 0&&(w={}),!z)throw new Error("coordinates is required");if(!Array.isArray(z))throw new Error("coordinates must be an Array");if(z.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!O(z[0])||!O(z[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:z};return i(E,B,w)}t.point=n;function o(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return n(E,B)}),w)}t.points=o;function s(z,B,w){w===void 0&&(w={});for(var E=0,D=z;E<D.length;E++){var L=D[E];if(L.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var G=0;G<L[L.length-1].length;G++)if(L[L.length-1][G]!==L[0][G])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:z};return i(Y,B,w)}t.polygon=s;function r(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return s(E,B)}),w)}t.polygons=r;function l(z,B,w){if(w===void 0&&(w={}),z.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:z};return i(E,B,w)}t.lineString=l;function c(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return l(E,B)}),w)}t.lineStrings=c;function u(z,B){B===void 0&&(B={});var w={type:"FeatureCollection"};return B.id&&(w.id=B.id),B.bbox&&(w.bbox=B.bbox),w.features=z,w}t.featureCollection=u;function d(z,B,w){w===void 0&&(w={});var E={type:"MultiLineString",coordinates:z};return i(E,B,w)}t.multiLineString=d;function p(z,B,w){w===void 0&&(w={});var E={type:"MultiPoint",coordinates:z};return i(E,B,w)}t.multiPoint=p;function f(z,B,w){w===void 0&&(w={});var E={type:"MultiPolygon",coordinates:z};return i(E,B,w)}t.multiPolygon=f;function g(z,B,w){w===void 0&&(w={});var E={type:"GeometryCollection",geometries:z};return i(E,B,w)}t.geometryCollection=g;function m(z,B){if(B===void 0&&(B=0),B&&!(B>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,B||0);return Math.round(z*w)/w}t.round=m;function y(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z*w}t.radiansToLength=y;function _(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z/w}t.lengthToRadians=_;function P(z,B){return S(_(z,B))}t.lengthToDegrees=P;function C(z){var B=z%360;return B<0&&(B+=360),B}t.bearingToAzimuth=C;function S(z){var B=z%(2*Math.PI);return B*180/Math.PI}t.radiansToDegrees=S;function x(z){var B=z%360;return B*Math.PI/180}t.degreesToRadians=x;function T(z,B,w){if(B===void 0&&(B="kilometers"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("length must be a positive number");return y(_(z,B),w)}t.convertLength=T;function R(z,B,w){if(B===void 0&&(B="meters"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("area must be a positive number");var E=t.areaFactors[B];if(!E)throw new Error("invalid original units");var D=t.areaFactors[w];if(!D)throw new Error("invalid final units");return z/E*D}t.convertArea=R;function O(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}t.isNumber=O;function N(z){return!!z&&z.constructor===Object}t.isObject=N;function V(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(function(B){if(!O(B))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function U(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}t.validateId=U})(y0);var Je={};const NM=Gm(YT);Object.defineProperty(Je,"__esModule",{value:!0});var wt=NM;function oa(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,m=g==="FeatureCollection",y=g==="Feature",_=m?t.features.length:1,P=0;P<_;P++){u=m?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var T=r.type;switch(d=e&&(T==="Polygon"||T==="MultiPolygon")?1:0,T){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,T==="MultiPoint"&&S++}T==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}T==="MultiLineString"&&S++,T==="Polygon"&&x++}T==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(oa(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function BM(t,i,e,n){var o=e;return oa(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function w0(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function VM(t,i,e){var n=e;return w0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function C0(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function UM(t,i,e){var n=e;return C0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function WM(t){var i=[];return oa(t,function(e){i.push(e)}),i}function gf(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",m=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:m?t.geometry:t,u=g?t.features[e].properties:m?t.properties:{},d=g?t.features[e].bbox:m?t.bbox:void 0,p=g?t.features[e].id:m?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function GM(t,i,e){var n=e;return gf(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function Mh(t,i){gf(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(wt.feature(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(wt.feature(p,o),n,u)===!1)return!1}})}function HM(t,i,e){var n=e;return Mh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function _0(t,i){Mh(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(oa(e,function(p,f,g,m,y){if(l===void 0||n>c||m>u||y>d){l=p,c=n,u=m,d=y,s=0;return}var _=wt.lineString([l,p],e.properties);if(i(_,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function $M(t,i,e){var n=e,o=!1;return _0(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function P0(t,i){if(!t)throw new Error("geojson is required");Mh(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(wt.lineString(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function qM(t,i,e){var n=e;return P0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function XM(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),wt.lineString([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),wt.lineString([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),wt.lineString([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),wt.lineString([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function YM(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return wt.point(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),wt.point(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),wt.point(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),wt.point(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),wt.point(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),wt.point(c[n][o][s],r,i)}throw new Error("geojson is invalid")}Je.coordAll=WM,Je.coordEach=oa,Je.coordReduce=BM,Je.featureEach=C0,Je.featureReduce=UM,Je.findPoint=YM,Je.findSegment=XM,Je.flattenEach=Mh,Je.flattenReduce=HM,Je.geomEach=gf,Je.geomReduce=GM,Je.lineEach=P0,Je.lineReduce=qM,Je.propEach=w0,Je.propReduce=VM,Je.segmentEach=_0,Je.segmentReduce=$M;var mf={};const ZM=Gm(sM);Object.defineProperty(mf,"__esModule",{value:!0});var QM=ZM;function vf(t){var i=[1/0,1/0,-1/0,-1/0];return QM.coordEach(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}vf.default=vf,mf.default=vf;var Ni=MM,b0=y0,S0=Je,Ys=mf.default,kM=S0.featureEach;S0.coordEach,b0.polygon;var E0=b0.featureCollection;function x0(t){var i=new Ni(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Ys(e),Ni.prototype.insert.call(this,e)},i.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ys(o),n.push(o)}):kM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ys(o),n.push(o)}),Ni.prototype.load.call(this,n)},i.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Ys(e),Ni.prototype.remove.call(this,e,n)},i.clear=function(){return Ni.prototype.clear.call(this)},i.search=function(e){var n=Ni.prototype.search.call(this,this.toBBox(e));return E0(n)},i.collides=function(e){return Ni.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Ni.prototype.all.call(this);return E0(e)},i.toJSON=function(){return Ni.prototype.toJSON.call(this)},i.fromJSON=function(e){return Ni.prototype.fromJSON.call(this,e)},i.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=Ys(e);else if(e.type==="FeatureCollection")n=Ys(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}ff.exports=x0,ff.exports.default=x0;var KM=ff.exports;const JM=Fc(KM);function yf(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Xt(t)),i.type==="LineString"&&(i=Xt(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=A0(t,i);return o&&n.push(o),Ot(n)}var s=JM();return s.load(v0(i)),Gs(v0(t),function(r){Gs(s.search(r),function(l){var c=A0(r,l);if(c){var u=Ri(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ot(n)}function A0(t,i){var e=Ri(t),n=Ri(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),g=(d-c)*(s-u)-(p-u)*(o-c),m=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=g/f,_=m/f;if(y>=0&&y<=1&&_>=0&&_<=1){var P=o+y*(r-o),C=s+y*(l-s);return ht([P,C])}return null}function Ih(t,i,e){e===void 0&&(e={});for(var n=Ah(t),o=Ri(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),jM(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function jM(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,g=u-l,m=d-c,y=p*m-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<=u:u<=s&&s<l:m>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<u:u<s&&s<=l:m>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<u:u<s&&s<l:m>0?c<r&&r<d:d<r&&r<c}else return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<=u:u<=s&&s<=l:m>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function eI(t,i){var e=Fi(t),n=Fi(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return tI(e,n);case"LineString":return Ih(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Pt(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return iI(e,n);case"LineString":return nI(e,n);case"Polygon":case"MultiPolygon":return oI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return sI(e,n);case"Polygon":case"MultiPolygon":return rI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return aI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function tI(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(M0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function iI(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)M0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function nI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ih(t.coordinates[n],i))return!1;e||(e=Ih(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function oI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=Pt(t.coordinates[1],i),!n){e=!1;break}n=Pt(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function sI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ih(t.coordinates[e],i))return!1;return!0}function rI(t,i){var e=Oo(i),n=Oo(t);if(!T0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!Pt(t.coordinates[s],i))return!1;if(o||(o=Pt(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=lI(t.coordinates[s],t.coordinates[s+1]);o=Pt(r,i,{ignoreBoundary:!0})}}return o}function aI(t,i){var e=Oo(t),n=Oo(i);if(!T0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!Pt(t.coordinates[0][o],i))return!1;return!0}function T0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function M0(t,i){return t[0]===i[0]&&t[1]===i[1]}function lI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function I0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/zi([o,s],[r,s],e),u=c*(r-o),d=i/zi([o,s],[o,l],e),p=d*(l-s),f=r-o,g=l-s,m=Math.floor(f/u),y=Math.floor(g/p),_=(f-m*u)/2,P=(g-y*p)/2,C=o+_;C<=r;){for(var S=s+P;S<=l;){var x=ht([C,S],e.properties);e.mask?eI(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Ot(n)}function wf(t,i){i===void 0&&(i={});var e=Fi(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return cI(e,i);case"MultiPolygon":return hI(e,i);default:throw new Error("invalid poly")}}function cI(t,i){i===void 0&&(i={});var e=Fi(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return D0(n,o)}function hI(t,i){i===void 0&&(i={});var e=Fi(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(D0(r,o))}),Ot(s)}function D0(t,i){return t.length>1?of(t,i):oi(t[0],i)}var R0=Object.prototype.toString,F0=function(i){var e=R0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&R0.call(i.callee)==="[object Function]"),n},Cf,z0;function uI(){if(z0)return Cf;z0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=F0,o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(g){var m=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",_=n(g),P=m&&e.call(g)==="[object String]",C=[];if(!m&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var S=r&&y;if(P&&g.length>0&&!i.call(g,0))for(var x=0;x<g.length;++x)C.push(String(x));if(_&&g.length>0)for(var T=0;T<g.length;++T)C.push(String(T));else for(var R in g)!(S&&R==="prototype")&&i.call(g,R)&&C.push(String(R));if(s)for(var O=p(g),N=0;N<l.length;++N)!(O&&l[N]==="constructor")&&i.call(g,l[N])&&C.push(l[N]);return C}}return Cf=t,Cf}var dI=Array.prototype.slice,pI=F0,L0=Object.keys,Dh=L0?function(i){return L0(i)}:uI(),O0=Object.keys;Dh.shim=function(){if(Object.keys){var i=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);i||(Object.keys=function(n){return pI(n)?O0(dI.call(n)):O0(n)})}else Object.keys=Dh;return Object.keys||Dh};var N0=Dh,B0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0},fI=B0,_f=function(){return fI()&&!!Symbol.toStringTag},V0=Object,U0=Error,gI=EvalError,mI=RangeError,vI=ReferenceError,W0=SyntaxError,Zs=TypeError,yI=URIError,wI=Math.abs,CI=Math.floor,_I=Math.max,PI=Math.min,bI=Math.pow,SI=Math.round,EI=Number.isNaN||function(i){return i!==i},xI=EI,AI=function(i){return xI(i)||i===0?i:i<0?-1:1},TI=Object.getOwnPropertyDescriptor,Rh=TI;if(Rh)try{Rh([],"length")}catch{Rh=null}var Qs=Rh,Fh=Object.defineProperty||!1;if(Fh)try{Fh({},"a",{value:1})}catch{Fh=!1}var zh=Fh,Pf,G0;function MI(){if(G0)return Pf;G0=1;var t=typeof Symbol<"u"&&Symbol,i=B0;return Pf=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},Pf}var H0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,II=V0,$0=II.getPrototypeOf||null,DI="Function.prototype.bind called on incompatible ",RI=Object.prototype.toString,FI=Math.max,zI="[object Function]",q0=function(i,e){for(var n=[],o=0;o<i.length;o+=1)n[o]=i[o];for(var s=0;s<e.length;s+=1)n[s+i.length]=e[s];return n},LI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},OI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},NI=function(i){var e=this;if(typeof e!="function"||RI.apply(e)!==zI)throw new TypeError(DI+e);for(var n=LI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,q0(n,arguments));return Object(d)===d?d:this}return e.apply(i,q0(n,arguments))},r=FI(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+OI(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},BI=NI,sa=Function.prototype.bind||BI,bf=Function.prototype.call,Sf=Function.prototype.apply,VI=typeof Reflect<"u"&&Reflect&&Reflect.apply,UI=sa,WI=Sf,GI=bf,HI=VI,X0=HI||UI.call(GI,WI),$I=sa,qI=Zs,XI=bf,YI=X0,Ef=function(i){if(i.length<1||typeof i[0]!="function")throw new qI("a function is required");return YI($I,XI,i)},ZI=Ef,Y0=Qs,Z0;try{Z0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var xf=!!Z0&&Y0&&Y0(Object.prototype,"__proto__"),Q0=Object,k0=Q0.getPrototypeOf,QI=xf&&typeof xf.get=="function"?ZI([xf.get]):typeof k0=="function"?function(i){return k0(i==null?i:Q0(i))}:!1,K0=H0,J0=$0,j0=QI,ew=K0?function(i){return K0(i)}:J0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return J0(i)}:j0?function(i){return j0(i)}:null,kI=Function.prototype.call,KI=Object.prototype.hasOwnProperty,JI=sa,tw=JI.call(kI,KI),me,jI=V0,eD=U0,tD=gI,iD=mI,nD=vI,ks=W0,Ks=Zs,oD=yI,sD=wI,rD=CI,aD=_I,lD=PI,cD=bI,hD=SI,uD=AI,iw=Function,Af=function(t){try{return iw('"use strict"; return ('+t+").constructor;")()}catch{}},ra=Qs,dD=zh,Tf=function(){throw new Ks},pD=ra?function(){try{return arguments.callee,Tf}catch{try{return ra(arguments,"callee").get}catch{return Tf}}}():Tf,Js=MI()(),nt=ew,fD=$0,gD=H0,nw=Sf,aa=bf,js={},mD=typeof Uint8Array>"u"||!nt?me:nt(Uint8Array),No={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":Js&&nt?nt([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":js,"%AsyncGenerator%":js,"%AsyncGeneratorFunction%":js,"%AsyncIteratorPrototype%":js,"%Atomics%":typeof Atomics>"u"?me:Atomics,"%BigInt%":typeof BigInt>"u"?me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":eD,"%eval%":eval,"%EvalError%":tD,"%Float16Array%":typeof Float16Array>"u"?me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?me:FinalizationRegistry,"%Function%":iw,"%GeneratorFunction%":js,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Js&&nt?nt(nt([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Js||!nt?me:nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":jI,"%Object.getOwnPropertyDescriptor%":ra,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":iD,"%ReferenceError%":nD,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Js||!nt?me:nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Js&&nt?nt(""[Symbol.iterator]()):me,"%Symbol%":Js?Symbol:me,"%SyntaxError%":ks,"%ThrowTypeError%":pD,"%TypedArray%":mD,"%TypeError%":Ks,"%Uint8Array%":typeof Uint8Array>"u"?me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?me:Uint32Array,"%URIError%":oD,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":aa,"%Function.prototype.apply%":nw,"%Object.defineProperty%":dD,"%Object.getPrototypeOf%":fD,"%Math.abs%":sD,"%Math.floor%":rD,"%Math.max%":aD,"%Math.min%":lD,"%Math.pow%":cD,"%Math.round%":hD,"%Math.sign%":uD,"%Reflect.getPrototypeOf%":gD};if(nt)try{null.error}catch(t){var vD=nt(nt(t));No["%Error.prototype%"]=vD}var yD=function t(i){var e;if(i==="%AsyncFunction%")e=Af("async function () {}");else if(i==="%GeneratorFunction%")e=Af("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=Af("async function* () {}");else if(i==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(i==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&nt&&(e=nt(o.prototype))}return No[i]=e,e},ow={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},la=sa,Lh=tw,wD=la.call(aa,Array.prototype.concat),CD=la.call(nw,Array.prototype.splice),sw=la.call(aa,String.prototype.replace),Oh=la.call(aa,String.prototype.slice),_D=la.call(aa,RegExp.prototype.exec),PD=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bD=/\\(\\)?/g,SD=function(i){var e=Oh(i,0,1),n=Oh(i,-1);if(e==="%"&&n!=="%")throw new ks("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new ks("invalid intrinsic syntax, expected opening `%`");var o=[];return sw(i,PD,function(s,r,l,c){o[o.length]=l?sw(c,bD,"$1"):r||s}),o},ED=function(i,e){var n=i,o;if(Lh(ow,n)&&(o=ow[n],n="%"+o[0]+"%"),Lh(No,n)){var s=No[n];if(s===js&&(s=yD(n)),typeof s>"u"&&!e)throw new Ks("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new ks("intrinsic "+i+" does not exist!")},rw=function(i,e){if(typeof i!="string"||i.length===0)throw new Ks("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ks('"allowMissing" argument must be a boolean');if(_D(/^%?[^%]*%?$/,i)===null)throw new ks("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=SD(i),o=n.length>0?n[0]:"",s=ED("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],CD(n,wD([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Oh(f,0,1),m=Oh(f,-1);if((g==='"'||g==="'"||g==="`"||m==='"'||m==="'"||m==="`")&&g!==m)throw new ks("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Lh(No,r))l=No[r];else if(l!=null){if(!(f in l)){if(!e)throw new Ks("base intrinsic for "+i+" exists, but the property is not available.");return}if(ra&&d+1>=n.length){var y=ra(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Lh(l,f),l=l[f];p&&!c&&(No[r]=l)}}return l},aw=rw,lw=Ef,xD=lw([aw("%String.prototype.indexOf%")]),Mf=function(i,e){var n=aw(i,!!e);return typeof n=="function"&&xD(i,".prototype.")>-1?lw([n]):n},AD=_f(),TD=Mf,If=TD("Object.prototype.toString"),Nh=function(i){return AD&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:If(i)==="[object Arguments]"},cw=function(i){return Nh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&If(i)!=="[object Array]"&&"callee"in i&&If(i.callee)==="[object Function]"},MD=function(){return Nh(arguments)}();Nh.isLegacyArguments=cw;var ID=MD?Nh:cw,hw=zh,DD=W0,er=Zs,uw=Qs,Df=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new er("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new er("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new er("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new er("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new er("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new er("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!uw&&uw(i,e);if(hw)hw(i,e,{configurable:r===null&&c?c.configurable:!r,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:s===null&&c?c.writable:!s});else if(l||!o&&!s&&!r)i[e]=n;else throw new DD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Rf=zh,dw=function(){return!!Rf};dw.hasArrayLengthDefineBug=function(){if(!Rf)return null;try{return Rf([],"length",{value:1}).length!==1}catch{return!0}};var Ff=dw,RD=N0,FD=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",zD=Object.prototype.toString,LD=Array.prototype.concat,pw=Df,OD=function(t){return typeof t=="function"&&zD.call(t)==="[object Function]"},fw=Ff(),ND=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!OD(n)||!n())return}fw?pw(t,i,e,!0):pw(t,i,e)},gw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=RD(i);FD&&(n=LD.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)ND(t,n[o],i[n[o]],e[n[o]])};gw.supportsDescriptors=!!fw;var ca=gw,mw={exports:{}},BD=rw,vw=Df,VD=Ff(),yw=Qs,ww=Zs,UD=BD("%Math.floor%"),WD=function(i,e){if(typeof i!="function")throw new ww("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||UD(e)!==e)throw new ww("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&yw){var r=yw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(VD?vw(i,"length",e,!0,!0):vw(i,"length",e)),i},GD=sa,HD=Sf,$D=X0,qD=function(){return $D(GD,HD,arguments)};(function(t){var i=WD,e=zh,n=Ef,o=qD;t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(mw);var Cw=mw.exports,_w=function(t){return t!==t},Pw=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||_w(i)&&_w(e))},XD=Pw,bw=function(){return typeof Object.is=="function"?Object.is:XD},YD=bw,ZD=ca,QD=function(){var i=YD();return ZD(Object,{is:i},{is:function(){return Object.is!==i}}),i},kD=ca,KD=Cw,JD=Pw,Sw=bw,jD=QD,Ew=KD(Sw(),Object);kD(Ew,{getPolyfill:Sw,implementation:JD,shim:jD});var e2=Ew,xw=Mf,t2=_f(),i2=tw,n2=Qs,zf;if(t2){var o2=xw("RegExp.prototype.exec"),Aw={},Lf=function(){throw Aw},Tw={toString:Lf,valueOf:Lf};typeof Symbol.toPrimitive=="symbol"&&(Tw[Symbol.toPrimitive]=Lf),zf=function(i){if(!i||typeof i!="object")return!1;var e=n2(i,"lastIndex"),n=e&&i2(e,"value");if(!n)return!1;try{o2(i,Tw)}catch(o){return o===Aw}}}else{var s2=xw("Object.prototype.toString"),r2="[object RegExp]";zf=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:s2(i)===r2}}var a2=zf,ha=function(){return typeof(function(){}).name=="string"},ua=Object.getOwnPropertyDescriptor;if(ua)try{ua([],"length")}catch{ua=null}ha.functionsHaveConfigurableNames=function(){if(!ha()||!ua)return!1;var i=ua(function(){},"name");return!!i&&!!i.configurable};var l2=Function.prototype.bind;ha.boundFunctionsHaveNames=function(){return ha()&&typeof l2=="function"&&(function(){}).bind().name!==""};var c2=ha,Mw=Df,h2=Ff(),u2=c2.functionsHaveConfigurableNames(),d2=Zs,p2=function(i,e){if(typeof i!="function")throw new d2("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||u2)&&(h2?Mw(i,"name",e,!0,!0):Mw(i,"name",e)),i},f2=p2,g2=Zs,m2=Object,Iw=f2(function(){if(this==null||this!==m2(this))throw new g2("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),v2=Iw,y2=ca.supportsDescriptors,w2=Object.getOwnPropertyDescriptor,Dw=function(){if(y2&&/a/mig.flags==="gim"){var i=w2(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),i.get.call(n),e==="dy")return i.get}}return v2},C2=ca.supportsDescriptors,_2=Dw,P2=Qs,b2=Object.defineProperty,S2=U0,Rw=ew,E2=/a/,x2=function(){if(!C2||!Rw)throw new S2("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=_2(),e=Rw(E2),n=P2(e,"flags");return(!n||n.get!==i)&&b2(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},A2=ca,T2=Cw,M2=Iw,Fw=Dw,I2=x2,zw=T2(Fw());A2(zw,{getPolyfill:Fw,implementation:M2,shim:I2});var D2=zw,Lw=Mf,R2=Lw("Date.prototype.getDay"),F2=function(i){try{return R2(i),!0}catch{return!1}},z2=Lw("Object.prototype.toString"),L2="[object Date]",O2=_f(),N2=function(i){return typeof i!="object"||i===null?!1:O2?F2(i):z2(i)===L2},Ow=N0,Nw=ID,Bw=e2,Vw=a2,Uw=D2,Ww=N2,Gw=Date.prototype.getTime;function Hw(t,i,e){var n=e||{};return(n.strict?Bw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?Bw(t,i):t==i:B2(t,i,n)}function $w(t){return t==null}function qw(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function B2(t,i,e){var n,o;if(typeof t!=typeof i||$w(t)||$w(i)||t.prototype!==i.prototype||Nw(t)!==Nw(i))return!1;var s=Vw(t),r=Vw(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Uw(t)===Uw(i);if(Ww(t)&&Ww(i))return Gw.call(t)===Gw.call(i);var l=qw(t),c=qw(i);if(l!==c)return!1;if(l||c){if(t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}if(typeof t!=typeof i)return!1;try{var u=Ow(t),d=Ow(i)}catch{return!1}if(u.length!==d.length)return!1;for(u.sort(),d.sort(),n=u.length-1;n>=0;n--)if(u[n]!=d[n])return!1;for(n=u.length-1;n>=0;n--)if(o=u[n],!Hw(t[o],i[o],e))return!1;return!0}var V2=Hw;function U2(t,i){var e=!0;return en(t,function(n){en(i,function(o){if(e===!1)return!1;e=W2(n.geometry,o.geometry)})}),e}function W2(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!q2(t.coordinates,i.coordinates);case"LineString":return!Xw(i,t);case"Polygon":return!Pt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Xw(t,i);case"LineString":return!G2(t,i);case"Polygon":return!Yw(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Pt(i,t);case"LineString":return!Yw(t,i);case"Polygon":return!H2(i,t)}}return!1}function Xw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if($2(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function G2(t,i){var e=yf(t,i);return e.features.length>0}function Yw(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(Pt(o,t))return!0}var s=yf(i,wf(t));return s.features.length>0}function H2(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(Pt(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(Pt(l,t))return!0}var c=yf(wf(t),wf(i));return c.features.length>0}function $2(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function q2(t,i){return t[0]===i[0]&&t[1]===i[1]}var X2=V2,Bi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:Y2};Bi.prototype.compare=function(t,i){if(t.type!==i.type||!Qw(t,i))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,i.coordinates);case"LineString":return this.compareLine(t.coordinates,i.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,i);case"Feature":return this.compareFeature(t,i);default:if(t.type.indexOf("Multi")===0){var e=this,n=Zw(t),o=Zw(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function Zw(t){return t.coordinates.map(function(i){return{type:t.type.replace("Multi",""),coordinates:i}})}function Qw(t,i){return t.hasOwnProperty("coordinates")?t.coordinates.length===i.coordinates.length:t.length===i.length}Bi.prototype.compareCoord=function(t,i){if(t.length!==i.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==i[e].toFixed(this.precision))return!1;return!0},Bi.prototype.compareLine=function(t,i,e,n){if(!Qw(t,i))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?i:this.removePseudo(i);if(!(n&&!this.compareCoord(o[0],s[0])&&(s=this.fixStartIndex(s,o),!s))){var r=this.compareCoord(o[e],s[e]);return this.direction||r?this.comparePath(o,s):this.compareCoord(o[e],s[s.length-(1+e)])?this.comparePath(o.slice().reverse(),s):!1}},Bi.prototype.fixStartIndex=function(t,i){for(var e,n=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],i[0])){n=o;break}return n>=0&&(e=[].concat(t.slice(n,t.length),t.slice(1,n+1))),e},Bi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Bi.prototype.comparePolygon=function(t,i){if(this.compareLine(t.coordinates[0],i.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),n=i.coordinates.slice(1,i.coordinates.length),o=this;return e.every(function(s){return this.some(function(r){return o.compareLine(s,r,1,!0)})},n)}else return!1},Bi.prototype.compareFeature=function(t,i){return t.id!==i.id||!this.objectComparator(t.properties,i.properties)||!this.compareBBox(t,i)?!1:this.compare(t.geometry,i.geometry)},Bi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Bi.prototype.removePseudo=function(t){return t};function Y2(t,i){return X2(t,i,{strict:!0})}var Z2=Bi;const Q2=Fc(Z2);function k2(t,i){var e=Fi(t).type,n=Fi(i).type;if(e!==n)return!1;var o=new Q2({precision:6});return o.compare(f0(t),f0(i))}function K2(t,i){var e=!1;return en(t,function(n){en(i,function(o){if(e===!0)return!0;e=!U2(n.geometry,o.geometry)})}),e}/**
1857
+ `,kn=class kn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_player");v(this,"_finalImageUrlReact",this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));v(this,"_routePaths",this.disposeVar(a.react(void 0)));v(this,"routePathCallback");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this._id.value=n),this._player=this.disposeVar(new a.Player);{const g=kn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],m=>m??g.loop,m=>m??g.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],m=>m??g.currentTime,m=>m??g.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],m=>m??g.duration,m=>m??g.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],m=>m??g.playing,m=>m??g.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],m=>m??g.speed,m=>m??g.speed))}const o=this.disposeVar(a.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),s=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{this.routePaths=void 0;const m=o.value;if(m)try{const _=await(await fetch(m)).json();this.routePaths=hM(_,this.width,this.repeatLength);return}catch(y){console.error(`geojson加载解析出错!${y}`),console.error(y)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const y=this.positionsSet;if(y){this.routePaths=y.map(_=>({positions:_,width:this.width}));return}}}));{const g=()=>{s.restart()};g();const m=this.disposeVar(a.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(m.disposableOn(g))}{const g=()=>{const m=Eu(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);m&&(this.routePathCallback=m)};g(),this.dispose(this.routePathCallbackStrChanged.disposableOn(g))}const r=e.viewer;if(!r){console.warn("viewer is undefined!");return}const l=this.finalImageUrlReact,c=this.disposeVar(new os),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const m=Dm(r.scene.context).getTextureHandler(l.value);if(m instanceof os)c.reset(m);else{const y=await g.promise(m);c.reset(y)}})),d=()=>c.valid?c.raw:r.scene.context.defaultTexture,p=()=>u.restart();p(),this.dispose(l.changed.disposableOn(p));const f=this.ad(a.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new a.ObjResettingWithEvent(f,()=>this.routePaths?new xM(r,this,l.value&&d||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(g=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))ne(r,this.routePaths[0].startPos,r.camera.positionCartographic.height,void 0,g);else{const m=computeBoundingSphere(this.routePaths[0].positions);if(!m)return;const[y,_]=m;ne(r,y,_*3,void 0,g)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get finalImageUrlReact(){return this._finalImageUrlReact}get routePaths(){return this._routePaths.value}set routePaths(e){this._routePaths.value=e}get routePathsChanged(){return this._routePaths.changed}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}};v(kn,"whiteGradientImageBase64",AM),v(kn,"defaultRoutePathCallback",function(e,n,o){const s=n/50,r=s-Math.floor(s);return e.color=[r*.5+.5,(1-r)*.5+.5,.5,1],e.bgColor=[r*.5+.5,(1-r)*.5+.5,.5,.3],e}),v(kn,"routePathCallbackStrMd",TM),v(kn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(kn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let nn=kn;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:a.reactPositionsSet(void 0),data:a.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(nn||(nn={})),a.extendClassProps(nn.prototype,nn.createDefaultProps);class Vn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new nn(e,n)),this.dispose(a.track([this._collection,"show"],[this,"show"])),this.dispose(a.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(a.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(a.track([this._collection,"color"],[this,"color"])),this.dispose(a.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(a.track([this._collection,"width"],[this,"width"])),this.dispose(a.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(a.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(a.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(a.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(a.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(a.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(a.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([this._collection,"playing"],[this,"playing"])),this.dispose(a.track([this._collection,"loop"],[this,"loop"])),this.dispose(a.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._collection,"duration"],[this,"duration"])),this.dispose(a.bind([this._collection,"speed"],[this,"speed"]));{const o=()=>{this.color=[this.bgColor[0],this.bgColor[1],this.bgColor[2],1]};o(),this.ad(this.bgColorChanged.don(o))}this.dispose(this.flyToEvent.disposableOn(o=>{this._collection.flyTo(o)}));{const o=()=>{if(!this.positions){this._collection.data=void 0;return}if(this.heightRatio===0){this._collection.data=[{positions:this.positions,width:this.width}];return}if(this.positions.length>=2){this._collection.data=this.positions.map((r,l)=>{var c;if(!(!this.positions||l==((c=this.positions)==null?void 0:c.length)-1))return{startPos:r,endPos:this.positions[l+1],width:this.width,heightRatio:this.heightRatio}}).filter(r=>r!==void 0);return}this._collection.data=void 0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(s.disposableOn(o))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get collection(){return this._collection}get player(){return this.collection.player}get ratio(){return this.player.ratio}set ratio(e){this.player.ratio=e}get ratioChanged(){return this.player.ratioChanged}}v(Vn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Vn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png"),(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:a.reactArray([0,1,0,1]),bgColor:a.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:a.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Vn||(Vn={})),a.extendClassProps(Vn.prototype,Vn.createDefaultProps);const Bl=class Bl extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Vn(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmSignalTransmission;{const r=()=>{s.show=e.show&&e.stroked};r(),this.ad(e.showChanged.don(r)),this.ad(e.strokedChanged.don(r))}this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"bgColor"],[e,"strokeColor"])),this.dispose(a.track([s,"startTime"],[e,"startTime"])),this.dispose(a.track([s,"transmissionTime"],[e,"transmissionTime"])),this.dispose(a.track([s,"heightRatio"],[e,"heightRatio"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"brightening"],[e,"brightening"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"bidirectional"],[e,"bidirectional"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"currentTime"],[e,"currentTime"])),this.dispose(a.track([s,"duration"],[e,"duration"])),this.dispose(a.track([s,"playing"],[e,"playing"])),this.dispose(a.track([s,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmSignalTransmission:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Bl,"type",Bl.register("ESCesiumViewer",Ph.type,Bl));let uf=Bl;function Oo(t){var i=[1/0,1/0,-1/0,-1/0];return zo(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}Oo.default=Oo;var c0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(yo,function(){function e(C,S,x,T,R){(function O(N,V,U,z,B){for(;z>U;){if(z-U>600){var w=z-U+1,E=V-U+1,D=Math.log(w),L=.5*Math.exp(2*D/3),G=.5*Math.sqrt(D*L*(w-L)/w)*(E-w/2<0?-1:1),Y=Math.max(U,Math.floor(V-E*L/w+G)),q=Math.min(z,Math.floor(V+(w-E)*L/w+G));O(N,V,Y,q,B)}var X=N[V],Q=U,ee=z;for(n(N,U,V),B(N[z],X)>0&&n(N,U,z);Q<ee;){for(n(N,Q,ee),Q++,ee--;B(N[Q],X)<0;)Q++;for(;B(N[ee],X)>0;)ee--}B(N[U],X)===0?n(N,U,ee):n(N,++ee,z),ee<=V&&(U=ee+1),V<=ee&&(z=ee-1)}})(C,S,x||0,T||C.length-1,R||o)}function n(C,S,x){var T=C[S];C[S]=C[x],C[x]=T}function o(C,S){return C<S?-1:C>S?1:0}var s=function(C){C===void 0&&(C=9),this._maxEntries=Math.max(4,C),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function r(C,S,x){if(!x)return S.indexOf(C);for(var T=0;T<S.length;T++)if(x(C,S[T]))return T;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,T,R){R||(R=_(null)),R.minX=1/0,R.minY=1/0,R.maxX=-1/0,R.maxY=-1/0;for(var O=S;O<x;O++){var N=C.children[O];u(R,C.leaf?T(N):N)}return R}function u(C,S){return C.minX=Math.min(C.minX,S.minX),C.minY=Math.min(C.minY,S.minY),C.maxX=Math.max(C.maxX,S.maxX),C.maxY=Math.max(C.maxY,S.maxY),C}function d(C,S){return C.minX-S.minX}function p(C,S){return C.minY-S.minY}function f(C){return(C.maxX-C.minX)*(C.maxY-C.minY)}function g(C){return C.maxX-C.minX+(C.maxY-C.minY)}function m(C,S){return C.minX<=S.minX&&C.minY<=S.minY&&S.maxX<=C.maxX&&S.maxY<=C.maxY}function y(C,S){return S.minX<=C.maxX&&S.minY<=C.maxY&&S.maxX>=C.minX&&S.maxY>=C.minY}function _(C){return{children:C,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function P(C,S,x,T,R){for(var O=[S,x];O.length;)if(!((x=O.pop())-(S=O.pop())<=T)){var N=S+Math.ceil((x-S)/T/2)*T;e(C,N,S,x,R),O.push(S,N,N,x)}}return s.prototype.all=function(){return this._all(this.data,[])},s.prototype.search=function(C){var S=this.data,x=[];if(!y(C,S))return x;for(var T=this.toBBox,R=[];S;){for(var O=0;O<S.children.length;O++){var N=S.children[O],V=S.leaf?T(N):N;y(C,V)&&(S.leaf?x.push(N):m(C,V)?this._all(N,x):R.push(N))}S=R.pop()}return x},s.prototype.collides=function(C){var S=this.data;if(!y(C,S))return!1;for(var x=[];S;){for(var T=0;T<S.children.length;T++){var R=S.children[T],O=S.leaf?this.toBBox(R):R;if(y(C,O)){if(S.leaf||m(C,O))return!0;x.push(R)}}S=x.pop()}return!1},s.prototype.load=function(C){if(!C||!C.length)return this;if(C.length<this._minEntries){for(var S=0;S<C.length;S++)this.insert(C[S]);return this}var x=this._build(C.slice(),0,C.length-1,0);if(this.data.children.length)if(this.data.height===x.height)this._splitRoot(this.data,x);else{if(this.data.height<x.height){var T=this.data;this.data=x,x=T}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},s.prototype.insert=function(C){return C&&this._insert(C,this.data.height-1),this},s.prototype.clear=function(){return this.data=_([]),this},s.prototype.remove=function(C,S){if(!C)return this;for(var x,T,R,O=this.data,N=this.toBBox(C),V=[],U=[];O||V.length;){if(O||(O=V.pop(),T=V[V.length-1],x=U.pop(),R=!0),O.leaf){var z=r(C,O.children,S);if(z!==-1)return O.children.splice(z,1),V.push(O),this._condense(V),this}R||O.leaf||!m(O,N)?T?(x++,O=T.children[x],R=!1):O=null:(V.push(O),U.push(x),x=0,T=O,O=O.children[0])}return this},s.prototype.toBBox=function(C){return C},s.prototype.compareMinX=function(C,S){return C.minX-S.minX},s.prototype.compareMinY=function(C,S){return C.minY-S.minY},s.prototype.toJSON=function(){return this.data},s.prototype.fromJSON=function(C){return this.data=C,this},s.prototype._all=function(C,S){for(var x=[];C;)C.leaf?S.push.apply(S,C.children):x.push.apply(x,C.children),C=x.pop();return S},s.prototype._build=function(C,S,x,T){var R,O=x-S+1,N=this._maxEntries;if(O<=N)return l(R=_(C.slice(S,x+1)),this.toBBox),R;T||(T=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,T-1))),(R=_([])).leaf=!1,R.height=T;var V=Math.ceil(O/N),U=V*Math.ceil(Math.sqrt(N));P(C,S,x,U,this.compareMinX);for(var z=S;z<=x;z+=U){var B=Math.min(z+U-1,x);P(C,z,B,V,this.compareMinY);for(var w=z;w<=B;w+=V){var E=Math.min(w+V-1,B);R.children.push(this._build(C,w,E,T-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,T){for(;T.push(S),!S.leaf&&T.length-1!==x;){for(var R=1/0,O=1/0,N=void 0,V=0;V<S.children.length;V++){var U=S.children[V],z=f(U),B=(w=C,E=U,(Math.max(E.maxX,w.maxX)-Math.min(E.minX,w.minX))*(Math.max(E.maxY,w.maxY)-Math.min(E.minY,w.minY))-z);B<O?(O=B,R=z<R?z:R,N=U):B===O&&z<R&&(R=z,N=U)}S=N||S.children[0]}var w,E;return S},s.prototype._insert=function(C,S,x){var T=x?C:this.toBBox(C),R=[],O=this._chooseSubtree(T,this.data,S,R);for(O.children.push(C),u(O,T);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(T,R,S)},s.prototype._split=function(C,S){var x=C[S],T=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,T);var O=this._chooseSplitIndex(x,R,T),N=_(x.children.splice(O,x.children.length-O));N.height=x.height,N.leaf=x.leaf,l(x,this.toBBox),l(N,this.toBBox),S?C[S-1].children.push(N):this._splitRoot(x,N)},s.prototype._splitRoot=function(C,S){this.data=_([C,S]),this.data.height=C.height+1,this.data.leaf=!1,l(this.data,this.toBBox)},s.prototype._chooseSplitIndex=function(C,S,x){for(var T,R,O,N,V,U,z,B=1/0,w=1/0,E=S;E<=x-S;E++){var D=c(C,0,E,this.toBBox),L=c(C,E,x,this.toBBox),G=(R=D,O=L,N=void 0,V=void 0,U=void 0,z=void 0,N=Math.max(R.minX,O.minX),V=Math.max(R.minY,O.minY),U=Math.min(R.maxX,O.maxX),z=Math.min(R.maxY,O.maxY),Math.max(0,U-N)*Math.max(0,z-V)),Y=f(D)+f(L);G<B?(B=G,T=E,w=Y<w?Y:w):G===B&&Y<w&&(w=Y,T=E)}return T||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var T=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,T)<this._allDistMargin(C,S,x,R)&&C.children.sort(T)},s.prototype._allDistMargin=function(C,S,x,T){C.children.sort(T);for(var R=this.toBBox,O=c(C,0,S,R),N=c(C,x-S,x,R),V=g(O)+g(N),U=S;U<x-S;U++){var z=C.children[U];u(O,C.leaf?R(z):z),V+=g(O)}for(var B=x-S-1;B>=S;B--){var w=C.children[B];u(N,C.leaf?R(w):w),V+=g(N)}return V},s.prototype._adjustParentBBoxes=function(C,S,x){for(var T=x;T>=0;T--)u(S[T],C)},s.prototype._condense=function(C){for(var S=C.length-1,x=void 0;S>=0;S--)C[S].children.length===0?S>0?(x=C[S-1].children).splice(x.indexOf(C[S]),1):this.clear():l(C[S],this.toBBox)},s})})(c0);var MM=c0.exports;function Pt(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!i)throw new Error("polygon is required");var n=Ah(t),o=Fi(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&IM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(h0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)h0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function h0(t,i,e){var n=!1;i[0][0]===i[i.length-1][0]&&i[0][1]===i[i.length-1][1]&&(i=i.slice(0,i.length-1));for(var o=0,s=i.length-1;o<i.length;s=o++){var r=i[o][0],l=i[o][1],c=i[s][0],u=i[s][1],d=t[1]*(r-c)+l*(c-t[0])+u*(t[0]-r)===0&&(r-t[0])*(c-t[0])<=0&&(l-t[1])*(u-t[1])<=0;if(d)return!e;var p=l>t[1]!=u>t[1]&&t[0]<(c-r)*(t[1]-l)/(u-l)+r;p&&(n=!n)}return n}function IM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function DM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return u0(t);case"FeatureCollection":return RM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return df(t);default:throw new Error("unknown GeoJSON type")}}function u0(t){var i={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:i[e]=t[e]}}),i.properties=d0(t.properties),i.geometry=df(t.geometry),i}function d0(t){var i={};return t&&Object.keys(t).forEach(function(e){var n=t[e];typeof n=="object"?n===null?i[e]=null:Array.isArray(n)?i[e]=n.map(function(o){return o}):i[e]=d0(n):i[e]=n}),i}function RM(t){var i={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:i[e]=t[e]}}),i.features=t.features.map(function(e){return u0(e)}),i}function df(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return df(e)}),i):(i.coordinates=p0(t.coordinates),i)}function p0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return p0(e)})}function f0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=QT(t),o=[];switch(n){case"LineString":o=pf(t);break;case"MultiLineString":case"Polygon":Ri(t).forEach(function(r){o.push(pf(r))});break;case"MultiPolygon":Ri(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(pf(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ri(t).forEach(function(r){var l=r.join("-");Object.prototype.hasOwnProperty.call(s,l)||(o.push(r),s[l]=!0)});break;default:throw new Error(n+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:n,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):Xt({type:n,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function pf(t){var i=Ri(t);if(i.length===2&&!g0(i[0],i[1]))return i;var e=[],n=i.length-1,o=e.length;e.push(i[0]);for(var s=1;s<n;s++){var r=e[e.length-1];i[s][0]===r[0]&&i[s][1]===r[1]||(e.push(i[s]),o=e.length,o>2&&m0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(i[i.length-1]),o=e.length,g0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return m0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function g0(t,i){return t[0]===i[0]&&t[1]===i[1]}function m0(t,i,e){var n=e[0],o=e[1],s=t[0],r=t[1],l=i[0],c=i[1],u=n-s,d=o-r,p=l-s,f=c-r,g=u*f-d*p;return g!==0?!1:Math.abs(p)>=Math.abs(f)?p>0?s<=n&&n<=l:l<=n&&n<=s:f>0?r<=o&&o<=c:c<=o&&o<=r}function FM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return zo(t,function(s){e+=s[0],n+=s[1],o++},!0),ht([e/o,n/o],i.properties)}function v0(t){if(!t)throw new Error("geojson is required");var i=[];return en(t,function(e){zM(e,i)}),Ot(i)}function zM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ri(n);break;case"LineString":e=[Ri(n)]}e.forEach(function(o){var s=LM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function LM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=OM(n,o),e.push(s),o}),e}function OM(t,i){var e=t[0],n=t[1],o=i[0],s=i[1],r=e<o?e:o,l=n<s?n:s,c=e>o?e:o,u=n>s?n:s;return[r,l,c,u]}var ff={exports:{}},y0={};(function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.earthRadius=63710088e-1,t.factors={centimeters:t.earthRadius*100,centimetres:t.earthRadius*100,degrees:t.earthRadius/111325,feet:t.earthRadius*3.28084,inches:t.earthRadius*39.37,kilometers:t.earthRadius/1e3,kilometres:t.earthRadius/1e3,meters:t.earthRadius,metres:t.earthRadius,miles:t.earthRadius/1609.344,millimeters:t.earthRadius*1e3,millimetres:t.earthRadius*1e3,nauticalmiles:t.earthRadius/1852,radians:1,yards:t.earthRadius*1.0936},t.unitsFactors={centimeters:100,centimetres:100,degrees:1/111325,feet:3.28084,inches:39.37,kilometers:1/1e3,kilometres:1/1e3,meters:1,metres:1,miles:1/1609.344,millimeters:1e3,millimetres:1e3,nauticalmiles:1/1852,radians:1/t.earthRadius,yards:1.0936133},t.areaFactors={acres:247105e-9,centimeters:1e4,centimetres:1e4,feet:10.763910417,hectares:1e-4,inches:1550.003100006,kilometers:1e-6,kilometres:1e-6,meters:1,metres:1,miles:386e-9,millimeters:1e6,millimetres:1e6,yards:1.195990046};function i(z,B,w){w===void 0&&(w={});var E={type:"Feature"};return(w.id===0||w.id)&&(E.id=w.id),w.bbox&&(E.bbox=w.bbox),E.properties=B||{},E.geometry=z,E}t.feature=i;function e(z,B,w){switch(z){case"Point":return n(B).geometry;case"LineString":return l(B).geometry;case"Polygon":return s(B).geometry;case"MultiPoint":return p(B).geometry;case"MultiLineString":return d(B).geometry;case"MultiPolygon":return f(B).geometry;default:throw new Error(z+" is invalid")}}t.geometry=e;function n(z,B,w){if(w===void 0&&(w={}),!z)throw new Error("coordinates is required");if(!Array.isArray(z))throw new Error("coordinates must be an Array");if(z.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!O(z[0])||!O(z[1]))throw new Error("coordinates must contain numbers");var E={type:"Point",coordinates:z};return i(E,B,w)}t.point=n;function o(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return n(E,B)}),w)}t.points=o;function s(z,B,w){w===void 0&&(w={});for(var E=0,D=z;E<D.length;E++){var L=D[E];if(L.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var G=0;G<L[L.length-1].length;G++)if(L[L.length-1][G]!==L[0][G])throw new Error("First and last Position are not equivalent.")}var Y={type:"Polygon",coordinates:z};return i(Y,B,w)}t.polygon=s;function r(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return s(E,B)}),w)}t.polygons=r;function l(z,B,w){if(w===void 0&&(w={}),z.length<2)throw new Error("coordinates must be an array of two or more positions");var E={type:"LineString",coordinates:z};return i(E,B,w)}t.lineString=l;function c(z,B,w){return w===void 0&&(w={}),u(z.map(function(E){return l(E,B)}),w)}t.lineStrings=c;function u(z,B){B===void 0&&(B={});var w={type:"FeatureCollection"};return B.id&&(w.id=B.id),B.bbox&&(w.bbox=B.bbox),w.features=z,w}t.featureCollection=u;function d(z,B,w){w===void 0&&(w={});var E={type:"MultiLineString",coordinates:z};return i(E,B,w)}t.multiLineString=d;function p(z,B,w){w===void 0&&(w={});var E={type:"MultiPoint",coordinates:z};return i(E,B,w)}t.multiPoint=p;function f(z,B,w){w===void 0&&(w={});var E={type:"MultiPolygon",coordinates:z};return i(E,B,w)}t.multiPolygon=f;function g(z,B,w){w===void 0&&(w={});var E={type:"GeometryCollection",geometries:z};return i(E,B,w)}t.geometryCollection=g;function m(z,B){if(B===void 0&&(B=0),B&&!(B>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,B||0);return Math.round(z*w)/w}t.round=m;function y(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z*w}t.radiansToLength=y;function _(z,B){B===void 0&&(B="kilometers");var w=t.factors[B];if(!w)throw new Error(B+" units is invalid");return z/w}t.lengthToRadians=_;function P(z,B){return S(_(z,B))}t.lengthToDegrees=P;function C(z){var B=z%360;return B<0&&(B+=360),B}t.bearingToAzimuth=C;function S(z){var B=z%(2*Math.PI);return B*180/Math.PI}t.radiansToDegrees=S;function x(z){var B=z%360;return B*Math.PI/180}t.degreesToRadians=x;function T(z,B,w){if(B===void 0&&(B="kilometers"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("length must be a positive number");return y(_(z,B),w)}t.convertLength=T;function R(z,B,w){if(B===void 0&&(B="meters"),w===void 0&&(w="kilometers"),!(z>=0))throw new Error("area must be a positive number");var E=t.areaFactors[B];if(!E)throw new Error("invalid original units");var D=t.areaFactors[w];if(!D)throw new Error("invalid final units");return z/E*D}t.convertArea=R;function O(z){return!isNaN(z)&&z!==null&&!Array.isArray(z)}t.isNumber=O;function N(z){return!!z&&z.constructor===Object}t.isObject=N;function V(z){if(!z)throw new Error("bbox is required");if(!Array.isArray(z))throw new Error("bbox must be an Array");if(z.length!==4&&z.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");z.forEach(function(B){if(!O(B))throw new Error("bbox must only contain numbers")})}t.validateBBox=V;function U(z){if(!z)throw new Error("id is required");if(["string","number"].indexOf(typeof z)===-1)throw new Error("id must be a number or a string")}t.validateId=U})(y0);var Je={};const NM=Gm(YT);Object.defineProperty(Je,"__esModule",{value:!0});var wt=NM;function oa(t,i,e){if(t!==null)for(var n,o,s,r,l,c,u,d=0,p=0,f,g=t.type,m=g==="FeatureCollection",y=g==="Feature",_=m?t.features.length:1,P=0;P<_;P++){u=m?t.features[P].geometry:y?t.geometry:t,f=u?u.type==="GeometryCollection":!1,l=f?u.geometries.length:1;for(var C=0;C<l;C++){var S=0,x=0;if(r=f?u.geometries[C]:u,r!==null){c=r.coordinates;var T=r.type;switch(d=e&&(T==="Polygon"||T==="MultiPolygon")?1:0,T){case null:break;case"Point":if(i(c,p,P,S,x)===!1)return!1;p++,S++;break;case"LineString":case"MultiPoint":for(n=0;n<c.length;n++){if(i(c[n],p,P,S,x)===!1)return!1;p++,T==="MultiPoint"&&S++}T==="LineString"&&S++;break;case"Polygon":case"MultiLineString":for(n=0;n<c.length;n++){for(o=0;o<c[n].length-d;o++){if(i(c[n][o],p,P,S,x)===!1)return!1;p++}T==="MultiLineString"&&S++,T==="Polygon"&&x++}T==="Polygon"&&S++;break;case"MultiPolygon":for(n=0;n<c.length;n++){for(x=0,o=0;o<c[n].length;o++){for(s=0;s<c[n][o].length-d;s++){if(i(c[n][o][s],p,P,S,x)===!1)return!1;p++}x++}S++}break;case"GeometryCollection":for(n=0;n<r.geometries.length;n++)if(oa(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function BM(t,i,e,n){var o=e;return oa(t,function(s,r,l,c,u){r===0&&e===void 0?o=s:o=i(o,s,r,l,c,u)},n),o}function w0(t,i){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&i(t.features[e].properties,e)!==!1;e++);break;case"Feature":i(t.properties,0);break}}function VM(t,i,e){var n=e;return w0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function C0(t,i){if(t.type==="Feature")i(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&i(t.features[e],e)!==!1;e++);}function UM(t,i,e){var n=e;return C0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function WM(t){var i=[];return oa(t,function(e){i.push(e)}),i}function gf(t,i){var e,n,o,s,r,l,c,u,d,p,f=0,g=t.type==="FeatureCollection",m=t.type==="Feature",y=g?t.features.length:1;for(e=0;e<y;e++){for(l=g?t.features[e].geometry:m?t.geometry:t,u=g?t.features[e].properties:m?t.properties:{},d=g?t.features[e].bbox:m?t.bbox:void 0,p=g?t.features[e].id:m?t.id:void 0,c=l?l.type==="GeometryCollection":!1,r=c?l.geometries.length:1,o=0;o<r;o++){if(s=c?l.geometries[o]:l,s===null){if(i(null,f,u,d,p)===!1)return!1;continue}switch(s.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(i(s,f,u,d,p)===!1)return!1;break}case"GeometryCollection":{for(n=0;n<s.geometries.length;n++)if(i(s.geometries[n],f,u,d,p)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function GM(t,i,e){var n=e;return gf(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function Mh(t,i){gf(t,function(e,n,o,s,r){var l=e===null?null:e.type;switch(l){case null:case"Point":case"LineString":case"Polygon":return i(wt.feature(e,o,{bbox:s,id:r}),n,0)===!1?!1:void 0}var c;switch(l){case"MultiPoint":c="Point";break;case"MultiLineString":c="LineString";break;case"MultiPolygon":c="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var d=e.coordinates[u],p={type:c,coordinates:d};if(i(wt.feature(p,o),n,u)===!1)return!1}})}function HM(t,i,e){var n=e;return Mh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function _0(t,i){Mh(t,function(e,n,o){var s=0;if(e.geometry){var r=e.geometry.type;if(!(r==="Point"||r==="MultiPoint")){var l,c=0,u=0,d=0;if(oa(e,function(p,f,g,m,y){if(l===void 0||n>c||m>u||y>d){l=p,c=n,u=m,d=y,s=0;return}var _=wt.lineString([l,p],e.properties);if(i(_,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function $M(t,i,e){var n=e,o=!1;return _0(t,function(s,r,l,c,u){o===!1&&e===void 0?n=s:n=i(n,s,r,l,c,u),o=!0}),n}function P0(t,i){if(!t)throw new Error("geojson is required");Mh(t,function(e,n,o){if(e.geometry!==null){var s=e.geometry.type,r=e.geometry.coordinates;switch(s){case"LineString":if(i(e,n,o,0,0)===!1)return!1;break;case"Polygon":for(var l=0;l<r.length;l++)if(i(wt.lineString(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function qM(t,i,e){var n=e;return P0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function XM(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.segmentIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":case"MultiPoint":return null;case"LineString":return s<0&&(s=c.length+s-1),wt.lineString([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),wt.lineString([c[o][s],c[o][s+1]],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s-1),wt.lineString([c[n][s],c[n][s+1]],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s-1),wt.lineString([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function YM(t,i){if(i=i||{},!wt.isObject(i))throw new Error("options is invalid");var e=i.featureIndex||0,n=i.multiFeatureIndex||0,o=i.geometryIndex||0,s=i.coordIndex||0,r=i.properties,l;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),r=r||t.features[e].properties,l=t.features[e].geometry;break;case"Feature":r=r||t.properties,l=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":l=t;break;default:throw new Error("geojson is invalid")}if(l===null)return null;var c=l.coordinates;switch(l.type){case"Point":return wt.point(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),wt.point(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),wt.point(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),wt.point(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),wt.point(c[n][s],r,i);case"MultiPolygon":return n<0&&(n=c.length+n),o<0&&(o=c[n].length+o),s<0&&(s=c[n][o].length-s),wt.point(c[n][o][s],r,i)}throw new Error("geojson is invalid")}Je.coordAll=WM,Je.coordEach=oa,Je.coordReduce=BM,Je.featureEach=C0,Je.featureReduce=UM,Je.findPoint=YM,Je.findSegment=XM,Je.flattenEach=Mh,Je.flattenReduce=HM,Je.geomEach=gf,Je.geomReduce=GM,Je.lineEach=P0,Je.lineReduce=qM,Je.propEach=w0,Je.propReduce=VM,Je.segmentEach=_0,Je.segmentReduce=$M;var mf={};const ZM=Gm(sM);Object.defineProperty(mf,"__esModule",{value:!0});var QM=ZM;function vf(t){var i=[1/0,1/0,-1/0,-1/0];return QM.coordEach(t,function(e){i[0]>e[0]&&(i[0]=e[0]),i[1]>e[1]&&(i[1]=e[1]),i[2]<e[0]&&(i[2]=e[0]),i[3]<e[1]&&(i[3]=e[1])}),i}vf.default=vf,mf.default=vf;var Ni=MM,b0=y0,S0=Je,Ys=mf.default,kM=S0.featureEach;S0.coordEach,b0.polygon;var E0=b0.featureCollection;function x0(t){var i=new Ni(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Ys(e),Ni.prototype.insert.call(this,e)},i.load=function(e){var n=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ys(o),n.push(o)}):kM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:Ys(o),n.push(o)}),Ni.prototype.load.call(this,n)},i.remove=function(e,n){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:Ys(e),Ni.prototype.remove.call(this,e,n)},i.clear=function(){return Ni.prototype.clear.call(this)},i.search=function(e){var n=Ni.prototype.search.call(this,this.toBBox(e));return E0(n)},i.collides=function(e){return Ni.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Ni.prototype.all.call(this);return E0(e)},i.toJSON=function(){return Ni.prototype.toJSON.call(this)},i.fromJSON=function(e){return Ni.prototype.fromJSON.call(this,e)},i.toBBox=function(e){var n;if(e.bbox)n=e.bbox;else if(Array.isArray(e)&&e.length===4)n=e;else if(Array.isArray(e)&&e.length===6)n=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")n=Ys(e);else if(e.type==="FeatureCollection")n=Ys(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}ff.exports=x0,ff.exports.default=x0;var KM=ff.exports;const JM=Fc(KM);function yf(t,i){var e={},n=[];if(t.type==="LineString"&&(t=Xt(t)),i.type==="LineString"&&(i=Xt(i)),t.type==="Feature"&&i.type==="Feature"&&t.geometry!==null&&i.geometry!==null&&t.geometry.type==="LineString"&&i.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&i.geometry.coordinates.length===2){var o=A0(t,i);return o&&n.push(o),Ot(n)}var s=JM();return s.load(v0(i)),Gs(v0(t),function(r){Gs(s.search(r),function(l){var c=A0(r,l);if(c){var u=Ri(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ot(n)}function A0(t,i){var e=Ri(t),n=Ri(i);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(n.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],s=e[0][1],r=e[1][0],l=e[1][1],c=n[0][0],u=n[0][1],d=n[1][0],p=n[1][1],f=(p-u)*(r-o)-(d-c)*(l-s),g=(d-c)*(s-u)-(p-u)*(o-c),m=(r-o)*(s-u)-(l-s)*(o-c);if(f===0)return null;var y=g/f,_=m/f;if(y>=0&&y<=1&&_>=0&&_<=1){var P=o+y*(r-o),C=s+y*(l-s);return ht([P,C])}return null}function Ih(t,i,e){e===void 0&&(e={});for(var n=Ah(t),o=Ri(i),s=0;s<o.length-1;s++){var r=!1;if(e.ignoreEndVertices&&(s===0&&(r="start"),s===o.length-2&&(r="end"),s===0&&s+1===o.length-1&&(r="both")),jM(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function jM(t,i,e,n,o){var s=e[0],r=e[1],l=t[0],c=t[1],u=i[0],d=i[1],p=e[0]-l,f=e[1]-c,g=u-l,m=d-c,y=p*m-f*g;if(o!==null){if(Math.abs(y)>o)return!1}else if(y!==0)return!1;if(n){if(n==="start")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<=u:u<=s&&s<l:m>0?c<r&&r<=d:d<=r&&r<c;if(n==="end")return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<u:u<s&&s<=l:m>0?c<=r&&r<d:d<r&&r<=c;if(n==="both")return Math.abs(g)>=Math.abs(m)?g>0?l<s&&s<u:u<s&&s<l:m>0?c<r&&r<d:d<r&&r<c}else return Math.abs(g)>=Math.abs(m)?g>0?l<=s&&s<=u:u<=s&&s<=l:m>0?c<=r&&r<=d:d<=r&&r<=c;return!1}function eI(t,i){var e=Fi(t),n=Fi(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return tI(e,n);case"LineString":return Ih(e,n,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return Pt(e,n,{ignoreBoundary:!0});default:throw new Error("feature2 "+s+" geometry not supported")}case"MultiPoint":switch(s){case"MultiPoint":return iI(e,n);case"LineString":return nI(e,n);case"Polygon":case"MultiPolygon":return oI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return sI(e,n);case"Polygon":case"MultiPolygon":return rI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return aI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function tI(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(M0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function iI(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)M0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function nI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ih(t.coordinates[n],i))return!1;e||(e=Ih(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function oI(t,i){for(var e=!0,n=!1,o=0;o<t.coordinates.length;o++){if(n=Pt(t.coordinates[1],i),!n){e=!1;break}n=Pt(t.coordinates[1],i,{ignoreBoundary:!0})}return e&&n}function sI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ih(t.coordinates[e],i))return!1;return!0}function rI(t,i){var e=Oo(i),n=Oo(t);if(!T0(e,n))return!1;for(var o=!1,s=0;s<t.coordinates.length-1;s++){if(!Pt(t.coordinates[s],i))return!1;if(o||(o=Pt(t.coordinates[s],i,{ignoreBoundary:!0})),!o){var r=lI(t.coordinates[s],t.coordinates[s+1]);o=Pt(r,i,{ignoreBoundary:!0})}}return o}function aI(t,i){var e=Oo(t),n=Oo(i);if(!T0(n,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!Pt(t.coordinates[0][o],i))return!1;return!0}function T0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function M0(t,i){return t[0]===i[0]&&t[1]===i[1]}function lI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function I0(t,i,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var n=[],o=t[0],s=t[1],r=t[2],l=t[3],c=i/zi([o,s],[r,s],e),u=c*(r-o),d=i/zi([o,s],[o,l],e),p=d*(l-s),f=r-o,g=l-s,m=Math.floor(f/u),y=Math.floor(g/p),_=(f-m*u)/2,P=(g-y*p)/2,C=o+_;C<=r;){for(var S=s+P;S<=l;){var x=ht([C,S],e.properties);e.mask?eI(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Ot(n)}function wf(t,i){i===void 0&&(i={});var e=Fi(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return cI(e,i);case"MultiPolygon":return hI(e,i);default:throw new Error("invalid poly")}}function cI(t,i){i===void 0&&(i={});var e=Fi(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return D0(n,o)}function hI(t,i){i===void 0&&(i={});var e=Fi(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(D0(r,o))}),Ot(s)}function D0(t,i){return t.length>1?of(t,i):oi(t[0],i)}var R0=Object.prototype.toString,F0=function(i){var e=R0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&R0.call(i.callee)==="[object Function]"),n},Cf,z0;function uI(){if(z0)return Cf;z0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=F0,o=Object.prototype.propertyIsEnumerable,s=!o.call({toString:null},"toString"),r=o.call(function(){},"prototype"),l=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],c=function(f){var g=f.constructor;return g&&g.prototype===f},u={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},d=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&i.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{c(window[f])}catch{return!0}}catch{return!0}return!1}(),p=function(f){if(typeof window>"u"||!d)return c(f);try{return c(f)}catch{return!1}};t=function(g){var m=g!==null&&typeof g=="object",y=e.call(g)==="[object Function]",_=n(g),P=m&&e.call(g)==="[object String]",C=[];if(!m&&!y&&!_)throw new TypeError("Object.keys called on a non-object");var S=r&&y;if(P&&g.length>0&&!i.call(g,0))for(var x=0;x<g.length;++x)C.push(String(x));if(_&&g.length>0)for(var T=0;T<g.length;++T)C.push(String(T));else for(var R in g)!(S&&R==="prototype")&&i.call(g,R)&&C.push(String(R));if(s)for(var O=p(g),N=0;N<l.length;++N)!(O&&l[N]==="constructor")&&i.call(g,l[N])&&C.push(l[N]);return C}}return Cf=t,Cf}var dI=Array.prototype.slice,pI=F0,L0=Object.keys,Dh=L0?function(i){return L0(i)}:uI(),O0=Object.keys;Dh.shim=function(){if(Object.keys){var i=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);i||(Object.keys=function(n){return pI(n)?O0(dI.call(n)):O0(n)})}else Object.keys=Dh;return Object.keys||Dh};var N0=Dh,B0=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var i={},e=Symbol("test"),n=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;i[e]=o;for(var s in i)return!1;if(typeof Object.keys=="function"&&Object.keys(i).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(i).length!==0)return!1;var r=Object.getOwnPropertySymbols(i);if(r.length!==1||r[0]!==e||!Object.prototype.propertyIsEnumerable.call(i,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(i,e);if(l.value!==o||l.enumerable!==!0)return!1}return!0},fI=B0,_f=function(){return fI()&&!!Symbol.toStringTag},V0=Object,U0=Error,gI=EvalError,mI=RangeError,vI=ReferenceError,W0=SyntaxError,Zs=TypeError,yI=URIError,wI=Math.abs,CI=Math.floor,_I=Math.max,PI=Math.min,bI=Math.pow,SI=Math.round,EI=Number.isNaN||function(i){return i!==i},xI=EI,AI=function(i){return xI(i)||i===0?i:i<0?-1:1},TI=Object.getOwnPropertyDescriptor,Rh=TI;if(Rh)try{Rh([],"length")}catch{Rh=null}var Qs=Rh,Fh=Object.defineProperty||!1;if(Fh)try{Fh({},"a",{value:1})}catch{Fh=!1}var zh=Fh,Pf,G0;function MI(){if(G0)return Pf;G0=1;var t=typeof Symbol<"u"&&Symbol,i=B0;return Pf=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},Pf}var H0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,II=V0,$0=II.getPrototypeOf||null,DI="Function.prototype.bind called on incompatible ",RI=Object.prototype.toString,FI=Math.max,zI="[object Function]",q0=function(i,e){for(var n=[],o=0;o<i.length;o+=1)n[o]=i[o];for(var s=0;s<e.length;s+=1)n[s+i.length]=e[s];return n},LI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},OI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},NI=function(i){var e=this;if(typeof e!="function"||RI.apply(e)!==zI)throw new TypeError(DI+e);for(var n=LI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,q0(n,arguments));return Object(d)===d?d:this}return e.apply(i,q0(n,arguments))},r=FI(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+OI(l,",")+"){ return binder.apply(this,arguments); }")(s),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},BI=NI,sa=Function.prototype.bind||BI,bf=Function.prototype.call,Sf=Function.prototype.apply,VI=typeof Reflect<"u"&&Reflect&&Reflect.apply,UI=sa,WI=Sf,GI=bf,HI=VI,X0=HI||UI.call(GI,WI),$I=sa,qI=Zs,XI=bf,YI=X0,Ef=function(i){if(i.length<1||typeof i[0]!="function")throw new qI("a function is required");return YI($I,XI,i)},ZI=Ef,Y0=Qs,Z0;try{Z0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var xf=!!Z0&&Y0&&Y0(Object.prototype,"__proto__"),Q0=Object,k0=Q0.getPrototypeOf,QI=xf&&typeof xf.get=="function"?ZI([xf.get]):typeof k0=="function"?function(i){return k0(i==null?i:Q0(i))}:!1,K0=H0,J0=$0,j0=QI,ew=K0?function(i){return K0(i)}:J0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return J0(i)}:j0?function(i){return j0(i)}:null,kI=Function.prototype.call,KI=Object.prototype.hasOwnProperty,JI=sa,tw=JI.call(kI,KI),me,jI=V0,eD=U0,tD=gI,iD=mI,nD=vI,ks=W0,Ks=Zs,oD=yI,sD=wI,rD=CI,aD=_I,lD=PI,cD=bI,hD=SI,uD=AI,iw=Function,Af=function(t){try{return iw('"use strict"; return ('+t+").constructor;")()}catch{}},ra=Qs,dD=zh,Tf=function(){throw new Ks},pD=ra?function(){try{return arguments.callee,Tf}catch{try{return ra(arguments,"callee").get}catch{return Tf}}}():Tf,Js=MI()(),nt=ew,fD=$0,gD=H0,nw=Sf,aa=bf,js={},mD=typeof Uint8Array>"u"||!nt?me:nt(Uint8Array),No={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":Js&&nt?nt([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":js,"%AsyncGenerator%":js,"%AsyncGeneratorFunction%":js,"%AsyncIteratorPrototype%":js,"%Atomics%":typeof Atomics>"u"?me:Atomics,"%BigInt%":typeof BigInt>"u"?me:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?me:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?me:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?me:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":eD,"%eval%":eval,"%EvalError%":tD,"%Float16Array%":typeof Float16Array>"u"?me:Float16Array,"%Float32Array%":typeof Float32Array>"u"?me:Float32Array,"%Float64Array%":typeof Float64Array>"u"?me:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?me:FinalizationRegistry,"%Function%":iw,"%GeneratorFunction%":js,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Js&&nt?nt(nt([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Js||!nt?me:nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":jI,"%Object.getOwnPropertyDescriptor%":ra,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":iD,"%ReferenceError%":nD,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Js||!nt?me:nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Js&&nt?nt(""[Symbol.iterator]()):me,"%Symbol%":Js?Symbol:me,"%SyntaxError%":ks,"%ThrowTypeError%":pD,"%TypedArray%":mD,"%TypeError%":Ks,"%Uint8Array%":typeof Uint8Array>"u"?me:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?me:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?me:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?me:Uint32Array,"%URIError%":oD,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":aa,"%Function.prototype.apply%":nw,"%Object.defineProperty%":dD,"%Object.getPrototypeOf%":fD,"%Math.abs%":sD,"%Math.floor%":rD,"%Math.max%":aD,"%Math.min%":lD,"%Math.pow%":cD,"%Math.round%":hD,"%Math.sign%":uD,"%Reflect.getPrototypeOf%":gD};if(nt)try{null.error}catch(t){var vD=nt(nt(t));No["%Error.prototype%"]=vD}var yD=function t(i){var e;if(i==="%AsyncFunction%")e=Af("async function () {}");else if(i==="%GeneratorFunction%")e=Af("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=Af("async function* () {}");else if(i==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(e=n.prototype)}else if(i==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&nt&&(e=nt(o.prototype))}return No[i]=e,e},ow={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},la=sa,Lh=tw,wD=la.call(aa,Array.prototype.concat),CD=la.call(nw,Array.prototype.splice),sw=la.call(aa,String.prototype.replace),Oh=la.call(aa,String.prototype.slice),_D=la.call(aa,RegExp.prototype.exec),PD=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,bD=/\\(\\)?/g,SD=function(i){var e=Oh(i,0,1),n=Oh(i,-1);if(e==="%"&&n!=="%")throw new ks("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new ks("invalid intrinsic syntax, expected opening `%`");var o=[];return sw(i,PD,function(s,r,l,c){o[o.length]=l?sw(c,bD,"$1"):r||s}),o},ED=function(i,e){var n=i,o;if(Lh(ow,n)&&(o=ow[n],n="%"+o[0]+"%"),Lh(No,n)){var s=No[n];if(s===js&&(s=yD(n)),typeof s>"u"&&!e)throw new Ks("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new ks("intrinsic "+i+" does not exist!")},rw=function(i,e){if(typeof i!="string"||i.length===0)throw new Ks("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Ks('"allowMissing" argument must be a boolean');if(_D(/^%?[^%]*%?$/,i)===null)throw new ks("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=SD(i),o=n.length>0?n[0]:"",s=ED("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],CD(n,wD([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Oh(f,0,1),m=Oh(f,-1);if((g==='"'||g==="'"||g==="`"||m==='"'||m==="'"||m==="`")&&g!==m)throw new ks("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Lh(No,r))l=No[r];else if(l!=null){if(!(f in l)){if(!e)throw new Ks("base intrinsic for "+i+" exists, but the property is not available.");return}if(ra&&d+1>=n.length){var y=ra(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Lh(l,f),l=l[f];p&&!c&&(No[r]=l)}}return l},aw=rw,lw=Ef,xD=lw([aw("%String.prototype.indexOf%")]),Mf=function(i,e){var n=aw(i,!!e);return typeof n=="function"&&xD(i,".prototype.")>-1?lw([n]):n},AD=_f(),TD=Mf,If=TD("Object.prototype.toString"),Nh=function(i){return AD&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:If(i)==="[object Arguments]"},cw=function(i){return Nh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&If(i)!=="[object Array]"&&"callee"in i&&If(i.callee)==="[object Function]"},MD=function(){return Nh(arguments)}();Nh.isLegacyArguments=cw;var ID=MD?Nh:cw,hw=zh,DD=W0,er=Zs,uw=Qs,Df=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new er("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new er("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new er("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new er("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new er("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new er("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,r=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,c=!!uw&&uw(i,e);if(hw)hw(i,e,{configurable:r===null&&c?c.configurable:!r,enumerable:o===null&&c?c.enumerable:!o,value:n,writable:s===null&&c?c.writable:!s});else if(l||!o&&!s&&!r)i[e]=n;else throw new DD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Rf=zh,dw=function(){return!!Rf};dw.hasArrayLengthDefineBug=function(){if(!Rf)return null;try{return Rf([],"length",{value:1}).length!==1}catch{return!0}};var Ff=dw,RD=N0,FD=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",zD=Object.prototype.toString,LD=Array.prototype.concat,pw=Df,OD=function(t){return typeof t=="function"&&zD.call(t)==="[object Function]"},fw=Ff(),ND=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!OD(n)||!n())return}fw?pw(t,i,e,!0):pw(t,i,e)},gw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=RD(i);FD&&(n=LD.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)ND(t,n[o],i[n[o]],e[n[o]])};gw.supportsDescriptors=!!fw;var ca=gw,mw={exports:{}},BD=rw,vw=Df,VD=Ff(),yw=Qs,ww=Zs,UD=BD("%Math.floor%"),WD=function(i,e){if(typeof i!="function")throw new ww("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||UD(e)!==e)throw new ww("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&yw){var r=yw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(VD?vw(i,"length",e,!0,!0):vw(i,"length",e)),i},GD=sa,HD=Sf,$D=X0,qD=function(){return $D(GD,HD,arguments)};(function(t){var i=WD,e=zh,n=Ef,o=qD;t.exports=function(r){var l=n(arguments),c=r.length-(arguments.length-1);return i(l,1+(c>0?c:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(mw);var Cw=mw.exports,_w=function(t){return t!==t},Pw=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||_w(i)&&_w(e))},XD=Pw,bw=function(){return typeof Object.is=="function"?Object.is:XD},YD=bw,ZD=ca,QD=function(){var i=YD();return ZD(Object,{is:i},{is:function(){return Object.is!==i}}),i},kD=ca,KD=Cw,JD=Pw,Sw=bw,jD=QD,Ew=KD(Sw(),Object);kD(Ew,{getPolyfill:Sw,implementation:JD,shim:jD});var eR=Ew,xw=Mf,tR=_f(),iR=tw,nR=Qs,zf;if(tR){var oR=xw("RegExp.prototype.exec"),Aw={},Lf=function(){throw Aw},Tw={toString:Lf,valueOf:Lf};typeof Symbol.toPrimitive=="symbol"&&(Tw[Symbol.toPrimitive]=Lf),zf=function(i){if(!i||typeof i!="object")return!1;var e=nR(i,"lastIndex"),n=e&&iR(e,"value");if(!n)return!1;try{oR(i,Tw)}catch(o){return o===Aw}}}else{var sR=xw("Object.prototype.toString"),rR="[object RegExp]";zf=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:sR(i)===rR}}var aR=zf,ha=function(){return typeof(function(){}).name=="string"},ua=Object.getOwnPropertyDescriptor;if(ua)try{ua([],"length")}catch{ua=null}ha.functionsHaveConfigurableNames=function(){if(!ha()||!ua)return!1;var i=ua(function(){},"name");return!!i&&!!i.configurable};var lR=Function.prototype.bind;ha.boundFunctionsHaveNames=function(){return ha()&&typeof lR=="function"&&(function(){}).bind().name!==""};var cR=ha,Mw=Df,hR=Ff(),uR=cR.functionsHaveConfigurableNames(),dR=Zs,pR=function(i,e){if(typeof i!="function")throw new dR("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||uR)&&(hR?Mw(i,"name",e,!0,!0):Mw(i,"name",e)),i},fR=pR,gR=Zs,mR=Object,Iw=fR(function(){if(this==null||this!==mR(this))throw new gR("RegExp.prototype.flags getter called on non-object");var i="";return this.hasIndices&&(i+="d"),this.global&&(i+="g"),this.ignoreCase&&(i+="i"),this.multiline&&(i+="m"),this.dotAll&&(i+="s"),this.unicode&&(i+="u"),this.unicodeSets&&(i+="v"),this.sticky&&(i+="y"),i},"get flags",!0),vR=Iw,yR=ca.supportsDescriptors,wR=Object.getOwnPropertyDescriptor,Dw=function(){if(yR&&/a/mig.flags==="gim"){var i=wR(RegExp.prototype,"flags");if(i&&typeof i.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(n,"sticky",{get:function(){e+="y"}}),i.get.call(n),e==="dy")return i.get}}return vR},CR=ca.supportsDescriptors,_R=Dw,PR=Qs,bR=Object.defineProperty,SR=U0,Rw=ew,ER=/a/,xR=function(){if(!CR||!Rw)throw new SR("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=_R(),e=Rw(ER),n=PR(e,"flags");return(!n||n.get!==i)&&bR(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},AR=ca,TR=Cw,MR=Iw,Fw=Dw,IR=xR,zw=TR(Fw());AR(zw,{getPolyfill:Fw,implementation:MR,shim:IR});var DR=zw,Lw=Mf,RR=Lw("Date.prototype.getDay"),FR=function(i){try{return RR(i),!0}catch{return!1}},zR=Lw("Object.prototype.toString"),LR="[object Date]",OR=_f(),NR=function(i){return typeof i!="object"||i===null?!1:OR?FR(i):zR(i)===LR},Ow=N0,Nw=ID,Bw=eR,Vw=aR,Uw=DR,Ww=NR,Gw=Date.prototype.getTime;function Hw(t,i,e){var n=e||{};return(n.strict?Bw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?Bw(t,i):t==i:BR(t,i,n)}function $w(t){return t==null}function qw(t){return!(!t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number")}function BR(t,i,e){var n,o;if(typeof t!=typeof i||$w(t)||$w(i)||t.prototype!==i.prototype||Nw(t)!==Nw(i))return!1;var s=Vw(t),r=Vw(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Uw(t)===Uw(i);if(Ww(t)&&Ww(i))return Gw.call(t)===Gw.call(i);var l=qw(t),c=qw(i);if(l!==c)return!1;if(l||c){if(t.length!==i.length)return!1;for(n=0;n<t.length;n++)if(t[n]!==i[n])return!1;return!0}if(typeof t!=typeof i)return!1;try{var u=Ow(t),d=Ow(i)}catch{return!1}if(u.length!==d.length)return!1;for(u.sort(),d.sort(),n=u.length-1;n>=0;n--)if(u[n]!=d[n])return!1;for(n=u.length-1;n>=0;n--)if(o=u[n],!Hw(t[o],i[o],e))return!1;return!0}var VR=Hw;function UR(t,i){var e=!0;return en(t,function(n){en(i,function(o){if(e===!1)return!1;e=WR(n.geometry,o.geometry)})}),e}function WR(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!qR(t.coordinates,i.coordinates);case"LineString":return!Xw(i,t);case"Polygon":return!Pt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Xw(t,i);case"LineString":return!GR(t,i);case"Polygon":return!Yw(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Pt(i,t);case"LineString":return!Yw(t,i);case"Polygon":return!HR(i,t)}}return!1}function Xw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if($R(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function GR(t,i){var e=yf(t,i);return e.features.length>0}function Yw(t,i){for(var e=0,n=i.coordinates;e<n.length;e++){var o=n[e];if(Pt(o,t))return!0}var s=yf(i,wf(t));return s.features.length>0}function HR(t,i){for(var e=0,n=t.coordinates[0];e<n.length;e++){var o=n[e];if(Pt(o,i))return!0}for(var s=0,r=i.coordinates[0];s<r.length;s++){var l=r[s];if(Pt(l,t))return!0}var c=yf(wf(t),wf(i));return c.features.length>0}function $R(t,i,e){var n=e[0]-t[0],o=e[1]-t[1],s=i[0]-t[0],r=i[1]-t[1],l=n*r-o*s;return l!==0?!1:Math.abs(s)>=Math.abs(r)?s>0?t[0]<=e[0]&&e[0]<=i[0]:i[0]<=e[0]&&e[0]<=t[0]:r>0?t[1]<=e[1]&&e[1]<=i[1]:i[1]<=e[1]&&e[1]<=t[1]}function qR(t,i){return t[0]===i[0]&&t[1]===i[1]}var XR=VR,Bi=function(t){this.precision=t&&t.precision?t.precision:17,this.direction=t&&t.direction?t.direction:!1,this.pseudoNode=t&&t.pseudoNode?t.pseudoNode:!1,this.objectComparator=t&&t.objectComparator?t.objectComparator:YR};Bi.prototype.compare=function(t,i){if(t.type!==i.type||!Qw(t,i))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,i.coordinates);case"LineString":return this.compareLine(t.coordinates,i.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,i);case"Feature":return this.compareFeature(t,i);default:if(t.type.indexOf("Multi")===0){var e=this,n=Zw(t),o=Zw(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function Zw(t){return t.coordinates.map(function(i){return{type:t.type.replace("Multi",""),coordinates:i}})}function Qw(t,i){return t.hasOwnProperty("coordinates")?t.coordinates.length===i.coordinates.length:t.length===i.length}Bi.prototype.compareCoord=function(t,i){if(t.length!==i.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==i[e].toFixed(this.precision))return!1;return!0},Bi.prototype.compareLine=function(t,i,e,n){if(!Qw(t,i))return!1;var o=this.pseudoNode?t:this.removePseudo(t),s=this.pseudoNode?i:this.removePseudo(i);if(!(n&&!this.compareCoord(o[0],s[0])&&(s=this.fixStartIndex(s,o),!s))){var r=this.compareCoord(o[e],s[e]);return this.direction||r?this.comparePath(o,s):this.compareCoord(o[e],s[s.length-(1+e)])?this.comparePath(o.slice().reverse(),s):!1}},Bi.prototype.fixStartIndex=function(t,i){for(var e,n=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],i[0])){n=o;break}return n>=0&&(e=[].concat(t.slice(n,t.length),t.slice(1,n+1))),e},Bi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Bi.prototype.comparePolygon=function(t,i){if(this.compareLine(t.coordinates[0],i.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),n=i.coordinates.slice(1,i.coordinates.length),o=this;return e.every(function(s){return this.some(function(r){return o.compareLine(s,r,1,!0)})},n)}else return!1},Bi.prototype.compareFeature=function(t,i){return t.id!==i.id||!this.objectComparator(t.properties,i.properties)||!this.compareBBox(t,i)?!1:this.compare(t.geometry,i.geometry)},Bi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Bi.prototype.removePseudo=function(t){return t};function YR(t,i){return XR(t,i,{strict:!0})}var ZR=Bi;const QR=Fc(ZR);function kR(t,i){var e=Fi(t).type,n=Fi(i).type;if(e!==n)return!1;var o=new QR({precision:6});return o.compare(f0(t),f0(i))}function KR(t,i){var e=!1;return en(t,function(n){en(i,function(o){if(e===!0)return!0;e=!UR(n.geometry,o.geometry)})}),e}/**
1858
1858
  * splaytree v3.1.2
1859
1859
  * Fast Splay tree for Node and browser
1860
1860
  *
@@ -1874,8 +1874,8 @@ function (result, this, instanceIndex, frameState) {
1874
1874
 
1875
1875
  See the Apache Version 2.0 License for specific language governing permissions
1876
1876
  and limitations under the License.
1877
- ***************************************************************************** */function J2(t,i){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=i.call(t,e)}catch(d){u=[6,d],o=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Un=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function j2(t,i){return t>i?1:t<i?-1:0}function Wn(t,i,e){for(var n=new Un(null,null),o=n,s=n;;){var r=e(t,i.key);if(r<0){if(i.left===null)break;if(e(t,i.left.key)<0){var l=i.left;if(i.left=l.right,l.right=i,i=l,i.left===null)break}s.left=i,s=i,i=i.left}else if(r>0){if(i.right===null)break;if(e(t,i.right.key)>0){var l=i.right;if(i.right=l.left,l.left=i,i=l,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,s.left=i.right,i.left=n.right,i.right=n.left,i}function Of(t,i,e,n){var o=new Un(t,i);if(e===null)return o.left=o.right=null,o;e=Wn(t,e,n);var s=n(t,e.key);return s<0?(o.left=e.left,o.right=e,e.left=null):s>=0&&(o.right=e.right,o.left=e,e.right=null),o}function kw(t,i,e){var n=null,o=null;if(i){i=Wn(t,i,e);var s=e(i.key,t);s===0?(n=i.left,o=i.right):s<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function eR(t,i,e){return i===null?t:(t===null||(i=Wn(t.key,i,e),i.left=t),i)}function Nf(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1878
- `);var s=i+(e?" ":"│ ");t.left&&Nf(t.left,s,!1,n,o),t.right&&Nf(t.right,s,!0,n,o)}}var Bf=function(){function t(i){i===void 0&&(i=j2),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=Of(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Un(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Wn(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=Wn(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Wn(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=Wn(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=Wn(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return iR(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&Wf(i,e,0,o-1,s),this._root===null)this._root=Vf(i,e,0,o),this._size=o;else{var r=nR(this.toList(),tR(i,e),s);o=this._size+o,this._root=Uf({head:r},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return Nf(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=kw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=Of(e,n,l,o):r=Of(e,n,r,o),this._root=eR(r,l,o)},t.prototype.split=function(i){return kw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return J2(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Vf(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Un(r,l);return c.left=Vf(t,i,e,s),c.right=Vf(t,i,s+1,n),c}return null}function tR(t,i){for(var e=new Un(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Un(t[o],i[o]);return n.next=null,e.next}function iR(t){for(var i=t,e=[],n=!1,o=new Un(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function Uf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Uf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Uf(t,o+1,e),r}return null}function nR(t,i,e){for(var n=new Un(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function Wf(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}Wf(t,i,e,l,o),Wf(t,i,l+1,n,o)}}const on=11102230246251565e-32,Ct=134217729,oR=(3+8*on)*on;function Gf(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let g=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[g++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[g++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[g++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[g++]=l);return(s!==0||g===0)&&(o[g++]=s),g}function sR(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function da(t){return new Float64Array(t)}const rR=(3+16*on)*on,aR=(2+12*on)*on,lR=(9+64*on)*on*on,tr=da(4),Kw=da(8),Jw=da(12),jw=da(16),bt=da(4);function cR(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,m,y,_,P,C,S,x,T,R,O,N;const V=t-o,U=e-o,z=i-s,B=n-s;x=V*B,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*B,y=f-(f-B),_=B-y,T=m*_-(x-g*y-m*y-g*_),R=z*U,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,tr[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,tr[1]=S-(P+p)+(p-R),N=C+P,p=N-C,tr[2]=C-(N-p)+(P-p),tr[3]=N;let w=sR(4,tr),E=aR*r;if(w>=E||-w>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-U,u=e-(U+p)+(p-o),p=i-z,c=i-(z+p)+(p-s),p=n-B,d=n-(B+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=lR*r+oR*Math.abs(w),w+=V*d+B*l-(z*u+U*c),w>=E||-w>=E))return w;x=l*B,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*B,y=f-(f-B),_=B-y,T=m*_-(x-g*y-m*y-g*_),R=c*U,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,bt[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const D=Gf(4,tr,4,bt,Kw);x=V*d,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*d,y=f-(f-d),_=d-y,T=m*_-(x-g*y-m*y-g*_),R=z*u,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,bt[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const L=Gf(D,Kw,4,bt,Jw);x=l*d,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*d,y=f-(f-d),_=d-y,T=m*_-(x-g*y-m*y-g*_),R=c*u,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,bt[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const G=Gf(L,Jw,4,bt,jw);return jw[G-1]}function hR(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=rR*u?c:-cR(t,i,e,n,o,s,u)}const pa=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Hf=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Gn=Number.EPSILON;Gn===void 0&&(Gn=Math.pow(2,-52));const uR=Gn*Gn,eC=(t,i)=>{if(-Gn<t&&t<Gn&&-Gn<i&&i<Gn)return 0;const e=t-i;return e*e<uR*t*i?0:t<i?-1:1};class dR{constructor(){this.reset()}reset(){this.xRounder=new tC,this.yRounder=new tC}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class tC{constructor(){this.tree=new Bf,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&eC(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&eC(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const fa=new dR,Bh=(t,i)=>t.x*i.y-t.y*i.x,iC=(t,i)=>t.x*i.x+t.y*i.y,nC=(t,i,e)=>{const n=hR(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Vh=t=>Math.sqrt(iC(t,t)),pR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Bh(o,n)/Vh(o)/Vh(n)},fR=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return iC(o,n)/Vh(o)/Vh(n)},oC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},sC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},gR=(t,i,e,n)=>{if(i.x===0)return sC(e,n,t.x);if(n.x===0)return sC(t,i,e.x);if(i.y===0)return oC(e,n,t.y);if(n.y===0)return oC(t,i,e.y);const o=Bh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Bh(s,i)/o,l=Bh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,g=(d+p)/2;return{x:f,y:g}};class si{static compare(i,e){const n=si.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Hn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:pR(this.point,i.point,s.point),cosine:fR(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let mR=0;class Hn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,g=d-c,m=r-o;if(p>f&&g<m)return 1;if(p<f&&g>m)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++mR,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=si.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new si(o,!0),u=new si(s,!1);return new Hn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=Hf(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=pa(e,l)&&this.comparePoint(l)===0,d=pa(n,s)&&i.comparePoint(s)===0,p=pa(e,c)&&this.comparePoint(c)===0,f=pa(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const g=gR(s,this.vector(),l,i.vector());return g===null||!pa(o,g)?null:fa.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new si(i,!0),s=new si(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Hn(o,r,this.rings.slice(),this.windings.slice());return si.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),si.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Hn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(vi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===vi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${vi.type}`)}return this._isInResult}}class rC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=fa.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=fa.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Hn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Hn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class vR{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new rC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const s=new rC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class aC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const s=new vR(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class Uh{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,_=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${_.x}, ${_.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,_=p.length;y<_;y++)if(p[y].point===l.point){g=y;break}if(g!==null){const y=p.splice(g)[0],_=u.splice(y.index);_.unshift(_[0].otherSE),e.push(new Uh(_.reverse()));continue}p.push({index:u.length,point:l.point});const m=l.getLeftmostComparator(r);c=f.sort(m)[0].otherSE;break}e.push(new Uh(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;nC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];nC(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];si.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class lC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class yR{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new lC(s));else{const r=s.enclosingRing();r.poly||e.push(new lC(r)),r.poly.addInterior(s)}}return e}}class wR{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.compare;this.queue=i,this.tree=new Bf(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=si.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const cC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,CR=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class _R{run(i,e,n){vi.type=i,fa.reset();const o=[new aC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new aC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Hf(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(vi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let m=p+1,y=o.length;m<y;m++)if(Hf(g.bbox,o[m].bbox)===null)return[]}const s=new Bf(si.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let m=0,y=g.length;m<y;m++)if(s.insert(g[m]),s.size>cC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new wR(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>cC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>CR)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let g=0,m=f.length;g<m;g++){const y=f[g];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}fa.reset();const u=Uh.factory(r.segments);return new yR(u).getGeom()}}const vi=new _R;var PR={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("difference",t,e)}};function Wh(t,i,e){e===void 0&&(e={});var n=Fi(t),o=Fi(i),s=PR.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?it(s[0],e.properties):sf(s,e.properties)}function bR(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/zi([o,c],[r,c],e),p=d*(r-o),f=i*2/zi([u,s],[u,l],e),g=f*(l-s),m=p/2,y=m*2,_=Math.sqrt(3)/2*g,P=r-o,C=l-s,S=3/4*y,x=_,T=(P-y)/(y-m/2),R=Math.floor(T),O=(R*S-m/2-P)/2-m/2+S/2,N=Math.floor((C-_)/_),V=(C-N*_)/2,U=N*_-C>_/2;U&&(V-=_/4);for(var z=[],B=[],w=0;w<6;w++){var E=2*Math.PI/6*w;z.push(Math.cos(E)),B.push(Math.sin(E))}for(var D=[],L=0;L<=R;L++)for(var G=0;G<=N;G++){var Y=L%2===1;if(!(G===0&&Y)&&!(G===0&&U)){var q=L*S+o-O,X=G*x+s+V;if(Y&&(X-=_/2),e.triangles===!0)ER([q,X],p/2,g/2,JSON.parse(n),z,B).forEach(function(ee){e.mask?Wh(e.mask,ee)&&D.push(ee):D.push(ee)});else{var Q=SR([q,X],p/2,g/2,JSON.parse(n),z,B);e.mask?Wh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Ot(D)}function SR(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),it([r],n)}function ER(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(it([c],n))}return r}function xR(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/zi([s,r],[l,r],n),d=u*(l-s),p=e/zi([s,r],[s,c],n),f=p*(c-r),g=l-s,m=c-r,y=Math.floor(g/d),_=Math.floor(m/f),P=(g-y*d)/2,C=(m-_*f)/2,S=s+P,x=0;x<y;x++){for(var T=r+C,R=0;R<_;R++){var O=it([[[S,T],[S,T+f],[S+d,T+f],[S+d,T],[S,T]]],n.properties);n.mask?K2(n.mask,O)&&o.push(O):o.push(O),T+=f}S+=d}return Ot(o)}function AR(t,i,e){return e===void 0&&(e={}),xR(t,i,i,e)}function TR(t,i,e){e===void 0&&(e={});for(var n=[],o=i/zi([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/zi([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&d%2===0?(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),g=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Wh(e.mask,f)&&n.push(f),Wh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Ot(n)}function MR(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(ZT(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=Oo(t),l;switch(n){case"point":case"points":l=I0(r,i,e);break;case"square":case"squares":l=AR(r,i,e);break;case"hex":case"hexes":l=bR(r,i,e);break;case"triangle":case"triangles":l=TR(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Gs(l,function(u){var d=0,p=0;Gs(t,function(g){var m=n==="point"?u:FM(u),y=zi(m,g,e),_;if(o!==void 0&&(_=g.properties[o]),_===void 0&&(_=g.geometry.coordinates[2]),_===void 0)throw new Error("zValue is missing");y===0&&(d=_);var P=1/Math.pow(y,s);p+=P,d+=P*_});var f=DM(u);f.properties[o]=d/p,c.push(f)}),Ot(c)}function IR(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const hC=(t=0)=>new Promise(i=>setTimeout(i,t));function DR(t,i){const e=Ot(t.map(c=>ht(c))),n=it([t]);return MR(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Pt(ht(c),n))}function RR(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return wr(e)}function FR(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const Vl=class Vl extends qt{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new vo(n,e.id));this.czmPointPrimitiveCollection=s,this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],d=e.sampleDistance,p=DR(u,d).map(S=>[...S,e.height]),f=Math.floor(e.extrudedHeight/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(T=>[T[0],T[1],e.height+x*d]))}const{startTime:g,endTime:m,spanTime:y}=e,_=y*36e5,P=Math.floor((m-g)/_),C=Array(p.length).fill(0);e:for(let S=0;S<P;S++){if(await hC(),this._stopRun)break e;const x=new Date(g+S*_),T=RR(x);t:for(let R=0;R<p.length;R++){if(await hC(),this._stopRun)break t;IR(p[R],T,o.scene)||(C[R]=(C[R]*P+1)/P)}!this._stopRun&&(e.progress=Number(((S+1)/P*100).toFixed(2))),console.log("colorScalelist",C),c(p,C)}},l=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}));const c=(u,d)=>{const p=u.map((f,g)=>({position:[...f],color:FR(e.startColor,e.endColor,d[g]),pixelSize:10}));s.pointPrimitiveOptions=p}}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}};v(Vl,"type",Vl.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Vl));let $f=Vl;const uC=(t=0)=>new Promise(i=>setTimeout(i,t)),Yo=class Yo extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_startEvent",this.disposeVar(new a.Event));v(this,"_stopEvent",this.dv(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new be(e,n)),this._customPrimitive=this.disposeVar(new De(e,n)),this._geoDivPoi=this.disposeVar(new We(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{qi(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
1877
+ ***************************************************************************** */function JR(t,i){var e={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},n,o,s,r;return r={next:l(0),throw:l(1),return:l(2)},typeof Symbol=="function"&&(r[Symbol.iterator]=function(){return this}),r;function l(u){return function(d){return c([u,d])}}function c(u){if(n)throw new TypeError("Generator is already executing.");for(;e;)try{if(n=1,o&&(s=u[0]&2?o.return:u[0]?o.throw||((s=o.return)&&s.call(o),0):o.next)&&!(s=s.call(o,u[1])).done)return s;switch(o=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return e.label++,{value:u[1],done:!1};case 5:e.label++,o=u[1],u=[0];continue;case 7:u=e.ops.pop(),e.trys.pop();continue;default:if(s=e.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){e.label=u[1];break}if(u[0]===6&&e.label<s[1]){e.label=s[1],s=u;break}if(s&&e.label<s[2]){e.label=s[2],e.ops.push(u);break}s[2]&&e.ops.pop(),e.trys.pop();continue}u=i.call(t,e)}catch(d){u=[6,d],o=0}finally{n=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Un=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function jR(t,i){return t>i?1:t<i?-1:0}function Wn(t,i,e){for(var n=new Un(null,null),o=n,s=n;;){var r=e(t,i.key);if(r<0){if(i.left===null)break;if(e(t,i.left.key)<0){var l=i.left;if(i.left=l.right,l.right=i,i=l,i.left===null)break}s.left=i,s=i,i=i.left}else if(r>0){if(i.right===null)break;if(e(t,i.right.key)>0){var l=i.right;if(i.right=l.left,l.left=i,i=l,i.right===null)break}o.right=i,o=i,i=i.right}else break}return o.right=i.left,s.left=i.right,i.left=n.right,i.right=n.left,i}function Of(t,i,e,n){var o=new Un(t,i);if(e===null)return o.left=o.right=null,o;e=Wn(t,e,n);var s=n(t,e.key);return s<0?(o.left=e.left,o.right=e,e.left=null):s>=0&&(o.right=e.right,o.left=e,e.right=null),o}function kw(t,i,e){var n=null,o=null;if(i){i=Wn(t,i,e);var s=e(i.key,t);s===0?(n=i.left,o=i.right):s<0?(o=i.right,i.right=null,n=i):(n=i.left,i.left=null,o=i)}return{left:n,right:o}}function e2(t,i,e){return i===null?t:(t===null||(i=Wn(t.key,i,e),i.left=t),i)}function Nf(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1878
+ `);var s=i+(e?" ":"│ ");t.left&&Nf(t.left,s,!1,n,o),t.right&&Nf(t.right,s,!0,n,o)}}var Bf=function(){function t(i){i===void 0&&(i=jR),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=Of(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Un(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Wn(i,this._root,o),r=o(i,s.key);return r===0?this._root=s:(r<0?(n.left=s.left,n.right=s,s.left=null):r>0&&(n.right=s.right,n.left=s,s.right=null),this._size++,this._root=n),this._root},t.prototype.remove=function(i){this._root=this._remove(i,this._root,this._comparator)},t.prototype._remove=function(i,e,n){var o;if(e===null)return null;e=Wn(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Wn(i,e.left,n),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var i=this._root;if(i){for(;i.left;)i=i.left;return this._root=Wn(i.key,this._root,this._comparator),this._root=this._remove(i.key,this._root,this._comparator),{key:i.key,data:i.data}}return null},t.prototype.findStatic=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(i){return this._root&&(this._root=Wn(i,this._root,this._comparator),this._comparator(i,this._root.key)!==0)?null:this._root},t.prototype.contains=function(i){for(var e=this._root,n=this._comparator;e;){var o=n(i,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(i,e){for(var n=this._root,o=[],s=!1;!s;)n!==null?(o.push(n),n=n.left):o.length!==0?(n=o.pop(),i.call(e,n),n=n.right):s=!0;return this},t.prototype.range=function(i,e,n,o){for(var s=[],r=this._comparator,l=this._root,c;s.length!==0||l;)if(l)s.push(l),l=l.left;else{if(l=s.pop(),c=r(l.key,e),c>0)break;if(r(l.key,i)>=0&&n.call(o,l))return this;l=l.right}return this},t.prototype.keys=function(){var i=[];return this.forEach(function(e){var n=e.key;return i.push(n)}),i},t.prototype.values=function(){var i=[];return this.forEach(function(e){var n=e.data;return i.push(n)}),i},t.prototype.min=function(){return this._root?this.minNode(this._root).key:null},t.prototype.max=function(){return this._root?this.maxNode(this._root).key:null},t.prototype.minNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.left;)i=i.left;return i},t.prototype.maxNode=function(i){if(i===void 0&&(i=this._root),i)for(;i.right;)i=i.right;return i},t.prototype.at=function(i){for(var e=this._root,n=!1,o=0,s=[];!n;)if(e)s.push(e),e=e.left;else if(s.length>0){if(e=s.pop(),o===i)return e;o++,e=e.right}else n=!0;return null},t.prototype.next=function(i){var e=this._root,n=null;if(i.right){for(n=i.right;n.left;)n=n.left;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?(n=e,e=e.left):e=e.right}return n},t.prototype.prev=function(i){var e=this._root,n=null;if(i.left!==null){for(n=i.left;n.right;)n=n.right;return n}for(var o=this._comparator;e;){var s=o(i.key,e.key);if(s===0)break;s<0?e=e.left:(n=e,e=e.right)}return n},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return i2(this._root)},t.prototype.load=function(i,e,n){e===void 0&&(e=[]),n===void 0&&(n=!1);var o=i.length,s=this._comparator;if(n&&Wf(i,e,0,o-1,s),this._root===null)this._root=Vf(i,e,0,o),this._size=o;else{var r=n2(this.toList(),t2(i,e),s);o=this._size+o,this._root=Uf({head:r},0,o)}return this},t.prototype.isEmpty=function(){return this._root===null},Object.defineProperty(t.prototype,"size",{get:function(){return this._size},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this._root},enumerable:!0,configurable:!0}),t.prototype.toString=function(i){i===void 0&&(i=function(n){return String(n.key)});var e=[];return Nf(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=kw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=Of(e,n,l,o):r=Of(e,n,r,o),this._root=e2(r,l,o)},t.prototype.split=function(i){return kw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return JR(this,function(o){switch(o.label){case 0:i=this._root,e=[],n=!1,o.label=1;case 1:return n?[3,6]:i===null?[3,2]:(e.push(i),i=i.left,[3,5]);case 2:return e.length===0?[3,4]:(i=e.pop(),[4,i]);case 3:return o.sent(),i=i.right,[3,5];case 4:n=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Vf(t,i,e,n){var o=n-e;if(o>0){var s=e+Math.floor(o/2),r=t[s],l=i[s],c=new Un(r,l);return c.left=Vf(t,i,e,s),c.right=Vf(t,i,s+1,n),c}return null}function t2(t,i){for(var e=new Un(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Un(t[o],i[o]);return n.next=null,e.next}function i2(t){for(var i=t,e=[],n=!1,o=new Un(null,null),s=o;!n;)i?(e.push(i),i=i.left):e.length>0?(i=s=s.next=e.pop(),i=i.right):n=!0;return s.next=null,o.next}function Uf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Uf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Uf(t,o+1,e),r}return null}function n2(t,i,e){for(var n=new Un(null,null),o=n,s=t,r=i;s!==null&&r!==null;)e(s.key,r.key)<0?(o.next=s,s=s.next):(o.next=r,r=r.next),o=o.next;return s!==null?o.next=s:r!==null&&(o.next=r),n.next}function Wf(t,i,e,n,o){if(!(e>=n)){for(var s=t[e+n>>1],r=e-1,l=n+1;;){do r++;while(o(t[r],s)<0);do l--;while(o(t[l],s)>0);if(r>=l)break;var c=t[r];t[r]=t[l],t[l]=c,c=i[r],i[r]=i[l],i[l]=c}Wf(t,i,e,l,o),Wf(t,i,l+1,n,o)}}const on=11102230246251565e-32,Ct=134217729,o2=(3+8*on)*on;function Gf(t,i,e,n,o){let s,r,l,c,u=i[0],d=n[0],p=0,f=0;d>u==d>-u?(s=u,u=i[++p]):(s=d,d=n[++f]);let g=0;if(p<t&&f<e)for(d>u==d>-u?(r=u+s,l=s-(r-u),u=i[++p]):(r=d+s,l=s-(r-d),d=n[++f]),s=r,l!==0&&(o[g++]=l);p<t&&f<e;)d>u==d>-u?(r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p]):(r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f]),s=r,l!==0&&(o[g++]=l);for(;p<t;)r=s+u,c=r-s,l=s-(r-c)+(u-c),u=i[++p],s=r,l!==0&&(o[g++]=l);for(;f<e;)r=s+d,c=r-s,l=s-(r-c)+(d-c),d=n[++f],s=r,l!==0&&(o[g++]=l);return(s!==0||g===0)&&(o[g++]=s),g}function s2(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function da(t){return new Float64Array(t)}const r2=(3+16*on)*on,a2=(2+12*on)*on,l2=(9+64*on)*on*on,tr=da(4),Kw=da(8),Jw=da(12),jw=da(16),bt=da(4);function c2(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,m,y,_,P,C,S,x,T,R,O,N;const V=t-o,U=e-o,z=i-s,B=n-s;x=V*B,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*B,y=f-(f-B),_=B-y,T=m*_-(x-g*y-m*y-g*_),R=z*U,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,tr[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,tr[1]=S-(P+p)+(p-R),N=C+P,p=N-C,tr[2]=C-(N-p)+(P-p),tr[3]=N;let w=s2(4,tr),E=a2*r;if(w>=E||-w>=E||(p=t-V,l=t-(V+p)+(p-o),p=e-U,u=e-(U+p)+(p-o),p=i-z,c=i-(z+p)+(p-s),p=n-B,d=n-(B+p)+(p-s),l===0&&c===0&&u===0&&d===0)||(E=l2*r+o2*Math.abs(w),w+=V*d+B*l-(z*u+U*c),w>=E||-w>=E))return w;x=l*B,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*B,y=f-(f-B),_=B-y,T=m*_-(x-g*y-m*y-g*_),R=c*U,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*U,y=f-(f-U),_=U-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,bt[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const D=Gf(4,tr,4,bt,Kw);x=V*d,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*d,y=f-(f-d),_=d-y,T=m*_-(x-g*y-m*y-g*_),R=z*u,f=Ct*z,g=f-(f-z),m=z-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,bt[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const L=Gf(D,Kw,4,bt,Jw);x=l*d,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*d,y=f-(f-d),_=d-y,T=m*_-(x-g*y-m*y-g*_),R=c*u,f=Ct*c,g=f-(f-c),m=c-g,f=Ct*u,y=f-(f-u),_=u-y,O=m*_-(R-g*y-m*y-g*_),P=T-O,p=T-P,bt[0]=T-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,bt[1]=S-(P+p)+(p-R),N=C+P,p=N-C,bt[2]=C-(N-p)+(P-p),bt[3]=N;const G=Gf(L,Jw,4,bt,jw);return jw[G-1]}function h2(t,i,e,n,o,s){const r=(i-s)*(e-o),l=(t-o)*(n-s),c=r-l,u=Math.abs(r+l);return Math.abs(c)>=r2*u?c:-c2(t,i,e,n,o,s,u)}const pa=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Hf=(t,i)=>{if(i.ur.x<t.ll.x||t.ur.x<i.ll.x||i.ur.y<t.ll.y||t.ur.y<i.ll.y)return null;const e=t.ll.x<i.ll.x?i.ll.x:t.ll.x,n=t.ur.x<i.ur.x?t.ur.x:i.ur.x,o=t.ll.y<i.ll.y?i.ll.y:t.ll.y,s=t.ur.y<i.ur.y?t.ur.y:i.ur.y;return{ll:{x:e,y:o},ur:{x:n,y:s}}};let Gn=Number.EPSILON;Gn===void 0&&(Gn=Math.pow(2,-52));const u2=Gn*Gn,eC=(t,i)=>{if(-Gn<t&&t<Gn&&-Gn<i&&i<Gn)return 0;const e=t-i;return e*e<u2*t*i?0:t<i?-1:1};class d2{constructor(){this.reset()}reset(){this.xRounder=new tC,this.yRounder=new tC}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class tC{constructor(){this.tree=new Bf,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&eC(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&eC(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const fa=new d2,Bh=(t,i)=>t.x*i.y-t.y*i.x,iC=(t,i)=>t.x*i.x+t.y*i.y,nC=(t,i,e)=>{const n=h2(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Vh=t=>Math.sqrt(iC(t,t)),p2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return Bh(o,n)/Vh(o)/Vh(n)},f2=(t,i,e)=>{const n={x:i.x-t.x,y:i.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return iC(o,n)/Vh(o)/Vh(n)},oC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},sC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},g2=(t,i,e,n)=>{if(i.x===0)return sC(e,n,t.x);if(n.x===0)return sC(t,i,e.x);if(i.y===0)return oC(e,n,t.y);if(n.y===0)return oC(t,i,e.y);const o=Bh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Bh(s,i)/o,l=Bh(s,n)/o,c=t.x+l*i.x,u=e.x+r*n.x,d=t.y+l*i.y,p=e.y+r*n.y,f=(c+u)/2,g=(d+p)/2;return{x:f,y:g}};class si{static compare(i,e){const n=si.comparePoints(i.point,e.point);return n!==0?n:(i.point!==e.point&&i.link(e),i.isLeft!==e.isLeft?i.isLeft?1:-1:Hn.compare(i.segment,e.segment))}static comparePoints(i,e){return i.x<e.x?-1:i.x>e.x?1:i.y<e.y?-1:i.y>e.y?1:0}constructor(i,e){i.events===void 0?i.events=[this]:i.events.push(this),this.point=i,this.isLeft=e}link(i){if(i.point===this.point)throw new Error("Tried to link already linked events");const e=i.point.events;for(let n=0,o=e.length;n<o;n++){const s=e[n];this.point.events.push(s),s.point=this.point}this.checkForConsuming()}checkForConsuming(){const i=this.point.events.length;for(let e=0;e<i;e++){const n=this.point.events[e];if(n.segment.consumedBy===void 0)for(let o=e+1;o<i;o++){const s=this.point.events[o];s.consumedBy===void 0&&n.otherSE.point.events===s.otherSE.point.events&&n.segment.consume(s.segment)}}}getAvailableLinkedEvents(){const i=[];for(let e=0,n=this.point.events.length;e<n;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&i.push(o)}return i}getLeftmostComparator(i){const e=new Map,n=o=>{const s=o.otherSE;e.set(o,{sine:p2(this.point,i.point,s.point),cosine:f2(this.point,i.point,s.point)})};return(o,s)=>{e.has(o)||n(o),e.has(s)||n(s);const{sine:r,cosine:l}=e.get(o),{sine:c,cosine:u}=e.get(s);return r>=0&&c>=0?l<u?1:l>u?-1:0:r<0&&c<0?l<u?-1:l>u?1:0:c<r?-1:c>r?1:0}}}let m2=0;class Hn{static compare(i,e){const n=i.leftSE.point.x,o=e.leftSE.point.x,s=i.rightSE.point.x,r=e.rightSE.point.x;if(r<n)return 1;if(s<o)return-1;const l=i.leftSE.point.y,c=e.leftSE.point.y,u=i.rightSE.point.y,d=e.rightSE.point.y;if(n<o){if(c<l&&c<u)return 1;if(c>l&&c>u)return-1;const p=i.comparePoint(e.leftSE.point);if(p<0)return 1;if(p>0)return-1;const f=e.comparePoint(i.rightSE.point);return f!==0?f:-1}if(n>o){if(l<c&&l<d)return-1;if(l>c&&l>d)return 1;const p=e.comparePoint(i.leftSE.point);if(p!==0)return p;const f=i.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(l<c)return-1;if(l>c)return 1;if(s<r){const p=e.comparePoint(i.rightSE.point);if(p!==0)return p}if(s>r){const p=i.comparePoint(e.rightSE.point);if(p<0)return 1;if(p>0)return-1}if(s!==r){const p=u-l,f=s-n,g=d-c,m=r-o;if(p>f&&g<m)return 1;if(p<f&&g>m)return-1}return s>r?1:s<r||u<d?-1:u>d?1:i.id<e.id?-1:i.id>e.id?1:0}constructor(i,e,n,o){this.id=++m2,this.leftSE=i,i.segment=this,i.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=i,this.rings=n,this.windings=o}static fromRing(i,e,n){let o,s,r;const l=si.comparePoints(i,e);if(l<0)o=i,s=e,r=1;else if(l>0)o=e,s=i,r=-1;else throw new Error(`Tried to create degenerate segment at [${i.x}, ${i.y}]`);const c=new si(o,!0),u=new si(s,!1);return new Hn(c,u,[n],[r])}replaceRightSE(i){this.rightSE=i,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const i=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:i<e?i:e},ur:{x:this.rightSE.point.x,y:i>e?i:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(i){return i.x===this.leftSE.point.x&&i.y===this.leftSE.point.y||i.x===this.rightSE.point.x&&i.y===this.rightSE.point.y}comparePoint(i){if(this.isAnEndpoint(i))return 0;const e=this.leftSE.point,n=this.rightSE.point,o=this.vector();if(e.x===n.x)return i.x===e.x?0:i.x<e.x?1:-1;const s=(i.y-e.y)/o.y,r=e.x+s*o.x;if(i.x===r)return 0;const l=(i.x-e.x)/o.x,c=e.y+l*o.y;return i.y===c?0:i.y<c?-1:1}getIntersection(i){const e=this.bbox(),n=i.bbox(),o=Hf(e,n);if(o===null)return null;const s=this.leftSE.point,r=this.rightSE.point,l=i.leftSE.point,c=i.rightSE.point,u=pa(e,l)&&this.comparePoint(l)===0,d=pa(n,s)&&i.comparePoint(s)===0,p=pa(e,c)&&this.comparePoint(c)===0,f=pa(n,r)&&i.comparePoint(r)===0;if(d&&u)return f&&!p?r:!f&&p?c:null;if(d)return p&&s.x===c.x&&s.y===c.y?null:s;if(u)return f&&r.x===l.x&&r.y===l.y?null:l;if(f&&p)return null;if(f)return r;if(p)return c;const g=g2(s,this.vector(),l,i.vector());return g===null||!pa(o,g)?null:fa.round(g.x,g.y)}split(i){const e=[],n=i.events!==void 0,o=new si(i,!0),s=new si(i,!1),r=this.rightSE;this.replaceRightSE(s),e.push(s),e.push(o);const l=new Hn(o,r,this.rings.slice(),this.windings.slice());return si.comparePoints(l.leftSE.point,l.rightSE.point)>0&&l.swapEvents(),si.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),n&&(o.checkForConsuming(),s.checkForConsuming()),e}swapEvents(){const i=this.rightSE;this.rightSE=this.leftSE,this.leftSE=i,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,n=this.windings.length;e<n;e++)this.windings[e]*=-1}consume(i){let e=this,n=i;for(;e.consumedBy;)e=e.consumedBy;for(;n.consumedBy;)n=n.consumedBy;const o=Hn.compare(e,n);if(o!==0){if(o>0){const s=e;e=n,n=s}if(e.prev===n){const s=e;e=n,n=s}for(let s=0,r=n.rings.length;s<r;s++){const l=n.rings[s],c=n.windings[s],u=e.rings.indexOf(l);u===-1?(e.rings.push(l),e.windings.push(c)):e.windings[u]+=c}n.rings=null,n.windings=null,n.consumedBy=e,n.leftSE.consumedBy=e.leftSE,n.rightSE.consumedBy=e.rightSE}}prevInResult(){return this._prevInResult!==void 0?this._prevInResult:(this.prev?this.prev.isInResult()?this._prevInResult=this.prev:this._prevInResult=this.prev.prevInResult():this._prevInResult=null,this._prevInResult)}beforeState(){if(this._beforeState!==void 0)return this._beforeState;if(!this.prev)this._beforeState={rings:[],windings:[],multiPolys:[]};else{const i=this.prev.consumedBy||this.prev;this._beforeState=i.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const i=this.beforeState();this._afterState={rings:i.rings.slice(0),windings:i.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,n=this._afterState.windings,o=this._afterState.multiPolys;for(let l=0,c=this.rings.length;l<c;l++){const u=this.rings[l],d=this.windings[l],p=e.indexOf(u);p===-1?(e.push(u),n.push(d)):n[p]+=d}const s=[],r=[];for(let l=0,c=e.length;l<c;l++){if(n[l]===0)continue;const u=e[l],d=u.poly;if(r.indexOf(d)===-1)if(u.isExterior)s.push(d);else{r.indexOf(d)===-1&&r.push(d);const p=s.indexOf(u.poly);p!==-1&&s.splice(p,1)}}for(let l=0,c=s.length;l<c;l++){const u=s[l].multiPoly;o.indexOf(u)===-1&&o.push(u)}return this._afterState}isInResult(){if(this.consumedBy)return!1;if(this._isInResult!==void 0)return this._isInResult;const i=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(vi.type){case"union":{const n=i.length===0,o=e.length===0;this._isInResult=n!==o;break}case"intersection":{let n,o;i.length<e.length?(n=i.length,o=e.length):(n=e.length,o=i.length),this._isInResult=o===vi.numMultiPolys&&n<o;break}case"xor":{const n=Math.abs(i.length-e.length);this._isInResult=n%2===1;break}case"difference":{const n=o=>o.length===1&&o[0].isSubject;this._isInResult=n(i)!==n(e);break}default:throw new Error(`Unrecognized operation type found ${vi.type}`)}return this._isInResult}}class rC{constructor(i,e,n){if(!Array.isArray(i)||i.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=n,this.segments=[],typeof i[0][0]!="number"||typeof i[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=fa.round(i[0][0],i[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let s=o;for(let r=1,l=i.length;r<l;r++){if(typeof i[r][0]!="number"||typeof i[r][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let c=fa.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Hn.fromRing(s,c,this)),c.x<this.bbox.ll.x&&(this.bbox.ll.x=c.x),c.y<this.bbox.ll.y&&(this.bbox.ll.y=c.y),c.x>this.bbox.ur.x&&(this.bbox.ur.x=c.x),c.y>this.bbox.ur.y&&(this.bbox.ur.y=c.y),s=c)}(o.x!==s.x||o.y!==s.y)&&this.segments.push(Hn.fromRing(s,o,this))}getSweepEvents(){const i=[];for(let e=0,n=this.segments.length;e<n;e++){const o=this.segments[e];i.push(o.leftSE),i.push(o.rightSE)}return i}}class v2{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new rC(i[0],this,!0),this.bbox={ll:{x:this.exteriorRing.bbox.ll.x,y:this.exteriorRing.bbox.ll.y},ur:{x:this.exteriorRing.bbox.ur.x,y:this.exteriorRing.bbox.ur.y}},this.interiorRings=[];for(let n=1,o=i.length;n<o;n++){const s=new rC(i[n],this,!1);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.interiorRings.push(s)}this.multiPoly=e}getSweepEvents(){const i=this.exteriorRing.getSweepEvents();for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class aC{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof i[0][0][0]=="number"&&(i=[i])}catch{}this.polys=[],this.bbox={ll:{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY},ur:{x:Number.NEGATIVE_INFINITY,y:Number.NEGATIVE_INFINITY}};for(let n=0,o=i.length;n<o;n++){const s=new v2(i[n],this);s.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=s.bbox.ll.x),s.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=s.bbox.ll.y),s.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=s.bbox.ur.x),s.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=s.bbox.ur.y),this.polys.push(s)}this.isSubject=e}getSweepEvents(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getSweepEvents();for(let s=0,r=o.length;s<r;s++)i.push(o[s])}return i}}class Uh{static factory(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.isInResult()||s.ringOut)continue;let r=null,l=s.leftSE,c=s.rightSE;const u=[l],d=l.point,p=[];for(;r=l,l=c,u.push(l),l.point!==d;)for(;;){const f=l.getAvailableLinkedEvents();if(f.length===0){const y=u[0].point,_=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${y.x}, ${y.y}]. Last matching segment found ends at [${_.x}, ${_.y}].`)}if(f.length===1){c=f[0].otherSE;break}let g=null;for(let y=0,_=p.length;y<_;y++)if(p[y].point===l.point){g=y;break}if(g!==null){const y=p.splice(g)[0],_=u.splice(y.index);_.unshift(_[0].otherSE),e.push(new Uh(_.reverse()));continue}p.push({index:u.length,point:l.point});const m=l.getLeftmostComparator(r);c=f.sort(m)[0].otherSE;break}e.push(new Uh(u))}return e}constructor(i){this.events=i;for(let e=0,n=i.length;e<n;e++)i[e].segment.ringOut=this;this.poly=null}getGeom(){let i=this.events[0].point;const e=[i];for(let u=1,d=this.events.length-1;u<d;u++){const p=this.events[u].point,f=this.events[u+1].point;nC(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];nC(n,i,o)===0&&e.shift(),e.push(e[0]);const s=this.isExteriorRing()?1:-1,r=this.isExteriorRing()?0:e.length-1,l=this.isExteriorRing()?e.length:-1,c=[];for(let u=r;u!=l;u+=s)c.push([e[u].x,e[u].y]);return c}isExteriorRing(){if(this._isExteriorRing===void 0){const i=this.enclosingRing();this._isExteriorRing=i?!i.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let i=this.events[0];for(let o=1,s=this.events.length;o<s;o++){const r=this.events[o];si.compare(i,r)>0&&(i=r)}let e=i.segment.prevInResult(),n=e?e.prevInResult():null;for(;;){if(!e)return null;if(!n)return e.ringOut;if(n.ringOut!==e.ringOut)return n.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=n.prevInResult(),n=e?e.prevInResult():null}}}class lC{constructor(i){this.exteriorRing=i,i.poly=this,this.interiorRings=[]}addInterior(i){this.interiorRings.push(i),i.poly=this}getGeom(){const i=[this.exteriorRing.getGeom()];if(i[0]===null)return null;for(let e=0,n=this.interiorRings.length;e<n;e++){const o=this.interiorRings[e].getGeom();o!==null&&i.push(o)}return i}}class y2{constructor(i){this.rings=i,this.polys=this._composePolys(i)}getGeom(){const i=[];for(let e=0,n=this.polys.length;e<n;e++){const o=this.polys[e].getGeom();o!==null&&i.push(o)}return i}_composePolys(i){const e=[];for(let n=0,o=i.length;n<o;n++){const s=i[n];if(!s.poly)if(s.isExteriorRing())e.push(new lC(s));else{const r=s.enclosingRing();r.poly||e.push(new lC(r)),r.poly.addInterior(s)}}return e}}class w2{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Hn.compare;this.queue=i,this.tree=new Bf(e),this.segments=[]}process(i){const e=i.segment,n=[];if(i.consumedBy)return i.isLeft?this.queue.remove(i.otherSE):this.tree.remove(e),n;const o=i.isLeft?this.tree.add(e):this.tree.find(e);if(!o)throw new Error(`Unable to find segment #${e.id} [${e.leftSE.point.x}, ${e.leftSE.point.y}] -> [${e.rightSE.point.x}, ${e.rightSE.point.y}] in SweepLine tree.`);let s=o,r=o,l,c;for(;l===void 0;)s=this.tree.prev(s),s===null?l=null:s.key.consumedBy===void 0&&(l=s.key);for(;c===void 0;)r=this.tree.next(r),r===null?c=null:r.key.consumedBy===void 0&&(c=r.key);if(i.isLeft){let u=null;if(l){const p=l.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(u=p),!l.isAnEndpoint(p))){const f=this._splitSafely(l,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}let d=null;if(c){const p=c.getIntersection(e);if(p!==null&&(e.isAnEndpoint(p)||(d=p),!c.isAnEndpoint(p))){const f=this._splitSafely(c,p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}}if(u!==null||d!==null){let p=null;u===null?p=d:d===null?p=u:p=si.comparePoints(u,d)<=0?u:d,this.queue.remove(e.rightSE),n.push(e.rightSE);const f=e.split(p);for(let g=0,m=f.length;g<m;g++)n.push(f[g])}n.length>0?(this.tree.remove(e),n.push(i)):(this.segments.push(e),e.prev=l)}else{if(l&&c){const u=l.getIntersection(c);if(u!==null){if(!l.isAnEndpoint(u)){const d=this._splitSafely(l,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}if(!c.isAnEndpoint(u)){const d=this._splitSafely(c,u);for(let p=0,f=d.length;p<f;p++)n.push(d[p])}}}this.tree.remove(e)}return n}_splitSafely(i,e){this.tree.remove(i);const n=i.rightSE;this.queue.remove(n);const o=i.split(e);return o.push(n),i.consumedBy===void 0&&this.tree.add(i),o}}const cC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,C2=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class _2{run(i,e,n){vi.type=i,fa.reset();const o=[new aC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new aC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Hf(o[f].bbox,p.bbox)!==null?f++:o.splice(f,1)}if(vi.type==="intersection")for(let p=0,f=o.length;p<f;p++){const g=o[p];for(let m=p+1,y=o.length;m<y;m++)if(Hf(g.bbox,o[m].bbox)===null)return[]}const s=new Bf(si.compare);for(let p=0,f=o.length;p<f;p++){const g=o[p].getSweepEvents();for(let m=0,y=g.length;m<y;m++)if(s.insert(g[m]),s.size>cC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new w2(s);let l=s.size,c=s.pop();for(;c;){const p=c.key;if(s.size===l){const g=p.segment;throw new Error(`Unable to pop() ${p.isLeft?"left":"right"} SweepEvent [${p.point.x}, ${p.point.y}] from segment #${g.id} [${g.leftSE.point.x}, ${g.leftSE.point.y}] -> [${g.rightSE.point.x}, ${g.rightSE.point.y}] from queue.`)}if(s.size>cC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>C2)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=r.process(p);for(let g=0,m=f.length;g<m;g++){const y=f[g];y.consumedBy===void 0&&s.insert(y)}l=s.size,c=s.pop()}fa.reset();const u=Uh.factory(r.segments);return new y2(u).getGeom()}}const vi=new _2;var P2={union:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("union",t,e)},intersection:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("intersection",t,e)},xor:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("xor",t,e)},difference:function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return vi.run("difference",t,e)}};function Wh(t,i,e){e===void 0&&(e={});var n=Fi(t),o=Fi(i),s=P2.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?it(s[0],e.properties):sf(s,e.properties)}function b2(t,i,e){e===void 0&&(e={});var n=JSON.stringify(e.properties||{}),o=t[0],s=t[1],r=t[2],l=t[3],c=(s+l)/2,u=(o+r)/2,d=i*2/zi([o,c],[r,c],e),p=d*(r-o),f=i*2/zi([u,s],[u,l],e),g=f*(l-s),m=p/2,y=m*2,_=Math.sqrt(3)/2*g,P=r-o,C=l-s,S=3/4*y,x=_,T=(P-y)/(y-m/2),R=Math.floor(T),O=(R*S-m/2-P)/2-m/2+S/2,N=Math.floor((C-_)/_),V=(C-N*_)/2,U=N*_-C>_/2;U&&(V-=_/4);for(var z=[],B=[],w=0;w<6;w++){var E=2*Math.PI/6*w;z.push(Math.cos(E)),B.push(Math.sin(E))}for(var D=[],L=0;L<=R;L++)for(var G=0;G<=N;G++){var Y=L%2===1;if(!(G===0&&Y)&&!(G===0&&U)){var q=L*S+o-O,X=G*x+s+V;if(Y&&(X-=_/2),e.triangles===!0)E2([q,X],p/2,g/2,JSON.parse(n),z,B).forEach(function(ee){e.mask?Wh(e.mask,ee)&&D.push(ee):D.push(ee)});else{var Q=S2([q,X],p/2,g/2,JSON.parse(n),z,B);e.mask?Wh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Ot(D)}function S2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=t[0]+i*o[l],u=t[1]+e*s[l];r.push([c,u])}return r.push(r[0].slice()),it([r],n)}function E2(t,i,e,n,o,s){for(var r=[],l=0;l<6;l++){var c=[];c.push(t),c.push([t[0]+i*o[l],t[1]+e*s[l]]),c.push([t[0]+i*o[(l+1)%6],t[1]+e*s[(l+1)%6]]),c.push(t),r.push(it([c],n))}return r}function x2(t,i,e,n){n===void 0&&(n={});for(var o=[],s=t[0],r=t[1],l=t[2],c=t[3],u=i/zi([s,r],[l,r],n),d=u*(l-s),p=e/zi([s,r],[s,c],n),f=p*(c-r),g=l-s,m=c-r,y=Math.floor(g/d),_=Math.floor(m/f),P=(g-y*d)/2,C=(m-_*f)/2,S=s+P,x=0;x<y;x++){for(var T=r+C,R=0;R<_;R++){var O=it([[[S,T],[S,T+f],[S+d,T+f],[S+d,T],[S,T]]],n.properties);n.mask?KR(n.mask,O)&&o.push(O):o.push(O),T+=f}S+=d}return Ot(o)}function A2(t,i,e){return e===void 0&&(e={}),x2(t,i,i,e)}function T2(t,i,e){e===void 0&&(e={});for(var n=[],o=i/zi([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/zi([t[0],t[1]],[t[0],t[3]],e),l=r*(t[3]-t[1]),c=0,u=t[0];u<=t[2];){for(var d=0,p=t[1];p<=t[3];){var f=null,g=null;c%2===0&&d%2===0?(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)):c%2===0&&d%2===1?(f=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties)):d%2===0&&c%2===1?(f=it([[[u,p],[u,p+l],[u+s,p+l],[u,p]]],e.properties),g=it([[[u,p],[u+s,p+l],[u+s,p],[u,p]]],e.properties)):d%2===1&&c%2===1&&(f=it([[[u,p],[u,p+l],[u+s,p],[u,p]]],e.properties),g=it([[[u,p+l],[u+s,p+l],[u+s,p],[u,p+l]]],e.properties)),e.mask?(Wh(e.mask,f)&&n.push(f),Wh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Ot(n)}function M2(t,i,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var n=e.gridType,o=e.property,s=e.weight;if(!t)throw new Error("points is required");if(ZT(t,"Point","input must contain Points"),!i)throw new Error("cellSize is required");if(s!==void 0&&typeof s!="number")throw new Error("weight must be a number");o=o||"elevation",n=n||"square",s=s||1;var r=Oo(t),l;switch(n){case"point":case"points":l=I0(r,i,e);break;case"square":case"squares":l=A2(r,i,e);break;case"hex":case"hexes":l=b2(r,i,e);break;case"triangle":case"triangles":l=T2(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Gs(l,function(u){var d=0,p=0;Gs(t,function(g){var m=n==="point"?u:FM(u),y=zi(m,g,e),_;if(o!==void 0&&(_=g.properties[o]),_===void 0&&(_=g.geometry.coordinates[2]),_===void 0)throw new Error("zValue is missing");y===0&&(d=_);var P=1/Math.pow(y,s);p+=P,d+=P*_});var f=DM(u);f.properties[o]=d/p,c.push(f)}),Ot(c)}function I2(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r);return!!(e.globe.pick(r,e)||l)}const hC=(t=0)=>new Promise(i=>setTimeout(i,t));function D2(t,i){const e=Ot(t.map(c=>ht(c))),n=it([t]);return M2(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Pt(ht(c),n))}function R2(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return wr(e)}function F2(t,i,e){const n=t[0]+(i[0]-t[0])*e,o=t[1]+(i[1]-t[1])*e,s=t[2]+(i[2]-t[2])*e,r=t[3]+(i[3]-t[3])*e;return[n,o,s,r]}const Vl=class Vl extends qt{constructor(e,n){super(e,n);v(this,"czmPointPrimitiveCollection");v(this,"_stopRun",!1);const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new vo(n,e.id));this.czmPointPrimitiveCollection=s,this.d(a.track([s,"show"],[e,"show"]));{const r=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){s.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],d=e.sampleDistance,p=D2(u,d).map(S=>[...S,e.height]),f=Math.floor(e.extrudedHeight/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(T=>[T[0],T[1],e.height+x*d]))}const{startTime:g,endTime:m,spanTime:y}=e,_=y*36e5,P=Math.floor((m-g)/_),C=Array(p.length).fill(0);e:for(let S=0;S<P;S++){if(await hC(),this._stopRun)break e;const x=new Date(g+S*_),T=R2(x);t:for(let R=0;R<p.length;R++){if(await hC(),this._stopRun)break t;I2(p[R],T,o.scene)||(C[R]=(C[R]*P+1)/P)}!this._stopRun&&(e.progress=Number(((S+1)/P*100).toFixed(2))),console.log("colorScalelist",C),c(p,C)}},l=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(r())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,s.pointPrimitiveOptions=void 0,e.progress=0,l.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,s.pointPrimitiveOptions=void 0,e.progress=0,l.isRunning&&l.cancel()}));const c=(u,d)=>{const p=u.map((f,g)=>({position:[...f],color:F2(e.startColor,e.endColor,d[g]),pixelSize:10}));s.pointPrimitiveOptions=p}}}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoPolygon:r}=this;if(!r||!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.positions){const l=[...r.positions];return r.positions.forEach(c=>{l.push([c[0],c[1],o.extrudedHeight],[c[0],c[1],o.height])}),oe(s,o,n,l,e),!0}return!1}};v(Vl,"type",Vl.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Vl));let $f=Vl;const uC=(t=0)=>new Promise(i=>setTimeout(i,t)),Yo=class Yo extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_startEvent",this.disposeVar(new a.Event));v(this,"_stopEvent",this.dv(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolyline");v(this,"_customPrimitive");v(this,"_geoDivPoi");v(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new be(e,n)),this._customPrimitive=this.disposeVar(new De(e,n)),this._geoDivPoi=this.disposeVar(new We(e,n)),this.ad(this._geoDivPoi.pickedEvent.don(s=>{qi(s)===0&&this.pickedEvent.emit(s)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(s=>{this._geoPolyline&&this._geoPolyline.flyTo(s)})),this._customPrimitive.primitiveType="LINES",this._customPrimitive.renderState={depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!1,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},this._customPrimitive.fragmentShaderSource=`
1879
1879
  uniform vec4 u_color;
1880
1880
  void main()
1881
1881
  {
@@ -1887,7 +1887,7 @@ void main()
1887
1887
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
1888
1888
  }
1889
1889
  `,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(a.track([this._customPrimitive,"show"],[this,"show"])),this.d(a.track([this._geoPolyline,"show"],[this,"show"])),this.d(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(a.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(a.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let s=function(u,d){const p=[];for(const f of d)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?p.push(`面积:${(u/1e6).toFixed(2)} km²`):p.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const g=u*(1/666.7);if(g>=15){const m=g/15;p.push(`面积:${m.toFixed(2)} 公顷`)}else p.push(`面积:${g.toFixed(2)} 亩`);break}return p};const r=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...s(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=co([...u].join(`
1890
- `),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=by(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??Yo.defaults.interpolationDistance,d=this.interpolation??Yo.defaults.interpolation,p=this.offsetHeight??Yo.defaults.offsetHeight,f=this.drillDepth??Yo.defaults.drillDepth,g=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);g.push(X)}var m=LR(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=OR(g),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,m);P<0&&(m=dC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=NR(m,_);var x=dC(y),T=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,T,T),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=ir(g,S),O=[],N=[],V=VR(R);if(d&&u>0){var U=BR(R);const q=Math.max(U.maxy-U.miny,U.maxx-U.minx);var z=HR(V,U,u);const X=await qf(z,C,S,m,o.scene,p,f,q);var B=$R(R,u);const Q=await qf(B,C,S,m,o.scene,p,f,q);N.push(...X.world_cartesian),O.push(...X.local),N.push(...Q.world_cartesian),O.push(...Q.local);for(let ee=0;ee<R.length;++ee){const he=R[ee];var w=await qf([he],C,S,m,o.scene,p,f,q);if(w.local.length>0)O.push(...w.local),N.push(...w.world_cartesian);else{const ge=[he.x,he.y,he.z+p];O.push(ge);var E=ir([h.Cartesian3.fromArray(ge)],C);for(let ve=0;ve<E.length;++ve)N.push(E[ve])}}}else{const q=R.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));O=q,N=ir(q,C)}var D=UR(O,V);const L=WR(N,D);this.totalArea=L;const G=[];O.forEach(q=>{const X=[q.x,q.y,q.z];X&&G.push(...X)});const Y={position:{typedArray:new Float32Array(G),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Y;const q=await zR([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:ee}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,ee)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Yo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Bo=Yo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Bo||(Bo={})),a.extendClassProps(Bo.prototype,Bo.createDefaultProps);async function zR(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await uC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function LR(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function OR(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function dC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function NR(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function ir(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function BR(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function VR(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function UR(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=p_.from(e).triangles;const o=[],s=it([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;Pt([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function WR(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=GR(o)}return e}function GR(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function HR(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)XR([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function $R(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=qR(n,o,i);e.push(...s)}return e}function qR(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function XR(t,i){var e=ht(t);if(!k2(ht(i[0]),ht(i[i.length-1])))return!1;var n=[];n.push(i);var o=it(n);return Pt(e,o)}async function qf(t,i,e,n,o,s,r,l){var c=[];t.forEach(S=>{var x=S.clone();x.z=l,c.push(x)});var u=ir(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let S=0;S<u.length;++S){await uC();var m=u[S],y=new h.Ray(m,d),_=void 0;try{_=o.pickFromRay(y)}catch{}if(!_){y=new h.Ray(m,n);try{_=o.pickFromRay(y)}catch{}}if(_){var P=_.position;if(!(!P||!P.x||isNaN(P.x))){var C=ir([P],e);C.forEach(x=>{x.z+=s}),P=ir(C,i)[0],g.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const Ul=class Ul extends qt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Bo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}};v(Ul,"type",Ul.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Ul));let Xf=Ul;async function YR(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Wl=class Wl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),YR(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const m=document.createElement("span");d.appendChild(m),this.dispose(()=>d.removeChild(m));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{m.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const _=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var T;let P="",C="";const S=u.getCameraInfo();if(S){const R=(N,V)=>S.position[N].toFixed(V),O=(N,V)=>S.rotation[N].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${R(0,5)}° 纬度: ${R(1,5)}° 高度: ${R(2,2)}米 偏航角: ${O(0,2)}° 俯仰角: ${O(1,2)}° 翻滚角:${O(2,2)}° `}f.innerText=P;const x=(T=u.extensions)==null?void 0:T.cursorPositionInfo.cursorPosition;if(x){const R=(O,N)=>x[O].toFixed(N);C=`鼠标位置:${R(0,5)}° ${R(1,5)}° ${R(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(_)),_()}}}}get customDiv(){return this._customDiv}};v(Wl,"type",Wl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Wl));let Yf=Wl;const Gl=class Gl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const m=document.createElement("div");f.appendChild(m);const y=document.createElement("div");p.appendChild(y);const _=document.createElement("div");y.appendChild(_);const P=document.createElement("div");_.appendChild(P);const C=document.createElement("div");_.appendChild(C);const S=document.createElement("span");y.appendChild(S);{const N=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(N)),N()}{const N=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(N)),N()}{const N=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(N)),N()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let x="EarthSDK";g.innerText=x,m.style.fontWeight="";let T="——免费开源地球可视化开发包";m.innerText=T,y.style.width="550px",_.style.position="fixed",_.style.width="125px",_.style.height="30px",_.style.padding="0 5px",_.style.display="flex",_.style.justifyContent="flex-end",_.style.pointerEvents="auto",_.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,S.style.display="flex",S.style.zIndex="101",S.style.justifyContent="flex-end",S.style.right="0";const R=()=>{const N=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||N&&N>1e6)_.style.display="none";else{_.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const U=n.viewerLegend.legend.computedLengthInPixels;if(U){C.style.width=`${U}px`;const z=(135-U)/2;C.style.left=`${z}px`}}};R();const O=setInterval(()=>{R()},200);this.dispose(()=>clearInterval(O));{let N;const V=()=>{e.show?(d.style.display="block",N=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var w;let U="";const z=u.getCameraInfo();if(z){const E=(D,L)=>z.position[D].toFixed(L);U+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const B=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(B){const E=(D,L)=>B[D].toFixed(L);U+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else U+="暂时无法获取鼠标位置...";S.innerText=U})),N.start()):(d.style.display="none",N.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};v(Gl,"type",Gl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Gl));let Zf=Gl;const pC=h.Math.toDegrees,ZR=new h.Cartographic;function fC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const m=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=m<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,g=h.Cartographic.fromCartesian(f,void 0,ZR);return[pC(g.longitude),pC(g.latitude),g.height]}const Hl=class Hl extends vt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[g,m,y]=u[0],_=[g,m,y+d];try{u.forEach((P,C)=>{if(C===0)return;const S=fC(_,P,o.scene);S?(p.push([P,S]),f.push([_,S])):f.push([_,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}};v(Hl,"type",Hl.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Hl));let Qf=Hl;class ga extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_enableEvent",this.dv(new a.Event));v(this,"_clearEvent",this.dv(new a.Event));v(this,"_gridPoints",this.dv(a.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new $t(e,n)),r=this.dv(new $t(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Di(e,n));this.d(a.track([g,"show"],[this,"show"])),this.d(a.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([g,"positions"],[this,"positions"])),this.d(a.bind([g,"depthTest"],[this,"depthTest"])),this.d(a.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([g,"outline"],[this,"outline"])),this.d(a.bind([g,"color"],[this,"fillColor"])),this.d(a.bind([g,"fill"],[this,"filled"])),this.d(a.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(_=>{g.flyTo(_)}));const m=()=>{g.positions=this.positions};m();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(m))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:m}=a.getMinMaxCorner(this.positions),y=g[0],_=g[1],P=m[0],C=m[1],x={type:"Polygon",coordinates:[[...this.positions.map(B=>[B[0],B[1]])]]},T=[y,_,P,C],R=this.gridWidth,V=I0(T,R,{units:"meters",mask:x}).features.map(B=>B.geometry.coordinates),U=h.Math.toRadians;return V.map(B=>new h.Cartographic(U(B[0]),U(B[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async g=>{const m=u();let y=0,_=300;const P=Math.ceil(m.length/_),C=[];do{let S=[];y===P-1?S=m.slice(y*_):S=m.slice(y*_,(y+1)*_);const x=o.scene.sampleHeightMostDetailed(S),T=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,T&&T.length){const R=h.Math.toDegrees,O=T.filter(N=>N!=null).map(N=>[R(N.longitude),R(N.latitude),N.height]);C.push(...O)}y++}while(y<P);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let m=0;const y=[];let _=0;const P=[];this.gridPoints.forEach(C=>{const S=this.positions;C[2]>S[0][2]?(m+=this.gridWidth*this.gridWidth*(C[2]-S[0][2]),y.push([C,[C[0],C[1],S[0][2]]])):(_+=this.gridWidth*this.gridWidth*(S[0][2]-C[2]),P.push([C,[C[0],C[1],S[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=Py(this.positions),this.cutVolume=m,this.fillVolume=_,this.cutAndFillVolume=_-m,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const m=JSON.parse(JSON.stringify(this.positions.slice(1)));m.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=m};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const $l=class $l extends qt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new ga(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v($l,"type",$l.register("ESCesiumViewer",a.ESVolumeMeasurement.type,$l));let kf=$l;const ql=class ql extends qt{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=ut(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Te.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(ql,"type",ql.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,ql));let Kf=ql;const Xl=class Xl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Xl,"type",Xl.register("ESCesiumViewer",a.ESHumanPoi.type,Xl));let Jf=Xl;const Yl=class Yl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,g;const u=(g=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(m=>m/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const m=f.getProperty("layer"),y=f.getProperty("dataset"),_=m.toString(),P=y.toString(),C=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===_);if(C&&C.value.color){const x=C.value.color;return h.Color.fromCssColorString(x,g)}const S=l.filter(x=>x.dataset.toString()===P);if(S.length==1&&S[0].value.color){const x=S[0].value.color;return h.Color.fromCssColorString(x,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(m){return console.warn(m),h.Color.clone(h.Color.WHITE,g)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const S=Object.entries(i.visJson);for(let x=0;x<S.length;x++){const T=S[x];if(f.getProperty("id").toString()===T[0])return T[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),m=f.getProperty("dataset"),y=g.toString(),_=m.toString(),P=l.find(S=>S.dataset.toString()===_&&S.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const C=l.filter(S=>S.dataset.toString()===_);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return u(f,g)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};v(Yl,"type",Yl.register("ESCesiumViewer",a.ESRtsTileset.type,Yl));let jf=Yl;const Zl=class Zl extends Fs{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Zl,"type",Zl.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,Zl));let eg=Zl;const Ql=class Ql extends Fs{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Ql,"type",Ql.register("ESCesiumViewer",a.ESMsTileset.type,Ql));let tg=Ql;const kl=class kl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(kl,"type",kl.register("ESCesiumViewer",a.ESStaticMesh.type,kl));let ig=kl;const Kl=class Kl extends vt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new ym(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=re(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}};v(Kl,"type",Kl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Kl));let ng=Kl;class QR extends a.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new Si(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class kR extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=r.show)};g(),this.ad(r.showChanged.don(g))}{const g=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(g.don(p))}{const g=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(m=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,_=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:m}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(_),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=m,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(_)),g(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
1890
+ `),24))};r(),this.d(this.totalAreaChanged.don(r)),this.d(this.unitsChanged.don(r)),this.d(a.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=by(this.positions):this._geoDivPoi.position=void 0)}));const l=async()=>{if((!this.positions||this.positions.length<3)&&this.customPrimitive){this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1;return}const u=this.interpolationDistance??Yo.defaults.interpolationDistance,d=this.interpolation??Yo.defaults.interpolation,p=this.offsetHeight??Yo.defaults.offsetHeight,f=this.drillDepth??Yo.defaults.drillDepth,g=[];if(this.positions)for(let q=0;q<this.positions.length;++q){const X=h.Cartesian3.fromDegrees(this.positions[q][0],this.positions[q][1],this.positions[q][2]);g.push(X)}var m=L2(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=O2(g),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,m);P<0&&(m=dC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=N2(m,_);var x=dC(y),T=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,T,T),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=ir(g,S),O=[],N=[],V=V2(R);if(d&&u>0){var U=B2(R);const q=Math.max(U.maxy-U.miny,U.maxx-U.minx);var z=H2(V,U,u);const X=await qf(z,C,S,m,o.scene,p,f,q);var B=$2(R,u);const Q=await qf(B,C,S,m,o.scene,p,f,q);N.push(...X.world_cartesian),O.push(...X.local),N.push(...Q.world_cartesian),O.push(...Q.local);for(let ee=0;ee<R.length;++ee){const he=R[ee];var w=await qf([he],C,S,m,o.scene,p,f,q);if(w.local.length>0)O.push(...w.local),N.push(...w.world_cartesian);else{const ge=[he.x,he.y,he.z+p];O.push(ge);var E=ir([h.Cartesian3.fromArray(ge)],C);for(let ve=0;ve<E.length;++ve)N.push(E[ve])}}}else{const q=R.map(X=>h.Cartesian3.fromArray([X.x,X.y,X.z+q]));O=q,N=ir(q,C)}var D=U2(O,V);const L=W2(N,D);this.totalArea=L;const G=[];O.forEach(q=>{const X=[q.x,q.y,q.z];X&&G.push(...X)});const Y={position:{typedArray:new Float32Array(G),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=h.Matrix4.toArray(C),this.customPrimitive.attributes=Y;const q=await z2([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(q),this.customPrimitive.show=!0;const X=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!X)return;const{min:Q,max:ee}=X;this.customPrimitive.setLocalAxisedBoundingBox(Q,ee)}},c=this.dv(a.createProcessingFromAsyncFunc(async u=>{await u.promise(l()),this._starting=!1,r()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,r(),c.restart()})),this.d(this.stopEvent.don(()=>{c.cancel(),this._starting=!1,this.totalArea=0,this.customPrimitive.position=void 0,this.customPrimitive.attributes=void 0,this.customPrimitive.indexTypedArray=void 0,this.customPrimitive.show=!1,r()}))}}get pickedEvent(){return this._pickedEvent}get startEvent(){return this._startEvent}start(){this._startEvent.emit()}get stopEvent(){return this._stopEvent}stop(){this._stopEvent.emit()}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolyline(){return this._geoPolyline}get customPrimitive(){return this._customPrimitive}get geoDivPoi(){return this._geoDivPoi}};v(Yo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let Bo=Yo;(t=>{t.createDefaultProps=()=>({positions:a.reactArrayWithUndefined(void 0),show:void 0,totalArea:void 0,interpolationDistance:void 0,interpolation:void 0,offsetHeight:void 0,drillDepth:void 0,outlineWidth:void 0,outlineColor:a.reactArray([1,1,1,1]),units:a.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(Bo||(Bo={})),a.extendClassProps(Bo.prototype,Bo.createDefaultProps);async function z2(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const i=t.length/3|0,e=new Array(i*6);for(let n=0;n<i;++n)await uC(),e[n*6+0]=t[n*3+0],e[n*6+1]=t[n*3+1],e[n*6+2]=t[n*3+2],e[n*6+3]=t[n*3+1],e[n*6+4]=t[n*3+2],e[n*6+5]=t[n*3+0];return e}function L2(t){var i=new h.Cartesian3(0,0,0),e=new h.Cartesian3(0,0,0),n=new h.Cartesian3(0,0,0),o=new h.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var s=t.length;for(let u=0;u<s;++u){var r=t[u],l;u==0?l=t[t.length-1]:l=t[u-1];var c;u==t.length-1?c=t[0]:c=t[u+1],i=h.Cartesian3.subtract(r,l,i),e=h.Cartesian3.subtract(r,c,e),n=h.Cartesian3.cross(i,e,n),!n.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6)&&(n=h.Cartesian3.normalize(n,n),o=h.Cartesian3.add(o,n,o))}return n.x=o.x/s,n.y=o.y/s,n.z=o.z/s,n}function O2(t){var i=new h.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var n=t[o];i=h.Cartesian3.add(i,n,i)}return i.x=i.x/e,i.y=i.y/e,i.z=i.z/e,i}function dC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function N2(t,i){var e=h.Cartesian3.cross(t,i,new h.Cartesian3);e=h.Cartesian3.normalize(e,e);var n=h.Cartesian3.cross(t,e,new h.Cartesian3);n=h.Cartesian3.normalize(n,n);var o=t,s=new h.Matrix4(e.x,e.y,e.z,0,n.x,n.y,n.z,0,o.x,o.y,o.z,0,0,0,0,1);return s}function ir(t,i){var e=[];for(let s=0;s<t.length;++s){var n=t[s],o=h.Matrix4.multiplyByPoint(i,n,new h.Cartesian3);e.push(o)}return e}function B2(t){var i=t[0].x,e=t[0].y,n=t[0].x,o=t[0].y;return t.forEach(s=>{i=Math.min(i,s.x),e=Math.min(e,s.y),n=Math.max(n,s.x),o=Math.max(o,s.y)}),{minx:i,miny:e,maxx:n,maxy:o}}function V2(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function U2(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=p_.from(e).triangles;const o=[],s=it([i]);for(let r=0;r<n.length;r+=3){const l=n[r],c=n[r+1],u=n[r+2],d=(t[l].x+t[c].x+t[u].x)/3,p=(t[l].y+t[c].y+t[u].y)/3;Pt([d,p],s)&&o.push(l,c,u)}return new Uint32Array(o.reverse())}function W2(t,i){for(var e=0,n=0;n<i.length;n+=3){const o=[t[i[n]],t[i[n+1]],t[i[n+2]]];e+=G2(o)}return e}function G2(t){var i=h.Cartesian3.distance(t[0],t[1]),e=h.Cartesian3.distance(t[1],t[2]),n=h.Cartesian3.distance(t[2],t[0]),o=(i+e+n)/2,s=Math.sqrt(o*(o-i)*(o-e)*(o-n));return s||0}function H2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)X2([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function $2(t,i){var e=[];for(let r=0;r<t.length;++r){var n=t[r],o;r==t.length-1?o=t[0]:o=t[r+1];var s=q2(n,o,i);e.push(...s)}return e}function q2(t,i,e){var n=[],o=h.Cartesian3.distance(t,i),s=h.Cartesian3.subtract(i,t,new h.Cartesian3);if(s.equalsEpsilon(h.Cartesian3.ZERO,h.Math.EPSILON6))return[];s=h.Cartesian3.normalize(s,s);for(var r=e;r<o;){var l=new h.Cartesian3(s.x*r,s.y*r,s.z*r),c=h.Cartesian3.add(t,l,new h.Cartesian3);n.push(c),r+=e}return n}function X2(t,i){var e=ht(t);if(!kR(ht(i[0]),ht(i[i.length-1])))return!1;var n=[];n.push(i);var o=it(n);return Pt(e,o)}async function qf(t,i,e,n,o,s,r,l){var c=[];t.forEach(S=>{var x=S.clone();x.z=l,c.push(x)});var u=ir(c,i),d=new h.Cartesian3(-1*n.x,-1*n.y,-1*n.z),p=[],f=[],g=[];for(let S=0;S<u.length;++S){await uC();var m=u[S],y=new h.Ray(m,d),_=void 0;try{_=o.pickFromRay(y)}catch{}if(!_){y=new h.Ray(m,n);try{_=o.pickFromRay(y)}catch{}}if(_){var P=_.position;if(!(!P||!P.x||isNaN(P.x))){var C=ir([P],e);C.forEach(x=>{x.z+=s}),P=ir(C,i)[0],g.push(P),P=h.Cartographic.fromCartesian(P),p.push([P.longitude,P.latitude,P.height]),f.push(C[0])}}}return{local:f,world:p,world_cartesian:g}}const Ul=class Ul extends qt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new Bo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmAreaMeasurement;this.ad(a.track([e,"surfaceArea"],[s,"totalArea"])),this.ad(a.track([s,"units"],[e,"units"])),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"positions"],[e,"points"])),this.d(a.track([s,"interpolationDistance"],[e,"interpolation"])),this.d(a.track([s,"offsetHeight"],[e,"offsetHeight"]));{const r=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)s.outlineWidth=e.strokeWidth;else{s.outlineWidth=0;return}s.outlineWidth=e.strokeWidth,s.outlineColor=e.strokeColor};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(l.disposableOn(r))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmAreaMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.positions&&oe(s,o,n,r.positions,e),!0):!1}};v(Ul,"type",Ul.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Ul));let Xf=Ul;async function Y2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Wl=class Wl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d)),d.style.width="100%",d.style.position="absolute",d.style.height=`${a.ESViewerStatusBar.defaults.height}px`,d.style.left="0",d.style.bottom="0",d.style.color="#fff",d.style.padding="0 20px 0 0",d.style.boxSizing="border-box",d.style.lineHeight=`${a.ESViewerStatusBar.defaults.height}px`,d.style.zIndex="100",d.style.alignContent="center",d.style.justifyContent="space-between";const p=document.createElement("span");d.appendChild(p),this.dispose(()=>d.removeChild(p));const f=document.createElement("span");p.appendChild(f),this.dispose(()=>p.removeChild(f));const g=document.createElement("span");p.appendChild(g),g.addEventListener("dblclick",function(){let y=g.innerHTML;y.startsWith("鼠标位置")&&(y=y.slice(5)),Y2(y)}),g.style.cursor="pointer",this.dispose(()=>p.removeChild(g));const m=document.createElement("span");d.appendChild(m),this.dispose(()=>d.removeChild(m));{const y=()=>{d.style.height=(e.height??a.ESViewerStatusBar.defaults.height)+"px",d.style.lineHeight=(e.height??a.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(y)),y()}{const y=()=>{d.style.fontSize=(e.fontSize??a.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(y)),y()}{const y=()=>{e.bgColor?d.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:d.style.background=`rgba(${a.ESViewerStatusBar.defaults.bgColor[0]},${a.ESViewerStatusBar.defaults.bgColor[1]},${a.ESViewerStatusBar.defaults.bgColor[2]},${a.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(y)),y()}{m.innerText=`Cesium 版本 : ${h.VERSION} `;let y;const _=()=>{e.show?(d.style.display="flex",y=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var T;let P="",C="";const S=u.getCameraInfo();if(S){const R=(N,V)=>S.position[N].toFixed(V),O=(N,V)=>S.rotation[N].toFixed(V);P=`帧率:${u.getFPS()}FPS 经度: ${R(0,5)}° 纬度: ${R(1,5)}° 高度: ${R(2,2)}米 偏航角: ${O(0,2)}° 俯仰角: ${O(1,2)}° 翻滚角:${O(2,2)}° `}f.innerText=P;const x=(T=u.extensions)==null?void 0:T.cursorPositionInfo.cursorPosition;if(x){const R=(O,N)=>x[O].toFixed(N);C=`鼠标位置:${R(0,5)}° ${R(1,5)}° ${R(2,2)}m`}else C="暂时无法获取鼠标位置...";g.innerText=C})),y.start()):(d.style.display="none",y.destroy())};this.dispose(e.showChanged.disposableOn(_)),_()}}}}get customDiv(){return this._customDiv}};v(Wl,"type",Wl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Wl));let Yf=Wl;const Gl=class Gl extends a.EngineObject{constructor(e,n){super(e,n);v(this,"_customDiv");if(this._customDiv=this.disposeVar(new a.ESCustomDiv(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._customDiv;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"show"],[e,"show"])),s.instanceClass=class extends a.Destroyable{constructor(l,c,u){if(super(),this._subContainer=l,!u||!(u instanceof Te))return;u.extensions.cursorPositionInfo.enabled=!0;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));const p=document.createElement("div");d.appendChild(p),p.style.width="100%",p.className="ESViewerStatusBarScale",p.style.position="absolute",p.style.display="flex",p.style.height=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.left="0",p.style.bottom="0",p.style.color="#fff",p.style.padding="0 20px 0 0",p.style.boxSizing="border-box",p.style.lineHeight=`${a.ESViewerStatusBarScale.defaults.height}px`,p.style.zIndex="100",p.style.alignContent="center",p.style.justifyContent="space-between";const f=document.createElement("div");p.appendChild(f);const g=document.createElement("div");f.appendChild(g);const m=document.createElement("div");f.appendChild(m);const y=document.createElement("div");p.appendChild(y);const _=document.createElement("div");y.appendChild(_);const P=document.createElement("div");_.appendChild(P);const C=document.createElement("div");_.appendChild(C);const S=document.createElement("span");y.appendChild(S);{const N=()=>{p.style.height=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px",p.style.lineHeight=(e.height??a.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(N)),N()}{const N=()=>{p.style.fontSize=(e.fontSize??a.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(N)),N()}{const N=()=>{e.bgColor?p.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:p.style.background=`rgba(${a.ESViewerStatusBarScale.defaults.bgColor[0]},${a.ESViewerStatusBarScale.defaults.bgColor[1]},${a.ESViewerStatusBarScale.defaults.bgColor[2]},${a.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(N)),N()}f.style.display="flex",g.style.fontWeight="bold",g.style.padding="0 0 0 25px";let x="EarthSDK";g.innerText=x,m.style.fontWeight="";let T="——免费开源地球可视化开发包";m.innerText=T,y.style.width="550px",_.style.position="fixed",_.style.width="125px",_.style.height="30px",_.style.padding="0 5px",_.style.display="flex",_.style.justifyContent="flex-end",_.style.pointerEvents="auto",_.style.zIndex="101",P.style.width="125px",P.style.display="inline-block",P.style.textAlign="center",P.style.fontSize="14px",P.style.fontWeight="lighter",P.style.lineHeight="30px",P.style.color="#fff",P.innerHTML="1000km",C.style.borderRight="1px solid #fff",C.style.borderLeft="1px solid #fff",C.style.borderBottom="1px solid #fff",C.style.position="absolute",C.style.height="10px",C.style.top="15px",C.style.width="75px",C.style.right=`${60/2}px`,S.style.display="flex",S.style.zIndex="101",S.style.justifyContent="flex-end",S.style.right="0";const R=()=>{const N=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||N&&N>1e6)_.style.display="none";else{_.style.display="block";const V=n.viewerLegend.legend.computedLengthInStr;V&&(P.innerHTML=V);const U=n.viewerLegend.legend.computedLengthInPixels;if(U){C.style.width=`${U}px`;const z=(135-U)/2;C.style.left=`${z}px`}}};R();const O=setInterval(()=>{R()},200);this.dispose(()=>clearInterval(O));{let N;const V=()=>{e.show?(d.style.display="block",N=this.disposeVar(a.createAnimateFrameWithStartValues(()=>{var w;let U="";const z=u.getCameraInfo();if(z){const E=(D,L)=>z.position[D].toFixed(L);U+=`帧率:${u.getFPS()}FPS 相机: ${E(2,2)}米 `}const B=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(B){const E=(D,L)=>B[D].toFixed(L);U+=`位置:${E(0,5)}° ${E(1,5)}° ${E(2,2)}米`}else U+="暂时无法获取鼠标位置...";S.innerText=U})),N.start()):(d.style.display="none",N.destroy())};this.dispose(e.showChanged.disposableOn(V)),V()}}}}get customDiv(){return this._customDiv}};v(Gl,"type",Gl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Gl));let Zf=Gl;const pC=h.Math.toDegrees,Z2=new h.Cartographic;function fC(t,i,e){const n=h.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=h.Cartesian3.fromDegrees(i[0],i[1],i[2]),s=h.Cartesian3.subtract(o,n,new h.Cartesian3);h.Cartesian3.normalize(s,s);const r=new h.Ray(n,s),l=e.pickFromRay(r),c=e.globe.pick(r,e);var u;if(l&&l.position&&c){const m=h.Cartesian3.distance(n,l.position),y=h.Cartesian3.distance(n,c);u=m<y?l.position:c}else l&&l.position?u=l.position:c&&(u=c);if(!u)return;const d=h.Cartesian3.distance(n,o),f=h.Cartesian3.distance(n,u)>d?o:u,g=h.Cartographic.fromCartesian(f,void 0,Z2);return[pC(g.longitude),pC(g.latitude),g.height]}const Hl=class Hl extends vt{constructor(e,n){super(e,n);v(this,"_hideGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));v(this,"_visibleGeoPolylines",this.disposeVar(new $t(this.czmViewer,this.sceneObject.id)));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this._hideGeoPolylines,r=this._visibleGeoPolylines;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([r,"show"],[e,"show"])),this.d(a.track([r,"color"],[e,"visibleColor"])),this.d(a.track([s,"color"],[e,"invisibleColor"]));{const l=()=>{const u=e.points,d=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){s.positions=void 0,r.positions=void 0;return}const p=[],f=[],[g,m,y]=u[0],_=[g,m,y+d];try{u.forEach((P,C)=>{if(C===0)return;const S=fC(_,P,o.scene);S?(p.push([P,S]),f.push([_,S])):f.push([_,P])}),s.positions=p,r.positions=f}catch(P){console.warn(P)}};l();const c=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(c.don(l))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);{let r=[];return this.visibleGeoPolylines.positions&&(r=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(r=[...r,...this.hideGeoPolylines.positions.flat()]),oe(s,o,n,r,e),!0}}};v(Hl,"type",Hl.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Hl));let Qf=Hl;class ga extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.dv(new a.Event));v(this,"_enableEvent",this.dv(new a.Event));v(this,"_clearEvent",this.dv(new a.Event));v(this,"_gridPoints",this.dv(a.reactJson([])));v(this,"excavationPolylines");v(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.dv(new $t(e,n)),r=this.dv(new $t(e,n));this.excavationPolylines=s,this.fillPolylines=r;const l=s;l.color=[1,1,0,1],this.d(a.track([l,"show"],[this,"show"])),l.show=!1,l.depthTest=!0;const c=r;c.color=[0,0,1,1],this.d(a.track([c,"show"],[this,"show"])),c.show=!1;{const g=this.ad(new Di(e,n));this.d(a.track([g,"show"],[this,"show"])),this.d(a.bind([g,"allowPicking"],[this,"allowPicking"])),this.d(a.bind([g,"positions"],[this,"positions"])),this.d(a.bind([g,"depthTest"],[this,"depthTest"])),this.d(a.bind([g,"outlineWidth"],[this,"outlineWidth"])),this.d(a.bind([g,"outlineColor"],[this,"outlineColor"])),this.d(a.bind([g,"outline"],[this,"outline"])),this.d(a.bind([g,"color"],[this,"fillColor"])),this.d(a.bind([g,"fill"],[this,"filled"])),this.d(a.bind([g,"strokeGround"],[this,"strokeGround"])),this.d(a.bind([g,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(_=>{g.flyTo(_)}));const m=()=>{g.positions=this.positions};m();const y=this.dv(a.createNextAnimateFrameEvent(this.positionsChanged));this.d(y.don(m))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:g,maxPos:m}=a.getMinMaxCorner(this.positions),y=g[0],_=g[1],P=m[0],C=m[1],x={type:"Polygon",coordinates:[[...this.positions.map(B=>[B[0],B[1]])]]},T=[y,_,P,C],R=this.gridWidth,V=I0(T,R,{units:"meters",mask:x}).features.map(B=>B.geometry.coordinates),U=h.Math.toRadians;return V.map(B=>new h.Cartographic(U(B[0]),U(B[1])))},d=()=>{l.positions=[],c.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,l.depthTest=!0},p=this.dv(a.createProcessingFromAsyncFunc(async g=>{const m=u();let y=0,_=300;const P=Math.ceil(m.length/_),C=[];do{let S=[];y===P-1?S=m.slice(y*_):S=m.slice(y*_,(y+1)*_);const x=o.scene.sampleHeightMostDetailed(S),T=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,T&&T.length){const R=h.Math.toDegrees,O=T.filter(N=>N!=null).map(N=>[R(N.longitude),R(N.latitude),N.height]);C.push(...O)}y++}while(y<P);!C||!C.length||(this.gridPoints=C)}));let f=null;{const g=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let m=0;const y=[];let _=0;const P=[];this.gridPoints.forEach(C=>{const S=this.positions;C[2]>S[0][2]?(m+=this.gridWidth*this.gridWidth*(C[2]-S[0][2]),y.push([C,[C[0],C[1],S[0][2]]])):(_+=this.gridWidth*this.gridWidth*(S[0][2]-C[2]),P.push([C,[C[0],C[1],S[0][2]]]))}),l.positions=y,c.positions=P,l.show=!0,c.show=!0,this.area=Py(this.positions),this.cutVolume=m,this.fillVolume=_,this.cutAndFillVolume=_-m,f&&clearTimeout(f),f=setTimeout(()=>{l.depthTest=!1},200)};g(),this.d(this.gridPointsChanged.don(g)),this.d(()=>clearTimeout(f))}{const g=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};g(),this.d(this.positionsChanged.don(g))}{const g=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const m=JSON.parse(JSON.stringify(this.positions.slice(1)));m.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=m};g(),this.d(this.planeHeightChanged.don(g))}this.d(this.enableEvent.don(()=>{d(),this.gridPoints=[],this.progress=0,p.restart()})),this.d(this.clearEvent.don(()=>{d()}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get enableEvent(){return this._enableEvent}enableEmit(){this._enableEvent.emit()}get clearEvent(){return this._clearEvent}clearEmit(){this._clearEvent.emit()}get gridPoints(){return this._gridPoints.value}set gridPoints(e){this._gridPoints.value=e}get gridPointsChanged(){return this._gridPoints.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),planeHeight:a.react(void 0),gridWidth:1,area:0,cutVolume:0,fillVolume:0,cutAndFillVolume:0,progress:0,depthTest:!1,outlineWidth:2,outlineColor:[1,1,1,1],outline:!0,filled:!1,fillColor:[1,1,1,1],fillGround:!1,strokeGround:!1})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const $l=class $l extends qt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new ga(this.czmViewer,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoVolumeMeasurement;this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"positions"],[e,"points"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"planeHeight"],[e,"planeHeight"])),this.d(a.track([s,"gridWidth"],[e,"gridWidth"])),this.d(a.track([e,"cutVolume"],[s,"cutVolume"])),this.d(a.track([e,"fillVolume"],[s,"fillVolume"])),this.d(a.track([e,"cutAndFillVolume"],[s,"cutAndFillVolume"])),this.d(a.bind([e,"progress"],[s,"progress"])),this.d(a.track([s,"depthTest"],[e,"depthTest"])),this.d(a.track([s,"outline"],[e,"stroked"])),this.d(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.d(a.track([s,"outlineColor"],[e,"strokeColor"])),this.d(a.track([s,"filled"],[e,"filled"])),this.d(a.track([s,"fillColor"],[e,"fillColor"])),this.d(a.track([s,"fillGround"],[e,"fillGround"])),this.d(a.track([s,"strokeGround"],[e,"strokeGround"])),this.ad(a.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{s.enableEmit()})),this.d(e.clearEvent.don(()=>{s.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoVolumeMeasurement:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v($l,"type",$l.register("ESCesiumViewer",a.ESVolumeMeasurement.type,$l));let kf=$l;const ql=class ql extends qt{constructor(e,n){super(e,n);v(this,"czmEntity");v(this,"czmPolyline",this.ad(new a.ESGeoLineString));const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.czmPolyline;n.add(s),this.ad(()=>n.delete(s)),this.ad(a.bind([s,"show"],[e,"show"])),this.ad(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.ad(a.bind([s,"stroked"],[e,"stroked"])),this.ad(a.bind([s,"strokeColor"],[e,"strokeColor"])),this.ad(a.bind([s,"strokeWidth"],[e,"strokeWidth"])),this.ad(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)s.points=e.points;else{const p=structuredClone(e.points);p.push(p[0]),e.perPositionHeight?s.points=p:s.points=p.map(f=>(f[2]=e.height??a.ESGeoExtrudedPolygon.defaults.height,f))}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(d.don(u))}const r=this.czmEntity=o.entities.add({polygon:{}});h.Entity.prototype&&(r.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(r));let l=new h.PolygonHierarchy;r.polygon&&(r.polygon.hierarchy=new h.CallbackProperty(()=>l,!1));const c=()=>{const u=ut(e.points??[]);if(u.length<2){l=new h.PolygonHierarchy;return}l=new h.PolygonHierarchy(u)};c(),this.dispose(e.pointsChanged.disposableOn(c));{const u=()=>{r.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!r.show&&e.filled)};u();const d=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(d.don(u))}{const u=()=>{r.polygon&&(r.polygon.perPositionHeight=new h.ConstantProperty(e.perPositionHeight),c())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{r.polygon&&(r.polygon.height=new h.ConstantProperty(e.height??a.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{r.polygon&&(r.polygon.extrudedHeight=new h.ConstantProperty(e.extrudedHeight??a.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const d=h.Color.fromCartesian4(h.Cartesian4.fromArray(e.fillColor));r.polygon&&(r.polygon.material=d)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new a.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new Te.ObjectsToExcludeWrapper(n,r)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:n,maxPos:o}=a.getMinMaxCorner(e.points);return[n[2],o[2]]}return[0,0]}};v(ql,"type",ql.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,ql));let Kf=ql;const Xl=class Xl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:s}=i;this.dispose(a.bind([o,"position"],[i,"position"])),this.dispose(a.bind([o,"rotation"],[i,"rotation"])),this.ad(a.bind([o,"scale"],[i,"scale"])),this.ad(a.track([s,"scale"],[i,"scale"])),this.dispose(a.track([s,"rotation"],[i,"rotation"]));const r=()=>{const c=i.position;s.position=[c[0],c[1],c[2]+i.poiOffsetHeight]};r();const l=this.dv(a.createNextAnimateFrameEvent(i.positionChanged,i.poiOffsetHeightChanged));this.d(l.don(r)),this.ad(s.pickedEvent.don(c=>{c.assign({sceneObject:i}),i.pickedEvent.emit(c)}))}};v(Xl,"type",Xl.register("ESCesiumViewer",a.ESHumanPoi.type,Xl));let Jf=Xl;const Yl=class Yl extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const s=o.d(o.tilesetReady.donce(c=>{c.allTilesLoaded.addEventListener(()=>{var d,p,f,g;const u=(g=(f=(p=(d=c==null?void 0:c._root)==null?void 0:d._content)==null?void 0:p._model)==null?void 0:f._featureTables[0])==null?void 0:g._features[0];u?o.strokeFeature([u],h.Color.LIME.toBytes().map(m=>m/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",c),s()})})),r=o.url,l=Date.now();r.includes("?reload=")?o.url=r.replace(/\?reload=\d+/,`?reload=${l}`):o.url=r+`?reload=${l}`})),this.d(i.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(i.es3DTileset.tilesetReady.don(o=>{const s=()=>{const l=i.layerConfig;if(!l){o.style=void 0;return}const c=i.colorBlendMode,u=(f,g)=>{try{if(f.getPropertyIds().includes("materialName"))return h.Color.clone(h.Color.WHITE,g);const m=f.getProperty("layer"),y=f.getProperty("dataset"),_=m.toString(),P=y.toString(),C=l.find(x=>x.dataset.toString()===P&&x.layer.toString()===_);if(C&&C.value.color){const x=C.value.color;return h.Color.fromCssColorString(x,g)}const S=l.filter(x=>x.dataset.toString()===P);if(S.length==1&&S[0].value.color){const x=S[0].value.color;return h.Color.fromCssColorString(x,g)}else return h.Color.clone(h.Color.WHITE,g)}catch(m){return console.warn(m),h.Color.clone(h.Color.WHITE,g)}},d=f=>{try{if(f.getPropertyIds().includes("id")){const S=Object.entries(i.visJson);for(let x=0;x<S.length;x++){const T=S[x];if(f.getProperty("id").toString()===T[0])return T[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const g=f.getProperty("layer"),m=f.getProperty("dataset"),y=g.toString(),_=m.toString(),P=l.find(S=>S.dataset.toString()===_&&S.layer.toString()===y);if(P&&P.value.visible===!1)return!1;if(P&&P.value.visible===!0)return!0;const C=l.filter(S=>S.dataset.toString()===_);return!(C.length==1&&C[0].value.visible===!1)}catch(g){return console.warn(g),!0}};let p;c!=="HIGHLIGHT"?p=new h.Cesium3DTileStyle({color:{evaluateColor:function(f,g){return u(f,g)}},show:{evaluate:function(f){return d(f)}}}):p=new h.Cesium3DTileStyle({show:{evaluate:function(f){return d(f)}}}),console.log("style",p),o.style=p};s();const r=this.dv(a.createNextAnimateFrameEvent(i.layerConfigChanged,i.colorBlendModeChanged,i.visJsonChanged));this.d(r.don(()=>{s()}))}))}};v(Yl,"type",Yl.register("ESCesiumViewer",a.ESRtsTileset.type,Yl));let jf=Yl;const Zl=class Zl extends Fs{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Zl,"type",Zl.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,Zl));let eg=Zl;const Ql=class Ql extends Fs{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Ql,"type",Ql.register("ESCesiumViewer",a.ESMsTileset.type,Ql));let tg=Ql;const kl=class kl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new ti(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(kl,"type",kl.register("ESCesiumViewer",a.ESStaticMesh.type,kl));let ig=kl;const Kl=class Kl extends vt{constructor(i,e){super(i,e);const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=this.ad(new ym(n));this.ad(i.startEvent.don(async()=>{const s=await o.getDepthsFromScreen(),r=Number.isFinite(i.radius)?i.radius:a.ESSkylineAnalysis.defaults.radius,{depths:l,windowPositions:c,positions:u}=o.getSkylineDepthsAndPositions(s,n.scene.canvas.width,n.scene.canvas.height,r),d=re(n.camera.position);u.push(d),i.depths=l,i.windowPositions=c,i.points=u}))}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):n.points?(oe(o,n,e,n.points,i),!0):!1:!1}};v(Kl,"type",Kl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Kl));let ng=Kl;class Q2 extends a.Destroyable{constructor(e,n){super();v(this,"_rectangle");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));const o=e.sceneObject;this._rectangle=this.ad(new Si(n,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(a.bind([this.rectangle,"show"],[o,"show"])),this.ad(a.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(s=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:s}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class k2 extends a.Destroyable{constructor(e,n){super();v(this,"_primitive");v(this,"_updateHeatMapEvent",this.disposeVar(new a.Event));v(this,"czmViewer");v(this,"czmESHeatMap");const o=this.czmViewer=n,s=this.czmESHeatMap=e,r=s.sceneObject,l=o.viewer;if(!l)return;let c,u;const d=this.ad(new a.Event),p=()=>{f(),!(!c||!u)&&(this._primitive=l.scene.primitives.add(new h.Primitive({geometryInstances:c,appearance:u,asynchronous:!1,allowPicking:r.allowPicking})))},f=()=>{this.primitive&&l.scene.primitives.remove(this.primitive)};this.ad(f);{const g=()=>{this.primitive&&(this.primitive.show=r.show)};g(),this.ad(r.showChanged.don(g))}{const g=this.ad(a.createNextAnimateFrameEvent(r.allowPickingChanged,d));this.ad(g.don(p))}{const g=()=>{s.rectangle&&(c=new h.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(s.div.style.width),Number.parseFloat(s.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=c,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(m=>{if(!s.rectangle)return;const y=s.rectangle[1]+(s.rectangle[3]-s.rectangle[1])*.5,_=a.getDistancesFromPositions([[s.rectangle[0],y,0],[s.rectangle[2],y,0]],"GEODESIC")[0]/5;u=new h.MaterialAppearance({material:new h.Material({fabric:{type:"Image",uniforms:{image:m}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(_),flat:!0}),this.primitive&&s.rectangle&&(this.primitive.appearance.material.uniforms.image=m,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(_)),g(),this.primitive||d.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
1891
1891
  in vec3 position3DHigh;
1892
1892
  in vec3 position3DLow;
1893
1893
  in vec3 normal;
@@ -1910,7 +1910,7 @@ void main()
1910
1910
  p += vec4(color.a * upDir * ${e??1e3}, 0.0);
1911
1911
 
1912
1912
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
1913
- }`}createHeatmapGeometry(e,n){const o=this.czmESHeatMap,s=e||256,r=Math.ceil(n||256),[l,c,u,d]=o.rectangle,p=(u-l)/(s-1),f=(d-c)/(r-1),g=[],m=[],y=[],_=[];for(let P=0;P<s;P++){const C=l+p*P;for(let S=0;S<r;S++){const x=c+f*S;o.heatmap.getValueAt({x:P,y:S});const T=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(T.x,T.y,T.z),m.push(P/(s-1),S/(r-1)),S!==r-1&&P!==s-1&&(y.push((P+1)*r+S+1,P*r+S+1,P*r+S),y.push(P*r+S,(P+1)*r+S,(P+1)*r+S+1))}}return this.createGeometry(g,m,y,_)}createGeometry(e,n,o,s){return new h.Geometry({attributes:new h.GeometryAttributes({position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),indices:new Uint32Array(o),boundingSphere:h.BoundingSphere.fromVertices(e,new h.Cartesian3,3),primitiveType:h.PrimitiveType.TRIANGLES})}}const Bt={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class KR{constructor(i){v(this,"_coordinator");v(this,"_data");v(this,"_radi");v(this,"_min");v(this,"_max");v(this,"_xField");v(this,"_yField");v(this,"_valueField");v(this,"_cfgRadius");this._coordinator=new gC,this._data={},this._radi={},this._min=0,this._max=1,this._xField=i.xField||i.defaultXField||Bt.defaultXField,this._yField=i.yField||i.defaultYField||Bt.defaultYField,this._valueField=i.valueField||i.defaultValueField||Bt.defaultValueField,i.radius&&(this._cfgRadius=i.radius)}_organiseData(i,e){const n=i[this._xField],o=i[this._yField],s=i[this._valueField]||1,r=i.radius||this._cfgRadius||Bt.defaultRadius;return this._data[n]||(this._data[n]={},this._radi[n]={}),this._data[n][o]?this._data[n][o]+=s:(this._data[n][o]=s,this._radi[n][o]=r),this._data[n][o]>this._max?(e?this.setDataMax(this._data[n][o]):this._max=this._data[n][o],!1):{x:n,y:o,value:s,radius:r,min:this._min,max:this._max}}_unOrganizeData(){const i=[];for(const e in this._data)for(const n in this._data[e])i.push({x:Number(e),y:Number(n),radius:this._radi[e][n],value:this._data[e][n]});return{min:this._min,max:this._max,data:i}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(i){if(Array.isArray(i))i.forEach(e=>this.addData(e));else{const e=this._organiseData(i,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(i){this._data={},this._radi={};for(const e of i.data)this._organiseData(e,!1);return this._max=i.max,this._min=i.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(i){return this._max=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(i){return this._min=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(i){this._coordinator=i}getData(){return this._unOrganizeData()}}class JR{constructor(i){v(this,"shadowCanvas");v(this,"canvas");v(this,"_renderBoundaries");v(this,"_width");v(this,"_height");v(this,"shadowCtx");v(this,"ctx");v(this,"_palette");v(this,"_templates");v(this,"_blur",Bt.defaultBlur);v(this,"_opacity",0);v(this,"_maxOpacity",Bt.defaultMaxOpacity*255);v(this,"_minOpacity",Bt.defaultMinOpacity*255);v(this,"_useGradientOpacity",!1);v(this,"_min",0);v(this,"_max",1);const e=i.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=i.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const n=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+n.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+n.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(i),this._templates={},this._setStyles(i)}_getColorPalette(i){const e=i.gradient||i.defaultGradient||Bt.defaultGradient,n=document.createElement("canvas"),o=n.getContext("2d");n.width=256,n.height=1;const s=o.createLinearGradient(0,0,256,1);for(const r in e)s.addColorStop(Number(r),e[r]);return o.fillStyle=s,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(i,e){const n=document.createElement("canvas"),o=n.getContext("2d"),s=i,r=i;if(n.width=n.height=i*2,e===1)o.beginPath(),o.arc(s,r,i,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const l=o.createRadialGradient(s,r,i*e,s,r,i);l.addColorStop(0,"rgba(0,0,0,1)"),l.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=l,o.fillRect(0,0,2*i,2*i)}return n}renderPartial(i){this._drawAlpha(i),this._colorize()}renderAll(i){this._clear(),this._drawAlpha(this._prepareData(i)),this._colorize()}_prepareData(i){const e=[],n=Object.keys(i.data);for(const o of n){const s=Object.keys(i.data[o]);for(const r of s)e.push({x:Number(o),y:Number(r),value:i.data[o][r],radius:i.radi[o][r]})}return{min:i.min,max:i.max,data:e}}updateConfig(i){i.gradient&&(this._palette=this._getColorPalette(i)),this._setStyles(i)}setDimensions(i,e){this._width=i,this._height=e,this.canvas.width=this.shadowCanvas.width=i,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(i){this._blur=i.blur===0?0:i.blur||i.defaultBlur||Bt.defaultBlur,i.backgroundColor&&(this.canvas.style.backgroundColor=i.backgroundColor),this._opacity=(i.opacity||0)*255,this._maxOpacity=(i.maxOpacity||i.defaultMaxOpacity||Bt.defaultMaxOpacity)*255,this._minOpacity=(i.minOpacity||i.defaultMinOpacity||Bt.defaultMinOpacity)*255,this._useGradientOpacity=!!i.useGradientOpacity}_drawAlpha(i){this._min=i.min,this._max=i.max;const e=1-this._blur;for(const n of i.data){const o=n.radius,s=n.x-o,r=n.y-o,l=Math.min(n.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(l-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],s,r),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],s),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],r),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],s+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],r+2*o)}}_colorize(){let[i,e,n,o]=this._renderBoundaries;i=Math.max(0,i),e=Math.max(0,e),n=Math.min(this._width-i,n-i),o=Math.min(this._height-e,o-e);const s=this.shadowCtx.getImageData(i,e,n,o),r=s.data;for(let l=3;l<r.length;l+=4){const c=r[l],u=c*4;if(!u)continue;let d;this._opacity>0?d=this._opacity:d=c<this._maxOpacity?c<this._minOpacity?this._minOpacity:c:this._maxOpacity,r[l-3]=this._palette[u],r[l-2]=this._palette[u+1],r[l-1]=this._palette[u+2],r[l]=this._useGradientOpacity?this._palette[u+3]:d}this.ctx.putImageData(s,i,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(i){const n=this.shadowCtx.getImageData(i.x,i.y,1,1).data[3];return Math.abs(this._max-this._min)*(n/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class gC{constructor(){v(this,"cStore");this.cStore={}}on(i,e,n){this.cStore[i]||(this.cStore[i]=[]),this.cStore[i].push(o=>e.call(n,o))}emit(i,e){this.cStore[i]&&this.cStore[i].forEach(n=>n(e))}}class jR{constructor(i={}){v(this,"_config");v(this,"_coordinator");v(this,"_renderer");v(this,"_store");if(this._config={...Bt,...i},this._coordinator=new gC,this._config.plugin){const e=Bt.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new JR(this._config),this._store=new KR(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",i=>this._renderer.renderPartial(i),this._renderer),this._coordinator.on("renderall",i=>this._renderer.renderAll(i),this._renderer),this._coordinator.on("extremachange",i=>{var e,n;(n=(e=this._config).onExtremaChange)==null||n.call(e,{min:i.min,max:i.max,gradient:this._config.gradient||this._config.defaultGradient||Bt.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(i){return this._store.addData(i),this}setData(i){return this._store.setData(i),this}setDataMax(i){return this._store.setDataMax(i),this}setDataMin(i){return this._store.setDataMin(i),this}configure(i){return this._config={...this._config,...i},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(i){return this._store.getValueAt?this._store.getValueAt(i):this._renderer.getValueAt?this._renderer.getValueAt(i):null}}const eF=t=>new jR(t),Jl=class Jl extends Jt{constructor(e,n){super(e,n);v(this,"_heatmap");v(this,"_div");v(this,"_primitiveObj");v(this,"_rectangle",this.disposeVar(a.react(void 0)));v(this,"onePixelRadius",1e-4);const o=n.viewer,s=256;if(this._primitiveObj=this.ad(new a.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new kR(this,n):new QR(this,n))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${s}px`,this.div.style.height=`${s}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=eF({container:this.div}),this.heatmap._renderer.setDimensions(s,s);const r=this.ad(new a.Event);let l=[],c={max:100,min:0};{const u=()=>{const p={radius:e.radius??a.ESHeatMap.defaults.radius,gradient:e.gradient??a.ESHeatMap.defaults.gradient,blur:e.blur??a.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(p),this.heatmap._store._cfgRadius=p.radius,r.emit()};u();const d=this.ad(a.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(d.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:p,minPos:f}=a.getMinMaxCorner(e.data),g=p[0]-f[0],m=p[1]-f[1];if(c={max:p[2]??100,min:f[2]??0},!Number.isFinite(g)||!Number.isFinite(m)||g<=0||m<=0)return;const y=1/Math.cos((f[1]+m*.5)*Math.PI/180);if(y==1/0)return;const _=s*m/g*y;this.div.style.width=`${s}px`,this.div.style.height=`${_}px`,this.heatmap._renderer.setDimensions(s,_);const P=g/s*(e.radius??a.ESHeatMap.defaults.radius)*2,C=m/_*(e.radius??a.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(P,C),this.rectangle=[f[0]-P,f[1]-C,p[0]+P,p[1]+C],l=tF(e.data,this.rectangle,s,_),r.emit()}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(d.don(u))}{const u=()=>{const d={max:c.max,min:c.min,data:l};this.heatmap.setData(d),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(r.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{r.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.rectangle?(oe(s,o,n,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};v(Jl,"type",Jl.register("ESCesiumViewer",a.ESHeatMap.type,Jl));let og=Jl;function tF(t,i,e,n,o){return t.map(s=>({x:(s[0]-i[0])*e/(i[2]-i[0])|0,y:(1-(s[1]-i[1])/(i[3]-i[1]))*n|0,value:s[2]}))}const jl=class jl extends vt{constructor(e,n){super(e,n);v(this,"czmPoints");if(!n.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new vo(n,e.id)),this._updateShow();const s=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(s.don(()=>this._updateShow())),this._updatePoints();const r=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(r.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(n=>{var o,s,r,l;return{position:n,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??a.ESGeoPoints.defaults.pointStyle.size,color:((s=this.sceneObject.pointStyle)==null?void 0:s.color)??a.ESGeoPoints.defaults.pointStyle.color,outlineColor:((r=this.sceneObject.pointStyle)==null?void 0:r.outlineColor)??a.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((l=this.sceneObject.pointStyle)==null?void 0:l.outlineWidth)??a.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};v(jl,"type",jl.register("ESCesiumViewer",a.ESGeoPoints.type,jl));let sg=jl;const Zo=class Zo extends Wt{constructor(e){super();v(this,"_config",this.disposeVar(a.react(Zo.defaultConfig)));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Zo.defaultPointerEventFilterFunc)));v(this,"point");v(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new a.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new iF(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new ti(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};v(Zo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),v(Zo,"defaultPointerEventFilterFunc",e=>e.button===0),v(Zo,"defaults",{...Wt.defaults,position:[116.39,39.9,0]});let Vi=Zo;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Vi||(Vi={})),a.extendClassProps(Vi.prototype,Vi.createDefaultProps);class iF extends a.Destroyable{constructor(e,n){super();v(this,"_doings",[]);v(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=n;const o=(s,r)=>{r=="click"&&(!n.clickEnabled||!n.pointerEventFilterFunc(s))||r=="dblclick"&&(!n.dblClickEnabled||!n.pointerEventFilterFunc(s))||(n.over(),n.enabled=!1)};this.ad(e.clickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(s=>{if(!s.pointerEvent)return;const r=new nF(this,s.pointerEvent,l=>{if(!l||l[2]<-1e5){n.position=void 0;return}const c=[...l];e.editingHeightOffset&&(c[2]+=e.editingHeightOffset),n.position=c,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(d=>d.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class nF extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Zg(o,e,this._owner.placeEditing.virtualHeight),[r]=a.getEventFromPromise(s);this.dispose(r.disposableOn(n))}}class Zt extends Wt{constructor(){super()}}v(Zt,"defaults",{...Wt.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0)})})(Zt||(Zt={})),a.extendClassProps(Zt.prototype,Zt.createDefaultProps);function rg(t,i){const e=new be(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=i,e}const ci=class ci extends a.Destroyable{constructor(i){if(super(),!i.viewer)return;const e=this.disposeVar(rg(i,ci.defaults.xAxisColor)),n=this.disposeVar(rg(i,ci.defaults.yAxisColor)),o=this.disposeVar(rg(i,ci.defaults.zAxisColor));{const s=()=>{e.show=this.xAxisShow&&this.show,n.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};s();const r=this.ad(a.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(r.disposableOn(s))}{const s=()=>{const{position:l=ci.defaults.position,heading:c=ci.defaults.heading}=this,[u,d,p]=l,{dimensions:f=ci.defaults.dimensions}=this;o.positions=[l,[u,d,p+f[2]]];const g=a.geoRhumbDestination(l,f[0],90+c);g&&(e.positions=[l,g]);const m=a.geoRhumbDestination(l,f[1],0+c);m&&(n.positions=[l,m])};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(r.disposableOn(s))}{const s=()=>{e.color=this.xAxisColor??ci.defaults.xAxisColor,n.color=this.yAxisColor??ci.defaults.yAxisColor,o.color=this.zAxisColor??ci.defaults.zAxisColor};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(r.disposableOn(s))}}};v(ci,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let $n=ci;(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),heading:0,dimensions:a.reactArray([1e3,1e3,1e3]),xAxisColor:a.reactArray([1,0,0,1]),yAxisColor:a.reactArray([0,1,0,1]),zAxisColor:a.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})($n||($n={})),a.extendClassProps($n.prototype,$n.createDefaultProps);const Kn=class Kn extends Zt{constructor(e){super();v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.ad(a.react("none")),originPosition:this.disposeVar(a.reactArray(Zt.defaults.position)),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});v(this,"_createCoordinates",e=>{const n=this.ad(new $n(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{mC(n,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const r=[...this.position??Kn.defaults.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),n.position=r};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{n.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{n.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return n});v(this,"_createOriginCoordinates",e=>{const n=this.ad(new $n(e));n.xAxisColor=[1,0,0,.5],n.yAxisColor=[0,1,0,.5],n.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:s,originDimensions:r}=this._opInfo;{const l=()=>{n.position=o.value};l(),this.dispose(o.changed.disposableOn(l))}{const l=()=>{n.heading=s.value??0};l(),this.dispose(s.changed.disposableOn(l))}{const l=()=>{n.dimensions=r.value};l(),this.dispose(r.changed.disposableOn(l))}return n});v(this,"_createGrid",e=>{const n=this.ad(new pi(e));{const o=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originHeading.value,c=this._opInfo.originDimensions.value[0],u=[];for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l+90);if(p){const f=a.geoRhumbDestination(p,c,l+180),g=a.geoRhumbDestination(p,c,l);f&&g&&u.push([f,p,g])}}for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l);if(p){const f=a.geoRhumbDestination(p,c,l-90),g=a.geoRhumbDestination(p,c,l+90);f&&g&&u.push([f,p,g])}}n.positions=u};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(s.disposableOn(o))}return n});v(this,"_createHelpLine",e=>{const n=this.ad(new be(e));n.hasDash=!0,n.arcType="RHUMB",n.color=[1,1,0,.99];{const o=()=>{n.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},s=this.ad(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(s.don(o))}return n});v(this,"_createCircle",e=>{const n=this.ad(new pi(e));n.arcType="RHUMB",n.width=2,n.hasDash=!0;const o=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),s=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originDimensions.value[0],c=[],u=32;for(let d=0;d<=u;++d){const p=a.geoRhumbDestination(r,l,d*360/u);p&&c.push(p)}n.positions=[c]};return s(),this.dispose(o.disposableOn(s)),n});v(this,"_pickingXYProcessing",e=>this.ad(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.don(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!es(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;jn(l,r),this._opInfo.constraintMode.value==="x"?to(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?to(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r;const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d})})));v(this,"_pickingZProcessing",e=>this.ad(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!Cc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(re(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l]}})})));v(this,"_pickingZAxisProcessing",e=>this.ad(new a.Processing(()=>{const n=[0,0,0],o=new h.Cartographic;return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!es(e.viewer.scene,r,this._opInfo.originPosition.value[2],o))return;jn(o,n);const l=a.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=a.geoRhumbHeading(this._opInfo.originPosition.value,n)-l;let d=this._opInfo.originHeading.value+u;d=h.Math.toDegrees(h.Math.negativePiToPi(h.Math.toRadians(d))),this._opInfo.movingPosition.value=n,this.heading=this._opInfo.targetHeading.value=d})})));if(!e.viewer)return;const n=this.ad(a.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new wu(e,this.positionReact,n,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(s=>{if(this._opInfo.moved){const r=[...s];e.editingHeightOffset&&(r[2]+=e.editingHeightOffset),this.position=r}})),this.ad(this._opInfo.targetHeading.changed.don(s=>this._opInfo.moved&&(this.heading=s)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((s,r)=>s===this._opInfo.targetPosition.value[r])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),s=this._createOriginCoordinates(e),r=this._createGrid(e),l=this._createHelpLine(e),c=this._createCircle(e);{const u=()=>{c.show=r.show=this.enabled&&this.showCircle,l.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,s.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const d=this.ad(a.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(d.don(u))}{const u=()=>{o.xAxisShow=s.xAxisShow=this.xAxisShow,o.yAxisShow=s.yAxisShow=this.yAxisShow,o.zAxisShow=s.zAxisShow=this.zAxisShow};u();const d=this.ad(a.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(d.don(u))}{const u=()=>{r.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],c.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],mC(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),d=this._pickingZProcessing(e),p=this._pickingZAxisProcessing(e),f=()=>{const S=[...this.position??Kn.defaults.position];e.editingHeightOffset&&(S[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=S},g=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,m=()=>this._opInfo.originDimensions.value=n.value,y={constraintMode:"none",startDragPos:[0,0,0]},_=S=>{const x={position:o.position??Kn.defaults.position,heading:o.heading??Kn.defaults.heading,dimensions:o.dimensions??Kn.defaults.dimensions};e.viewer&&au(S,e.viewer.scene,x,this.axisSnapPixelSize,y,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=y.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=y.startDragPos},P=this.ad(a.createProcessingFromAsyncFunc(async S=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",S.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(S,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((g(),this.headingChanged.don(g))),x.disposer.dispose((m(),n.changed.don(m))),x.disposer.dispose(e.pointerMoveEvent.don(T=>{T.pointerEvent&&_(T.pointerEvent)})),await a.step(x,T=>new Promise((R,O)=>{T.disposer.dispose(O),T.disposer.dispose(e.pointerDownEvent.don(N=>{N.pointerEvent&&_(N.pointerEvent),N.pointerEvent&&N.pointerEvent.button===0&&y.constraintMode!=="none"&&R()}))}))}),this._opInfo.step.value=!1,await a.step(S,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const T=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),R=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,T,R),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(d.restart(),x.disposer.dispose(()=>d.cancel())):this._opInfo.constraintMode.value==="zAxis"?(p.restart(),x.disposer.dispose(()=>p.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await a.step(x,T=>new Promise((R,O)=>{T.disposer.dispose(O),T.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),T.disposer.dispose(e.pointerOutEvent.don(()=>R()))}))}),P.restart()})),C=()=>{this.enabled?P.restart():P.isRunning&&P.cancel()};C(),this.ad(this.enabledChanged.don(C))}}}};v(Kn,"defaults",{...Zt.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let sn=Kn;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(sn||(sn={})),a.extendClassProps(sn.prototype,sn.createDefaultProps);function mC(t,i,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],i==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class ag extends a.HasOwner{constructor(e){super(e);v(this,"_valid",!1);v(this,"_normal",new h.Cartesian3(0,0,0));v(this,"_origin",new h.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const n=this.owner.cartesian,o=ui(e);return Qg(this.scene,n,this.normal,o)}}class oF extends ag{constructor(i){super(i);{const e=()=>{const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const n=this.ad(a.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(n.don(e))}}}class sF extends ag{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[0],s.y=-o[1],s.z=-o[2]}{const s=this._origin;s.x=o[4],s.y=o[5],s.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class rF extends ag{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[4],s.y=-o[5],s.z=-o[6]}{const s=this._origin;s.x=o[8],s.y=o[9],s.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class nr extends a.Destroyable{constructor(e){super();v(this,"_czmTexture");v(this,"_customPrimitiveForCircle");v(this,"_circleCanvas");v(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ze(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let n=this.disposeVar(a.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const r=()=>{const c={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,d=this.color,p=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, ${d[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${d[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=p,u.stroke();{u.lineWidth=1,u.beginPath();let m=h.Math.zeroToTwoPi(c.startRotation),y=h.Math.zeroToTwoPi(c.endRotation);y<m&&(y+=h.Math.TWO_PI),(m!==y||m!==0)&&(u.moveTo(128,128),u.arc(128,128,64,m,y,y-m>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=h.Math.negativePiToPi(c.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,h.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const _=`${(h.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var g=u.measureText(_).width;u.translate(128,128),u.rotate(Math.PI*.5),f=h.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(n.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(_,128-g*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};r();const l=this.ad(a.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,n.changed));this.ad(l.don(r)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(r))}{const s=()=>{const l=Ie({rotation:this.selfRotation});if(!l)return;const c=Ie({position:this.position,rotation:this.rotation,localModelMatrix:h.Matrix4.toArray(l)});if(!c)return;const{viewer:u}=e;if(!u)return;const d=h.Cartesian3.dot(u.scene.camera.directionWC,new h.Cartesian3(c[8],c[9],c[10]));n.value=d>0};s();const r=this.ad(a.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(r.don(s))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(aF(e)),this.dispose(a.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(a.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(a.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(a.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}_createDebugAxis(e){this._debugAxis=this.ad(lF(e)),this.dispose(a.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([this._debugAxis,"position"],[this,"position"])),this.dispose(a.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(a.track([this._debugAxis,"show"],[this,"debug"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}}v(nr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,color:a.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);function aF(t){return Su({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},De,t)}function lF(t){return Su({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
1913
+ }`}createHeatmapGeometry(e,n){const o=this.czmESHeatMap,s=e||256,r=Math.ceil(n||256),[l,c,u,d]=o.rectangle,p=(u-l)/(s-1),f=(d-c)/(r-1),g=[],m=[],y=[],_=[];for(let P=0;P<s;P++){const C=l+p*P;for(let S=0;S<r;S++){const x=c+f*S;o.heatmap.getValueAt({x:P,y:S});const T=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(T.x,T.y,T.z),m.push(P/(s-1),S/(r-1)),S!==r-1&&P!==s-1&&(y.push((P+1)*r+S+1,P*r+S+1,P*r+S),y.push(P*r+S,(P+1)*r+S,(P+1)*r+S+1))}}return this.createGeometry(g,m,y,_)}createGeometry(e,n,o,s){return new h.Geometry({attributes:new h.GeometryAttributes({position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(n)})}),indices:new Uint32Array(o),boundingSphere:h.BoundingSphere.fromVertices(e,new h.Cartesian3,3),primitiveType:h.PrimitiveType.TRIANGLES})}}const Bt={defaultRadius:40,defaultRenderer:"canvas2d",defaultGradient:{.25:"rgb(0,0,255)",.55:"rgb(0,255,0)",.85:"yellow",1:"rgb(255,0,0)"},defaultMaxOpacity:1,defaultMinOpacity:0,defaultBlur:.85,defaultXField:"x",defaultYField:"y",defaultValueField:"value",plugins:{}};class K2{constructor(i){v(this,"_coordinator");v(this,"_data");v(this,"_radi");v(this,"_min");v(this,"_max");v(this,"_xField");v(this,"_yField");v(this,"_valueField");v(this,"_cfgRadius");this._coordinator=new gC,this._data={},this._radi={},this._min=0,this._max=1,this._xField=i.xField||i.defaultXField||Bt.defaultXField,this._yField=i.yField||i.defaultYField||Bt.defaultYField,this._valueField=i.valueField||i.defaultValueField||Bt.defaultValueField,i.radius&&(this._cfgRadius=i.radius)}_organiseData(i,e){const n=i[this._xField],o=i[this._yField],s=i[this._valueField]||1,r=i.radius||this._cfgRadius||Bt.defaultRadius;return this._data[n]||(this._data[n]={},this._radi[n]={}),this._data[n][o]?this._data[n][o]+=s:(this._data[n][o]=s,this._radi[n][o]=r),this._data[n][o]>this._max?(e?this.setDataMax(this._data[n][o]):this._max=this._data[n][o],!1):{x:n,y:o,value:s,radius:r,min:this._min,max:this._max}}_unOrganizeData(){const i=[];for(const e in this._data)for(const n in this._data[e])i.push({x:Number(e),y:Number(n),radius:this._radi[e][n],value:this._data[e][n]});return{min:this._min,max:this._max,data:i}}_onExtremaChange(){this._coordinator.emit("extremachange",{min:this._min,max:this._max})}_getInternalData(){return{max:this._max,min:this._min,data:this._data,radi:this._radi}}addData(i){if(Array.isArray(i))i.forEach(e=>this.addData(e));else{const e=this._organiseData(i,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(i){this._data={},this._radi={};for(const e of i.data)this._organiseData(e,!1);return this._max=i.max,this._min=i.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(i){return this._max=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(i){return this._min=i,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(i){this._coordinator=i}getData(){return this._unOrganizeData()}}class J2{constructor(i){v(this,"shadowCanvas");v(this,"canvas");v(this,"_renderBoundaries");v(this,"_width");v(this,"_height");v(this,"shadowCtx");v(this,"ctx");v(this,"_palette");v(this,"_templates");v(this,"_blur",Bt.defaultBlur);v(this,"_opacity",0);v(this,"_maxOpacity",Bt.defaultMaxOpacity*255);v(this,"_minOpacity",Bt.defaultMinOpacity*255);v(this,"_useGradientOpacity",!1);v(this,"_min",0);v(this,"_max",1);const e=i.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=i.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const n=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+n.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+n.height.replace(/px/,""),this.shadowCtx=this.shadowCanvas.getContext("2d"),this.ctx=this.canvas.getContext("2d"),this.canvas.style.cssText=this.shadowCanvas.style.cssText="position:absolute;left:0;top:0;",e.style.position="relative",e.appendChild(this.canvas),this._palette=this._getColorPalette(i),this._templates={},this._setStyles(i)}_getColorPalette(i){const e=i.gradient||i.defaultGradient||Bt.defaultGradient,n=document.createElement("canvas"),o=n.getContext("2d");n.width=256,n.height=1;const s=o.createLinearGradient(0,0,256,1);for(const r in e)s.addColorStop(Number(r),e[r]);return o.fillStyle=s,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(i,e){const n=document.createElement("canvas"),o=n.getContext("2d"),s=i,r=i;if(n.width=n.height=i*2,e===1)o.beginPath(),o.arc(s,r,i,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const l=o.createRadialGradient(s,r,i*e,s,r,i);l.addColorStop(0,"rgba(0,0,0,1)"),l.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=l,o.fillRect(0,0,2*i,2*i)}return n}renderPartial(i){this._drawAlpha(i),this._colorize()}renderAll(i){this._clear(),this._drawAlpha(this._prepareData(i)),this._colorize()}_prepareData(i){const e=[],n=Object.keys(i.data);for(const o of n){const s=Object.keys(i.data[o]);for(const r of s)e.push({x:Number(o),y:Number(r),value:i.data[o][r],radius:i.radi[o][r]})}return{min:i.min,max:i.max,data:e}}updateConfig(i){i.gradient&&(this._palette=this._getColorPalette(i)),this._setStyles(i)}setDimensions(i,e){this._width=i,this._height=e,this.canvas.width=this.shadowCanvas.width=i,this.canvas.height=this.shadowCanvas.height=e}_clear(){this.shadowCtx.clearRect(0,0,this._width,this._height),this.ctx.clearRect(0,0,this._width,this._height)}_setStyles(i){this._blur=i.blur===0?0:i.blur||i.defaultBlur||Bt.defaultBlur,i.backgroundColor&&(this.canvas.style.backgroundColor=i.backgroundColor),this._opacity=(i.opacity||0)*255,this._maxOpacity=(i.maxOpacity||i.defaultMaxOpacity||Bt.defaultMaxOpacity)*255,this._minOpacity=(i.minOpacity||i.defaultMinOpacity||Bt.defaultMinOpacity)*255,this._useGradientOpacity=!!i.useGradientOpacity}_drawAlpha(i){this._min=i.min,this._max=i.max;const e=1-this._blur;for(const n of i.data){const o=n.radius,s=n.x-o,r=n.y-o,l=Math.min(n.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(l-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],s,r),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],s),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],r),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],s+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],r+2*o)}}_colorize(){let[i,e,n,o]=this._renderBoundaries;i=Math.max(0,i),e=Math.max(0,e),n=Math.min(this._width-i,n-i),o=Math.min(this._height-e,o-e);const s=this.shadowCtx.getImageData(i,e,n,o),r=s.data;for(let l=3;l<r.length;l+=4){const c=r[l],u=c*4;if(!u)continue;let d;this._opacity>0?d=this._opacity:d=c<this._maxOpacity?c<this._minOpacity?this._minOpacity:c:this._maxOpacity,r[l-3]=this._palette[u],r[l-2]=this._palette[u+1],r[l-1]=this._palette[u+2],r[l]=this._useGradientOpacity?this._palette[u+3]:d}this.ctx.putImageData(s,i,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(i){const n=this.shadowCtx.getImageData(i.x,i.y,1,1).data[3];return Math.abs(this._max-this._min)*(n/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class gC{constructor(){v(this,"cStore");this.cStore={}}on(i,e,n){this.cStore[i]||(this.cStore[i]=[]),this.cStore[i].push(o=>e.call(n,o))}emit(i,e){this.cStore[i]&&this.cStore[i].forEach(n=>n(e))}}class j2{constructor(i={}){v(this,"_config");v(this,"_coordinator");v(this,"_renderer");v(this,"_store");if(this._config={...Bt,...i},this._coordinator=new gC,this._config.plugin){const e=Bt.plugins[this._config.plugin];if(!e)throw new Error(`Plugin '${this._config.plugin}' not found. Maybe it was not registered.`);this._renderer=new e.renderer(this._config),this._store=new e.store(this._config)}else this._renderer=new J2(this._config),this._store=new K2(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",i=>this._renderer.renderPartial(i),this._renderer),this._coordinator.on("renderall",i=>this._renderer.renderAll(i),this._renderer),this._coordinator.on("extremachange",i=>{var e,n;(n=(e=this._config).onExtremaChange)==null||n.call(e,{min:i.min,max:i.max,gradient:this._config.gradient||this._config.defaultGradient||Bt.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(i){return this._store.addData(i),this}setData(i){return this._store.setData(i),this}setDataMax(i){return this._store.setDataMax(i),this}setDataMin(i){return this._store.setDataMin(i),this}configure(i){return this._config={...this._config,...i},this._renderer.updateConfig(this._config),this._coordinator.emit("renderall",this._store._getInternalData()),this}repaint(){return this._coordinator.emit("renderall",this._store._getInternalData()),this}getData(){return this._store.getData()}getDataURL(){return this._renderer.getDataURL()}getValueAt(i){return this._store.getValueAt?this._store.getValueAt(i):this._renderer.getValueAt?this._renderer.getValueAt(i):null}}const eF=t=>new j2(t),Jl=class Jl extends Jt{constructor(e,n){super(e,n);v(this,"_heatmap");v(this,"_div");v(this,"_primitiveObj");v(this,"_rectangle",this.disposeVar(a.react(void 0)));v(this,"onePixelRadius",1e-4);const o=n.viewer,s=256;if(this._primitiveObj=this.ad(new a.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new k2(this,n):new Q2(this,n))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${s}px`,this.div.style.height=`${s}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=eF({container:this.div}),this.heatmap._renderer.setDimensions(s,s);const r=this.ad(new a.Event);let l=[],c={max:100,min:0};{const u=()=>{const p={radius:e.radius??a.ESHeatMap.defaults.radius,gradient:e.gradient??a.ESHeatMap.defaults.gradient,blur:e.blur??a.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(p),this.heatmap._store._cfgRadius=p.radius,r.emit()};u();const d=this.ad(a.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(d.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:p,minPos:f}=a.getMinMaxCorner(e.data),g=p[0]-f[0],m=p[1]-f[1];if(c={max:p[2]??100,min:f[2]??0},!Number.isFinite(g)||!Number.isFinite(m)||g<=0||m<=0)return;const y=1/Math.cos((f[1]+m*.5)*Math.PI/180);if(y==1/0)return;const _=s*m/g*y;this.div.style.width=`${s}px`,this.div.style.height=`${_}px`,this.heatmap._renderer.setDimensions(s,_);const P=g/s*(e.radius??a.ESHeatMap.defaults.radius)*2,C=m/_*(e.radius??a.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(P,C),this.rectangle=[f[0]-P,f[1]-C,p[0]+P,p[1]+C],l=tF(e.data,this.rectangle,s,_),r.emit()}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(d.don(u))}{const u=()=>{const d={max:c.max,min:c.min,data:l};this.heatmap.setData(d),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(r.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{r.emit()}))}get heatmap(){return this._heatmap}get div(){return this._div}get primitiveObj(){var e;return(e=this._primitiveObj)==null?void 0:e.obj}get rectangle(){return this._rectangle.value}set rectangle(e){this._rectangle.value=e}get rectangleChanged(){return this._rectangle.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.rectangle?(oe(s,o,n,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};v(Jl,"type",Jl.register("ESCesiumViewer",a.ESHeatMap.type,Jl));let og=Jl;function tF(t,i,e,n,o){return t.map(s=>({x:(s[0]-i[0])*e/(i[2]-i[0])|0,y:(1-(s[1]-i[1])/(i[3]-i[1]))*n|0,value:s[2]}))}const jl=class jl extends vt{constructor(e,n){super(e,n);v(this,"czmPoints");if(!n.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new vo(n,e.id)),this._updateShow();const s=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(s.don(()=>this._updateShow())),this._updatePoints();const r=this.ad(a.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(r.don(()=>this._updatePoints()))}_updateShow(){this.czmPoints&&(this.czmPoints.show=this.sceneObject.show&&this.sceneObject.pointed)}_updatePoints(){var e;this.czmPoints&&(this.czmPoints.pointPrimitiveOptions=(e=this.sceneObject.points)==null?void 0:e.map(n=>{var o,s,r,l;return{position:n,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??a.ESGeoPoints.defaults.pointStyle.size,color:((s=this.sceneObject.pointStyle)==null?void 0:s.color)??a.ESGeoPoints.defaults.pointStyle.color,outlineColor:((r=this.sceneObject.pointStyle)==null?void 0:r.outlineColor)??a.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((l=this.sceneObject.pointStyle)==null?void 0:l.outlineWidth)??a.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};v(jl,"type",jl.register("ESCesiumViewer",a.ESGeoPoints.type,jl));let sg=jl;const Zo=class Zo extends Wt{constructor(e){super();v(this,"_config",this.disposeVar(a.react(Zo.defaultConfig)));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Zo.defaultPointerEventFilterFunc)));v(this,"point");v(this,"czmViewer");this.czmViewer=e,e.viewer&&(this._updateConfig(),this.dispose(this.configChanged.disposableOn(()=>this._updateConfig())),this._createPoint(),this._updatePointPosition(),this.dispose(this.positionChanged.disposableOn(()=>this._updatePointPosition())),this.ad(new a.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new iF(e,this):void 0)))}get config(){return this._config.value}set config(e){this._config.value=e}get configChanged(){return this._config.changed}get overEvent(){return this._overEvent}over(){this._overEvent.emit()}get pointerEventFilterFunc(){return this._pointerEventFilterFunc.value}set pointerEventFilterFunc(e){this._pointerEventFilterFunc.value=e}get pointerEventFilterFuncChanged(){return this._pointerEventFilterFunc.changed}_updateConfig(){const{config:e}=this;e.clickEnabled!==void 0&&(this.clickEnabled=e.clickEnabled),e.dblClickEnabled!==void 0&&(this.dblClickEnabled=e.dblClickEnabled)}_createPoint(){this.point=this.ad(new ti(this.czmViewer)),this.point.pixelSize=4,this.point.outlineColor=[0,0,.8,1],this.point.outlineWidth=2,this.point.allowPicking=!1}_updatePointPosition(){if(!this.position)return;const e=[...this.position];this.czmViewer.editingHeightOffset&&(e[2]-=this.czmViewer.editingHeightOffset),this.point.position=e,this.point.show=!!this.position}};v(Zo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),v(Zo,"defaultPointerEventFilterFunc",e=>e.button===0),v(Zo,"defaults",{...Wt.defaults,position:[116.39,39.9,0]});let Vi=Zo;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Vi||(Vi={})),a.extendClassProps(Vi.prototype,Vi.createDefaultProps);class iF extends a.Destroyable{constructor(e,n){super();v(this,"_doings",[]);v(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=n;const o=(s,r)=>{r=="click"&&(!n.clickEnabled||!n.pointerEventFilterFunc(s))||r=="dblclick"&&(!n.dblClickEnabled||!n.pointerEventFilterFunc(s))||(n.over(),n.enabled=!1)};this.ad(e.clickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(s=>{s.pointerEvent&&o(s.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(s=>{if(!s.pointerEvent)return;const r=new nF(this,s.pointerEvent,l=>{if(!l||l[2]<-1e5){n.position=void 0;return}const c=[...l];e.editingHeightOffset&&(c[2]+=e.editingHeightOffset),n.position=c,this._doings.splice(0,this._doings.indexOf(r)+1).forEach(d=>d.destroy())});this._doings.push(r)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class nF extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Zg(o,e,this._owner.placeEditing.virtualHeight),[r]=a.getEventFromPromise(s);this.dispose(r.disposableOn(n))}}class Zt extends Wt{constructor(){super()}}v(Zt,"defaults",{...Wt.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0)})})(Zt||(Zt={})),a.extendClassProps(Zt.prototype,Zt.createDefaultProps);function rg(t,i){const e=new be(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=i,e}const ci=class ci extends a.Destroyable{constructor(i){if(super(),!i.viewer)return;const e=this.disposeVar(rg(i,ci.defaults.xAxisColor)),n=this.disposeVar(rg(i,ci.defaults.yAxisColor)),o=this.disposeVar(rg(i,ci.defaults.zAxisColor));{const s=()=>{e.show=this.xAxisShow&&this.show,n.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};s();const r=this.ad(a.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(r.disposableOn(s))}{const s=()=>{const{position:l=ci.defaults.position,heading:c=ci.defaults.heading}=this,[u,d,p]=l,{dimensions:f=ci.defaults.dimensions}=this;o.positions=[l,[u,d,p+f[2]]];const g=a.geoRhumbDestination(l,f[0],90+c);g&&(e.positions=[l,g]);const m=a.geoRhumbDestination(l,f[1],0+c);m&&(n.positions=[l,m])};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(r.disposableOn(s))}{const s=()=>{e.color=this.xAxisColor??ci.defaults.xAxisColor,n.color=this.yAxisColor??ci.defaults.yAxisColor,o.color=this.zAxisColor??ci.defaults.zAxisColor};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(r.disposableOn(s))}}};v(ci,"defaults",{position:[116.39,39.9,0],heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let $n=ci;(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),heading:0,dimensions:a.reactArray([1e3,1e3,1e3]),xAxisColor:a.reactArray([1,0,0,1]),yAxisColor:a.reactArray([0,1,0,1]),zAxisColor:a.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})($n||($n={})),a.extendClassProps($n.prototype,$n.createDefaultProps);const Kn=class Kn extends Zt{constructor(e){super();v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.ad(a.react("none")),originPosition:this.disposeVar(a.reactArray(Zt.defaults.position)),originHeading:this.disposeVar(a.react(0)),originDimensions:this.disposeVar(a.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(a.reactArray([0,0,0])),movingPosition:this.disposeVar(a.reactArray([0,0,0])),targetPosition:this.disposeVar(a.reactArray([0,0,0])),targetHeading:this.disposeVar(a.react(0))});v(this,"_createCoordinates",e=>{const n=this.ad(new $n(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{mC(n,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const r=[...this.position??Kn.defaults.position];e.editingHeightOffset&&(r[2]-=e.editingHeightOffset),n.position=r};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{n.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{n.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return n});v(this,"_createOriginCoordinates",e=>{const n=this.ad(new $n(e));n.xAxisColor=[1,0,0,.5],n.yAxisColor=[0,1,0,.5],n.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:s,originDimensions:r}=this._opInfo;{const l=()=>{n.position=o.value};l(),this.dispose(o.changed.disposableOn(l))}{const l=()=>{n.heading=s.value??0};l(),this.dispose(s.changed.disposableOn(l))}{const l=()=>{n.dimensions=r.value};l(),this.dispose(r.changed.disposableOn(l))}return n});v(this,"_createGrid",e=>{const n=this.ad(new pi(e));{const o=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originHeading.value,c=this._opInfo.originDimensions.value[0],u=[];for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l+90);if(p){const f=a.geoRhumbDestination(p,c,l+180),g=a.geoRhumbDestination(p,c,l);f&&g&&u.push([f,p,g])}}for(let d=-4;d<5;++d){const p=a.geoRhumbDestination(r,c*.2*d,l);if(p){const f=a.geoRhumbDestination(p,c,l-90),g=a.geoRhumbDestination(p,c,l+90);f&&g&&u.push([f,p,g])}}n.positions=u};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(s.disposableOn(o))}return n});v(this,"_createHelpLine",e=>{const n=this.ad(new be(e));n.hasDash=!0,n.arcType="RHUMB",n.color=[1,1,0,.99];{const o=()=>{n.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},s=this.ad(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(s.don(o))}return n});v(this,"_createCircle",e=>{const n=this.ad(new pi(e));n.arcType="RHUMB",n.width=2,n.hasDash=!0;const o=this.disposeVar(a.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),s=()=>{const r=this._opInfo.originPosition.value,l=this._opInfo.originDimensions.value[0],c=[],u=32;for(let d=0;d<=u;++d){const p=a.geoRhumbDestination(r,l,d*360/u);p&&c.push(p)}n.positions=[c]};return s(),this.dispose(o.disposableOn(s)),n});v(this,"_pickingXYProcessing",e=>this.ad(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.don(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!es(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;jn(l,r),this._opInfo.constraintMode.value==="x"?to(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?to(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r;const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d})})));v(this,"_pickingZProcessing",e=>this.ad(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!Cc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;const l=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(re(n,o)){this._opInfo.movingPosition.value=o;const c=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[c[0],c[1],o[2]+l]}})})));v(this,"_pickingZAxisProcessing",e=>this.ad(new a.Processing(()=>{const n=[0,0,0],o=new h.Cartographic;return e.pointerMoveEvent.don(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!es(e.viewer.scene,r,this._opInfo.originPosition.value[2],o))return;jn(o,n);const l=a.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=a.geoRhumbHeading(this._opInfo.originPosition.value,n)-l;let d=this._opInfo.originHeading.value+u;d=h.Math.toDegrees(h.Math.negativePiToPi(h.Math.toRadians(d))),this._opInfo.movingPosition.value=n,this.heading=this._opInfo.targetHeading.value=d})})));if(!e.viewer)return;const n=this.ad(a.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new wu(e,this.positionReact,n,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(s=>{if(this._opInfo.moved){const r=[...s];e.editingHeightOffset&&(r[2]+=e.editingHeightOffset),this.position=r}})),this.ad(this._opInfo.targetHeading.changed.don(s=>this._opInfo.moved&&(this.heading=s)));const o=()=>{if(this._opInfo.constraintMode.value==="none"){this._opInfo.moved.value=!1;return}if(this._opInfo.originHeading.value!==this._opInfo.targetHeading.value){this._opInfo.moved.value=!0;return}if(!this._opInfo.originPosition.value.every((s,r)=>s===this._opInfo.targetPosition.value[r])){this._opInfo.moved.value=!0;return}};o(),this.dispose(this._opInfo.originHeading.changed.disposableOn(o)),this.dispose(this._opInfo.originPosition.changed.disposableOn(o)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(o)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(o))}{const o=this._createCoordinates(e),s=this._createOriginCoordinates(e),r=this._createGrid(e),l=this._createHelpLine(e),c=this._createCircle(e);{const u=()=>{c.show=r.show=this.enabled&&this.showCircle,l.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,s.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const d=this.ad(a.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(d.don(u))}{const u=()=>{o.xAxisShow=s.xAxisShow=this.xAxisShow,o.yAxisShow=s.yAxisShow=this.yAxisShow,o.zAxisShow=s.zAxisShow=this.zAxisShow};u();const d=this.ad(a.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(d.don(u))}{const u=()=>{r.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],c.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],mC(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),d=this._pickingZProcessing(e),p=this._pickingZAxisProcessing(e),f=()=>{const S=[...this.position??Kn.defaults.position];e.editingHeightOffset&&(S[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=S},g=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,m=()=>this._opInfo.originDimensions.value=n.value,y={constraintMode:"none",startDragPos:[0,0,0]},_=S=>{const x={position:o.position??Kn.defaults.position,heading:o.heading??Kn.defaults.heading,dimensions:o.dimensions??Kn.defaults.dimensions};e.viewer&&au(S,e.viewer.scene,x,this.axisSnapPixelSize,y,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=y.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=y.startDragPos},P=this.ad(a.createProcessingFromAsyncFunc(async S=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",S.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(S,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((g(),this.headingChanged.don(g))),x.disposer.dispose((m(),n.changed.don(m))),x.disposer.dispose(e.pointerMoveEvent.don(T=>{T.pointerEvent&&_(T.pointerEvent)})),await a.step(x,T=>new Promise((R,O)=>{T.disposer.dispose(O),T.disposer.dispose(e.pointerDownEvent.don(N=>{N.pointerEvent&&_(N.pointerEvent),N.pointerEvent&&N.pointerEvent.button===0&&y.constraintMode!=="none"&&R()}))}))}),this._opInfo.step.value=!1,await a.step(S,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const T=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),R=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,T,R),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(d.restart(),x.disposer.dispose(()=>d.cancel())):this._opInfo.constraintMode.value==="zAxis"?(p.restart(),x.disposer.dispose(()=>p.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await a.step(x,T=>new Promise((R,O)=>{T.disposer.dispose(O),T.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),T.disposer.dispose(e.pointerOutEvent.don(()=>R()))}))}),P.restart()})),C=()=>{this.enabled?P.restart():P.isRunning&&P.cancel()};C(),this.ad(this.enabledChanged.don(C))}}}};v(Kn,"defaults",{...Zt.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let sn=Kn;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),heading:0,axisPixelSize:100,axisSnapPixelSize:5,showCoordinates:!0,showCircle:!0,disableX:!1,disableY:!1,disableZ:!1,disableXY:!1,disableZAxis:!1,xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(sn||(sn={})),a.extendClassProps(sn.prototype,sn.createDefaultProps);function mC(t,i,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],i==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:i==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class ag extends a.HasOwner{constructor(e){super(e);v(this,"_valid",!1);v(this,"_normal",new h.Cartesian3(0,0,0));v(this,"_origin",new h.Cartesian3(0,0,0))}get viewer(){return this.owner.czmViewer.viewer}get scene(){return this.viewer.scene}get sceneObject(){return this.owner}get valid(){return this._valid}get normal(){return this._normal}get origin(){return this._valid&&this._origin}pick(e){if(!this.normal||!this.owner.cartesian)return;const n=this.owner.cartesian,o=ui(e);return Qg(this.scene,n,this.normal,o)}}class oF extends ag{constructor(i){super(i);{const e=()=>{const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation});this._valid=!!o,o&&(this._origin.x=o[4],this._origin.y=o[5],this._origin.z=o[6],this._normal.x=o[8],this._normal.y=o[9],this._normal.z=o[10])};e();const n=this.ad(a.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(n.don(e))}}}class sF extends ag{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[0],s.y=-o[1],s.z=-o[2]}{const s=this._origin;s.x=o[4],s.y=o[5],s.z=o[6]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class rF extends ag{constructor(i){super(i);const e=()=>{const n=Ie({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!n)throw new Error("PitchPlane: rm is undefined");const o=Ie({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:h.Matrix4.toArray(n)});if(this._valid=!!o,!!o){{const s=this._normal;s.x=-o[4],s.y=-o[5],s.z=-o[6]}{const s=this._origin;s.x=o[8],s.y=o[9],s.z=o[10]}}};e(),this.dispose(this.sceneObject.positionChanged.disposableOn(e)),this.dispose(this.sceneObject.rotationChanged.disposableOn(e)),this.dispose(this.sceneObject.selfRotationChanged.disposableOn(e))}}class nr extends a.Destroyable{constructor(e){super();v(this,"_czmTexture");v(this,"_customPrimitiveForCircle");v(this,"_circleCanvas");v(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ze(e)),this._czmTexture.uri="",this._createCircleCanvas(e),this._createCustomPrimitiveForCircle(e),this._createDebugAxis(e))}get czmTexture(){return this._czmTexture}get customPrimitiveForCircle(){return this._customPrimitiveForCircle}get circleCanvas(){return this._circleCanvas}get debugAxis(){return this._debugAxis}_createCircleCanvas(e){let n=this.disposeVar(a.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const r=()=>{const c={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,d=this.color,p=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, ${d[3]})`;u.clearRect(0,0,256,256),u.lineWidth=6,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=`rgba(0,0,0,${d[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=p,u.stroke();{u.lineWidth=1,u.beginPath();let m=h.Math.zeroToTwoPi(c.startRotation),y=h.Math.zeroToTwoPi(c.endRotation);y<m&&(y+=h.Math.TWO_PI),(m!==y||m!==0)&&(u.moveTo(128,128),u.arc(128,128,64,m,y,y-m>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=h.Math.negativePiToPi(c.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,h.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${d[0]*255|0}, ${d[1]*255|0}, ${d[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const _=`${(h.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var g=u.measureText(_).width;u.translate(128,128),u.rotate(Math.PI*.5),f=h.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(n.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(_,128-g*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};r();const l=this.ad(a.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,n.changed));this.ad(l.don(r)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(r))}{const s=()=>{const l=Ie({rotation:this.selfRotation});if(!l)return;const c=Ie({position:this.position,rotation:this.rotation,localModelMatrix:h.Matrix4.toArray(l)});if(!c)return;const{viewer:u}=e;if(!u)return;const d=h.Cartesian3.dot(u.scene.camera.directionWC,new h.Cartesian3(c[8],c[9],c[10]));n.value=d>0};s();const r=this.ad(a.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(r.don(s))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(aF(e)),this.dispose(a.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(a.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(a.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(a.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}_createDebugAxis(e){this._debugAxis=this.ad(lF(e)),this.dispose(a.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([this._debugAxis,"position"],[this,"position"])),this.dispose(a.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(a.track([this._debugAxis,"show"],[this,"debug"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&h.Matrix4.toArray(o)||void 0)};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};n(),this.dispose(this.colorChanged.disposableOn(n))}}}v(nr,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,color:a.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);function aF(t){return Su({type:"CzmCustomPrimitive",allowPicking:!0,pixelSize:100,boundingVolume:{type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},renderState:{depthTest:{enabled:!1},cull:{enabled:!1,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},localPosition:[-.5,-.5,0],localRotation:[-90,0,0]},De,t)}function lF(t){return Su({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
1914
1914
  void main()
1915
1915
  {
1916
1916
  // 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
@@ -1990,7 +1990,7 @@ return material;
1990
1990
  material.alpha = fragColor.a;
1991
1991
 
1992
1992
  return material;
1993
- }`},translucent:!0}),xF(),AF(),TF(),RF(),FF(),zF(),LF(),EF(),XF(),YF(),QF(),vz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function CL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class _L extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=kt(l);if(c&&(c.destroy(),Mg(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=SF;await l.promise(CL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new qC(d,e);Mg(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const PL=new h.EllipsoidTerrainProvider;class WC extends a.Destroyable{constructor(e){super();v(this,"_terrainMap",new Map);v(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));v(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??PL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class GC extends a.Destroyable{constructor(e){super();v(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof We?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof We?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof We?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof We&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof Xi&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class bL extends a.Destroyable{constructor(e){super();v(this,"_czmImageryLayerWrappers",new Set);v(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class SL extends a.Destroyable{constructor(e){super();v(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class EL extends a.Destroyable{constructor(e){super();v(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new SL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class xL extends a.Destroyable{constructor(e,n){super();v(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new EL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class HC extends a.Destroyable{constructor(e){super();v(this,"_czmImageryWrappers",new Set);v(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new bL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new xL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class $C extends a.Destroyable{constructor(e){super();v(this,"_pause",this.disposeVar(a.react(!1)));v(this,"_pickPositionTasks",[]);v(this,"_pickTasks",[]);v(this,"pickHeightMustGreaterThanZero",!0);v(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:m,camera:y}=n,_=_e(d),P=y.getPickRay(_);if(P){let T;if(p?T=await m.pickFromRayMostDetailed(P,this.objectsToExclude):T=m.pickFromRay(P,this.objectsToExclude),T&&T.position){const R=re(T.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(m.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=m.globe.pick(P,m);if(!R)return g(new Error("scene.globe.pick failed"));const O=re(R);return O?(this.pickHeightMustGreaterThanZero&&O[2]<0&&(O[2]=0),f(O)):g(new Error("positionFromCartesian failed"))}}const C=m.terrainProvider instanceof h.EllipsoidTerrainProvider?m.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(_e(d),C);if(!S)return g(new Error("Pick failed"));const x=re(S);return x?f(x):g(new Error("positionFromCartesian failed"))})()}catch(m){g(m)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,m]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var T,R,O,N;let y=n.scene.pick(_e(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await AL(n,_e(d)));let _;if(y&&y instanceof h.Cesium3DTileFeature){_={};try{y&&y.getPropertyIds().forEach(U=>{_&&(_[U]=y.getProperty(U))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:U}=e.container.getBoundingClientRect();y=(T=document.elementFromPoint(d[0]+V,d[1]+U))==null?void 0:T.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:wr(y.id.position.getValue(V))}:(O=y.id)==null?void 0:O.map(U=>{var z;return{name:U.id,properties:(z=U.properties)==null?void 0:z.getValue(V),coordinates:wr(U.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;if(!y.id.entityCollection)return;const U=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",z=((N=y.id.properties)==null?void 0:N.getValue(V))??{},B=U=="Point"?re(y.id.position.getValue(V)):U=="LineString"?y.id.polyline.positions.getValue(V).map(w=>re(w)):yu(y.id.polygon.hierarchy.getValue(V));S=C.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:U,coordinates:B},properties:z}:{type:U,coordinates:B,properties:z}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,_,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const x=new a.ESJPickedResult(y,C,_,S,f,d);g(x)})()}catch(y){m(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function AL(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class TL extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.disposeVar(a.react(!1)));v(this,"_cursorPosition",a.react(void 0));v(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=kt(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function kt(t){return a.getExtProp(t,"_viewerExtensions")}function Mg(t,i){a.setExtProp(t,"_viewerExtensions",i)}class qC extends a.Destroyable{constructor(e,n){super();v(this,"_imageriesManager");v(this,"_terrainManager");v(this,"_labelManager");v(this,"_pickingManager");v(this,"_poiContext");v(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new HC(this.viewer)),this._terrainManager=this.dv(new WC(this.viewer)),this._labelManager=this.dv(new GC(this.viewer)),this._poiContext=this.disposeVar(new Rm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new TL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new $C(n))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var XC=new h.Cartesian3,YC=new h.Cartesian3;function ZC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,XC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,YC);else var c=h.Cartesian3.cross(t.up,r,YC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,XC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,m=f.latitude;h.Cartesian3.fromRadians(g,m,o,void 0,t.position),t.lookAtTransform(n)}function QC(t,i){ZC(t,i,!1)}function kC(t,i){ZC(t,-i,!0)}class ML extends a.Destroyable{constructor(e){super();v(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&QC(s,d*p),r.MoveBackword&&QC(s,-d*p),r.MoveLeft&&kC(s,-d*p),r.MoveRight&&kC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Xh extends a.Destroyable{constructor(e){super();v(this,"_currentKeyIds",new Set);v(this,"_currentKeyIdsChanged",this.dv(new a.Event));v(this,"_debug",this.dv(a.react(!1)));v(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
1993
+ }`},translucent:!0}),xF(),AF(),TF(),RF(),FF(),zF(),LF(),EF(),XF(),YF(),QF(),vz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function CL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class _L extends a.Destroyable{constructor(i,e,n,o){super();const s=()=>{e.setStatus("Raw");const{viewer:l}=e;if(l){const c=kt(l);if(c&&(c.destroy(),Mg(l,void 0)),h.defined(l)){l.entities.removeAll(),l.dataSources.removeAll(),l.imageryLayers.removeAll(),l.scene.primitives.removeAll(),l.scene.groundPrimitives.removeAll(),l.scene.postProcessStages.removeAll();let u=l.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}l.destroy(),n(void 0)}};this.d(s);const r=this.dv(a.createProcessingFromAsyncFunc(async(l,c)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=SF;await l.promise(CL());const d=await l.promise(a.createCancelablePromise(u(c,o)));d.scene._xbsjOriginSkyAtmosphere=d.scene.skyAtmosphere,d.scene._xbsjOriginSkyBox=d.scene.skyBox,d.scene.renderError.removeEventListener(d.cesiumWidget._onRenderError),d.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const p=h.JulianDate.fromDate(new Date(e.currentTime));h.JulianDate.equals(p,d.clockViewModel.currentTime)||(d.clockViewModel.currentTime=p)})),this.dispose(Ci(d.clockViewModel,"currentTime",p=>{const f=h.JulianDate.toDate(d.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const p=new qC(d,e);Mg(d,p)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),n(d)}));r.start(i),r.errorEvent.don(l=>{console.error(l),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const PL=new h.EllipsoidTerrainProvider;class WC extends a.Destroyable{constructor(e){super();v(this,"_terrainMap",new Map);v(this,"_nextAnimateFrame",this.dv(a.createNextAnimateFrame()));v(this,"selectedTerrain");this._viewer=e;const n=this._viewer,o=n.scene.globe.terrainProviderChanged.addEventListener(()=>{this.selectedTerrain&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit())});this.ad(()=>{o&&o()}),this.dispose(this._changed.disposableOn(()=>{this.selectedTerrain=void 0;let s=Number.MIN_SAFE_INTEGER;for(let r of this._terrainMap.keys())r.sceneObject.activate=!1,(r.sceneObject.show??!0)&&r.sceneObject.zIndex>=s&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${r.sceneObject.name}(${r.sceneObject.id})`),s=r.sceneObject.zIndex,this.selectedTerrain=r);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),n.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??PL}))}_makeDirty(){this._nextAnimateFrame.restartIfNotRunning()}get _changed(){return this._nextAnimateFrame.completeEvent}add(e){if(this._terrainMap.has(e)){console.warn("this._terrainMap.has(imagery)");return}const n=new a.Destroyable;n.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),n.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>n.destroy()),this._makeDirty();const o=this.ad(a.createNextAnimateFrameEvent(e.sceneObject.zIndexChanged));this.d(o.don(()=>{this._changed.emit()}))}delete(e){if(!this._terrainMap.has(e)){console.warn("!this._imageriesMap.has(imagery)");return}const n=this._terrainMap.get(e);if(!n){console.error("!disposeFunc");return}n(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class GC extends a.Destroyable{constructor(e){super();v(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const n=e instanceof We?"div":"canvas";if(this._labelMap[n].has(e)){console.warn(`this._labelMap[${n}].has(poi)`,e);return}const o=new a.Destroyable;{const s=o.dv(a.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(s.don(()=>{this._updateZOrder()}))}this._labelMap[n].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const n=e instanceof We?"div":"canvas";if(!this._labelMap[n].has(e)){console.warn(`!this._labelMap[${n}].has(poi)`,e);return}const o=this._labelMap[n].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[n].delete(e),this._updateZOrder()}_updateZOrder(){for(const e in this._labelMap)Object.prototype.hasOwnProperty.call(this._labelMap,e)&&this._updateLabelZOrder(this._labelMap[e],e)}_updateLabelZOrder(e,n){const o={};for(const l of e.keys())o[l.zOrder]||(o[l.zOrder]=new Map),o[l.zOrder].set(l,l instanceof We?l.czmDivPoi?l.czmDivPoi.depth:0:l.canvasObj?l.canvasObj.czmCanvasPoi.depth:0);const s=Object.keys(o).sort((l,c)=>n=="div"?Number(c)-Number(l):Number(l)-Number(c));let r=e.size;for(let l=0;l<s.length;l++)new Map([...o[s[l]]].sort((u,d)=>Number(d[1])-Number(u[1]))).forEach((u,d)=>{d instanceof We&&d.czmDivPoi&&(d.czmDivPoi.zOrder=r),d instanceof Xi&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class bL extends a.Destroyable{constructor(e){super();v(this,"_czmImageryLayerWrappers",new Set);v(this,"_zIndexChangedEvent",this.dv(new a.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const n=[...this.czmImageryLayerWrappers.values()];n.sort((o,s)=>{const r=o.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex,l=s.czmImageryWrapper.imagery.zIndex??a.ESImageryLayer.defaults.zIndex;return r-l});for(const o of n)this.viewer.imageryLayers.raiseToTop(o.imageryLayer)}))}get viewer(){return this._viewer}get czmImageryLayerWrappers(){return this._czmImageryLayerWrappers}add(e){this._czmImageryLayerWrappers.add(e),this.viewer.imageryLayers.add(e.imageryLayer),this.zIndexChange()}delete(e){this.viewer.imageryLayers.remove(e.imageryLayer,!1),this._czmImageryLayerWrappers.delete(e)}zIndexChange(){this._zIndexChangedEvent.emit()}}class SL extends a.Destroyable{constructor(e){super();v(this,"_imageryLayer");if(this._czmImageryWrapper=e,!this._czmImageryWrapper.imagery.layer)throw new Error("this._czmCzmImageryWrapper.imagery.czmImagery");this._imageryLayer=this._czmImageryWrapper.imagery.layer;const{czmImageryWrapper:n}=this,o=n.manager.czmImageriesManager;o.add(this),this.d(()=>o.delete(this)),this.d(this._czmImageryWrapper.imagery.zIndexChanged.don(()=>o.zIndexChange()))}get imageryLayer(){return this._imageryLayer}get czmImageryWrapper(){return this._czmImageryWrapper}}class EL extends a.Destroyable{constructor(e){super();v(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new a.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new SL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class xL extends a.Destroyable{constructor(e,n){super();v(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=n,this._czmImageryLayerWrapperObjResetting=this.dv(new a.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new EL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class HC extends a.Destroyable{constructor(e){super();v(this,"_czmImageryWrappers",new Set);v(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new bL(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let n of this.czmImageryWrappers)if(n.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new xL(e,this))}has(e){for(let n of this.czmImageryWrappers)if(n.imagery===e)return!0;return!1}delete(e){for(const n of this.czmImageryWrappers)if(n.imagery===e){this.czmImageryWrappers.delete(n);return}console.warn("imageriesManager delete error!",e)}}class $C extends a.Destroyable{constructor(e){super();v(this,"_pause",this.disposeVar(a.react(!1)));v(this,"_pickPositionTasks",[]);v(this,"_pickTasks",[]);v(this,"pickHeightMustGreaterThanZero",!0);v(this,"objectsToExclude",[]);const n=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(l=>l[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(l=>l[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const l=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of l){const[d,p,f,g]=u;try{(async()=>{const{scene:m,camera:y}=n,_=_e(d),P=y.getPickRay(_);if(P){let T;if(p?T=await m.pickFromRayMostDetailed(P,this.objectsToExclude):T=m.pickFromRay(P,this.objectsToExclude),T&&T.position){const R=re(T.position);return R?f(R):g(new Error("positionFromCartesian failed"))}if(!(m.terrainProvider instanceof h.EllipsoidTerrainProvider)){const R=m.globe.pick(P,m);if(!R)return g(new Error("scene.globe.pick failed"));const O=re(R);return O?(this.pickHeightMustGreaterThanZero&&O[2]<0&&(O[2]=0),f(O)):g(new Error("positionFromCartesian failed"))}}const C=m.terrainProvider instanceof h.EllipsoidTerrainProvider?m.terrainProvider.tilingScheme.ellipsoid:n.scene.globe.ellipsoid,S=n.camera.pickEllipsoid(_e(d),C);if(!S)return g(new Error("Pick failed"));const x=re(S);return x?f(x):g(new Error("positionFromCartesian failed"))})()}catch(m){g(m)}}const c=[...this._pickTasks];this._pickTasks.length=0;for(let u of c){const[d,p,f,g,m]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var T,R,O,N;let y=n.scene.pick(_e(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await AL(n,_e(d)));let _;if(y&&y instanceof h.Cesium3DTileFeature){_={};try{y&&y.getPropertyIds().forEach(U=>{_&&(_[U]=y.getProperty(U))})}catch(V){console.warn(V)}}if(!y){const{left:V,top:U}=e.container.getBoundingClientRect();y=(T=document.elementFromPoint(d[0]+V,d[1]+U))==null?void 0:T.closest("[data-es-scene-object-id]")}let P;y&&(y.id&&y.id instanceof h.Entity&&y.id.ESSceneObjectID?P=y.id.ESSceneObjectID:y.collection&&y.collection.ESSceneObjectID?P=y.collection.ESSceneObjectID:y.primitive&&y.primitive.ESSceneObjectID?P=y.primitive.ESSceneObjectID:Array.isArray(y)&&y[0]instanceof h.ImageryLayerFeatureInfo?P=y[0].imageryLayer.ESSceneObjectID:y instanceof HTMLElement&&(P=y.dataset.esSceneObjectId));let C=P?a.ESSceneObject.getSceneObject(P):void 0;C&&C.parentID&&(C=a.ESSceneObject.getSceneObject(C.parentID));let S={};if(C&&Reflect.has(C,"allowPicking")&&Reflect.has(C,"pickedEvent")&&(C.allowPicking??!1)){if(C instanceof a.ESEntityCluster){const V=new h.JulianDate;S=y.id instanceof h.Entity?{name:y.id.label.text.getValue(V),properties:(R=y.id.properties)==null?void 0:R.getValue(V),coordinates:wr(y.id.position.getValue(V))}:(O=y.id)==null?void 0:O.map(U=>{var z;return{name:U.id,properties:(z=U.properties)==null?void 0:z.getValue(V),coordinates:wr(U.position.getValue(V))}})}else if(C instanceof a.ESGeoJson){const V=new h.JulianDate;if(!y.id.entityCollection)return;const U=y.id.polygon?"Polygon":y.id.polyline?"LineString":"Point",z=((N=y.id.properties)==null?void 0:N.getValue(V))??{},B=U=="Point"?re(y.id.position.getValue(V)):U=="LineString"?y.id.polyline.positions.getValue(V).map(w=>re(w)):yu(y.id.polygon.hierarchy.getValue(V));S=C.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:U,coordinates:B},properties:z}:{type:U,coordinates:B,properties:z}}else if(C instanceof a.ESGltfModel){let V;Reflect.has(y,"featureId")?V=y.featureId:Reflect.has(y,"instanceId")&&(V=y.instanceId),V&&(y.id=y.primitive.structuralMetadata.getPropertyTable(0).getProperty(y.instanceId,"id"))}C.pickedEvent.emit(new a.ESJPickedResult(y,C,_,S,f,d))}C&&Reflect.has(C,"allowPicking")&&!C.allowPicking&&g(new a.ESJPickedResult);const x=new a.ESJPickedResult(y,C,_,S,f,d);g(x)})()}catch(y){m(y)}}};let s=n.scene.postRender.addEventListener(o);const r=()=>{s&&s(),s=void 0};this.ad(r),this.ad(this.pauseChanged.don(l=>{l?r():s=n.scene.postRender.addEventListener(o)}))}}get pause(){return this._pause.value}set pause(e){this._pause.value=e}get pauseChanged(){return this._pause.changed}pickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!0,n,o])})}quickPickPosition(e){return new Promise((n,o)=>{this._pickPositionTasks.push([e,!1,n,o])})}pick(e,n,o){return new Promise((s,r)=>{this._pickTasks.push([e,n,o,s,r])})}}function AL(t,i){const e=t.scene,n=e.camera.getPickRay(i);if(!n)return;const o=e.imageryLayers.pickImageryLayerFeatures(n,e);if(h.defined(o))return o}class TL extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.disposeVar(a.react(!1)));v(this,"_cursorPosition",a.react(void 0));v(this,"quickPickPosition",!0);let n=new a.Destroyable;const o=()=>{n&&(n.destroy(),n=void 0)};this.dispose(o);const s=()=>{if(o(),!this._enabled.value||!e)return;const r=kt(e);if(!r)return;n=new a.Destroyable;const l=n.disposeVar(a.react(void 0)),c=n.disposeVar(a.createNextAnimateFrameEvent(l.changed));n.dispose(r.czmViewer.pointerMoveEvent.disposableOn(d=>{d.pointerEvent&&(l.value=a.getDomEventCurrentTargetPos(d.pointerEvent))}));const u=n.disposeVar(a.createProcessingFromAsyncFunc(async d=>{if(r.pickingManager&&l.value)if(this.quickPickPosition){const p=await d.promise(a.createCancelablePromise(r.pickingManager.quickPickPosition(l.value)));this._cursorPosition.value=p}else{const p=await d.promise(a.createCancelablePromise(r.pickingManager.pickPosition(l.value)));this._cursorPosition.value=p}}));n.dispose(c.disposableOn(()=>{u.restart()}))};s(),this.dispose(this._enabled.changed.disposableOn(s))}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get cursorPosition(){return this._cursorPosition.value}get cursorPositionChanged(){return this._cursorPosition.changed}}function kt(t){return a.getExtProp(t,"_viewerExtensions")}function Mg(t,i){a.setExtProp(t,"_viewerExtensions",i)}class qC extends a.Destroyable{constructor(e,n){super();v(this,"_imageriesManager");v(this,"_terrainManager");v(this,"_labelManager");v(this,"_pickingManager");v(this,"_poiContext");v(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=n,this._imageriesManager=this.dv(new HC(this.viewer)),this._terrainManager=this.dv(new WC(this.viewer)),this._labelManager=this.dv(new GC(this.viewer)),this._poiContext=this.disposeVar(new Rm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new TL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new $C(n))}))}get viewer(){return this._viewer}get czmViewer(){return this._czmViewer}get imageriesManager(){return this._imageriesManager}get terrainManager(){return this._terrainManager}get labelManager(){return this._labelManager}get pickingManager(){return this._pickingManager}get poiContext(){return this._poiContext}get cursorPositionInfo(){return this._cursorPositionInfo}}var XC=new h.Cartesian3,YC=new h.Cartesian3;function ZC(t,i,e){let n=h.Matrix4.clone(t.transform);t.lookAtTransform(h.Matrix4.IDENTITY);var o=t.positionCartographic.height,s=t.positionWC,r=h.Cartesian3.normalize(s,XC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,YC);else var c=h.Cartesian3.cross(t.up,r,YC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,XC);u=d}var p=h.Cartesian3.magnitude(s);t.rotate(u,i/p);var f=t.positionCartographic,g=f.longitude,m=f.latitude;h.Cartesian3.fromRadians(g,m,o,void 0,t.position),t.lookAtTransform(n)}function QC(t,i){ZC(t,i,!1)}function kC(t,i){ZC(t,-i,!0)}class ML extends a.Destroyable{constructor(e){super();v(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:n}=this,{viewer:o}=n.firstPersonController,{camera:s}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:l[r.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(r=>{const{keyStatusMap:l}=this.running.keyboardCameraController;l[r.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:r}=this;let l=Date.now();const c=()=>{const u=Date.now(),d=u-l;l=u;const p=this.controller.speed;r.WithCamera||this.controller.alwaysWithCamera?(r.MoveForward&&s.moveForward(d*p),r.MoveBackword&&s.moveBackward(d*p),r.MoveLeft&&s.moveLeft(d*p),r.MoveRight&&s.moveRight(d*p)):(r.MoveForward&&QC(s,d*p),r.MoveBackword&&QC(s,-d*p),r.MoveLeft&&kC(s,-d*p),r.MoveRight&&kC(s,d*p));{const{rotateSpeed:f}=this.controller,g=h.Math.toRadians(f*d);r.RotateRight?s.lookRight(g):r.RotateLeft?s.lookRight(-g):r.RotateUp?s.lookDown(-g):r.RotateDown&&s.lookDown(g)}};o.scene.preUpdate.addEventListener(c),this.dispose(()=>o.scene.preUpdate.removeEventListener(c))}}get running(){return this._running}get controller(){return this.running.keyboardCameraController}get actions(){return this._actions}_resetActions(){const e=Object.keys(this._actions);for(let n of e)this._actions[n]=!1}_updateActions(){const{running:e}=this,{keyStatus:n}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:s}=this.running.keyboardCameraController;for(let r of n.currentKeyIds)o[s[r]]=!0}}class Xh extends a.Destroyable{constructor(e){super();v(this,"_currentKeyIds",new Set);v(this,"_currentKeyIdsChanged",this.dv(new a.Event));v(this,"_debug",this.dv(a.react(!1)));v(this,"_debugResetting",this.dv(new a.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends a.Destroyable{constructor(e){super();const n=()=>{console.log([...e.currentKeyIds].join(`
1994
1994
  `))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=Xh.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=Xh.getKeyId(s);this._currentKeyIds.has(r)&&(this._currentKeyIds.delete(r),this._currentKeyIdsChanged.emit())};this.d(n.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(n.abortEvent.don(o))}}static getKeyId(e){return e.code}get currentKeyIds(){return this._currentKeyIds}get currentKeyIdsChanged(){return this._currentKeyIdsChanged}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}}class IL extends a.Destroyable{constructor(e){super();v(this,"_keyStatus");v(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Xh(this)),this._cameraOp=this.dv(new ML(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const jh=class jh extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!1)));v(this,"_keyStatusMap",this.dv(a.react(jh.defaultKeyStatusMap)));v(this,"_speed",this.dv(a.react(1)));v(this,"_rotateSpeed",this.dv(a.react(.01)));v(this,"_alwaysWithCamera",this.dv(a.react(!1)));v(this,"_keyDownEvent",this.dv(new a.Event));v(this,"_keyUpEvent",this.dv(new a.Event));v(this,"_abortEvent",this.dv(new a.Event));this._firstPersonController=e,this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new IL(this)}))}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get keyStatusMap(){return this._keyStatusMap.value}set keyStatusMap(e){this._keyStatusMap.value=e}get keyStatusMapChanged(){return this._keyStatusMap.changed}get speed(){return this._speed.value}set speed(e){this._speed.value=e}get speedChanged(){return this._speed.changed}get rotateSpeed(){return this._rotateSpeed.value}set rotateSpeed(e){this._rotateSpeed.value=e}get rotateSpeedChanged(){return this._rotateSpeed.changed}get alwaysWithCamera(){return this._alwaysWithCamera.value}set alwaysWithCamera(e){this._alwaysWithCamera.value=e}get alwaysWithCameraChanged(){return this._alwaysWithCamera.changed}get keyDownEvent(){return this._keyDownEvent}keyDown(e){this._keyDownEvent.emit(e)}get keyUpEvent(){return this._keyUpEvent}keyUp(e){this._keyUpEvent.emit(e)}get abortEvent(){return this._abortEvent}abort(){this._abortEvent.emit()}};v(jh,"defaultKeyStatusMap",{ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"MoveLeft",ArrowRight:"MoveRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"});let Yh=jh;function DL(t,i){t.lookRight(h.Math.toRadians(i.movementX)*.1),t.lookDown(h.Math.toRadians(i.movementY)*.1);const e=t.pitch,n=h.Math.clamp(e,-h.Math.PI_OVER_TWO,h.Math.PI_OVER_TWO);n!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:n,roll:t.roll}})}class RL extends a.Destroyable{constructor(i,e){super(),this._firstPersonController=i,this._mouseCameraController=e;const{canvas:n}=this._firstPersonController.viewer;{const o=s=>{const{camera:r}=this._firstPersonController.viewer.scene;DL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const eu=class eu extends a.Destroyable{constructor(e){super();v(this,"_mouseMoving",this.dv(new RL(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:n}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=eu.origin_setPointerCapture);const o=n.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const s=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",s,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",s,!1))}{const s=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",s)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};v(eu,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Ig=eu;class FL extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!1)));v(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});v(this,"_mouseResetting",this.dv(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Ig(this)})));this._firstPersonController=e}get firstPersonController(){return this._firstPersonController}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get mouseResetting(){return this._mouseResetting}}class zL extends a.Destroyable{constructor(e){super();v(this,"viewer");v(this,"_mouseCameraController",this.dv(new FL(this)));v(this,"_keyboardCameraController",this.dv(new Yh(this)));if(this._viewer=e,!this._viewer.viewer)throw new Error("Cesium.Viewer不存在!");this.viewer=this._viewer.viewer}get czmViewer(){return this._viewer}get mouseCameraController(){return this._mouseCameraController}get mouseEnabled(){return this.mouseCameraController.enabled}set mouseEnabled(e){this.mouseCameraController.enabled=e}get mouseEnabledChanged(){return this.mouseCameraController.enabledChanged}get keyboardCameraController(){return this._keyboardCameraController}get keyboardEnabled(){return this.keyboardCameraController.enabled}set keyboardEnabled(e){this.keyboardCameraController.enabled=e}get keyboardEnabledChanged(){return this.keyboardCameraController.enabledChanged}}function KC(t){t.removeInputAction(h.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(h.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)}function Dg(t,i,e,n=void 0){const s=t.camera,r=new h.Cartesian2;r.x=i.startPosition.x,r.y=0;const l=new h.Cartesian2;l.x=i.endPosition.x,l.y=0;let c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,p,f;if(!c||!u)return;s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction);let g=h.Cartesian3.dot(p,f);g<1&&(d=Math.acos(g)),d=i.startPosition.x>i.endPosition.x?d:-d;const m=e._horizontalRotationAxis;if(h.defined(n)?s.look(n,-d):h.defined(m)?s.look(m,-d):s.lookLeft(d),r.x=0,r.y=i.startPosition.y,l.x=0,l.y=i.endPosition.y,c=s.getPickRay(r,new h.Ray),u=s.getPickRay(l,new h.Ray),d=0,!(!c||!u))if(s.frustum instanceof h.OrthographicFrustum?(p=c.origin,f=u.origin,h.Cartesian3.add(s.direction,p,p),h.Cartesian3.add(s.direction,f,f),h.Cartesian3.subtract(p,s.position,p),h.Cartesian3.subtract(f,s.position,f),h.Cartesian3.normalize(p,p),h.Cartesian3.normalize(f,f)):(p=c.direction,f=u.direction),g=h.Cartesian3.dot(p,f),g<1&&(d=Math.acos(g)),d=i.startPosition.y>i.endPosition.y?d:-d,n=h.defaultValue(n,m),h.defined(n)){const y=s.direction,_=h.Cartesian3.negate(n,new h.Cartesian3),P=h.Cartesian3.equalsEpsilon(y,n,h.Math.EPSILON2),C=h.Cartesian3.equalsEpsilon(y,_,h.Math.EPSILON2);if(!P&&!C){g=h.Cartesian3.dot(y,n);let S=h.Math.acosClamped(g);d>0&&d>S&&(d=S-h.Math.EPSILON4),g=h.Cartesian3.dot(y,_),S=h.Math.acosClamped(g),d<0&&-d>S&&(d=-S+h.Math.EPSILON4);const x=h.Cartesian3.cross(n,y,new h.Cartesian3);s.look(x,d)}else(P&&d<0||C&&d>0)&&s.look(s.right,-d)}else s.lookUp(d)}class LL extends a.Destroyable{constructor(i,e){super();const n=e.viewer;if(!n)throw new Error("viewer is undefined");let o=!0;this.d(i.positionChanged.don(()=>o=!0)),this.d(i.rotationChanged.don(()=>o=!0)),this.d(i.offsetHeightChanged.don(()=>o=!0)),this.d(i.viewDistanceChanged.don(()=>o=!0)),this.d(i.offsetRotationChanged.don(()=>o=!0)),this.d(i.relativeRotationChanged.don(()=>o=!0));const s=[0,0,0],r=[0,0,0];this.d(n.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!i.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(i.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const p=Le(i.position),f=n.camera.positionWC,g=h.Cartesian3.distance(p,f);i.viewDistance=g}a.Vector.clone(i.position,r),i.offsetHeight&&(r[2]+=i.offsetHeight);const{rotation:l,offsetRotation:c=Ui.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Ui.defaults.relativeRotation)&&(a.Vector.add(l,s,s),u[0]+=90),a.Vector.add(u,s,s);const d={distance:i.viewDistance,heading:s[0],pitch:s[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(d,r)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(l=>{const c=l==null?void 0:l.pointerEvent;if(c&&i.enabledRotationInput&&(c.buttons===1||c.buttons===2)){const{movementX:u,movementY:d}=c;i.offsetRotation=a.Vector.add(i.offsetRotation??Ui.defaults.offsetRotation,[u*.2,d*-.2,0])}})),this.d(e.wheelEvent.don(l=>{if(!i.enabledScaleInput)return;const c=l.deltaY,d=Math.max(1,i.viewDistance)*(c*.001);i.viewDistance=i.viewDistance+d}))}}class Ui extends a.Destroyable{constructor(e){super();v(this,"_resetWithCameraEvent",this.dv(new a.Event));const n=e.viewer;if(!n)throw new Error("viewer is undefined");const o=this;let s;const r=()=>{s&&(s.destroy(),s=void 0)};this.d(r);const l=()=>{r(),o.enabled&&(s=new LL(o,e))};l(),this.d(o.enabledChanged.don(l)),this.d(o.resetWithCameraEvent.don(c=>{if(!e.actived)return;const u=jo(n.camera);if(!u)return;const d=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?d[0]:90),u[1]-(o.relativeRotation?d[1]:0),u[2]-(o.relativeRotation?d[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}v(Ui,"defaults",{position:[116.39,39.9,0],rotation:[0,0,0],offsetRotation:[0,-60,0],relativeRotation:!0}),(t=>{t.createDefaultProps=()=>({enabled:!1,showTarget:!1,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(Ui||(Ui={})),a.extendClassProps(Ui.prototype,Ui.createDefaultProps);class ma extends a.Destroyable{constructor(e){super();v(this,"_geoCameraController");v(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Ui(e)),this._geoPolylinePath=this.dv(new Ds(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const n=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};n(),this.d(this._geoPolylinePath.currentPositionChanged.don(n)),this.d(this._geoPolylinePath.currentRotationChanged.don(n)),this.dispose(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(a.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(a.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(a.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(a.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(a.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new a.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new OL(this,e);if(this.lineMode==="manual")return new NL(this,e)}}))}get geoCameraController(){return this._geoCameraController}get polylinePath(){return this._geoPolylinePath}get position(){return this._geoCameraController.position}get positionChanged(){return this._geoCameraController.positionChanged}get rotation(){return this._geoCameraController.rotation}get roataionChanged(){return this._geoCameraController.rotationChanged}}(t=>{t.createDefaultProps=()=>({enabled:!1,usePathPosition:!0,usePathRotation:!0,viewDistance:1e3,offsetHeight:0,offsetRotation:a.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(ma||(ma={})),a.extendClassProps(ma.prototype,ma.createDefaultProps);class OL extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class NL extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=s=>{(s.key==="w"||s.key==="s")&&(i.polylinePath.playing=s.type==="keydown",i.polylinePath.speed=s.key==="w"||s.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class BL extends a.Destroyable{constructor(i,e){super();const n=e.positionPropertyName??"position",o=e.positionChangedPropertyName??n+"Changed",s=e.rotationPropertyName??"rotation",r=e.rotationChangedPropertyName??s+"Changed",l=(e.positionTracking??!0)&&Reflect.has(i,n)&&Reflect.has(i,o),c=(e.rotationTracking??!0)&&Reflect.has(i,s)&&Reflect.has(i,r);if(!(!l&&!c)){if(l){const u=()=>{e.geoCameraController.position=i[n]};u();const d=i[o];this.d(d.don(u))}if(c){const u=()=>{e.geoCameraController.rotation=i[s]};u();const d=i[o];this.d(d.don(u))}}}}class VL extends a.Destroyable{constructor(i,e){super();const n=this.dv(new a.ESSceneObjectWithId);n.id=i;const o=this.dv(a.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,n.sceneObjectChanged));this.disposeVar(new a.ObjResettingWithEvent(o,()=>{const{sceneObject:s}=n;if(!(!e.enabled||!s))return new BL(s,e)}))}}class va extends a.Destroyable{constructor(e){super();v(this,"_geoCameraController");this._geoCameraController=this.dv(new Ui(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new VL(this.sceneObjectId,this)}))}get geoCameraController(){return this._geoCameraController}}(t=>{t.createDefaultProps=()=>({enabled:void 0,sceneObjectId:void 0,positionTracking:void 0,rotationTracking:void 0,positionPropertyName:void 0,positionChangedPropertyName:void 0,rotationPropertyName:void 0,rotationChangedPropertyName:void 0})})(va||(va={})),a.extendClassProps(va.prototype,va.createDefaultProps);class UL extends a.Destroyable{constructor(e){super();v(this,"height",1e7);v(this,"cycle",60);v(this,"latitude",38*3.1415926/18);v(this,"_running",!1);v(this,"_sseh");v(this,"_eventDisposer");v(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new h.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},h.ScreenSpaceEventType.LEFT_DOWN),this.d(()=>{this.cancel()})}get viewer(){return this._viewer}get sseh(){return this._sseh}start(){if(this._running)return;const e=this._viewer.camera,n=e.positionCartographic;e.flyTo({destination:h.Cartesian3.fromRadians(n.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,r)=>{if(!o){o=new Date().getTime();return}const l=(new Date().getTime()-o)/1e3,c=e.positionCartographic.longitude+l*h.Math.PI*2/this.cycle;e.setView({destination:h.Cartesian3.fromRadians(c,this.latitude,this.height),orientation:{heading:0,pitch:-.5*h.Math.PI,roll:0}}),o=new Date().getTime()})},duration:.5})}cancel(){this._running&&(this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1)}}class WL extends a.Destroyable{constructor(e){super();v(this,"_height",this.dv(a.react(1e7)));v(this,"_cycle",this.dv(a.react(60)));v(this,"_latitude",this.dv(a.react(38)));v(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("未初始化viewer");this._inner=this.dv(new UL(n)),this._inner.leftDownCancel=!1;{const o=()=>{this._inner.height=this.height,this._inner.cycle=this.cycle,this._inner.latitude=this.latitude*Math.PI/180};o(),this.d(this.heightChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.latitudeChanged.don(o))}}get height(){return this._height.value}set height(e){this._height.value=e}get heightChanged(){return this._height.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get latitude(){return this._latitude.value}set latitude(e){this._latitude.value=e}get latitudeChanged(){return this._latitude.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class GL extends a.Destroyable{constructor(e){super();v(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));v(this,"_distance",this.dv(a.react(5e4)));v(this,"_cycle",this.dv(a.react(60)));v(this,"_heading",this.dv(a.react(0)));v(this,"_pitch",this.dv(a.react(-30)));v(this,"_transform");v(this,"_headingRadius");v(this,"_pitchRadius");v(this,"_running",!1);v(this,"_sseh");v(this,"_eventDisposer");this._viewer=e;const n=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new h.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const s=()=>{let r;if(this.position==null){var l=o.getPickRay(new h.Cartesian2(n.canvas.width*.5,n.canvas.height*.5));if(!l)return;r=n.globe.pick(l,n)}else r=h.Cartesian3.fromDegrees(...this.position);r&&(this._transform=h.Transforms.eastNorthUpToFixedFrame(r),this.start())};s(),this.d(this.positionChanged.don(s))}{const s=()=>{this._headingRadius=h.Math.toRadians(this.heading)};s(),this.d(this.headingChanged.don(s))}{const s=()=>{this._pitchRadius=h.Math.toRadians(this.pitch)};s(),this.d(this.pitchChanged.don(s))}}get viewer(){return this._viewer}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get sseh(){return this._sseh}start(){if(this._running)return;const e=this.viewer.camera;e.lookAtTransform(this._transform);var n=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),s=new h.Cartesian3(0,n,o);e.flyTo({destination:h.Matrix4.multiplyByPoint(this._transform,s,new h.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let r;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((l,c)=>{if(!r){r=new Date().getTime();return}const u=(new Date().getTime()-r)/1e3;this._headingRadius+=u*h.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new h.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),r=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(h.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class HL extends a.Destroyable{constructor(e){super();v(this,"_position",this.dv(a.reactArrayWithUndefined(void 0)));v(this,"_distance",this.dv(a.react(5e4)));v(this,"_cycle",this.dv(a.react(60)));v(this,"_heading",this.dv(a.react(0)));v(this,"_pitch",this.dv(a.react(-30)));v(this,"_inner");this._czmViewer=e;const n=this._czmViewer.viewer;if(!n)throw new Error("viewer is undefined");this._inner=this.dv(new GL(n));{const o=()=>{this.inner.distance=this.distance,this.inner.cycle=this.cycle,this.inner.position=this.position,this.inner.heading=this.heading,this.inner.pitch=this.pitch};o(),this.d(this.distanceChanged.don(o)),this.d(this.cycleChanged.don(o)),this.d(this.positionChanged.don(o)),this.d(this.headingChanged.don(o)),this.d(this.pitchChanged.don(o))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get distance(){return this._distance.value}set distance(e){this._distance.value=e}get distanceChanged(){return this._distance.changed}get cycle(){return this._cycle.value}set cycle(e){this._cycle.value=e}get cycleChanged(){return this._cycle.changed}get heading(){return this._heading.value}set heading(e){this._heading.value=e}get headingChanged(){return this._heading.changed}get pitch(){return this._pitch.value}set pitch(e){this._pitch.value=e}get pitchChanged(){return this._pitch.changed}get inner(){return this._inner}start(){return this._inner.start()}cancel(){return this._inner.cancel()}}class $L extends a.Destroyable{constructor(e){super();v(this,"_firstPersonController");v(this,"_rotateGlobe");v(this,"_rotatePoint");v(this,"_followController");v(this,"_pathCameraController");v(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new zL(e)),this.d(this._viewer.keyDownEvent.don(n=>this._firstPersonController.keyboardCameraController.keyDown(n))),this.d(this._viewer.keyUpEvent.don(n=>this._firstPersonController.keyboardCameraController.keyUp(n)));{const{subContainer:n}=this._viewer;if(!n)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();n.addEventListener("blur",o,!1),this.d(()=>n.removeEventListener("blur",o,!1))}this._firstPersonController.keyboardEnabled=!1,this._firstPersonController.mouseEnabled=!1,this._firstPersonController.keyboardCameraController.speed=.006,this._firstPersonController.keyboardCameraController.rotateSpeed=.05,this._firstPersonController.keyboardCameraController.alwaysWithCamera=!1,this._firstPersonController.keyboardCameraController.keyStatusMap=Yh.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new WL(e)),this._rotatePoint=this.dv(new HL(e)),this._followController=this.dv(new va(e)),this._pathCameraController=this.dv(new ma(e))}get firstPersonController(){return this._firstPersonController}get rotateGlobe(){return this._rotateGlobe}get rotatePoint(){return this._rotatePoint}get followController(){return this._followController}get pathCameraController(){return this._pathCameraController}resetNavigation(){this._firstPersonController.keyboardEnabled=!1,this._rotateGlobe.cancel(),this._rotatePoint.cancel(),this._followController.enabled=!1,this._followController.sceneObjectId=void 0,this._followController.geoCameraController.offsetRotation=[-90,0,0],this._followController.geoCameraController.viewDistance=0,this._pathCameraController.enabled=!1,this._pathCameraController.polylinePath.playing=!1,this._pathCameraController.polylinePath.currentTime=0,this._pathCameraController.polylinePath.loop=!1,this._pathCameraController.geoCameraController.offsetHeight=0,this._pathCameraController.polylinePath.positions=void 0,this._pathCameraController.lineMode=void 0}changeToMap(){this.resetNavigation(),this._changedMouseEvent("Map")}changeToWalk(e,n=4.2,o=1.6){this.resetNavigation();const s=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const r=this._viewer.getCameraInfo(),l=[(r==null?void 0:r.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(c=>{s?this._viewer.flyIn([e[0],e[1],(c??0)+o],l):this._viewer.viewer&&(this._viewer.viewer.camera.position=h.Cartesian3.fromDegrees(e[0],e[1],(c??0)+o)),this.firstPersonController.keyboardEnabled=!0,this.firstPersonController.keyboardCameraController.speed=.006,this.firstPersonController.keyboardCameraController.rotateSpeed=.05,this.firstPersonController.keyboardCameraController.keyStatusMap={ShiftLeft:"WithCamera",ShiftRight:"WithCamera",KeyW:"MoveForward",KeyS:"MoveBackword",KeyA:"MoveLeft",KeyD:"MoveRight",ArrowUp:"MoveForward",ArrowDown:"MoveBackword",ArrowLeft:"RotateLeft",ArrowRight:"RotateRight",KeyR:"SpeedUp",KeyF:"SpeedDown",KeyQ:"SwitchAlwaysWithCamera"}})}changeToRotateGlobe(e=38,n=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=n,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,n=5e4,o=60,s=0,r=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=n,this._rotatePoint.cycle=o,this._rotatePoint.heading=s,this._rotatePoint.pitch=r,this._rotatePoint.start()}changeToFollow(e,n=0,o=0,s=-30,r=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,s,0],this._followController.geoCameraController.relativeRotation=r,n!==0?this._followController.geoCameraController.viewDistance=n:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,n=10,o=10,s=!0,r=10,l="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const c=l==="auto",u=a.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:d}=u;if(!d)return;const p=a.getDistancesFromPositions(d,"NONE"),f=p[p.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...d],this._pathCameraController.polylinePath.duration=f/n*1e3,this._pathCameraController.polylinePath.loop=s,this._pathCameraController.offsetHeight=o;const g=pm(d);this._pathCameraController.polylinePath.rotationRadius=!c||g==!1?[0]:g.map(m=>m/r*n),this._pathCameraController.enabledRotationInput=!c,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=c,this._pathCameraController.lineMode=l,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const n=this._viewer.viewer;if(!n)return;this._handler||(this._handler=new h.ScreenSpaceEventHandler(n.scene.canvas));const o=this._handler,s=n.scene.screenSpaceCameraController;this.d(()=>{o&&KC(o)}),e=="Walk"||e=="RotateGlobe"?(s.lookEventTypes=void 0,s.rotateEventTypes=void 0,s.tiltEventTypes=void 0,s.zoomEventTypes=void 0,s.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(r=>{o.setInputAction(l=>{Dg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_UP)},h.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Dg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_UP)},h.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(r=>{o.setInputAction(l=>{Dg(n.scene,l,s)},h.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(l=>{o.removeInputAction(h.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_UP)},h.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&KC(o),s.lookEventTypes=h.CameraEventType.RIGHT_DRAG,s.rotateEventTypes=h.CameraEventType.LEFT_DRAG,s.tiltEventTypes=[h.CameraEventType.MIDDLE_DRAG,h.CameraEventType.PINCH,{eventType:h.CameraEventType.LEFT_DRAG,modifier:h.KeyboardEventModifier.CTRL},{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.CTRL}],s.translateEventTypes=h.CameraEventType.LEFT_DRAG,s.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}])}}const qL=[{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3558367297943,39.93163726456884,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30223283037274,39.92688664316035,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.43707387584969,39.922782714050356,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.27929428317248,39.895318074706246,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36181901056395,39.89720944386167,3553.618347252562]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.40050587550184,39.87565113086582,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.31629153797958,39.88888615917464,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.38662084727662,39.93026695192356,5222.983612030221]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.35985958294472,39.879559968940974,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30061281533665,39.86521469244785,3500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.33589491695909,39.85251691437225,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3978491755026,39.92191230041099,3e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.404556165088,39.901554635269065,3400]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.3371677114933,39.90666589456628,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.30329238580244,39.90598342431921,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.25047545555285,39.927295935589235,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33129680063607,39.98205319015022,5500]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.38241622722414,39.864780790627634,5800]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.24126681456984,39.85629130246847,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.4476299820832,39.9015287845667,5233.181711832771]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.33116617802452,39.824241891065384,6e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.15206905891218,39.90872966468676,5e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.24197212869294,39.88630968655299,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.43381133281572,39.96058832885812,5700]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[4e4,1e4],position:[116.21635435523064,39.966450178376924,7e3]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.17908072725879,39.87211951629164,3200]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.32516866705241,39.94534681561764,3300]},{slice:-1,brightness:1,maximumSize:[25,9,10],color:[1,1,1,1],scale:[1e4,5e3],position:[116.36086721251684,39.948381883306446,3400]}];class XL extends a.Destroyable{constructor(e){super();v(this,"_show",this.dv(a.react(!1)));v(this,"cloudsPostProcess");const n=e.viewer;if(!n)throw new Error("Cesium Viewer is not initialized");const o=new h.CloudCollection;n.scene.primitives.add(o),this.dispose(()=>n.scene.primitives.remove(o));{const s=()=>{o.show=this.show};s(),this.dispose(this.showChanged.disposableOn(s))}{const s=l=>({slice:l.slice,brightness:l.brightness,scale:_e(l.scale),maximumSize:hi(l.maximumSize),color:te(l.color),position:Le(l.position)});(()=>{o.removeAll();for(let l of qL)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ya extends a.Destroyable{constructor(i){super();const e=i.viewer;if(!e){console.warn("viewer is undefined!");return}const n=e.scene.postProcessStages.add(h.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(n));{const o=()=>{n.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{n.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{n.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{n.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{n.uniforms.stepSize=this.stepSize};o(),this.d(this.stepSizeChanged.don(o))}}}(t=>{t.createDefaultProps=()=>({show:!1,focalDistance:87,delta:1,sigma:3.78,stepSize:2.46})})(ya||(ya={})),a.extendClassProps(ya.prototype,ya.createDefaultProps);const YL=`
1995
1995
  float getDistance(sampler2D depthTexture, vec2 texCoords)
1996
1996
  {
@@ -2290,10 +2290,10 @@ async function initCesiumViewer(container, czmViewer) {
2290
2290
  `;function B4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
2291
2291
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
2292
2292
  gitee地址:${t}
2293
- `;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",$h);v(this,"_moveObjectsProcess",this.ad(xC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new yF(this)),this.ad(new wF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bF(this)})),this._viewerLegend=this.dv(new R4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new zg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new _L(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&kt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Ar(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Ar(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Ar(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:jo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Sm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return It(e,n)}localPositionsToPositions(e,n){return wn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",N4,O4,!0),new a.FunctionProperty([],()=>st.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",B4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",PF),v(st,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...L4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.12",e="2025-10-13T02:59:52.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="3b43762eb996d25b6ceaa15c8c605f8b1d9cb144",l=((Date.now()-1760324392e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2293
+ `;console.log(e);const n=window.prompt(e,t);n&&window.open(n,"_blank")}const st=class st extends a.ESViewer{constructor(e){super(e);v(this,"_disabledInputStack",this.disposeVar(a.react(0)));v(this,"_viewer",this.dv(a.react(void 0)));v(this,"_viewerInstance");v(this,"_viewerLegend");v(this,"pickCustomAttachedInfo");v(this,"_fps",this.dv(a.react(0)));v(this,"_notSupportEditingCount",this.disposeVar(a.react(0)));v(this,"_editingSystem",$h);v(this,"_moveObjectsProcess",this.ad(xC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new yF(this)),this.ad(new wF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new bF(this)})),this._viewerLegend=this.dv(new R4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new zg(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=te([1,1,1,1]))}));const n=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new a.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new _L(this.subContainer,this,o=>this._viewer.value=o,n.options)}))}get disabledInputStack(){return this._disabledInputStack.value}get disabledInputStackChanged(){return this._disabledInputStack.changed}incrementDisabledInputStack(){++this._disabledInputStack.value}decrementDisabledInputStack(){--this._disabledInputStack.value}get viewer(){return this._viewer.value}get extensions(){return this.viewer&&kt(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,n,o){if(!this.extensions)return;const{pickingManager:s}=this.extensions;return await s.pick(e,void 0,n)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:n}=this.extensions;return await n.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:n}=this;if(!n)return;const o=h.Cartographic.fromDegrees(e[0],e[1],e[2],st.getHeightsScartchCarto);return n.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:jo(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:n}=this.viewer;if(!n||!e)return;const o=h.Cartesian3.fromDegrees(...e),s=h.Transforms.eastNorthUpToFixedFrame(o),r=h.Matrix4.inverse(s,new h.Matrix4),l=h.Matrix4.multiplyByPoint(r,n.positionWC,new h.Cartesian3),c=h.Cartesian3.magnitude(l);let u=-Math.asin(l.z/c);u=h.Math.toDegrees(u);let d=h.Math.PI_OVER_TWO-Math.atan(l.y/l.x);l.x>0&&(d+=l.y<0?-h.Math.PI:h.Math.PI),d=h.Math.toDegrees(d);const p=jo(n),f=p[0]-d,g=p[1]-u;return{distance:c,heading:d,pitch:u,flyDuration:1,hDelta:f,pDelta:g}}flyIn(e,n,o,s="default"){var c;if(!n)return;const r={position:e,rotation:n,duration:(o??1)*1e3},l=(c=this.viewer)==null?void 0:c.camera;return l&&Ar(l,r,s)}flyTo(e,n,o="default"){var g;const{distance:s,heading:r,pitch:l,flyDuration:c,hDelta:u,pDelta:d}=e,p={position:n,viewDistance:s,rotation:[r,l,0],duration:c*1e3,hdelta:u,pdelta:d},f=(g=this.viewer)==null?void 0:g.camera;return f&&Ar(f,p,o)}flyToBoundingSphere(e,n,o=1){var p;const s=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],r=a.getGeoBoundingSphereFromPositions(s);if(!r)return;const{center:l,radius:c}=r,u={position:l,viewDistance:n??c,rotation:[0,-90,0],duration:o*1e3},d=(p=this.viewer)==null?void 0:p.camera;return d&&Ar(d,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Gt(e),rotation:jo(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,n=4.2,o=1.6){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToWalk(e,n,o),this._navigationMode.value="Walk"}changeToMap(){var e,n;(n=(e=this._viewerInstance)==null?void 0:e.obj)==null||n.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,n,o){var s,r;(r=(s=this._viewerInstance)==null?void 0:s.obj)==null||r.navigationManager.changeToRotateGlobe(e,n,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,n,o,s,r,l){var c,u;(u=(c=this._viewerInstance)==null?void 0:c.obj)==null||u.navigationManager.changeToLine(e,n,o,s,r,l),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToRotatePoint(e,n,o,s,r),this._navigationMode.value="RotatePoint"}changeToFollow(e,n,o,s,r){var l,c;(c=(l=this._viewerInstance)==null?void 0:l.obj)==null||c.navigationManager.changeToFollow(e,n,o,s,r),this._navigationMode.value="Follow"}getFPS(){return this._fps.value}async getBoundSphere(e){return Promise.resolve(void 0)}async getVersion(){const e=window.g_XE3CopyRights??{};return e.cesium=h.VERSION,e}async getHeightByLonLat(e,n,o){if(!this.viewer)return null;const s=h.Cartographic.fromDegrees(e,n,void 0,st.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(s)??null}async getHeightsByLonLats(e,n){const o=e.map(r=>this.getHeightByLonLat(...r));return await Promise.all(o)}async capture(e,n){if(this.viewer)return await Sm(this.viewer.scene,e,n)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const n=this.viewer.scene.cartesianToCanvasCoordinates(Le(e));if(n)return[n.x,n.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,n,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const s=e.components.main??e;s&&n!=null&&(s.editingID=`${o.callSource}_${a.createGuid()}`,this._editingSystem.create(this,s,n,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const n=[],o=a.createGuid();for(let s=0;s<e.length;s++){const r=e[s],l=r.components.main??r;l.editingID=o,l&&n.push(l)}this._moveObjectsProcess.restart(void 0,this,n,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=st.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!st.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=st.latestDefaultAccessToken}positionsToLocalPositions(e,n){return It(e,n)}localPositionsToPositions(e,n){return wn(e,n)}isPointVisible(e){if(!this.viewer)return!1;const n=Le(e),o=new h.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(n))return!1;const s=this.viewer.scene.cartesianToCanvasCoordinates(n);return!(!s||s.x<0||s.y<0)}getESProperties(){const e={...super.getESProperties()},n=st.defaults;return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",N4,O4,!0),new a.FunctionProperty([],()=>st.getCesiumIonToken(),[],"获取官方token"),new a.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new a.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new a.BooleanProperty([this,"flashLighting"],"头顶灯",n.flashLighting,!0),new a.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",n.particleGlobalControl,!0),new a.GroupProperty([],"Viewer","Viewer"),new a.NumberProperty([this,"resolutionScale"],"分辨率比率",n.resolutionScale,!0),new a.NumberProperty([this,"msaaSamples"],"msaaSamples",n.msaaSamples,!0),new a.BooleanProperty([this,"shadows"]),new a.GroupProperty([],"比例尺","比例尺(Legend)"),new a.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new a.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new a.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new a.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new a.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new a.GroupProperty([],"场景","场景(Scene)"),new a.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",n.sceneSplitPosition,!0),new a.GroupProperty([],"Globe","Globe"),new a.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",n.sceneGlobeShadows,!0),new a.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new a.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new a.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new a.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new a.BooleanProperty([this,"sceneGlobeShowSkirts"]),new a.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new a.ColorProperty([this,"sceneGlobeBaseColor"]),new a.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new a.JsonProperty([this,"sceneGlobeClippingPlanes"]),new a.StringProperty([this,"sceneGlobeClippingPlanesId"]),new a.JsonProperty([this,"sceneGlobeClippingPolygons"]),new a.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new a.GroupProperty([],"underground","underground"),new a.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",n.sceneGlobeUndergroundColor,!0),new a.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",n.sceneGlobeUndergroundColorAlphaByDistance,!0),new a.GroupProperty([],"Translucency","Translucency"),new a.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",n.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",n.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new a.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",n.sceneGlobeTranslucencyRectangle,!0),new a.GroupProperty([],"Sun","Sun"),new a.BooleanProperty([this,"sun"],"sun",n.sun,!0),new a.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",n.sceneSunGlowFactor,!0),new a.GroupProperty([],"Moon","Moon"),new a.BooleanProperty([this,"moon"],"moon",n.moon,!0),new a.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",n.sceneMoonTextureUrl,!0),new a.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",n.sceneMoonOnlySunLighting,!0),new a.GroupProperty([],"SkyBox","SkyBox"),new a.BooleanProperty([this,"sceneSkyBoxShow"]),new a.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",n.sceneSkyBoxSources,void 0,!0),new a.GroupProperty([],"Background","Background"),new a.BooleanProperty([this,"xbsjUseBackground"]),new a.StringProperty([this,"xbsjBackgroundImageUri"]),new a.ColorProperty([this,"xbsjBackgroundColor"]),new a.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new a.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",n.xbsjLocalBoxSources,void 0,!0),new a.ColorProperty([this,"sceneBackgroundColor"]),new a.GroupProperty([],"Fog","Fog"),new a.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",n.sceneFogEnabled,!0),new a.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",n.sceneFogDensity,!0),new a.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",n.sceneFogScreenSpaceErrorFactor,!0),new a.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",n.sceneFogMinimumBrightness,!0),new a.GroupProperty([],"Sscc","Sscc"),new a.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",n.sceneSsccEnableInputs,!0),new a.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",n.sceneSsccEnableCollisionDetection,!0),new a.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",n.sceneSsccZoomFactor,!0),new a.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new a.GroupProperty([],"后处理","后处理"),new a.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",n.scenePpsfxaaEnabled,!0),new a.GroupProperty([],"环境遮蔽","环境遮蔽"),new a.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new a.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new a.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new a.GroupProperty([],"Bloom","Bloom"),new a.BooleanProperty([this,"scenePpsBloomEnabled"]),new a.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new a.NumberProperty([this,"scenePpsBloomContrast"]),new a.NumberProperty([this,"scenePpsBloomBrightness"]),new a.NumberProperty([this,"scenePpsBloomDelta"]),new a.NumberProperty([this,"scenePpsBloomSigma"]),new a.NumberProperty([this,"scenePpsBloomStepSize"]),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",n.sceneDebugShowFramesPerSecond,!0),new a.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",n.sceneDebugShowCommands,!0),new a.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",n.sceneDebugShowFrustums,!0),new a.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",n.sceneDebugShowFrustumPlanes,!0),new a.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",n.sceneDebugShowDepthFrustum,!0),new a.GroupProperty([],"Inspector","Inspector"),new a.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",n.showCesiumInspector,!0),new a.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",n.cesiumInspectorWireframe,!0),new a.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",n.showCesium3DTilesInspector,!0)]}}};v(st,"type",st.register("ESCesiumViewer",st)),v(st,"getCesiumIonToken",B4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",PF),v(st,"defaults",{...a.ESViewer.defaults,flashLighting:!1,resolutionScale:1,msaaSamples:4,sceneSplitPosition:0,sceneGlobeShadows:"RECEIVE_ONLY",sceneGlobeUndergroundColor:[0,0,0,1],sceneGlobeUndergroundColorAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyBackFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyFrontFaceAlphaByDistance:[6378.137,0,12756274e-1,1],sceneGlobeTranslucencyRectangle:[-3.141592653589793,-1.5707963267948966,3.141592653589793,1.5707963267948966].map(e=>180*e/Math.PI),sun:!0,sceneSunGlowFactor:1,moon:!0,sceneMoonTextureUrl:h.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:h.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mz.jpg")},xbsjLocalBoxSources:{positiveX:"${earthsdk3-assets-script-dir}/assets/img/skybox/east.jpg",negativeX:"${earthsdk3-assets-script-dir}/assets/img/skybox/west.jpg",positiveY:"${earthsdk3-assets-script-dir}/assets/img/skybox/bottom.jpg",negativeY:"${earthsdk3-assets-script-dir}/assets/img/skybox/top.jpg",positiveZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/north.jpg",negativeZ:"${earthsdk3-assets-script-dir}/assets/img/skybox/south.jpg"},sceneFogEnabled:!0,sceneFogDensity:2e-4,sceneFogScreenSpaceErrorFactor:2,sceneFogMinimumBrightness:.03,sceneSsccEnableInputs:!0,sceneSsccEnableCollisionDetection:!0,sceneSsccZoomFactor:5,scenePpsfxaaEnabled:!0,sceneDebugShowFramesPerSecond:!1,sceneDebugShowCommands:!1,sceneDebugShowFrustums:!1,sceneDebugShowFrustumPlanes:!1,sceneDebugShowDepthFrustum:1,showCesiumInspector:!1,cesiumInspectorWireframe:!1,showCesium3DTilesInspector:!1,particleGlobalControl:!1}),v(st,"getHeightsScartchCarto",new h.Cartographic);let Te=st;(t=>{t.createDefaultProps=()=>({...a.ESViewer.createDefaultProps(),...L4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.13",e="2025-10-14T02:45:32.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="a0787eb10850868339eb3167f2f4a0b3b77ae414",l=((Date.now()-1760409932e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2294
2294
  %c${o?o+`
2295
2295
  `:""}当前网站正在使用${t},此软件版权归${n}所有
2296
- `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","3b43762eb996d25b6ceaa15c8c605f8b1d9cb144")},get info(){return c},get date(){return"2025-10-13T02:59:52.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.12"},get name(){return"earthsdk3-cesium"},get commitId(){return"3b43762eb996d25b6ceaa15c8c605f8b1d9cb144"},print(){console.info(this.info,`
2296
+ `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","a0787eb10850868339eb3167f2f4a0b3b77ae414")},get info(){return c},get date(){return"2025-10-14T02:45:32.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.13"},get name(){return"earthsdk3-cesium"},get commitId(){return"a0787eb10850868339eb3167f2f4a0b3b77ae414"},print(){console.info(this.info,`
2297
2297
  font-size: 18px;
2298
2298
  font-weight: 1000;
2299
2299
  line-height: 1;