earthsdk3-cesium 3.5.0-beta.17 → 3.5.0-beta.19

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.
@@ -1,4 +1,4 @@
1
- (function(M,ye){typeof exports=="object"&&typeof module<"u"?ye(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut"],ye):(M=typeof globalThis<"u"?globalThis:M||self,ye(M.EarthSDK3_Cesium={},M.Cesium,M.EarthSDK3,M.html2canvas,M.Mapbox,M.Delaunator,M.earcut))})(this,function(M,ye,a,Jh,l_,c_,h_){"use strict";var L4=Object.defineProperty;var O4=(M,ye,a)=>ye in M?L4(M,ye,{enumerable:!0,configurable:!0,writable:!0,value:a}):M[ye]=a;var v=(M,ye,a)=>O4(M,typeof ye!="symbol"?ye+"":ye,a);var Ko=typeof document<"u"?document.currentScript:null;function Og(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=Og(ye),u_=Og(l_);window.Cesium=h;function d_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const ma=class ma extends a.Destroyable{};v(ma,"defaults",{enabled:!0}),v(ma,"createDefaultProps",()=>({...ma.defaults}));let Wt=ma;a.extendClassProps(Wt.prototype,Wt.createDefaultProps);class Jt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s,r)=>this.flyTo(o,s,r))),this.d(i.flyInEvent.don((o,s,r)=>this.flyIn(o,s,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l,c="default"){const{sceneObject:u,czmViewer:d}=this,p=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e,c);p&&p.then(f=>{})}flyTo(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}flyIn(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}get czmViewer(){return this.viewer}}function Le(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const p_=new h.Cartographic;function re(t,i){const e=h.Cartographic.fromCartesian(t,void 0,p_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function _e(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function Ng(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function hi(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function vr(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function jh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function Bg(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ui(t,i){if(t.length===4)return jh(t,i);if(t.length===3)return hi(t,i);if(t.length===2)return _e(t,i);throw new Error("toCartesian error: should not be here!")}function f_(t,i){if(t instanceof h.Cartesian2)return Ng(t,i);if(t instanceof h.Cartesian3)return vr(t,i);if(t instanceof h.Cartesian4)return Bg(t,i);throw new Error("fromCartesian error: should not be here!")}function g_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function Jn(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function m_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function dn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function v_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function Vg(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function y_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function yr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function w_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function C_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function __(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const P_=new h.HeadingPitchRoll,b_=new h.Cartesian3;function S_(t,i,e){const n=Vg(i,P_),o=Le(t,b_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ne(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function E_(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const x_=new h.Cartesian3;function we(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,x_),i)}function A_(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function wi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),rectangle:t.rectangle&&Ne(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&_e(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&_e(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ey({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&_e(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&_e(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new ty({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&_e(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&_e(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function wr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(hi(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function pc(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(hi(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function fc(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Le(s))})),enabled:e,inverse:n})}function gc(t,i){return eu(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function Ug(t,i){return eu(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function eu(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function pn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Wg(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Ie(t,i){if(!((!t.localScale||pn(t.localScale,3))&&(!t.localRotation||pn(t.localRotation,3))&&(!t.localPosition||pn(t.localPosition,3))&&(!t.localModelMatrix||pn(t.localModelMatrix,16))&&(!t.scale||pn(t.scale,3))&&(!t.rotation||pn(t.rotation,3))&&(!t.position||pn(t.position,3))&&(!t.modelMatrix||pn(t.modelMatrix,16)))||t.localScale&&!Wg(t.localScale)||t.scale&&!Wg(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=gc(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=gc(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const T_=new h.Cartesian3,Cr=new h.HeadingPitchRoll,M_=new h.Matrix4,I_=new h.Cartesian3,D_=new h.Cartographic;function R_(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,T_),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){Cr.heading=c[0],Cr.pitch=c[1],Cr.roll=c[2],Cr.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,Cr,void 0,void 0,M_),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,I_);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,D_);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function Gg(t,i,e,n){return R_(t,i,e,n)}const fn=h.Math.toDegrees;function Gt(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=o,i):[fn(e),fn(n),o]}function Jo(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=fn(o),i):[e,n,o].map(fn)}class mc extends a.Destroyable{constructor(e){super();v(this,"_originViewMatrix",new h.Matrix4);v(this,"_originProjMatrix",new h.Matrix4);v(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class F_ extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class z_ extends a.Destroyable{constructor(e){super();v(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new F_(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class jn extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_visibleAlpha",this.disposeVar(a.react(1)));v(this,"_viewDistance",this.disposeVar(a.react(0)));v(this,"_debug",this.disposeVar(a.react(!1)));v(this,"_viewDistanceDebug",this.disposeVar(new z_(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,g]=a.getReactFuncs(r),[m,y,_]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let x=1,A=Number.NEGATIVE_INFINITY;const R=c(),O=p(),N=m?m():0,V=l.getCurrentCameraInfo();if(!R||!O||!V){this._viewDistance.value=A,this._visibleAlpha.value=x;return}A=a.cartesianDistance(V.position,O)-(N??0);const[U,z,B,w]=R;U>z||z>B||B>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=z&&A<=B?x=1:A<=U||A>=w?x=0:A>U&&A<z?z-U<=0?x=0:x=(A-U)/(z-U):A>B&&A<w?(w<=B&&(x=0),x=(w-A)/(w-B)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=x};P();const C=[l.cameraChanged,d,g];_&&C.push(_);const S=this.disposeVar(a.createNextAnimateFrameEvent(...C));this.dispose(S.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const L_=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Wi(t,i,e){var n=L_;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function ut(t,i=!1){const e=t.length;let n;const o=[];for(let s=0;s<e;++s){const[r,l,c]=t[s],u=i?h.Cartesian3.fromDegrees(r,l):h.Cartesian3.fromDegrees(r,l,c);if(!u)continue;const{x:d,y:p,z:f}=u;[d,p,f].every(Number.isFinite)&&(!n||!h.Cartesian3.equals(n,u))&&(n=u,o.push(n))}return o}function eo(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function O_(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function N_(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const Hg=new h.Cartesian3,B_=new h.Ray,V_=new h.Plane(h.Cartesian3.UNIT_X,0);function vc(t,i,e,n){const o=h.Cartesian3.normalize(i,Hg),s=h.Cartesian3.cross(t.camera.right,o,Hg);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,V_),l=t.camera.getPickRay(e,B_);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const tu=new h.Cartesian3,U_=new h.Ray,W_=new h.Cartographic,G_=new h.Ellipsoid;function jo(t,i,e,n){const o=t.camera.getPickRay(i,U_);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,tu),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,tu),l=h.Ellipsoid.fromCartesian3(r,G_),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,tu),p=h.Cartographic.fromCartesian(d,void 0,W_);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function es(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function $g(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const qg=new h.Cartographic,Xg=new h.Cartesian3,Tt=[0,0,0],gn=[0,0,0],iu=new h.Cartesian2,nu=new h.Cartesian3;function ou(t,i,e,n,o,s){o.constraintMode="none",es([0,0,0],o.startDragPos),s=s||{},ui(a.getDomEventCurrentTargetPos(t),iu);const r=e.position;if(!Le(r,nu))return;const l=Wi(i,nu,n);if(l===void 0||!vc(i,nu,iu,Xg)||!re(Xg,Tt))return;const c=$g(Tt[2])*a.geoDistance(r,Tt);if(!s.z&&c<l&&Math.abs(r[2]-Tt[2])<e.dimensions[0]&&Tt[2]>r[2])return o.constraintMode="z",es(Tt,o.startDragPos),!0;if(!jo(i,iu,r[2],qg)||!Jn(qg,Tt))return;const u=$g(r[2])*a.geoDistance(r,Tt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",es(Tt,o.startDragPos);return}{const[p,f]=eo(r,e.heading+90,Tt,gn);if(!s.x&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Tt)<l)){o.constraintMode="x",es(gn,o.startDragPos);return}}{const[p,f]=eo(r,e.heading,Tt,gn);if(!s.y&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Tt)<l)){o.constraintMode="y",es(gn,o.startDragPos);return}}s.xy||(o.constraintMode="xy",es(Tt,o.startDragPos))}}async function Yg(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ui(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=jo(o,r,e);return c?Jn(c):void 0}}let su,ru;function Zg(t,i,e,n,o){o=o||new h.Cartesian3,su=su||new h.Ray,ru=ru||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,su),r=h.Plane.fromPointNormal(i,e,ru);return o=h.IntersectionTests.rayPlane(s,r,o),o}function Qg(t){const i=h.Material.fromType(t.type);return au(i,t),i}function Mt(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function H_(t){return{x:t[0],y:t[1]}}function au(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=_e(i.lineCount??[8,8]),t.uniforms.lineThickness=_e(i.lineThickness??[1,1]),t.uniforms.lineOffset=_e(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=_e(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=_e(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Mt(i.specularMap),t.uniforms.normalMap=Mt(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=H_(i.fadeDirection??[!0,!0]),t.uniforms.time=_e(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=Mt(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=Mt(i.image):i.type==="ElevationBand"?(t.uniforms.color=Mt(i.colors),t.uniforms.heights=Mt(i.heights)):i.type==="XbsjPolylineArrow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.image=Mt(i.image),t.uniforms.repeat=i.repeat??60,t.uniforms.speed=i.speed??1,t.uniforms.lineLength=i.lineLength??1,t.uniforms.arrowColor=te(i.arrowColor??[1,1,1,1])):console.warn(`未知材质类型,无法更新 ${i.type}`)}function di(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Qg(c)):e.value&&au(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Gi(t,i=!1){const e=ut(t.positions,i),n=t.holes&&t.holes.map(o=>Gi(o));return{positions:e,holes:n}}function lu(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const kg=new h.Cartesian4,$_=new h.Matrix4;function q_(){return{left:0,top:0,right:0,bottom:0,depth:0}}function Kg(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Jg(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,$_),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,kg),kg);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,g=c.z;if(!(u<0||d<0||p<0||f<0||g<0||g>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=g):e={left:u,top:f,right:p,bottom:d,depth:g},e}const to={left:0,top:0,right:0,bottom:0,depth:0};class yc extends a.Destroyable{constructor(e,n=!0,o){super();v(this,"_cartesian",new h.Cartesian3);v(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});v(this,"_winPosValid",!1);v(this,"_changedEvent",new a.Event);v(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new mc(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Jg(this._viewer,this._cartesian,to);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?Kg(this._winPos,to)||(e=!0,this._winPos.left=to.left,this._winPos.top=to.top,this._winPos.right=to.right,this._winPos.bottom=to.bottom,this._winPos.depth=to.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function jg(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const X_=h.Check,io=h.defined,em=h.Math.EPSILON10;function Y_(t,i,e,n){if(X_.defined("equalsEpsilon",i),!io(t))return;e=e??!1;const o=io(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,em)?(io(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(io(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],em)&&(o&&(io(u)?n.splice(p,0,d):n.push(s-1)),io(u)?u.length-=1:u=t.slice(0,-1)),io(u)?u:t}const pe=h.Cartesian3,ts=h.Cartographic,no=h.defined,tm=h.DeveloperError,im=h.Ellipsoid,Z_=h.EllipsoidGeodesic,nm=h.EllipsoidRhumbLine,Q_=h.IntersectionTests,cu=h.Math,is=h.Matrix4,oo=h.Plane,ke={};ke.numberOfPoints=function(t,i,e){const n=pe.distance(t,i);return Math.ceil(n/e)},ke.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const k_=new ts;ke.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,k_).height}return n};const K_=new is,J_=new pe,om=new pe,j_=new oo(pe.UNIT_X,0),sm=new pe,e1=new oo(pe.UNIT_X,0),t1=new pe,i1=new pe,hu=[];function rm(t,i,e){const n=hu;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const wc=new ts,Cc=new ts,mn=new pe,uu=new pe,n1=new pe,du=new Z_;let _r=new nm;function o1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,uu),u=n.scaleToGeodeticSurface(i,n1),d=ke.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,wc),f=n.cartesianToCartographic(u,Cc),g=rm(d,o,s);du.setEndPoints(p,f);const m=du.surfaceDistance/d;let y=l;p.height=o;let _=n.cartographicToCartesian(p,mn);pe.pack(_,r,y),y+=3;for(let P=1;P<d;P++){const C=du.interpolateUsingSurfaceDistance(P*m,Cc);C.height=g[P],_=n.cartographicToCartesian(C,mn),pe.pack(_,r,y),y+=3}return y}function s1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,wc),u=n.cartesianToCartographic(i,Cc),d=ke.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=rm(d,o,s);_r.ellipsoid.equals(n)||(_r=new nm(void 0,void 0,n)),_r.setEndPoints(c,u);const f=_r.surfaceDistance/d;let g=l;c.height=o;let m=n.cartographicToCartesian(c,mn);pe.pack(m,r,g),g+=3;for(let y=1;y<d;y++){const _=_r.interpolateUsingSurfaceDistance(y*f,Cc);_.height=p[y],m=n.cartographicToCartesian(_,mn),pe.pack(m,r,g),g+=3}return g}ke.wrapLongitude=function(t,i){const e=[],n=[];if(no(t)&&t.length>0){i=i??is.IDENTITY;const o=is.inverseTransformation(i,K_),s=is.multiplyByPoint(o,pe.ZERO,J_),r=pe.normalize(is.multiplyByPointAsVector(o,pe.UNIT_Y,om),om),l=oo.fromPointNormal(s,r,j_),c=pe.normalize(is.multiplyByPointAsVector(o,pe.UNIT_X,sm),sm),u=oo.fromPointNormal(s,c,e1);let d=1;e.push(pe.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const m=t[g];if(oo.getPointDistance(u,p)<0||oo.getPointDistance(u,m)<0){const y=Q_.lineSegmentPlane(p,m,l,t1);if(no(y)){const _=pe.multiplyByScalar(r,5e-9,i1);oo.getPointDistance(l,p)<0&&pe.negate(_,_),e.push(pe.add(y,_,new pe)),n.push(d+1),pe.negate(_,_),e.push(pe.add(y,_,new pe)),d=1}}e.push(pe.clone(t[g])),d++,p=m}n.push(d)}return{positions:e,lengths:n}},ke.generateArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new tm("options.positions is required.");const e=i.length,n=t.ellipsoid??im.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const _=n.geodeticSurfaceNormal(y,mn);pe.multiplyByScalar(_,o,_),pe.add(y,_,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!no(r)){const y=t.granularity??cu.RADIANS_PER_DEGREE;r=cu.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=ke.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],_=i[c+1],P=s?o[c]:o,C=s?o[c+1]:o;p=o1(y,_,r,n,P,C,d,p)}hu.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,wc);g.height=s?o[e-1]:o;const m=n.cartographicToCartesian(g,mn);return pe.pack(m,d,u-3),d};const am=new ts,r1=new ts;ke.generateRhumbArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new tm("options.positions is required.");const e=i.length,n=t.ellipsoid??im.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const C=n.geodeticSurfaceNormal(P,mn);pe.multiplyByScalar(C,o,C),pe.add(P,C,P)}return[P.x,P.y,P.z]}const r=t.granularity??cu.RADIANS_PER_DEGREE;let l=0,c,u=n.cartesianToCartographic(i[0],am),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],r1),l+=ke.numberOfPointsRhumbLine(u,d,r),u=ts.clone(d,am);const p=(l+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const P=i[c],C=i[c+1],S=s?o[c]:o,x=s?o[c+1]:o;g=s1(P,C,r,n,S,x,f,g)}hu.length=0;const m=i[e-1],y=n.cartesianToCartographic(m,wc);y.height=s?o[e-1]:o;const _=n.cartographicToCartesian(y,mn);return pe.pack(_,f,p-3),f},ke.generateCartesianArc=function(t){const i=ke.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=pe.unpack(i,o*3);return n},ke.generateCartesianRhumbArc=function(t){const i=ke.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=pe.unpack(i,o*3);return n};const _c=h.ArcType,a1=h.Cartesian3,l1=h.Math;function lm(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=Y_(t.positions,a1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===_c.GEODESIC||i===_c.RHUMB){let l;i===_c.GEODESIC?(l=l1.chordLength(e,n.maximumRadius),ke.numberOfPoints):(l=e,ke.numberOfPointsRhumbLine);const c=ke.extractHeights(s,n);i===_c.GEODESIC?s=ke.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=ke.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function pu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=lm({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function cm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function fu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?gc(o,l):r==="XForwardZUp"&&Ug(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ui(s),e),cm(e,i)}const c1=new h.Matrix4;function hm(t,i){const e=h.Matrix4.fromArray(t,0,c1);return h.Matrix4.inverse(e,e),cm(e,i)}const h1=new h.Matrix4,u1=new h.Cartesian3;function um(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,u1),l=h.Matrix4.fromArray(t,0,h1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const d1=new h.Matrix4,p1=new h.Cartesian3,f1=new h.Cartographic;function vn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,p1),l=h.Matrix4.fromArray(t,0,d1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,f1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function It(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=hm(r);return[i.map(u=>um(l,u)),r,l]}function yn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>vn(r,c)),r]}function dm(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=ye.Cartesian3.fromDegrees(...t[e]),o=ye.Cartesian3.fromDegrees(...t[e+1]),s=ye.Cartesian3.fromDegrees(...t[e+2]),r=ye.Cartesian3.angleBetween(ye.Cartesian3.subtract(n,o,new ye.Cartesian3),ye.Cartesian3.subtract(s,o,new ye.Cartesian3));i.push(isNaN(r)?0:ye.Math.toDegrees(r))}return i}function gu(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>re(n)))),t.holes&&t.holes.forEach(n=>{e=gu(n,e)}),e}function Ht(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class mu extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let m=r();m&&(m=[...m],i.editingHeightOffset&&(m[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...m,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const m=Wi(s,f,o);m!==void 0?d([m,m,m]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${m??"undefined"}`)}))}}function g1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=re(e),u=re(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=re(n),d=re(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=re(o),p=re(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=vn(i,[e.x,e.y,e.z]),u=vn(i,[-e.x,-e.y,-e.z]),l=vn(i,[n.x,n.y,n.z]),d=vn(i,[-n.x,-n.y,-n.z]),c=vn(i,[o.x,o.y,o.z]),p=vn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const pm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&u()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=g1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function m1(t){return new Promise((i,e)=>{pm.restart(void 0,t),pm.completeEvent.don(n=>{i(n)})})}class vu extends a.Destroyable{constructor(e){super();v(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function fm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
1
+ (function(M,ye){typeof exports=="object"&&typeof module<"u"?ye(exports,require("cesium"),require("earthsdk3"),require("html2canvas"),require("mvt-basic-render"),require("delaunator"),require("earcut")):typeof define=="function"&&define.amd?define(["exports","cesium","earthsdk3","html2canvas","mvt-basic-render","delaunator","earcut"],ye):(M=typeof globalThis<"u"?globalThis:M||self,ye(M.EarthSDK3_Cesium={},M.Cesium,M.EarthSDK3,M.html2canvas,M.Mapbox,M.Delaunator,M.earcut))})(this,function(M,ye,a,Jh,l_,c_,h_){"use strict";var z4=Object.defineProperty;var L4=(M,ye,a)=>ye in M?z4(M,ye,{enumerable:!0,configurable:!0,writable:!0,value:a}):M[ye]=a;var v=(M,ye,a)=>L4(M,typeof ye!="symbol"?ye+"":ye,a);var Ko=typeof document<"u"?document.currentScript:null;function Og(t){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(i,e,n.get?n:{enumerable:!0,get:()=>t[e]})}}return i.default=t,Object.freeze(i)}const h=Og(ye),u_=Og(l_);window.Cesium=h;function d_(){Object.keys(h).forEach(t=>{h[t].prototype&&Object.defineProperty(h[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:a.createGuid()})})}fetch("https://corsproxy.io/?https://gitee.com/mirrors/CesiumJS/raw/main/packages/engine/Source/Core/Ion.js").then(t=>t.text()).then(t=>{const i=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);i&&(h.Ion.defaultAccessToken=i[1],console.log("更新默认Cesium.Ion.Token成功"))});const ma=class ma extends a.Destroyable{};v(ma,"defaults",{enabled:!0}),v(ma,"createDefaultProps",()=>({...ma.defaults}));let Wt=ma;a.extendClassProps(Wt.prototype,Wt.createDefaultProps);class Jt extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(i.flyToEvent.don((o,s,r)=>this.flyTo(o,s,r))),this.d(i.flyInEvent.don((o,s,r)=>this.flyIn(o,s,r))),this.dispose(i.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:s,rotation:r}=o;i.flyInParam={position:s,rotation:r,flyDuration:1}})),this.dispose(i.calcFlyToParamEvent.disposableOn(()=>{i.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(i,e,n,o,s,r,l,c="default"){const{sceneObject:u,czmViewer:d}=this,p=d.flyTo({distance:n??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:s??1,hDelta:r??0,pDelta:l??0},e,c);p&&p.then(f=>{})}flyTo(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}flyIn(i,e,n="default"){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyInParam){const{position:r,rotation:l,flyDuration:c}=o.flyInParam,u=i??c;return this.flyToWithPromise(e,r,void 0,l,u,void 0,void 0,n),!0}return!1}get czmViewer(){return this.viewer}}function Le(t,i){return h.Cartesian3.fromDegrees(...t,void 0,i)}const p_=new h.Cartographic;function re(t,i){const e=h.Cartographic.fromCartesian(t,void 0,p_);if(e)return i=i||[0,0,0],i[0]=h.Math.toDegrees(e.longitude),i[1]=h.Math.toDegrees(e.latitude),i[2]=e.height,i}function _e(t,i){return i=i||new h.Cartesian2,i.x=t[0],i.y=t[1],i}function Ng(t,i){return i=i||[0,0],i[0]=t.x,i[1]=t.y,i}function hi(t,i){return i=i||new h.Cartesian3,i.x=t[0],i.y=t[1],i.z=t[2],i}function vr(t,i){return i=i||[0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i}function jh(t,i){return i=i||new h.Cartesian4,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function Bg(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}function ui(t,i){if(t.length===4)return jh(t,i);if(t.length===3)return hi(t,i);if(t.length===2)return _e(t,i);throw new Error("toCartesian error: should not be here!")}function f_(t,i){if(t instanceof h.Cartesian2)return Ng(t,i);if(t instanceof h.Cartesian3)return vr(t,i);if(t instanceof h.Cartesian4)return Bg(t,i);throw new Error("fromCartesian error: should not be here!")}function g_(t,i){return i=i||new h.Cartographic,i.longitude=h.Math.toRadians(t[0]),i.latitude=h.Math.toRadians(t[1]),i.height=t[2],i}function Jn(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.longitude),i[1]=h.Math.toDegrees(t.latitude),i[2]=t.height,i}function te(t,i){return i=i||new h.Color,i.red=t[0],i.green=t[1],i.blue=t[2],i.alpha=t[3],i}function m_(t,i){return i=i||[0,0,0,0],i[0]=t.red,i[1]=t.green,i[2]=t.blue,i[3]=t.alpha,i}function dn(t,i){return i=i||new h.NearFarScalar,i.near=t[0],i.nearValue=t[1],i.far=t[2],i.farValue=t[3],i}function v_(t,i){return i=i||[0,0,0,0],i[0]=t.near,i[1]=t.nearValue,i[2]=t.far,i[3]=t.farValue,i}function Vg(t,i){return i=i||new h.HeadingPitchRoll,i.heading=h.Math.toRadians(t[0]-90),i.pitch=h.Math.toRadians(t[1]),i.roll=h.Math.toRadians(t[2]),i}function y_(t,i){return i=i||[0,0,0],i[0]=h.Math.toDegrees(t.heading+h.Math.PI_OVER_TWO),i[1]=h.Math.toDegrees(t.pitch),i[2]=h.Math.toDegrees(t.roll),i}function yr(t,i){return i=i||new h.DistanceDisplayCondition,i.near=t[0],i.far=t[1],i}function w_(t,i){return i=i||[0,0],i[0]=t.near,i[1]=t.far,i}function C_(t,i){return i=i||new h.Quaternion,i.x=t[0],i.y=t[1],i.z=t[2],i.w=t[3],i}function __(t,i){return i=i||[0,0,0,0],i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=t.w,i}const P_=new h.HeadingPitchRoll,b_=new h.Cartesian3;function S_(t,i,e){const n=Vg(i,P_),o=Le(t,b_);return h.Transforms.headingPitchRollQuaternion(o,n,void 0,void 0,e)}function Ne(t,i){return i=i||new h.Rectangle,i.west=t[0]*Math.PI/180,i.south=t[1]*Math.PI/180,i.east=t[2]*Math.PI/180,i.north=t[3]*Math.PI/180,i}function E_(t,i){return i=i||[0,0,0,0],i[0]=t.west,i[1]=t.south,i[2]=t.east,i[3]=t.north,i}const x_=new h.Cartesian3;function we(t,i){return i=i||new h.Ellipsoid,h.Ellipsoid.fromCartesian3(h.Cartesian3.fromArray(t,void 0,x_),i)}function A_(t,i){return i=i||[0,0,0],i[0]=t.radii.x,i[1]=t.radii.y,i[2]=t.radii.z,i}function wi(t){if(t.type==="GeographicTilingScheme")return new h.GeographicTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),rectangle:t.rectangle&&Ne(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new h.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&_e(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&_e(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ey({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&_e(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&_e(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new ty({ellipsoid:t.ellipsoid&&we(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&_e(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&_e(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function wr(t,i){const{planes:e,enabled:n,modelMatrix:o,unionClippingRegions:s,edgeColor:r,edgeWidth:l}=t;let c=o&&h.Matrix4.fromArray(o);return i&&(c=c||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4),h.Matrix4.multiply(i,c,c)),new h.ClippingPlaneCollection({planes:e&&e.map(u=>new h.ClippingPlane(hi(u.normal),u.distance)),enabled:n,modelMatrix:c,unionClippingRegions:s,edgeColor:r&&te(r),edgeWidth:l})}function pc(t,i,e){const n=i;if(!n){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),n.planes)for(let s of n.planes)t.add(new h.ClippingPlane(hi(s.normal),s.distance));let o=n.modelMatrix&&h.Matrix4.fromArray(n.modelMatrix)||h.Matrix4.clone(h.Matrix4.IDENTITY,new h.Matrix4);e&&h.Matrix4.multiply(e,o,o),t.enabled=n.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=n.unionClippingRegions??!1,t.edgeColor=te(n.edgeColor??[1,1,1,1]),t.edgeWidth=n.edgeWidth??2}function fc(t){const{polygons:i,enabled:e,inverse:n}=t;return new h.ClippingPolygonCollection({polygons:i&&i.map(o=>new h.ClippingPolygon({positions:o.positions.map(s=>Le(s))})),enabled:e,inverse:n})}function gc(t,i){return eu(t,h.Cartesian3.UNIT_Y,h.Cartesian3.UNIT_Z,h.Cartesian3.UNIT_X,i)}function Ug(t,i){return eu(t,h.Cartesian3.UNIT_X,h.Cartesian3.UNIT_Z,new h.Cartesian3(0,-1,0),i)}function eu(t,i,e,n,o){const[s,r,l]=t,c=h.Quaternion.fromAxisAngle(e,h.Math.toRadians(-s)),u=h.Quaternion.fromAxisAngle(n,h.Math.toRadians(r)),d=h.Quaternion.fromAxisAngle(i,h.Math.toRadians(l)),p=h.Quaternion.clone(h.Quaternion.IDENTITY,o);return h.Quaternion.multiply(d,p,p),h.Quaternion.multiply(u,p,p),h.Quaternion.multiply(c,p,p),p}function pn(t,i){return Array.isArray(t)?t.length!==i?(console.warn(`array.length !== ${i}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Wg(t){return t.some(i=>i===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function Ie(t,i){if(!((!t.localScale||pn(t.localScale,3))&&(!t.localRotation||pn(t.localRotation,3))&&(!t.localPosition||pn(t.localPosition,3))&&(!t.localModelMatrix||pn(t.localModelMatrix,16))&&(!t.scale||pn(t.scale,3))&&(!t.rotation||pn(t.rotation,3))&&(!t.position||pn(t.position,3))&&(!t.modelMatrix||pn(t.modelMatrix,16)))||t.localScale&&!Wg(t.localScale)||t.scale&&!Wg(t.scale))return;if(t.sceneScaleFromPixelSize){if(!Number.isFinite(t.sceneScaleFromPixelSize)){console.warn("!Number.isFinite(options.sceneScaleFromPixelSize)");return}if(t.sceneScaleFromPixelSize===0){console.warn("options.sceneScaleFromPixelSize === 0");return}}const n=i??h.Matrix4.clone(h.Matrix4.IDENTITY);if(t.localScale){const[o,s,r]=t.localScale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=h.Quaternion.fromAxisAngle(h.Cartesian3.UNIT_Z,h.Math.toRadians(90)),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localRotation){const o=gc(t.localRotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.localPosition){const o=h.Matrix4.fromTranslation(h.Cartesian3.fromArray(t.localPosition));h.Matrix4.multiply(o,n,n)}if(t.localModelMatrix){const o=h.Matrix4.fromArray(t.localModelMatrix);h.Matrix4.multiply(o,n,n)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,s=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,o,o),new h.Matrix4);h.Matrix4.multiply(s,n,n)}if(t.scale){const[o,s,r]=t.scale??[1,1,1],l=h.Matrix4.fromScale(h.Cartesian3.fromElements(o,s,r),new h.Matrix4);h.Matrix4.multiply(l,n,n)}if(t.rotation){const o=gc(t.rotation),s=h.Matrix3.fromQuaternion(o);h.Matrix4.multiply(h.Matrix4.fromRotationTranslation(s),n,n)}if(t.position){const o=h.Cartesian3.fromDegrees(...t.position),s=h.Transforms.eastNorthUpToFixedFrame(o);h.Matrix4.multiply(s,n,n)}if(t.modelMatrix){const o=h.Matrix4.fromArray(t.modelMatrix);h.Matrix4.multiply(o,n,n)}return n}const T_=new h.Cartesian3,Cr=new h.HeadingPitchRoll,M_=new h.Matrix4,I_=new h.Cartesian3,D_=new h.Cartographic;function R_(t,i=[0,0,0],e=0,n){const[o,s,r]=t,l=h.Cartesian3.fromDegrees(o,s,r,void 0,T_),c=[...i];for(let d=0;d<3;++d)c[d]=h.Math.RADIANS_PER_DEGREE*c[d];if(e!==0){Cr.heading=c[0],Cr.pitch=c[1],Cr.roll=c[2],Cr.heading-=h.Math.PI_OVER_TWO;const d=h.Transforms.headingPitchRollToFixedFrame(l,Cr,void 0,void 0,M_),p=h.Matrix4.multiplyByPointAsVector(d,h.Cartesian3.UNIT_X,I_);h.Cartesian3.multiplyByScalar(p,e,p),h.Cartesian3.subtract(l,p,l)}const u=h.Cartographic.fromCartesian(l,void 0,D_);if(u)return n=n||[0,0,0],n[0]=u.longitude*180/Math.PI,n[1]=u.latitude*180/Math.PI,n[2]=u.height,n}function Gg(t,i,e,n){return R_(t,i,e,n)}const fn=h.Math.toDegrees;function Gt(t,i){const{longitude:e,latitude:n,height:o}=t.positionCartographic;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=o,i):[fn(e),fn(n),o]}function Jo(t,i){const{heading:e,pitch:n,roll:o}=t;return i?(i[0]=fn(e),i[1]=fn(n),i[2]=fn(o),i):[e,n,o].map(fn)}class mc extends a.Destroyable{constructor(e){super();v(this,"_originViewMatrix",new h.Matrix4);v(this,"_originProjMatrix",new h.Matrix4);v(this,"_changed",new a.Event);this._scene=e;const n=this._scene.camera;h.Matrix4.clone(n.viewMatrix,this._originViewMatrix),h.Matrix4.clone(n.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){h.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(h.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),h.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(h.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class F_ extends a.Destroyable{constructor(i){super();const e=()=>{};this.dispose(i.viewDistanceChanged.disposableOn(e)),this.dispose(i.visibleAlphaChanged.disposableOn(e))}}class z_ extends a.Destroyable{constructor(e){super();v(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new a.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new F_(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class jn extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_visibleAlpha",this.disposeVar(a.react(1)));v(this,"_viewDistance",this.disposeVar(a.react(0)));v(this,"_debug",this.disposeVar(a.react(!1)));v(this,"_viewDistanceDebug",this.disposeVar(new z_(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:r,czmViewer:l}=this,[c,u,d]=a.getReactFuncs(n),[p,f,g]=a.getReactFuncs(r),[m,y,_]=s?a.getReactFuncs(s):[void 0,void 0,void 0],P=()=>{let x=1,A=Number.NEGATIVE_INFINITY;const R=c(),O=p(),N=m?m():0,V=l.getCurrentCameraInfo();if(!R||!O||!V){this._viewDistance.value=A,this._visibleAlpha.value=x;return}A=a.cartesianDistance(V.position,O)-(N??0);const[U,z,B,w]=R;U>z||z>B||B>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):A>=z&&A<=B?x=1:A<=U||A>=w?x=0:A>U&&A<z?z-U<=0?x=0:x=(A-U)/(z-U):A>B&&A<w?(w<=B&&(x=0),x=(w-A)/(w-B)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=A,this._visibleAlpha.value=x};P();const C=[l.cameraChanged,d,g];_&&C.push(_);const S=this.disposeVar(a.createNextAnimateFrameEvent(...C));this.dispose(S.disposableOn(P))}get visibleAlpha(){return this._visibleAlpha.value}get visibleAlphaChanged(){return this._visibleAlpha.changed}get viewDistance(){return this._viewDistance.value}set viewDistance(e){this._viewDistance.value=e}get viewDistanceChanged(){return this._viewDistance.changed}get debug(){return this._debug.value}set debug(e){this._debug.value=e}get debugChanged(){return this._debug.changed}get positionReact(){return this._positionReact}get czmViewer(){return this._czmViewer}get viewDistanceDebug(){return this._viewDistanceDebug}}const L_=new h.BoundingSphere(h.Cartesian3.ZERO,0);function Wi(t,i,e){var n=L_;h.Cartesian3.clone(i,n.center);const o=t.camera.getPixelSize(n,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const s=e*o;if(Number.isFinite(s)&&s>0)return s}function ut(t,i=!1){const e=t.length;let n;const o=[];for(let s=0;s<e;++s){const[r,l,c]=t[s],u=i?h.Cartesian3.fromDegrees(r,l):h.Cartesian3.fromDegrees(r,l,c);if(!u)continue;const{x:d,y:p,z:f}=u;[d,p,f].every(Number.isFinite)&&(!n||!h.Cartesian3.equals(n,u))&&(n=u,o.push(n))}return o}function eo(t,i,e,n){const o=a.geoRhumbDistance(t,e),s=a.geoRhumbHeading(t,e),r=Math.cos(s*Math.PI/180)*Math.cos(i*Math.PI/180)+Math.sin(s*Math.PI/180)*Math.sin(i*Math.PI/180);return r>0?a.geoRhumbDestination(t,o,i,n):a.geoRhumbDestination(t,o,i+180,n),[r>0?o:-o,n]}function O_(t,i,e){const n=e*.1,o=[];for(let s=-9;s<10;++s){const r=a.geoRhumbDestination(t,n*s,i);r&&o.push(r)}return o}function N_(t,i){return a.geoNearestPointOnLine(t,i).geometry.coordinates}const Hg=new h.Cartesian3,B_=new h.Ray,V_=new h.Plane(h.Cartesian3.UNIT_X,0);function vc(t,i,e,n){const o=h.Cartesian3.normalize(i,Hg),s=h.Cartesian3.cross(t.camera.right,o,Hg);h.Cartesian3.normalize(s,s);const r=h.Plane.fromPointNormal(i,s,V_),l=t.camera.getPickRay(e,B_);if(l)return h.IntersectionTests.rayPlane(l,r,n)}const tu=new h.Cartesian3,U_=new h.Ray,W_=new h.Cartographic,G_=new h.Ellipsoid;function jo(t,i,e,n){const o=t.camera.getPickRay(i,U_);if(!o)return;const s=h.Cartesian3.fromElements(e,e,e,tu),r=h.Cartesian3.add(s,h.Ellipsoid.WGS84.radii,tu),l=h.Ellipsoid.fromCartesian3(r,G_),c=h.IntersectionTests.rayEllipsoid(o,l);if(c){const u=c.start>0?c.start:c.stop;if(u){const d=h.Ray.getPoint(o,u,tu),p=h.Cartographic.fromCartesian(d,void 0,W_);return n=n||new h.Cartographic,n.longitude=p.longitude,n.latitude=p.latitude,n.height=e,n}else return}else return}function es(t,i){i[0]=t[0],i[1]=t[1],i[2]=t[2]}function $g(t){const i=h.Ellipsoid.WGS84.minimumRadius;return(t+i)/i}const qg=new h.Cartographic,Xg=new h.Cartesian3,Tt=[0,0,0],gn=[0,0,0],iu=new h.Cartesian2,nu=new h.Cartesian3;function ou(t,i,e,n,o,s){o.constraintMode="none",es([0,0,0],o.startDragPos),s=s||{},ui(a.getDomEventCurrentTargetPos(t),iu);const r=e.position;if(!Le(r,nu))return;const l=Wi(i,nu,n);if(l===void 0||!vc(i,nu,iu,Xg)||!re(Xg,Tt))return;const c=$g(Tt[2])*a.geoDistance(r,Tt);if(!s.z&&c<l&&Math.abs(r[2]-Tt[2])<e.dimensions[0]&&Tt[2]>r[2])return o.constraintMode="z",es(Tt,o.startDragPos),!0;if(!jo(i,iu,r[2],qg)||!Jn(qg,Tt))return;const u=$g(r[2])*a.geoDistance(r,Tt),d=e.dimensions[0];if(!(u>1.05*d)){if(!s.zAxis&&u>.95*d&&u<=1.05*d){o.constraintMode="zAxis",es(Tt,o.startDragPos);return}{const[p,f]=eo(r,e.heading+90,Tt,gn);if(!s.x&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Tt)<l)){o.constraintMode="x",es(gn,o.startDragPos);return}}{const[p,f]=eo(r,e.heading,Tt,gn);if(!s.y&&p>0&&f&&(gn[2]=r[2],a.geoDistance(gn,Tt)<l)){o.constraintMode="y",es(gn,o.startDragPos);return}}s.xy||(o.constraintMode="xy",es(Tt,o.startDragPos))}}async function Yg(t,i,e,n){var l;const o=(l=t.viewer)==null?void 0:l.scene;if(!o)throw new Error("!scene");const s=a.getDomEventCurrentTargetPos(i),r=ui(s);if(e===void 0){const c=t.quickPickPosition(s);return c?await c:void 0}else{const c=jo(o,r,e);return c?Jn(c):void 0}}let su,ru;function Zg(t,i,e,n,o){o=o||new h.Cartesian3,su=su||new h.Ray,ru=ru||new h.Plane(h.Cartesian3.UNIT_X,0);const s=t.camera.getPickRay(n,su),r=h.Plane.fromPointNormal(i,e,ru);return o=h.IntersectionTests.rayPlane(s,r,o),o}function Qg(t){const i=h.Material.fromType(t.type);return au(i,t),i}function Mt(t){return t&&a.ESSceneObject.context.getStrFromEnv(t)||h.Material.DefaultImageId}function H_(t){return{x:t[0],y:t[1]}}function au(t,i){i.type==="Color"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineArrow"?t.uniforms.color=te(i.color??[1,1,1,1]):i.type==="PolylineDash"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.gapColor=te(i.gapColor??[0,0,0,0]),t.uniforms.dashLength=i.dashLength??16,t.uniforms.dashPattern=i.dashPattern??255):i.type==="PolylineGlow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.glowPower=i.glowPower??.25,t.uniforms.taperPower=i.taperPower??1):i.type==="PolylineOutline"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.outlineColor=te(i.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=i.outlineWidth??1):i.type==="Image"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.color=te(i.color??[1,1,1,1])):i.type==="DiffuseMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="AlphaMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channel=i.channel??"a"):i.type==="SpecularMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r"):i.type==="EmissionMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb"):i.type==="BumpMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channel=i.channel??"r",t.uniforms.strength=i.strength??.8):i.type==="NormalMap"?(t.uniforms.image=Mt(i.image),t.uniforms.repeat=_e(i.repeat??[1,1]),t.uniforms.channels=i.channels??"rgb",t.uniforms.strength=i.strength??.8):i.type==="Grid"?(t.uniforms.color=te(i.color??[0,1,0,1]),t.uniforms.cellAlpha=i.cellAlpha??.1,t.uniforms.lineCount=_e(i.lineCount??[8,8]),t.uniforms.lineThickness=_e(i.lineThickness??[1,1]),t.uniforms.lineOffset=_e(i.lineOffset??[0,0])):i.type==="Stripe"?(t.uniforms.evenColor=te(i.evenColor??[1,1,1,.5]),t.uniforms.oddColor=te(i.oddColor??[0,0,1,.5]),t.uniforms.horizontal=i.horizontal??!0,t.uniforms.offset=i.offset??0,t.uniforms.repeat=i.repeat??5):i.type==="Checkerboard"?(t.uniforms.lightColor=te(i.lightColor??[1,1,1,.5]),t.uniforms.darkColor=te(i.darkColor??[0,0,0,.5]),t.uniforms.repeat=_e(i.repeat??[5,5])):i.type==="Dot"?(t.uniforms.lightColor=te(i.lightColor??[1,1,0,.75]),t.uniforms.darkColor=te(i.darkColor??[0,1,1,.75]),t.uniforms.repeat=_e(i.repeat??[5,5])):i.type==="Water"?(t.uniforms.baseWaterColor=te(i.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=te(i.blendColor??[0,1,.699,1]),t.uniforms.specularMap=Mt(i.specularMap),t.uniforms.normalMap=Mt(i.normalMap),t.uniforms.frequency=i.frequency??10,t.uniforms.animationSpeed=i.animationSpeed??.01,t.uniforms.amplitude=i.amplitude??1,t.uniforms.specularIntensity=i.specularIntensity??.5,t.uniforms.fadeFactor=i.fadeFactor??1):i.type==="RimLighting"?(t.uniforms.color=te(i.color??[1,0,0,.7]),t.uniforms.rimColor=te(i.rimColor??[1,1,1,.4]),t.uniforms.width=i.width??.3):i.type==="Fade"?(t.uniforms.fadeInColor=te(i.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=te(i.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=i.maximumDistance??.5,t.uniforms.repeat=i.repeat??!0,t.uniforms.fadeDirection=H_(i.fadeDirection??[!0,!0]),t.uniforms.time=_e(i.time??[.5,.5])):i.type==="ElevationContour"?(t.uniforms.color=te(i.color??[1,0,0,1]),t.uniforms.spacing=i.spacing??100,t.uniforms.width=i.width??1):i.type==="ElevationRamp"?(t.uniforms.image=Mt(i.image),t.uniforms.minimumHeight=i.minimumHeight??0,t.uniforms.maximumHeight=i.maximumHeight??1e4):i.type==="AspectRamp"?t.uniforms.image=Mt(i.image):i.type==="ElevationBand"?(t.uniforms.color=Mt(i.colors),t.uniforms.heights=Mt(i.heights)):i.type==="XbsjPolylineArrow"?(t.uniforms.color=te(i.color??[1,1,1,1]),t.uniforms.image=Mt(i.image),t.uniforms.repeat=i.repeat??60,t.uniforms.speed=i.speed??1,t.uniforms.lineLength=i.lineLength??1,t.uniforms.arrowColor=te(i.arrowColor??[1,1,1,1])):console.warn(`未知材质类型,无法更新 ${i.type}`)}function di(t,i){const e=a.react(void 0);let n="";const[o,s,r]=a.getReactFuncs(t),l=()=>{try{const c=o()??i;c?n!==c.type?(n=c.type,e.value=Qg(c)):e.value&&au(e.value,c):(n="",e.value=void 0)}catch{}};return l(),e.dispose(r.disposableOn(l)),e}function Gi(t,i=!1){const e=ut(t.positions,i),n=t.holes&&t.holes.map(o=>Gi(o));return{positions:e,holes:n}}function lu(t,i){const e=Math.PI/180,n=1/e,o=new h.Cartographic(t[0]*e,t[1]*e,t[2]),s=new h.Cartographic(i[0]*e,i[1]*e,i[2]),r=new h.EllipsoidGeodesic(o,s).interpolateUsingFraction(.5,new h.Cartographic);if(r)return r.height=(o.height+s.height)*.5,[r.longitude*n,r.latitude*n,r.height]}const kg=new h.Cartesian4,$_=new h.Matrix4;function q_(){return{left:0,top:0,right:0,bottom:0,depth:0}}function Kg(t,i){return t.left===i.left&&t.right===i.right&&t.bottom===i.bottom&&t.top===i.top&&t.depth===i.depth}function Jg(t,i,e){if(t.scene.mode!==h.SceneMode.SCENE3D)return;const n=t.canvas.clientHeight,o=t.canvas.clientWidth,s=t.camera.viewMatrix,r=t.camera.frustum.projectionMatrix,l=h.Matrix4.multiply(r,s,$_),c=h.Matrix4.multiplyByVector(l,h.Cartesian4.fromElements(i.x,i.y,i.z,1,kg),kg);c.x/=c.w,c.y/=c.w,c.z/=c.w,c.w=1;const u=o*(c.x*.5+.5),d=n*(c.y*.5+.5),p=o-u,f=n-d,g=c.z;if(!(u<0||d<0||p<0||f<0||g<0||g>1))return e?(e.left=u,e.top=f,e.right=p,e.bottom=d,e.depth=g):e={left:u,top:f,right:p,bottom:d,depth:g},e}const to={left:0,top:0,right:0,bottom:0,depth:0};class yc extends a.Destroyable{constructor(e,n=!0,o){super();v(this,"_cartesian",new h.Cartesian3);v(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});v(this,"_winPosValid",!1);v(this,"_changedEvent",new a.Event);v(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new mc(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=n}get enabled(){return this._enabled}set enabled(e){this._enabled!==e&&(this._enabled=e,e&&this._updateWinPos())}_updateWinPos(){if(!this._enabled)return;let e=!1;const n=Jg(this._viewer,this._cartesian,to);!!n!==this._winPosValid&&(e=!0,this._winPosValid=!!n),this._winPosValid?Kg(this._winPos,to)||(e=!0,this._winPos.left=to.left,this._winPos.top=to.top,this._winPos.right=to.right,this._winPos.bottom=to.bottom,this._winPos.depth=to.depth):(e=!0,this._winPos.left=Number.NaN,this._winPos.top=Number.NaN,this._winPos.right=Number.NaN,this._winPos.bottom=Number.NaN,this._winPos.depth=Number.NaN),e&&this._changedEvent.emit(this._winPosValid,this._winPos)}get cartesian(){return this._cartesian}set cartesian(e){h.Cartesian3.equals(this._cartesian,e)||(h.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function jg(t){const i=h.Math.toRadians(t[0]),e=h.Math.toRadians(t[1]),n=h.Math.toRadians(t[2]),o=h.Matrix3.fromHeadingPitchRoll(new h.HeadingPitchRoll(i,e,n)),s=new h.Cartesian3;return h.Matrix3.multiplyByVector(o,h.Cartesian3.UNIT_X,s),[s.x,s.y,s.z]}const X_=h.Check,io=h.defined,em=h.Math.EPSILON10;function Y_(t,i,e,n){if(X_.defined("equalsEpsilon",i),!io(t))return;e=e??!1;const o=io(n),s=t.length;if(s<2)return t;let r,l=t[0],c,u,d=0,p=-1;for(r=1;r<s;++r)c=t[r],i(l,c,em)?(io(u)||(u=t.slice(0,r),d=r-1,p=0),o&&n.push(r)):(io(u)&&(u.push(c),d=r,o&&(p=n.length)),l=c);return e&&i(t[0],t[s-1],em)&&(o&&(io(u)?n.splice(p,0,d):n.push(s-1)),io(u)?u.length-=1:u=t.slice(0,-1)),io(u)?u:t}const pe=h.Cartesian3,ts=h.Cartographic,no=h.defined,tm=h.DeveloperError,im=h.Ellipsoid,Z_=h.EllipsoidGeodesic,nm=h.EllipsoidRhumbLine,Q_=h.IntersectionTests,cu=h.Math,is=h.Matrix4,oo=h.Plane,ke={};ke.numberOfPoints=function(t,i,e){const n=pe.distance(t,i);return Math.ceil(n/e)},ke.numberOfPointsRhumbLine=function(t,i,e){const n=Math.pow(t.longitude-i.longitude,2)+Math.pow(t.latitude-i.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(n/(e*e))))};const k_=new ts;ke.extractHeights=function(t,i){const e=t.length,n=new Array(e);for(let o=0;o<e;o++){const s=t[o];n[o]=i.cartesianToCartographic(s,k_).height}return n};const K_=new is,J_=new pe,om=new pe,j_=new oo(pe.UNIT_X,0),sm=new pe,e1=new oo(pe.UNIT_X,0),t1=new pe,i1=new pe,hu=[];function rm(t,i,e){const n=hu;n.length=t;let o;if(i===e){for(o=0;o<t;o++)n[o]=i;return n}const r=(e-i)/t;for(o=0;o<t;o++){const l=i+o*r;n[o]=l}return n}const wc=new ts,Cc=new ts,mn=new pe,uu=new pe,n1=new pe,du=new Z_;let _r=new nm;function o1(t,i,e,n,o,s,r,l){const c=n.scaleToGeodeticSurface(t,uu),u=n.scaleToGeodeticSurface(i,n1),d=ke.numberOfPoints(t,i,e),p=n.cartesianToCartographic(c,wc),f=n.cartesianToCartographic(u,Cc),g=rm(d,o,s);du.setEndPoints(p,f);const m=du.surfaceDistance/d;let y=l;p.height=o;let _=n.cartographicToCartesian(p,mn);pe.pack(_,r,y),y+=3;for(let P=1;P<d;P++){const C=du.interpolateUsingSurfaceDistance(P*m,Cc);C.height=g[P],_=n.cartographicToCartesian(C,mn),pe.pack(_,r,y),y+=3}return y}function s1(t,i,e,n,o,s,r,l){const c=n.cartesianToCartographic(t,wc),u=n.cartesianToCartographic(i,Cc),d=ke.numberOfPointsRhumbLine(c,u,e);c.height=0,u.height=0;const p=rm(d,o,s);_r.ellipsoid.equals(n)||(_r=new nm(void 0,void 0,n)),_r.setEndPoints(c,u);const f=_r.surfaceDistance/d;let g=l;c.height=o;let m=n.cartographicToCartesian(c,mn);pe.pack(m,r,g),g+=3;for(let y=1;y<d;y++){const _=_r.interpolateUsingSurfaceDistance(y*f,Cc);_.height=p[y],m=n.cartographicToCartesian(_,mn),pe.pack(m,r,g),g+=3}return g}ke.wrapLongitude=function(t,i){const e=[],n=[];if(no(t)&&t.length>0){i=i??is.IDENTITY;const o=is.inverseTransformation(i,K_),s=is.multiplyByPoint(o,pe.ZERO,J_),r=pe.normalize(is.multiplyByPointAsVector(o,pe.UNIT_Y,om),om),l=oo.fromPointNormal(s,r,j_),c=pe.normalize(is.multiplyByPointAsVector(o,pe.UNIT_X,sm),sm),u=oo.fromPointNormal(s,c,e1);let d=1;e.push(pe.clone(t[0]));let p=e[0];const f=t.length;for(let g=1;g<f;++g){const m=t[g];if(oo.getPointDistance(u,p)<0||oo.getPointDistance(u,m)<0){const y=Q_.lineSegmentPlane(p,m,l,t1);if(no(y)){const _=pe.multiplyByScalar(r,5e-9,i1);oo.getPointDistance(l,p)<0&&pe.negate(_,_),e.push(pe.add(y,_,new pe)),n.push(d+1),pe.negate(_,_),e.push(pe.add(y,_,new pe)),d=1}}e.push(pe.clone(t[g])),d++,p=m}n.push(d)}return{positions:e,lengths:n}},ke.generateArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new tm("options.positions is required.");const e=i.length,n=t.ellipsoid??im.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const y=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const _=n.geodeticSurfaceNormal(y,mn);pe.multiplyByScalar(_,o,_),pe.add(y,_,y)}return[y.x,y.y,y.z]}let r=t.minDistance;if(!no(r)){const y=t.granularity??cu.RADIANS_PER_DEGREE;r=cu.chordLength(y,n.maximumRadius)}let l=0,c;for(c=0;c<e-1;c++)l+=ke.numberOfPoints(i[c],i[c+1],r);const u=(l+1)*3,d=new Array(u);let p=0;for(c=0;c<e-1;c++){const y=i[c],_=i[c+1],P=s?o[c]:o,C=s?o[c+1]:o;p=o1(y,_,r,n,P,C,d,p)}hu.length=0;const f=i[e-1],g=n.cartesianToCartographic(f,wc);g.height=s?o[e-1]:o;const m=n.cartographicToCartesian(g,mn);return pe.pack(m,d,u-3),d};const am=new ts,r1=new ts;ke.generateRhumbArc=function(t){no(t)||(t={});const i=t.positions;if(!no(i))throw new tm("options.positions is required.");const e=i.length,n=t.ellipsoid??im.WGS84;let o=t.height??0;const s=Array.isArray(o);if(e<1)return[];if(e===1){const P=n.scaleToGeodeticSurface(i[0],uu);if(o=s?o[0]:o,o!==0){const C=n.geodeticSurfaceNormal(P,mn);pe.multiplyByScalar(C,o,C),pe.add(P,C,P)}return[P.x,P.y,P.z]}const r=t.granularity??cu.RADIANS_PER_DEGREE;let l=0,c,u=n.cartesianToCartographic(i[0],am),d;for(c=0;c<e-1;c++)d=n.cartesianToCartographic(i[c+1],r1),l+=ke.numberOfPointsRhumbLine(u,d,r),u=ts.clone(d,am);const p=(l+1)*3,f=new Array(p);let g=0;for(c=0;c<e-1;c++){const P=i[c],C=i[c+1],S=s?o[c]:o,x=s?o[c+1]:o;g=s1(P,C,r,n,S,x,f,g)}hu.length=0;const m=i[e-1],y=n.cartesianToCartographic(m,wc);y.height=s?o[e-1]:o;const _=n.cartographicToCartesian(y,mn);return pe.pack(_,f,p-3),f},ke.generateCartesianArc=function(t){const i=ke.generateArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=pe.unpack(i,o*3);return n},ke.generateCartesianRhumbArc=function(t){const i=ke.generateRhumbArc(t),e=i.length/3,n=new Array(e);for(let o=0;o<e;o++)n[o]=pe.unpack(i,o*3);return n};const _c=h.ArcType,a1=h.Cartesian3,l1=h.Math;function lm(t){const i=t.arcType,e=t.granularity,n=t.ellipsoid,o=[];let s=Y_(t.positions,a1.equalsEpsilon,!1,o);if(!(s.length<2)){if(i===_c.GEODESIC||i===_c.RHUMB){let l;i===_c.GEODESIC?(l=l1.chordLength(e,n.maximumRadius),ke.numberOfPoints):(l=e,ke.numberOfPointsRhumbLine);const c=ke.extractHeights(s,n);i===_c.GEODESIC?s=ke.generateCartesianArc({positions:s,minDistance:l,ellipsoid:n,height:c}):s=ke.generateCartesianRhumbArc({positions:s,granularity:l,ellipsoid:n,height:c})}return s}}function pu(t,i="GEODESIC",e){const o=t.map(a.lbhToXyz).map(p=>h.Cartesian3.fromArray(p));let s;if(e>0&&i!=="NONE"){if(s=lm({arcType:h.ArcType[i??"GEODESIC"],granularity:e,ellipsoid:h.Ellipsoid.WGS84,positions:o}),!s)return}else s=o;let r=0;const l=[0],c=s.length;for(let p=1;p<c;++p)r+=h.Cartesian3.distance(s[p-1],s[p]),l.push(r);const u=s.map(p=>a.xyzToLbh([p.x,p.y,p.z]));return{timePosRots:l.map((p,f)=>[l[f],u[f],void 0]),distances:l}}function cm(t,i){i=i??new Array(16);for(let e=0;e<16;++e)i[e]=t[e];return i}function fu(t,i){const e=h.Matrix4.clone(h.Matrix4.IDENTITY),{position:n,rotation:o,scale:s,initialRotationMode:r="YForwardZUp"}=t;if(n){const[l,c,u]=n;h.Transforms.eastNorthUpToFixedFrame(h.Cartesian3.fromDegrees(l,c,u),void 0,e)}if(o){const l=new h.Quaternion;r==="YForwardZUp"?gc(o,l):r==="XForwardZUp"&&Ug(o,l);const c=h.Matrix3.fromQuaternion(l);h.Matrix4.multiply(e,h.Matrix4.fromRotationTranslation(c),e)}return s&&h.Matrix4.multiplyByScale(e,ui(s),e),cm(e,i)}const c1=new h.Matrix4;function hm(t,i){const e=h.Matrix4.fromArray(t,0,c1);return h.Matrix4.inverse(e,e),cm(e,i)}const h1=new h.Matrix4,u1=new h.Cartesian3;function um(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromDegrees(n,o,s,void 0,u1),l=h.Matrix4.fromArray(t,0,h1),c=h.Matrix4.multiplyByPoint(l,r,r),{x:u,y:d,z:p}=c;return e=e||[0,0,0],e[0]=u,e[1]=d,e[2]=p,e}const d1=new h.Matrix4,p1=new h.Cartesian3,f1=new h.Cartographic;function vn(t,i,e){const[n,o,s]=i,r=h.Cartesian3.fromElements(n,o,s,p1),l=h.Matrix4.fromArray(t,0,d1),c=h.Matrix4.multiplyByPoint(l,r,r),u=h.Cartographic.fromCartesian(c,void 0,f1);return e=e||[0,0,0],e[0]=h.Math.toDegrees(u.longitude),e[1]=h.Math.toDegrees(u.latitude),e[2]=u.height,e}function It(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s}),l=hm(r);return[i.map(u=>um(l,u)),r,l]}function yn(t,i){const{originPosition:e,originRotation:n,originScale:o,initialRotationMode:s}=t,r=fu({position:e,rotation:n,scale:o,initialRotationMode:s});return[i.map(c=>vn(r,c)),r]}function dm(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let i=[];for(let e=0;e<t.length-2;e++){const n=ye.Cartesian3.fromDegrees(...t[e]),o=ye.Cartesian3.fromDegrees(...t[e+1]),s=ye.Cartesian3.fromDegrees(...t[e+2]),r=ye.Cartesian3.angleBetween(ye.Cartesian3.subtract(n,o,new ye.Cartesian3),ye.Cartesian3.subtract(s,o,new ye.Cartesian3));i.push(isNaN(r)?0:ye.Math.toDegrees(r))}return i}function gu(t,i){let e=i||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(n=>re(n)))),t.holes&&t.holes.forEach(n=>{e=gu(n,e)}),e}function Ht(t){return typeof t=="string"?a.ESSceneObject.context.getStrFromEnv(t):new h.Resource({url:a.ESSceneObject.context.getStrFromEnv(t.url),headers:t.headers,queryParameters:t.queryParameters,templateValues:t.templateValues,proxy:t.proxy,retryCallback:t.retryCallback,retryAttempts:t.retryAttempts,request:t.request,parseUrl:t.parseUrl})}class mu extends a.Destroyable{constructor(i,e,n,o){if(super(),!i.viewer)return;const{scene:s}=i.viewer,[r,l,c]=a.getReactFuncs(e),[u,d,p]=a.getReactFuncs(n),f=new h.Cartesian3,g=()=>{let m=r();m&&(m=[...m],i.editingHeightOffset&&(m[2]-=i.editingHeightOffset),h.Cartesian3.fromDegrees(...m,void 0,f))};g(),this.dispose(c.disposableOn(g)),this.dispose(s.preUpdate.addEventListener(()=>{if(h.Cartesian3.ZERO.equals(f))return;const m=Wi(s,f,o);m!==void 0?d([m,m,m]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${m??"undefined"}`)}))}}function g1(t){const i=Reflect.has(t.root,"transform")?t.root.transform:h.Matrix4.toArray(h.Matrix4.IDENTITY);let e,n,o,s;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))s=h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new h.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];s=h.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=h.Cartesian3.add(s,h.Cartesian3.fromArray([f,0,0]),new h.Cartesian3),n=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,f,0]),new h.Cartesian3),o=h.Cartesian3.add(s,h.Cartesian3.fromArray([0,0,f]),new h.Cartesian3)}if(!e||!n||!o||!s)return"无法生成包围盒,请检查包围盒是否正确";let r,l,c,u,d,p;return h.Matrix4.IDENTITY.equals(h.Matrix4.fromArray(i))?(r=re(e),u=re(h.Cartesian3.add(s,h.Cartesian3.subtract(s,e,new h.Cartesian3),new h.Cartesian3)),l=re(n),d=re(h.Cartesian3.add(s,h.Cartesian3.subtract(s,n,new h.Cartesian3),new h.Cartesian3)),c=re(o),p=re(h.Cartesian3.add(s,h.Cartesian3.subtract(s,o,new h.Cartesian3),new h.Cartesian3))):(r=vn(i,[e.x,e.y,e.z]),u=vn(i,[-e.x,-e.y,-e.z]),l=vn(i,[n.x,n.y,n.z]),d=vn(i,[-n.x,-n.y,-n.z]),c=vn(i,[o.x,o.y,o.z]),p=vn(i,[-o.x,-o.y,-o.z])),!r||!u||!l||!d||!c||!p?"无法生成包围盒,请检查包围盒是否正确":[h.Math.toRadians(Math.min(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.min(r[1],u[1],l[1],d[1],c[1],p[1])),h.Math.toRadians(Math.max(r[0],u[0],l[0],d[0],c[0],p[0])),h.Math.toRadians(Math.max(r[1],u[1],l[1],d[1],c[1],p[1])),Math.min(r[2],u[2],l[2],d[2],c[2],p[2]),Math.max(r[2],u[2],l[2],d[2],c[2],p[2])]}const pm=a.createProcessingFromAsyncFunc(async(t,i)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},n={},o=[];if(await a.step(t,async c=>new Promise(async(u,d)=>{for(let p=0;p<i.length;p++){const f=i[p];await fetch(f).then(g=>g.json()).then(g=>{g&&!Reflect.has(g,"success")?n[f]=g:o.push({index:p,url:f,message:g.message}),p==i.length-1&&u()}).catch(g=>{o.push({index:p,url:f,message:g}),p==i.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==i.length))return e.tilesUrl=void 0,e;const s=[],r=[],l=[];for(const c in n){const u=n[c];r.push(u.geometricError??u.root.geometricError??0);const d=g1(u);s.push(d),l.push({content:{uri:c},boundingVolume:{region:d},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...r),e.tilesUrl.root.boundingVolume.region=[Math.min(...s.map(c=>c[0])),Math.min(...s.map(c=>c[1])),Math.max(...s.map(c=>c[2])),Math.max(...s.map(c=>c[3])),Math.min(...s.map(c=>c[4])),Math.max(...s.map(c=>c[5]))],e.tilesUrl.root.children=l),e});function m1(t){return new Promise((i,e)=>{pm.restart(void 0,t),pm.completeEvent.don(n=>{i(n)})})}class vu extends a.Destroyable{constructor(e){super();v(this,"_center",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_radius",this.disposeVar(a.react(0)));const[n,o,s]=a.getReactFuncs(e);{const r=()=>{const l=n();if(l){const{center:c,minPos:u,maxPos:d}=a.getMinMaxCorner(l);this._center.value=c,this._radius.value=a.geoDistance(u,d)/2}else this._center.value=void 0};r(),this.dispose(s.disposableOn(r))}}get centerReact(){return this._center}get center(){return this._center.value}get centerChanged(){return this._center.changed}get radiusReact(){return this._radius}get radius(){return this._radius.value}get radiusChanged(){return this._radius.changed}}function fm(t){return new h.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new h.Color(.2,.3,.6,1),blendColor:new h.Color(0,1,.699,1),specularMap:h.Material.DefaultImageId,normalMap:h.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
2
2
  // http://29a.ch/2012/7/19/webgl-terrain-rendering-water-fog
3
3
 
4
4
  uniform sampler2D specularMap;
@@ -634,7 +634,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
634
634
  out_FragColor = imageColor * u_color;
635
635
  out_FragColor.a *= smoothstep(1., 0.8, v_st.t);
636
636
  }
637
- `,r.pass="TRANSLUCENT",r.renderState=Zd,r.allowPickingDepth=!1,this.dispose(a.track([o,"show"],[this,"show"])),this.dispose(a.track([s,"show"],[this,"show"])),this.dispose(a.track([r,"show"],[this,"show"])),this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([s,"position"],[this,"position"])),this.dispose(a.track([r,"position"],[this,"position"])),this.dispose(a.track([o,"rotation"],[this,"rotation"])),this.dispose(a.track([s,"rotation"],[this,"rotation"])),this.dispose(a.track([r,"rotation"],[this,"rotation"])),this.dispose(a.track([o,"scale"],[this,"scale"])),this.dispose(a.track([s,"scale"],[this,"scale"])),this.dispose(a.track([r,"scale"],[this,"scale"]));{const l={type:"image",uri:Fa.defaultParticlesImageUri},c=()=>{o.uniformMap={u_color:this.color??[1,1,0,2]},s.uniformMap={u_color:this.color??[1,1,0,2]},r.uniformMap={u_color:this.color??[1,1,0,2],u_image:l}};c(),this.dispose(this.colorChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(l=>{s.flyTo(l)})),this.dispose(a.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get circleCustomPrimitive(){return this._circleCustomPrimitive}get cylinderCustomPrimitive(){return this._cylinderCustomPrimitive}get cylinderParticlesCustomPrimitive(){return this._cylinderParticlesCustomPrimitive}};v(Fa,"defaultParticlesImageUri","${earthsdk3-assets-script-dir}/assets/img/particles.png");let Eo=Fa;(t=>{t.createDefaultProps=()=>({show:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),scale:a.reactArrayWithUndefined(void 0),color:a.reactArrayWithUndefined(void 0),allowPicking:void 0})})(Eo||(Eo={})),a.extendClassProps(Eo.prototype,Eo.createDefaultProps);const za=class za extends fe{constructor(e,n){super(e,n);v(this,"_czmCityBasePoint");if(this._czmCityBasePoint=this.disposeVar(new Eo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCityBasePoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Ke([s,"rotation"],[e,"rotation"]))}get czmCityBasePoint(){return this._czmCityBasePoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCityBasePoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r.cylinderCustomPrimitive,!0),!0):!1}};v(za,"type",za.register("ESCesiumViewer",a.ESCityBasePoint.type,za));let Qd=za;class xo extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.colorChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,this.classificationTypeChanged));this.disposeVar(new a.ObjResettingWithEvent(s,()=>{if(this.polygonHierarchy)return new rA(this,e)}));const r=new h.BoundingSphere;{const l=()=>{if(!this.polygonHierarchy)return;const c=ut(this.polygonHierarchy.positions);if(c.length<3){r.radius=-1;return}h.BoundingSphere.fromPoints(c,r)};l(),this.polygonHierarchyChanged.disposableOn(l)}this.dispose(this.flyToEvent.disposableOn(l=>{if(e.actived&&r.radius>0){const c=re(r.center);c&&ne(o,c,r.radius*4,void 0,l)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(xo,"defaults",{color:[1,1,1,.5]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,color:a.reactArrayWithUndefined(void 0),stRotation:void 0,polygonHierarchy:a.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0,classificationType:"BOTH"})})(xo||(xo={})),a.extendClassProps(xo.prototype,xo.createDefaultProps);class rA extends a.HasOwner{constructor(i,e){if(super(i),!e)throw new Error("!czmViewer");const n=this.owner;if(!n.polygonHierarchy)throw new Error("polygonHierarchy is required");const o=[],s=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Gi(n.polygonHierarchy),stRotation:n.stRotation&&h.Math.toRadians(n.stRotation),arcType:n.arcType&&h.ArcType[n.arcType],height:n.height,extrudedHeight:n.extrudedHeight,perPositionHeight:n.perPositionHeight,closeTop:n.closeTop,closeBottom:n.closeBottom,ellipsoid:n.ellipsoid&&we(n.ellipsoid),granularity:n.granularity!==void 0?h.Math.toRadians(n.granularity):void 0}),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(...n.color??xo.defaults.color)),show:new h.ShowGeometryInstanceAttribute(!0)},id:this});o.push(s);const r=new h.ClassificationPrimitive({geometryInstances:o,asynchronous:!1,allowPicking:n.allowPicking,compressVertices:!1,classificationType:dt.classificationTypeMap[n.classificationType]});h.ClassificationPrimitive.prototype&&(r.ESSceneObjectID=i.id);{if(!e)throw new Error("!this.owner.czmViewer");const{viewer:l}=e;if(!l)throw new Error("!czmViewer.viewer");l.scene.primitives.add(r),this.dispose(()=>l.scene.primitives.remove(r))}{const l=()=>{r.show=n.show??!0};l(),this.dispose(n.showChanged.disposableOn(l))}}}class aA extends a.Destroyable{constructor(e,n){super();v(this,"_czmClassificationPolygonPrimitive");this._czmClassificationPolygonPrimitive=this.disposeVar(new xo(n,e.id));const o=this._czmClassificationPolygonPrimitive;{const s=()=>{const l=e.show,c=e.fill;if(o.show=l&&c,e.positions&&e.positions.length>0?o.height=e.positions[0][2]:o.height=void 0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.color=e.color,e.depth===void 0)throw new Error("sceneObject.depth === undefined");o.extrudedHeight=(o.height??0)+e.depth,o.classificationType=e.classificationType};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.classificationTypeChanged));this.dispose(r.disposableOn(s))}this.dispose(e.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(a.track([o,"allowPicking"],[e,"allowPicking"]))}}class zs extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_helperPolygon");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);{const o=this.disposeVar(new Sn(e,n));this._helperPolygon=o,this.dispose(a.track([o,"show"],[this,"showHelper"],s=>s));{const s=()=>{o.show=this.showHelper};s(),this.dispose(this.showHelperChanged.disposableOn(s))}this.dispose(a.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([o,"outline"],[this,"outline"])),this.dispose(a.track([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.track([o,"outlineWidth"],[this,"outlineWidth"])),o.fill=!1,o.color=[0,0,0,0],this.dispose(a.track([o,"positions"],[this,"positions"])),this.dispose(a.track([o,"depth"],[this,"depth"])),this.dispose(a.track([o,"zIndex"],[this,"zIndex"]))}this.disposeVar(new a.ObjResettingWithEvent(this.depthChanged,()=>{if(!(this.depth===void 0||this.depth<0))return new aA(this,e)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get helperPolygon(){return this._helperPolygon}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(zs,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,showHelper:!1,allowPicking:!1,classificationType:"BOTH",outline:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:a.reactArray([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0,zIndex:0})})(zs||(zs={})),a.extendClassProps(zs.prototype,zs.createDefaultProps);const La=class La extends vt{constructor(e,n){super(e,n);v(this,"_polygon");if(this._polygon=this.disposeVar(new zs(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._polygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"depth"],[e,"height"])),this.dispose(a.track([s,"showHelper"],[e,"stroked"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fill"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"]))}get polygon(){return this._polygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,polygon: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,polygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(La,"type",La.register("ESCesiumViewer",a.ESClassification.type,La));let kd=La;const lA=[{id:"document",version:"1.0"},{id:"Vehicle",availability:"2012-08-04T16:00:00Z/2012-08-04T16:14:15.251Z",billboard:{eyeOffset:{cartesian:[0,0,0]},horizontalOrigin:"CENTER",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAEISURBVEhLvVXBDYQwDOuojHKj8LhBbpTbpBCEkZsmIVTXq1RVQGrHiWlLmTTqPiZBlyLgy/KSZQ5JSHDQ/mCYCsC8106kDU0AdwRnvYZArWRcAl0dcYJq1hWCb3hBrumbDAVMwAC82WoRvgMnVMDBnB0nYZFTbE6BBvdUGqVqCbjBIk3PyFFR/NU7EKzru+qZsau3ryPwwCRLKYOzutZuCL6fUmWeJGzNzL/RxAMrUmASSCkkAayk2IxPlwhAAYGpsiHQjbLccfdOY5gKkCXAMi7SscAwbQpAnKyctWyUZ6z8ja3OGMepwD8asz+9FnSvbhU8uVOHFIwQsI3/p0CfhuqCSQuxLqsN6mu8SS+N42MAAAAASUVORK5CYII=",pixelOffset:{cartesian2:[0,0]},scale:.8333333333333334,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],verticalOrigin:"BOTTOM"},label:{fillColor:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}],font:"bold 10pt Segoe UI Semibold",horizontalOrigin:"LEFT",outlineColor:{rgba:[0,0,0,255]},pixelOffset:{cartesian2:[10,0]},scale:1,show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}],style:"FILL",text:"Vehicle",verticalOrigin:"CENTER"},path:{material:{solidColor:{color:{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",rgba:[255,255,0,255]}}},width:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",number:5}],show:[{interval:"2012-08-04T16:00:00Z/2012-08-04T18:00:00Z",boolean:!0}]},position:{interpolationAlgorithm:"LAGRANGE",interpolationDegree:1,epoch:"2012-08-04T16:00:00Z",cartesian:[0,-23797546637012e-7,-466533288013588e-8,362813368924173e-8,100,-237951008905552e-8,-466541964840452e-8,362818220006795e-8,200,-23795684769522e-7,-46655553441867e-7,362797083323261e-8,300,-237963893786855e-8,-466569163561896e-8,362775082085873e-8,400,-237970929834665e-8,-46658279679646e-7,362753080187124e-8,500,-237983728064915e-8,-46658477494347e-7,362742212874017e-8,600,-237962498289073e-8,-466590750853722e-8,36274841191848e-7,700,-237938612743523e-8,-466602954174431e-8,362748383297459e-8,800,-237914726777171e-8,-466615156669944e-8,36274835403492e-7,900,-237890840390057e-8,-466627358340244e-8,362748324130864e-8,1e3]}}],cA=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
637
+ `,r.pass="TRANSLUCENT",r.renderState=Zd,r.allowPickingDepth=!1,this.dispose(a.track([o,"show"],[this,"show"])),this.dispose(a.track([s,"show"],[this,"show"])),this.dispose(a.track([r,"show"],[this,"show"])),this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([s,"position"],[this,"position"])),this.dispose(a.track([r,"position"],[this,"position"])),this.dispose(a.track([o,"rotation"],[this,"rotation"])),this.dispose(a.track([s,"rotation"],[this,"rotation"])),this.dispose(a.track([r,"rotation"],[this,"rotation"])),this.dispose(a.track([o,"scale"],[this,"scale"])),this.dispose(a.track([s,"scale"],[this,"scale"])),this.dispose(a.track([r,"scale"],[this,"scale"]));{const l={type:"image",uri:Fa.defaultParticlesImageUri},c=()=>{o.uniformMap={u_color:this.color??[1,1,0,2]},s.uniformMap={u_color:this.color??[1,1,0,2]},r.uniformMap={u_color:this.color??[1,1,0,2],u_image:l}};c(),this.dispose(this.colorChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(l=>{s.flyTo(l)})),this.dispose(a.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([s,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"]))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get circleCustomPrimitive(){return this._circleCustomPrimitive}get cylinderCustomPrimitive(){return this._cylinderCustomPrimitive}get cylinderParticlesCustomPrimitive(){return this._cylinderParticlesCustomPrimitive}};v(Fa,"defaultParticlesImageUri","${earthsdk3-assets-script-dir}/assets/img/particles.png");let Eo=Fa;(t=>{t.createDefaultProps=()=>({show:void 0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),scale:a.reactArrayWithUndefined(void 0),color:a.reactArrayWithUndefined(void 0),allowPicking:void 0})})(Eo||(Eo={})),a.extendClassProps(Eo.prototype,Eo.createDefaultProps);const za=class za extends fe{constructor(e,n){super(e,n);v(this,"_czmCityBasePoint");if(this._czmCityBasePoint=this.disposeVar(new Eo(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCityBasePoint;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Ke([s,"rotation"],[e,"rotation"]))}get czmCityBasePoint(){return this._czmCityBasePoint}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCityBasePoint:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r.cylinderCustomPrimitive,!0),!0):!1}};v(za,"type",za.register("ESCesiumViewer",a.ESCityBasePoint.type,za));let Qd=za;class xo extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.polygonHierarchyChanged,this.colorChanged,this.stRotationChanged,this.arcTypeChanged,this.heightChanged,this.extrudedHeightChanged,this.perPositionHeightChanged,this.closeTopChanged,this.closeBottomChanged,this.ellipsoidChanged,this.granularityChanged,this.allowPickingChanged,this.classificationTypeChanged));this.disposeVar(new a.ObjResettingWithEvent(s,()=>{if(this.polygonHierarchy)return new rA(this,e)}));const r=new h.BoundingSphere;{const l=()=>{if(!this.polygonHierarchy)return;const c=ut(this.polygonHierarchy.positions);if(c.length<3){r.radius=-1;return}h.BoundingSphere.fromPoints(c,r)};l(),this.polygonHierarchyChanged.disposableOn(l)}this.dispose(this.flyToEvent.disposableOn(l=>{if(e.actived&&r.radius>0){const c=re(r.center);c&&ne(o,c,r.radius*4,void 0,l)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(xo,"defaults",{color:[1,1,1,.5]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,color:a.reactArrayWithUndefined(void 0),stRotation:void 0,polygonHierarchy:a.reactJson({positions:[]}),height:void 0,extrudedHeight:void 0,ellipsoid:void 0,granularity:void 0,perPositionHeight:void 0,closeTop:void 0,closeBottom:void 0,classificationType:"BOTH"})})(xo||(xo={})),a.extendClassProps(xo.prototype,xo.createDefaultProps);class rA extends a.HasOwner{constructor(i,e){if(super(i),!e)throw new Error("!czmViewer");const n=this.owner;if(!n.polygonHierarchy)throw new Error("polygonHierarchy is required");const o=[],s=new h.GeometryInstance({geometry:new h.PolygonGeometry({vertexFormat:h.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Gi(n.polygonHierarchy),stRotation:n.stRotation&&h.Math.toRadians(n.stRotation),arcType:n.arcType&&h.ArcType[n.arcType],height:n.height,extrudedHeight:n.extrudedHeight,perPositionHeight:n.perPositionHeight,closeTop:n.closeTop,closeBottom:n.closeBottom,ellipsoid:n.ellipsoid&&we(n.ellipsoid),granularity:n.granularity!==void 0?h.Math.toRadians(n.granularity):void 0}),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(...n.color??xo.defaults.color)),show:new h.ShowGeometryInstanceAttribute(!0)},id:this});o.push(s);const r=new h.ClassificationPrimitive({geometryInstances:o,asynchronous:!1,allowPicking:n.allowPicking,compressVertices:!1,classificationType:dt.classificationTypeMap[n.classificationType]});h.ClassificationPrimitive.prototype&&(r.ESSceneObjectID=i.id);{if(!e)throw new Error("!this.owner.czmViewer");const{viewer:l}=e;if(!l)throw new Error("!czmViewer.viewer");l.scene.primitives.add(r),this.dispose(()=>l.scene.primitives.remove(r))}{const l=()=>{r.show=n.show??!0};l(),this.dispose(n.showChanged.disposableOn(l))}}}class aA extends a.Destroyable{constructor(e,n){super();v(this,"_czmClassificationPolygonPrimitive");this._czmClassificationPolygonPrimitive=this.disposeVar(new xo(n,e.id));const o=this._czmClassificationPolygonPrimitive;{const s=()=>{const l=e.show,c=e.fill;if(o.show=l&&c,e.positions&&e.positions.length>0?o.height=e.positions[0][2]:o.height=void 0,o.polygonHierarchy=o.show?{positions:e.positions||[]}:{positions:[]},o.color=e.color,e.depth===void 0)throw new Error("sceneObject.depth === undefined");o.extrudedHeight=(o.height??0)+e.depth,o.classificationType=e.classificationType};s();const r=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.classificationTypeChanged));this.dispose(r.disposableOn(s))}this.dispose(e.flyToEvent.disposableOn(s=>{o.flyTo(s)})),this.dispose(a.track([o,"allowPicking"],[e,"allowPicking"]))}}class zs extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_helperPolygon");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);{const o=this.disposeVar(new Sn(e,n));this._helperPolygon=o,this.dispose(a.track([o,"show"],[this,"showHelper"],s=>s));{const s=()=>{o.show=this.showHelper};s(),this.dispose(this.showHelperChanged.disposableOn(s))}this.dispose(a.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(a.track([o,"outline"],[this,"outline"])),this.dispose(a.track([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.track([o,"outlineWidth"],[this,"outlineWidth"])),o.fill=!1,o.color=[0,0,0,0],this.dispose(a.track([o,"positions"],[this,"positions"])),this.dispose(a.track([o,"depth"],[this,"depth"])),this.dispose(a.track([o,"zIndex"],[this,"zIndex"]))}this.disposeVar(new a.ObjResettingWithEvent(this.depthChanged,()=>{if(!(this.depth===void 0||this.depth<0))return new aA(this,e)}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get helperPolygon(){return this._helperPolygon}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(zs,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,showHelper:!1,allowPicking:!1,classificationType:"BOTH",outline:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:a.reactArray([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0,zIndex:0})})(zs||(zs={})),a.extendClassProps(zs.prototype,zs.createDefaultProps);const La=class La extends vt{constructor(e,n){super(e,n);v(this,"_polygon");if(this._polygon=this.disposeVar(new zs(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._polygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"depth"],[e,"height"])),this.dispose(a.track([s,"showHelper"],[e,"stroked"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fill"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"]))}get polygon(){return this._polygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,polygon: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,polygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(La,"type",La.register("ESCesiumViewer",a.ESClassification.type,La));let kd=La;const lA=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
638
638
  \`\`\`
639
639
  [{
640
640
  "id": "document",
@@ -704,12 +704,12 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
704
704
  }
705
705
  }
706
706
  }
707
- `,hA=`data 路径都可以使用下面回调函数
707
+ `,cA=`data 路径都可以使用下面回调函数
708
708
  \`\`\`
709
709
  ${Cy}
710
710
  \`\`\`
711
711
 
712
- `,_y=Date.now();new Date(_y).toISOString(),new Date(_y+24*60*60*1e3).toISOString();const Oa=class Oa extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));v(this,"_clock");v(this,"_resetClockEvent",this.disposeVar(new a.Event));v(this,"_dataSource",this.disposeVar(a.react(void 0)));this._clock=this.disposeVar(new ae(e)),this.dispose(a.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(a.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(a.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(a.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(a.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(a.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(a.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&this.dataSource&&(u!==void 0?o.flyTo(this.dataSource,{duration:u/1e3}):o.flyTo(this.dataSource))}));const s=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(s);const r=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:u}=this;this.startTime=h.JulianDate.toDate(u.clock.startTime).getTime(),this.stopTime=h.JulianDate.toDate(u.clock.stopTime).getTime(),this.currentTime=h.JulianDate.toDate(u.clock.currentTime).getTime(),this.multiplier=u.clock.multiplier,this.clockStep=ae.getClockStep(u.clock.clockStep),this.clockRange=ae.getClockRange(u.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(r));const l=()=>{this.dataSource&&(this.dataSource.show=this.show??Oa.defaults.show)};l(),this.dispose(this.showChanged.disposableOn(l));const c=this.disposeVar(a.react(void 0));{const u=()=>{var f;if(this.uri)if(this.uri&&typeof this.uri!="string")(f=h.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||f.then(g=>g);else return a.ESSceneObject.context.getStrFromEnv(this.uri)},d=()=>{c.value=this.data??u()};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.dispose(p.disposableOn(d))}{const u=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{if(s(),!c.value)return;let g;try{g=await h.CzmlDataSource.load(c.value)}catch(m){console.error(`加载czml错误:${m}`),console.error(m)}if(g&&(f.check(),g.entities.values.forEach(m=>{h.Entity.prototype&&(g.ESSceneObjectID=n)}),o.dataSources.add(g),this._dataSource.value=g,l(),(this.autoResetClock??Oa.defaults.autoResetClock)&&r(),!!this.loadFun))try{this.loadFun(g)}catch(m){console.error(m)}})),d=()=>{u.isRunning&&u.cancel(),u.restart()};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(c.changed,this.loadFunChanged));this.dispose(p.disposableOn(d))}{const u=()=>{if(this.loadFuncStr)try{const d=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=d}catch(d){console.error(d),this.loadFun=void 0}else this.loadFun=void 0};u(),this.dispose(this.loadFuncStrChanged.disposableOn(u))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};v(Oa,"defaults",{show:!0,allowPicking:!0,data:lA,dataMd:cA,autoResetClock:!0,clockEnabled:!1,startTime:ae.defaults.startTime,stopTime:ae.defaults.stopTime,currentTime:ae.defaults.currentTime,multiplier:ae.defaults.multiplier,clockStep:ae.defaults.clockStep,clockRange:ae.defaults.clockRange,shouldAnimate:ae.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:Cy,defaultLoadFuncDocStr:hA});let Ao=Oa;(t=>{t.createDefaultProps=()=>({show:void 0,uri:void 0,allowPicking:void 0,data:a.reactJsonWithUndefined(void 0),autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,loadFuncStr:void 0})})(Ao||(Ao={})),a.extendClassProps(Ao.prototype,Ao.createDefaultProps);const Na=class Na extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Ao(e,i.id));this.dispose(a.track([o,"show"],[i,"show"])),this.dispose(a.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([o,"data"],[i,"data"])),this.dispose(a.bind([o,"uri"],[i,"uri"])),this.dispose(a.bind([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(a.bind([o,"autoResetClock"],[i,"autoResetClock"])),this.dispose(a.bind([o,"clockEnabled"],[i,"clockEnabled"])),this.dispose(a.bind([o,"startTime"],[i,"startTime"])),this.dispose(a.bind([o,"stopTime"],[i,"stopTime"])),this.dispose(a.bind([o,"currentTime"],[i,"currentTime"])),this.dispose(a.bind([o,"multiplier"],[i,"multiplier"])),this.dispose(a.bind([o,"clockStep"],[i,"clockStep"])),this.dispose(a.bind([o,"clockRange"],[i,"clockRange"])),this.dispose(a.bind([o,"shouldAnimate"],[i,"shouldAnimate"])),this.dispose(i.flyToEvent.disposableOn(s=>{e.actived&&o.flyTo(s)}))}};v(Na,"type",Na.register("ESCesiumViewer",a.ESCzml.type,Na));let Kd=Na;async function uA(t,i){const e=a.fetchArrayBuffer(t+"index.bin"),n=a.fetchArrayBuffer(t+"vertex.bin"),o=[...new Array(i).keys()].map(p=>p.toString().padStart(6,"0")).map(p=>`${t}bins/R2DC${p}.bin`).map(p=>a.fetchArrayBuffer(p)),s=await Promise.all([e,n,...o]);if(s.some(p=>p===void 0)){console.warn("有数据未能解析!");return}const[r,...l]=s,c=new Uint16Array(r),[u,...d]=l.map(p=>new Float32Array(p));return{indexBuffer:c,vertexBuffer:u,propBuffers:d}}function*dA(t){const e=t.length/3|0;for(let n=0;n<e;++n)yield[t[n*3+0],t[n*3+1],t[n*3+2]]}const Ba=class Ba extends fe{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");v(this,"_czmTexture");if(this._czmCustomPrimitive=this.disposeVar(new De(n,e.id)),this._czmTexture=this.ad(new ze(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:s}=this,{czmTexture:r}=this;{r.uri="",r.size=[1024,1],r.enabled=!0;const c=new a.ColorStops,u=()=>{c.value=e.colorStops??a.ESDataMesh.defaults.colorStops;const d=c.getColorsInUint8(new Uint8Array(1024*4));r.copyTexture({source:{width:1024,height:1,arrayBufferView:d}})};u(),this.dispose(e.colorStopsChanged.disposableOn(u))}this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),s.cull=!1,s.vertexShaderSource=`
712
+ `,_y=Date.now();new Date(_y).toISOString(),new Date(_y+24*60*60*1e3).toISOString();const Oa=class Oa extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));v(this,"_clock");v(this,"_resetClockEvent",this.disposeVar(new a.Event));v(this,"_dataSource",this.disposeVar(a.react(void 0)));this._clock=this.disposeVar(new ae(e)),this.dispose(a.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(a.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(a.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(a.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(a.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(a.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(a.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this.dispose(this.flyToEvent.disposableOn(u=>{e.actived&&this.dataSource&&(u!==void 0?o.flyTo(this.dataSource,{duration:u/1e3}):o.flyTo(this.dataSource))}));const s=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(s);const r=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:u}=this;this.startTime=h.JulianDate.toDate(u.clock.startTime).getTime(),this.stopTime=h.JulianDate.toDate(u.clock.stopTime).getTime(),this.currentTime=h.JulianDate.toDate(u.clock.currentTime).getTime(),this.multiplier=u.clock.multiplier,this.clockStep=ae.getClockStep(u.clock.clockStep),this.clockRange=ae.getClockRange(u.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(r));const l=()=>{this.dataSource&&(this.dataSource.show=this.show??Oa.defaults.show)};l(),this.dispose(this.showChanged.disposableOn(l));const c=this.disposeVar(a.react(void 0));{const u=()=>{var f;if(!(!this.uri||Array.isArray(this.uri)))if(this.uri&&typeof this.uri!="string")(f=h.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||f.then(g=>g);else return a.ESSceneObject.context.getStrFromEnv(this.uri)},d=()=>{c.value=Array.isArray(this.uri)?this.uri:u()};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(this.uriChanged));this.dispose(p.disposableOn(d))}{const u=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{if(s(),!c.value)return;let g;try{g=await h.CzmlDataSource.load(c.value)}catch(m){console.error(`加载czml错误:${m}`),console.error(m)}if(g&&(f.check(),g.entities.values.forEach(m=>{h.Entity.prototype&&(g.ESSceneObjectID=n)}),o.dataSources.add(g),this._dataSource.value=g,l(),(this.autoResetClock??Oa.defaults.autoResetClock)&&r(),!!this.loadFun))try{this.loadFun(g)}catch(m){console.error(m)}})),d=()=>{u.isRunning&&u.cancel(),u.restart()};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(c.changed,this.loadFunChanged));this.dispose(p.disposableOn(d))}{const u=()=>{if(this.loadFuncStr)try{const d=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=d}catch(d){console.error(d),this.loadFun=void 0}else this.loadFun=void 0};u(),this.dispose(this.loadFuncStrChanged.disposableOn(u))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};v(Oa,"defaults",{show:!0,allowPicking:!0,dataMd:lA,autoResetClock:!0,clockEnabled:!1,startTime:ae.defaults.startTime,stopTime:ae.defaults.stopTime,currentTime:ae.defaults.currentTime,multiplier:ae.defaults.multiplier,clockStep:ae.defaults.clockStep,clockRange:ae.defaults.clockRange,shouldAnimate:ae.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:Cy,defaultLoadFuncDocStr:cA});let Ao=Oa;(t=>{t.createDefaultProps=()=>({show:void 0,uri:void 0,allowPicking:void 0,autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,loadFuncStr:void 0})})(Ao||(Ao={})),a.extendClassProps(Ao.prototype,Ao.createDefaultProps);const Na=class Na extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Ao(e,i.id));this.dispose(a.track([o,"show"],[i,"show"])),this.dispose(a.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([o,"uri"],[i,"url"])),this.dispose(a.bind([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(a.bind([o,"autoResetClock"],[i,"autoResetClock"])),this.dispose(a.bind([o,"clockEnabled"],[i,"clockEnabled"])),this.dispose(a.bind([o,"startTime"],[i,"startTime"])),this.dispose(a.bind([o,"stopTime"],[i,"stopTime"])),this.dispose(a.bind([o,"currentTime"],[i,"currentTime"])),this.dispose(a.bind([o,"multiplier"],[i,"multiplier"])),this.dispose(a.bind([o,"clockStep"],[i,"clockStep"])),this.dispose(a.bind([o,"clockRange"],[i,"clockRange"])),this.dispose(a.bind([o,"shouldAnimate"],[i,"shouldAnimate"])),this.dispose(i.flyToEvent.disposableOn(s=>{e.actived&&o.flyTo(s)}))}};v(Na,"type",Na.register("ESCesiumViewer",a.ESCzml.type,Na));let Kd=Na;async function hA(t,i){const e=a.fetchArrayBuffer(t+"index.bin"),n=a.fetchArrayBuffer(t+"vertex.bin"),o=[...new Array(i).keys()].map(p=>p.toString().padStart(6,"0")).map(p=>`${t}bins/R2DC${p}.bin`).map(p=>a.fetchArrayBuffer(p)),s=await Promise.all([e,n,...o]);if(s.some(p=>p===void 0)){console.warn("有数据未能解析!");return}const[r,...l]=s,c=new Uint16Array(r),[u,...d]=l.map(p=>new Float32Array(p));return{indexBuffer:c,vertexBuffer:u,propBuffers:d}}function*uA(t){const e=t.length/3|0;for(let n=0;n<e;++n)yield[t[n*3+0],t[n*3+1],t[n*3+2]]}const Ba=class Ba extends fe{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");v(this,"_czmTexture");if(this._czmCustomPrimitive=this.disposeVar(new De(n,e.id)),this._czmTexture=this.ad(new ze(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:s}=this,{czmTexture:r}=this;{r.uri="",r.size=[1024,1],r.enabled=!0;const c=new a.ColorStops,u=()=>{c.value=e.colorStops??a.ESDataMesh.defaults.colorStops;const d=c.getColorsInUint8(new Uint8Array(1024*4));r.copyTexture({source:{width:1024,height:1,arrayBufferView:d}})};u(),this.dispose(e.colorStopsChanged.disposableOn(u))}this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),s.cull=!1,s.vertexShaderSource=`
713
713
  precision highp float;
714
714
  in vec3 a_position;
715
715
  in vec3 a_prop;
@@ -739,7 +739,7 @@ ${Cy}
739
739
  // out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
740
740
  out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
741
741
  }
742
- `,s.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let l=this.disposeVar(a.react(void 0));{const c=this.disposeVar(a.createProcessingFromAsyncFunc(async d=>{l.value=void 0;const p=e.url??a.ESDataMesh.defaults.url;if(!p)return;await d.promise(a.sleep(200));const f=(e.maxTime??23)|0;l.value=await d.promise(uA(a.ESSceneObject.context.getStrFromEnv(typeof p=="string"?p:p.url),f+1))}));c.start();const u=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>c.restart()))}{class c{constructor(p){this._buffer=p}[Symbol.iterator](){return dA(this._buffer)}}const u=()=>{if(!l.value)return;const{vertexBuffer:d,propBuffers:p,indexBuffer:f}=l.value,{minPos:g,maxPos:m}=a.getMinMaxCorner(new c(d));s.setLocalAxisedBoundingBox(g,m);const y=(e.maxTime??23)|0;let _=(e.currentTime??a.ESDataMesh.defaults.currentTime)/y;_=_<0?0:_>1?1:_;const P=_*y;let C=_*y|0,S=P-C;if(C>=y&&(C=y-1,S=1),!Number.isFinite(S)){console.error("!Number.isFinite(rr)");debugger;return}if(s.indexTypedArray=f,!p[C]||!p[C+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}s.attributes={a_position:{typedArray:d,componentsPerAttribute:3},a_prop:{typedArray:p[C],componentsPerAttribute:3},a_prop2:{typedArray:p[C+1],componentsPerAttribute:3}},s.uniformMap={u_gradientMap:{type:"texture",id:`${r.id}`},u_stripMinMaxValue:[e.minPropValue??a.ESDataMesh.defaults.minPropValue,e.maxPropValue??a.ESDataMesh.defaults.maxPropValue],u_ratio:S}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(l.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r,!0),!0):!1}};v(Ba,"type",Ba.register("ESCesiumViewer",a.ESDataMesh.type,Ba));let Jd=Ba;const Ho=class Ho extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_heading",this.disposeVar(a.react(0)));v(this,"_textFunc",this.disposeVar(a.react(void 0)));const o=this;{const l=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=a.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=a.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=a.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?a.clampN180_180(u):a.clamp0_360(u)}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(c.disposableOn(l))}const s=this.disposeVar(new be(e,n));s.loop=!1,this.dispose(a.track([s,"allowPicking"],[o,"allowPicking"])),this.dispose(a.bind([s,"arcType"],[o,"arcType"])),this.dispose(a.bind([s,"color"],[o,"color"])),this.dispose(a.bind([s,"dashLength"],[o,"dashLength"])),this.dispose(a.bind([s,"dashPattern"],[o,"dashPattern"])),this.dispose(a.bind([s,"gapColor"],[o,"gapColor"])),this.dispose(a.bind([s,"hasArrow"],[o,"hasArrow"])),this.dispose(a.bind([s,"hasDash"],[o,"hasDash"])),this.dispose(a.bind([s,"positions"],[o,"positions"])),this.dispose(a.bind([s,"show"],[o,"show"])),this.dispose(a.bind([s,"width"],[o,"width"])),this.dispose(a.bind([s,"depthTest"],[o,"depthTest"])),this.dispose(a.bind([s,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const r=this.disposeVar(new We(e,n));this.dispose(a.bind([r,"shadowDom"],[o,"shadowDom"])),this.dispose(a.bind([r,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(a.bind([r,"show"],[o,"show"]));{const l=()=>{o.positions&&o.positions.length>=2?r.position=o.positions[1]:r.position=void 0};l(),this.dispose(o.positionsChanged.disposableOn(l))}{const l=()=>{const{heading:u}=o,d=(o.textFunc??Ho.defaultTextFunc_度格式)(u);r.innerHTML=ao(`方向: ${d}`,24)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(c.disposableOn(l))}this.ad(r.pickedEvent.don(l=>{Hi(l)===0&&this.pickedEvent.emit(l)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};v(Ho,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),v(Ho,"defaultTextFunc_度分格式",e=>`${br(e,!0)}`),v(Ho,"defaultTextFunc_度分秒格式",e=>`${br(e,!1)}`),v(Ho,"defaults",{positions:[]});let To=Ho;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:8,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(To||(To={})),a.extendClassProps(To.prototype,To.createDefaultProps);const Va=class Va extends vt{constructor(e,n){super(e,n);v(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new To(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDirectionMeasurement;s.angleMode="0~360",this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):u==="normal"?(s.hasDash=!1,s.hasArrow=!1):(s.hasDash=!1,s.hasArrow=!0);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Va,"type",Va.register("ESCesiumViewer",a.ESDirectionMeasurement.type,Va));let jd=Va;class Ls extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_distances",this.disposeVar(a.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await Sm(e.viewer,this.positions??[]):this._distances.value=a.getDistancesFromPositions(this.positions??[],this.arcType)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(s.disposableOn(o));const r=this.disposeVar(new be(e,n));r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"positions"],[this,"positions"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.bind([r,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&r.flyTo(l)}));{const l=[],c=()=>{for(let d of l)d.destroy();l.length=0};this.dispose(c);const u=()=>{if(c(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const p=Eu("起点",this.positions[0],e,n);p.dispose(a.track([p,"show"],[this,"show"])),p.dispose(a.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(a.track([p,"cssAllInitial"],[this,"cssAllInitial"])),l.push(p)}const d=this.distances.length;for(let p=0;p<d;++p){const f=this.distances[p],g=this.positions[p+1],m=Eu(`长度: ${Sc(f)}`,g,e,n);m.dispose(a.track([m,"show"],[this,"show"])),m.dispose(a.track([m,"shadowDom"],[this,"shadowDom"])),m.dispose(a.track([m,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(m.pickedEvent.don(y=>{Hi(y)===0&&this.pickedEvent.emit(y)})),l.push(m)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>a.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}v(Ls,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width: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",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Ls||(Ls={})),a.extendClassProps(Ls.prototype,Ls.createDefaultProps);const Ua=class Ua extends vt{constructor(e,n){super(e,n);v(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new be(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoPolyline;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,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get geoPolyline(){return this._geoPolyline}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolyline: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,geoPolyline:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Ua,"type",Ua.register("ESCesiumViewer",a.ESGeoLineString.type,Ua));let Os=Ua;const Wa=class Wa extends Os{constructor(e,n){super(e,n);v(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Ls(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Wa,"type",Wa.register("ESCesiumViewer",a.ESDistanceMeasurement.type,Wa));let ep=Wa;class Ns extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:a.reactPositions(void 0),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Ns||(Ns={})),a.extendClassProps(Ns.prototype,Ns.createDefaultProps);class pA extends a.Destroyable{constructor(i,e){super(),this._czmESExcavate=i,this._eS3DTileset=e;for(let n=0;n<this._eS3DTileset.excavateId.length;n++){const o=this._eS3DTileset.excavateId[n];a.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(n,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(n=>n!==this._czmESExcavate.czmPolygonClipping.id)]})}}class fA extends a.Destroyable{constructor(i){if(super(),this._czmESExcavate=i,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const n=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];a.ESSceneObject.getSceneObjById(n)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Ga=class Ga extends qt{constructor(e,n){super(e,n);v(this,"_czmPolygonClipping");v(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new Ns(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)),this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!n.viewer)return;const r=this._czmPolygonClipping;r.showHelper=!1,this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.reverse=e.mode!=="in"};l(),this.dispose(e.modeChanged.disposableOn(l))}a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new fA(this):!c||!(c instanceof a.ES3DTileset)?void 0:new pA(this,c)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonClipping: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(Ga,"type",Ga.register("ESCesiumViewer",a.ESExcavate.type,Ga));let tp=Ga;const Ha=class Ha extends fe{constructor(e,n){super(e,n);v(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmFireParticleSystem;s.endColor=[1,1,0,.4],s.startColor=[1,0,0,.5],s.particleLife=1,s.emissionRate=30,s.lifetime=1,s.imageSize=[1,1],s.emitter={type:"CircleEmitter",radius:.1},s.sizeInMeters=!0;{const r=()=>{s.startScale=10*(e.scale[0]>0?e.scale[0]:1),s.endScale=5*(e.scale[0]>0?e.scale[0]:1),s.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),s.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"translation"],[e,"translation"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmFireParticleSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,jt,e),o.flyOverEvent.emit(n,"over",s),!0}}};v(Ha,"type",Ha.register("ESCesiumViewer",a.ESFireParticleSystem.type,Ha));let ip=Ha;class Bs extends a.Destroyable{constructor(e,n){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,n)),this._geoCanvasPointPoi=this.disposeVar(new _n(e,n)),this._player=this.disposeVar(new a.Player),this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(a.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(a.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(a.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),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,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const r=this.granularity*Math.PI/180,l=pu(this.positions,this.arcType??"GEODESIC",r);if(l){this._geoPath.timePosRots=l.timePosRots,this.rotationRadius.some(c=>c>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=[]};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(s.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const s=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(s-this.currentDistance)>.01&&(this.currentDistance=s)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const s=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(s-(this._player.currentTime??0))>.01&&(this._player.currentTime=s)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}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(o=>{this._geoPolyline.flyTo(o)}))}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"})})(Bs||(Bs={})),a.extendClassProps(Bs.prototype,Bs.createDefaultProps);class qr extends a.Destroyable{constructor(e,n){super();v(this,"_geoPolylinePath");v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_currentDistance",this.disposeVar(a.react(0)));this._geoPolylinePath=this.disposeVar(new Bs(e,n)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(a.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(a.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(a.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(a.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(a.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(a.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(a.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(a.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(a.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(a.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(a.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),s=()=>{try{if(this.positions&&this.positions.length>=2){const r=xu(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=r}else this._geoPolylinePath.positions=void 0}catch(r){console.error(r),this._geoPolylinePath.positions=void 0}};s(),this.dispose(o.disposableOn(s)),this.dispose(this._flyToEvent.disposableOn(r=>{this._geoPolylinePath.flyTo(r)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.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",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(qr||(qr={})),a.extendClassProps(qr.prototype,qr.createDefaultProps);const gA=[["256",256],["512",512],["1024",1024]],mA=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Vt=class Vt extends a.ESVisualObject{constructor(e){super(e);v(this,"_pickFeaturesEvent",this.dv(new a.Event));this.ad(a.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(a.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"accessToken"],"令牌",Vt.defaults.accessToken),new a.Number4Property([this,"rectangle"],"矩形范围",Vt.defaults.rectangle),new a.JsonProperty([this,"url"],"服务地址",Vt.defaults.url),new a.JsonProperty([this,"style"],"样式配置",Vt.defaults.style),new a.NumberProperty([this,"zIndex"],"层级序号",Vt.defaults.zIndex),new a.EnumProperty([this,"tileSize"],gA,"瓦片大小",256),new a.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Vt.defaults.maximumLevel),new a.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Vt.defaults.minimumLevel),new a.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Vt.defaults.scheme)],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EnumProperty([this,"splitDirection"],mA,"splitDirection","NONE"),new a.GroupProperty([],"czm","czm"),new a.NumberProperty([this,"czmAlpha"],"透明度"),new a.NumberProperty([this,"czmBrightness"],"亮度"),new a.NumberProperty([this,"czmContrast"],"对比度"),new a.NumberProperty([this,"czmHue"],"色相"),new a.NumberProperty([this,"czmSaturation"],"饱和度"),new a.NumberProperty([this,"czmGamma"],"伽马值")]}}};v(Vt,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),rectangle:a.reactJsonWithUndefined([-180,-90,180,90]),url:a.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:a.reactArrayWithUndefined([]),scheme:a.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),v(Vt,"type",Vt.register("ESMVTLayer",Vt,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let fh=Vt;const vA=t=>{const i=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:n}of i)if(t>=e)return n;return 20},yA=async(t,i,e)=>(await fetch(`http://tileser.giiiis.com/xyzinfo/${e}/${t}/${i}`)).json(),wA=async t=>{var u;const i=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!i)return;const e=i[0],n=i[1],o=i[2],s=vA(o);let r=Math.floor((e+180)/360*Math.pow(2,s+1)),l=Math.floor((90-n)/180*Math.pow(2,s));return await yA(r,l,s)};class CA extends a.Destroyable{constructor(i,e,n){super();const o=async()=>{const r=await wA(i);e.datesEvent.emit(r,i)};o();let s;s=setInterval(()=>{o()},3e3),this.d(()=>s&&clearInterval(s));{const r=()=>{const l=e.currentDate?e.currentDate:0;n.url=`http://tileser.giiiis.com/timetile/tms/${l}/tilemapresource.xml`};r(),this.d(e.currentDateChanged.don(r))}}}const dr=class dr extends a.ESVisualObject{constructor(e){super(e);v(this,"_esImageryLayer",this.dv(new a.ESImageryLayer));v(this,"_datesEvent",this.dv(new a.Event));const n=this._esImageryLayer;this.d(this.components.disposableAdd(n)),n.zIndex=1,n.minimumLevel=1,n.maximumLevel=18,this.d(a.track([n,"show"],[this,"show"])),this.d(a.track([n,"zIndex"],[this,"zIndex"])),this.d(a.track([n,"rectangle"],[this,"rectangle"])),this.d(a.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(a.bind([n,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new CA(o,this,n)),this.d(this.flyInEvent.don(o=>{n.flyIn(o)})),this.d(this.flyToEvent.don(o=>{n.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"currentDate"],"时间","0"),new a.NumberProperty([this,"zIndex"],"层级",0),new a.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};v(dr,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:a.reactArray([-180,-90,180,90])})),v(dr,"type",dr.register("ESGeHistoryImagery",dr,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gh=dr;const Py=`async (dataSource, viewer) => {
742
+ `,s.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let l=this.disposeVar(a.react(void 0));{const c=this.disposeVar(a.createProcessingFromAsyncFunc(async d=>{l.value=void 0;const p=e.url??a.ESDataMesh.defaults.url;if(!p)return;await d.promise(a.sleep(200));const f=(e.maxTime??23)|0;l.value=await d.promise(hA(a.ESSceneObject.context.getStrFromEnv(typeof p=="string"?p:p.url),f+1))}));c.start();const u=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>c.restart()))}{class c{constructor(p){this._buffer=p}[Symbol.iterator](){return uA(this._buffer)}}const u=()=>{if(!l.value)return;const{vertexBuffer:d,propBuffers:p,indexBuffer:f}=l.value,{minPos:g,maxPos:m}=a.getMinMaxCorner(new c(d));s.setLocalAxisedBoundingBox(g,m);const y=(e.maxTime??23)|0;let _=(e.currentTime??a.ESDataMesh.defaults.currentTime)/y;_=_<0?0:_>1?1:_;const P=_*y;let C=_*y|0,S=P-C;if(C>=y&&(C=y-1,S=1),!Number.isFinite(S)){console.error("!Number.isFinite(rr)");debugger;return}if(s.indexTypedArray=f,!p[C]||!p[C+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}s.attributes={a_position:{typedArray:d,componentsPerAttribute:3},a_prop:{typedArray:p[C],componentsPerAttribute:3},a_prop2:{typedArray:p[C+1],componentsPerAttribute:3}},s.uniformMap={u_gradientMap:{type:"texture",id:`${r.id}`},u_stripMinMaxValue:[e.minPropValue??a.ESDataMesh.defaults.minPropValue,e.maxPropValue??a.ESDataMesh.defaults.maxPropValue],u_ratio:S}};u(),this.dispose(e.maxTimeChanged.disposableOn(u)),this.dispose(e.currentTimeChanged.disposableOn(u)),this.dispose(e.minPropValueChanged.disposableOn(u)),this.dispose(e.maxPropValueChanged.disposableOn(u)),this.dispose(l.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r,!0),!0):!1}};v(Ba,"type",Ba.register("ESCesiumViewer",a.ESDataMesh.type,Ba));let Jd=Ba;const Ho=class Ho extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_heading",this.disposeVar(a.react(0)));v(this,"_textFunc",this.disposeVar(a.react(void 0)));const o=this;{const l=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=a.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=a.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=a.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?a.clampN180_180(u):a.clamp0_360(u)}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(c.disposableOn(l))}const s=this.disposeVar(new be(e,n));s.loop=!1,this.dispose(a.track([s,"allowPicking"],[o,"allowPicking"])),this.dispose(a.bind([s,"arcType"],[o,"arcType"])),this.dispose(a.bind([s,"color"],[o,"color"])),this.dispose(a.bind([s,"dashLength"],[o,"dashLength"])),this.dispose(a.bind([s,"dashPattern"],[o,"dashPattern"])),this.dispose(a.bind([s,"gapColor"],[o,"gapColor"])),this.dispose(a.bind([s,"hasArrow"],[o,"hasArrow"])),this.dispose(a.bind([s,"hasDash"],[o,"hasDash"])),this.dispose(a.bind([s,"positions"],[o,"positions"])),this.dispose(a.bind([s,"show"],[o,"show"])),this.dispose(a.bind([s,"width"],[o,"width"])),this.dispose(a.bind([s,"depthTest"],[o,"depthTest"])),this.dispose(a.bind([s,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(l=>{e.actived&&s.flyTo(l)}));const r=this.disposeVar(new We(e,n));this.dispose(a.bind([r,"shadowDom"],[o,"shadowDom"])),this.dispose(a.bind([r,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(a.bind([r,"show"],[o,"show"]));{const l=()=>{o.positions&&o.positions.length>=2?r.position=o.positions[1]:r.position=void 0};l(),this.dispose(o.positionsChanged.disposableOn(l))}{const l=()=>{const{heading:u}=o,d=(o.textFunc??Ho.defaultTextFunc_度格式)(u);r.innerHTML=ao(`方向: ${d}`,24)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(c.disposableOn(l))}this.ad(r.pickedEvent.don(l=>{Hi(l)===0&&this.pickedEvent.emit(l)}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get heading(){return this._heading.value}get headingChanged(){return this._heading.changed}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}};v(Ho,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),v(Ho,"defaultTextFunc_度分格式",e=>`${br(e,!0)}`),v(Ho,"defaultTextFunc_度分秒格式",e=>`${br(e,!1)}`),v(Ho,"defaults",{positions:[]});let To=Ho;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:8,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(To||(To={})),a.extendClassProps(To.prototype,To.createDefaultProps);const Va=class Va extends vt{constructor(e,n){super(e,n);v(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new To(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDirectionMeasurement;s.angleMode="0~360",this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):u==="normal"?(s.hasDash=!1,s.hasArrow=!1):(s.hasDash=!1,s.hasArrow=!0);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDirectionMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Va,"type",Va.register("ESCesiumViewer",a.ESDirectionMeasurement.type,Va));let jd=Va;class Ls extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_distances",this.disposeVar(a.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await Sm(e.viewer,this.positions??[]):this._distances.value=a.getDistancesFromPositions(this.positions??[],this.arcType)};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(s.disposableOn(o));const r=this.disposeVar(new be(e,n));r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"positions"],[this,"positions"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"])),this.dispose(a.bind([r,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&r.flyTo(l)}));{const l=[],c=()=>{for(let d of l)d.destroy();l.length=0};this.dispose(c);const u=()=>{if(c(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const p=Eu("起点",this.positions[0],e,n);p.dispose(a.track([p,"show"],[this,"show"])),p.dispose(a.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(a.track([p,"cssAllInitial"],[this,"cssAllInitial"])),l.push(p)}const d=this.distances.length;for(let p=0;p<d;++p){const f=this.distances[p],g=this.positions[p+1],m=Eu(`长度: ${Sc(f)}`,g,e,n);m.dispose(a.track([m,"show"],[this,"show"])),m.dispose(a.track([m,"shadowDom"],[this,"shadowDom"])),m.dispose(a.track([m,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(m.pickedEvent.don(y=>{Hi(y)===0&&this.pickedEvent.emit(y)})),l.push(m)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>a.inOrderRunning(u)))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}}v(Ls,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width: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",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Ls||(Ls={})),a.extendClassProps(Ls.prototype,Ls.createDefaultProps);const Ua=class Ua extends vt{constructor(e,n){super(e,n);v(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new be(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoPolyline;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,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get geoPolyline(){return this._geoPolyline}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoPolyline: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,geoPolyline:r}=this;return s.actived?o.flyInParam?(super.flyIn(e,n),!0):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Ua,"type",Ua.register("ESCesiumViewer",a.ESGeoLineString.type,Ua));let Os=Ua;const Wa=class Wa extends Os{constructor(e,n){super(e,n);v(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Ls(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmDistanceMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Wa,"type",Wa.register("ESCesiumViewer",a.ESDistanceMeasurement.type,Wa));let ep=Wa;class Ns extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n)}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,allowPicking:!1,positions:a.reactPositions(void 0),reverse:!1,edgeColor:a.reactArray([1,1,1,1]),edgeWidth:2})})(Ns||(Ns={})),a.extendClassProps(Ns.prototype,Ns.createDefaultProps);class dA extends a.Destroyable{constructor(i,e){super(),this._czmESExcavate=i,this._eS3DTileset=e;for(let n=0;n<this._eS3DTileset.excavateId.length;n++){const o=this._eS3DTileset.excavateId[n];a.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(n,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(n=>n!==this._czmESExcavate.czmPolygonClipping.id)]})}}class pA extends a.Destroyable{constructor(i){if(super(),this._czmESExcavate=i,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const n=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];a.ESSceneObject.getSceneObjById(n)||this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.splice(e,1)}this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._czmESExcavate.viewer&&(this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId=[...this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.filter(e=>e!==this._czmESExcavate.czmPolygonClipping.id)])})}}}const Ga=class Ga extends qt{constructor(e,n){super(e,n);v(this,"_czmPolygonClipping");v(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new Ns(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)),this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!n.viewer)return;const r=this._czmPolygonClipping;r.showHelper=!1,this.dispose(a.bind([r,"positions"],[e,"points"])),this.dispose(a.track([r,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.reverse=e.mode!=="in"};l(),this.dispose(e.modeChanged.disposableOn(l))}a.registerCreatedEventUpdate(this,e,()=>{const l=this.disposeVar(a.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new a.ObjResettingWithEvent(l,()=>{const{sceneObject:c,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new pA(this):!c||!(c instanceof a.ES3DTileset)?void 0:new dA(this,c)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonClipping: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(Ga,"type",Ga.register("ESCesiumViewer",a.ESExcavate.type,Ga));let tp=Ga;const Ha=class Ha extends fe{constructor(e,n){super(e,n);v(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmFireParticleSystem;s.endColor=[1,1,0,.4],s.startColor=[1,0,0,.5],s.particleLife=1,s.emissionRate=30,s.lifetime=1,s.imageSize=[1,1],s.emitter={type:"CircleEmitter",radius:.1},s.sizeInMeters=!0;{const r=()=>{s.startScale=10*(e.scale[0]>0?e.scale[0]:1),s.endScale=5*(e.scale[0]>0?e.scale[0]:1),s.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),s.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};r(),this.ad(e.scaleChanged.don(r))}this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"translation"],[e,"translation"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmFireParticleSystem:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,jt,e),o.flyOverEvent.emit(n,"over",s),!0}}};v(Ha,"type",Ha.register("ESCesiumViewer",a.ESFireParticleSystem.type,Ha));let ip=Ha;class Bs extends a.Destroyable{constructor(e,n){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,n)),this._geoCanvasPointPoi=this.disposeVar(new _n(e,n)),this._player=this.disposeVar(new a.Player),this.dispose(a.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(a.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(a.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(a.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(a.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(a.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(a.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(a.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(a.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(a.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(a.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(a.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),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,"currentPoiShow"],[this,"currentPoiShow"]));{const o=()=>{this._geoCanvasPointPoi.show=(this.show??!0)&&(this.currentPoiShow??!0)};o(),this.dispose(this.showChanged.disposableOn(o)),this.dispose(this.currentPoiShowChanged.disposableOn(o))}this.dispose(a.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const r=this.granularity*Math.PI/180,l=pu(this.positions,this.arcType??"GEODESIC",r);if(l){this._geoPath.timePosRots=l.timePosRots,this.rotationRadius.some(c=>c>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=[]};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(s.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const s=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(s-this.currentDistance)>.01&&(this.currentDistance=s)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const s=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(s-(this._player.currentTime??0))>.01&&(this._player.currentTime=s)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}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(o=>{this._geoPolyline.flyTo(o)}))}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"})})(Bs||(Bs={})),a.extendClassProps(Bs.prototype,Bs.createDefaultProps);class qr extends a.Destroyable{constructor(e,n){super();v(this,"_geoPolylinePath");v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_currentDistance",this.disposeVar(a.react(0)));this._geoPolylinePath=this.disposeVar(new Bs(e,n)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(a.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(a.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(a.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(a.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(a.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(a.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(a.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(a.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(a.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(a.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(a.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(a.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(a.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(a.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(a.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(a.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),s=()=>{try{if(this.positions&&this.positions.length>=2){const r=xu(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=r}else this._geoPolylinePath.positions=void 0}catch(r){console.error(r),this._geoPolylinePath.positions=void 0}};s(),this.dispose(o.disposableOn(s)),this.dispose(this._flyToEvent.disposableOn(r=>{this._geoPolylinePath.flyTo(r)}))}get geoPolylinePath(){return this._geoPolylinePath}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get player(){return this._geoPolylinePath.player}get currentInfo(){return this._geoPolylinePath.currentInfo}get currentInfoChanged(){return this._geoPolylinePath.currentInfoChanged}get currentIndex(){return this._geoPolylinePath.currentIndex}get currentIndexChanged(){return this._geoPolylinePath.currentIndexChanged}get currentPosition(){return this._geoPolylinePath.currentPosition}get currentPositionChanged(){return this._geoPolylinePath.currentPositionChanged}get currentRotation(){return this._geoPolylinePath.currentRotation}get currentRotationChanged(){return this._geoPolylinePath.currentRotationChanged}get accumDistances(){return this._geoPolylinePath.accumDistances}get accumDistancesChanged(){return this._geoPolylinePath.accumDistances}get totalDistance(){return this._geoPolylinePath.totalDistance}get totalDistanceChanged(){return this._geoPolylinePath.totalDistanceChanged}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.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",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0})})(qr||(qr={})),a.extendClassProps(qr.prototype,qr.createDefaultProps);const fA=[["256",256],["512",512],["1024",1024]],gA=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Vt=class Vt extends a.ESVisualObject{constructor(e){super(e);v(this,"_pickFeaturesEvent",this.dv(new a.Event));this.ad(a.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(a.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"accessToken"],"令牌",Vt.defaults.accessToken),new a.Number4Property([this,"rectangle"],"矩形范围",Vt.defaults.rectangle),new a.JsonProperty([this,"url"],"服务地址",Vt.defaults.url),new a.JsonProperty([this,"style"],"样式配置",Vt.defaults.style),new a.NumberProperty([this,"zIndex"],"层级序号",Vt.defaults.zIndex),new a.EnumProperty([this,"tileSize"],fA,"瓦片大小",256),new a.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Vt.defaults.maximumLevel),new a.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Vt.defaults.minimumLevel),new a.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Vt.defaults.scheme)],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.EnumProperty([this,"splitDirection"],gA,"splitDirection","NONE"),new a.GroupProperty([],"czm","czm"),new a.NumberProperty([this,"czmAlpha"],"透明度"),new a.NumberProperty([this,"czmBrightness"],"亮度"),new a.NumberProperty([this,"czmContrast"],"对比度"),new a.NumberProperty([this,"czmHue"],"色相"),new a.NumberProperty([this,"czmSaturation"],"饱和度"),new a.NumberProperty([this,"czmGamma"],"伽马值")]}}};v(Vt,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),rectangle:a.reactJsonWithUndefined([-180,-90,180,90]),url:a.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:a.reactArrayWithUndefined([]),scheme:a.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),v(Vt,"type",Vt.register("ESMVTLayer",Vt,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let fh=Vt;const mA=t=>{const i=[{maxAlt:25e7,level:0},{maxAlt:25e6,level:1},{maxAlt:9e6,level:2},{maxAlt:7e6,level:3},{maxAlt:44e5,level:4},{maxAlt:2e6,level:5},{maxAlt:1e6,level:6},{maxAlt:493977,level:7},{maxAlt:218047,level:8},{maxAlt:124961,level:9},{maxAlt:56110,level:10},{maxAlt:4e4,level:11},{maxAlt:13222,level:12},{maxAlt:7e3,level:13},{maxAlt:4e3,level:14},{maxAlt:2500,level:15},{maxAlt:1500,level:16},{maxAlt:600,level:17},{maxAlt:250,level:18},{maxAlt:150,level:19},{maxAlt:50,level:20}];for(const{maxAlt:e,level:n}of i)if(t>=e)return n;return 20},vA=async(t,i,e)=>(await fetch(`http://tileser.giiiis.com/xyzinfo/${e}/${t}/${i}`)).json(),yA=async t=>{var u;const i=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!i)return;const e=i[0],n=i[1],o=i[2],s=mA(o);let r=Math.floor((e+180)/360*Math.pow(2,s+1)),l=Math.floor((90-n)/180*Math.pow(2,s));return await vA(r,l,s)};class wA extends a.Destroyable{constructor(i,e,n){super();const o=async()=>{const r=await yA(i);e.datesEvent.emit(r,i)};o();let s;s=setInterval(()=>{o()},3e3),this.d(()=>s&&clearInterval(s));{const r=()=>{const l=e.currentDate?e.currentDate:0;n.url=`http://tileser.giiiis.com/timetile/tms/${l}/tilemapresource.xml`};r(),this.d(e.currentDateChanged.don(r))}}}const dr=class dr extends a.ESVisualObject{constructor(e){super(e);v(this,"_esImageryLayer",this.dv(new a.ESImageryLayer));v(this,"_datesEvent",this.dv(new a.Event));const n=this._esImageryLayer;this.d(this.components.disposableAdd(n)),n.zIndex=1,n.minimumLevel=1,n.maximumLevel=18,this.d(a.track([n,"show"],[this,"show"])),this.d(a.track([n,"zIndex"],[this,"zIndex"])),this.d(a.track([n,"rectangle"],[this,"rectangle"])),this.d(a.bind([n,"flyInParam"],[this,"flyInParam"])),this.d(a.bind([n,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new wA(o,this,n)),this.d(this.flyInEvent.don(o=>{n.flyIn(o)})),this.d(this.flyToEvent.don(o=>{n.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{n.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{n.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new a.StringProperty([this,"currentDate"],"时间","0"),new a.NumberProperty([this,"zIndex"],"层级",0),new a.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};v(dr,"createDefaultProps",()=>({...a.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:a.reactArray([-180,-90,180,90])})),v(dr,"type",dr.register("ESGeHistoryImagery",dr,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let gh=dr;const Py=`async (dataSource, viewer) => {
743
743
  viewer.clock.shouldAnimate = false;
744
744
  const rider = dataSource.entities.getById("tour");
745
745
  await viewer.flyTo(rider)
@@ -749,7 +749,7 @@ ${Cy}
749
749
  viewer.clock.multiplier = 30;
750
750
  viewer.clock.shouldAnimate = true;
751
751
  }
752
- `,_A=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
752
+ `,CA=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
753
753
 
754
754
  该路径可以使用下面回调函数
755
755
  \`\`\`
@@ -799,7 +799,7 @@ ${Py}
799
799
  }
800
800
 
801
801
  \`\`\`
802
- `,np=Date.now(),Et=class Et extends a.ESSceneObject{constructor(e){super(e);v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetClockEvent",this.disposeVar(new a.Event))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new a.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new a.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new a.BooleanProperty([this,"autoResetClock"],"自动设置时钟",Et.defaults.autoResetClock),new a.BooleanProperty([this,"clockEnabled"],"启用",Et.defaults.clockEnabled),new a.BooleanProperty([this,"shouldAnimate"],"是否启用动画",Et.defaults.shouldAnimate),new a.DateProperty([this,"startTime"],"开始时间",Et.defaults.startTime,!0),new a.DateProperty([this,"stopTime"],"结束时间",Et.defaults.stopTime),new a.DateProperty([this,"currentTime"],"当前时间",Et.defaults.currentTime,!0),new a.NumberProperty([this,"multiplier"],"倍速",Et.defaults.multiplier),new a.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",Et.defaults.clockStep),new a.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",Et.defaults.clockRange)],general:[...e.general,new a.BooleanProperty([this,"show"],"是否显示",!0),new a.BooleanProperty([this,"collision"],"开启碰撞",!1),new a.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.FunctionProperty(["number"],n=>this.flyTo(n),[1e3],"飞入"),new a.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",Py,_A,!0),new a.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};v(Et,"createDefaultProps",()=>({...a.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:np,stopTime:np+24*60*60*1e3,currentTime:np,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1})),v(Et,"type",Et.register("ESKml",Et,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"}));let mh=Et;const pr=class pr extends a.ESLocalVector2D{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new a.GroupProperty([],"折线","折线"),new a.Number2sProperty([this,"points"],"本地位置数组",void 0,!0),new a.GroupProperty([],"czm","czm"),new a.BooleanProperty([this,"loop"],"首尾相连",!0),new a.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new a.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new a.NumberProperty([this,"dashLength"],"虚线长度",16),new a.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new a.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(pr,"createDefaultProps",()=>({...a.ESLocalVector2D.createDefaultProps(),points:a.reactPosition2Ds(void 0),loop:!0,hasDash:!0,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(pr,"type",pr.register("ESLocalLineString",pr,{chsName:"局部2D坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineString"}));let vh=pr;const fr=class fr extends a.ESLocalVector{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new a.GroupProperty([],"通用","通用"),new a.Number3sProperty([this,"points"],"本地位置数组",void 0,!0),new a.GroupProperty([],"czm","czm"),new a.BooleanProperty([this,"loop"],"首尾相连",!0),new a.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new a.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new a.NumberProperty([this,"dashLength"],"虚线长度",16),new a.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new a.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(fr,"createDefaultProps",()=>({...a.ESLocalVector.createDefaultProps(),points:a.reactPositions(void 0),loop:!0,width:void 0,color:a.reactArrayWithUndefined(void 0),hasDash:!0,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(fr,"type",fr.register("ESLocalLineStringZ",fr,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineStringZ"}));let Xr=fr;const by=`in vec3 position;
802
+ `,np=Date.now(),Et=class Et extends a.ESSceneObject{constructor(e){super(e);v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetClockEvent",this.disposeVar(new a.Event))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}getESProperties(){const e={...super.getESProperties()};return{...e,defaultMenu:"basic",basic:[...e.basic,new a.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new a.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new a.BooleanProperty([this,"autoResetClock"],"自动设置时钟",Et.defaults.autoResetClock),new a.BooleanProperty([this,"clockEnabled"],"启用",Et.defaults.clockEnabled),new a.BooleanProperty([this,"shouldAnimate"],"是否启用动画",Et.defaults.shouldAnimate),new a.DateProperty([this,"startTime"],"开始时间",Et.defaults.startTime,!0),new a.DateProperty([this,"stopTime"],"结束时间",Et.defaults.stopTime),new a.DateProperty([this,"currentTime"],"当前时间",Et.defaults.currentTime,!0),new a.NumberProperty([this,"multiplier"],"倍速",Et.defaults.multiplier),new a.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",Et.defaults.clockStep),new a.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",Et.defaults.clockRange)],general:[...e.general,new a.BooleanProperty([this,"show"],"是否显示",!0),new a.BooleanProperty([this,"collision"],"开启碰撞",!1),new a.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.FunctionProperty(["number"],n=>this.flyTo(n),[1e3],"飞入"),new a.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",Py,CA,!0),new a.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};v(Et,"createDefaultProps",()=>({...a.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:np,stopTime:np+24*60*60*1e3,currentTime:np,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1})),v(Et,"type",Et.register("ESKml",Et,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"}));let mh=Et;const pr=class pr extends a.ESLocalVector2D{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new a.GroupProperty([],"折线","折线"),new a.Number2sProperty([this,"points"],"本地位置数组",void 0,!0),new a.GroupProperty([],"czm","czm"),new a.BooleanProperty([this,"loop"],"首尾相连",!0),new a.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new a.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new a.NumberProperty([this,"dashLength"],"虚线长度",16),new a.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new a.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(pr,"createDefaultProps",()=>({...a.ESLocalVector2D.createDefaultProps(),points:a.reactPosition2Ds(void 0),loop:!0,hasDash:!0,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(pr,"type",pr.register("ESLocalLineString",pr,{chsName:"局部2D坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineString"}));let vh=pr;const fr=class fr extends a.ESLocalVector{constructor(i){super(i)}getESProperties(){const i={...super.getESProperties()};return{...i,more:[...i.more,new a.GroupProperty([],"通用","通用"),new a.Number3sProperty([this,"points"],"本地位置数组",void 0,!0),new a.GroupProperty([],"czm","czm"),new a.BooleanProperty([this,"loop"],"首尾相连",!0),new a.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new a.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new a.NumberProperty([this,"dashLength"],"虚线长度",16),new a.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new a.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};v(fr,"createDefaultProps",()=>({...a.ESLocalVector.createDefaultProps(),points:a.reactPositions(void 0),loop:!0,width:void 0,color:a.reactArrayWithUndefined(void 0),hasDash:!0,gapColor:a.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),v(fr,"type",fr.register("ESLocalLineStringZ",fr,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineStringZ"}));let Xr=fr;const by=`in vec3 position;
803
803
  in vec3 normal;
804
804
  in vec2 st;
805
805
  out vec3 v_normalEC;
@@ -819,7 +819,7 @@ void main()
819
819
  vec4 imageColor = texture(u_image, v_st);
820
820
  out_FragColor = imageColor * u_color;
821
821
  }
822
- `,Ey={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},xy={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},Ay={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},Ty={position:{typedArray:new Float32Array([0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,0,1,1,0,1,1]),componentsPerAttribute:2}},My=new Uint16Array([0,1,2,3,4,5]);function Iy(t){const i={};for(let e of Object.keys(t)){const{typedArray:n,componentsPerAttribute:o,usage:s,normalize:r}=t[e];i[e]={typedArray:{type:n.constructor.name,array:[...n.values()]},componentsPerAttribute:o,usage:s,normalize:r}}return i}function PA(t){const i={};for(let e of Object.keys(t)){const{typedArray:{type:n,array:o},componentsPerAttribute:s,usage:r,normalize:l}=t[e];i[e]={typedArray:new globalThis[n](o),componentsPerAttribute:s,usage:r,normalize:l}}return i}function Dy(t){return{type:t.constructor.name,array:[...t.values()]}}function bA(t){const{type:i,array:e}=t;return new globalThis[i](e)}const SA=[["POINTS","POINTS"],["LINES","LINES"],["LINE_LOOP","LINE_LOOP"],["LINE_STRIP","LINE_STRIP"],["TRIANGLES","TRIANGLES"],["TRIANGLE_STRIP","TRIANGLE_STRIP"],["TRIANGLE_FAN","TRIANGLE_FAN"]],EA=[["ENVIRONMENT","ENVIRONMENT"],["COMPUTE","COMPUTE"],["GLOBE","GLOBE"],["TERRAIN_CLASSIFICATION","TERRAIN_CLASSIFICATION"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["CESIUM_3D_TILE_CLASSIFICATION","CESIUM_3D_TILE_CLASSIFICATION"],["CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW","CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW"],["OPAQUE","OPAQUE"],["TRANSLUCENT","TRANSLUCENT"],["OVERLAY","OVERLAY"],["NUMBER_OF_PASSES","NUMBER_OF_PASSES"]],xA=`### 默认使用的渲染状态
822
+ `,Ey={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},xy={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!1,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},Ay={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},Ty={position:{typedArray:new Float32Array([0,0,0,0,-1,0,1,-1,0,0,0,0,1,-1,0,1,0,0]),componentsPerAttribute:3},normal:{typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1]),componentsPerAttribute:3},textureCoordinates:{typedArray:new Float32Array([0,1,0,0,1,0,0,1,1,0,1,1]),componentsPerAttribute:2}},My=new Uint16Array([0,1,2,3,4,5]);function Iy(t){const i={};for(let e of Object.keys(t)){const{typedArray:n,componentsPerAttribute:o,usage:s,normalize:r}=t[e];i[e]={typedArray:{type:n.constructor.name,array:[...n.values()]},componentsPerAttribute:o,usage:s,normalize:r}}return i}function _A(t){const i={};for(let e of Object.keys(t)){const{typedArray:{type:n,array:o},componentsPerAttribute:s,usage:r,normalize:l}=t[e];i[e]={typedArray:new globalThis[n](o),componentsPerAttribute:s,usage:r,normalize:l}}return i}function Dy(t){return{type:t.constructor.name,array:[...t.values()]}}function PA(t){const{type:i,array:e}=t;return new globalThis[i](e)}const bA=[["POINTS","POINTS"],["LINES","LINES"],["LINE_LOOP","LINE_LOOP"],["LINE_STRIP","LINE_STRIP"],["TRIANGLES","TRIANGLES"],["TRIANGLE_STRIP","TRIANGLE_STRIP"],["TRIANGLE_FAN","TRIANGLE_FAN"]],SA=[["ENVIRONMENT","ENVIRONMENT"],["COMPUTE","COMPUTE"],["GLOBE","GLOBE"],["TERRAIN_CLASSIFICATION","TERRAIN_CLASSIFICATION"],["CESIUM_3D_TILE","CESIUM_3D_TILE"],["CESIUM_3D_TILE_CLASSIFICATION","CESIUM_3D_TILE_CLASSIFICATION"],["CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW","CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW"],["OPAQUE","OPAQUE"],["TRANSLUCENT","TRANSLUCENT"],["OVERLAY","OVERLAY"],["NUMBER_OF_PASSES","NUMBER_OF_PASSES"]],EA=`### 默认使用的渲染状态
823
823
  \`\`\`
824
824
  {
825
825
  depthTest: {
@@ -946,7 +946,7 @@ interface RenderStateOptions {
946
946
  }
947
947
  }
948
948
  \`\`\`
949
- `,AA=`### 默认的BoundingVolume
949
+ `,xA=`### 默认的BoundingVolume
950
950
  \`\`\`
951
951
  type: 'LocalAxisedBoundingBox',
952
952
  data: {
@@ -974,7 +974,7 @@ export type BoundingVolumeJsonType = {
974
974
  };
975
975
  };
976
976
  \`\`\`
977
- `,TA=`### 默认顶点Shader示例
977
+ `,AA=`### 默认顶点Shader示例
978
978
  \`\`\`
979
979
  in vec3 position;
980
980
  in vec3 normal;
@@ -1016,7 +1016,7 @@ void main()
1016
1016
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
1017
1017
  }
1018
1018
  \`\`\`
1019
- `,MA=`### 默认片元Shader示例
1019
+ `,TA=`### 默认片元Shader示例
1020
1020
  \`\`\`
1021
1021
  in vec2 v_st;
1022
1022
  uniform sampler2D u_image;
@@ -1071,7 +1071,7 @@ void main()
1071
1071
  // #endif
1072
1072
  }
1073
1073
  \`\`\`
1074
- `,IA=`### 默认使用的UniformMap
1074
+ `,MA=`### 默认使用的UniformMap
1075
1075
  \`\`\`
1076
1076
  {
1077
1077
  "myImage": {
@@ -1116,7 +1116,7 @@ void main()
1116
1116
  export type CzmCustomPrimitiveUniformType = number | [number, number] | [number, number, number] | [number, number, number, number] | { type: 'image', uri: string };
1117
1117
  export type CzmCustomPrimitiveUniformMapType = { [k: string]: CzmCustomPrimitiveUniformType };
1118
1118
  \`\`\`
1119
- `,DA=`### 默认的顶点属性
1119
+ `,IA=`### 默认的顶点属性
1120
1120
  \`\`\`
1121
1121
  {
1122
1122
  position: {
@@ -1150,7 +1150,7 @@ export type AttributesJsonType = {
1150
1150
  [k: string]: AttributeJsonType;
1151
1151
  }
1152
1152
  \`\`\`
1153
- `,RA=`### 默认的索引数组
1153
+ `,DA=`### 默认的索引数组
1154
1154
  \`\`\`
1155
1155
  {
1156
1156
  "type": "Uint16Array",
@@ -1165,7 +1165,7 @@ export type IndexJsonType = {
1165
1165
  array: number[];
1166
1166
  }
1167
1167
  \`\`\`
1168
- `,xt=class xt extends a.ESObjectWithLocation{constructor(e){super(e);v(this,"_attributes",this.disposeVar(a.react(void 0)));v(this,"_indexTypedArray",this.disposeVar(a.react(void 0)))}get attributesJson(){return this.attributes&&Iy(this.attributes)}set attributesJson(e){const n=JSON.stringify(this.attributesJson),o=JSON.stringify(e);n!==o&&(this.attributes=e&&PA(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&Dy(this.indexTypedArray)}set indexTypedArrayJson(e){const n=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);n!==o&&(this.indexTypedArray=e&&bA(e))}get indexTypedArrayJsonChanged(){return this.indexTypedArrayChanged}get attributes(){return this._attributes.value}set attributes(e){this._attributes.value=e}get attributesChanged(){return this._attributes.changed}get indexTypedArray(){return this._indexTypedArray.value}set indexTypedArray(e){this._indexTypedArray.value=e}get indexTypedArrayChanged(){return this._indexTypedArray.changed}setUniformMap(e){if(Object.entries(e).some(([o,s])=>(console.warn(`setUniformMap error: key: ${o} value: ${s}`),s===null)))return;const n={...this.uniformMap??{},...e};this.uniformMap=n}setLocalBoundingSphere(e,n=[0,0,0]){if(!Number.isFinite(e)||e<=0){console.warn(`!Number.isFinite(radius) || radius <= 0 radius: ${e}`);return}this.boundingVolume={type:"LocalBoundingSphere",data:{center:n,radius:e}}}setLocalAxisedBoundingBox(e,n){if(e.some(o=>!Number.isFinite(o))||n.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${n.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:n}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const n=this.attributes[e];if(!("typedArray"in n)||!(n.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in n)||n.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:s}=xt.getMinMaxPosition(n.typedArray);if(!o.some(r=>!Number.isFinite(r)||s.some(l=>!Number.isFinite(l))))return{min:o,max:s}}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.Number4Property([this,"viewDistanceRange"],"可视范围控制",void 0,!0),new a.BooleanProperty([this,"viewDistanceDebug"],"可视距离调试"),new a.GroupProperty([],"屏幕像素","屏幕像素"),new a.NumberProperty([this,"maximumScale"],"最大缩放值",3,!0),new a.NumberProperty([this,"minimumScale"],"最小缩放值",1,!0),new a.NumberProperty([this,"pixelSize"],"屏幕像素",5,!0),new a.BooleanProperty([this,"showSceneScale"],"显示缩放值",!1,!0),new a.GroupProperty([],"图元属性","图元属性"),new a.JsonProperty([this,"modelMatrix"],"模型矩阵",void 0,void 0,!0),new a.BooleanProperty([this,"cull"],"是否拣选",void 0,!0),new a.JsonProperty([this,"boundingVolume"],"包围体",Ey,AA,!0),new a.EnumProperty([this,"pass"],EA,"渲染顺序","TRANSLUCENT",!0),new a.EnumProperty([this,"primitiveType"],SA,"图元类型","TRIANGLES",!0),new a.JsonProperty([this,"renderState"],"渲染状态",xy,xA,!0),new a.EvalStringProperty([this,"vertexShaderSource"],"顶点着色器",by,TA,!0),new a.EvalStringProperty([this,"fragmentShaderSource"],"片元着色器",Sy,MA,!0),new a.JsonProperty([this,"uniformMap"],"一致性变量(uniform)",Ay,IA,!0),new a.JsonProperty([this,"attributesJson"],"顶点属性(attributes)",Iy(Ty),DA,!0),new a.JsonProperty([this,"indexTypedArrayJson"],"索引(index)",Dy(My),RA,!0),new a.NumberProperty([this,"count"],"count",0,!0),new a.NumberProperty([this,"offset"],"offset",0,!0),new a.NumberProperty([this,"instanceCount"],"instanceCount",0,!0),new a.FunctionProperty(["string"],n=>{const o=this.computeLocalAxisedBoundingBoxFromAttribute(n);if(!o)return;const{min:s,max:r}=o;this.setLocalAxisedBoundingBox(s,r)},["position"],"自动计算包围盒"),new a.GroupProperty([],"本地变换","本地变换"),new a.PositionProperty([this,"localPosition"],"本地偏移",void 0,!0),new a.RotationProperty([this,"localRotation"],"本地姿态",void 0,!0),new a.Number3Property([this,"localScale"],"本地缩放",[1,1,1],!0),new a.JsonProperty([this,"localModelMatrix"],"本地模型矩阵",void 0,void 0,!0),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"debugShowBoundingVolume"],"debugShowBoundingVolume",!1,!0),new a.NumberProperty([this,"debugOverlappingFrustums"],"debugOverlappingFrustums",0,!0),new a.GroupProperty([],"Czm特有","Czm特有"),new a.BooleanProperty([this,"occlude"],"occlude",!0,!0),new a.BooleanProperty([this,"castShadows"],"castShadows",!1,!0),new a.BooleanProperty([this,"receiveShadows"],"receiveShadows",!1,!0),new a.BooleanProperty([this,"executeInClosestFrustum"],"executeInClosestFrustum",!1,!0),new a.BooleanProperty([this,"pickOnly"],"pickOnly",!1,!0),new a.BooleanProperty([this,"depthForTranslucentClassification"],"depthForTranslucentClassification",!1,!0)]}}};v(xt,"createDefaultProps",()=>({...a.ESObjectWithLocation.createDefaultProps(),maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:a.reactArrayWithUndefined(void 0),cull:a.react(void 0),boundingVolume:a.reactJson(void 0),renderState:a.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:a.reactJson(void 0),localPosition:a.reactArrayWithUndefined(void 0),localRotation:a.reactArrayWithUndefined(void 0),localScale:a.reactArrayWithUndefined(void 0),localModelMatrix:a.reactArrayWithUndefined(void 0),occlude:void 0,count:void 0,offset:void 0,instanceCount:void 0,castShadows:void 0,receiveShadows:void 0,executeInClosestFrustum:void 0,debugShowBoundingVolume:void 0,debugOverlappingFrustums:void 0,pickOnly:void 0,depthForTranslucentClassification:void 0,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})),v(xt,"type",xt.register("ESCustomPrimitive",xt,{chsName:"ES自定义图元",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES自定义图元"})),v(xt,"defaultRenderState",xy),v(xt,"defaultVertexShaderSource",by),v(xt,"defaultFragmentShaderSource",Sy),v(xt,"defaultUniformMap",Ay),v(xt,"defaultBoundingVolume",Ey),v(xt,"defaultAttribute",Ty),v(xt,"defaultIndexTypedArray",My),v(xt,"getMinMaxPosition",a.getMinMaxPosition);let yh=xt;const hn=class hn extends a.ESGeoVector{constructor(e){super(e);v(this,"editingBindMode","lineString");v(this,"_player");this._player=this.disposeVar(new a.Player);{const n=hn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],o=>o??n.loop,o=>o??n.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],o=>o??n.currentTime,o=>o??n.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],o=>o??n.duration,o=>o??n.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],o=>o??n.playing,o=>o??n.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],o=>o??n.speed,o=>o??n.speed))}this.stroked=!0,this.strokeColor=[0,1,0,.3]}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.NumberProperty([this,"startTime"],"起始时间"),new a.NumberProperty([this,"transmissionTime"],"传输时间"),new a.NumberProperty([this,"heightRatio"],"高度比率"),new a.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new a.BooleanProperty([this,"brightening"],"变亮"),new a.BooleanProperty([this,"depthTest"],"深度监测"),new a.UriProperty([this,"imageUrl"],"图片路径",hn.defaults.imageUrl,!0),new a.NumberProperty([this,"repeat"],"图像重复次数"),new a.EnumProperty([this,"bidirectional"],[["正向",0],["反向",1],["双向",2],["无",3]],"运动方向",0),new a.GroupProperty([],"播放器","播放器"),new a.PlayerProperty([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new a.BooleanProperty([this,"loop"],"是否循环"),new a.NumberProperty([this.player,"currentTime"],"当前时间"),new a.NumberProperty([this,"duration"],"过渡时间"),new a.BooleanProperty([this,"playing"],"是否播放"),new a.NumberProperty([this,"speed"],"播放速度")]}}};v(hn,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),imageUrl:"${esobjs-xe2-plugin-assets-script-dir}/xe2-assets/esobjs-xe2-plugin/images/signal.png",repeat:5,bidirectional:0,startTime:0,transmissionTime:3e3,arcType:"GEODESIC",brightening:!1,depthTest:!0,heightRatio:1,loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0})),v(hn,"type",hn.register("ESSignalTransmission",hn,{chsName:"信号传输器",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"})),v(hn,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert]);let wh=hn;const $o=class $o extends a.ESGeoVector{constructor(e){super(e);v(this,"editingBindMode","lineString")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.NumberProperty([this,"width"],"线宽"),new a.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new a.StringProperty([this,"imageUrl"],"道路图片"),new a.Number2Property([this,"repeat"],"重复次数")]}}};v($o,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],stroked:!0})),v($o,"type",$o.register("ESRoad",$o,{chsName:"贴地道路",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"最大宽度到1000米"})),v($o,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert]);let Ch=$o;const qo=class qo extends a.ESGeoVector{constructor(e){super(e);v(this,"_deprecated",["ground"]);v(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());v(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.BooleanProperty([this,"ground"],"是否贴地",!1,!0),new a.NumberProperty([this,"depth"],"厚度",16,!0)]}}};v(qo,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),ground:!1,depth:0,stroked:!0,filled:!0,fillStyle:a.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),v(qo,"type",qo.register("ESGeoSmoothPolygon",qo,{chsName:"平滑多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平滑多边形"})),v(qo,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.CircularAppend,a.ESJEditingMode.CircularInsert]);let Yr=qo;const Yn=class Yn extends a.ESGeoVector{constructor(e){super(e);v(this,"_deprecated",["ground"]);v(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());v(this,"_geoPolylinePath");v(this,"_currentDistance",this.disposeVar(a.react(0)))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert],{callSource:"inner"})}get geoPolylinePath(){return this._geoPolylinePath}set geoPolylinePath(e){this._geoPolylinePath=e}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.BooleanProperty([this,"currentPoiShow"],"是否显示当前",!0),new a.NumberProperty([this,"currentDistance"],"当前距离",0),new a.NumberProperty([this,"resolution"],"分辨率",1e3),new a.NumberProperty([this,"sharpness"],"锐化程度",.85),new a.GroupProperty([],"折线","折线"),new a.JsonProperty([this,"timePosRots"],"timePosRots",[],void 0,!1,!0),new a.NumberProperty([this,"leadTime"],"折线超前显示时长",0),new a.NumberProperty([this,"trailTime"],"折线滞后显示时长",0),new a.GroupProperty([],"播放器","播放器"),new a.PlayerProperty([this,"playing"],[this._geoPolylinePath,"ratio"],[this,"loop"],"播放器"),new a.BooleanProperty([this,"loop"],"是否循环"),new a.NumberProperty([this,"currentTime"],"当前时间"),new a.NumberProperty([this,"duration"],"过渡时间"),new a.BooleanProperty([this,"playing"],"是否播放"),new a.NumberProperty([this,"speed"],"播放速度"),new a.GroupProperty([],"折线","折线"),new a.BooleanProperty([this,"ground"],"是否贴地"),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测"),new a.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型",Yn.defaults.arcType)]}}};v(Yn,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),currentPoiShow:!0,ground:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0,stroked:!0})),v(Yn,"type",Yn.register("ESGeoBezierPath",Yn,{chsName:"贝塞尔曲线路径",tags:["GeoObjects"],description:"贝塞尔曲线路径"})),v(Yn,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert]);let _h=Yn;const $a=class $a extends Jt{constructor(e,n){super(e,n);v(this,"_czmBezierPath");if(this._czmBezierPath=this.disposeVar(new qr(n,e.id)),e.geoPolylinePath=this._czmBezierPath.geoPolylinePath,!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmBezierPath;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"currentPoiShow"],[e,"currentPoiShow"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"currentDistance"],[e,"currentDistance"])),this.dispose(a.track([s,"resolution"],[e,"resolution"])),this.dispose(a.track([s,"sharpness"],[e,"sharpness"])),this.dispose(a.track([s.geoPath,"timePosRots"],[e.geoPath,"timePosRots"])),this.dispose(a.track([s,"leadTime"],[e,"leadTime"])),this.dispose(a.track([s,"trailTime"],[e,"trailTime"])),this.dispose(a.track([s.geoPolylinePath,"ratio"],[e.geoPolylinePath,"ratio"])),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"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"polylineShow"],[e,"stroked"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"]));{const r=()=>{s.ground=e.ground||e.strokeGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.strokeGroundChanged));this.d(l.don(r))}{const r=()=>{if(!e.stroked){s.hasDash=!1,s.hasArrow=!1;return}const u=e.strokeStyle;if(u.material==="hasDash"&&u.materialParams)try{const p=u.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashLength=0;const d=e.strokeMaterial??"normal";d==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):d==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get czmBezierPath(){return this._czmBezierPath}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmBezierPath: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmBezierPath:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v($a,"type",$a.register("ESCesiumViewer",_h.type,$a));let op=$a;const qa=class qa extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoCustomDivPoi");v(this,"_divContainer");v(this,"_hasClassDivAndPos",{});if(this._czmGeoCustomDivPoi=this.disposeVar(new We(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoCustomDivPoi;s.cssAllInitial=!0,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"opacity"],[e,"opacity"])),this.d(a.track([s,"zOrder"],[e,"zOrder"]));{const r=()=>{s.originRatioAndOffset=[...e.anchor,0,0],this._divContainer&&this._divContainer.children[0]&&(this._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};r(),this.dispose(e.anchorChanged.don(r))}{const r=()=>{const c=this;return class extends a.Destroyable{constructor(d,p,f){if(super(),this._subContainer=d,!f||!(f instanceof Te))return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");c._divContainer=this.disposeVar(new e.instanceClass(d,e,f))._container;{const y=()=>{c._divContainer.style.pointerEvents=c.sceneObject.editing?"none":"all"};y(),this.d(c.sceneObject.editingChanged.don(y))}{const y=()=>{c._divContainer.children[0]&&(c._divContainer.children[0].style.transform=`scale(${e.scale[1]},${e.scale[2]})`,c._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};y(),this.d(e.scaleChanged.don(y))}let g=c._divContainer?c._divContainer.querySelectorAll("*[class]"):[];for(let y=0;y<g.length;y++){const _=g[y];var m=_.getBoundingClientRect();c._hasClassDivAndPos[_.className]=[_.offsetLeft,_.offsetTop,_.offsetLeft+m.width,_.offsetTop+m.height]}}}},l=()=>{try{e.instanceClass?s.instanceClass=r():s.instanceClass=void 0}catch(c){console.error(c)}};l(),this.dispose(e.instanceClassChanged.disposableOn(l))}this.dispose(s.pickedEvent.disposableOn(r=>{var u;r.assign({sceneObject:e});const l=(u=lo(r,"pickResult"))==null?void 0:u.pointerEvent;if(!l)return;const c={type:l.buttons!=0&&l.button==0?"leftClick":l.button==2?"rightClick":void 0,add:{mousePos:[l.offsetX,l.offsetY]}};if(c.type==null&&(c.type=l.type),c.type==="leftClick"){const d=Object.keys(this._hasClassDivAndPos);for(let p=0;p<d.length;p++){const f=d[p];let g=this._hasClassDivAndPos[f],m=this._divContainer.getBoundingClientRect();const y=l.clientX-m.left,_=l.clientY-m.top;if(y>=g[0]&&y<=g[2]&&_>=g[1]&&_<=g[3]){c.add.className=f;break}}}e.widgetEvent.emit(c),c.type==="leftClick"&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.position&&ne(s.viewer,r.position,1e3,jt,e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(qa,"type",qa.register("ESCesiumViewer",a.ESGeoDiv.type,qa));let sp=qa;const Xa=class Xa extends fe{constructor(e,n){super(e,n);v(this,"_czmDivTextPoi");if(this._czmDivTextPoi=this.disposeVar(new Pi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDivTextPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([s,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([s,"width"],[e,"width"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"originRatioAndOffset"],[e,"originRatioAndOffset"])),this.dispose(a.track([s,"opacity"],[e,"opacity"])),this.dispose(a.bind([s,"fontSize"],[e,"fontSize"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.track([s,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([s,"borderColor"],[e,"borderColor"])),this.dispose(a.track([s,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([s,"textAlign"],[e,"textAlign"])),this.dispose(a.track([s,"borderStyle"],[e,"borderStyle"]))}get czmDivTextPoi(){return this._czmDivTextPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDivTextPoi: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(Xa,"type",Xa.register("ESCesiumViewer",a.ESGeoDivTextPoi.type,Xa));let rp=Xa;const FA={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[116.2,39.56]},properties:{title:"swimming","marker-symbol":"swimming","marker-color":"#8F1312"}},{type:"Feature",geometry:{type:"Point",coordinates:[115.2,38.56]},properties:{title:"8","marker-symbol":"8","marker-color":"#46117E"}},{type:"Feature",geometry:{type:"Point",coordinates:[114.2,37.56]},properties:{title:"6","marker-symbol":"6","marker-color":"#713291"}}]},zA=`properties是一个包含三个属性的对象,title表示标题,marker-symbol表示点位的文字内容,marker-color表示点位颜色,properties可以删除,然后使用场景对象属性设置。
1168
+ `,xt=class xt extends a.ESObjectWithLocation{constructor(e){super(e);v(this,"_attributes",this.disposeVar(a.react(void 0)));v(this,"_indexTypedArray",this.disposeVar(a.react(void 0)))}get attributesJson(){return this.attributes&&Iy(this.attributes)}set attributesJson(e){const n=JSON.stringify(this.attributesJson),o=JSON.stringify(e);n!==o&&(this.attributes=e&&_A(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&Dy(this.indexTypedArray)}set indexTypedArrayJson(e){const n=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);n!==o&&(this.indexTypedArray=e&&PA(e))}get indexTypedArrayJsonChanged(){return this.indexTypedArrayChanged}get attributes(){return this._attributes.value}set attributes(e){this._attributes.value=e}get attributesChanged(){return this._attributes.changed}get indexTypedArray(){return this._indexTypedArray.value}set indexTypedArray(e){this._indexTypedArray.value=e}get indexTypedArrayChanged(){return this._indexTypedArray.changed}setUniformMap(e){if(Object.entries(e).some(([o,s])=>(console.warn(`setUniformMap error: key: ${o} value: ${s}`),s===null)))return;const n={...this.uniformMap??{},...e};this.uniformMap=n}setLocalBoundingSphere(e,n=[0,0,0]){if(!Number.isFinite(e)||e<=0){console.warn(`!Number.isFinite(radius) || radius <= 0 radius: ${e}`);return}this.boundingVolume={type:"LocalBoundingSphere",data:{center:n,radius:e}}}setLocalAxisedBoundingBox(e,n){if(e.some(o=>!Number.isFinite(o))||n.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${n.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:n}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const n=this.attributes[e];if(!("typedArray"in n)||!(n.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in n)||n.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:s}=xt.getMinMaxPosition(n.typedArray);if(!o.some(r=>!Number.isFinite(r)||s.some(l=>!Number.isFinite(l))))return{min:o,max:s}}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.Number4Property([this,"viewDistanceRange"],"可视范围控制",void 0,!0),new a.BooleanProperty([this,"viewDistanceDebug"],"可视距离调试"),new a.GroupProperty([],"屏幕像素","屏幕像素"),new a.NumberProperty([this,"maximumScale"],"最大缩放值",3,!0),new a.NumberProperty([this,"minimumScale"],"最小缩放值",1,!0),new a.NumberProperty([this,"pixelSize"],"屏幕像素",5,!0),new a.BooleanProperty([this,"showSceneScale"],"显示缩放值",!1,!0),new a.GroupProperty([],"图元属性","图元属性"),new a.JsonProperty([this,"modelMatrix"],"模型矩阵",void 0,void 0,!0),new a.BooleanProperty([this,"cull"],"是否拣选",void 0,!0),new a.JsonProperty([this,"boundingVolume"],"包围体",Ey,xA,!0),new a.EnumProperty([this,"pass"],SA,"渲染顺序","TRANSLUCENT",!0),new a.EnumProperty([this,"primitiveType"],bA,"图元类型","TRIANGLES",!0),new a.JsonProperty([this,"renderState"],"渲染状态",xy,EA,!0),new a.EvalStringProperty([this,"vertexShaderSource"],"顶点着色器",by,AA,!0),new a.EvalStringProperty([this,"fragmentShaderSource"],"片元着色器",Sy,TA,!0),new a.JsonProperty([this,"uniformMap"],"一致性变量(uniform)",Ay,MA,!0),new a.JsonProperty([this,"attributesJson"],"顶点属性(attributes)",Iy(Ty),IA,!0),new a.JsonProperty([this,"indexTypedArrayJson"],"索引(index)",Dy(My),DA,!0),new a.NumberProperty([this,"count"],"count",0,!0),new a.NumberProperty([this,"offset"],"offset",0,!0),new a.NumberProperty([this,"instanceCount"],"instanceCount",0,!0),new a.FunctionProperty(["string"],n=>{const o=this.computeLocalAxisedBoundingBoxFromAttribute(n);if(!o)return;const{min:s,max:r}=o;this.setLocalAxisedBoundingBox(s,r)},["position"],"自动计算包围盒"),new a.GroupProperty([],"本地变换","本地变换"),new a.PositionProperty([this,"localPosition"],"本地偏移",void 0,!0),new a.RotationProperty([this,"localRotation"],"本地姿态",void 0,!0),new a.Number3Property([this,"localScale"],"本地缩放",[1,1,1],!0),new a.JsonProperty([this,"localModelMatrix"],"本地模型矩阵",void 0,void 0,!0),new a.GroupProperty([],"调试","调试"),new a.BooleanProperty([this,"debugShowBoundingVolume"],"debugShowBoundingVolume",!1,!0),new a.NumberProperty([this,"debugOverlappingFrustums"],"debugOverlappingFrustums",0,!0),new a.GroupProperty([],"Czm特有","Czm特有"),new a.BooleanProperty([this,"occlude"],"occlude",!0,!0),new a.BooleanProperty([this,"castShadows"],"castShadows",!1,!0),new a.BooleanProperty([this,"receiveShadows"],"receiveShadows",!1,!0),new a.BooleanProperty([this,"executeInClosestFrustum"],"executeInClosestFrustum",!1,!0),new a.BooleanProperty([this,"pickOnly"],"pickOnly",!1,!0),new a.BooleanProperty([this,"depthForTranslucentClassification"],"depthForTranslucentClassification",!1,!0)]}}};v(xt,"createDefaultProps",()=>({...a.ESObjectWithLocation.createDefaultProps(),maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:a.reactArrayWithUndefined(void 0),cull:a.react(void 0),boundingVolume:a.reactJson(void 0),renderState:a.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:a.reactJson(void 0),localPosition:a.reactArrayWithUndefined(void 0),localRotation:a.reactArrayWithUndefined(void 0),localScale:a.reactArrayWithUndefined(void 0),localModelMatrix:a.reactArrayWithUndefined(void 0),occlude:void 0,count:void 0,offset:void 0,instanceCount:void 0,castShadows:void 0,receiveShadows:void 0,executeInClosestFrustum:void 0,debugShowBoundingVolume:void 0,debugOverlappingFrustums:void 0,pickOnly:void 0,depthForTranslucentClassification:void 0,viewDistanceRange:a.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})),v(xt,"type",xt.register("ESCustomPrimitive",xt,{chsName:"ES自定义图元",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES自定义图元"})),v(xt,"defaultRenderState",xy),v(xt,"defaultVertexShaderSource",by),v(xt,"defaultFragmentShaderSource",Sy),v(xt,"defaultUniformMap",Ay),v(xt,"defaultBoundingVolume",Ey),v(xt,"defaultAttribute",Ty),v(xt,"defaultIndexTypedArray",My),v(xt,"getMinMaxPosition",a.getMinMaxPosition);let yh=xt;const hn=class hn extends a.ESGeoVector{constructor(e){super(e);v(this,"editingBindMode","lineString");v(this,"_player");this._player=this.disposeVar(new a.Player);{const n=hn.defaults;this.dispose(a.bind([this._player,"loop"],[this,"loop"],o=>o??n.loop,o=>o??n.loop)),this.dispose(a.bind([this._player,"currentTime"],[this,"currentTime"],o=>o??n.currentTime,o=>o??n.currentTime)),this.dispose(a.bind([this._player,"duration"],[this,"duration"],o=>o??n.duration,o=>o??n.duration)),this.dispose(a.bind([this._player,"playing"],[this,"playing"],o=>o??n.playing,o=>o??n.playing)),this.dispose(a.bind([this._player,"speed"],[this,"speed"],o=>o??n.speed,o=>o??n.speed))}this.stroked=!0,this.strokeColor=[0,1,0,.3]}get player(){return this._player}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.NumberProperty([this,"startTime"],"起始时间"),new a.NumberProperty([this,"transmissionTime"],"传输时间"),new a.NumberProperty([this,"heightRatio"],"高度比率"),new a.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new a.BooleanProperty([this,"brightening"],"变亮"),new a.BooleanProperty([this,"depthTest"],"深度监测"),new a.UriProperty([this,"imageUrl"],"图片路径",hn.defaults.imageUrl,!0),new a.NumberProperty([this,"repeat"],"图像重复次数"),new a.EnumProperty([this,"bidirectional"],[["正向",0],["反向",1],["双向",2],["无",3]],"运动方向",0),new a.GroupProperty([],"播放器","播放器"),new a.PlayerProperty([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new a.BooleanProperty([this,"loop"],"是否循环"),new a.NumberProperty([this.player,"currentTime"],"当前时间"),new a.NumberProperty([this,"duration"],"过渡时间"),new a.BooleanProperty([this,"playing"],"是否播放"),new a.NumberProperty([this,"speed"],"播放速度")]}}};v(hn,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),imageUrl:"${esobjs-xe2-plugin-assets-script-dir}/xe2-assets/esobjs-xe2-plugin/images/signal.png",repeat:5,bidirectional:0,startTime:0,transmissionTime:3e3,arcType:"GEODESIC",brightening:!1,depthTest:!0,heightRatio:1,loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0})),v(hn,"type",hn.register("ESSignalTransmission",hn,{chsName:"信号传输器",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"})),v(hn,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert]);let wh=hn;const $o=class $o extends a.ESGeoVector{constructor(e){super(e);v(this,"editingBindMode","lineString")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.NumberProperty([this,"width"],"线宽"),new a.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new a.StringProperty([this,"imageUrl"],"道路图片"),new a.Number2Property([this,"repeat"],"重复次数")]}}};v($o,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],stroked:!0})),v($o,"type",$o.register("ESRoad",$o,{chsName:"贴地道路",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"最大宽度到1000米"})),v($o,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert]);let Ch=$o;const qo=class qo extends a.ESGeoVector{constructor(e){super(e);v(this,"_deprecated",["ground"]);v(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());v(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.BooleanProperty([this,"ground"],"是否贴地",!1,!0),new a.NumberProperty([this,"depth"],"厚度",16,!0)]}}};v(qo,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),ground:!1,depth:0,stroked:!0,filled:!0,fillStyle:a.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),v(qo,"type",qo.register("ESGeoSmoothPolygon",qo,{chsName:"平滑多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平滑多边形"})),v(qo,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.CircularAppend,a.ESJEditingMode.CircularInsert]);let Yr=qo;const Yn=class Yn extends a.ESGeoVector{constructor(e){super(e);v(this,"_deprecated",["ground"]);v(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());v(this,"_geoPolylinePath");v(this,"_currentDistance",this.disposeVar(a.react(0)))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert],{callSource:"inner"})}get geoPolylinePath(){return this._geoPolylinePath}set geoPolylinePath(e){this._geoPolylinePath=e}get geoPath(){return this._geoPolylinePath.geoPath}get ratio(){return this._geoPolylinePath.ratio}set ratio(e){this._geoPolylinePath.ratio=e}get ratioChanged(){return this._geoPolylinePath.ratioChanged}get currentDistance(){return this._currentDistance.value}set currentDistance(e){this._currentDistance.value=e}get currentDistanceChanged(){return this._currentDistance.changed}get timePosRots(){return this.geoPath.timePosRots}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new a.GroupProperty([],"通用","通用"),new a.BooleanProperty([this,"currentPoiShow"],"是否显示当前",!0),new a.NumberProperty([this,"currentDistance"],"当前距离",0),new a.NumberProperty([this,"resolution"],"分辨率",1e3),new a.NumberProperty([this,"sharpness"],"锐化程度",.85),new a.GroupProperty([],"折线","折线"),new a.JsonProperty([this,"timePosRots"],"timePosRots",[],void 0,!1,!0),new a.NumberProperty([this,"leadTime"],"折线超前显示时长",0),new a.NumberProperty([this,"trailTime"],"折线滞后显示时长",0),new a.GroupProperty([],"播放器","播放器"),new a.PlayerProperty([this,"playing"],[this._geoPolylinePath,"ratio"],[this,"loop"],"播放器"),new a.BooleanProperty([this,"loop"],"是否循环"),new a.NumberProperty([this,"currentTime"],"当前时间"),new a.NumberProperty([this,"duration"],"过渡时间"),new a.BooleanProperty([this,"playing"],"是否播放"),new a.NumberProperty([this,"speed"],"播放速度"),new a.GroupProperty([],"折线","折线"),new a.BooleanProperty([this,"ground"],"是否贴地"),new a.BooleanProperty([this,"depthTest"],"是否开启深度检测"),new a.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型",Yn.defaults.arcType)]}}};v(Yn,"createDefaultProps",()=>({...a.ESGeoVector.createDefaultProps(),currentPoiShow:!0,ground:!1,arcType:"GEODESIC",loop:!1,currentTime:0,duration:3e3,speed:1,playing:!1,resolution:1e3,sharpness:.85,depthTest:!1,leadTime:0,trailTime:0,stroked:!0})),v(Yn,"type",Yn.register("ESGeoBezierPath",Yn,{chsName:"贝塞尔曲线路径",tags:["GeoObjects"],description:"贝塞尔曲线路径"})),v(Yn,"supportEditingModes",[...a.ESGeoVector.supportEditingModes,a.ESJEditingMode.LineStringAppend,a.ESJEditingMode.LineStringInsert]);let _h=Yn;const $a=class $a extends Jt{constructor(e,n){super(e,n);v(this,"_czmBezierPath");if(this._czmBezierPath=this.disposeVar(new qr(n,e.id)),e.geoPolylinePath=this._czmBezierPath.geoPolylinePath,!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmBezierPath;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"currentPoiShow"],[e,"currentPoiShow"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.bind([s,"currentDistance"],[e,"currentDistance"])),this.dispose(a.track([s,"resolution"],[e,"resolution"])),this.dispose(a.track([s,"sharpness"],[e,"sharpness"])),this.dispose(a.track([s.geoPath,"timePosRots"],[e.geoPath,"timePosRots"])),this.dispose(a.track([s,"leadTime"],[e,"leadTime"])),this.dispose(a.track([s,"trailTime"],[e,"trailTime"])),this.dispose(a.track([s.geoPolylinePath,"ratio"],[e.geoPolylinePath,"ratio"])),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"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"polylineShow"],[e,"stroked"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"]));{const r=()=>{s.ground=e.ground||e.strokeGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.strokeGroundChanged));this.d(l.don(r))}{const r=()=>{if(!e.stroked){s.hasDash=!1,s.hasArrow=!1;return}const u=e.strokeStyle;if(u.material==="hasDash"&&u.materialParams)try{const p=u.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashLength=0;const d=e.strokeMaterial??"normal";d==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):d==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}}get czmBezierPath(){return this._czmBezierPath}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmBezierPath: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmBezierPath:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v($a,"type",$a.register("ESCesiumViewer",_h.type,$a));let op=$a;const qa=class qa extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoCustomDivPoi");v(this,"_divContainer");v(this,"_hasClassDivAndPos",{});if(this._czmGeoCustomDivPoi=this.disposeVar(new We(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoCustomDivPoi;s.cssAllInitial=!0,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"opacity"],[e,"opacity"])),this.d(a.track([s,"zOrder"],[e,"zOrder"]));{const r=()=>{s.originRatioAndOffset=[...e.anchor,0,0],this._divContainer&&this._divContainer.children[0]&&(this._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};r(),this.dispose(e.anchorChanged.don(r))}{const r=()=>{const c=this;return class extends a.Destroyable{constructor(d,p,f){if(super(),this._subContainer=d,!f||!(f instanceof Te))return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");c._divContainer=this.disposeVar(new e.instanceClass(d,e,f))._container;{const y=()=>{c._divContainer.style.pointerEvents=c.sceneObject.editing?"none":"all"};y(),this.d(c.sceneObject.editingChanged.don(y))}{const y=()=>{c._divContainer.children[0]&&(c._divContainer.children[0].style.transform=`scale(${e.scale[1]},${e.scale[2]})`,c._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};y(),this.d(e.scaleChanged.don(y))}let g=c._divContainer?c._divContainer.querySelectorAll("*[class]"):[];for(let y=0;y<g.length;y++){const _=g[y];var m=_.getBoundingClientRect();c._hasClassDivAndPos[_.className]=[_.offsetLeft,_.offsetTop,_.offsetLeft+m.width,_.offsetTop+m.height]}}}},l=()=>{try{e.instanceClass?s.instanceClass=r():s.instanceClass=void 0}catch(c){console.error(c)}};l(),this.dispose(e.instanceClassChanged.disposableOn(l))}this.dispose(s.pickedEvent.disposableOn(r=>{var u;r.assign({sceneObject:e});const l=(u=lo(r,"pickResult"))==null?void 0:u.pointerEvent;if(!l)return;const c={type:l.buttons!=0&&l.button==0?"leftClick":l.button==2?"rightClick":void 0,add:{mousePos:[l.offsetX,l.offsetY]}};if(c.type==null&&(c.type=l.type),c.type==="leftClick"){const d=Object.keys(this._hasClassDivAndPos);for(let p=0;p<d.length;p++){const f=d[p];let g=this._hasClassDivAndPos[f],m=this._divContainer.getBoundingClientRect();const y=l.clientX-m.left,_=l.clientY-m.top;if(y>=g[0]&&y<=g[2]&&_>=g[1]&&_<=g[3]){c.add.className=f;break}}}e.widgetEvent.emit(c),c.type==="leftClick"&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.position&&ne(s.viewer,r.position,1e3,jt,e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(qa,"type",qa.register("ESCesiumViewer",a.ESGeoDiv.type,qa));let sp=qa;const Xa=class Xa extends fe{constructor(e,n){super(e,n);v(this,"_czmDivTextPoi");if(this._czmDivTextPoi=this.disposeVar(new Pi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmDivTextPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([s,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([s,"width"],[e,"width"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"originRatioAndOffset"],[e,"originRatioAndOffset"])),this.dispose(a.track([s,"opacity"],[e,"opacity"])),this.dispose(a.bind([s,"fontSize"],[e,"fontSize"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.track([s,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([s,"borderColor"],[e,"borderColor"])),this.dispose(a.track([s,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([s,"textAlign"],[e,"textAlign"])),this.dispose(a.track([s,"borderStyle"],[e,"borderStyle"]))}get czmDivTextPoi(){return this._czmDivTextPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmDivTextPoi: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(Xa,"type",Xa.register("ESCesiumViewer",a.ESGeoDivTextPoi.type,Xa));let rp=Xa;const RA={type:"FeatureCollection",features:[{type:"Feature",geometry:{type:"Point",coordinates:[116.2,39.56]},properties:{title:"swimming","marker-symbol":"swimming","marker-color":"#8F1312"}},{type:"Feature",geometry:{type:"Point",coordinates:[115.2,38.56]},properties:{title:"8","marker-symbol":"8","marker-color":"#46117E"}},{type:"Feature",geometry:{type:"Point",coordinates:[114.2,37.56]},properties:{title:"6","marker-symbol":"6","marker-color":"#713291"}}]},FA=`properties是一个包含三个属性的对象,title表示标题,marker-symbol表示点位的文字内容,marker-color表示点位颜色,properties可以删除,然后使用场景对象属性设置。
1169
1169
  \`\`\`
1170
1170
  {
1171
1171
  "type": "FeatureCollection",
@@ -1244,19 +1244,19 @@ export type IndexJsonType = {
1244
1244
  }
1245
1245
  }
1246
1246
  }
1247
- `,Fy="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",LA=`${Fy}
1247
+ `,Fy="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",zA=`${Fy}
1248
1248
 
1249
1249
  该路径可以使用下面回调函数
1250
1250
  \`\`\`
1251
1251
  ${Ry}
1252
1252
  \`\`\`
1253
- `,He=class He extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));v(this,"_dataSource",this.disposeVar(a.react(void 0)));v(this,"_data");v(this,"_defaultHeight",{});v(this,"_defaultBoundingSphere",new h.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(d=>d.json()).then(d=>{this._data=d}).catch(d=>{console.warn("ESGeoJson数据加载失败",d)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(d=>{var f,g;const p=[];for(const m of d.entities.values)if(h.Entity.prototype&&(m.ESSceneObjectID=n),this._isEntityShow(m,e),m.polygon&&p.push(...(f=m.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions),m.polyline&&p.push(...(g=m.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now())),m.position){const y=m.position.getValue(h.JulianDate.now());y&&p.push(y)}this._defaultBoundingSphere=h.BoundingSphere.fromPoints(p)}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const c=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(l))}{const r=()=>{var c,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(d){console.error(d)}else{const d=this.dataSource.entities.values;for(let p=0;p<d.length;p++){const f=d[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??He.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??He.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polygon.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g,f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new h.ConstantProperty(this.stroked??He.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??He.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??He.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??He.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:He.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:He.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:He.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const m=this.imageAnchor??He.defaults.imageAnchor,y=this.imageOffset??He.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-m[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-m[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??He.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??He.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??He.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const _=this.textFontSize&&this.textFontSize!=0?this.textFontSize:He.defaults.textFontSize,P=this.textOffset??He.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??He.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${_}px ${this.textFontFamily??He.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const C=this.textAnchor??He.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-C[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+P[0],-C[1]*((this.textBackgroundColor?10:0)+_)+P[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let u=0;u<c.length;u++){const d=c[u];this._isEntityShow(d,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&(r!==void 0?o.flyTo(this.dataSource,{duration:r/1e3}).then(l=>{l||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:r/1e3})}):o.flyTo(this.dataSource).then(l=>{l||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=n.viewer)!=null&&o.camera&&this.show){let s;if(e.polygon&&e.polygon.hierarchy)s=a.getMinMaxCorner(e.polygon.hierarchy.getValue(h.JulianDate.now()).positions.map(c=>re(c))).center;else if(e.polyline&&e.polyline.positions)s=a.getMinMaxCorner(e.polyline.positions.getValue(h.JulianDate.now()).map(c=>re(c))).center;else if(e.position){const c=e.position.getValue(h.JulianDate.now());c&&(s=re(c))}if(!s||isNaN(s[0]))return;const r=a.getDistancesFromPositions([s,Gt(n.viewer.camera)],"NONE")[0];let l=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?l=this.minFeatureVisibleDistance<r&&r<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?l=r>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(l=r<this.maxFeatureVisibleDistance),e.show=this.show&&l}}};v(He,"defaults",{show:!0,allowPicking:!0,url:Fy,defaultLoadFuncStr:Ry,defaultLoadFuncDocStr:LA,data:FA,dataMd:zA,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Mo=He;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Mo||(Mo={})),a.extendClassProps(Mo.prototype,Mo.createDefaultProps);const Ya=class Ya extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.ad(new Mo(e,i.id));this.ad(a.track([o,"show"],[i,"show"])),this.ad(a.track([o,"allowPicking"],[i,"allowPicking"])),this.ad(a.track([o,"loadFuncStr"],[i,"loadFuncStr"])),this.ad(a.track([o,"url"],[i,"features"])),this.ad(a.track([o,"stroked"],[i,"stroked"])),this.ad(a.track([o,"strokeWidth"],[i,"strokeWidth"])),this.ad(a.track([o,"strokeWidthType"],[i,"strokeWidthType"])),this.ad(a.track([o,"strokeColor"],[i,"strokeColor"])),this.ad(a.track([o,"strokeMaterial"],[i,"strokeMaterial"])),this.ad(a.track([o,"strokeMaterialParams"],[i,"strokeMaterialParams"])),this.ad(a.track([o,"strokeGround"],[i,"strokeGround"])),this.ad(a.track([o,"filled"],[i,"filled"])),this.ad(a.track([o,"fillColor"],[i,"fillColor"])),this.ad(a.track([o,"fillMaterial"],[i,"fillMaterial"])),this.ad(a.track([o,"fillMaterialParams"],[i,"fillMaterialParams"])),this.ad(a.track([o,"fillGround"],[i,"fillGround"])),this.ad(a.track([o,"imageShow"],[i,"imageShow"])),this.ad(a.track([o,"imageUrl"],[i,"imageUrl"])),this.ad(a.track([o,"imageSize"],[i,"imageSize"])),this.ad(a.track([o,"imageAnchor"],[i,"imageAnchor"])),this.ad(a.track([o,"imageOffset"],[i,"imageOffset"])),this.ad(a.track([o,"textShow"],[i,"textShow"])),this.ad(a.track([o,"textProperty"],[i,"textProperty"])),this.ad(a.track([o,"textDefaultText"],[i,"textDefaultText"])),this.ad(a.track([o,"textColor"],[i,"textColor"])),this.ad(a.track([o,"textBackgroundColor"],[i,"textBackgroundColor"])),this.ad(a.track([o,"textFontFamily"],[i,"textFontFamily"])),this.ad(a.track([o,"textFontSize"],[i,"textFontSize"])),this.ad(a.track([o,"textFontStyle"],[i,"textFontStyle"])),this.ad(a.track([o,"textFontWeight"],[i,"textFontWeight"])),this.ad(a.track([o,"textAnchor"],[i,"textAnchor"])),this.ad(a.track([o,"textOffset"],[i,"textOffset"])),this.ad(a.track([o,"minFeatureVisibleDistance"],[i,"minFeatureVisibleDistance"])),this.ad(a.track([o,"maxFeatureVisibleDistance"],[i,"maxFeatureVisibleDistance"])),this.ad(a.track([o,"heightReference"],[i,"heightReference"])),this.ad(a.track([o,"classificationType"],[i,"classificationType"])),this.ad(i.flyToEvent.disposableOn(s=>{if(e.actived){if(i.flyInParam){const{position:r,rotation:l,flyDuration:c}=i.flyInParam;return ne(e.viewer,r,void 0,l,c),!0}o.flyTo(s&&s*1e3)}}));{const s=async(r,l,c)=>{if(!e.actived)return;const u=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(r,l)));if(!(!u||!(u!=null&&u.positions)))if(u.type=="Point"||u.type=="MultiPoint")ei(e,i,this.id,await this._calculateFeatureHeight(u.type=="MultiPoint"?u.positions.flat():u.positions,i.heightReference,e),1e3,c);else{const d=u.type=="Polygon"||u.type=="MultiPolygon"||u.type=="MultiLineString";let p=[];d?p=u.positions.flat(u.type=="MultiPolygon"?2:1).map(y=>this._calculateFeatureHeight(y,i.fillGround?"CLAMP_TO_GROUND":"NONE",e)):p=u.positions.map(y=>this._calculateFeatureHeight(y,i.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:g,center:m}=a.getMinMaxCorner(p);ei(e,i,this.id,m,a.getDistancesFromPositions([f,g],"NONE")[0],c)}};this.d(i.flyToFeatureEvent.don((r,l,c)=>s(r,l,c))),this.d(i.flyToFeatureIndexEvent.don((r,l)=>s(r,void 0,l)))}}_getFeatureByIndexOrProperties(i,e){var r,l,c,u,d,p,f,g;const{sceneObject:n}=this,o=n.features;if(!o)return;const s=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(s){if(e){let m=s.find(y=>(y==null?void 0:y.properties[i])==e);return{type:m!=null&&m.coordinates?m.type:(r=m==null?void 0:m.geometry)==null?void 0:r.type,positions:(m==null?void 0:m.coordinates)||((l=m==null?void 0:m.geometry)==null?void 0:l.coordinates)}}else if(typeof i=="number")return{type:(c=s[i])!=null&&c.coordinates?s[i].type:(d=(u=s[i])==null?void 0:u.geometry)==null?void 0:d.type,positions:((p=s[i])==null?void 0:p.coordinates)||((g=(f=s[i])==null?void 0:f.geometry)==null?void 0:g.coordinates)}}}async _calculateFeatureHeight(i,e,n){const o=[...i];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await n.getTerrainHeight(o)??0:o[2]+=await n.getTerrainHeight(o)??0,o}};v(Ya,"type",Ya.register("ESCesiumViewer",a.ESGeoJson.type,Ya));let ap=Ya;const Za=class Za extends vt{constructor(e,n){super(e,n);v(this,"_czmGeoESRectangle");v(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new be(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:u,maxPos:d}=a.getMinMaxCorner(c);s.rectangle=[u[0],u[1],d[0],d[1]],s.height=c[0][2],s.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],m=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];r.positions=[...m,f]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};v(Za,"type",Za.register("ESCesiumViewer",a.ESGeoRectangle.type,Za));let lp=Za;class Zr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Sn(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=xu([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(Zr||(Zr={})),a.extendClassProps(Zr.prototype,Zr.createDefaultProps);const Qa=class Qa extends vt{constructor(e,n){super(e,n);v(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:Yr.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Qa,"type",Qa.register("ESCesiumViewer",Yr.type,Qa));let cp=Qa;const ka=class ka extends fe{constructor(e,n){super(e,n);v(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new rt(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{s.gltf.animations&&(s.activeAnimationsJson=s.gltf.animations.map((c,u)=>({index:u,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new Pc(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c)))}{const l=()=>{var c,u;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=c};l(),this.d(e.rotationChanged.don(l));{const c=()=>{if(l(),!e.instances){s.instances=e.instances;return}s.instances=e.instances.map(u=>{const d=JSON.parse(JSON.stringify(u));return!d.rotation&&(d.rotation=[0,0,0]),d.rotation[0]+=90,d})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const c=[...s.rotation];c[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=c};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};c(),this.d(l.don(c))}const r=()=>{s.url=a.ESSceneObject.context.getStrFromEnv(bc(typeof e.url=="string"?e.url:e.url.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,c)=>{s.setNodeTranslation(l,c)})),this.d(e.setNodeRotationEvent.don((l,c)=>{s.setNodeRotation(l,c)})),this.d(e.setNodeScaleEvent.don((l,c)=>{s.setNodeScale(l,c)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Dt(s,o,n,e,r,!0),!!r):!1}};v(ka,"type",ka.register("ESCesiumViewer",a.ESGltfModel.type,ka));let hp=ka;function zy(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Qr extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_distance",this.disposeVar(a.react(0)));v(this,"_surfaceDistance",this.disposeVar(a.react(0)));v(this,"_height",this.disposeVar(a.react(0)));v(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=zy(r,l),this._surfaceDistance.value=zy(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new be(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[u,d]=this.positions;r.positions=[u,d,[u[0],u[1],d[2]]]}else r.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&r.flyTo(c)}));const l=this.disposeVar(new We(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const c=()=>{l.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{l.innerHTML=ao(`高度: ${Sc(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(l.pickedEvent.don(c=>{Hi(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Qr||(Qr={})),a.extendClassProps(Qr.prototype,Qr.createDefaultProps);const Ka=class Ka extends vt{constructor(e,n){super(e,n);v(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Qr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Ka,"type",Ka.register("ESCesiumViewer",a.ESHeightMeasurement.type,Ka));let up=Ka;const dp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Ja=class Ja extends fe{constructor(e,n){super(e,n);v(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new rt(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(y=>{e.readyEvent.emit(y)}));{const y=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),_=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};_(),this.d(y.don(_))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),d=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=c;break;case"stranger":s.url=u;break;case"suitMan":s.url=d;break;case"suitWoman":s.url=p;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}y==="walking"?s.activeAnimationsJson=dp.czmAnimationsWalk:y==="standing"?s.activeAnimationsJson=dp.czmAnimationsStand:y==="running"&&(s.activeAnimationsJson=dp.czmAnimationsRun)};g();const m=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(m.disposableOn(()=>g())),this.ad(new Pc(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Dt(s,o,n,e,r,!0),!!r)}};v(Ja,"type",Ja.register("ESCesiumViewer",a.ESHuman.type,Ja));let pp=Ja;class Ly extends a.Destroyable{constructor(e,n){super();v(this,"_czmGeoCanvasImagePoi");v(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,jt,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new _i(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=d=>{let p=d;return d.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(bc(p))},r=()=>{const d=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=d,e.sizeByContent){const f=new Image;f.src=d,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const d=()=>{o.scale=[e.scale[1],e.scale[2]]};d(),this.dispose(e.scaleChanged.don(d))}const c=()=>{const d=e.anchor,p=e.offset;d?o.originRatioAndOffset=[...d,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(d=>{const{offsetX:p,offsetY:f}=d,m={type:d.button===0?"leftClick":d.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(m)})),this.dispose(o.hoveredChanged.disposableOn(d=>{if(d===void 0)return;const p={type:d?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Oy extends a.Destroyable{constructor(e,n,o){super();v(this,"_czmGeoImageModel");v(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});v(this,"_isPointEvent",!1);v(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return ei(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new qi(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,m,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(bc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=c,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const f=e.size;s.size=[f[0]/100,f[1]/100]}},s.uri=c,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const f=()=>{s.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(Ke([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const d=()=>{const f=e.anchor,g=e.offset;f?s.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},p=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>d())),d()}get czmGeoImageModel(){return this._czmGeoImageModel}}const ja=class ja extends Hr{constructor(e,n){super(e,n);v(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new Ly(this.sceneObject,this.czmViewer):new Oy(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(ja,"type",ja.register("ESCesiumViewer",a.ESImageLabel.type,ja));let fp=ja;function OA(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const el=class el extends Jt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=a.ESSceneObject.context.getStrFromEnv(d.url),r.value=d}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var m;if(!r.value)return;const u=(((m=e.options)==null?void 0:m.type)??"auto").toLowerCase(),d=e.options??{};let p={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...d},f=r.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const P=+y.substring(6);p={...d,assetId:P,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const _=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=_:f.url=_,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const _=+g.substring(6);p={...d,assetId:_,type:"IonImageryProvider"}}p.type=OA(u)}console.log("imageryProvider",p),s.imageryProvider=p};l();const c=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(el,"type",el.register("ESCesiumViewer",a.ESImageryLayer.type,el));let gp=el;class NA extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_show");v(this,"_czmESCustomPrimitive");v(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new De(n,this._sceneObject.id)),this._czmTexture=this.dv(new ze(n));const r=e,l=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=r.size/2,f=s[0].map(z=>z*p),g=s[1].map(z=>z*p),m=s[2].map(z=>z*p),y=s[3].map(z=>z*p),_=[...f,...g,...m,...y];let P=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(P=P.reverse());const C=[0,0],S=[1,0],x=[1,1],A=[0,1];let R=[];o=="east"||o=="south"?R=[...S,...C,...A,...x]:o=="west"?R=[...S,...x,...A,...C]:o=="top"?R=[...A,...x,...S,...C]:R=[...C,...S,...x,...A],l.indexTypedArray=new Uint16Array(P),l.attributes={position:{typedArray:new Float32Array(_),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},c.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const O=n.getCameraInfo();if(O!=null){const B=a.getDistancesFromPositions([r.position,O.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:B)}const N=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!N)return;const{min:V,max:U}=N;l.setLocalAxisedBoundingBox(V,U)};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(d.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class BA extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const d=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(d)})}}r()}}const Ye=class Ye extends fe{constructor(e,n){super(e,n);v(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ye._defaultLocalBox&&Ye._firstLoad&&(Ye._firstLoad=!1,Ye._defaultLocalBox=n.xbsjLocalBoxSources),Ye._eSLocalSkyBoxArr.push(e),this.d(()=>{Ye._eSLocalSkyBoxArr.includes(e)&&Ye._eSLocalSkyBoxArr.splice(Ye._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new NA(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new BA(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ye._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ye._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ye._defaultLocalBox)}Ye._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ye._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?(ei(s,o,n,o.position,r,e,!0),!0):!1}}};v(Ye,"type",Ye.register("ESCesiumViewer",a.ESLocalSkyBox.type,Ye)),v(Ye,"_defaultLocalBox"),v(Ye,"_firstLoad",!0),v(Ye,"_eSLocalSkyBoxArr",[]);let mp=Ye;const li=class li extends fe{constructor(e,n){super(e,n);v(this,"_geoCustomDivPoi");v(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new We(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=c=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:c}))}));{const r=()=>{if(!e.position)return;const c=(this.textFunc??li.defaultTextFunc_度格式)(e.position);s.innerHTML=ao(c)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?li.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?li.defaultTextFunc_度分格式:li.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(li,"type",li.register("ESCesiumViewer",a.ESLocationMeasurement.type,li)),v(li,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
1253
+ `,He=class He extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));v(this,"_dataSource",this.disposeVar(a.react(void 0)));v(this,"_data");v(this,"_defaultHeight",{});v(this,"_defaultBoundingSphere",new h.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{s()});{const r=this.dv(a.createProcessingFromAsyncFunc(async u=>{this.dataSource&&s(),this.url&&(typeof this.url=="object"?this._data=this.url:a.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(a.ESSceneObject.context.getStrFromEnv(this.url)).then(d=>d.json()).then(d=>{this._data=d}).catch(d=>{console.warn("ESGeoJson数据加载失败",d)}),this.dataSource=await h.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(d=>{var f,g;const p=[];for(const m of d.entities.values)if(h.Entity.prototype&&(m.ESSceneObjectID=n),this._isEntityShow(m,e),m.polygon&&p.push(...(f=m.polygon.hierarchy)==null?void 0:f.getValue(h.JulianDate.now()).positions),m.polyline&&p.push(...(g=m.polyline.positions)==null?void 0:g.getValue(h.JulianDate.now())),m.position){const y=m.position.getValue(h.JulianDate.now());y&&p.push(y)}this._defaultBoundingSphere=h.BoundingSphere.fromPoints(p)}))})),l=()=>{r.isRunning&&r.cancel(),r.restart()};l();const c=this.dv(a.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(c.don(l))}{const r=()=>{var c,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(d){console.error(d)}else{const d=this.dataSource.entities.values;for(let p=0;p<d.length;p++){const f=d[p];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(c=f.polygon.height)==null?void 0:c.getValue(h.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new h.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new h.ConstantProperty(!this.fillGround),f.polygon.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new h.ConstantProperty(this.filled??He.defaults.filled),f.polygon.material=new h.ColorMaterialProperty(new h.Color(...this.fillColor??He.defaults.fillColor)),f.polygon.outline=new h.ConstantProperty(!1),f.polygon.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new h.PolylineGraphics;const g=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(h.JulianDate.now()).positions));h.Cartesian3.equals(g[0],g[g.length-1])||g.push(g[0]),f.polyline.positions=g,f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=h.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new h.ConstantProperty(this.stroked??He.defaults.stroked),f.polyline.width=new h.ConstantProperty(this.strokeWidth??He.defaults.strokeWidth),f.polyline.material=new h.ColorMaterialProperty(new h.Color(...this.strokeColor??He.defaults.strokeColor)),f.polyline.clampToGround=new h.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new h.ConstantProperty(this.imageShow??He.defaults.imageShow),f.billboard.width=new h.ConstantProperty(this.imageSize?this.imageSize[0]:He.defaults.imageSize[0]),f.billboard.height=new h.ConstantProperty(this.imageSize?this.imageSize[1]:He.defaults.imageSize[1]);const g=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:He.defaults.imageUrl;f.billboard.image=new h.ConstantProperty(a.ESSceneObject.context.getStrFromEnv(g)),f.billboard.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.billboard.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND);const m=this.imageAnchor??He.defaults.imageAnchor,y=this.imageOffset??He.defaults.imageOffset;if(f.billboard.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-m[0]*f.billboard.width.getValue(h.JulianDate.now())+y[0],-m[1]*f.billboard.height.getValue(h.JulianDate.now())+y[1]])),f.label=new h.LabelGraphics,!f.label)return;f.label.show=new h.ConstantProperty(this.textShow??He.defaults.textShow),f.label.heightReference=new h.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?h.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.RELATIVE_TO_GROUND),f.label.text=new h.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??He.defaults.textDefaultText),f.label.fillColor=new h.ConstantProperty(new h.Color(...this.textColor??He.defaults.textColor)),f.label.showBackground=new h.ConstantProperty(this.textBackgroundColor!=null);const _=this.textFontSize&&this.textFontSize!=0?this.textFontSize:He.defaults.textFontSize,P=this.textOffset??He.defaults.textOffset;f.label.backgroundColor=new h.ConstantProperty(new h.Color(...this.textBackgroundColor??He.defaults.textBackgroundColor)),f.label.font=new h.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${_}px ${this.textFontFamily??He.defaults.textFontFamily}`),f.label.horizontalOrigin=new h.ConstantProperty(h.HorizontalOrigin.LEFT),f.label.verticalOrigin=new h.ConstantProperty(h.VerticalOrigin.TOP),f.label.eyeOffset=new h.ConstantProperty(h.Cartesian3.fromArray([0,0,-1]));const C=this.textAnchor??He.defaults.textAnchor;f.label.pixelOffset=new h.ConstantProperty(h.Cartesian2.fromArray([-C[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(h.JulianDate.now()),f.label.font.getValue(h.JulianDate.now())))+P[0],-C[1]*((this.textBackgroundColor?10:0)+_)+P[1]]))}}}};r();const l=this.dv(a.createNextAnimateFrameEvent(this._dataSource.changed,this.showChanged,this.strokedChanged,this.strokeWidthChanged,this.strokeWidthTypeChanged,this.strokeColorChanged,this.strokeMaterialChanged,this.strokeMaterialParamsChanged,this.strokeGroundChanged,this.filledChanged,this.fillColorChanged,this.fillMaterialChanged,this.fillMaterialParamsChanged,this.fillGroundChanged,this.imageShowChanged,this.imageUrlChanged,this.imageSizeChanged,this.imageAnchorChanged,this.imageOffsetChanged,this.textShowChanged,this.textPropertyChanged,this.textDefaultTextChanged,this.textColorChanged,this.textBackgroundColorChanged,this.textFontFamilyChanged,this.textFontSizeChanged,this.textFontStyleChanged,this.textFontWeightChanged,this.textAnchorChanged,this.textOffsetChanged,this.heightReferenceChanged,this.classificationTypeChanged));this.dispose(l.don(r))}{const r=()=>{if(!this.dataSource)return;const c=this.dataSource.entities.values;for(let u=0;u<c.length;u++){const d=c[u];this._isEntityShow(d,e)}};r();const l=this.ad(a.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(l.don(r))}{const r=()=>{if(this.loadFuncStr)try{const l=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=l}catch(l){console.error(l),this.loadFun=void 0}else this.loadFun=void 0};r(),this.dispose(this.loadFuncStrChanged.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{e.actived&&this.dataSource&&(r!==void 0?o.flyTo(this.dataSource,{duration:r/1e3}).then(l=>{l||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:r/1e3})}):o.flyTo(this.dataSource).then(l=>{l||o.camera.flyToBoundingSphere(this._defaultBoundingSphere)}))}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get dataSource(){return this._dataSource.value}set dataSource(e){this._dataSource.value=e}_getTextPixelWidth(e,n="16px sans-serif"){const s=document.createElement("canvas").getContext("2d");return s.font=n,s.measureText(e).width}_isEntityShow(e,n){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=n.viewer)!=null&&o.camera&&this.show){let s;if(e.polygon&&e.polygon.hierarchy)s=a.getMinMaxCorner(e.polygon.hierarchy.getValue(h.JulianDate.now()).positions.map(c=>re(c))).center;else if(e.polyline&&e.polyline.positions)s=a.getMinMaxCorner(e.polyline.positions.getValue(h.JulianDate.now()).map(c=>re(c))).center;else if(e.position){const c=e.position.getValue(h.JulianDate.now());c&&(s=re(c))}if(!s||isNaN(s[0]))return;const r=a.getDistancesFromPositions([s,Gt(n.viewer.camera)],"NONE")[0];let l=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?l=this.minFeatureVisibleDistance<r&&r<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?l=r>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(l=r<this.maxFeatureVisibleDistance),e.show=this.show&&l}}};v(He,"defaults",{show:!0,allowPicking:!0,url:Fy,defaultLoadFuncStr:Ry,defaultLoadFuncDocStr:zA,data:RA,dataMd:FA,stroked:!0,strokeWidth:1,strokeWidthType:"world",strokeColor:[.79,.91,.06,1],strokeMaterial:"",strokeMaterialParams:{},strokeGround:!1,filled:!0,fillColor:[.79,.91,.06,.2],fillMaterial:"",fillMaterialParams:{},fillGround:!1,imageShow:!0,imageUrl:"${earthsdk3-assets-script-dir}/assets/misc/location.png",imageSize:[64,64],imageAnchor:[.5,1],imageOffset:[0,0],textShow:!0,textProperty:"",textDefaultText:"默认标注",textColor:[1,1,1,1],textBackgroundColor:[.79,.91,.06,1],textFontFamily:"Arial",textFontSize:16,textFontWeight:"normal",textFontStyle:"normal",textAnchor:[.5,1],textOffset:[0,0],strokeWidthTypes:[["screen","screen"],["world","world"]],minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReferences:[["NONE","NONE"],["CLAMP_TO_GROUND","CLAMP_TO_GROUND"],["RELATIVE_TO_GROUND","RELATIVE_TO_GROUND"]]});let Mo=He;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:a.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:a.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:a.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:a.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:a.reactArrayWithUndefined(void 0),imageAnchor:a.reactArrayWithUndefined(void 0),imageOffset:a.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:a.reactArrayWithUndefined(void 0),textBackgroundColor:a.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:a.reactArrayWithUndefined(void 0),textOffset:a.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(Mo||(Mo={})),a.extendClassProps(Mo.prototype,Mo.createDefaultProps);const Ya=class Ya extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.ad(new Mo(e,i.id));this.ad(a.track([o,"show"],[i,"show"])),this.ad(a.track([o,"allowPicking"],[i,"allowPicking"])),this.ad(a.track([o,"loadFuncStr"],[i,"loadFuncStr"])),this.ad(a.track([o,"url"],[i,"features"])),this.ad(a.track([o,"stroked"],[i,"stroked"])),this.ad(a.track([o,"strokeWidth"],[i,"strokeWidth"])),this.ad(a.track([o,"strokeWidthType"],[i,"strokeWidthType"])),this.ad(a.track([o,"strokeColor"],[i,"strokeColor"])),this.ad(a.track([o,"strokeMaterial"],[i,"strokeMaterial"])),this.ad(a.track([o,"strokeMaterialParams"],[i,"strokeMaterialParams"])),this.ad(a.track([o,"strokeGround"],[i,"strokeGround"])),this.ad(a.track([o,"filled"],[i,"filled"])),this.ad(a.track([o,"fillColor"],[i,"fillColor"])),this.ad(a.track([o,"fillMaterial"],[i,"fillMaterial"])),this.ad(a.track([o,"fillMaterialParams"],[i,"fillMaterialParams"])),this.ad(a.track([o,"fillGround"],[i,"fillGround"])),this.ad(a.track([o,"imageShow"],[i,"imageShow"])),this.ad(a.track([o,"imageUrl"],[i,"imageUrl"])),this.ad(a.track([o,"imageSize"],[i,"imageSize"])),this.ad(a.track([o,"imageAnchor"],[i,"imageAnchor"])),this.ad(a.track([o,"imageOffset"],[i,"imageOffset"])),this.ad(a.track([o,"textShow"],[i,"textShow"])),this.ad(a.track([o,"textProperty"],[i,"textProperty"])),this.ad(a.track([o,"textDefaultText"],[i,"textDefaultText"])),this.ad(a.track([o,"textColor"],[i,"textColor"])),this.ad(a.track([o,"textBackgroundColor"],[i,"textBackgroundColor"])),this.ad(a.track([o,"textFontFamily"],[i,"textFontFamily"])),this.ad(a.track([o,"textFontSize"],[i,"textFontSize"])),this.ad(a.track([o,"textFontStyle"],[i,"textFontStyle"])),this.ad(a.track([o,"textFontWeight"],[i,"textFontWeight"])),this.ad(a.track([o,"textAnchor"],[i,"textAnchor"])),this.ad(a.track([o,"textOffset"],[i,"textOffset"])),this.ad(a.track([o,"minFeatureVisibleDistance"],[i,"minFeatureVisibleDistance"])),this.ad(a.track([o,"maxFeatureVisibleDistance"],[i,"maxFeatureVisibleDistance"])),this.ad(a.track([o,"heightReference"],[i,"heightReference"])),this.ad(a.track([o,"classificationType"],[i,"classificationType"])),this.ad(i.flyToEvent.disposableOn(s=>{if(e.actived){if(i.flyInParam){const{position:r,rotation:l,flyDuration:c}=i.flyInParam;return ne(e.viewer,r,void 0,l,c),!0}o.flyTo(s&&s*1e3)}}));{const s=async(r,l,c)=>{if(!e.actived)return;const u=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(r,l)));if(!(!u||!(u!=null&&u.positions)))if(u.type=="Point"||u.type=="MultiPoint")ei(e,i,this.id,await this._calculateFeatureHeight(u.type=="MultiPoint"?u.positions.flat():u.positions,i.heightReference,e),1e3,c);else{const d=u.type=="Polygon"||u.type=="MultiPolygon"||u.type=="MultiLineString";let p=[];d?p=u.positions.flat(u.type=="MultiPolygon"?2:1).map(y=>this._calculateFeatureHeight(y,i.fillGround?"CLAMP_TO_GROUND":"NONE",e)):p=u.positions.map(y=>this._calculateFeatureHeight(y,i.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:g,center:m}=a.getMinMaxCorner(p);ei(e,i,this.id,m,a.getDistancesFromPositions([f,g],"NONE")[0],c)}};this.d(i.flyToFeatureEvent.don((r,l,c)=>s(r,l,c))),this.d(i.flyToFeatureIndexEvent.don((r,l)=>s(r,void 0,l)))}}_getFeatureByIndexOrProperties(i,e){var r,l,c,u,d,p,f,g;const{sceneObject:n}=this,o=n.features;if(!o)return;const s=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(s){if(e){let m=s.find(y=>(y==null?void 0:y.properties[i])==e);return{type:m!=null&&m.coordinates?m.type:(r=m==null?void 0:m.geometry)==null?void 0:r.type,positions:(m==null?void 0:m.coordinates)||((l=m==null?void 0:m.geometry)==null?void 0:l.coordinates)}}else if(typeof i=="number")return{type:(c=s[i])!=null&&c.coordinates?s[i].type:(d=(u=s[i])==null?void 0:u.geometry)==null?void 0:d.type,positions:((p=s[i])==null?void 0:p.coordinates)||((g=(f=s[i])==null?void 0:f.geometry)==null?void 0:g.coordinates)}}}async _calculateFeatureHeight(i,e,n){const o=[...i];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await n.getTerrainHeight(o)??0:o[2]+=await n.getTerrainHeight(o)??0,o}};v(Ya,"type",Ya.register("ESCesiumViewer",a.ESGeoJson.type,Ya));let ap=Ya;const Za=class Za extends vt{constructor(e,n){super(e,n);v(this,"_czmGeoESRectangle");v(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new be(n,e.id)),this._czmGeoESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoESRectangle,r=this._geoPolyline;r.arcType="RHUMB",this.dispose(a.track([r,"color"],[e,"strokeColor"])),this.dispose(a.track([r,"width"],[e,"strokeWidth"])),this.dispose(a.track([r,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{const l=()=>{r.show=e.show&&e.stroked,s.show=e.show&&e.filled};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material=void 0};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}{const l=()=>{const c=e.points;if(c&&c.length>=2){const{minPos:u,maxPos:d}=a.getMinMaxCorner(c);s.rectangle=[u[0],u[1],d[0],d[1]],s.height=c[0][2],s.extrudedHeight=c[0][2];const p=c.map(y=>(c&&(y[2]=c[0][2]),y)),f=p[0],g=p[1],m=[f,[f[0],g[1],f[2]],g,[g[0],f[1],g[2]]];r.positions=[...m,f]}else s.rectangle=void 0,r.positions=void 0,s.height=0,s.extrudedHeight=0};l(),this.dispose(e.pointsChanged.disposableOn(()=>l()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmGeoESRectangle:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}};v(Za,"type",Za.register("ESCesiumViewer",a.ESGeoRectangle.type,Za));let lp=Za;class Zr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new Sn(e,n));const{geoPolygon:o}=this;this.dispose(a.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(a.bind([o,"show"],[this,"show"])),this.dispose(a.bind([o,"fill"],[this,"filled"])),this.dispose(a.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(a.bind([o,"ground"],[this,"ground"])),this.dispose(a.bind([o,"outline"],[this,"outline"])),this.dispose(a.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(a.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(a.bind([o,"color"],[this,"color"])),this.dispose(a.bind([o,"depth"],[this,"depth"]));const s=()=>{if(this.positions&&this.positions.length>=2){const r=xu([...this.positions,this.positions[0]]);o.positions=r}else o.positions=void 0};s(),this.dispose(this.positionsChanged.disposableOn(s))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get geoPolygon(){return this._geoPolygon}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,strokeGround:!1,ground:!1,outline:!1,filled:!0,outlineColor:a.reactArray([1,1,1,1]),outlineWidth:1,color:a.reactArrayWithUndefined([1,1,1,.5]),positions:a.reactPositions(void 0),depth:0})})(Zr||(Zr={})),a.extendClassProps(Zr.prototype,Zr.createDefaultProps);const Qa=class Qa extends vt{constructor(e,n){super(e,n);v(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._geoSmoothPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"ground"],[e,"ground"]));{const r=()=>{s.ground=e.ground||e.fillGround};r();const l=this.dv(a.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(l.don(r))}{const r=()=>{s.color=e.filled?e.fillColor:Yr.defaults.fillStyle.color};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}this.dispose(a.track([s,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoSmoothPolygon:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Qa,"type",Qa.register("ESCesiumViewer",Yr.type,Qa));let cp=Qa;const ka=class ka extends fe{constructor(e,n){super(e,n);v(this,"_czmModel");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new rt(n,e.id));const s=this._czmModel;this.d(s.readyEvent.don(l=>{s.gltf.animations&&(s.activeAnimationsJson=s.gltf.animations.map((c,u)=>({index:u,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),e.czmModelReadyEvent.emit(l),e.readyEvent.emit(l)})),this.ad(new Pc(o,this._czmModel)),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"color"],[e,"czmColor"])),this.d(a.track([s,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(a.track([s,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.track([s,"nativeScale"],[e,"czmNativeScale"])),this.d(a.track([s,"scale"],[e,"scale"])),this.ad(a.track([s,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(a.track([s,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const l=c=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:c}:{atmosphereScatteringIntensity:c}};l(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(c=>l(c)))}{const l=()=>{var c,u;(c=e.czmEnvironmentMapManager)!=null&&c.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const c=[...e.rotation??[0,0,0]];c[0]+=e.instances&&e.instances.length!=0?0:90,s.rotation=c};l(),this.d(e.rotationChanged.don(l));{const c=()=>{if(l(),!e.instances){s.instances=e.instances;return}s.instances=e.instances.map(u=>{const d=JSON.parse(JSON.stringify(u));return!d.rotation&&(d.rotation=[0,0,0]),d.rotation[0]+=90,d})};c(),this.ad(e.instancesChanged.don(c))}}this.ad(e.setMaterialEvent.don(l=>{s.setMaterial(l)}));{const l=()=>{const c=[...s.rotation];c[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=c};l(),this.d(s.rotationChanged.don(l))}{const l=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),c=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};c(),this.d(l.don(c))}const r=()=>{s.url=a.ESSceneObject.context.getStrFromEnv(bc(typeof e.url=="string"?e.url:e.url.url))};r(),this.d(e.urlChanged.don(r)),this.d(e.setNodePositionEvent.don((l,c)=>{s.setNodeTranslation(l,c)})),this.d(e.setNodeRotationEvent.don((l,c)=>{s.setNodeRotation(l,c)})),this.d(e.setNodeScaleEvent.don((l,c)=>{s.setNodeScale(l,c)})),this.d(e.printDebugInfoEvent.don(()=>{s.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,n){const{sceneObject:o,czmViewer:s,model:r}=this;return s.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Dt(s,o,n,e,r,!0),!!r):!1}};v(ka,"type",ka.register("ESCesiumViewer",a.ESGltfModel.type,ka));let hp=ka;function zy(t,i){const e=t[0]-i[0],n=t[1]-i[1],o=t[2]-i[2];return Math.sqrt(e*e+n*n+o*o)}class Qr extends a.Destroyable{constructor(e,n){super();v(this,"_pickedEvent",this.disposeVar(new a.Event));v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_distance",this.disposeVar(a.react(0)));v(this,"_surfaceDistance",this.disposeVar(a.react(0)));v(this,"_height",this.disposeVar(a.react(0)));v(this,"_middlePosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_heightPosition",this.disposeVar(a.reactArrayWithUndefined(void 0)));const o=()=>{if(this.positions)if(this.positions.length>=2)if(this._middlePosition.value=[this.positions[0][0],this.positions[0][1],this.positions[1][2]],this._heightPosition.value=[this.positions[0][0],this.positions[0][1],.5*(this.positions[1][2]+this.positions[0][2])],this.arcType===void 0||this.arcType==="GEODESIC"){const r=this._surfaceDistance.value=a.geoDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="RHUMB"){const r=this._surfaceDistance.value=a.geoRhumbDistance(this.positions[0],this.positions[1]),l=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(r*r+l*l)}else if(this.arcType==="NONE"){const r=a.lbhToXyz(this.positions[0]),l=a.lbhToXyz(this.positions[1]);this._distance.value=zy(r,l),this._surfaceDistance.value=zy(a.lbhToXyz(this._middlePosition.value),l),this._height.value=this.positions[1][2]-this.positions[0][2]}else console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`);else this._heightPosition.value=void 0,this._distance.value=0,this._surfaceDistance.value=0,this._height.value=0};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(s.disposableOn(o));{const r=this.disposeVar(new be(e,n));r.ground=!1,r.loop=!1,this.dispose(a.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(a.bind([r,"arcType"],[this,"arcType"])),this.dispose(a.bind([r,"color"],[this,"color"])),this.dispose(a.bind([r,"dashLength"],[this,"dashLength"])),this.dispose(a.bind([r,"dashPattern"],[this,"dashPattern"])),this.dispose(a.bind([r,"gapColor"],[this,"gapColor"])),this.dispose(a.bind([r,"hasArrow"],[this,"hasArrow"])),this.dispose(a.bind([r,"hasDash"],[this,"hasDash"])),this.dispose(a.bind([r,"show"],[this,"show"])),this.dispose(a.bind([r,"width"],[this,"width"])),this.dispose(a.bind([r,"depthTest"],[this,"depthTest"]));{r.loop=!0;const c=()=>{if(this.positions&&this.positions.length===2){const[u,d]=this.positions;r.positions=[u,d,[u[0],u[1],d[2]]]}else r.positions=void 0};c(),this.dispose(this.positionsChanged.disposableOn(c))}this.dispose(this.flyToEvent.disposableOn(c=>{e.actived&&r.flyTo(c)}));const l=this.disposeVar(new We(e,n));this.dispose(a.track([l,"shadowDom"],[this,"shadowDom"])),this.dispose(a.track([l,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(a.track([l,"show"],[this,"show"]));{const c=()=>{l.position=this.heightPosition};c(),this.dispose(this.heightPositionChanged.disposableOn(c))}{const c=()=>{l.innerHTML=ao(`高度: ${Sc(this.height)}`,0)};c(),this.dispose(this.heightChanged.disposableOn(c))}this.ad(l.pickedEvent.don(c=>{Hi(c)===0&&this.pickedEvent.emit(c)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get distance(){return this._distance.value}get distanceChanged(){return this._distance.changed}get surfaceDistance(){return this._surfaceDistance.value}get surfaceDistanceChanged(){return this._surfaceDistance.changed}get height(){return this._height.value}get heightChanged(){return this._height.changed}get middlePosition(){return this._middlePosition.value}get middlePositionChanged(){return this._middlePosition.changed}get heightPosition(){return this._heightPosition.value}get heightPositionChanged(){return this._heightPosition.changed}}(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(void 0),width:1,color:a.reactArray([1,1,1,1]),hasDash:!1,gapColor:a.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})(Qr||(Qr={})),a.extendClassProps(Qr.prototype,Qr.createDefaultProps);const Ka=class Ka extends vt{constructor(e,n){super(e,n);v(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new Qr(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:s}=this;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"]));{const r=()=>{if(e.stroked)s.width=e.strokeWidth;else{s.width=0;return}s.width=e.strokeWidth,s.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(s.hasDash=!0,s.hasArrow=!1):u==="hasArrow"?(s.hasDash=!1,s.hasArrow=!0):(s.hasDash=!1,s.hasArrow=!1);const d=e.strokeStyle;if(d.material==="hasDash"&&d.materialParams)try{const p=d.materialParams;Reflect.has(p,"gapColor")&&(s.gapColor=p.gapColor??[0,0,0,0]),Reflect.has(p,"dashLength")&&(s.dashLength=p.dashLength),Reflect.has(p,"dashPattern")&&(s.dashPattern=p.dashPattern)}catch(p){console.error(p)}else s.gapColor=[0,0,0,0],s.dashLength=0,s.dashPattern=0};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(l.disposableOn(r))}this.dispose(s.pickedEvent.disposableOn(r=>{Hi(r)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(r)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmHeightMeasurement:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Ka,"type",Ka.register("ESCesiumViewer",a.ESHeightMeasurement.type,Ka));let up=Ka;const dp={czmAnimationsStand:[{index:0,name:"Stand",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsWalk:[{index:2,name:"Walk",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}],czmAnimationsRun:[{index:1,name:"Run",loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration"}]},Ja=class Ja extends fe{constructor(e,n){super(e,n);v(this,"_czmModelPrimitive");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new rt(n,this.sceneObject.id));const s=this._czmModelPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"])),this.d(s.readyEvent.don(y=>{e.readyEvent.emit(y)}));{const y=this.dv(a.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),_=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};_(),this.d(y.don(_))}const r=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),d=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),p=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":s.url=r;break;case"police":s.url=l;break;case"pedestrian":s.url=c;break;case"stranger":s.url=u;break;case"suitMan":s.url=d;break;case"suitWoman":s.url=p;break;default:s.url=r;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const g=()=>{const y=e.animation??a.ESHuman.defaults.animation;if(!e.show){s.activeAnimationsJson=void 0;return}y==="walking"?s.activeAnimationsJson=dp.czmAnimationsWalk:y==="standing"?s.activeAnimationsJson=dp.czmAnimationsStand:y==="running"&&(s.activeAnimationsJson=dp.czmAnimationsRun)};g();const m=this.ad(a.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(m.disposableOn(()=>g())),this.ad(new Pc(o,s))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmModelPrimitive:r}=this;return!s.actived||!s.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,n),!0):(r&&Dt(s,o,n,e,r,!0),!!r)}};v(Ja,"type",Ja.register("ESCesiumViewer",a.ESHuman.type,Ja));let pp=Ja;class Ly extends a.Destroyable{constructor(e,n){super();v(this,"_czmGeoCanvasImagePoi");v(this,"flyTo",(e,n)=>{if(this.czmGeoCanvasImagePoi.position){ne(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,jt,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoCanvasImagePoi=this.disposeVar(new _i(n));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(s=>{(e.allowPicking??!1)&&e.pickedEvent.emit(s)}));{const s=d=>{let p=d;return d.includes("inner://")&&(p="${earthsdk3-assets-script-dir}/assets/img/points/"+d.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(bc(p))},r=()=>{const d=s(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=d,e.sizeByContent){const f=new Image;f.src=d,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},l=this.disposeVar(a.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(l.disposableOn(()=>r())),r(),this.d(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.ad(a.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const d=()=>{o.scale=[e.scale[1],e.scale[2]]};d(),this.dispose(e.scaleChanged.don(d))}const c=()=>{const d=e.anchor,p=e.offset;d?o.originRatioAndOffset=[...d,-p[0],-p[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>c())),c(),this.dispose(o.clickEvent.disposableOn(d=>{const{offsetX:p,offsetY:f}=d,m={type:d.button===0?"leftClick":d.button===2?"rightClick":void 0,add:{mousePos:[p,f]}};e.widgetEvent.emit(m)})),this.dispose(o.hoveredChanged.disposableOn(d=>{if(d===void 0)return;const p={type:d?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(p)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Oy extends a.Destroyable{constructor(e,n,o){super();v(this,"_czmGeoImageModel");v(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});v(this,"_isPointEvent",!1);v(this,"flyTo",(e,n)=>{if(this.czmGeoImageModel.position)return ei(this.czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=n,this._czmGeoImageModel=this.disposeVar(new qi(n,e.id));const s=this._czmGeoImageModel;this.ad(n.clickEvent.don(f=>{const g=f==null?void 0:f.pointerEvent;g&&(this._isPointEvent=!0,this._eventInfo={type:g.button==0?"leftClick":g.button==2?"rightClick":"leftClick",add:{mousePos:[g.offsetX,g.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var g,m,y;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((g=this._eventInfo.add)!=null&&g.mousePos)&&Math.abs(f.screenPosition[0]-((m=this._eventInfo.add)==null?void 0:m.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((y=this._eventInfo.add)==null?void 0:y.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const f=n.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((g,m)=>{(g==null?void 0:g.sceneObject)==(m==null?void 0:m.sceneObject)||(g==null?void 0:g.sceneObject)!=e&&(m==null?void 0:m.sceneObject)!=e||(g!=null&&g.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:g==null?void 0:g.screenPosition}},g.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&g.sceneObject.id==e.id&&(s.scale=[s.scale[0]*1.5,s.scale[1]*1.5])),m!=null&&m.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:g==null?void 0:g.screenPosition}},m.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&m.sceneObject.id==e.id&&(s.scale=[s.scale[0]/1.5,s.scale[1]/1.5])))}))});const r=e.sizeByContent,c=(f=>{let g=f;return f.includes("inner://")&&(g="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),a.ESSceneObject.context.getStrFromEnv(bc(g))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=c,u.onload=()=>{if(r)s.size=[u.width/100,u.height/100];else{const f=e.size;s.size=[f[0]/100,f[1]/100]}},s.uri=c,this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),s.pixelSize=void 0,s.useAxis="XZ";{const f=()=>{s.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(s.rotationMode="WithProp",this.d(Ke([s,"rotation"],[e,"rotation"]))),e.rotationType===1&&(s.rotationMode="WithCamera"),e.rotationType===2&&(s.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const d=()=>{const f=e.anchor,g=e.offset;f?s.originRatioAndOffset=[...f,-g[0]/100,-g[1]/100]:s.originRatioAndOffset=[0,0,0,0]},p=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(p.disposableOn(()=>d())),d()}get czmGeoImageModel(){return this._czmGeoImageModel}}const ja=class ja extends Hr{constructor(e,n){super(e,n);v(this,"_resetting");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new a.ObjResettingWithEvent(s,()=>this.sceneObject.screenRender?new Ly(this.sceneObject,this.czmViewer):new Oy(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(ja,"type",ja.register("ESCesiumViewer",a.ESImageLabel.type,ja));let fp=ja;function LA(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const el=class el extends Jt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;{const r=this.ad(a.reactJson(""));{const u=()=>{if(typeof e.url=="string")r.value=a.ESSceneObject.context.getStrFromEnv(e.url);else{const d=e.url;d.url=a.ESSceneObject.context.getStrFromEnv(d.url),r.value=d}};u(),this.ad(e.urlChanged.don(u))}const l=()=>{var m;if(!r.value)return;const u=(((m=e.options)==null?void 0:m.type)??"auto").toLowerCase(),d=e.options??{};let p={type:"UrlTemplateImageryProvider",url:r.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...d},f=r.value,g=typeof f=="string"?f:f.url;if(u==="auto"){const y=g.toLowerCase();if(y.startsWith("ion://")){const P=+y.substring(6);p={...d,assetId:P,type:"IonImageryProvider"}}else if(y.includes("{x}")||y.includes("{y}")||y.includes("{z}"))p.type="UrlTemplateImageryProvider";else if(y.includes("wmts"))p.type="WebMapTileServiceImageryProvider";else if(y.includes("wms"))p.type="WebMapServiceImageryProvider";else{if(g.includes("/tilemapresource.xml")){const _=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=_:f.url=_,p.url=f}p.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&g.includes("/tilemapresource.xml")){const y=g.split("/tilemapresource.xml").join("");typeof f=="string"?f=y:f.url=y,p.url=f}else if(u==="ion"&&g.startsWith("ion://")){const _=+g.substring(6);p={...d,assetId:_,type:"IonImageryProvider"}}p.type=LA(u)}console.log("imageryProvider",p),s.imageryProvider=p};l();const c=this.dv(a.createNextAnimateFrameEvent(r.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(c.don(l))}this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"alpha"],[e,"opacity"])),this.d(a.bind([s,"alpha"],[e,"czmAlpha"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.ad(a.track([s,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(el,"type",el.register("ESCesiumViewer",a.ESImageryLayer.type,el));let gp=el;class OA extends a.Destroyable{constructor(e,n,o,s){super();v(this,"_show");v(this,"_czmESCustomPrimitive");v(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(a.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new De(n,this._sceneObject.id)),this._czmTexture=this.dv(new ze(n));const r=e,l=this._czmESCustomPrimitive,c=this._czmTexture;this.dispose(a.track([l,"show"],[this,"show"])),this.dispose(a.track([l,"show"],[r,"show"])),this.dispose(a.track([l,"allowPicking"],[r,"allowPicking"])),this.dispose(a.track([l,"rotation"],[r,"rotation"])),this.dispose(a.track([l,"position"],[r,"position"])),this.dispose(a.track([l,"scale"],[r,"scale"])),this.ad(r.allowPickingChanged.don(()=>{l.allowPicking=r.allowPicking,l.pass=r.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const p=r.size/2,f=s[0].map(z=>z*p),g=s[1].map(z=>z*p),m=s[2].map(z=>z*p),y=s[3].map(z=>z*p),_=[...f,...g,...m,...y];let P=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(P=P.reverse());const C=[0,0],S=[1,0],x=[1,1],A=[0,1];let R=[];o=="east"||o=="south"?R=[...S,...C,...A,...x]:o=="west"?R=[...S,...x,...A,...C]:o=="top"?R=[...A,...x,...S,...C]:R=[...C,...S,...x,...A],l.indexTypedArray=new Uint16Array(P),l.attributes={position:{typedArray:new Float32Array(_),componentsPerAttribute:3},st:{typedArray:new Float32Array(R),componentsPerAttribute:2}},c.uri=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${r.mode}/${o}.${r.mode!="blueSky"?"png":"jpg"}`);const O=n.getCameraInfo();if(O!=null){const B=a.getDistancesFromPositions([r.position,O.position],"NONE")[0]/(r.size/2*r.autoOpacityFactor);this.changeOpacity(r.autoFollow?1:B)}const N=l.computeLocalAxisedBoundingBoxFromAttribute("position");if(!N)return;const{min:V,max:U}=N;l.setLocalAxisedBoundingBox(V,U)};u();const d=this.disposeVar(a.createNextAnimateFrameEvent(r.sizeChanged,r.modeChanged));this.dispose(d.disposableOn(u))}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}changeOpacity(e){this._czmESCustomPrimitive.uniformMap={u_image:{type:"texture",id:this._czmTexture.id},u_color:[1,1,1,1-e>=0?1-e:0]}}}class NA extends a.Destroyable{constructor(i,e,n){if(super(),!e.viewer)return;let o=!0,s;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{r()}));function r(){var c;if(!((c=e.viewer)!=null&&c.camera))return;const l=e.getCameraInfo();if(l!=null&&(s==null||s.position[0]!=l.position[0]||s.position[1]!=l.position[1]||s.position[2]!=l.position[2]||s.rotation[0]!=l.rotation[0]||s.rotation[1]!=l.rotation[1]||s.rotation[2]!=l.rotation[2])){s=l;const d=a.getDistancesFromPositions([i.position,s.position],"NONE")[0]/(i.size/2*i.autoOpacityFactor);i.autoFollow?(i.position=s.position,o&&(o=!1,n.forEach(p=>{p.changeOpacity(1)}))):n.forEach(p=>{p.changeOpacity(d)})}}r()}}const Ye=class Ye extends fe{constructor(e,n){super(e,n);v(this,"_czmSkyBoxComponents",[]);if(!n.viewer){console.warn("viewer is undefined!");return}!Ye._defaultLocalBox&&Ye._firstLoad&&(Ye._firstLoad=!1,Ye._defaultLocalBox=n.xbsjLocalBoxSources),Ye._eSLocalSkyBoxArr.push(e),this.d(()=>{Ye._eSLocalSkyBoxArr.includes(e)&&Ye._eSLocalSkyBoxArr.splice(Ye._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const s={bottom:[[-1,-1,-1],[1,-1,-1],[1,1,-1],[-1,1,-1]],top:[[-1,-1,1],[1,-1,1],[1,1,1],[-1,1,1]],south:[[-1,-1,-1],[1,-1,-1],[1,-1,1],[-1,-1,1]],north:[[-1,1,-1],[1,1,-1],[1,1,1],[-1,1,1]],east:[[1,-1,-1],[1,1,-1],[1,1,1],[1,-1,1]],west:[[-1,1,-1],[-1,1,1],[-1,-1,1],[-1,-1,-1]]};for(const r in s)if(Object.prototype.hasOwnProperty.call(s,r)){const l=s[r];this._czmSkyBoxComponents.push(this.dv(new OA(e,n,r,l)))}{const r=this.disposeVar(a.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new a.ObjResettingWithEvent(r,()=>(this.ChangeAutoFollow(),new NA(e,n,this._czmSkyBoxComponents))))}{const r=()=>{this.ChangeAutoFollow()},l=this.disposeVar(a.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(l.disposableOn(r))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let n=Ye._eSLocalSkyBoxArr.length-1;n>=0;n--){const o=Ye._eSLocalSkyBoxArr[n];if(o.autoFollow&&o.show){e.xbsjLocalBoxSources={positiveX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/east.${o.mode!="blueSky"?"png":"jpg"}`,negativeX:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/west.${o.mode!="blueSky"?"png":"jpg"}`,positiveY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/bottom.${o.mode!="blueSky"?"png":"jpg"}`,negativeY:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/top.${o.mode!="blueSky"?"png":"jpg"}`,positiveZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/north.${o.mode!="blueSky"?"png":"jpg"}`,negativeZ:`\${earthsdk3-assets-script-dir}/assets/img/skybox/${o.mode}/south.${o.mode!="blueSky"?"png":"jpg"}`};break}n==0&&(e.xbsjLocalBoxSources=Ye._defaultLocalBox)}Ye._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Ye._defaultLocalBox)}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.size??a.ESLocalSkyBox.defaults.size;return o.position?(ei(s,o,n,o.position,r,e,!0),!0):!1}}};v(Ye,"type",Ye.register("ESCesiumViewer",a.ESLocalSkyBox.type,Ye)),v(Ye,"_defaultLocalBox"),v(Ye,"_firstLoad",!0),v(Ye,"_eSLocalSkyBoxArr",[]);let mp=Ye;const li=class li extends fe{constructor(e,n){super(e,n);v(this,"_geoCustomDivPoi");v(this,"_textFunc",this.disposeVar(a.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new We(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.geoCustomDivPoi;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]));{this.dispose(s.pickedEvent.disposableOn(r=>{(e.allowPicking??a.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(r)})),this.dispose(s.innerHtmlMounted.disposableOn(r=>{const l=r.firstElementChild;l&&(l.style.pointerEvents="auto",l.style.cursor="default",l.onclick=c=>s.pickFromDiv(l,{type:"viewerPicking",pointerEvent:c}))}));{const r=()=>{if(!e.position)return;const c=(this.textFunc??li.defaultTextFunc_度格式)(e.position);s.innerHTML=ao(c)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(l.disposableOn(r))}{const r=()=>{n.lonLatFormat??(n.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=n.lonLatFormat=="DECIMAL_DEGREE"?li.defaultTextFunc_度格式:n.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?li.defaultTextFunc_度分格式:li.defaultTextFunc_度分秒格式};r(),this.d(n.lonLatFormatChanged.don(()=>{r()}))}}}get geoCustomDivPoi(){return this._geoCustomDivPoi}get textFunc(){return this._textFunc.value}set textFunc(e){this._textFunc.value=e}get textFuncChanged(){return this._textFunc.changed}flyTo(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,geoCustomDivPoi:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(li,"type",li.register("ESCesiumViewer",a.ESLocationMeasurement.type,li)),v(li,"defaultTextFunc_度格式",e=>{if(!e)return"";const[n=0,o=0,s=0]=e;return`经度: ${n.toFixed(5)}°
1254
1254
  纬度: ${o.toFixed(5)}°
1255
1255
  高度: ${s.toFixed(2)}m`}),v(li,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[n,o,s]=bu(e,!0);return`经度: ${n}
1256
1256
  纬度: ${o}
1257
1257
  高度: ${s}`}),v(li,"defaultTextFunc_度分秒格式",e=>{if(!e)return"";const[n,o,s]=bu(e);return`经度: ${n}
1258
1258
  纬度: ${o}
1259
- 高度: ${s}`});let vp=li;const tl=class tl extends fe{constructor(e,n){super(e,n);v(this,"_czmESParticleSystemPrimitive");if(this._czmESParticleSystemPrimitive=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESParticleSystemPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"updateCallback"],[e,"updateCallback"])),this.dispose(a.track([s,"emissionRate"],[e,"emissionRate"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"scale"],[e,"particleScale"])),this.dispose(a.track([s,"startScale"],[e,"startScale"])),this.dispose(a.track([s,"endScale"],[e,"endScale"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"startColor"],[e,"startColor"])),this.dispose(a.track([s,"endColor"],[e,"endColor"])),this.dispose(a.track([s,"sizeInMeters"],[e,"sizeInMeters"])),this.dispose(a.track([s,"speed"],[e,"speed"])),this.dispose(a.track([s,"minimumSpeed"],[e,"minimumSpeed"])),this.dispose(a.track([s,"maximumSpeed"],[e,"maximumSpeed"])),this.dispose(a.track([s,"lifetime"],[e,"lifetime"])),this.dispose(a.track([s,"particleLife"],[e,"particleLife"])),this.dispose(a.track([s,"minimumParticleLife"],[e,"minimumParticleLife"])),this.dispose(a.track([s,"maximumParticleLife"],[e,"maximumParticleLife"])),this.dispose(a.track([s,"mass"],[e,"mass"])),this.dispose(a.track([s,"minimumMass"],[e,"minimumMass"])),this.dispose(a.track([s,"maximumMass"],[e,"maximumMass"])),this.dispose(a.track([s,"imageSize"],[e,"imageSize"])),this.dispose(a.track([s,"minimumImageSize"],[e,"minimumImageSize"])),this.dispose(a.track([s,"maximumImageSize"],[e,"maximumImageSize"])),this.dispose(a.track([s,"image"],[e,"image"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"translation"],[e,"translation"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"bursts"],[e,"bursts"])),this.dispose(a.track([s,"emitter"],[e,"emitter"])),this.dispose(a.track([s,"ratio"],[e,"ratio"])),this.dispose(a.track([s,"playingLoop"],[e,"playingLoop"])),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,"playingSpeed"],[e,"playingSpeed"]))}get czmESParticleSystemPrimitive(){return this._czmESParticleSystemPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESParticleSystemPrimitive:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,jt,e),o.flyOverEvent.emit(n,"over",s),!0}}};v(tl,"type",tl.register("ESCesiumViewer",a.ESParticleSystemPrimitive.type,tl));let yp=tl;async function VA(t){const i=["Flag01","Flag02","Linear02","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"],e=["CircularV05","Diamond01"],n=["Flag01","Flag02","Linear02","Linear03","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"];let o=[];const s="${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/",r=i.includes(t)?void 0:await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/icon.png`)),l=e.includes(t)?void 0:await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/anchor.png`));for(let d=1;d<=(YA[t]??3);d++)o.push(await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/textBox_0${d}.png`)));const c=n.includes(t)?void 0:await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/iconBox.png`)),u=o.filter(d=>d!=null);return{icon:r,anchor:l,iconBox:c,textBox:u}}function UA(t,i,e,n,o,s){var m,y,_;const r={iconBox:n,icon:o,anchor:s},l=document.createElement("div");l.classList.add("czmPoi2dDiv"),["SquareH","CircularH","Flag","Linear01"].some(P=>t.includes(P))?l.innerHTML=HA(t,r,i):l.innerHTML=$A(t,r,i);const{textDiv:u,height:d}=qA(e);let p;t=="Linear03"&&o&&(p=document.createElement("img"),p.classList.add(`${t}-icon`),p.src=o.url,p.style.width=`${o.width}px`,p.style.height=`${o.height}px`,p.style.position="absolute",p.style.top="2px");const f=l.querySelector(".textDiv");if(f&&f.nextElementSibling){const P=(m=f.nextElementSibling.lastElementChild)==null?void 0:m.getAttribute("style");p?(f.nextElementSibling.insertAdjacentElement("afterbegin",p),(y=f.nextElementSibling.lastElementChild)==null||y.setAttribute("style",P+`;margin-left: ${o==null?void 0:o.width}px;`)):["Stranger","Man","Woman"].some(C=>t.includes(C))&&((_=f.nextElementSibling.lastElementChild)==null||_.setAttribute("style",P+";margin-left: 50px;"))}f&&(f.innerHTML=u);const{poi2DCssObj:g}=WA(t,s,n,d);return{div:l,styleObj:g}}function WA(t,i,e,n){const o=GA(t,i,e),s={img:"display:inline-block !important;",icon:`top: ${((e==null?void 0:e.height)??0)*(t=="CircularV05"?.4:.5)}px !important;`,anchor:`top:${e!=null&&e.height?e.height+(["Diamond02","Linear01"].includes(t)?0:(i==null?void 0:i.height)??0):0}px !important;
1259
+ 高度: ${s}`});let vp=li;const tl=class tl extends fe{constructor(e,n){super(e,n);v(this,"_czmESParticleSystemPrimitive");if(this._czmESParticleSystemPrimitive=this.disposeVar(new bi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESParticleSystemPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"updateCallback"],[e,"updateCallback"])),this.dispose(a.track([s,"emissionRate"],[e,"emissionRate"])),this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"scale"],[e,"particleScale"])),this.dispose(a.track([s,"startScale"],[e,"startScale"])),this.dispose(a.track([s,"endScale"],[e,"endScale"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"startColor"],[e,"startColor"])),this.dispose(a.track([s,"endColor"],[e,"endColor"])),this.dispose(a.track([s,"sizeInMeters"],[e,"sizeInMeters"])),this.dispose(a.track([s,"speed"],[e,"speed"])),this.dispose(a.track([s,"minimumSpeed"],[e,"minimumSpeed"])),this.dispose(a.track([s,"maximumSpeed"],[e,"maximumSpeed"])),this.dispose(a.track([s,"lifetime"],[e,"lifetime"])),this.dispose(a.track([s,"particleLife"],[e,"particleLife"])),this.dispose(a.track([s,"minimumParticleLife"],[e,"minimumParticleLife"])),this.dispose(a.track([s,"maximumParticleLife"],[e,"maximumParticleLife"])),this.dispose(a.track([s,"mass"],[e,"mass"])),this.dispose(a.track([s,"minimumMass"],[e,"minimumMass"])),this.dispose(a.track([s,"maximumMass"],[e,"maximumMass"])),this.dispose(a.track([s,"imageSize"],[e,"imageSize"])),this.dispose(a.track([s,"minimumImageSize"],[e,"minimumImageSize"])),this.dispose(a.track([s,"maximumImageSize"],[e,"maximumImageSize"])),this.dispose(a.track([s,"image"],[e,"image"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"translation"],[e,"translation"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"bursts"],[e,"bursts"])),this.dispose(a.track([s,"emitter"],[e,"emitter"])),this.dispose(a.track([s,"ratio"],[e,"ratio"])),this.dispose(a.track([s,"playingLoop"],[e,"playingLoop"])),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,"playingSpeed"],[e,"playingSpeed"]))}get czmESParticleSystemPrimitive(){return this._czmESParticleSystemPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESParticleSystemPrimitive:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const l=r.position;return ne(s.viewer,l,100,jt,e),o.flyOverEvent.emit(n,"over",s),!0}}};v(tl,"type",tl.register("ESCesiumViewer",a.ESParticleSystemPrimitive.type,tl));let yp=tl;async function BA(t){const i=["Flag01","Flag02","Linear02","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"],e=["CircularV05","Diamond01"],n=["Flag01","Flag02","Linear02","Linear03","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"];let o=[];const s="${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/",r=i.includes(t)?void 0:await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/icon.png`)),l=e.includes(t)?void 0:await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/anchor.png`));for(let d=1;d<=(XA[t]??3);d++)o.push(await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/textBox_0${d}.png`)));const c=n.includes(t)?void 0:await co(a.ESSceneObject.context.getStrFromEnv(s+`/${t}/iconBox.png`)),u=o.filter(d=>d!=null);return{icon:r,anchor:l,iconBox:c,textBox:u}}function VA(t,i,e,n,o,s){var m,y,_;const r={iconBox:n,icon:o,anchor:s},l=document.createElement("div");l.classList.add("czmPoi2dDiv"),["SquareH","CircularH","Flag","Linear01"].some(P=>t.includes(P))?l.innerHTML=GA(t,r,i):l.innerHTML=HA(t,r,i);const{textDiv:u,height:d}=$A(e);let p;t=="Linear03"&&o&&(p=document.createElement("img"),p.classList.add(`${t}-icon`),p.src=o.url,p.style.width=`${o.width}px`,p.style.height=`${o.height}px`,p.style.position="absolute",p.style.top="2px");const f=l.querySelector(".textDiv");if(f&&f.nextElementSibling){const P=(m=f.nextElementSibling.lastElementChild)==null?void 0:m.getAttribute("style");p?(f.nextElementSibling.insertAdjacentElement("afterbegin",p),(y=f.nextElementSibling.lastElementChild)==null||y.setAttribute("style",P+`;margin-left: ${o==null?void 0:o.width}px;`)):["Stranger","Man","Woman"].some(C=>t.includes(C))&&((_=f.nextElementSibling.lastElementChild)==null||_.setAttribute("style",P+";margin-left: 50px;"))}f&&(f.innerHTML=u);const{poi2DCssObj:g}=UA(t,s,n,d);return{div:l,styleObj:g}}function UA(t,i,e,n){const o=WA(t,i,e),s={img:"display:inline-block !important;",icon:`top: ${((e==null?void 0:e.height)??0)*(t=="CircularV05"?.4:.5)}px !important;`,anchor:`top:${e!=null&&e.height?e.height+(["Diamond02","Linear01"].includes(t)?0:(i==null?void 0:i.height)??0):0}px !important;
1260
1260
  left: calc(50% - ${((i==null?void 0:i.width)??0)/2}px)!important;`,textBoxTransverseParent:`height:${o}px !important;`,textBoxTransverse:`
1261
1261
  margin-left:${i&&!["Flag02","Linear01","CircularH02","CircularH01"].includes(t)?t.includes("Flag01")?-i.width/2+2:i.height:t=="CircularH01"?15:t=="CircularH02"?-2:2}px !important;
1262
1262
  line-height: ${t=="CircularH01"?n+5:t=="Linear01"?e==null?void 0:e.height:n}px !important;
@@ -1270,7 +1270,7 @@ ${Ry}
1270
1270
  .czmPoi2dDiv .${t}-textBoxTransverse {${s.textBoxTransverse}}
1271
1271
  .czmPoi2dDiv .${t}-textBoxVertical {${s.textBoxVertical}}
1272
1272
  .czmPoi2dDiv .${t}-textBoxVertical+div {${s.textBoxVerticalBrother}}
1273
- `,poi2DCssObj:s}}function GA(t,i,e){return e==null?i==null?void 0:i.height:i==null?e.height:e.height+i.height*(["Diamond02","Linear01","Linear02","Linear03"].includes(t)?1:2)}function HA(t,i,e){const{iconBox:n,icon:o,anchor:s}=i;let r="";return n&&o&&(r+=`<img src="${n.url}" class="${t}-iconBox" style="text-align:center !important"/>
1273
+ `,poi2DCssObj:s}}function WA(t,i,e){return e==null?i==null?void 0:i.height:i==null?e.height:e.height+i.height*(["Diamond02","Linear01","Linear02","Linear03"].includes(t)?1:2)}function GA(t,i,e){const{iconBox:n,icon:o,anchor:s}=i;let r="";return n&&o&&(r+=`<img src="${n.url}" class="${t}-iconBox" style="text-align:center !important"/>
1274
1274
  <img src="${o.url}" class="${t}-icon"
1275
1275
  style="{{icon}} position:absolute !important;
1276
1276
  top: ${n.height*.5}px !important;
@@ -1300,7 +1300,7 @@ ${Ry}
1300
1300
  </span>
1301
1301
  </div>
1302
1302
  </div>
1303
- </div>`}function $A(t,i,e){const{iconBox:n,icon:o,anchor:s}=i;let r="";return n!=null&&o!=null&&(r+=`<img src="${n.url}" class="${t}-iconBox" style="width:${n.width}px !important;height:${n.height}px !important;text-align:center !important"/>
1303
+ </div>`}function HA(t,i,e){const{iconBox:n,icon:o,anchor:s}=i;let r="";return n!=null&&o!=null&&(r+=`<img src="${n.url}" class="${t}-iconBox" style="width:${n.width}px !important;height:${n.height}px !important;text-align:center !important"/>
1304
1304
  <img class="${t}-icon" src="${o.url}"
1305
1305
  style="{{icon}} width:${o.width}px !important;
1306
1306
  height:${o.height}px !important;
@@ -1330,11 +1330,11 @@ ${Ry}
1330
1330
  <div style="{{textBoxVerticalBrother}} position: relative !important;">
1331
1331
  ${r}
1332
1332
  </div>
1333
- </div>`}function qA(t){let i="",e=0,n=0;for(let o=0;o<t.length;o+=2)n+=t[o].width;for(let o=0;o<t.length;o++)t.length==1?i+=`<img src="${t[o].url}" style="{{img}} width: 100% !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`:o%2==1?i+=`<img src="${t[o].url}" style="{{img}}
1333
+ </div>`}function $A(t){let i="",e=0,n=0;for(let o=0;o<t.length;o+=2)n+=t[o].width;for(let o=0;o<t.length;o++)t.length==1?i+=`<img src="${t[o].url}" style="{{img}} width: 100% !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`:o%2==1?i+=`<img src="${t[o].url}" style="{{img}}
1334
1334
  width: calc(${100/Math.floor(t.length/2)}% - ${n/Math.floor(t.length/2)}px) !important;
1335
1335
  height: ${t[o].height}px !important;
1336
1336
  vertical-align: top !important"
1337
- />`:i+=`<img src="${t[o].url}" style="{{img}} width: ${t[o].width}px !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`,e=e>t[o].height?e:t[o].height;return{textDiv:i,height:e}}function XA(t,i){for(let e in i){const n=new RegExp("\\{\\{"+e+"\\}\\}","g");t=t.replace(n,i[e])}return t}const YA={SquareH01:1,SquareH02:3,SquareV01:5,SquareV02:5,SquareV03:5,SquareV04:3,Flag01:3,Flag02:3,Linear01:0,Linear02:3,Linear03:3,CircularH01:3,CircularH02:3,CircularV01:1,CircularV02:3,CircularV03:3,CircularV04:3,CircularV05:2,P3D01:3,P3D02:3,P3D03:1,P3D04:3,P3D05:1,P3D06:1,P3D07:1,Diamond01:3,Diamond02:3},ZA=`
1337
+ />`:i+=`<img src="${t[o].url}" style="{{img}} width: ${t[o].width}px !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`,e=e>t[o].height?e:t[o].height;return{textDiv:i,height:e}}function qA(t,i){for(let e in i){const n=new RegExp("\\{\\{"+e+"\\}\\}","g");t=t.replace(n,i[e])}return t}const XA={SquareH01:1,SquareH02:3,SquareV01:5,SquareV02:5,SquareV03:5,SquareV04:3,Flag01:3,Flag02:3,Linear01:0,Linear02:3,Linear03:3,CircularH01:3,CircularH02:3,CircularV01:1,CircularV02:3,CircularV03:3,CircularV04:3,CircularV05:2,P3D01:3,P3D02:3,P3D03:1,P3D04:3,P3D05:1,P3D06:1,P3D07:1,Diamond01:3,Diamond02:3},YA=`
1338
1338
  <div class="{{CustomContainer}}" style="position: relative !important;">
1339
1339
  <div style="position:relative !important; width: {{IMAGE_WIDTH}}; height: {{IMAGE_HEIGHT}};">
1340
1340
  <img src="{{IMAGE_SRC}}" alt="图片icon" class="{{CustomImage}} Custom-anchor" style="position: absolute !important; width: {{IMAGE_WIDTH}}; height: {{IMAGE_HEIGHT}};">
@@ -1346,7 +1346,7 @@ ${Ry}
1346
1346
  </div>
1347
1347
  </div>
1348
1348
  </div>
1349
- `,QA=async(t,i)=>{const e=(i==null?void 0:i.fontSize)??a.ESPoi2D.defaults.style.fontSize,n=(i==null?void 0:i.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(i==null?void 0:i.imageSize)??a.ESPoi2D.defaults.style.imageSize,s=(i==null?void 0:i.text)??a.ESPoi2D.defaults.style.text,r=(i==null?void 0:i.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",l=(i==null?void 0:i.textBackgroundColor)??a.ESPoi2D.defaults.style.textBackgroundColor,c=(i==null?void 0:i.textBackgroundSize)??a.ESPoi2D.defaults.style.textBackgroundSize,u=(i==null?void 0:i.textColor)??a.ESPoi2D.defaults.style.textColor,d=(i==null?void 0:i.textOffset)??a.ESPoi2D.defaults.style.textOffset;let p=ZA;p=p.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),p=p.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),p=p.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),p=p.replace(/{{FONT_SIZE}}/g,e+"px"),p=p.replace(/{{IMAGE_SRC}}/g,a.ESSceneObject.context.getStrFromEnv(n)),p=p.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),p=p.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),p=p.replace(/{{TEXT}}/g,s),p=p.replace(/{{TEXT_BACKGROUND}}/g,a.ESSceneObject.context.getStrFromEnv(r)),p=p.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${l.map(g=>g*255).join(",")})`),p=p.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,c[0]+"px"),p=p.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,c[1]+"px"),p=p.replace(/{{TEXT_COLOR}}/g,`rgb(${u.map(g=>g*255).join(",")})`),p=p.replace(/{{TEXT_OFFSET_X}}/g,d[0]+"px"),p=p.replace(/{{TEXT_OFFSET_Y}}/g,d[1]+"px");const f=document.createElement("div");return f.innerHTML=p,[f.children[0].children[0],f.children[0].children[1]]},$e=class $e extends Hr{constructor(e,n){super(e,n);v(this,"_widgetComponent");v(this,"_customWidgetComponent");v(this,"_textBox",[]);v(this,"_iconBox");v(this,"_icon");v(this,"_anchor");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.ad(new a.Event),r=this.ad(new a.Event);{let c;const u=this.ad(a.createNextAnimateFrameEvent(e.screenRenderChanged,r));this.customWidgetComponent=this.disposeVar(new a.ObjResettingWithEvent(u,()=>{if(!(!c||e.mode!="Custom"))return e.screenRender?new Pn(e,n,c[1],!0,!1):new Mc(e,n,c[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new a.ObjResettingWithEvent(u,()=>{if(c)return e.screenRender?new Pn(e,n,c instanceof HTMLDivElement?c:c[0],!0,!1):new Mc(e,n,c instanceof HTMLDivElement?c:c[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const d=this.dv(a.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,s));this.ad(d.don(async()=>{var p;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const f=e.style[Object.keys(e.style).filter(y=>y.toUpperCase()=="TEXT")[0]]??e.name,{div:g,styleObj:m}=UA(e.mode,f,this._textBox,this._iconBox,this._icon,this._anchor);c=g,c.innerHTML=XA(c.innerHTML,m)}else{const f=await QA(e.id,{...e.style,text:((p=e.style)==null?void 0:p.text)??e.name});c=[f[0],f[1]]}r.emit()}))}{const c=this.ad(a.createProcessingFromAsyncFunc(async f=>{const g=e.mode;$e.modeCache.value={...$e.modeCache.value,[g]:void 0},await f.promise(VA(g)).then(m=>{$e.modeCache.value={...$e.modeCache.value,[g]:m},this._icon=m.icon,this._anchor=m.anchor,this._iconBox=m.iconBox,this._textBox=m.textBox,s.emit()})}));let u=null,d=null;const p=()=>{var f,g,m,y;if(e.mode=="Custom"){s.emit();return}if(Reflect.has($e.modeCache.value,e.mode))if($e.modeCache.value[e.mode])this._icon=(f=$e.modeCache.value[e.mode])==null?void 0:f.icon,this._anchor=(g=$e.modeCache.value[e.mode])==null?void 0:g.anchor,this._iconBox=(m=$e.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((y=$e.modeCache.value[e.mode])==null?void 0:y.textBox)??[],s.emit();else{if(u)return;u=$e.modeCache.changed.don(()=>{var _,P,C,S;$e.modeCache.value[e.mode]&&(this._icon=(_=$e.modeCache.value[e.mode])==null?void 0:_.icon,this._anchor=(P=$e.modeCache.value[e.mode])==null?void 0:P.anchor,this._iconBox=(C=$e.modeCache.value[e.mode])==null?void 0:C.iconBox,this._textBox=((S=$e.modeCache.value[e.mode])==null?void 0:S.textBox)??[],s.emit(),u&&u(),u=null)})}else if(!c.isRunning)c.restart();else{if(d)return;d=c.completeEvent.donce(()=>{d&&d(),d=null,c.restart()})}};p(),this.d(e.modeChanged.don(p))}const l=this.ad(new a.Event);{const c=this.dv(a.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),u=()=>{const d=this.widgetComponent.obj,p=e.autoAnchor?d.defaultAnchor:e.anchor,f=e.offset;if(d instanceof Pn)p?(d.czmGeoCustomDivPoi.originRatioAndOffset=[...p,-f[0],-f[1]],d.widgetInfo.style.transformOrigin=`${p[0]*100}% ${p[1]*100}%`):d.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let g=100,m=100;e.sizeByContent&&d.domSize?(g=d.domSize.width/100,m=d.domSize.height/100):(g=e.size[0]/100,m=e.size[1]/100),p?d.czmCustomPrimitive.localPosition=[p[0]*g-f[0]/100,0,p[1]*m-f[1]/100]:d.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&l.emit()};this.d(c.don(u)),this.ad(new a.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const d=new a.Destroyable;return u(),d.d(this.widgetComponent.obj.defaultAnchorChanged.don(u)),d}))}{const c=this.dv(a.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,l)),u=()=>{var P,C,S;if(e.mode!="Custom")return;const d=this.customWidgetComponent.obj;if(!d)return;const p=((P=e.style)==null?void 0:P.imageSize)??a.ESPoi2D.defaults.style.imageSize,f=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,g=((C=e.style)==null?void 0:C.textBoxAlign)??a.ESPoi2D.defaults.style.textBoxAlign,m=g=="start"?0:g=="center"?.5:1,y=((S=e.style)==null?void 0:S.textBoxOffset)??a.ESPoi2D.defaults.style.textBoxOffset,_=e.offset;if(d instanceof Pn)f?(d.czmGeoCustomDivPoi.originRatioAndOffset=[m,.5,-_[0]-y[0]+p[0]*(f[0]-.5),-_[1]-y[1]+p[1]*(f[1]-.5)],d.widgetInfo.style.transformOrigin=`${m*100}% ${.5*100}%`):d.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let x=100,A=100;e.sizeByContent&&d.domSize?(x=d.domSize.width/100,A=d.domSize.height/100):(x=e.size[0]/100,A=e.size[1]/100),f?d.czmCustomPrimitive.localPosition=[m*x+(-_[0]-y[0]+p[0]*(f[0]-.5))/100,0,.5*A+(-_[1]-y[1]+p[1]*(f[1]-.5))/100]:d.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(c.don(u));{const d=this.ad(a.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new a.ObjResettingWithEvent(d,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const p=new a.Destroyable,f=this.customWidgetComponent.obj,g=()=>{var m,y,_,P;f&&(f instanceof Pn?(((m=e.style)==null?void 0:m.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(C=>{var x,A;const S=(x=lo(C,"pickResult"))==null?void 0:x.pointerEvent;S&&(f.czmGeoCustomDivPoi.show=e.show&&(((A=e.style)==null?void 0:A.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow)&&S.type=="mouseenter")}))):f.czmGeoCustomDivPoi.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow):(((_=e.style)==null?void 0:_.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(C=>{var S;C&&(f.czmCustomPrimitive.show=e.show&&(((S=e.style)==null?void 0:S.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow)&&C.type=="mouseEnter")}))):f.czmCustomPrimitive.show=e.show&&(((P=e.style)==null?void 0:P.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow))};return g(),p.ad(e.styleChanged.don(g)),p}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,n){const{sceneObject:o,czmViewer:s,widgetComponent:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.obj)r.obj.flyTo(e,n);else{const l=setTimeout(()=>{clearTimeout(l),this.flyTo(e,n)},200)}return o.flyOverEvent.emit(n,"over",s),!0}visibleDistance(e,n){var o,s,r,l,c;if((o=n.viewer)!=null&&o.camera&&e.show){const u=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let d=!1;e.minVisibleDistance<e.maxVisibleDistance?d=e.minVisibleDistance<u&&u<e.maxVisibleDistance:e.maxVisibleDistance==0&&(d=u>e.minVisibleDistance);const p=this.widgetComponent.obj,f=this.customWidgetComponent.obj;if(!p)return;p instanceof Pn?(p.czmGeoCustomDivPoi.show=e.show&&d,(((s=e.style)==null?void 0:s.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmGeoCustomDivPoi.show=e.show&&d&&(((r=e.style)==null?void 0:r.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow))):(p.czmCustomPrimitive.show=e.show&&d,(((l=e.style)==null?void 0:l.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmCustomPrimitive.show=e.show&&d&&(((c=e.style)==null?void 0:c.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow)))}}};v($e,"type",$e.register("ESCesiumViewer",a.ESPoi2D.type,$e)),v($e,"modeCache",a.react({}));let wp=$e;const il=class il extends fe{constructor(e,n){super(e,n);v(this,"_czmModelPoi3D");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.dv(a.createNextAnimateFrameEvent(e.modeChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{let{mode:r}=e;const l=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${r.charAt(0).toLocaleLowerCase()+r.slice(1)}/SM_${["triangle","diamond"].includes(r)?"POI":"3dPoi"}_${r.charAt(0).toUpperCase()+r.slice(1)}.glb`);return this._czmModelPoi3D=new kA(e,n,l)}))}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;if(e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,n),!0):!1:!1}};v(il,"type",il.register("ESCesiumViewer",a.ESPoi3D.type,il));let Cp=il;class kA extends a.Destroyable{constructor(e,n,o){super();v(this,"czmModel");this._sceneObject=e,this._czmViewer=n,this._modelUrl=o,this.czmModel=this.ad(new rt(this._czmViewer,this._sceneObject.id)),this.d(this.czmModel.readyEvent.don(c=>{this.czmModel.gltf.animations&&(this.czmModel.activeAnimationsJson=this.czmModel.gltf.animations.map((u,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),this._updateMaterial(this._sceneObject,this.czmModel)})),this.ad(new Pc(n.viewer,this.czmModel));const s=this._sceneObject,r=this.czmModel;r.url=this._modelUrl,this.d(a.bind([r,"position"],[s,"position"])),this.d(Ke([r,"rotation"],[s,"rotation"])),this.d(a.track([r,"scale"],[s,"scale"])),this.d(a.track([r,"show"],[s,"show"]));{const c=this.dv(a.createNextAnimateFrameEvent(s.allowPickingChanged,s.editingChanged)),u=()=>{s.allowPicking&&!s.editing?r.allowPicking=!0:r.allowPicking=!1};u(),this.d(c.don(u))}const l=this.dv(a.createNextAnimateFrameEvent(s.nameChanged,s.styleChanged));this.d(l.don(()=>this._updateMaterial(s,r)))}async _updateMaterial(e,n){var r,l;const o=document.createElement("div");o.style.position="absolute",o.style.zIndex="-1",o.style.bottom="108px",o.style.right="0px";const s=e.style[Object.keys(e.style).filter(c=>c.toUpperCase()==="TEXT")[0]]??e.name;o.innerHTML=`<div style="width: 512px; height: 128px;color: #fff;text-align: center;line-height: 128px;font-size: 50px;margin: 0 auto;">
1349
+ `,ZA=async(t,i)=>{const e=(i==null?void 0:i.fontSize)??a.ESPoi2D.defaults.style.fontSize,n=(i==null?void 0:i.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(i==null?void 0:i.imageSize)??a.ESPoi2D.defaults.style.imageSize,s=(i==null?void 0:i.text)??a.ESPoi2D.defaults.style.text,r=(i==null?void 0:i.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",l=(i==null?void 0:i.textBackgroundColor)??a.ESPoi2D.defaults.style.textBackgroundColor,c=(i==null?void 0:i.textBackgroundSize)??a.ESPoi2D.defaults.style.textBackgroundSize,u=(i==null?void 0:i.textColor)??a.ESPoi2D.defaults.style.textColor,d=(i==null?void 0:i.textOffset)??a.ESPoi2D.defaults.style.textOffset;let p=YA;p=p.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),p=p.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),p=p.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),p=p.replace(/{{FONT_SIZE}}/g,e+"px"),p=p.replace(/{{IMAGE_SRC}}/g,a.ESSceneObject.context.getStrFromEnv(n)),p=p.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),p=p.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),p=p.replace(/{{TEXT}}/g,s),p=p.replace(/{{TEXT_BACKGROUND}}/g,a.ESSceneObject.context.getStrFromEnv(r)),p=p.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${l.map(g=>g*255).join(",")})`),p=p.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,c[0]+"px"),p=p.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,c[1]+"px"),p=p.replace(/{{TEXT_COLOR}}/g,`rgb(${u.map(g=>g*255).join(",")})`),p=p.replace(/{{TEXT_OFFSET_X}}/g,d[0]+"px"),p=p.replace(/{{TEXT_OFFSET_Y}}/g,d[1]+"px");const f=document.createElement("div");return f.innerHTML=p,[f.children[0].children[0],f.children[0].children[1]]},$e=class $e extends Hr{constructor(e,n){super(e,n);v(this,"_widgetComponent");v(this,"_customWidgetComponent");v(this,"_textBox",[]);v(this,"_iconBox");v(this,"_icon");v(this,"_anchor");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.ad(new a.Event),r=this.ad(new a.Event);{let c;const u=this.ad(a.createNextAnimateFrameEvent(e.screenRenderChanged,r));this.customWidgetComponent=this.disposeVar(new a.ObjResettingWithEvent(u,()=>{if(!(!c||e.mode!="Custom"))return e.screenRender?new Pn(e,n,c[1],!0,!1):new Mc(e,n,c[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new a.ObjResettingWithEvent(u,()=>{if(c)return e.screenRender?new Pn(e,n,c instanceof HTMLDivElement?c:c[0],!0,!1):new Mc(e,n,c instanceof HTMLDivElement?c:c[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const d=this.dv(a.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,s));this.ad(d.don(async()=>{var p;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const f=e.style[Object.keys(e.style).filter(y=>y.toUpperCase()=="TEXT")[0]]??e.name,{div:g,styleObj:m}=VA(e.mode,f,this._textBox,this._iconBox,this._icon,this._anchor);c=g,c.innerHTML=qA(c.innerHTML,m)}else{const f=await ZA(e.id,{...e.style,text:((p=e.style)==null?void 0:p.text)??e.name});c=[f[0],f[1]]}r.emit()}))}{const c=this.ad(a.createProcessingFromAsyncFunc(async f=>{const g=e.mode;$e.modeCache.value={...$e.modeCache.value,[g]:void 0},await f.promise(BA(g)).then(m=>{$e.modeCache.value={...$e.modeCache.value,[g]:m},this._icon=m.icon,this._anchor=m.anchor,this._iconBox=m.iconBox,this._textBox=m.textBox,s.emit()})}));let u=null,d=null;const p=()=>{var f,g,m,y;if(e.mode=="Custom"){s.emit();return}if(Reflect.has($e.modeCache.value,e.mode))if($e.modeCache.value[e.mode])this._icon=(f=$e.modeCache.value[e.mode])==null?void 0:f.icon,this._anchor=(g=$e.modeCache.value[e.mode])==null?void 0:g.anchor,this._iconBox=(m=$e.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((y=$e.modeCache.value[e.mode])==null?void 0:y.textBox)??[],s.emit();else{if(u)return;u=$e.modeCache.changed.don(()=>{var _,P,C,S;$e.modeCache.value[e.mode]&&(this._icon=(_=$e.modeCache.value[e.mode])==null?void 0:_.icon,this._anchor=(P=$e.modeCache.value[e.mode])==null?void 0:P.anchor,this._iconBox=(C=$e.modeCache.value[e.mode])==null?void 0:C.iconBox,this._textBox=((S=$e.modeCache.value[e.mode])==null?void 0:S.textBox)??[],s.emit(),u&&u(),u=null)})}else if(!c.isRunning)c.restart();else{if(d)return;d=c.completeEvent.donce(()=>{d&&d(),d=null,c.restart()})}};p(),this.d(e.modeChanged.don(p))}const l=this.ad(new a.Event);{const c=this.dv(a.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),u=()=>{const d=this.widgetComponent.obj,p=e.autoAnchor?d.defaultAnchor:e.anchor,f=e.offset;if(d instanceof Pn)p?(d.czmGeoCustomDivPoi.originRatioAndOffset=[...p,-f[0],-f[1]],d.widgetInfo.style.transformOrigin=`${p[0]*100}% ${p[1]*100}%`):d.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let g=100,m=100;e.sizeByContent&&d.domSize?(g=d.domSize.width/100,m=d.domSize.height/100):(g=e.size[0]/100,m=e.size[1]/100),p?d.czmCustomPrimitive.localPosition=[p[0]*g-f[0]/100,0,p[1]*m-f[1]/100]:d.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&l.emit()};this.d(c.don(u)),this.ad(new a.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const d=new a.Destroyable;return u(),d.d(this.widgetComponent.obj.defaultAnchorChanged.don(u)),d}))}{const c=this.dv(a.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,l)),u=()=>{var P,C,S;if(e.mode!="Custom")return;const d=this.customWidgetComponent.obj;if(!d)return;const p=((P=e.style)==null?void 0:P.imageSize)??a.ESPoi2D.defaults.style.imageSize,f=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,g=((C=e.style)==null?void 0:C.textBoxAlign)??a.ESPoi2D.defaults.style.textBoxAlign,m=g=="start"?0:g=="center"?.5:1,y=((S=e.style)==null?void 0:S.textBoxOffset)??a.ESPoi2D.defaults.style.textBoxOffset,_=e.offset;if(d instanceof Pn)f?(d.czmGeoCustomDivPoi.originRatioAndOffset=[m,.5,-_[0]-y[0]+p[0]*(f[0]-.5),-_[1]-y[1]+p[1]*(f[1]-.5)],d.widgetInfo.style.transformOrigin=`${m*100}% ${.5*100}%`):d.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let x=100,A=100;e.sizeByContent&&d.domSize?(x=d.domSize.width/100,A=d.domSize.height/100):(x=e.size[0]/100,A=e.size[1]/100),f?d.czmCustomPrimitive.localPosition=[m*x+(-_[0]-y[0]+p[0]*(f[0]-.5))/100,0,.5*A+(-_[1]-y[1]+p[1]*(f[1]-.5))/100]:d.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(c.don(u));{const d=this.ad(a.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new a.ObjResettingWithEvent(d,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const p=new a.Destroyable,f=this.customWidgetComponent.obj,g=()=>{var m,y,_,P;f&&(f instanceof Pn?(((m=e.style)==null?void 0:m.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(C=>{var x,A;const S=(x=lo(C,"pickResult"))==null?void 0:x.pointerEvent;S&&(f.czmGeoCustomDivPoi.show=e.show&&(((A=e.style)==null?void 0:A.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow)&&S.type=="mouseenter")}))):f.czmGeoCustomDivPoi.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow):(((_=e.style)==null?void 0:_.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(C=>{var S;C&&(f.czmCustomPrimitive.show=e.show&&(((S=e.style)==null?void 0:S.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow)&&C.type=="mouseEnter")}))):f.czmCustomPrimitive.show=e.show&&(((P=e.style)==null?void 0:P.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow))};return g(),p.ad(e.styleChanged.don(g)),p}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,n){const{sceneObject:o,czmViewer:s,widgetComponent:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.obj)r.obj.flyTo(e,n);else{const l=setTimeout(()=>{clearTimeout(l),this.flyTo(e,n)},200)}return o.flyOverEvent.emit(n,"over",s),!0}visibleDistance(e,n){var o,s,r,l,c;if((o=n.viewer)!=null&&o.camera&&e.show){const u=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let d=!1;e.minVisibleDistance<e.maxVisibleDistance?d=e.minVisibleDistance<u&&u<e.maxVisibleDistance:e.maxVisibleDistance==0&&(d=u>e.minVisibleDistance);const p=this.widgetComponent.obj,f=this.customWidgetComponent.obj;if(!p)return;p instanceof Pn?(p.czmGeoCustomDivPoi.show=e.show&&d,(((s=e.style)==null?void 0:s.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmGeoCustomDivPoi.show=e.show&&d&&(((r=e.style)==null?void 0:r.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow))):(p.czmCustomPrimitive.show=e.show&&d,(((l=e.style)==null?void 0:l.textBoxMode)??a.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmCustomPrimitive.show=e.show&&d&&(((c=e.style)==null?void 0:c.textBoxShow)??a.ESPoi2D.defaults.style.textBoxShow)))}}};v($e,"type",$e.register("ESCesiumViewer",a.ESPoi2D.type,$e)),v($e,"modeCache",a.react({}));let wp=$e;const il=class il extends fe{constructor(e,n){super(e,n);v(this,"_czmModelPoi3D");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.dv(a.createNextAnimateFrameEvent(e.modeChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{let{mode:r}=e;const l=a.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${r.charAt(0).toLocaleLowerCase()+r.slice(1)}/SM_${["triangle","diamond"].includes(r)?"POI":"3dPoi"}_${r.charAt(0).toUpperCase()+r.slice(1)}.glb`);return this._czmModelPoi3D=new QA(e,n,l)}))}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;if(e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,n),!0):!1:!1}};v(il,"type",il.register("ESCesiumViewer",a.ESPoi3D.type,il));let Cp=il;class QA extends a.Destroyable{constructor(e,n,o){super();v(this,"czmModel");this._sceneObject=e,this._czmViewer=n,this._modelUrl=o,this.czmModel=this.ad(new rt(this._czmViewer,this._sceneObject.id)),this.d(this.czmModel.readyEvent.don(c=>{this.czmModel.gltf.animations&&(this.czmModel.activeAnimationsJson=this.czmModel.gltf.animations.map((u,d)=>({index:d,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),this._updateMaterial(this._sceneObject,this.czmModel)})),this.ad(new Pc(n.viewer,this.czmModel));const s=this._sceneObject,r=this.czmModel;r.url=this._modelUrl,this.d(a.bind([r,"position"],[s,"position"])),this.d(Ke([r,"rotation"],[s,"rotation"])),this.d(a.track([r,"scale"],[s,"scale"])),this.d(a.track([r,"show"],[s,"show"]));{const c=this.dv(a.createNextAnimateFrameEvent(s.allowPickingChanged,s.editingChanged)),u=()=>{s.allowPicking&&!s.editing?r.allowPicking=!0:r.allowPicking=!1};u(),this.d(c.don(u))}const l=this.dv(a.createNextAnimateFrameEvent(s.nameChanged,s.styleChanged));this.d(l.don(()=>this._updateMaterial(s,r)))}async _updateMaterial(e,n){var r,l;const o=document.createElement("div");o.style.position="absolute",o.style.zIndex="-1",o.style.bottom="108px",o.style.right="0px";const s=e.style[Object.keys(e.style).filter(c=>c.toUpperCase()==="TEXT")[0]]??e.name;o.innerHTML=`<div style="width: 512px; height: 128px;color: #fff;text-align: center;line-height: 128px;font-size: 50px;margin: 0 auto;">
1350
1350
  <span style="display: inline-block;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: 512px;">${s}</span>
1351
1351
  </div>`,document.body.contains(o)||document.body.appendChild(o);try{const c=await Jh(o,{backgroundColor:null,allowTaint:!1,useCORS:!0});document.body.contains(o)&&document.body.removeChild(o),n.setMaterial({Text:{baseColorTexture:{value:c.toDataURL("image/png",1)}},lambert5:{baseColorFactor:((r=e.style)==null?void 0:r.UI_Color)??[1,1,1,1]},default:{baseColorFactor:((l=e.style)==null?void 0:l.FX_Color)??[1,1,1,1]}})}catch(c){console.error(c),document.body.contains(o)&&document.body.removeChild(o)}}flyTo(e,n){const{_czmViewer:o,_sceneObject:s,czmModel:r}=this;Dt(o,s,n,e,r,!0)}}const nl=class nl extends fe{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");v(this,"_causticsTexture");v(this,"_foamTexture");v(this,"_heightMapTexture");v(this,"_normalMapTexture");v(this,"isTimestamp",e=>{if(e.toString().length!==13||isNaN(e))return console.log("时间戳格式错误"),!1;const o=new Date(e);return isNaN(o.getTime())?(console.log("时间戳格式错误"),!1):!0});v(this,"getClosestTimestampIndex",(e,n)=>{for(var o=0,s=1/0,r=0;r<n.length;r++){var l=Math.abs(e-n[r]);l<s&&(s=l,o=r)}return o});if(this._czmCustomPrimitive=this.dv(new De(n,e.id)),this._causticsTexture=this.dv(new ze(n)),this._foamTexture=this.dv(new ze(n)),this._heightMapTexture=this.dv(new ze(n)),this._normalMapTexture=this.dv(new ze(n)),!n.viewer){console.warn("viewer is undefined!");return}const s=this.czmCustomPrimitive,r=this.causticsTexture,l=this.foamTexture,c=this.heightMapTexture,u=this.normalMapTexture;r.uri=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/caustics.jpg"),l.uri=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/foam.jpg"),c.uri=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/heightmap.jpg"),u.uri=a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/water_normalmap.png"),this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"allowPicking"],[e,"allowPicking"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(a.bind([s,"rotation"],[e,"rotation"])),this.d(a.bind([s,"scale"],[e,"scale"])),s.pass="TRANSLUCENT",s.primitiveType="TRIANGLES",s.renderState={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},depthMask:!0,blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},s.vertexShaderSource=`
1352
1352
  in vec3 position;
@@ -1419,7 +1419,7 @@ ${Ry}
1419
1419
  out_FragColor.rgb *= vec3(clamp((distance - realDistance)*.5, 0.5, 1.0));
1420
1420
  out_FragColor.a = 0.9;
1421
1421
  }
1422
- `;{const d=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),p=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??a.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??a.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},Mu[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};p(),this.d(d.don(p))}{const d=f=>{if(f==0||!this.isTimestamp(f))return;const g=e.getAllMoments(),m=e.getSubmergingData;if(g.length==0||!m)return;const y=this.getClosestTimestampIndex(f,g);s.attributes={position:{typedArray:m[y].posBuffer,componentsPerAttribute:3}},s.indexTypedArray=m[y].indicesBuffer;const _=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!_)return;const{min:P,max:C}=_;s.setLocalAxisedBoundingBox(P,C)},p=this.dv(a.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(p.don(()=>{d(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:n,sceneObject:o,heightMapTexture:s,normalMapTexture:r,foamTexture:l,causticsTexture:c}=this,u=o.materialParams[Object.keys(o.materialParams).filter(d=>d.toUpperCase().includes("BASECOLOR"))[0]];n.uniformMap={u_image:{type:"texture",id:s.id},u_heightmap_image:{type:"texture",id:s.id},u_normalmap_image:{type:"texture",id:r.id},u_foam_image:{type:"texture",id:l.id},u_caustics_image:{type:"texture",id:c.id},u_color:e.waterColor??u??a.ESSubmergingAnalysis.defaults.waterColor}}};v(nl,"type",nl.register("ESCesiumViewer",a.ESSubmergingAnalysis.type,nl));let _p=nl;const{getStrFromEnv:Ny}=a.ESSceneObject.context;function KA(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=h.IonResource.fromAssetId(n))}else i=Ny(t);return i}async function JA(t,i){if(t.type==="EllipsoidTerrainProvider")return new h.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&we(t.ellipsoid),tilingScheme:t.tilingScheme&&wi(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=KA(typeof t.url=="string"?t.url:t.url.url);return e?await h.CesiumTerrainProvider.fromUrl(typeof e=="string"?Ht(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await h.GoogleEarthEnterpriseMetadata.fromUrl(Ny(t.url));return await h.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await h.ArcGISTiledElevationTerrainProvider.fromUrl(Ht(t.url),{token:t.token,ellipsoid:t.ellipsoid&&we(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new h.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&wi(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await h.VRTheWorldTerrainProvider.fromUrl(Ht(t.url),{ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit})}}const ol=class ol extends Jt{constructor(e,n){super(e,n);v(this,"_provider",this.disposeVar(a.react(void 0)));v(this,"_czmProvider",this.dv(a.react(void 0)));const o=n.viewer;if(!o)return;const s=kt(o);if(!s)return;const{terrainManager:r}=s,l=()=>{r.delete(this),this.provider=void 0};this.dispose(l);let c=!1;const u=this.disposeVar(a.createProcessingFromAsyncFunc(async(p,f)=>{if(f){if(c=!0,l(),!this.czmProvider)return;this.provider=await p.promise(JA(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),r.add(this),c=!1}}));u.restart(void 0,!0);const d=this.disposeVar(new a.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{d.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{d.emit()})),this.dispose(d.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{c||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((p,f)=>this.flyTo(p,f)));{const p=this.ad(a.reactJson(""));{const g=()=>{if(typeof e.url=="string")p.value=a.ESSceneObject.context.getStrFromEnv(e.url??a.ESTerrainLayer.defaults.url);else{const m=e.url;m.url=a.ESSceneObject.context.getStrFromEnv(m.url??a.ESTerrainLayer.defaults.url),p.value=m}};g(),this.ad(e.urlChanged.don(g))}const f=()=>{if(!p.value)return;let g=p.value,m=typeof g=="string"?g:g.url;if(m.includes(a.ESTerrainLayer.defaults.url)){const y=jA(m);if(y&&y.h){const _=Number(y.h),P={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[P.x+_,P.y+_,P.z+_]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else m.includes("/layer.json")&&(typeof g=="string"?g=m.split("/layer.json").join(""):g.url=m.split("/layer.json").join("")),this._czmProvider.value={type:"CesiumTerrainProvider",url:g,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(p.changed.disposableOn(f))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,n){const{czmViewer:o,sceneObject:s}=this;if(!o.actived)return!1;const{viewer:r}=o;return r?(r.camera.flyTo({destination:s.rectangle&&!Cu(s.rectangle)?Ne(s.rectangle):h.Camera.DEFAULT_VIEW_RECTANGLE,duration:e}),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?super.flyIn(e,n):this.flyTo(e,n):!1}};v(ol,"type",ol.register("ESCesiumViewer",a.ESTerrainLayer.type,ol));let Pp=ol;function jA(t){const i=t.indexOf("?"),n=t.slice(i+1).split("&"),o={};for(var s=0;s<n.length;s++){var r=n[s].split("=");o[r[0]]=r[1]}return o}class By extends a.Destroyable{constructor(e,n){super();v(this,"_czmTextLabel");v(this,"flyTo",(e,n)=>{if(this.czmTextLabel.position){ne(this.czmViewer.viewer,this.czmTextLabel.position,1e3,jt,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id));const o=this._czmTextLabel,s=()=>{const l=e.anchor,c=e.offset;l?o.originRatioAndOffset=[...l,-c[0],-c[1]]:o.originRatioAndOffset=[0,0,0,0]},r=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(r.disposableOn(()=>s())),s(),this.dispose(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"text"],[e,"text"])),this.dispose(a.track([o,"color"],[e,"color"])),this.dispose(a.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.dispose(a.track([o,"width"],[e,"width"])),this.dispose(a.track([o,"opacity"],[e,"opacity"])),this.dispose(a.track([o,"padding"],[e,"padding"])),this.dispose(a.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([o,"borderColor"],[e,"borderColor"])),this.dispose(a.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([o,"textAlign"],[e,"textAlign"])),this.dispose(a.track([o,"fontSize"],[e,"fontSize"])),this.dispose(a.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(a.track([o,"pickOnClick"],[e,"allowPicking"]));{const l=()=>{o.scale=[e.scale[1],e.scale[2]]};l(),this.dispose(e.scaleChanged.don(l))}{const l=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};l(),this.dispose(e.sizeByContentChanged.don(l)),this.dispose(e.sizeChanged.don(l))}this.d(o.pickedEvent.don(l=>{var d;const c=(d=lo(l,"pickResult"))==null?void 0:d.pointerEvent;if(!c)return;const u={type:c.buttons!=0&&c.button==0?"leftClick":c.button==2?"rightClick":void 0,add:{mousePos:[c.offsetX,c.offsetY]}};u.type==null&&(u.type=c.type),e.widgetEvent.emit(u)}));{let l;const c=u=>{u&&(l=u),l&&(l.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>c(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>c(u)))}}get czmTextLabel(){return this._czmTextLabel}}class Vy extends a.Destroyable{constructor(e,n){super();v(this,"_czmTextLabel");v(this,"_czmImageModel");v(this,"_url",this.disposeVar(a.react("")));v(this,"_defaultSize",this.disposeVar(a.react([1,1])));v(this,"_size",this.disposeVar(a.react([1,1])));v(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});v(this,"_isPointEvent",!1);v(this,"flyTo",(e,n)=>{if(this.czmImageModel.position)return ei(this._czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id)),this._czmImageModel=this.disposeVar(new qi(n,e.id));const o=this._czmViewer,s=this._czmTextLabel;s.originRatioAndOffset=[1e3,0,0,0],this.dispose(s.divCreatedEvent.disposableOn(c=>{const u=setTimeout(()=>{Jh(c,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{if(clearTimeout(u),this.isDestroyed())return;const p=new Image;p.onload=()=>{e.sizeByContent?this._size.value=[p.width/100,p.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},p.src=d.toDataURL("image/png"),this._url.value=d.toDataURL("image/png")}).catch(d=>{clearTimeout(u),console.error(d)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"fontSize"],[e,"fontSize"]));const r=()=>{const c=e.anchor,u=e.offset;c?this.czmImageModel.originRatioAndOffset=[...c,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r();{const c=()=>{this._czmTextLabel.show=!1;const u=this._czmImageModel;u.uri=this._url.value,u.pixelSize=void 0,u.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{u.size=this._size.value})),this.dispose(a.track([u,"show"],[e,"show"])),this.dispose(a.bind([u,"position"],[e,"position"])),this.dispose(a.track([u,"allowPicking"],[e,"allowPicking"]));{const d=()=>{u.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(Ke([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}};this.dispose(this._url.changed.disposableOn(c))}this.ad(o.clickEvent.don(c=>{const u=c==null?void 0:c.pointerEvent;u&&(this._isPointEvent=!0,this._eventInfo={type:u.button==0?"leftClick":u.button==2?"rightClick":"leftClick",add:{mousePos:[u.offsetX,u.offsetY]}})})),this.d(e.pickedEvent.don(c=>{var u,d,p;c.screenPosition&&this._isPointEvent&&c.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(c.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(c.screenPosition[1]-((p=this._eventInfo.add)==null?void 0:p.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const c=o.getEngineObject(e);this.ad(c.lastHoverResultChanged.don((u,d)=>{(u==null?void 0:u.sceneObject)==(d==null?void 0:d.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const sl=class sl extends Hr{constructor(e,n){super(e,n);v(this,"_event",this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));v(this,"_resetting",this.disposeVar(new a.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new By(this.sceneObject,this.czmViewer):new Vy(this.sceneObject,this.czmViewer))));if(!n.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(sl,"type",sl.register("ESCesiumViewer",a.ESTextLabel.type,sl));let bp=sl;const rl=class rl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new ho(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoDivSwitchPoi;s.showIcon=!1,this.d(a.track([s,"zOrder"],[e,"zOrder"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"text"],[e,"info"],c=>Object.values(c??{title:"请输入内容"}).join())),this.dispose(a.bind([s,"position"],[e,"position"]));const r=()=>{const c=e.anchor,u=e.offset;c?s.originRatioAndOffset=[...c,-u[0],-u[1]]:s.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoDivSwitchPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.position?(ne(this.czmViewer.viewer,r.position,1e3,jt,e),!0):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(rl,"type",rl.register("ESCesiumViewer",a.ESUEWidget.type,rl));let Sp=rl;const al=class al 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(al,"type",al.register("ESCesiumViewer",a.ESUnrealActor.type,al));let Ep=al;var eT=h.Primitive._modifyShaderPosition;h.Primitive._modifyShaderPosition=function(t,n,e){var n=eT(t,n,e);return t.isCameraVideo&&n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n=n.replace("void main()",`
1422
+ `;{const d=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),p=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??a.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??a.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},Mu[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};p(),this.d(d.don(p))}{const d=f=>{if(f==0||!this.isTimestamp(f))return;const g=e.getAllMoments(),m=e.getSubmergingData;if(g.length==0||!m)return;const y=this.getClosestTimestampIndex(f,g);s.attributes={position:{typedArray:m[y].posBuffer,componentsPerAttribute:3}},s.indexTypedArray=m[y].indicesBuffer;const _=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!_)return;const{min:P,max:C}=_;s.setLocalAxisedBoundingBox(P,C)},p=this.dv(a.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(p.don(()=>{d(e.currentTime)}))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get causticsTexture(){return this._causticsTexture}get foamTexture(){return this._foamTexture}get heightMapTexture(){return this._heightMapTexture}get normalMapTexture(){return this._normalMapTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:n,sceneObject:o,heightMapTexture:s,normalMapTexture:r,foamTexture:l,causticsTexture:c}=this,u=o.materialParams[Object.keys(o.materialParams).filter(d=>d.toUpperCase().includes("BASECOLOR"))[0]];n.uniformMap={u_image:{type:"texture",id:s.id},u_heightmap_image:{type:"texture",id:s.id},u_normalmap_image:{type:"texture",id:r.id},u_foam_image:{type:"texture",id:l.id},u_caustics_image:{type:"texture",id:c.id},u_color:e.waterColor??u??a.ESSubmergingAnalysis.defaults.waterColor}}};v(nl,"type",nl.register("ESCesiumViewer",a.ESSubmergingAnalysis.type,nl));let _p=nl;const{getStrFromEnv:Ny}=a.ESSceneObject.context;function kA(t){let i;if(t.startsWith("ion://")){const n=+t.substring(6);Number.isFinite(n)&&(i=h.IonResource.fromAssetId(n))}else i=Ny(t);return i}async function KA(t,i){if(t.type==="EllipsoidTerrainProvider")return new h.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&we(t.ellipsoid),tilingScheme:t.tilingScheme&&wi(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=kA(typeof t.url=="string"?t.url:t.url.url);return e?await h.CesiumTerrainProvider.fromUrl(typeof e=="string"?Ht(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await h.GoogleEarthEnterpriseMetadata.fromUrl(Ny(t.url));return await h.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await h.ArcGISTiledElevationTerrainProvider.fromUrl(Ht(t.url),{token:t.token,ellipsoid:t.ellipsoid&&we(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new h.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&wi(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await h.VRTheWorldTerrainProvider.fromUrl(Ht(t.url),{ellipsoid:t.ellipsoid&&we(t.ellipsoid),credit:t.credit})}}const ol=class ol extends Jt{constructor(e,n){super(e,n);v(this,"_provider",this.disposeVar(a.react(void 0)));v(this,"_czmProvider",this.dv(a.react(void 0)));const o=n.viewer;if(!o)return;const s=kt(o);if(!s)return;const{terrainManager:r}=s,l=()=>{r.delete(this),this.provider=void 0};this.dispose(l);let c=!1;const u=this.disposeVar(a.createProcessingFromAsyncFunc(async(p,f)=>{if(f){if(c=!0,l(),!this.czmProvider)return;this.provider=await p.promise(KA(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),r.add(this),c=!1}}));u.restart(void 0,!0);const d=this.disposeVar(new a.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{d.emit()})),this.dispose(a.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{d.emit()})),this.dispose(d.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{c||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((p,f)=>this.flyTo(p,f)));{const p=this.ad(a.reactJson(""));{const g=()=>{if(typeof e.url=="string")p.value=a.ESSceneObject.context.getStrFromEnv(e.url??a.ESTerrainLayer.defaults.url);else{const m=e.url;m.url=a.ESSceneObject.context.getStrFromEnv(m.url??a.ESTerrainLayer.defaults.url),p.value=m}};g(),this.ad(e.urlChanged.don(g))}const f=()=>{if(!p.value)return;let g=p.value,m=typeof g=="string"?g:g.url;if(m.includes(a.ESTerrainLayer.defaults.url)){const y=JA(m);if(y&&y.h){const _=Number(y.h),P={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[P.x+_,P.y+_,P.z+_]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else m.includes("/layer.json")&&(typeof g=="string"?g=m.split("/layer.json").join(""):g.url=m.split("/layer.json").join("")),this._czmProvider.value={type:"CesiumTerrainProvider",url:g,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(p.changed.disposableOn(f))}}get provider(){return this._provider.value}set provider(e){this._provider.value=e}get providerChanged(){return this._provider.changed}get czmProvider(){return this._czmProvider.value}get czmProviderChanged(){return this._czmProvider.changed}flyTo(e,n){const{czmViewer:o,sceneObject:s}=this;if(!o.actived)return!1;const{viewer:r}=o;return r?(r.camera.flyTo({destination:s.rectangle&&!Cu(s.rectangle)?Ne(s.rectangle):h.Camera.DEFAULT_VIEW_RECTANGLE,duration:e}),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyInParam?super.flyIn(e,n):this.flyTo(e,n):!1}};v(ol,"type",ol.register("ESCesiumViewer",a.ESTerrainLayer.type,ol));let Pp=ol;function JA(t){const i=t.indexOf("?"),n=t.slice(i+1).split("&"),o={};for(var s=0;s<n.length;s++){var r=n[s].split("=");o[r[0]]=r[1]}return o}class By extends a.Destroyable{constructor(e,n){super();v(this,"_czmTextLabel");v(this,"flyTo",(e,n)=>{if(this.czmTextLabel.position){ne(this.czmViewer.viewer,this.czmTextLabel.position,1e3,jt,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id));const o=this._czmTextLabel,s=()=>{const l=e.anchor,c=e.offset;l?o.originRatioAndOffset=[...l,-c[0],-c[1]]:o.originRatioAndOffset=[0,0,0,0]},r=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(r.disposableOn(()=>s())),s(),this.dispose(a.track([o,"zOrder"],[e,"zOrder"])),this.dispose(a.track([o,"show"],[e,"show"])),this.dispose(a.bind([o,"text"],[e,"text"])),this.dispose(a.track([o,"color"],[e,"color"])),this.dispose(a.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(a.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(a.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(a.bind([o,"position"],[e,"position"])),this.dispose(a.track([o,"width"],[e,"width"])),this.dispose(a.track([o,"opacity"],[e,"opacity"])),this.dispose(a.track([o,"padding"],[e,"padding"])),this.dispose(a.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(a.track([o,"borderColor"],[e,"borderColor"])),this.dispose(a.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(a.track([o,"textAlign"],[e,"textAlign"])),this.dispose(a.track([o,"fontSize"],[e,"fontSize"])),this.dispose(a.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(a.track([o,"pickOnClick"],[e,"allowPicking"]));{const l=()=>{o.scale=[e.scale[1],e.scale[2]]};l(),this.dispose(e.scaleChanged.don(l))}{const l=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};l(),this.dispose(e.sizeByContentChanged.don(l)),this.dispose(e.sizeChanged.don(l))}this.d(o.pickedEvent.don(l=>{var d;const c=(d=lo(l,"pickResult"))==null?void 0:d.pointerEvent;if(!c)return;const u={type:c.buttons!=0&&c.button==0?"leftClick":c.button==2?"rightClick":void 0,add:{mousePos:[c.offsetX,c.offsetY]}};u.type==null&&(u.type=c.type),e.widgetEvent.emit(u)}));{let l;const c=u=>{u&&(l=u),l&&(l.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>c(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>c(u)))}}get czmTextLabel(){return this._czmTextLabel}}class Vy extends a.Destroyable{constructor(e,n){super();v(this,"_czmTextLabel");v(this,"_czmImageModel");v(this,"_url",this.disposeVar(a.react("")));v(this,"_defaultSize",this.disposeVar(a.react([1,1])));v(this,"_size",this.disposeVar(a.react([1,1])));v(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});v(this,"_isPointEvent",!1);v(this,"flyTo",(e,n)=>{if(this.czmImageModel.position)return ei(this._czmViewer,this.sceneObject,n,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=n,this._czmTextLabel=this.disposeVar(new Pi(n,e.id)),this._czmImageModel=this.disposeVar(new qi(n,e.id));const o=this._czmViewer,s=this._czmTextLabel;s.originRatioAndOffset=[1e3,0,0,0],this.dispose(s.divCreatedEvent.disposableOn(c=>{const u=setTimeout(()=>{Jh(c,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:c.offsetWidth,height:c.offsetHeight,scale:1}).then(d=>{if(clearTimeout(u),this.isDestroyed())return;const p=new Image;p.onload=()=>{e.sizeByContent?this._size.value=[p.width/100,p.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},p.src=d.toDataURL("image/png"),this._url.value=d.toDataURL("image/png")}).catch(d=>{clearTimeout(u),console.error(d)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"text"],[e,"text"])),this.dispose(a.track([s,"color"],[e,"color"])),this.dispose(a.track([s,"fontSize"],[e,"fontSize"]));const r=()=>{const c=e.anchor,u=e.offset;c?this.czmImageModel.originRatioAndOffset=[...c,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r();{const c=()=>{this._czmTextLabel.show=!1;const u=this._czmImageModel;u.uri=this._url.value,u.pixelSize=void 0,u.useAxis="XZ",this.dispose(this.sizeChanged.disposableOn(()=>{u.size=this._size.value})),this.dispose(a.track([u,"show"],[e,"show"])),this.dispose(a.bind([u,"position"],[e,"position"])),this.dispose(a.track([u,"allowPicking"],[e,"allowPicking"]));{const d=()=>{u.scale=[e.scale[1],e.scale[2]]};d(),this.d(e.scaleChanged.don(d))}{const d=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(Ke([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};d(),this.dispose(e.rotationTypeChanged.disposableOn(d))}};this.dispose(this._url.changed.disposableOn(c))}this.ad(o.clickEvent.don(c=>{const u=c==null?void 0:c.pointerEvent;u&&(this._isPointEvent=!0,this._eventInfo={type:u.button==0?"leftClick":u.button==2?"rightClick":"leftClick",add:{mousePos:[u.offsetX,u.offsetY]}})})),this.d(e.pickedEvent.don(c=>{var u,d,p;c.screenPosition&&this._isPointEvent&&c.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(c.screenPosition[0]-((d=this._eventInfo.add)==null?void 0:d.mousePos[0]))<1&&Math.abs(c.screenPosition[1]-((p=this._eventInfo.add)==null?void 0:p.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),a.registerCreatedEventUpdate(this,e,()=>{const c=o.getEngineObject(e);this.ad(c.lastHoverResultChanged.don((u,d)=>{(u==null?void 0:u.sceneObject)==(d==null?void 0:d.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(d==null?void 0:d.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo)))}))})}get czmTextLabel(){return this._czmTextLabel}get czmImageModel(){return this._czmImageModel}get url(){return this._url.value}get defaultSize(){return this._defaultSize.value}get defaultSizeChanged(){return this._defaultSize.changed}get size(){return this._size.value}get sizeChanged(){return this._size.changed}}const sl=class sl extends Hr{constructor(e,n){super(e,n);v(this,"_event",this.disposeVar(a.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));v(this,"_resetting",this.disposeVar(new a.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new By(this.sceneObject,this.czmViewer):new Vy(this.sceneObject,this.czmViewer))));if(!n.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,n){const{sceneObject:o,czmViewer:s,resetting:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r&&r.obj&&r.obj.flyTo(e,n),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(sl,"type",sl.register("ESCesiumViewer",a.ESTextLabel.type,sl));let bp=sl;const rl=class rl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new ho(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoDivSwitchPoi;s.showIcon=!1,this.d(a.track([s,"zOrder"],[e,"zOrder"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"text"],[e,"info"],c=>Object.values(c??{title:"请输入内容"}).join())),this.dispose(a.bind([s,"position"],[e,"position"]));const r=()=>{const c=e.anchor,u=e.offset;c?s.originRatioAndOffset=[...c,-u[0],-u[1]]:s.originRatioAndOffset=[0,0,0,0]},l=this.ad(a.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(l.disposableOn(()=>r())),r()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoDivSwitchPoi:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r.position?(ne(this.czmViewer.viewer,r.position,1e3,jt,e),!0):(r.flyTo(e&&e*1e3),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(rl,"type",rl.register("ESCesiumViewer",a.ESUEWidget.type,rl));let Sp=rl;const al=class al 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(al,"type",al.register("ESCesiumViewer",a.ESUnrealActor.type,al));let Ep=al;var jA=h.Primitive._modifyShaderPosition;h.Primitive._modifyShaderPosition=function(t,n,e){var n=jA(t,n,e);return t.isCameraVideo&&n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n=n.replace("void main()",`
1423
1423
  #ifdef XBSJ_CAMERA_VIDEO
1424
1424
  uniform mat4 u_boxMV;
1425
1425
  #endif
@@ -1444,7 +1444,7 @@ ${Ry}
1444
1444
  #ifdef XBSJ_CAMERA_VIDEO
1445
1445
  position = vec4(position3DLow + position3DHigh, 1.0);
1446
1446
  #endif
1447
- `)),n};var tT=h.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes;h.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes=function(t){return h.defined(t.isCameraVideo)?!0:tT(t)};var iT=h.ShadowVolumeAppearance.prototype.createFragmentShader;h.ShadowVolumeAppearance.prototype.createFragmentShader=function(t){var i=iT.bind(this)(t);if(this._appearance.isCameraVideo){var e=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];e.forEach(function(n){var o=i.defines.indexOf(n);o!==-1&&i.defines.splice(o,1)}),i.defines.push("XBSJ_CAMERA_VIDEO"),i.sources.forEach(function(n,o){n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(i.sources[o]=n.replace("void main(void)",`
1447
+ `)),n};var eT=h.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes;h.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes=function(t){return h.defined(t.isCameraVideo)?!0:eT(t)};var tT=h.ShadowVolumeAppearance.prototype.createFragmentShader;h.ShadowVolumeAppearance.prototype.createFragmentShader=function(t){var i=tT.bind(this)(t);if(this._appearance.isCameraVideo){var e=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];e.forEach(function(n){var o=i.defines.indexOf(n);o!==-1&&i.defines.splice(o,1)}),i.defines.push("XBSJ_CAMERA_VIDEO"),i.sources.forEach(function(n,o){n.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(i.sources[o]=n.replace("void main(void)",`
1448
1448
  #ifdef XBSJ_CAMERA_VIDEO
1449
1449
  uniform mat4 u_inverseBoxMV;
1450
1450
  #endif
@@ -1459,7 +1459,7 @@ ${Ry}
1459
1459
  #endif
1460
1460
 
1461
1461
  czm_material material = czm_getMaterial(materialInput);
1462
- `))})}return i};var nT=h.ShadowVolumeAppearance.prototype.createVertexShader;h.ShadowVolumeAppearance.prototype.createVertexShader=function(t,i,e,n){var o=nT.bind(this)(t,i,e,n);if(this._appearance.isCameraVideo){var s=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];s.forEach(function(r){var l=o.defines.indexOf(r);l!==-1&&o.defines.splice(l,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var oT=new h.Cartesian3;function Uy(t){var i=new h.Cartesian3(-1,-1,-1),e=new h.Cartesian3(1,1,1);i.y+=1.001,e.y+=1.001;var n=new Float64Array(8*3);n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=e.x,n[4]=i.y,n[5]=i.z,n[6]=e.x,n[7]=e.y,n[8]=i.z,n[9]=i.x,n[10]=e.y,n[11]=i.z,n[12]=i.x,n[13]=i.y,n[14]=e.z,n[15]=e.x,n[16]=i.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=i.x,n[22]=e.y,n[23]=e.z;var o=new h.GeometryAttributes;o.position=new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n});var s=new Uint16Array(6*2*3);s[0]=4,s[1]=5,s[2]=6,s[3]=4,s[4]=6,s[5]=7,s[6]=1,s[7]=0,s[8]=3,s[9]=1,s[10]=3,s[11]=2,s[12]=1,s[13]=6,s[14]=5,s[15]=1,s[16]=2,s[17]=6,s[18]=2,s[19]=3,s[20]=7,s[21]=2,s[22]=7,s[23]=6,s[24]=3,s[25]=0,s[26]=4,s[27]=3,s[28]=4,s[29]=7,s[30]=0,s[31]=1,s[32]=5,s[33]=0,s[34]=5,s[35]=4;for(var r=0;r<36;r+=3)s[r]=s[r]^s[r+2],s[r+2]=s[r]^s[r+2],s[r]=s[r]^s[r+2];var l;t&&(l=new Uint16Array(6*2*2),l[0]=0,l[1]=1,l[2]=1,l[3]=2,l[4]=2,l[5]=3,l[6]=3,l[7]=0,l[8]=4,l[9]=5,l[10]=5,l[11]=6,l[12]=6,l[13]=7,l[14]=7,l[15]=4,l[16]=0,l[17]=4,l[18]=1,l[19]=5,l[20]=2,l[21]=6,l[22]=3,l[23]=7);var c=h.Cartesian3.subtract(e,i,oT),u=h.Cartesian3.magnitude(c)*.5;return new h.Geometry({attributes:o,indices:t?l:s,primitiveType:t?h.PrimitiveType.LINES:h.PrimitiveType.TRIANGLES,boundingSphere:new h.BoundingSphere(h.Cartesian3.ZERO,u)})}var sT=`
1462
+ `))})}return i};var iT=h.ShadowVolumeAppearance.prototype.createVertexShader;h.ShadowVolumeAppearance.prototype.createVertexShader=function(t,i,e,n){var o=iT.bind(this)(t,i,e,n);if(this._appearance.isCameraVideo){var s=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];s.forEach(function(r){var l=o.defines.indexOf(r);l!==-1&&o.defines.splice(l,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var nT=new h.Cartesian3;function Uy(t){var i=new h.Cartesian3(-1,-1,-1),e=new h.Cartesian3(1,1,1);i.y+=1.001,e.y+=1.001;var n=new Float64Array(8*3);n[0]=i.x,n[1]=i.y,n[2]=i.z,n[3]=e.x,n[4]=i.y,n[5]=i.z,n[6]=e.x,n[7]=e.y,n[8]=i.z,n[9]=i.x,n[10]=e.y,n[11]=i.z,n[12]=i.x,n[13]=i.y,n[14]=e.z,n[15]=e.x,n[16]=i.y,n[17]=e.z,n[18]=e.x,n[19]=e.y,n[20]=e.z,n[21]=i.x,n[22]=e.y,n[23]=e.z;var o=new h.GeometryAttributes;o.position=new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:n});var s=new Uint16Array(6*2*3);s[0]=4,s[1]=5,s[2]=6,s[3]=4,s[4]=6,s[5]=7,s[6]=1,s[7]=0,s[8]=3,s[9]=1,s[10]=3,s[11]=2,s[12]=1,s[13]=6,s[14]=5,s[15]=1,s[16]=2,s[17]=6,s[18]=2,s[19]=3,s[20]=7,s[21]=2,s[22]=7,s[23]=6,s[24]=3,s[25]=0,s[26]=4,s[27]=3,s[28]=4,s[29]=7,s[30]=0,s[31]=1,s[32]=5,s[33]=0,s[34]=5,s[35]=4;for(var r=0;r<36;r+=3)s[r]=s[r]^s[r+2],s[r+2]=s[r]^s[r+2],s[r]=s[r]^s[r+2];var l;t&&(l=new Uint16Array(6*2*2),l[0]=0,l[1]=1,l[2]=1,l[3]=2,l[4]=2,l[5]=3,l[6]=3,l[7]=0,l[8]=4,l[9]=5,l[10]=5,l[11]=6,l[12]=6,l[13]=7,l[14]=7,l[15]=4,l[16]=0,l[17]=4,l[18]=1,l[19]=5,l[20]=2,l[21]=6,l[22]=3,l[23]=7);var c=h.Cartesian3.subtract(e,i,nT),u=h.Cartesian3.magnitude(c)*.5;return new h.Geometry({attributes:o,indices:t?l:s,primitiveType:t?h.PrimitiveType.LINES:h.PrimitiveType.TRIANGLES,boundingSphere:new h.BoundingSphere(h.Cartesian3.ZERO,u)})}var oT=`
1463
1463
  in vec3 position3DHigh;
1464
1464
  in vec3 position3DLow;
1465
1465
  in vec4 color;
@@ -1480,7 +1480,7 @@ void main()
1480
1480
  p.w = 1.0;
1481
1481
  gl_Position = czm_projection * p;
1482
1482
  }
1483
- `;function kr(t){if(!h.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var i=t.showHelperPrimitive??!1;this.inverseViewMatrix=h.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new h.Matrix4,h.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new h.PerspectiveFrustum({fov:h.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new h.Matrix4,this._primitiveModelMatrix=new h.Matrix4,this._inverseBoxMV=new h.Matrix4;var e=this,n={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new h.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:h.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const u=o._uniforms.image_0;o._uniforms.image_0=()=>{const d=this.videoTextureFunc&&this.videoTextureFunc();return d||u()}}{const u=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const d=this.alphaTextureFunc&&this.alphaTextureFunc();return d||u()}}var s=new h.MaterialAppearance({material:o,closed:!1});s._vertexFormat=h.VertexFormat.POSITION_ONLY,s.isCameraVideo=!0;var r=new h.ClassificationPrimitive({geometryInstances:new h.GeometryInstance({geometry:Uy(),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0),isCameraVideo:new h.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:h.ClassificationType.CESIUM_3D_TILE,_uniformMap:n,appearance:s,asynchronous:!1,compressVertices:!1,allowPicking:!1});r.isCameraVideo=!0,Object.defineProperties(r,{_sp:{set:function(u){if(this.__sp!==u){if(u){var d=u,p=d.vertexShaderSource;p.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&p.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=d}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=r;var l=new h.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:sT});l.uniforms={u_boxMV:this._boxMV};var c=new h.Primitive({geometryInstances:new h.GeometryInstance({geometry:Uy(!0),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:l,asynchronous:!1,compressVertices:!1,cull:!1,show:i});this._helperPrimitive=c,this._projectionMatrix=new h.Matrix4,this._inverseViewProjectionMatrix=new h.Matrix4,this._viewProjectionMatrix=new h.Matrix4,this.show=!0}kr.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new h.Cartesian3,this._scratchBS=this._scratchBS||new h.BoundingSphere;const r=h.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),l=this.frustum.far,c=this._scratchBS;if(h.Cartesian3.clone(r,c.center),c.radius=l,t.cullingVolume.computeVisibility(c)===h.Intersect.OUTSIDE)return;const u=t.camera;if(u&&u.getPixelSize&&Wi(u._scene,c.center,20)>c.radius)return}var i=h.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=h.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(i||h.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||h.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!i||!e){var n=this._inverseViewProjectionMatrix;h.Matrix4.inverse(this._projectionMatrix,n),h.Matrix4.multiply(this._inverseViewMatrix,n,n);var o=this._viewProjectionMatrix;h.Matrix4.inverse(n,o);var s=this._primitiveModelMatrix;h.Matrix4.fromUniformScale(this.frustum.far,s),h.Matrix4.multiply(this._inverseViewMatrix,s,s),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),h.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),h.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(kr.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),kr.prototype.isDestroyed=function(){return!1},kr.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),h.destroyObject(this)};class Vs extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetWithCameraInfoEvent",this.disposeVar(new a.Event));v(this,"_sharedCzmTexture");v(this,"_fovy",this.disposeVar(a.react(0)));v(this,"_fovyUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(s-this.fovy)<1e-5||(this.fovy=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());v(this,"_fovx",this.disposeVar(a.react(0)));v(this,"_fovxUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(s-this.fovx)<1e-5||(this.fovx=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());v(this,"_xbsjCameraVideoResettingEvent");v(this,"_xbsjCameraVideoResetting");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);{const s=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};s(),this.ad(this.czmTextureIdChanged.don(s))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new a.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new aT(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const s=e.getCameraInfo();s&&(this.position=s.position,this.rotation=s.rotation)})),this.dispose(this.flyToEvent.disposableOn(s=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}ne(e.viewer,this.position,0,this.rotation,s)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(Vs,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(Vs||(Vs={})),a.extendClassProps(Vs.prototype,Vs.createDefaultProps);var Ph=new h.Matrix3;function rT(t,i){const{position:e,heading:n,pitch:o,roll:s}=t,r=h.Transforms.eastNorthUpToFixedFrame(e,void 0,i);var l=h.Matrix3.fromRotationX(h.Math.PI_OVER_TWO,Ph);return h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationY(-n,Ph),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationX(o,Ph),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationZ(-s,Ph),h.Matrix4.multiplyByMatrix3(r,l,r),r}class aT extends a.Destroyable{constructor(e,n){super();v(this,"_xbsjCameraVideo");const{viewer:o}=n;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:s}=e;if(!s)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[r,l,c]}=e,u=h.Math.toRadians,d=h.Cartesian3.fromDegrees(...s),p=rT({position:d,heading:u(r),pitch:u(l),roll:u(c)}),{fov:f,aspectRatio:g,near:m,far:y}=e,_=new h.PerspectiveFrustum({fov:u(f),aspectRatio:g,near:m,far:y}),P=new kr({inverseViewMatrix:p,frustum:_,showHelperPrimitive:!0});this._xbsjCameraVideo=P,this.dispose(()=>P.destroy()),P.ESSceneObjectID=e.id,o.scene.primitives.add(P),this.dispose(()=>o.scene.primitives.remove(P));{const C=()=>{const S=e.getCurrentCzmTexture();if(S&&S instanceof ze)return S.texture};this.xbsjCameraVideo.videoTextureFunc=C}{const C=()=>{P.showHelperPrimitive=e.showHelperPrimitive};C(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(C))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const ll=class ll extends fe{constructor(e,n){super(e,n);v(this,"_czmCameraVideo");v(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new Vs(n,e.id)),this._czmTexture=this.dv(new ze(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:s}=this,{czmTexture:r}=this;s.czmTextureId=r.id,this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(Ke([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"showHelperPrimitive"],[e,"showFrustum"])),this.d(a.track([r,"uriType"],[e,"videoStreamType"]));{const l=()=>{const u=e.fov??a.ESVideoFusion.defaults.fov,d=e.aspectRatio??a.ESVideoFusion.defaults.aspectRatio;s.fovx=h.Math.clamp(u,.001,179.9),s.aspectRatio=h.Math.clamp(d,.001,Number.MAX_SAFE_INTEGER)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(c.disposableOn(l))}{const l=()=>{if(e.far<e.near){e.far=e.near;return}s.far=e.far};l(),this.ad(e.farChanged.don(l)),this.d(a.track([e,"far"],[s,"far"]))}{const l=()=>{e.near>e.far||e.near<=0||(s.near=e.near)};l(),this.ad(e.nearChanged.don(l))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{s.fovx=e.fov}));{const l=()=>{e.videoStreamUrl&&(r.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};l(),this.d(e.videoStreamUrlChanged.disposableOn(l))}{const l=()=>{r.loop=e.looping};l(),this.d(e.loopingChanged.don(l))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{s.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.far??a.ESVideoFusion.defaults.far;return o.position?(ei(s,o,n,o.position,r,e),!0):!1}}};v(ll,"type",ll.register("ESCesiumViewer",a.ESVideoFusion.type,ll));let xp=ll;function lT(t,i){const e=t,n=i,o=Math.cos,s=Math.sin;var r=[o(-e)*o(-n),s(-e)*o(-n),s(-n)];return r}function Wy(t,i,e){return t*(-.5+e/i)}function Gy(t,i,e,n){const o=new Float32Array((e+1)*(n+1)*3+3);for(let s=0;s<e+1;++s)for(let r=0;r<n+1;++r){const l=lT(Wy(t,e,s),Wy(i,n,r));o[(r*(e+1)+s)*3+0]=l[0],o[(r*(e+1)+s)*3+1]=l[1],o[(r*(e+1)+s)*3+2]=l[2]}return o[(e+1)*(n+1)*3+0]=0,o[(e+1)*(n+1)*3+1]=0,o[(e+1)*(n+1)*3+2]=0,o}function cT(t,i){var e=new Uint16Array(t*i*6);for(let n=0;n<t;++n)for(let o=0;o<i;++o){const s=o*(t+1)+n,r=o*(t+1)+n+1,l=(o+1)*(t+1)+n,c=(o+1)*(t+1)+n+1,u=(o*t+n)*6;e[u+0]=s,e[u+1]=r,e[u+2]=c,e[u+3]=s,e[u+4]=c,e[u+5]=l}return e}function hT(t,i,e,n){const o=t*e,s=i*n,r=new Uint16Array((t+1)*(s*2)+(i+1)*(o*2)+4*2);for(let g=0;g<t+1;++g)for(let m=0;m<s;++m){const y=g*e;r[(g*s+m)*2+0]=m*(o+1)+y,r[(g*s+m)*2+1]=(m+1)*(o+1)+y}const l=(t+1)*(s*2);for(let g=0;g<i+1;++g)for(let m=0;m<o;++m){const y=g*n;r[l+(m+g*o)*2+0]=y*(o+1)+m,r[l+(m+g*o)*2+1]=y*(o+1)+m+1}const c=(t+1)*(s*2)+(i+1)*(o*2),u=0,d=o,p=(o+1)*s,f=(o+1)*(s+1)-1;return r[c+0]=u,r[c+1]=(o+1)*(s+1),r[c+2]=d,r[c+3]=(o+1)*(s+1),r[c+4]=p,r[c+5]=(o+1)*(s+1),r[c+6]=f,r[c+7]=(o+1)*(s+1),r}var uT=`
1483
+ `;function kr(t){if(!h.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var i=t.showHelperPrimitive??!1;this.inverseViewMatrix=h.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new h.Matrix4,h.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new h.PerspectiveFrustum({fov:h.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new h.Matrix4,this._primitiveModelMatrix=new h.Matrix4,this._inverseBoxMV=new h.Matrix4;var e=this,n={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new h.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:h.Material.DefaultImageId},components:{diffuse:"texture(image, fract(materialInput.st)).rgb",alpha:"texture(alphaImage, fract(materialInput.st)).r"}}});{const u=o._uniforms.image_0;o._uniforms.image_0=()=>{const d=this.videoTextureFunc&&this.videoTextureFunc();return d||u()}}{const u=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const d=this.alphaTextureFunc&&this.alphaTextureFunc();return d||u()}}var s=new h.MaterialAppearance({material:o,closed:!1});s._vertexFormat=h.VertexFormat.POSITION_ONLY,s.isCameraVideo=!0;var r=new h.ClassificationPrimitive({geometryInstances:new h.GeometryInstance({geometry:Uy(),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0),isCameraVideo:new h.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:h.ClassificationType.CESIUM_3D_TILE,_uniformMap:n,appearance:s,asynchronous:!1,compressVertices:!1,allowPicking:!1});r.isCameraVideo=!0,Object.defineProperties(r,{_sp:{set:function(u){if(this.__sp!==u){if(u){var d=u,p=d.vertexShaderSource;p.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&p.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=d}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=r;var l=new h.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:oT});l.uniforms={u_boxMV:this._boxMV};var c=new h.Primitive({geometryInstances:new h.GeometryInstance({geometry:Uy(!0),attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(new h.Color(1,0,0,1)),show:new h.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:l,asynchronous:!1,compressVertices:!1,cull:!1,show:i});this._helperPrimitive=c,this._projectionMatrix=new h.Matrix4,this._inverseViewProjectionMatrix=new h.Matrix4,this._viewProjectionMatrix=new h.Matrix4,this.show=!0}kr.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new h.Cartesian3,this._scratchBS=this._scratchBS||new h.BoundingSphere;const r=h.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),l=this.frustum.far,c=this._scratchBS;if(h.Cartesian3.clone(r,c.center),c.radius=l,t.cullingVolume.computeVisibility(c)===h.Intersect.OUTSIDE)return;const u=t.camera;if(u&&u.getPixelSize&&Wi(u._scene,c.center,20)>c.radius)return}var i=h.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=h.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(i||h.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||h.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!i||!e){var n=this._inverseViewProjectionMatrix;h.Matrix4.inverse(this._projectionMatrix,n),h.Matrix4.multiply(this._inverseViewMatrix,n,n);var o=this._viewProjectionMatrix;h.Matrix4.inverse(n,o);var s=this._primitiveModelMatrix;h.Matrix4.fromUniformScale(this.frustum.far,s),h.Matrix4.multiply(this._inverseViewMatrix,s,s),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),h.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),h.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(kr.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),kr.prototype.isDestroyed=function(){return!1},kr.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),h.destroyObject(this)};class Vs extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_resetWithCameraInfoEvent",this.disposeVar(new a.Event));v(this,"_sharedCzmTexture");v(this,"_fovy",this.disposeVar(a.react(0)));v(this,"_fovyUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(s-this.fovy)<1e-5||(this.fovy=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());v(this,"_fovx",this.disposeVar(a.react(0)));v(this,"_fovxUpdate",(()=>{const e=h.Math.toRadians,n=h.Math.toDegrees;{const o=()=>{const s=n(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(s-this.fovx)<1e-5||(this.fovx=s)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const s=n(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(s-this.fov)<1e-5||(this.fov=s)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());v(this,"_xbsjCameraVideoResettingEvent");v(this,"_xbsjCameraVideoResetting");v(this,"_id",this.disposeVar(a.react(a.createGuid())));n&&(this.id=n);{const s=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};s(),this.ad(this.czmTextureIdChanged.don(s))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new a.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new rT(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const s=e.getCameraInfo();s&&(this.position=s.position,this.rotation=s.rotation)})),this.dispose(this.flyToEvent.disposableOn(s=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}ne(e.viewer,this.position,0,this.rotation,s)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get resetWithCameraInfoEvent(){return this._resetWithCameraInfoEvent}resetWithCameraInfo(){this._resetWithCameraInfoEvent.emit()}get sharedCzmTexture(){return this._sharedCzmTexture}getCurrentCzmTexture(){return this._sharedCzmTexture}get fovy(){return this._fovy.value}set fovy(e){this._fovy.value=e}get fovyChanged(){return this._fovy.changed}get fovx(){return this._fovx.value}set fovx(e){this._fovx.value=e}get fovxChanged(){return this._fovx.changed}get xbsjCameraVideoResetting(){return this._xbsjCameraVideoResetting}get xbsjCameraVideoChanged(){return this._xbsjCameraVideoResetting.objChanged}get xbsjCameraVideo(){var e;return(e=this._xbsjCameraVideoResetting.obj)==null?void 0:e.xbsjCameraVideo}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}v(Vs,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(Vs||(Vs={})),a.extendClassProps(Vs.prototype,Vs.createDefaultProps);var Ph=new h.Matrix3;function sT(t,i){const{position:e,heading:n,pitch:o,roll:s}=t,r=h.Transforms.eastNorthUpToFixedFrame(e,void 0,i);var l=h.Matrix3.fromRotationX(h.Math.PI_OVER_TWO,Ph);return h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationY(-n,Ph),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationX(o,Ph),h.Matrix4.multiplyByMatrix3(r,l,r),l=h.Matrix3.fromRotationZ(-s,Ph),h.Matrix4.multiplyByMatrix3(r,l,r),r}class rT extends a.Destroyable{constructor(e,n){super();v(this,"_xbsjCameraVideo");const{viewer:o}=n;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:s}=e;if(!s)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[r,l,c]}=e,u=h.Math.toRadians,d=h.Cartesian3.fromDegrees(...s),p=sT({position:d,heading:u(r),pitch:u(l),roll:u(c)}),{fov:f,aspectRatio:g,near:m,far:y}=e,_=new h.PerspectiveFrustum({fov:u(f),aspectRatio:g,near:m,far:y}),P=new kr({inverseViewMatrix:p,frustum:_,showHelperPrimitive:!0});this._xbsjCameraVideo=P,this.dispose(()=>P.destroy()),P.ESSceneObjectID=e.id,o.scene.primitives.add(P),this.dispose(()=>o.scene.primitives.remove(P));{const C=()=>{const S=e.getCurrentCzmTexture();if(S&&S instanceof ze)return S.texture};this.xbsjCameraVideo.videoTextureFunc=C}{const C=()=>{P.showHelperPrimitive=e.showHelperPrimitive};C(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(C))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const ll=class ll extends fe{constructor(e,n){super(e,n);v(this,"_czmCameraVideo");v(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new Vs(n,e.id)),this._czmTexture=this.dv(new ze(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:s}=this,{czmTexture:r}=this;s.czmTextureId=r.id,this.d(a.track([s,"show"],[e,"show"])),this.d(a.bind([s,"position"],[e,"position"])),this.d(Ke([s,"rotation"],[e,"rotation"])),this.d(a.track([s,"showHelperPrimitive"],[e,"showFrustum"])),this.d(a.track([r,"uriType"],[e,"videoStreamType"]));{const l=()=>{const u=e.fov??a.ESVideoFusion.defaults.fov,d=e.aspectRatio??a.ESVideoFusion.defaults.aspectRatio;s.fovx=h.Math.clamp(u,.001,179.9),s.aspectRatio=h.Math.clamp(d,.001,Number.MAX_SAFE_INTEGER)};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(c.disposableOn(l))}{const l=()=>{if(e.far<e.near){e.far=e.near;return}s.far=e.far};l(),this.ad(e.farChanged.don(l)),this.d(a.track([e,"far"],[s,"far"]))}{const l=()=>{e.near>e.far||e.near<=0||(s.near=e.near)};l(),this.ad(e.nearChanged.don(l))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{s.fovx=e.fov}));{const l=()=>{e.videoStreamUrl&&(r.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};l(),this.d(e.videoStreamUrlChanged.disposableOn(l))}{const l=()=>{r.loop=e.looping};l(),this.d(e.loopingChanged.don(l))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{s.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.far??a.ESVideoFusion.defaults.far;return o.position?(ei(s,o,n,o.position,r,e),!0):!1}}};v(ll,"type",ll.register("ESCesiumViewer",a.ESVideoFusion.type,ll));let xp=ll;function aT(t,i){const e=t,n=i,o=Math.cos,s=Math.sin;var r=[o(-e)*o(-n),s(-e)*o(-n),s(-n)];return r}function Wy(t,i,e){return t*(-.5+e/i)}function Gy(t,i,e,n){const o=new Float32Array((e+1)*(n+1)*3+3);for(let s=0;s<e+1;++s)for(let r=0;r<n+1;++r){const l=aT(Wy(t,e,s),Wy(i,n,r));o[(r*(e+1)+s)*3+0]=l[0],o[(r*(e+1)+s)*3+1]=l[1],o[(r*(e+1)+s)*3+2]=l[2]}return o[(e+1)*(n+1)*3+0]=0,o[(e+1)*(n+1)*3+1]=0,o[(e+1)*(n+1)*3+2]=0,o}function lT(t,i){var e=new Uint16Array(t*i*6);for(let n=0;n<t;++n)for(let o=0;o<i;++o){const s=o*(t+1)+n,r=o*(t+1)+n+1,l=(o+1)*(t+1)+n,c=(o+1)*(t+1)+n+1,u=(o*t+n)*6;e[u+0]=s,e[u+1]=r,e[u+2]=c,e[u+3]=s,e[u+4]=c,e[u+5]=l}return e}function cT(t,i,e,n){const o=t*e,s=i*n,r=new Uint16Array((t+1)*(s*2)+(i+1)*(o*2)+4*2);for(let g=0;g<t+1;++g)for(let m=0;m<s;++m){const y=g*e;r[(g*s+m)*2+0]=m*(o+1)+y,r[(g*s+m)*2+1]=(m+1)*(o+1)+y}const l=(t+1)*(s*2);for(let g=0;g<i+1;++g)for(let m=0;m<o;++m){const y=g*n;r[l+(m+g*o)*2+0]=y*(o+1)+m,r[l+(m+g*o)*2+1]=y*(o+1)+m+1}const c=(t+1)*(s*2)+(i+1)*(o*2),u=0,d=o,p=(o+1)*s,f=(o+1)*(s+1)-1;return r[c+0]=u,r[c+1]=(o+1)*(s+1),r[c+2]=d,r[c+3]=(o+1)*(s+1),r[c+4]=p,r[c+5]=(o+1)*(s+1),r[c+6]=f,r[c+7]=(o+1)*(s+1),r}var hT=`
1484
1484
  // vtxf 使用double类型的position进行计算
1485
1485
  // in vec3 position3DHigh;
1486
1486
  // in vec3 position3DLow;
@@ -1507,7 +1507,7 @@ void main()
1507
1507
  // v_st = st;
1508
1508
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
1509
1509
  }
1510
- `,dT=`
1510
+ `,uT=`
1511
1511
  in vec3 v_positionEC;
1512
1512
  in vec3 v_normalEC;
1513
1513
  // vec2 v_st;
@@ -1542,7 +1542,7 @@ void main()
1542
1542
  out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
1543
1543
  #endif
1544
1544
  }
1545
- `,pT={position:0,normal:1};class fT{constructor(i){this.modelMatrix=i.modelMatrix??new h.Matrix4,this.fovH=i.fovH??h.Math.toRadians(60),this.fovV=i.fovV??h.Math.toRadians(30),this.segmentH=i.segmentH??6,this.segmentV=i.segmentV??3,this.subSegmentH=i.subSegmentH??3,this.subSegmentV=i.subSegmentV??3,this._faceColor=i.faceColor??new h.Color(1,1,0,.5),this._lineColor=i.lineColor??new h.Color(1,0,0),this.show=i.lineColor??!0,this._modelMatrix=h.Matrix4.clone(h.Matrix4.IDENTITY),this._fovH=0,this._fovV=0,this._segmentH=1,this._segmentV=1,this._subSegmentH=1,this._subSegmentV=1,this._boundingSphere=new h.BoundingSphere,this._initBoundingSphere=void 0,this._command=void 0}_createCommand(i){const e=this._subSegmentH*this._segmentH,n=this._subSegmentV*this._segmentV;var o=Gy(this._fovH,this._fovV,e,n),s=Gy(this._fovH,this._fovV,e,n),r=cT(e,n),l=hT(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV),c=!0,u=!1,d=h.Appearance.getDefaultRenderState(c,u,void 0),p=h.RenderState.fromCache(d),f=new h.ShaderSource({sources:[uT]}),g=new h.ShaderSource({sources:[dT]}),m={xbsjColor:()=>this._faceColor},y={xbsjColor:()=>this._lineColor},_=h.ShaderProgram.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:g,attributeLocations:pT});this._shaderprogram=_;var P=h.Buffer.createVertexBuffer({context:i,typedArray:o,usage:h.BufferUsage.STATIC_DRAW}),C=h.Buffer.createVertexBuffer({context:i,typedArray:s,usage:h.BufferUsage.STATIC_DRAW}),S=h.Buffer.createIndexBuffer({context:i,typedArray:r,usage:h.BufferUsage.STATIC_DRAW,indexDatatype:h.IndexDatatype.UNSIGNED_SHORT}),x=h.Buffer.createIndexBuffer({context:i,typedArray:l,usage:h.BufferUsage.STATIC_DRAW,indexDatatype:h.IndexDatatype.UNSIGNED_SHORT});const A=new h.VertexArray({context:i,attributes:[{index:0,vertexBuffer:P,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT},{index:1,vertexBuffer:C,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT}],indexBuffer:S}),R=new h.VertexArray({context:i,attributes:[{index:0,vertexBuffer:P,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT},{index:1,vertexBuffer:C,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT}],indexBuffer:x});this._initBoundingSphere=h.BoundingSphere.fromVertices(o),this._command=new h.DrawCommand({vertexArray:A,primitiveType:h.PrimitiveType.TRIANGLES,renderState:p,shaderProgram:_,uniformMap:m,owner:this,pass:h.Pass.TRANSLUCENT,modelMatrix:new h.Matrix4,boundingVolume:new h.BoundingSphere,cull:!0}),this._lineCommand=new h.DrawCommand({vertexArray:R,primitiveType:h.PrimitiveType.LINES,renderState:p,shaderProgram:_,uniformMap:y,owner:this,pass:h.Pass.TRANSLUCENT,modelMatrix:new h.Matrix4,boundingVolume:new h.BoundingSphere,cull:!0})}update(i){if(!this.show||!i.passes.render)return;(this.fovH!==this._fovH||this.fovV!==this._fovV||this.segmentH!==this._segmentH||this.segmentV!==this._segmentV||this.subSegmentH!==this._subSegmentH||this.subSegmentV!==this._subSegmentV)&&(this._fovH=this.fovH,this._fovV=this.fovV,this._segmentH=this.segmentH,this._segmentV=this.segmentV,this._subSegmentH=this.subSegmentH,this._subSegmentV=this.subSegmentV,this._modelMatrix=h.clone(h.Matrix4.IDENTITY),this._destroyVideoMemory()),h.defined(this._command)||this._createCommand(i.context),h.Matrix4.equals(this.modelMatrix,this._modelMatrix)||(h.Matrix4.clone(this.modelMatrix,this._modelMatrix),this._command.modelMatrix=h.Matrix4.IDENTITY,this._command.modelMatrix=this._modelMatrix,this._command.boundingVolume=h.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere),this._lineCommand.modelMatrix=h.Matrix4.IDENTITY,this._lineCommand.modelMatrix=this._modelMatrix,this._lineCommand.boundingVolume=h.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere)),this._command&&i.commandList.push(this._command),this._lineCommand&&i.commandList.push(this._lineCommand)}isDestroyed(){return!1}_destroyVideoMemory(){this._shaderprogram=this._shaderprogram&&this._shaderprogram.destroy(),h.defined(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command=void 0),h.defined(this._lineCommand)&&(this._lineCommand.vertexArray=this._lineCommand.vertexArray&&this._lineCommand.vertexArray.destroy(),this._lineCommand=void 0)}destroy(){return this._destroyVideoMemory(),h.destroyObject(this)}}var gT=h.ShadowMapShader.createShadowReceiveFragmentShader;h.ShadowMapShader.createShadowReceiveFragmentShader=function(t,i,e,n,o){var s=i._isSpotLight,r=gT.bind(this)(t,i,e,n,o);if(s){var l="out_FragColor.rgb *= visibility;",c="out_FragColor.rgb *= (visibility < 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0));";r.sources[r.sources.length-1]=r.sources[r.sources.length-1].replace(l,c);{var l="vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);",c=l+"if (distance(positionEC.xyz, shadowMap_lightPositionEC.xyz) > shadowMap_lightPositionEC.w) { return; }";r.sources[r.sources.length-1]=r.sources[r.sources.length-1].replace(l,c)}}return r};function mT(){var t=h.Matrix3.fromRotationZ(h.Math.PI*.5),i=h.Matrix3.fromRotationY(h.Math.PI*.5),e=new h.Matrix3;return h.Matrix3.multiply(t,i,e),e}const vT=mT();class Hy{_updateFov(){this._fovH<0||this._fovV<0||(this.frustum.aspectRatio=Math.tan(this._fovH*.5)/Math.tan(this._fovV*.5),this.frustum.fov=this._fovH>this._fovV?this._fovH:this._fovV)}constructor(i){this._fovH=h.Math.PI/3,this._fovV=h.Math.PI/6,h.defined(i)||console.error("scene is not defined!"),this._scene=i,this._frustum=new h.PerspectiveFrustum,this._updateFov(),this._frustum.near=1,this._frustum.far=400,this._spotLightCamera=new h.Camera(i),this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap=new h.ShadowMap({context:i.context,lightCamera:this._spotLightCamera,cascadesEnabled:!1}),this._debugCameraPrimitive=new fT({}),this._enabledChangedEvent=new h.Event}update(i){if(this._viewshedShadowMap.enabled){if(i.shadowMaps.unshift(this._viewshedShadowMap),!this._frustum.equals(this._spotLightCamera.frustum)){this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap._pointLightRadius=this._frustum.far;const n=this.shadowMap._boundingSphere;n.radius=Math.random()}if(this._debugCameraPrimitive.show){var e=this._debugCameraPrimitive.modelMatrix;h.Matrix4.clone(this._spotLightCamera.inverseViewMatrix,e),h.Matrix4.multiplyByMatrix3(e,vT,e),h.Matrix4.multiplyByUniformScale(e,this._spotLightCamera.frustum.far,e);const o=this._spotLightCamera.frustum;this._debugCameraPrimitive.fovV=o.aspectRatio<=1?o.fov:Math.atan(Math.tan(o.fov*.5)/o.aspectRatio)*2,this._debugCameraPrimitive.fovH=o.aspectRatio>1?o.fov:Math.atan(Math.tan(o.fov*.5)*o.aspectRatio)*2,this._debugCameraPrimitive.update(i)}}}setView(i){this._spotLightCamera.setView(i)}get enabledChangedEvent(){return this._enabledChangedEvent}isDestroyed(){return!1}destroy(){return this._debugCameraPrimitive=this._debugCameraPrimitive&&this._debugCameraPrimitive.destroy(),this._viewshedShadowMap=this._viewshedShadowMap&&this._viewshedShadowMap.destroy(),h.destroyObject(this)}}Object.defineProperties(Hy.prototype,{frustum:{get:function(){return this._frustum}},fovH:{get:function(){return this._fovH},set:function(t){this._fovH=t,this._updateFov()}},fovV:{get:function(){return this._fovV},set:function(t){this._fovV=t,this._updateFov()}},near:{get:function(){return this.frustum.near},set:function(t){this.frustum.near!==t&&(this.frustum.near=t)}},far:{get:function(){return this.frustum.far},set:function(t){this.frustum.far!==t&&(this.frustum.far=t)}},position:{get:function(){return this._spotLightCamera.positionWC},set:function(t){this.setView({destination:t,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},heading:{get:function(){return this._spotLightCamera.heading},set:function(t){this._spotLightCamera.heading!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:t,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},pitch:{get:function(){return this._spotLightCamera.pitch},set:function(t){this._spotLightCamera.pitch!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:t,roll:this._spotLightCamera.roll}})}},showHelper:{get:function(){return this._debugCameraPrimitive.show},set:function(t){this._debugCameraPrimitive.show=t}},roll:{get:function(){return this._spotLightCamera.roll},set:function(t){this._spotLightCamera.roll!==t&&this._spotLightCamera.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:t}})}},shadowMap:{get:function(){return this._viewshedShadowMap}},lightCamera:{get:function(){return this._spotLightCamera}},enabled:{get:function(){return this._viewshedShadowMap.enabled},set:function(t){this._viewshedShadowMap.enabled!==t&&(t?(this._viewshedShadowMap.enabled=!0,this._viewshedShadowMap._pointLightRadius=this._spotLightCamera.frustum.far):this._viewshedShadowMap.enabled=!1,this._enabledChangedEvent.raiseEvent(t))}}});const cl=class cl extends fe{constructor(e,n){super(e,n);v(this,"_czmViewShed");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmViewShed=this.disposeVar(new Hy(o.scene));const s=this._czmViewShed;s.ESSceneObjectID=e.id,o.scene.primitives.add(s),this.dispose(()=>o.scene.primitives.remove(s));{const r=()=>{if(e.fov==0||e.aspectRatio==0)return;const c=h.Math.toRadians(e.fov),u=h.Math.toRadians(e.fov/e.aspectRatio),d=h.Math.PI-1e-5;s.fovH=h.Math.clamp(c,-d,d),s.fovV=h.Math.clamp(u,-d,d)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(l.disposableOn(r))}{const r=()=>{s.enabled=!!e.position&&e.show,s.position&&(s.position=Le(e.position))};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,e.showChanged));this.dispose(l.disposableOn(r))}{const r=()=>{s.heading=h.Math.toRadians(e.rotation[0]+90),s.pitch=h.Math.toRadians(e.rotation[1]),s.roll=h.Math.toRadians(e.rotation[2])};r(),this.ad(e.rotationChanged.don(r))}{const r=()=>{s.showHelper=e.showFrustum??a.ESViewShed.defaults.showFrustum};r(),this.ad(e.showFrustumChanged.don(r))}{const r=()=>{if(e.far<e.near){e.far=e.near;return}s.far=e.far};r(),this.ad(e.farChanged.don(r))}{const r=()=>{e.near>e.far||e.near<=0||(s.near=e.near)};r(),this.ad(e.nearChanged.don(r))}}get czmViewShed(){return this._czmViewShed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.far??a.ESViewShed.defaults.far;return o.position?(ei(s,o,n,o.position,r,e),!0):!1}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmViewShed&&(this.czmViewShed.showHelper=r&&(e.showFrustum??a.ESViewShed.defaults.showFrustum),this.czmViewShed.enabled=r&&e.show&&!!e.position)}}};v(cl,"type",cl.register("ESCesiumViewer",a.ESViewShed.type,cl));let Ap=cl;function yT(t,i,e){const n=document.createElement("div");let o,s="";const r=Object.keys(t.info);for(let c=0;c<r.length;c++){if(r[c].toLowerCase()=="title"){o=t.info[r[c]];continue}s+=`<div style="
1545
+ `,dT={position:0,normal:1};class pT{constructor(i){this.modelMatrix=i.modelMatrix??new h.Matrix4,this.fovH=i.fovH??h.Math.toRadians(60),this.fovV=i.fovV??h.Math.toRadians(30),this.segmentH=i.segmentH??6,this.segmentV=i.segmentV??3,this.subSegmentH=i.subSegmentH??3,this.subSegmentV=i.subSegmentV??3,this._faceColor=i.faceColor??new h.Color(1,1,0,.5),this._lineColor=i.lineColor??new h.Color(1,0,0),this.show=i.lineColor??!0,this._modelMatrix=h.Matrix4.clone(h.Matrix4.IDENTITY),this._fovH=0,this._fovV=0,this._segmentH=1,this._segmentV=1,this._subSegmentH=1,this._subSegmentV=1,this._boundingSphere=new h.BoundingSphere,this._initBoundingSphere=void 0,this._command=void 0}_createCommand(i){const e=this._subSegmentH*this._segmentH,n=this._subSegmentV*this._segmentV;var o=Gy(this._fovH,this._fovV,e,n),s=Gy(this._fovH,this._fovV,e,n),r=lT(e,n),l=cT(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV),c=!0,u=!1,d=h.Appearance.getDefaultRenderState(c,u,void 0),p=h.RenderState.fromCache(d),f=new h.ShaderSource({sources:[hT]}),g=new h.ShaderSource({sources:[uT]}),m={xbsjColor:()=>this._faceColor},y={xbsjColor:()=>this._lineColor},_=h.ShaderProgram.fromCache({context:i,vertexShaderSource:f,fragmentShaderSource:g,attributeLocations:dT});this._shaderprogram=_;var P=h.Buffer.createVertexBuffer({context:i,typedArray:o,usage:h.BufferUsage.STATIC_DRAW}),C=h.Buffer.createVertexBuffer({context:i,typedArray:s,usage:h.BufferUsage.STATIC_DRAW}),S=h.Buffer.createIndexBuffer({context:i,typedArray:r,usage:h.BufferUsage.STATIC_DRAW,indexDatatype:h.IndexDatatype.UNSIGNED_SHORT}),x=h.Buffer.createIndexBuffer({context:i,typedArray:l,usage:h.BufferUsage.STATIC_DRAW,indexDatatype:h.IndexDatatype.UNSIGNED_SHORT});const A=new h.VertexArray({context:i,attributes:[{index:0,vertexBuffer:P,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT},{index:1,vertexBuffer:C,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT}],indexBuffer:S}),R=new h.VertexArray({context:i,attributes:[{index:0,vertexBuffer:P,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT},{index:1,vertexBuffer:C,componentsPerAttribute:3,componentDatatype:h.ComponentDatatype.FLOAT}],indexBuffer:x});this._initBoundingSphere=h.BoundingSphere.fromVertices(o),this._command=new h.DrawCommand({vertexArray:A,primitiveType:h.PrimitiveType.TRIANGLES,renderState:p,shaderProgram:_,uniformMap:m,owner:this,pass:h.Pass.TRANSLUCENT,modelMatrix:new h.Matrix4,boundingVolume:new h.BoundingSphere,cull:!0}),this._lineCommand=new h.DrawCommand({vertexArray:R,primitiveType:h.PrimitiveType.LINES,renderState:p,shaderProgram:_,uniformMap:y,owner:this,pass:h.Pass.TRANSLUCENT,modelMatrix:new h.Matrix4,boundingVolume:new h.BoundingSphere,cull:!0})}update(i){if(!this.show||!i.passes.render)return;(this.fovH!==this._fovH||this.fovV!==this._fovV||this.segmentH!==this._segmentH||this.segmentV!==this._segmentV||this.subSegmentH!==this._subSegmentH||this.subSegmentV!==this._subSegmentV)&&(this._fovH=this.fovH,this._fovV=this.fovV,this._segmentH=this.segmentH,this._segmentV=this.segmentV,this._subSegmentH=this.subSegmentH,this._subSegmentV=this.subSegmentV,this._modelMatrix=h.clone(h.Matrix4.IDENTITY),this._destroyVideoMemory()),h.defined(this._command)||this._createCommand(i.context),h.Matrix4.equals(this.modelMatrix,this._modelMatrix)||(h.Matrix4.clone(this.modelMatrix,this._modelMatrix),this._command.modelMatrix=h.Matrix4.IDENTITY,this._command.modelMatrix=this._modelMatrix,this._command.boundingVolume=h.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere),this._lineCommand.modelMatrix=h.Matrix4.IDENTITY,this._lineCommand.modelMatrix=this._modelMatrix,this._lineCommand.boundingVolume=h.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere)),this._command&&i.commandList.push(this._command),this._lineCommand&&i.commandList.push(this._lineCommand)}isDestroyed(){return!1}_destroyVideoMemory(){this._shaderprogram=this._shaderprogram&&this._shaderprogram.destroy(),h.defined(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command=void 0),h.defined(this._lineCommand)&&(this._lineCommand.vertexArray=this._lineCommand.vertexArray&&this._lineCommand.vertexArray.destroy(),this._lineCommand=void 0)}destroy(){return this._destroyVideoMemory(),h.destroyObject(this)}}var fT=h.ShadowMapShader.createShadowReceiveFragmentShader;h.ShadowMapShader.createShadowReceiveFragmentShader=function(t,i,e,n,o){var s=i._isSpotLight,r=fT.bind(this)(t,i,e,n,o);if(s){var l="out_FragColor.rgb *= visibility;",c="out_FragColor.rgb *= (visibility < 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0));";r.sources[r.sources.length-1]=r.sources[r.sources.length-1].replace(l,c);{var l="vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);",c=l+"if (distance(positionEC.xyz, shadowMap_lightPositionEC.xyz) > shadowMap_lightPositionEC.w) { return; }";r.sources[r.sources.length-1]=r.sources[r.sources.length-1].replace(l,c)}}return r};function gT(){var t=h.Matrix3.fromRotationZ(h.Math.PI*.5),i=h.Matrix3.fromRotationY(h.Math.PI*.5),e=new h.Matrix3;return h.Matrix3.multiply(t,i,e),e}const mT=gT();class Hy{_updateFov(){this._fovH<0||this._fovV<0||(this.frustum.aspectRatio=Math.tan(this._fovH*.5)/Math.tan(this._fovV*.5),this.frustum.fov=this._fovH>this._fovV?this._fovH:this._fovV)}constructor(i){this._fovH=h.Math.PI/3,this._fovV=h.Math.PI/6,h.defined(i)||console.error("scene is not defined!"),this._scene=i,this._frustum=new h.PerspectiveFrustum,this._updateFov(),this._frustum.near=1,this._frustum.far=400,this._spotLightCamera=new h.Camera(i),this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap=new h.ShadowMap({context:i.context,lightCamera:this._spotLightCamera,cascadesEnabled:!1}),this._debugCameraPrimitive=new pT({}),this._enabledChangedEvent=new h.Event}update(i){if(this._viewshedShadowMap.enabled){if(i.shadowMaps.unshift(this._viewshedShadowMap),!this._frustum.equals(this._spotLightCamera.frustum)){this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap._pointLightRadius=this._frustum.far;const n=this.shadowMap._boundingSphere;n.radius=Math.random()}if(this._debugCameraPrimitive.show){var e=this._debugCameraPrimitive.modelMatrix;h.Matrix4.clone(this._spotLightCamera.inverseViewMatrix,e),h.Matrix4.multiplyByMatrix3(e,mT,e),h.Matrix4.multiplyByUniformScale(e,this._spotLightCamera.frustum.far,e);const o=this._spotLightCamera.frustum;this._debugCameraPrimitive.fovV=o.aspectRatio<=1?o.fov:Math.atan(Math.tan(o.fov*.5)/o.aspectRatio)*2,this._debugCameraPrimitive.fovH=o.aspectRatio>1?o.fov:Math.atan(Math.tan(o.fov*.5)*o.aspectRatio)*2,this._debugCameraPrimitive.update(i)}}}setView(i){this._spotLightCamera.setView(i)}get enabledChangedEvent(){return this._enabledChangedEvent}isDestroyed(){return!1}destroy(){return this._debugCameraPrimitive=this._debugCameraPrimitive&&this._debugCameraPrimitive.destroy(),this._viewshedShadowMap=this._viewshedShadowMap&&this._viewshedShadowMap.destroy(),h.destroyObject(this)}}Object.defineProperties(Hy.prototype,{frustum:{get:function(){return this._frustum}},fovH:{get:function(){return this._fovH},set:function(t){this._fovH=t,this._updateFov()}},fovV:{get:function(){return this._fovV},set:function(t){this._fovV=t,this._updateFov()}},near:{get:function(){return this.frustum.near},set:function(t){this.frustum.near!==t&&(this.frustum.near=t)}},far:{get:function(){return this.frustum.far},set:function(t){this.frustum.far!==t&&(this.frustum.far=t)}},position:{get:function(){return this._spotLightCamera.positionWC},set:function(t){this.setView({destination:t,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},heading:{get:function(){return this._spotLightCamera.heading},set:function(t){this._spotLightCamera.heading!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:t,pitch:this._spotLightCamera.pitch,roll:this._spotLightCamera.roll}})}},pitch:{get:function(){return this._spotLightCamera.pitch},set:function(t){this._spotLightCamera.pitch!==t&&this.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:t,roll:this._spotLightCamera.roll}})}},showHelper:{get:function(){return this._debugCameraPrimitive.show},set:function(t){this._debugCameraPrimitive.show=t}},roll:{get:function(){return this._spotLightCamera.roll},set:function(t){this._spotLightCamera.roll!==t&&this._spotLightCamera.setView({destination:this._spotLightCamera.positionWC,orientation:{heading:this._spotLightCamera.heading,pitch:this._spotLightCamera.pitch,roll:t}})}},shadowMap:{get:function(){return this._viewshedShadowMap}},lightCamera:{get:function(){return this._spotLightCamera}},enabled:{get:function(){return this._viewshedShadowMap.enabled},set:function(t){this._viewshedShadowMap.enabled!==t&&(t?(this._viewshedShadowMap.enabled=!0,this._viewshedShadowMap._pointLightRadius=this._spotLightCamera.frustum.far):this._viewshedShadowMap.enabled=!1,this._enabledChangedEvent.raiseEvent(t))}}});const cl=class cl extends fe{constructor(e,n){super(e,n);v(this,"_czmViewShed");const o=n.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmViewShed=this.disposeVar(new Hy(o.scene));const s=this._czmViewShed;s.ESSceneObjectID=e.id,o.scene.primitives.add(s),this.dispose(()=>o.scene.primitives.remove(s));{const r=()=>{if(e.fov==0||e.aspectRatio==0)return;const c=h.Math.toRadians(e.fov),u=h.Math.toRadians(e.fov/e.aspectRatio),d=h.Math.PI-1e-5;s.fovH=h.Math.clamp(c,-d,d),s.fovV=h.Math.clamp(u,-d,d)};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(l.disposableOn(r))}{const r=()=>{s.enabled=!!e.position&&e.show,s.position&&(s.position=Le(e.position))};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.positionChanged,e.showChanged));this.dispose(l.disposableOn(r))}{const r=()=>{s.heading=h.Math.toRadians(e.rotation[0]+90),s.pitch=h.Math.toRadians(e.rotation[1]),s.roll=h.Math.toRadians(e.rotation[2])};r(),this.ad(e.rotationChanged.don(r))}{const r=()=>{s.showHelper=e.showFrustum??a.ESViewShed.defaults.showFrustum};r(),this.ad(e.showFrustumChanged.don(r))}{const r=()=>{if(e.far<e.near){e.far=e.near;return}s.far=e.far};r(),this.ad(e.farChanged.don(r))}{const r=()=>{e.near>e.far||e.near<=0||(s.near=e.near)};r(),this.ad(e.nearChanged.don(r))}}get czmViewShed(){return this._czmViewShed}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);{const r=o.far??a.ESViewShed.defaults.far;return o.position?(ei(s,o,n,o.position,r,e),!0):!1}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmViewShed&&(this.czmViewShed.showHelper=r&&(e.showFrustum??a.ESViewShed.defaults.showFrustum),this.czmViewShed.enabled=r&&e.show&&!!e.position)}}};v(cl,"type",cl.register("ESCesiumViewer",a.ESViewShed.type,cl));let Ap=cl;function vT(t,i,e){const n=document.createElement("div");let o,s="";const r=Object.keys(t.info);for(let c=0;c<r.length;c++){if(r[c].toLowerCase()=="title"){o=t.info[r[c]];continue}s+=`<div style="
1546
1546
  display: flex;
1547
1547
  font-size: 10px;
1548
1548
  width: 100%;">
@@ -1586,7 +1586,7 @@ void main()
1586
1586
  ${s}
1587
1587
  </div>
1588
1588
  </div>
1589
- </div>`;let l=document.createElement("style");return l.setAttribute("type","text/css"),l.innerHTML=wT,n.appendChild(l),n}const wT=`
1589
+ </div>`;let l=document.createElement("style");return l.setAttribute("type","text/css"),l.innerHTML=yT,n.appendChild(l),n}const yT=`
1590
1590
  /*定义滚动条高宽及背景
1591
1591
  高宽分别对应横竖滚动条的尺寸*/
1592
1592
  .info ::-webkit-scrollbar,.body ::-webkit-scrollbar {
@@ -1610,7 +1610,7 @@ void main()
1610
1610
  border-radius: 8px;
1611
1611
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
1612
1612
  background-color: green;
1613
- }`,hl=class hl extends Hr{constructor(e,n){super(e,n);v(this,"_widgetTemp");if(!n.viewer){console.warn("viewer is undefined!");return}(async()=>{const s="${earthsdk3-assets-script-dir}/assets/img/Info/",r=await co(a.ESSceneObject.context.getStrFromEnv(s+"/InfoBackGround.png")),l=await co(a.ESSceneObject.context.getStrFromEnv(s+"/InfoItemRowBackGround.png"));{const c=this.dv(a.createNextAnimateFrameEvent(e.screenRenderChanged,e.infoChanged));this.widgetTemp=this.disposeVar(new a.ObjResettingWithEvent(c,()=>{const u=yT(e,l,r);return e.screenRender?new Pn(e,n,u,Object.keys(e.info).length!=0):new Mc(e,n,u,Object.keys(e.info).length!=0)}))}})()}get widgetTemp(){return this._widgetTemp}set widgetTemp(e){this._widgetTemp=e}flyTo(e,n){const{sceneObject:o,czmViewer:s,widgetTemp:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r)r.obj.flyTo(e,n);else{const l=setTimeout(()=>{clearTimeout(l),this.flyTo(e,n)},200)}return o.flyOverEvent.emit(n,"over",s),!0}};v(hl,"type",hl.register("ESCesiumViewer",a.ESWidget.type,hl));let Tp=hl;const CT=`<?xml version="1.0" encoding="utf-8" ?>
1613
+ }`,hl=class hl extends Hr{constructor(e,n){super(e,n);v(this,"_widgetTemp");if(!n.viewer){console.warn("viewer is undefined!");return}(async()=>{const s="${earthsdk3-assets-script-dir}/assets/img/Info/",r=await co(a.ESSceneObject.context.getStrFromEnv(s+"/InfoBackGround.png")),l=await co(a.ESSceneObject.context.getStrFromEnv(s+"/InfoItemRowBackGround.png"));{const c=this.dv(a.createNextAnimateFrameEvent(e.screenRenderChanged,e.infoChanged));this.widgetTemp=this.disposeVar(new a.ObjResettingWithEvent(c,()=>{const u=vT(e,l,r);return e.screenRender?new Pn(e,n,u,Object.keys(e.info).length!=0):new Mc(e,n,u,Object.keys(e.info).length!=0)}))}})()}get widgetTemp(){return this._widgetTemp}set widgetTemp(e){this._widgetTemp=e}flyTo(e,n){const{sceneObject:o,czmViewer:s,widgetTemp:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r)r.obj.flyTo(e,n);else{const l=setTimeout(()=>{clearTimeout(l),this.flyTo(e,n)},200)}return o.flyOverEvent.emit(n,"over",s),!0}};v(hl,"type",hl.register("ESCesiumViewer",a.ESWidget.type,hl));let Tp=hl;const wT=`<?xml version="1.0" encoding="utf-8" ?>
1614
1614
  <kml xmlns="http://www.opengis.net/kml/2.2">
1615
1615
  <Document id="root_doc">
1616
1616
  <Folder><name>高速公路</name>
@@ -1635,7 +1635,7 @@ void main()
1635
1635
  <Point><coordinates>118.49952,31.69933</coordinates></Point>
1636
1636
  </Placemark>
1637
1637
  </Folder>
1638
- `,_T=`KML文件本质上是一个XML文件,完全遵循XML文件格式。但是,KML文件定义了几个特殊的元素标签,常用标签为:Placemark:标记或路径 Linestring:路劲的坐标点 Point:标记位置的坐标 Coordinates:经纬度坐标
1638
+ `,CT=`KML文件本质上是一个XML文件,完全遵循XML文件格式。但是,KML文件定义了几个特殊的元素标签,常用标签为:Placemark:标记或路径 Linestring:路劲的坐标点 Point:标记位置的坐标 Coordinates:经纬度坐标
1639
1639
  \`\`\`
1640
1640
  <?xml version="1.0" encoding="utf-8" ?>
1641
1641
  <kml xmlns="http://www.opengis.net/kml/2.2">
@@ -1673,7 +1673,7 @@ void main()
1673
1673
  viewer.clock.multiplier = 30;
1674
1674
  viewer.clock.shouldAnimate = true;
1675
1675
  }
1676
- `,PT=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
1676
+ `,_T=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
1677
1677
 
1678
1678
  该路径可以使用下面回调函数
1679
1679
  \`\`\`
@@ -1723,7 +1723,7 @@ ${$y}
1723
1723
  }
1724
1724
 
1725
1725
  \`\`\`
1726
- `;function bT(t){return new DOMParser().parseFromString(t,"application/xml")}const gr=class gr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));v(this,"_clock");v(this,"_resetClockEvent",this.disposeVar(new a.Event));v(this,"_dataSource",this.dv(a.react(void 0)));this._clock=this.disposeVar(new ae(e)),this.dispose(a.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(a.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(a.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(a.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(a.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(a.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(a.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s;s=document.createElement("div"),o.container.appendChild(s),s.style.pointerEvents="none",s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",this.d(()=>{o.container.removeChild(s)}),this.d(this.flyToEvent.don(d=>{e.actived&&this.dataSource&&(d!==void 0?o.flyTo(this.dataSource,{duration:d/1e3}):o.flyTo(this.dataSource))}));const r=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource),this._dataSource.value=void 0)};this.d(()=>r());const l=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:d}=this;d.clock&&(this.startTime=h.JulianDate.toDate(d.clock.startTime).getTime(),this.stopTime=h.JulianDate.toDate(d.clock.stopTime).getTime(),this.currentTime=h.JulianDate.toDate(d.clock.currentTime).getTime(),this.multiplier=d.clock.multiplier,this.clockStep=ae.getClockStep(d.clock.clockStep),this.clockRange=ae.getClockRange(d.clock.clockRange))};this.d(this.resetClockEvent.don(l));const c=()=>{this.dataSource&&(this.dataSource.show=this.show??gr.defaults.show,s.style.display=this.show??gr.defaults.show?"block":"none")};c(),this.d(this.showChanged.don(c));const u=this.dv(a.react(void 0));{const d=()=>{var g;if(this.uri)if(this.uri&&typeof this.uri!="string")(g=h.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||g.then(m=>m);else return a.ESSceneObject.context.getStrFromEnv(this.uri)},p=()=>{u.value=(this.data&&bT(this.data))??d()};p();const f=this.dv(a.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.d(f.don(p))}{const d=this.dv(a.createProcessingFromAsyncFunc(async g=>{if(r(),!u.value)return;let m;try{m=await h.KmlDataSource.load(u.value,{camera:o.scene.camera,canvas:o.scene.canvas,screenOverlayContainer:s,clampToGround:this.clampToGround})}catch(y){m=void 0,console.error(`kml加载报错:${y}`),console.error(y)}if(m&&(m.entities.values.forEach(y=>{h.Entity.prototype&&(m.ESSceneObjectID=n)}),g.check(),o.dataSources.add(m),this._dataSource.value=m,c(),(this.autoResetClock??gr.defaults.autoResetClock)&&l(),!!this.loadFun))try{this.loadFun(m,o)}catch(y){console.error(y)}})),p=()=>{d.isRunning&&d.cancel(),d.restart()};p();const f=this.dv(a.createNextAnimateFrameEvent(u.changed,this.loadFunChanged,this.clampToGroundChanged));this.d(f.don(p))}{const d=()=>{if(this.loadFuncStr)try{const p=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=p}catch(p){console.error(p),this.loadFun=void 0}else this.loadFun=void 0};d(),this.d(this.loadFuncStrChanged.don(d))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};v(gr,"defaults",{show:!0,allowPicking:!0,defaultLoadFuncStr:$y,defaultLoadFuncDocStr:PT,data:CT,dataMd:_T,autoResetClock:!0,clockEnabled:!1,startTime:ae.defaults.startTime,stopTime:ae.defaults.stopTime,currentTime:ae.defaults.currentTime,multiplier:ae.defaults.multiplier,clockStep:ae.defaults.clockStep,clockRange:ae.defaults.clockRange,shouldAnimate:ae.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",clampToGround:!1});let Io=gr;(t=>{t.createDefaultProps=()=>({show:!0,uri:void 0,data:void 0,allowPicking:void 0,loadFuncStr:void 0,autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,clampToGround:void 0})})(Io||(Io={})),a.extendClassProps(Io.prototype,Io.createDefaultProps);const ul=class ul extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Io(e,i.id));this.dispose(a.track([o,"show"],[i,"show"])),this.dispose(a.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([o,"data"],[i,"data"])),this.dispose(a.bind([o,"uri"],[i,"uri"])),this.dispose(a.bind([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(a.bind([o,"autoResetClock"],[i,"autoResetClock"])),this.dispose(a.bind([o,"clockEnabled"],[i,"clockEnabled"])),this.dispose(a.bind([o,"startTime"],[i,"startTime"])),this.dispose(a.bind([o,"stopTime"],[i,"stopTime"])),this.dispose(a.bind([o,"currentTime"],[i,"currentTime"])),this.dispose(a.bind([o,"multiplier"],[i,"multiplier"])),this.dispose(a.bind([o,"clockStep"],[i,"clockStep"])),this.dispose(a.bind([o,"clockRange"],[i,"clockRange"])),this.dispose(a.bind([o,"shouldAnimate"],[i,"shouldAnimate"])),this.dispose(a.bind([o,"clampToGround"],[i,"clampToGround"])),this.dispose(i.flyToEvent.disposableOn(s=>{e.actived&&o.flyTo(s&&s*1e3)}))}};v(ul,"type",ul.register("ESCesiumViewer",mh.type,ul));let Mp=ul;const dl=class dl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoCircle");v(this,"_geoPolyline");if(this._czmGeoCircle=this.disposeVar(new fo(n,e.id)),this._geoPolyline=this.dv(new be(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoCircle,r=this._geoPolyline;{const l=()=>{r.positions=ST(e.position,e.rotation,e.radius)};l();const c=this.dv(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.radiusChanged));this.dispose(c.don(l))}{const l=()=>{s.show=e.show&&e.filled,r.show=e.show&&e.stroked};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.strokedChanged,e.strokeGroundChanged));this.dispose(c.don(l))}r.loop=!0,this.d(a.track([r,"ground"],[e,"strokeGround"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.bind([r,"width"],[e,"strokeWidth"]));{s.outline=!1,this.dispose(a.track([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.bind([s,"radius"],[e,"radius"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"ground"],[e,"fillGround"]));{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:a.ESLocalCircle.defaults.fillStyle.color}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}}}get czmGeoCircle(){return this._czmGeoCircle}get geoPolyline(){return this._geoPolyline}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this._czmGeoCircle.show=e.show&&e.filled&&r,this._geoPolyline.show=e.show&&e.stroked&&r}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoCircle:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?(ei(s,o,n,o.position,o.radius,e,!0),!0):!1:!1}};v(dl,"type",dl.register("ESCesiumViewer",a.ESLocalCircle.type,dl));let Ip=dl;function ST(t,i,e){const o=2*Math.PI/36,s=[];h.Cartesian3.fromDegrees(...t);let r=function(c){let u=new h.Cartesian3(c.x,c.y,c.z),d=h.Cartographic.fromCartesian(u),p=h.Math.toDegrees(d.latitude),f=h.Math.toDegrees(d.longitude),g=d.height;return[f,p,g]};const l=Ie({initialRotation:"yForwardzUp",rotation:[i[0],i[2],-i[1]],position:t});if(!l)return s;for(let c=0;c<36;c++){let u=new h.Cartesian3(e*Math.cos(o*c),e*Math.sin(o*c),0),d=h.Matrix4.multiplyByPoint(l,u,new h.Cartesian3);s.push(r(d))}return s}const pl=class pl extends fe{constructor(e,n){super(e,n);v(this,"_czmESLocalLineStringZ");if(this._czmESLocalLineStringZ=this.disposeVar(new Xr(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESLocalLineStringZ;n.add(s),this.dispose(()=>n.delete(s));{this.dispose(a.track([s,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeColor"],[e,"strokeColor"]));const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"hasDash"],[e,"hasDash"])),this.dispose(a.track([s,"gapColor"],[e,"gapColor"])),this.dispose(a.track([s,"dashLength"],[e,"dashLength"])),this.dispose(a.track([s,"dashPattern"],[e,"dashPattern"])),this.dispose(a.track([s,"hasArrow"],[e,"hasArrow"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(!e.points){s.points=void 0;return}s.points=e.points.map(l=>[l[0],l[1],0])};r(),this.dispose(e.pointsChanged.disposableOn(r))}}get czmESLocalLineStringZ(){return this._czmESLocalLineStringZ}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this._czmESLocalLineStringZ.show=e.show&&e.stroked&&r}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESLocalLineStringZ:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.points&&r.flyTo(e),!0):!1}};v(pl,"type",pl.register("ESCesiumViewer",vh.type,pl));let Dp=pl;const fl=class fl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoPolyline");if(this._czmGeoPolyline=this.disposeVar(new be(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPolyline;s.arcType="NONE";{this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"]));const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"hasDash"],[e,"hasDash"])),this.dispose(a.track([s,"gapColor"],[e,"gapColor"])),this.dispose(a.track([s,"dashLength"],[e,"dashLength"])),this.dispose(a.track([s,"dashPattern"],[e,"dashPattern"])),this.dispose(a.track([s,"hasArrow"],[e,"hasArrow"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[c]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale},e.points);s.positions=c};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(l.disposableOn(r))}}get czmGeoPolyline(){return this._czmGeoPolyline}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this._czmGeoPolyline.show=e.show&&e.stroked&&r}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPolyline: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(fl,"type",fl.register("ESCesiumViewer",Xr.type,fl));let Rp=fl;const gl=class gl extends dh{constructor(e,n){super(e,n);v(this,"_czmESLocalPolygon");if(this._czmESLocalPolygon=this.disposeVar(new a.ESLocalPolygonZ(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESLocalPolygon;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"stroked"],[e,"stroked"])),this.dispose(a.track([s,"strokeColor"],[e,"strokeColor"])),this.dispose(a.track([s,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fillColor"],[e,"fillColor"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"fillGround"],[e,"fillGround"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"]));{const r=()=>{if(!e.points){s.points=void 0;return}s.points=e.points.map(l=>[l[0],l[1],0])};r(),this.dispose(e.pointsChanged.disposableOn(r))}}get czmESLocalPolygon(){return this._czmESLocalPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESLocalPolygon: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(gl,"type",gl.register("ESCesiumViewer",a.ESLocalPolygon.type,gl));let Fp=gl;const ml=class ml extends dh{constructor(e,n){super(e,n);v(this,"_czmGeoPolygon");if(this._czmGeoPolygon=this.disposeVar(new Mi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"fill"],[e,"filled"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[c]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},e.points);s.positions=c};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(l.disposableOn(r))}}get czmGeoPolygon(){return this._czmGeoPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPolygon: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(ml,"type",ml.register("ESCesiumViewer",a.ESLocalPolygonZ.type,ml));let zp=ml;const vl=class vl extends fe{constructor(e,n){super(e,n);v(this,"_czmLocalRectangle");if(this._czmLocalRectangle=this.disposeVar(new a.ESLocalPolygon(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmLocalRectangle;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"stroked"],[e,"stroked"])),this.dispose(a.track([s,"strokeColor"],[e,"strokeColor"])),this.dispose(a.track([s,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fillColor"],[e,"fillColor"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"fillGround"],[e,"fillGround"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"]));{const r=()=>{const l=e.width??0,c=e.height??0;s.points=[[-l,-c],[-l,c],[l,c],[l,-c]]};this.dispose(e.widthChanged.disposableOn(r)),this.dispose(e.heightChanged.disposableOn(r)),r()}}get czmLocalRectangle(){return this._czmLocalRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmLocalRectangle: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(vl,"type",vl.register("ESCesiumViewer",a.ESLocalRectangle.type,vl));let Lp=vl;const yl=class yl 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){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const m=()=>{const y=n.getCameraInfo(),_=y==null?void 0:y.position,C=[...y==null?void 0:y.rotation];C[0]=360,ne(n.viewer,_,void 0,C)};d.addEventListener("click",m),d.style.cursor="pointer",this.dispose(()=>d.removeEventListener("click",m))}{const m=()=>{d.style.display=e.show??a.ESNavigator.defaults.show?"block":"none"};m(),e.dispose(e.showChanged.disposableOn(m))}{const m=()=>{d.style.width=`${e.cssSize?e.cssSize:a.ESNavigator.defaults.cssSize}px`,d.style.height=`${e.cssSize?e.cssSize:a.ESNavigator.defaults.cssSize}px`};m(),e.dispose(e.cssSizeChanged.disposableOn(m))}d.style.position="fixed";{const m=()=>{d.style.top=`${e.cssPosition?e.cssPosition[0]:a.ESNavigator.defaults.cssPosition[0]}px`,d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESNavigator.defaults.cssPosition[1]}px`};m(),e.dispose(e.cssPositionChanged.disposableOn(m))}d.style.transition=" right 0.4s linear",d.style.transition=" right 0.4s linear",d.style.cursor="pointer";const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="100%",p.style.height="100%",p.style.position="relative";const f=document.createElement("img");p.appendChild(f),this.dispose(()=>p.removeChild(f)),f.style.width="100%",f.style.height="100%",f.style.border="none";{const m=()=>f.src=e.imgUrl;m(),e.dispose(e.imgUrlChanged.disposableOn(m))}const g=a.createAnimateFrameWithStartValues(()=>{const m=n.getCameraInfo(),y=m==null?void 0:m.rotation[0];f.style.transform=`rotate(-${y}deg)`});g.start(),this.dispose(()=>g.destroy()),f.style.transformOrigin="50% 50%"}}}get customDiv(){return this._customDiv}};v(yl,"type",yl.register("ESCesiumViewer",a.ESNavigator.type,yl));let Op=yl;const ET="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjJCQzhDNzQyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjJCQzhDNzMyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrRBvqMAAAx2SURBVHja7N1/qF51HQfwM5FhMmSIyLBYsmSImQzZhrPMWU1zqKGiVkuHyZQlS1ZYVg6pIVELppg/1hKVUhgi5RY49A+VzMI7QkRusSLWCJMV4xJjLVk9fb48Z3rddrd7n/vc557v+b5e8OFe73Yv5/k47ud9vuc83zOj0+lUAEBZTtACABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAQAAAAAQAAEAAAAAEAABAAAAA8nGiFgBHsfAoX9uhLSAAAO0e/ldHfXvU1w5EPR71qDAA7TCj0+noAjB6+L8YNesYf+epqI1CAAgAQHuG/zNRc8fxd0eirqxXBgQByJCbAIFDbhjn8E9mR/26Dg0LtQ4EACDfs/9revi+h6OWCwGQHzcBAofM6/H7vhu1p/7c5QCwAgBkZM0kvz+tBJxtJQAEACAvM/vwM34WtVgIgDx4FwCQ/D1qTp9+1qL6o8sBYAUAaLB0xn56H3/e0KifCwgAQEG/C4a0FAQAoEzPWAUAAQAoT9pUaLMQAAIAUJ4FUTcKAdA8NgICptpXo06qP/fOALACABTk1qg7rASAFQCgPF+K2mUlAAQAoDx3R/1HCAABACjP+qjdQgBML/cAANPhiahZlXsCQAAAivNi/VEIAAEAKIwtg0EAAAplt0AQAIACpd0CnxACQAAAynNO1ANCAAgAQHkuiLpXCAABACjPpVFfFwJg6tkICGiaz0e9VX9uoyAQAIApMr+Bx/S1qINCAEwdlwCAeQ09rm/Ux+ZyAAgAwBT4WIOPbUvUHCEABACgv9JgvWaMP9vXkGPc5n8TCABA/411L9CsBh3jNqsAIAAA/XNeJseZLgM8JwSAAABMXhqmqzI63tOEABAAgP64ILPjTSHAcwNAAAAmcfb/mUyP/RwhAAQAoHffz/jYUwj4lhAAAgAwsbP/T7TgdaS3L64RAqA3tgKGMm1syeu4KepP9ee2DAYBADjG2f/DLXtN66N2CwEwMS4BQFnDf0HVziXzdFPg/MrlABi3GZ1ORxegjOGfDLX8dS6yCgBWAID3GyrgNf7WKgAIAMB7Z/+lPFAn3df0GyEABAAw/KtqbdXdS78UMysbBcFxuQcA2j3810VdVejrH45aWbknAAQAKGjwJ7+I+lDhvXil6q6ACAEgAEARw39IK961teruFSAEwCjuAYD2DP5Utxj+R0iXQDw3AKwAgLP+Qq2Ket1KAAgA0JbBvynqfO0Yl5uj3hQCQACAXId+8nTUmVoyYUuiDgoBCAACAOQy8JM7o67XlklbVH8UAiiWpwFC84Z8cm7UJVHLo07Tor4bGhUCwAoAMLAhf0rU3HrIp2HvGv7gjUQtswqAAAD0e9CnIT+nPtO8MGqx9jTOzqgVQgACADDRIX9G/THdWHZW1NLKkn1u/hZ1tRCAAAAcPuQP/fdH6o9p6M/XolZ5Lep2IQABAMoc9Oma/OeiTq3rQu0pyhtVdydFIYAieBcApQ35U+shP6/q3nyX/vtkLSKcF3Vt/bkQgAAAmQ77dD3+tqjTq+6S/WytYRzuivqHEEAJXAKgTUP/nqgLKjfhMXm2DEYAgIYP/fRWuxcqT7ak/+wWiAAADR3+nn6HEAACAAUN/rTUf4V2IASAAEAZwz/drf+yViAEwOS5bkouw3+14c80crkJKwAwDcN/fdRntYJptj/qYqsAWAGAwQz/+w1/GiJdgnqyOvrjm0EAgD6f+duOlyZJz4B4UAhAAICpG/73OPOnodJjndcIAeTOVsA0cfinbXy9zY8muylqb/25ewLIkpsAaWIAcMc1uUg3Be4XAsiRSwA0bfg/pw1k5OVR/3ZBAIAeh/+CyoN8yM+QEIAAAJOzWQsQAkAAoKyz/7XagBAAAgDl+aIWIASAAEBZZ/9rtIEWhgAQAOA4btICWuY5qwAIAADlSe9muV8IQACAsX1TC2ip9ByL1UIATWUrYKZT+sW4VBtosS9HvVV/brdArADAKDb+oe3ujjrDSgACAEB5nq0/CgEIABDO1gIK4u2BCABQu1wLKMwqqwAIAFBVM7WAwtyqBQgAAGXaZhUAAYDSeRsqJZrj3z4CAECZ7BKIAABQoMVagAAAUKZPWQVAAKBUroNSsh9oAQIAACAAAAACAEBbrdACBACA8qSdAd0IiAAAUJiTtQABAAAQACjCQS0AEAAAAAGAAtgICEAAAAAEAABAAAAABACANhjWAgQAgPI8ELVDGxAAAMpi+CMAAAACAEDbjWgBAgClshUwJUuPAnYJAAEAoDB7tAABAKAsP9ECBACA8myuLP8jAFAw9wBQooe0AAGA0r2jBRToMWf/CACU7oAWUJjVWoAAAFX1rBZQkOH6zN/ZPwIAxXtLCyho+K80/BEAAMpi+CMAwGHe1gJabpEWIADA+6Uzoq3aQIvdOOrfOggAMMpmLaCl0h3/fzT8EQBgbJ6KRtv8qHLHPwIAHFP6BblBG2iR7VFbDH8EADi+57WAFg3/dYY/AgCMnx3SaAPDn2ycqAU0gF+Y5G5/1MXagBUA6M1lWkCmLq7c9IcAAD2vAuyNek0ryOzM30Y/ZGlGp9PRBZpkYdSQNpCBg1FLnPVjBQD659NaQAYuMvwRAKB/0i/Uf0V9RytosBvrFQDIlncB0NQQkHwg6m7toGFs8YsAAAMIAenf6F3aQUPcV7nbHwEABhYCKiGABngo6knDn7bwLgBykN4ZcEbUs1rBNPl91G2GPwIATE8ISF6Imq0dDNBw1ErDHwEApj8IXBp1r1YwADujVhj+CADQrNWATVHnawdT5ND+/oY/AgA0NAjcH3WhdtBHdvlDAICMgkAKAZdELY+aqS1MwiLDHwEA8g0E6V6BD0bNizo76kytYRyW1CsAAgACALQoFCRn1aHgw1ELok4XDqila/77DX8EACgvHMytA0EKB1fVYcHlhDLcEfWq4Y8AAIwOB2nXzFOr7oZEH436ZOUdCG2SHj71vOGPAABMZNWgqlcN5lfdRxnPr4s8PBL1qOGPAABMRThI9xxcFnWF9jTKU1EbDX8EAGCQweBQOEg3Ii6LWqpFA7U9ap3hjwAANDEcpGDwlcqNiP22K+o6wx8BAMglHJwS9UzlgUiT8UbULYY/AoAAALkGAg9FmriRqruqYvgjAAgAkH0QWBq1QTvGxRa/UDtRCyBbOw4bbMmWqvuOA44+/AErANDaVYEhbTjCtVG7nf3De07QAmjlme52bXjXasMfrABASSsBSyv3BqyNesXwBysAUIo08F6KurngHvzY8AcrAFDySkC6KXBLYa/7vqgnDX+wAgAlrwT8JerOgl7zVsMfBADgvcsBWwt4rb+LWm/4w/G5BADlaPtbBNPQX234gxUA4Eht3gzH8AcBABjjDDlZJ9gALgFAedp2KWBJ1EFn/2AFADi+a1v0Ogx/6IGHAUF5Dg3L9Gjc2Rm/jhsqW/yCFQBgwiEg570Bflh19zcw/EEAACbo9UyP+6dRTxv+IAAAvXsks+NNmxltMvxBAAB6l4botsyGv13+QAAA+mDPMf5sX4OO8yXDHwQAoL+Gx/j6rAYd452GPwgAQP+kofqrhh+jXf5AAACmwF8zGP7O/kEAAPpsuKHHdaXhDwIAMHX2NfCY0i5/bxv+IAAA5bDLHwyAZwEATfK9qrs3geEPVgCAATjYgGN43PAHAQAYrOleDUy7/D1o+IMAAJTDFr8gAACFGTH8QQAAyrPM8AcBACiLLX5BAAAKY5c/EACABvjfgIe/Xf5gms3odDq6APx3QCcEt0e9ZviDFQCgGQaxEdA6wx8EAKCsAJCG/3bDHwQAoFmmcifAhwx/EACAslYAfh71mOEPzeMmQCD5d9RJff6ZO6NWGP4gAADlBIB3oj5u+ENzuQQAJLv7/PMMfxAAgAzs7OPPssUvCABAJvb06edcVH909g8CAJCBP/ThZ1wedcDwBwEAyMdL9fDu1Rei/mn4gwAA5CUN7ld7/N7rov5s+IMAAORpYw/fsyxql+EPAgCQr/SI3l+O8+++WXXv9h8x/CFPNgICRltYdbfuPXeMP0/3CayPet7gBwEAaF8ImBe1YdTX9kZtqoe+wQ8CAACQI/cAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAE32fwEGAMnMSDh4qI2qAAAAAElFTkSuQmCC",xT="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NkJCOEQ5RUQyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NkJCOEQ5RUMyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmdWjtQAABYrSURBVHja7N0L9HZTnQfwbWrNtNZQRteJpBvpMiLkkstErlGKilJC94uRS7ohFU1rpqRJy9JFpXLJpUgSDbpIEc1MMmqV0lsuMciExDv7t85+12rNwvunZ5/9PPv5fNb6La3V6xzf/37+7/k9Z5+9zzKLFy9OAMB8+Ss/AgDQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADcCs2DrXd3M9WSa5GtiiZHpKZ2O1Za4L5AINwDRaJtc7c52ea/1cF+Z6YQeZ3vH/Mu3Q6Vi9oINMB+Q6488yvaiTsYpcX821nlyQPzyLFy/2U5gey+U65m4u+DFIh+U6MNedMk19rkNLrrtmLNOyuT6da8e7yfTB0uzM4lgtW8bqRXeT659zvUsuNAC0tFquU3Ktfi9/5sxcL8t1w4xkWrVkekpHmRaa62u5Xj5DuZ5UMj31Xv7M2blemuv6GRqryHXqUsbqrFy7yMW8MQUwHbZLw6271Zfy57bK9YNca8xIpu+npc9JzlKm+5Jr6xnKtW3J9NSl/LnNc12Ua80ZGavnLXCstihj9Qy50AAw5s//4FxfzvWQBf47j0/Dw1k7T2mmmJM8qHw76SVTr7ki07tzfSXX8gv8d1bJ9Z1cu075WB1Yfq8WmutxZazkYm6YAmgnLiKfK98o76+P5No315+mJNODS6bt/4JjHJ5rvynKNKlcH861f2djdUT5/N3R2VjJhQaAauLWXcy3rjqBY52X68W5rm2cafWSabWOMk0617kl13WNMz25ZJrEssVvlUxXdzZW55dc18hFr0wBjC+e2L1wQhf/sEmui3Ot2zDTC0um1TrKVCPXprl+2DjXC0qmSe1ZsFEangtYv/FYRa7vTXCsNi6fwWfJhQaAv9QDcr0/14lpWL4zSSuVzn6PRpm+lIZlcT1k6jVX/K4fkuvkNNxOnqQVc/17rtc2+jvsfRVznScXvTIFMI4Vcn0+DU+813ZUrr1y3S6TXMXyJdM2I2T6ZK43jjRWcs1WLjQAc+cfShf/hBHPuWQ3sEUVM8Wc5ONHzBS3QXesmKlVrti+daeKuZ5WMj1xxEzfL2N1VcVzPL38Xo2dK36vfi0XPTAFUN+bR774h5jfi3m+jSsd/y0jXyTDepUztcoVc+cxh75RpeO/ceSLSVi3jNWmFc/RMtcmcqEBYCFenWvvNP7yr0emYee2t1Q49p4dZmqZ61G5zqmU6/XluGMv/Xp4rm+Un2cNr2uU6xHlM7iXXMw6UwDjiW+ux5e/7McW64fjgZ9bJ3zcTUqmR3aUqddcG+Q6IQ0PgI3ti6W5+kOFY29Ycj1arpnIhQZgbsVfvrEKoMWSqUvTsKztFx1luqRkurKzsaqV61Glsdm4QaYflUw/r3BsuWYrF1PCFMC44kGvTXMd2eDcsR947Au+RUeZYk/6iypkmpZcm0/4uLFZz2Zp2JVwbGuUz9/WFY69JNfhDXNtJRcaAJbmj2l40OeVqc7t63vz0DS85z3eH75MhUy75bqtk0zTkOvMCrni+Ya3puGtfreMnCmWWJ6ehtcKT3qsIlc8b7Bzw1zvkItZYgqgrfimd1IaXtgxtpPKhe0WmeY2V7z9L5acrdog06mlCb65wrFb5jqljJVcaABY0De9Y1ObW22X5doh1xUVMsVGJlt2lKnXXLHL3DHl2GO7vJz38grHjlyfzfV8uWYiFw2YAmjv+jS8jz22/Ry7G4uXEsU83/aVMr2/UabY2GS7imPVU674RhebwMRt3jtHzhTvI4hNq15Q4dg3l4vVO+WaiVy4AzD3ti/d/UNGPu/i0oAcnOsumaY+1yGlJp0rHjr8QhrW8I+d6bA0vOu+xkUtcsXStoc1yHVoyXWXXGgAWJonpWGe72kNzh0P070s140TPm7MWZ7UWaZec62chpcgrdMg05kl0w0Vjr1yGau1G+T6Wsn1P3IxTUwBTJ+fpmHb2y80OHe8fCSmBJ4+4ePGvPX65dtKL5l6zfWrNGxL/IkGmbYqmdaocOyWuWLp40VyoQFgIf63dNaxLefYW4LGPuTfTcMysUmKJ9h3aZzpJRWO3WOueDNcbGEdu8GNvfzx8SXTzhWOfZtcM5WLykwBTL/YEjR2A2uxheu/pmEd+qT3xn92yTT2NqeLS6a3pzr7/bfOFWM16Tn0Z6bhFvNjG3z+YgOc/SqN1dol18oNcsVGTPvLhQaAhYgtQY9Lbd7W9c1yN+C6CplabXNaK1PrXOeUb2KTzhXLH2Oa47kNMp2X68W5rq1w7Ja5zi25rpOLVkwBzIbYEnTz8i1v7I7tOWmY53tmhUyxzemHOsrUOtdmlXLF8seY722x/DGa3nhV7boVjr0k16ENcm1acq0jF+4AsFA75fpUrmVHPm/MLcarZY+Raa5ztVr+GM8lxLbMn6x0/OeXXA+WayZyoQGYW7Ehxynln2P7eK5/SsM++ZO0ehqWP7bIdGTJVOMhvh5ztVyqelQaHri8vcKx5ZqtXGgA5tay5dvlTg3O/d1y3t9M+LjLlUw7Nsj0nTTMXf6mwrFb54qx+u2Ej/u3uY5ObZ7+/l75WS6q9HsVuV7aINcFZazkYhSeAZhdsfwsln/tk8Z/6naDNMw1bzjh4/6+XIT3bZBpw0qZpiHXxRVyxVLVXVK9Oyf3Zr2SaeNKv1fR1OzdINf65TP4bLlwB4CFigelYpXAo0Y+7x3lAnBkhWNvmoYnmXvK1Guu2IgmVj78fYNM0VQdUen4Pec6odFnsGYuNABz69HlL6sWXfYxaXjobNKbkKxYGpueMvWaq+Xyx8/lem2uWysc+1HlYrmRXDORi/vAFEA/Yu46lrcd3uDcu6VhrnnSm8UsKpk+0ijTt1OdDVV6zNVy+eOu5fP3uArHvrqMVctcq8iFOwAsVMw3x/KbsZef/S4NDxmdU+HY8bzDJxpkig1Ndq6UqXWuGKtvVjh2PKAXDz0uN3KmWP8ezyWcVen4O5Xfqxa5YqzOlgt3AFiauLUXG6dcPvJ547WkX0/DPN8yEz523F5+VoNMD6+YqXWusyrl+lL5/F02cqbYAS/eknhApbE6seT6SYNc8abE/eXCHQAWquVSwbiwxctJbpnwcVsuqauVqddcy5a7Gy9pkCn2w9+t0ljJNVu5cAdgLi1ZKvjWNP7yszhvrP990oSPu2RJ3T6NMsUeCE+scOwec8XnL27xtlgq+KJcF+ZatdLvVeTaW66ZyIU7AHOv1dKfG9Pw0M/pnWWK1zWf0eFY1coVKx5i5cPYb7W8Kdcrcn2l0vFb5orfq9Mq5mrxZsvauXAHYC59K9ea5Z9jWj7Xl3MdlCY/zxdZ1mqU6bRKmXrNFSsP4lW1542cKd5ZcGquQyr9fdcyV/xeHVwx1zM7zIU7AHPtgbk+mIbbsmM/eHNa6e5vqpRp7wY/z1qZes0VmQ5Lw1TH2J+/M8odjhsrjVWrXF/N9fKKuT6QhmnEnnKhAZhrn0/DkqmxxbexHWSa+1yfScOt+bHFVNR2FY/fKlc0bNvLxX3hFsv8eVAa1vy2uKCcVL5V1sj0qUaZvlQpU6+5ItPRjS4mp5Y7AKmzXCdXzvWJDnOhAZg7sVNa7MC1+8jnvTPX29OwHPGWCpniCfZXNcj0tjQ8uX9LpbHqLVfsFBnPNew5cqa7cr0r1wtz3Vzh+K1yxVi9Mw1LR39f4firpOFZgD06y0XxQD+CubFNGvbgXmHk89bcnW3bXJ9tlKnmDmY95toq17Fp2PxlTDeUb5FnVjq+XLOVC3cA5m6MD07DXNrYF5RLc61T4eIfmd6ThqVdY2e6JA1PfZ9daax6yxWZDkzDA11jX0x+VD5/Z1Yaq15zHdRhLtwBmDsPLd/6t25w7vj2EG/8+kOFTMeWbyhjq/kWsx5zrVDuZGzbIFO8cnnPCp+/3nPFZ2GbznLhDsDciTW8FzW4+McOYnul4QGySf8yr10ybdUo0ysqXfx7zLVmyTT2RTJ2UYwla7tUupj0mmutkmubznLhDsDciYd2/i0NT/CO6Zo0PDx2foVjx7eDj3aWqddc8eDikQ0yXVcynVvp+L3mioeCP9ZhLjQAc+VB5Rd59wbnjn28Yz/vRTLN9VgdkevVDTL9oGS6qtJY9Zrro2n81Qu1c7FApgD60WqJX4j1z5tUuKAsWQrXU6Zecy1ZCtfiIhl7JWxc6WLSMlfs17FRpVyrpDZLF2vnQgMwd7YuHfVaI5/39lyvKXX7hI8dc5ExJ7lmR5l6zbVlrovT8CzDmP6Y6w1pmPK6rcLxW+WK8XlduTjX+AxuVT6DveVCAzB34xdLdmJ707GX7Cwq3ySPrpSpxbLFWpla5/p1pVyxN3xssHNGg8/fb3L9Y66PVzh2y1yLSq6jKuV6d2qzxK9mLu4nzwDMrr9Lw5KdFkuR4sGxeHjnmgqZjk1tliHVypRS2+VV55Vc1074uMuXTM9rkCmmumJXyd9WOHbLXN8uua6ulOvYRn9f1MyFOwBz5xlpuDXZ4pc5HobavMKFckmmFhfJj+TarNLFP3Jd1DDX5hUu/mukYcqpxUXyY+WbZI2L/xplrFrkilU7z6l0kVzyGdy2s1xoAObOK9PwANnjRj5vrBOP9eKxbvyOCpkuaJAp1h3H60bj1ch/qjRWveXatXz+njhyptvKz/NNFT5/f57rCY1yvbliru90mIsJMAUwO/4m14dzvb7Bua9Mw4tULqmQ6fA0PBg0tl+UTJdWGqvecv11rg/lemODTL8smX5Y4dg954q/L97QWS40AHNnpTS8nvVZDc4d+/jHLl3XT/i4j8l1YmeZluSKsVq3o1wrlrFav0Gmc9LwgqLfVTj2imWs1pNrJnIxYaYApt9zSic99oVyca4PpGHu+voKmS7uLFPYrORat6Ncm5bP3/oNMv1LGpbi1biY/GPJtZ5cM5ELDcBciSU7byvf6h4+8rnjPfDx1O7b0/BubpmWnuuAXF/vbKz2zfWNXI9okGnnXPtVGqt9y2dQrunPRUWmAKbTg3Mdk2uHBue+opz3MpnmNtdyadhdb8cGmX6Whvnj/6xw7Mj16TRsQTu2n5Zc/1XpM/ipDnOhAZg7T8l1cq7VGpw7NqmJp4ZvkmlBnlpyrdpRrifnOqX8c2yx8c7Lct1Y4dirl7Fqkev0MlZyMVVMAUyX2LDlwgYXyrtyHZzr+RUuKD1mCi/J9b0GF//IdVClXPEN8vsNLiYxf/zeXNtVupi0zPWeMlZy4Q4A9zgOh+XaJw1zeWO6sXTxp8u04FzxwN1bG+V6WfmmPEkPyPX+XPs3yHRzGauvVDh25Do0DXPTY+e6qeQ6TS40ANyTeGjs+DQ8vTu2H6dhDvmnMi041wlpeDJ+bDEnHnOtP5vwcR+W67g0rGAY22Ul039XGqsvNswVn8Er5GKamQJoK5aLXdzoQhnrutercKFsmen4SplCLFn8YaOLf+TaoMLFf+0yVi0uJieVn2mNi3/kuqhxrivkQgPAPYn3i8cLaB4z8nljmU4sxYs57Fs6yhS3Q3eukCnEK3TjpTordZRr9zS8D37lBpliyeJOlcZqD7lmKhcNmQIY34PS8IKMPRqcOzboiF26zpFpbnPFNsVHlKZmbLFJUexUeFaFY8s1W7nQAMyd6N5ji851Gpw7bl/HfOsvZVpwrrjtuXZHuVpuKX1pyfSLCsdeqYzVunLNRC6mhCmA8cS83UWNLpSfzbVhhQtKj5n+PNfaHeXaNLXZUjp8vmSqcTFZsvXtunLNRC40AHMllunEPG6LbWLjNZzxOs54LedtMi0o1/4d5oqlmN9okCleRRyvJI5XE/+hwlhFrrMajdVecjHzF6fFixf7KdR1ZGrzCt+r0/DgzrdlmutcR5TGYmzXpmETqPMqHf+jud7UINc1Jdf5cqEBYGniifjYqnPM28kXlAvKIpnuc65Tc63VUa4Vy1iNeSs5dqeLXep+XfEcLebHLyy5FslFD0wB1HdVro1yfW6k8x2VhvnDRTLdr1wx93nsSLk+noa5+Zq54tibpOElOGP4ZK6NK1/8Uzl+5PrMSLmOLudbJBcaAO6LmNN9Ra690zAvWsPtufbM9bryv2W6/7l2rZwrzhFLC9+Q648jZYp1/29JwzxvrbF6bRmvMcdqt5Kr5mfwNaXkoiumAMYX32RjO9mHTfhbw5IXg8g0Oc9Jwy58k8x1Vcn1g0aZ4tte7AI5yQfMFpVMFzYcK7lmKxcagLn12DS8cnXNCRwrHrKKh3eu7SjTuSXTdVMwVqukYQ69p1yTfNbh/JLpmikYq5XLZ1Cu2chFY6YA2og13s9Ow0s9/hIfzrX5FFz8J53puVNy8Q9XllzHdZRrUs86HFE+f9NyMflVGSu5ZiMXGoC5FetsY5vNWE9/5/38d+OVtH+SaZRcsR///h3lWvKsw/3577o1Dc9/xJrxO6ZsrG4tufaRayZy0ZApgOnw3PLN+aEL+LM/T8MWnT+SqVmuuBuwQke5NiuZFvKsw5Ul0yUzMFaR6/gFfgblwh0Amohd2mLd738s5c+dmYZtd38kU9Nc63SW65zy33rpUv7c2WnY+2FWLibnlP/epY3BWXKhAaCl+LYY73w/4W7+v7hNc2iu5+W6QaapyBVz6Cd2lOvKkum4e8j0wVxbpeENcWnGcm1wL7k+kGsbuZhHpgCmcExyvS3X+3I9INfv07Am+GSZpjLXAbneW3LdnOtVHeSKZzgOK5niHfC730OzM2tjtV9pzpbkis/gSXKhAWDabJ3rwPKX709kmolccfG/vJNMW+Q6JA0bFv24o7HaMtfBJddlcqEBAADmimcAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAHDv/k+AAQD4HcieQJZ+TQAAAABJRU5ErkJggg==",wl=class wl extends Os{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.ad(a.createEventsCallFunc([i.strokeColorChanged,i.strokeWidthChanged,i.materialModeChanged,i.speedChanged,i.strokeMaterialChanged],()=>{this.geoPolyline.customArrow=i.materialMode!=="pureColor",this.geoPolyline.customArrowParams={color:i.strokeColor,arrowColor:i.strokeMaterialParams.arrowColor,repeat:i.strokeWidth*6,speed:i.speed,image:i.materialMode=="singleArrow"?ET:xT,lineLength:a.getDistancesFromPositions(i.points??[],"GEODESIC").pop()??0}},{immediate:!0}))}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(wl,"type",wl.register("ESCesiumViewer",a.ESPath.type,wl));let Np=wl;const un=class un extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_czmCustomPrimitive");v(this,"_geoBoundingSphere");this._czmCustomPrimitive=this.disposeVar(new De(e,n)),this._geoBoundingSphere=this.disposeVar(Pm([this,"positions"]));const{czmCustomPrimitive:o}=this;this.dispose(a.track([o,"show"],[this,"show"])),this.dispose(a.track([o,"allowPicking"],[this,"allowPicking"]));const s=this.disposeVar(a.react(0));{const r=()=>{if(!this.positions||this.positions.length<3){o.show=!1;return}o.show=!0;const[c,u,d]=It({originPosition:this.positions[0]},this.positions);o.modelMatrix=u,o.cull=!1,c.push(c[0]);const p=c.length,f=[...c,...c.map(C=>[C[0],C[1],C[2]+(this.height??un.defaults.height)])],g=c.reduce((C,S,x,A)=>{if(x===0)return C.push(0),C;const R=x-1,O=A[R],N=Math.sqrt((O[0]-S[0])*(O[0]-S[0])+(O[1]-S[1])*(O[1]-S[1]));return C.push(C[R]+N),C},[]);s.value=g[p-1];const m=g.map(C=>C/s.value),y=[...m.map(C=>[C,0]),...m.map(C=>[C,1])];o.attributes={a_position:{typedArray:new Float32Array(f.flat(1)),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(y.flat(1)),componentsPerAttribute:2}};const _=o.computeLocalAxisedBoundingBoxFromAttribute("a_position");if(!_){console.warn("包围盒计算存在问题!");return}o.setLocalAxisedBoundingBox(_.min,_.max);const P=[...new Array(p-1).keys()].map(C=>[[C,C+1,C+p+1],[C,C+p+1,C+p],[C+p+1,C+1,C],[C+p,C+p+1,C]]).flat(2);o.indexTypedArray=new Uint16Array(P),o.vertexShaderSource=` in vec3 a_position;
1726
+ `;function PT(t){return new DOMParser().parseFromString(t,"application/xml")}const gr=class gr extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_loadFuncReact",this.disposeVar(a.react(void 0)));v(this,"_clock");v(this,"_resetClockEvent",this.disposeVar(new a.Event));v(this,"_dataSource",this.dv(a.react(void 0)));this._clock=this.disposeVar(new ae(e)),this.dispose(a.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(a.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(a.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(a.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(a.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(a.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(a.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(a.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let s;s=document.createElement("div"),o.container.appendChild(s),s.style.pointerEvents="none",s.style.position="absolute",s.style.top="0",s.style.left="0",s.style.width="100%",s.style.height="100%",this.d(()=>{o.container.removeChild(s)}),this.d(this.flyToEvent.don(d=>{e.actived&&this.dataSource&&(d!==void 0?o.flyTo(this.dataSource,{duration:d/1e3}):o.flyTo(this.dataSource))}));const r=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource),this._dataSource.value=void 0)};this.d(()=>r());const l=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:d}=this;d.clock&&(this.startTime=h.JulianDate.toDate(d.clock.startTime).getTime(),this.stopTime=h.JulianDate.toDate(d.clock.stopTime).getTime(),this.currentTime=h.JulianDate.toDate(d.clock.currentTime).getTime(),this.multiplier=d.clock.multiplier,this.clockStep=ae.getClockStep(d.clock.clockStep),this.clockRange=ae.getClockRange(d.clock.clockRange))};this.d(this.resetClockEvent.don(l));const c=()=>{this.dataSource&&(this.dataSource.show=this.show??gr.defaults.show,s.style.display=this.show??gr.defaults.show?"block":"none")};c(),this.d(this.showChanged.don(c));const u=this.dv(a.react(void 0));{const d=()=>{var g;if(this.uri)if(this.uri&&typeof this.uri!="string")(g=h.Resource.fetchXML({url:this.uri.url,headers:this.uri.headers,queryParameters:this.uri.queryParameters,templateValues:this.uri.templateValues,proxy:this.uri.proxy,retryCallback:this.uri.retryCallback,retryAttempts:this.uri.retryAttempts,request:this.uri.request}))==null||g.then(m=>m);else return a.ESSceneObject.context.getStrFromEnv(this.uri)},p=()=>{u.value=(this.data&&PT(this.data))??d()};p();const f=this.dv(a.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.d(f.don(p))}{const d=this.dv(a.createProcessingFromAsyncFunc(async g=>{if(r(),!u.value)return;let m;try{m=await h.KmlDataSource.load(u.value,{camera:o.scene.camera,canvas:o.scene.canvas,screenOverlayContainer:s,clampToGround:this.clampToGround})}catch(y){m=void 0,console.error(`kml加载报错:${y}`),console.error(y)}if(m&&(m.entities.values.forEach(y=>{h.Entity.prototype&&(m.ESSceneObjectID=n)}),g.check(),o.dataSources.add(m),this._dataSource.value=m,c(),(this.autoResetClock??gr.defaults.autoResetClock)&&l(),!!this.loadFun))try{this.loadFun(m,o)}catch(y){console.error(y)}})),p=()=>{d.isRunning&&d.cancel(),d.restart()};p();const f=this.dv(a.createNextAnimateFrameEvent(u.changed,this.loadFunChanged,this.clampToGroundChanged));this.d(f.don(p))}{const d=()=>{if(this.loadFuncStr)try{const p=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=p}catch(p){console.error(p),this.loadFun=void 0}else this.loadFun=void 0};d(),this.d(this.loadFuncStrChanged.don(d))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get loadFun(){return this._loadFuncReact.value}set loadFun(e){this._loadFuncReact.value=e}get loadFunChanged(){return this._loadFuncReact.changed}get clock(){return this._clock}get resetClockEvent(){return this._resetClockEvent}resetClock(){this._resetClockEvent.emit()}get dataSource(){return this._dataSource.value}};v(gr,"defaults",{show:!0,allowPicking:!0,defaultLoadFuncStr:$y,defaultLoadFuncDocStr:_T,data:wT,dataMd:CT,autoResetClock:!0,clockEnabled:!1,startTime:ae.defaults.startTime,stopTime:ae.defaults.stopTime,currentTime:ae.defaults.currentTime,multiplier:ae.defaults.multiplier,clockStep:ae.defaults.clockStep,clockRange:ae.defaults.clockRange,shouldAnimate:ae.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",clampToGround:!1});let Io=gr;(t=>{t.createDefaultProps=()=>({show:!0,uri:void 0,data:void 0,allowPicking:void 0,loadFuncStr:void 0,autoResetClock:void 0,clockEnabled:void 0,startTime:void 0,stopTime:void 0,currentTime:void 0,multiplier:void 0,clockStep:void 0,clockRange:void 0,shouldAnimate:void 0,clampToGround:void 0})})(Io||(Io={})),a.extendClassProps(Io.prototype,Io.createDefaultProps);const ul=class ul extends a.EngineObject{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Io(e,i.id));this.dispose(a.track([o,"show"],[i,"show"])),this.dispose(a.track([o,"allowPicking"],[i,"allowPicking"])),this.dispose(a.bind([o,"data"],[i,"data"])),this.dispose(a.bind([o,"uri"],[i,"uri"])),this.dispose(a.bind([o,"loadFuncStr"],[i,"loadFuncStr"])),this.dispose(a.bind([o,"autoResetClock"],[i,"autoResetClock"])),this.dispose(a.bind([o,"clockEnabled"],[i,"clockEnabled"])),this.dispose(a.bind([o,"startTime"],[i,"startTime"])),this.dispose(a.bind([o,"stopTime"],[i,"stopTime"])),this.dispose(a.bind([o,"currentTime"],[i,"currentTime"])),this.dispose(a.bind([o,"multiplier"],[i,"multiplier"])),this.dispose(a.bind([o,"clockStep"],[i,"clockStep"])),this.dispose(a.bind([o,"clockRange"],[i,"clockRange"])),this.dispose(a.bind([o,"shouldAnimate"],[i,"shouldAnimate"])),this.dispose(a.bind([o,"clampToGround"],[i,"clampToGround"])),this.dispose(i.flyToEvent.disposableOn(s=>{e.actived&&o.flyTo(s&&s*1e3)}))}};v(ul,"type",ul.register("ESCesiumViewer",mh.type,ul));let Mp=ul;const dl=class dl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoCircle");v(this,"_geoPolyline");if(this._czmGeoCircle=this.disposeVar(new fo(n,e.id)),this._geoPolyline=this.dv(new be(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoCircle,r=this._geoPolyline;{const l=()=>{r.positions=bT(e.position,e.rotation,e.radius)};l();const c=this.dv(a.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.radiusChanged));this.dispose(c.don(l))}{const l=()=>{s.show=e.show&&e.filled,r.show=e.show&&e.stroked};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.strokedChanged,e.strokeGroundChanged));this.dispose(c.don(l))}r.loop=!0,this.d(a.track([r,"ground"],[e,"strokeGround"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.bind([r,"width"],[e,"strokeWidth"]));{s.outline=!1,this.dispose(a.track([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.bind([s,"radius"],[e,"radius"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"ground"],[e,"fillGround"]));{const l=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:a.ESLocalCircle.defaults.fillStyle.color}};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(c.disposableOn(l))}}}get czmGeoCircle(){return this._czmGeoCircle}get geoPolyline(){return this._geoPolyline}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this._czmGeoCircle.show=e.show&&e.filled&&r,this._geoPolyline.show=e.show&&e.stroked&&r}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoCircle:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.position?(ei(s,o,n,o.position,o.radius,e,!0),!0):!1:!1}};v(dl,"type",dl.register("ESCesiumViewer",a.ESLocalCircle.type,dl));let Ip=dl;function bT(t,i,e){const o=2*Math.PI/36,s=[];h.Cartesian3.fromDegrees(...t);let r=function(c){let u=new h.Cartesian3(c.x,c.y,c.z),d=h.Cartographic.fromCartesian(u),p=h.Math.toDegrees(d.latitude),f=h.Math.toDegrees(d.longitude),g=d.height;return[f,p,g]};const l=Ie({initialRotation:"yForwardzUp",rotation:[i[0],i[2],-i[1]],position:t});if(!l)return s;for(let c=0;c<36;c++){let u=new h.Cartesian3(e*Math.cos(o*c),e*Math.sin(o*c),0),d=h.Matrix4.multiplyByPoint(l,u,new h.Cartesian3);s.push(r(d))}return s}const pl=class pl extends fe{constructor(e,n){super(e,n);v(this,"_czmESLocalLineStringZ");if(this._czmESLocalLineStringZ=this.disposeVar(new Xr(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESLocalLineStringZ;n.add(s),this.dispose(()=>n.delete(s));{this.dispose(a.track([s,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"strokeColor"],[e,"strokeColor"]));const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"hasDash"],[e,"hasDash"])),this.dispose(a.track([s,"gapColor"],[e,"gapColor"])),this.dispose(a.track([s,"dashLength"],[e,"dashLength"])),this.dispose(a.track([s,"dashPattern"],[e,"dashPattern"])),this.dispose(a.track([s,"hasArrow"],[e,"hasArrow"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(!e.points){s.points=void 0;return}s.points=e.points.map(l=>[l[0],l[1],0])};r(),this.dispose(e.pointsChanged.disposableOn(r))}}get czmESLocalLineStringZ(){return this._czmESLocalLineStringZ}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this._czmESLocalLineStringZ.show=e.show&&e.stroked&&r}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESLocalLineStringZ:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.points&&r.flyTo(e),!0):!1}};v(pl,"type",pl.register("ESCesiumViewer",vh.type,pl));let Dp=pl;const fl=class fl extends fe{constructor(e,n){super(e,n);v(this,"_czmGeoPolyline");if(this._czmGeoPolyline=this.disposeVar(new be(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPolyline;s.arcType="NONE";{this.dispose(a.track([s,"width"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"strokeColor"]));const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.track([s,"loop"],[e,"loop"])),this.dispose(a.track([s,"hasDash"],[e,"hasDash"])),this.dispose(a.track([s,"gapColor"],[e,"gapColor"])),this.dispose(a.track([s,"dashLength"],[e,"dashLength"])),this.dispose(a.track([s,"dashPattern"],[e,"dashPattern"])),this.dispose(a.track([s,"hasArrow"],[e,"hasArrow"])),this.dispose(a.track([s,"depthTest"],[e,"depthTest"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"strokeGround"]));{const r=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[c]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale},e.points);s.positions=c};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(l.disposableOn(r))}}get czmGeoPolyline(){return this._czmGeoPolyline}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this._czmGeoPolyline.show=e.show&&e.stroked&&r}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPolyline: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(fl,"type",fl.register("ESCesiumViewer",Xr.type,fl));let Rp=fl;const gl=class gl extends dh{constructor(e,n){super(e,n);v(this,"_czmESLocalPolygon");if(this._czmESLocalPolygon=this.disposeVar(new a.ESLocalPolygonZ(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESLocalPolygon;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"stroked"],[e,"stroked"])),this.dispose(a.track([s,"strokeColor"],[e,"strokeColor"])),this.dispose(a.track([s,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fillColor"],[e,"fillColor"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"fillGround"],[e,"fillGround"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"]));{const r=()=>{if(!e.points){s.points=void 0;return}s.points=e.points.map(l=>[l[0],l[1],0])};r(),this.dispose(e.pointsChanged.disposableOn(r))}}get czmESLocalPolygon(){return this._czmESLocalPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESLocalPolygon: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(gl,"type",gl.register("ESCesiumViewer",a.ESLocalPolygon.type,gl));let Fp=gl;const ml=class ml extends dh{constructor(e,n){super(e,n);v(this,"_czmGeoPolygon");if(this._czmGeoPolygon=this.disposeVar(new Mi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmGeoPolygon;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"])),this.dispose(a.track([s,"outlineWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"color"],[e,"fillColor"])),this.dispose(a.track([s,"fill"],[e,"filled"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"]));{const r=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[c]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},e.points);s.positions=c};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(l.disposableOn(r))}}get czmGeoPolygon(){return this._czmGeoPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmGeoPolygon: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(ml,"type",ml.register("ESCesiumViewer",a.ESLocalPolygonZ.type,ml));let zp=ml;const vl=class vl extends fe{constructor(e,n){super(e,n);v(this,"_czmLocalRectangle");if(this._czmLocalRectangle=this.disposeVar(new a.ESLocalPolygon(e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmLocalRectangle;n.add(s),this.dispose(()=>n.delete(s)),this.dispose(a.track([s,"stroked"],[e,"stroked"])),this.dispose(a.track([s,"strokeColor"],[e,"strokeColor"])),this.dispose(a.track([s,"strokeWidth"],[e,"strokeWidth"])),this.dispose(a.track([s,"fillColor"],[e,"fillColor"])),this.dispose(a.track([s,"filled"],[e,"filled"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"fillGround"],[e,"fillGround"])),this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"position"],[e,"position"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.bind([s,"scale"],[e,"scale"]));{const r=()=>{const l=e.width??0,c=e.height??0;s.points=[[-l,-c],[-l,c],[l,c],[l,-c]]};this.dispose(e.widthChanged.disposableOn(r)),this.dispose(e.heightChanged.disposableOn(r)),r()}}get czmLocalRectangle(){return this._czmLocalRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmLocalRectangle: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(vl,"type",vl.register("ESCesiumViewer",a.ESLocalRectangle.type,vl));let Lp=vl;const yl=class yl 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){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const m=()=>{const y=n.getCameraInfo(),_=y==null?void 0:y.position,C=[...y==null?void 0:y.rotation];C[0]=360,ne(n.viewer,_,void 0,C)};d.addEventListener("click",m),d.style.cursor="pointer",this.dispose(()=>d.removeEventListener("click",m))}{const m=()=>{d.style.display=e.show??a.ESNavigator.defaults.show?"block":"none"};m(),e.dispose(e.showChanged.disposableOn(m))}{const m=()=>{d.style.width=`${e.cssSize?e.cssSize:a.ESNavigator.defaults.cssSize}px`,d.style.height=`${e.cssSize?e.cssSize:a.ESNavigator.defaults.cssSize}px`};m(),e.dispose(e.cssSizeChanged.disposableOn(m))}d.style.position="fixed";{const m=()=>{d.style.top=`${e.cssPosition?e.cssPosition[0]:a.ESNavigator.defaults.cssPosition[0]}px`,d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESNavigator.defaults.cssPosition[1]}px`};m(),e.dispose(e.cssPositionChanged.disposableOn(m))}d.style.transition=" right 0.4s linear",d.style.transition=" right 0.4s linear",d.style.cursor="pointer";const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),p.style.width="100%",p.style.height="100%",p.style.position="relative";const f=document.createElement("img");p.appendChild(f),this.dispose(()=>p.removeChild(f)),f.style.width="100%",f.style.height="100%",f.style.border="none";{const m=()=>f.src=e.imgUrl;m(),e.dispose(e.imgUrlChanged.disposableOn(m))}const g=a.createAnimateFrameWithStartValues(()=>{const m=n.getCameraInfo(),y=m==null?void 0:m.rotation[0];f.style.transform=`rotate(-${y}deg)`});g.start(),this.dispose(()=>g.destroy()),f.style.transformOrigin="50% 50%"}}}get customDiv(){return this._customDiv}};v(yl,"type",yl.register("ESCesiumViewer",a.ESNavigator.type,yl));let Op=yl;const ST="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6RjJCQzhDNzQyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6RjJCQzhDNzMyRkFGMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PrRBvqMAAAx2SURBVHja7N1/qF51HQfwM5FhMmSIyLBYsmSImQzZhrPMWU1zqKGiVkuHyZQlS1ZYVg6pIVELppg/1hKVUhgi5RY49A+VzMI7QkRusSLWCJMV4xJjLVk9fb48Z3rddrd7n/vc557v+b5e8OFe73Yv5/k47ud9vuc83zOj0+lUAEBZTtACABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAAAEAABAAAAABAAAQAAAAAQAAEAAAQAAAAAQAAEAAAAAEAABAAAAA8nGiFgBHsfAoX9uhLSAAAO0e/ldHfXvU1w5EPR71qDAA7TCj0+noAjB6+L8YNesYf+epqI1CAAgAQHuG/zNRc8fxd0eirqxXBgQByJCbAIFDbhjn8E9mR/26Dg0LtQ4EACDfs/9revi+h6OWCwGQHzcBAofM6/H7vhu1p/7c5QCwAgBkZM0kvz+tBJxtJQAEACAvM/vwM34WtVgIgDx4FwCQ/D1qTp9+1qL6o8sBYAUAaLB0xn56H3/e0KifCwgAQEG/C4a0FAQAoEzPWAUAAQAoT9pUaLMQAAIAUJ4FUTcKAdA8NgICptpXo06qP/fOALACABTk1qg7rASAFQCgPF+K2mUlAAQAoDx3R/1HCAABACjP+qjdQgBML/cAANPhiahZlXsCQAAAivNi/VEIAAEAKIwtg0EAAAplt0AQAIACpd0CnxACQAAAynNO1ANCAAgAQHkuiLpXCAABACjPpVFfFwJg6tkICGiaz0e9VX9uoyAQAIApMr+Bx/S1qINCAEwdlwCAeQ09rm/Ux+ZyAAgAwBT4WIOPbUvUHCEABACgv9JgvWaMP9vXkGPc5n8TCABA/411L9CsBh3jNqsAIAAA/XNeJseZLgM8JwSAAABMXhqmqzI63tOEABAAgP64ILPjTSHAcwNAAAAmcfb/mUyP/RwhAAQAoHffz/jYUwj4lhAAAgAwsbP/T7TgdaS3L64RAqA3tgKGMm1syeu4KepP9ee2DAYBADjG2f/DLXtN66N2CwEwMS4BQFnDf0HVziXzdFPg/MrlABi3GZ1ORxegjOGfDLX8dS6yCgBWAID3GyrgNf7WKgAIAMB7Z/+lPFAn3df0GyEABAAw/KtqbdXdS78UMysbBcFxuQcA2j3810VdVejrH45aWbknAAQAKGjwJ7+I+lDhvXil6q6ACAEgAEARw39IK961teruFSAEwCjuAYD2DP5Utxj+R0iXQDw3AKwAgLP+Qq2Ket1KAAgA0JbBvynqfO0Yl5uj3hQCQACAXId+8nTUmVoyYUuiDgoBCAACAOQy8JM7o67XlklbVH8UAiiWpwFC84Z8cm7UJVHLo07Tor4bGhUCwAoAMLAhf0rU3HrIp2HvGv7gjUQtswqAAAD0e9CnIT+nPtO8MGqx9jTOzqgVQgACADDRIX9G/THdWHZW1NLKkn1u/hZ1tRCAAAAcPuQP/fdH6o9p6M/XolZ5Lep2IQABAMoc9Oma/OeiTq3rQu0pyhtVdydFIYAieBcApQ35U+shP6/q3nyX/vtkLSKcF3Vt/bkQgAAAmQ77dD3+tqjTq+6S/WytYRzuivqHEEAJXAKgTUP/nqgLKjfhMXm2DEYAgIYP/fRWuxcqT7ak/+wWiAAADR3+nn6HEAACAAUN/rTUf4V2IASAAEAZwz/drf+yViAEwOS5bkouw3+14c80crkJKwAwDcN/fdRntYJptj/qYqsAWAGAwQz/+w1/GiJdgnqyOvrjm0EAgD6f+duOlyZJz4B4UAhAAICpG/73OPOnodJjndcIAeTOVsA0cfinbXy9zY8muylqb/25ewLIkpsAaWIAcMc1uUg3Be4XAsiRSwA0bfg/pw1k5OVR/3ZBAIAeh/+CyoN8yM+QEIAAAJOzWQsQAkAAoKyz/7XagBAAAgDl+aIWIASAAEBZZ/9rtIEWhgAQAOA4btICWuY5qwAIAADlSe9muV8IQACAsX1TC2ip9ByL1UIATWUrYKZT+sW4VBtosS9HvVV/brdArADAKDb+oe3ujjrDSgACAEB5nq0/CgEIABDO1gIK4u2BCABQu1wLKMwqqwAIAFBVM7WAwtyqBQgAAGXaZhUAAYDSeRsqJZrj3z4CAECZ7BKIAABQoMVagAAAUKZPWQVAAKBUroNSsh9oAQIAACAAAAACAEBbrdACBACA8qSdAd0IiAAAUJiTtQABAAAQACjCQS0AEAAAAAGAAtgICEAAAAAEAABAAAAABACANhjWAgQAgPI8ELVDGxAAAMpi+CMAAAACAEDbjWgBAgClshUwJUuPAnYJAAEAoDB7tAABAKAsP9ECBACA8myuLP8jAFAw9wBQooe0AAGA0r2jBRToMWf/CACU7oAWUJjVWoAAAFX1rBZQkOH6zN/ZPwIAxXtLCyho+K80/BEAAMpi+CMAwGHe1gJabpEWIADA+6Uzoq3aQIvdOOrfOggAMMpmLaCl0h3/fzT8EQBgbJ6KRtv8qHLHPwIAHFP6BblBG2iR7VFbDH8EADi+57WAFg3/dYY/AgCMnx3SaAPDn2ycqAU0gF+Y5G5/1MXagBUA6M1lWkCmLq7c9IcAAD2vAuyNek0ryOzM30Y/ZGlGp9PRBZpkYdSQNpCBg1FLnPVjBQD659NaQAYuMvwRAKB/0i/Uf0V9RytosBvrFQDIlncB0NQQkHwg6m7toGFs8YsAAAMIAenf6F3aQUPcV7nbHwEABhYCKiGABngo6knDn7bwLgBykN4ZcEbUs1rBNPl91G2GPwIATE8ISF6Imq0dDNBw1ErDHwEApj8IXBp1r1YwADujVhj+CADQrNWATVHnawdT5ND+/oY/AgA0NAjcH3WhdtBHdvlDAICMgkAKAZdELY+aqS1MwiLDHwEA8g0E6V6BD0bNizo76kytYRyW1CsAAgACALQoFCRn1aHgw1ELok4XDqila/77DX8EACgvHMytA0EKB1fVYcHlhDLcEfWq4Y8AAIwOB2nXzFOr7oZEH436ZOUdCG2SHj71vOGPAABMZNWgqlcN5lfdRxnPr4s8PBL1qOGPAABMRThI9xxcFnWF9jTKU1EbDX8EAGCQweBQOEg3Ii6LWqpFA7U9ap3hjwAANDEcpGDwlcqNiP22K+o6wx8BAMglHJwS9UzlgUiT8UbULYY/AoAAALkGAg9FmriRqruqYvgjAAgAkH0QWBq1QTvGxRa/UDtRCyBbOw4bbMmWqvuOA44+/AErANDaVYEhbTjCtVG7nf3De07QAmjlme52bXjXasMfrABASSsBSyv3BqyNesXwBysAUIo08F6KurngHvzY8AcrAFDySkC6KXBLYa/7vqgnDX+wAgAlrwT8JerOgl7zVsMfBADgvcsBWwt4rb+LWm/4w/G5BADlaPtbBNPQX234gxUA4Eht3gzH8AcBABjjDDlZJ9gALgFAedp2KWBJ1EFn/2AFADi+a1v0Ogx/6IGHAUF5Dg3L9Gjc2Rm/jhsqW/yCFQBgwiEg570Bflh19zcw/EEAACbo9UyP+6dRTxv+IAAAvXsks+NNmxltMvxBAAB6l4botsyGv13+QAAA+mDPMf5sX4OO8yXDHwQAoL+Gx/j6rAYd452GPwgAQP+kofqrhh+jXf5AAACmwF8zGP7O/kEAAPpsuKHHdaXhDwIAMHX2NfCY0i5/bxv+IAAA5bDLHwyAZwEATfK9qrs3geEPVgCAATjYgGN43PAHAQAYrOleDUy7/D1o+IMAAJTDFr8gAACFGTH8QQAAyrPM8AcBACiLLX5BAAAKY5c/EACABvjfgIe/Xf5gms3odDq6APx3QCcEt0e9ZviDFQCgGQaxEdA6wx8EAKCsAJCG/3bDHwQAoFmmcifAhwx/EACAslYAfh71mOEPzeMmQCD5d9RJff6ZO6NWGP4gAADlBIB3oj5u+ENzuQQAJLv7/PMMfxAAgAzs7OPPssUvCABAJvb06edcVH909g8CAJCBP/ThZ1wedcDwBwEAyMdL9fDu1Rei/mn4gwAA5CUN7ld7/N7rov5s+IMAAORpYw/fsyxql+EPAgCQr/SI3l+O8+++WXXv9h8x/CFPNgICRltYdbfuPXeMP0/3CayPet7gBwEAaF8ImBe1YdTX9kZtqoe+wQ8CAACQI/cAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAAIAACAAAAACAAAgAAAAAIAACAAAAACAAAgAAAAAgAAIAAAAE32fwEGAMnMSDh4qI2qAAAAAElFTkSuQmCC",ET="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAEACAYAAADFkM5nAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA39pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ4IDc5LjE2NDAzNiwgMjAxOS8wOC8xMy0wMTowNjo1NyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDozNzdjMTM2OS1jOWY2LTNhNGEtOWM3My01OTJmNWM0Mzg3NjYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6NkJCOEQ5RUQyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6NkJCOEQ5RUMyRkIxMTFFRkIzRjJCNDE5M0I3OTE5MzYiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOmE0ZWU5OWFlLTUyNmYtODY0ZC05OTk0LWQwMzE5MTdjZWUyZSIgc3RSZWY6ZG9jdW1lbnRJRD0iYWRvYmU6ZG9jaWQ6cGhvdG9zaG9wOjdiN2Q4YjQzLTM4ZDktZjI0ZS04MjIyLWI3MTdiMGQxZDY3MiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PmdWjtQAABYrSURBVHja7N0L9HZTnQfwbWrNtNZQRteJpBvpMiLkkstErlGKilJC94uRS7ohFU1rpqRJy9JFpXLJpUgSDbpIEc1MMmqV0lsuMciExDv7t85+12rNwvunZ5/9PPv5fNb6La3V6xzf/37+7/k9Z5+9zzKLFy9OAMB8+Ss/AgDQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADcCs2DrXd3M9WSa5GtiiZHpKZ2O1Za4L5AINwDRaJtc7c52ea/1cF+Z6YQeZ3vH/Mu3Q6Vi9oINMB+Q6488yvaiTsYpcX821nlyQPzyLFy/2U5gey+U65m4u+DFIh+U6MNedMk19rkNLrrtmLNOyuT6da8e7yfTB0uzM4lgtW8bqRXeT659zvUsuNAC0tFquU3Ktfi9/5sxcL8t1w4xkWrVkekpHmRaa62u5Xj5DuZ5UMj31Xv7M2blemuv6GRqryHXqUsbqrFy7yMW8MQUwHbZLw6271Zfy57bK9YNca8xIpu+npc9JzlKm+5Jr6xnKtW3J9NSl/LnNc12Ua80ZGavnLXCstihj9Qy50AAw5s//4FxfzvWQBf47j0/Dw1k7T2mmmJM8qHw76SVTr7ki07tzfSXX8gv8d1bJ9Z1cu075WB1Yfq8WmutxZazkYm6YAmgnLiKfK98o76+P5No315+mJNODS6bt/4JjHJ5rvynKNKlcH861f2djdUT5/N3R2VjJhQaAauLWXcy3rjqBY52X68W5rm2cafWSabWOMk0617kl13WNMz25ZJrEssVvlUxXdzZW55dc18hFr0wBjC+e2L1wQhf/sEmui3Ot2zDTC0um1TrKVCPXprl+2DjXC0qmSe1ZsFEangtYv/FYRa7vTXCsNi6fwWfJhQaAv9QDcr0/14lpWL4zSSuVzn6PRpm+lIZlcT1k6jVX/K4fkuvkNNxOnqQVc/17rtc2+jvsfRVznScXvTIFMI4Vcn0+DU+813ZUrr1y3S6TXMXyJdM2I2T6ZK43jjRWcs1WLjQAc+cfShf/hBHPuWQ3sEUVM8Wc5ONHzBS3QXesmKlVrti+daeKuZ5WMj1xxEzfL2N1VcVzPL38Xo2dK36vfi0XPTAFUN+bR774h5jfi3m+jSsd/y0jXyTDepUztcoVc+cxh75RpeO/ceSLSVi3jNWmFc/RMtcmcqEBYCFenWvvNP7yr0emYee2t1Q49p4dZmqZ61G5zqmU6/XluGMv/Xp4rm+Un2cNr2uU6xHlM7iXXMw6UwDjiW+ux5e/7McW64fjgZ9bJ3zcTUqmR3aUqddcG+Q6IQ0PgI3ti6W5+kOFY29Ycj1arpnIhQZgbsVfvrEKoMWSqUvTsKztFx1luqRkurKzsaqV61Glsdm4QaYflUw/r3BsuWYrF1PCFMC44kGvTXMd2eDcsR947Au+RUeZYk/6iypkmpZcm0/4uLFZz2Zp2JVwbGuUz9/WFY69JNfhDXNtJRcaAJbmj2l40OeVqc7t63vz0DS85z3eH75MhUy75bqtk0zTkOvMCrni+Ya3puGtfreMnCmWWJ6ehtcKT3qsIlc8b7Bzw1zvkItZYgqgrfimd1IaXtgxtpPKhe0WmeY2V7z9L5acrdog06mlCb65wrFb5jqljJVcaABY0De9Y1ObW22X5doh1xUVMsVGJlt2lKnXXLHL3DHl2GO7vJz38grHjlyfzfV8uWYiFw2YAmjv+jS8jz22/Ry7G4uXEsU83/aVMr2/UabY2GS7imPVU674RhebwMRt3jtHzhTvI4hNq15Q4dg3l4vVO+WaiVy4AzD3ti/d/UNGPu/i0oAcnOsumaY+1yGlJp0rHjr8QhrW8I+d6bA0vOu+xkUtcsXStoc1yHVoyXWXXGgAWJonpWGe72kNzh0P070s140TPm7MWZ7UWaZec62chpcgrdMg05kl0w0Vjr1yGau1G+T6Wsn1P3IxTUwBTJ+fpmHb2y80OHe8fCSmBJ4+4ePGvPX65dtKL5l6zfWrNGxL/IkGmbYqmdaocOyWuWLp40VyoQFgIf63dNaxLefYW4LGPuTfTcMysUmKJ9h3aZzpJRWO3WOueDNcbGEdu8GNvfzx8SXTzhWOfZtcM5WLykwBTL/YEjR2A2uxheu/pmEd+qT3xn92yTT2NqeLS6a3pzr7/bfOFWM16Tn0Z6bhFvNjG3z+YgOc/SqN1dol18oNcsVGTPvLhQaAhYgtQY9Lbd7W9c1yN+C6CplabXNaK1PrXOeUb2KTzhXLH2Oa47kNMp2X68W5rq1w7Ja5zi25rpOLVkwBzIbYEnTz8i1v7I7tOWmY53tmhUyxzemHOsrUOtdmlXLF8seY722x/DGa3nhV7boVjr0k16ENcm1acq0jF+4AsFA75fpUrmVHPm/MLcarZY+Raa5ztVr+GM8lxLbMn6x0/OeXXA+WayZyoQGYW7Ehxynln2P7eK5/SsM++ZO0ehqWP7bIdGTJVOMhvh5ztVyqelQaHri8vcKx5ZqtXGgA5tay5dvlTg3O/d1y3t9M+LjLlUw7Nsj0nTTMXf6mwrFb54qx+u2Ej/u3uY5ObZ7+/l75WS6q9HsVuV7aINcFZazkYhSeAZhdsfwsln/tk8Z/6naDNMw1bzjh4/6+XIT3bZBpw0qZpiHXxRVyxVLVXVK9Oyf3Zr2SaeNKv1fR1OzdINf65TP4bLlwB4CFigelYpXAo0Y+7x3lAnBkhWNvmoYnmXvK1Guu2IgmVj78fYNM0VQdUen4Pec6odFnsGYuNABz69HlL6sWXfYxaXjobNKbkKxYGpueMvWaq+Xyx8/lem2uWysc+1HlYrmRXDORi/vAFEA/Yu46lrcd3uDcu6VhrnnSm8UsKpk+0ijTt1OdDVV6zNVy+eOu5fP3uArHvrqMVctcq8iFOwAsVMw3x/KbsZef/S4NDxmdU+HY8bzDJxpkig1Ndq6UqXWuGKtvVjh2PKAXDz0uN3KmWP8ezyWcVen4O5Xfqxa5YqzOlgt3AFiauLUXG6dcPvJ547WkX0/DPN8yEz523F5+VoNMD6+YqXWusyrl+lL5/F02cqbYAS/eknhApbE6seT6SYNc8abE/eXCHQAWquVSwbiwxctJbpnwcVsuqauVqddcy5a7Gy9pkCn2w9+t0ljJNVu5cAdgLi1ZKvjWNP7yszhvrP990oSPu2RJ3T6NMsUeCE+scOwec8XnL27xtlgq+KJcF+ZatdLvVeTaW66ZyIU7AHOv1dKfG9Pw0M/pnWWK1zWf0eFY1coVKx5i5cPYb7W8Kdcrcn2l0vFb5orfq9Mq5mrxZsvauXAHYC59K9ea5Z9jWj7Xl3MdlCY/zxdZ1mqU6bRKmXrNFSsP4lW1542cKd5ZcGquQyr9fdcyV/xeHVwx1zM7zIU7AHPtgbk+mIbbsmM/eHNa6e5vqpRp7wY/z1qZes0VmQ5Lw1TH2J+/M8odjhsrjVWrXF/N9fKKuT6QhmnEnnKhAZhrn0/DkqmxxbexHWSa+1yfScOt+bHFVNR2FY/fKlc0bNvLxX3hFsv8eVAa1vy2uKCcVL5V1sj0qUaZvlQpU6+5ItPRjS4mp5Y7AKmzXCdXzvWJDnOhAZg7sVNa7MC1+8jnvTPX29OwHPGWCpniCfZXNcj0tjQ8uX9LpbHqLVfsFBnPNew5cqa7cr0r1wtz3Vzh+K1yxVi9Mw1LR39f4firpOFZgD06y0XxQD+CubFNGvbgXmHk89bcnW3bXJ9tlKnmDmY95toq17Fp2PxlTDeUb5FnVjq+XLOVC3cA5m6MD07DXNrYF5RLc61T4eIfmd6ThqVdY2e6JA1PfZ9daax6yxWZDkzDA11jX0x+VD5/Z1Yaq15zHdRhLtwBmDsPLd/6t25w7vj2EG/8+kOFTMeWbyhjq/kWsx5zrVDuZGzbIFO8cnnPCp+/3nPFZ2GbznLhDsDciTW8FzW4+McOYnul4QGySf8yr10ybdUo0ysqXfx7zLVmyTT2RTJ2UYwla7tUupj0mmutkmubznLhDsDciYd2/i0NT/CO6Zo0PDx2foVjx7eDj3aWqddc8eDikQ0yXVcynVvp+L3mioeCP9ZhLjQAc+VB5Rd59wbnjn28Yz/vRTLN9VgdkevVDTL9oGS6qtJY9Zrro2n81Qu1c7FApgD60WqJX4j1z5tUuKAsWQrXU6Zecy1ZCtfiIhl7JWxc6WLSMlfs17FRpVyrpDZLF2vnQgMwd7YuHfVaI5/39lyvKXX7hI8dc5ExJ7lmR5l6zbVlrovT8CzDmP6Y6w1pmPK6rcLxW+WK8XlduTjX+AxuVT6DveVCAzB34xdLdmJ707GX7Cwq3ySPrpSpxbLFWpla5/p1pVyxN3xssHNGg8/fb3L9Y66PVzh2y1yLSq6jKuV6d2qzxK9mLu4nzwDMrr9Lw5KdFkuR4sGxeHjnmgqZjk1tliHVypRS2+VV55Vc1074uMuXTM9rkCmmumJXyd9WOHbLXN8uua6ulOvYRn9f1MyFOwBz5xlpuDXZ4pc5HobavMKFckmmFhfJj+TarNLFP3Jd1DDX5hUu/mukYcqpxUXyY+WbZI2L/xplrFrkilU7z6l0kVzyGdy2s1xoAObOK9PwANnjRj5vrBOP9eKxbvyOCpkuaJAp1h3H60bj1ch/qjRWveXatXz+njhyptvKz/NNFT5/f57rCY1yvbliru90mIsJMAUwO/4m14dzvb7Bua9Mw4tULqmQ6fA0PBg0tl+UTJdWGqvecv11rg/lemODTL8smX5Y4dg954q/L97QWS40AHNnpTS8nvVZDc4d+/jHLl3XT/i4j8l1YmeZluSKsVq3o1wrlrFav0Gmc9LwgqLfVTj2imWs1pNrJnIxYaYApt9zSic99oVyca4PpGHu+voKmS7uLFPYrORat6Ncm5bP3/oNMv1LGpbi1biY/GPJtZ5cM5ELDcBciSU7byvf6h4+8rnjPfDx1O7b0/BubpmWnuuAXF/vbKz2zfWNXI9okGnnXPtVGqt9y2dQrunPRUWmAKbTg3Mdk2uHBue+opz3MpnmNtdyadhdb8cGmX6Whvnj/6xw7Mj16TRsQTu2n5Zc/1XpM/ipDnOhAZg7T8l1cq7VGpw7NqmJp4ZvkmlBnlpyrdpRrifnOqX8c2yx8c7Lct1Y4dirl7Fqkev0MlZyMVVMAUyX2LDlwgYXyrtyHZzr+RUuKD1mCi/J9b0GF//IdVClXPEN8vsNLiYxf/zeXNtVupi0zPWeMlZy4Q4A9zgOh+XaJw1zeWO6sXTxp8u04FzxwN1bG+V6WfmmPEkPyPX+XPs3yHRzGauvVDh25Do0DXPTY+e6qeQ6TS40ANyTeGjs+DQ8vTu2H6dhDvmnMi041wlpeDJ+bDEnHnOtP5vwcR+W67g0rGAY22Ul039XGqsvNswVn8Er5GKamQJoK5aLXdzoQhnrutercKFsmen4SplCLFn8YaOLf+TaoMLFf+0yVi0uJieVn2mNi3/kuqhxrivkQgPAPYn3i8cLaB4z8nljmU4sxYs57Fs6yhS3Q3eukCnEK3TjpTordZRr9zS8D37lBpliyeJOlcZqD7lmKhcNmQIY34PS8IKMPRqcOzboiF26zpFpbnPFNsVHlKZmbLFJUexUeFaFY8s1W7nQAMyd6N5ji851Gpw7bl/HfOsvZVpwrrjtuXZHuVpuKX1pyfSLCsdeqYzVunLNRC6mhCmA8cS83UWNLpSfzbVhhQtKj5n+PNfaHeXaNLXZUjp8vmSqcTFZsvXtunLNRC40AHMllunEPG6LbWLjNZzxOs54LedtMi0o1/4d5oqlmN9okCleRRyvJI5XE/+hwlhFrrMajdVecjHzF6fFixf7KdR1ZGrzCt+r0/DgzrdlmutcR5TGYmzXpmETqPMqHf+jud7UINc1Jdf5cqEBYGniifjYqnPM28kXlAvKIpnuc65Tc63VUa4Vy1iNeSs5dqeLXep+XfEcLebHLyy5FslFD0wB1HdVro1yfW6k8x2VhvnDRTLdr1wx93nsSLk+noa5+Zq54tibpOElOGP4ZK6NK1/8Uzl+5PrMSLmOLudbJBcaAO6LmNN9Ra690zAvWsPtufbM9bryv2W6/7l2rZwrzhFLC9+Q648jZYp1/29JwzxvrbF6bRmvMcdqt5Kr5mfwNaXkoiumAMYX32RjO9mHTfhbw5IXg8g0Oc9Jwy58k8x1Vcn1g0aZ4tte7AI5yQfMFpVMFzYcK7lmKxcagLn12DS8cnXNCRwrHrKKh3eu7SjTuSXTdVMwVqukYQ69p1yTfNbh/JLpmikYq5XLZ1Cu2chFY6YA2og13s9Ow0s9/hIfzrX5FFz8J53puVNy8Q9XllzHdZRrUs86HFE+f9NyMflVGSu5ZiMXGoC5FetsY5vNWE9/5/38d+OVtH+SaZRcsR///h3lWvKsw/3577o1Dc9/xJrxO6ZsrG4tufaRayZy0ZApgOnw3PLN+aEL+LM/T8MWnT+SqVmuuBuwQke5NiuZFvKsw5Ul0yUzMFaR6/gFfgblwh0Amohd2mLd738s5c+dmYZtd38kU9Nc63SW65zy33rpUv7c2WnY+2FWLibnlP/epY3BWXKhAaCl+LYY73w/4W7+v7hNc2iu5+W6QaapyBVz6Cd2lOvKkum4e8j0wVxbpeENcWnGcm1wL7k+kGsbuZhHpgCmcExyvS3X+3I9INfv07Am+GSZpjLXAbneW3LdnOtVHeSKZzgOK5niHfC730OzM2tjtV9pzpbkis/gSXKhAWDabJ3rwPKX709kmolccfG/vJNMW+Q6JA0bFv24o7HaMtfBJddlcqEBAADmimcAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAANAAAAAaAABAAwAAaAAAAA0AAKABAAA0AACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAACABgAA0AAAABoAAEADAABoAAAADQAAoAEAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAADQAAIAGAADQAAAAGgAAQAMAAGgAAAANAACgAQAANAAAgAYAANAAAAAaAABAAwAAaAAAAA0AAHDv/k+AAQD4HcieQJZ+TQAAAABJRU5ErkJggg==",wl=class wl extends Os{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}this.ad(a.createEventsCallFunc([i.strokeColorChanged,i.strokeWidthChanged,i.materialModeChanged,i.speedChanged,i.strokeMaterialChanged],()=>{this.geoPolyline.customArrow=i.materialMode!=="pureColor",this.geoPolyline.customArrowParams={color:i.strokeColor,arrowColor:i.strokeMaterialParams.arrowColor,repeat:i.strokeWidth*6,speed:i.speed,image:i.materialMode=="singleArrow"?ST:ET,lineLength:a.getDistancesFromPositions(i.points??[],"GEODESIC").pop()??0}},{immediate:!0}))}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(wl,"type",wl.register("ESCesiumViewer",a.ESPath.type,wl));let Np=wl;const un=class un extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_czmCustomPrimitive");v(this,"_geoBoundingSphere");this._czmCustomPrimitive=this.disposeVar(new De(e,n)),this._geoBoundingSphere=this.disposeVar(Pm([this,"positions"]));const{czmCustomPrimitive:o}=this;this.dispose(a.track([o,"show"],[this,"show"])),this.dispose(a.track([o,"allowPicking"],[this,"allowPicking"]));const s=this.disposeVar(a.react(0));{const r=()=>{if(!this.positions||this.positions.length<3){o.show=!1;return}o.show=!0;const[c,u,d]=It({originPosition:this.positions[0]},this.positions);o.modelMatrix=u,o.cull=!1,c.push(c[0]);const p=c.length,f=[...c,...c.map(C=>[C[0],C[1],C[2]+(this.height??un.defaults.height)])],g=c.reduce((C,S,x,A)=>{if(x===0)return C.push(0),C;const R=x-1,O=A[R],N=Math.sqrt((O[0]-S[0])*(O[0]-S[0])+(O[1]-S[1])*(O[1]-S[1]));return C.push(C[R]+N),C},[]);s.value=g[p-1];const m=g.map(C=>C/s.value),y=[...m.map(C=>[C,0]),...m.map(C=>[C,1])];o.attributes={a_position:{typedArray:new Float32Array(f.flat(1)),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(y.flat(1)),componentsPerAttribute:2}};const _=o.computeLocalAxisedBoundingBoxFromAttribute("a_position");if(!_){console.warn("包围盒计算存在问题!");return}o.setLocalAxisedBoundingBox(_.min,_.max);const P=[...new Array(p-1).keys()].map(C=>[[C,C+1,C+p+1],[C,C+p+1,C+p],[C+p+1,C+1,C],[C+p,C+p+1,C]]).flat(2);o.indexTypedArray=new Uint16Array(P),o.vertexShaderSource=` in vec3 a_position;
1727
1727
  in vec2 a_st;
1728
1728
  out vec2 v_st;
1729
1729
  void main()
@@ -1742,7 +1742,7 @@ ${$y}
1742
1742
  vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
1743
1743
  out_FragColor = imageColor * u_color;
1744
1744
  }
1745
- `};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};v(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Do=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Cl=class Cl extends vt{constructor(e,n){super(e,n);v(this,"_czmPolygonFence");v(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Do(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:m,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=m,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};v(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Bp=Cl;const _l=class _l extends vt{constructor(e,n){super(e,n);v(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};v(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Vp=_l;const Zn=class Zn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Zn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const C=h.Material.fromType(h.Material.ImageType);C.uniforms.image=s.value,C.uniforms.repeat=_e(this.repeat??Zn.defaults.repeat),r.value=C};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(C,S)=>{const x=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const A=[];if(C.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:C,width:this.width??Zn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Zn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??Zn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const C=ut(this.positions);if(C.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(C,p),d=u(C,r.value),d&&o.scene.primitives.add(d)},m=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(C=>{if(e.actived&&p.radius>0){const S=re(p.center);S&&ne(o,S,p.radius*4,void 0,C)}})),g(),m();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),m()}));const _=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(_.disposableOn(()=>{m()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Zn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Ro=Zn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Pl=class Pl extends vt{constructor(e,n){super(e,n);v(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Ro(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Up=Pl;const bl=class bl 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){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},_=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(_.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),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";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const _=n.viewerLegend.legend.computedLengthInStr;_&&(p.innerHTML=_);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const C=(135-P)/2;f.style.left=`${C}px`}}};g();const m=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(m))}}}get customDiv(){return this._customDiv}};v(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Wp=bl;const Sl=class Sl extends fe{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new De(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r,!0),!0):!1}};v(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Gp=Sl;const El=class El extends dh{constructor(e,n){super(e,n);v(this,"czmGeoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.czmGeoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};v(El,"type",El.register("ESCesiumViewer",a.ESDynamicWater.type,El));let Hp=El;const xl=class xl extends Jt{constructor(e,n){super(e,n);v(this,"_scaleFactor",.6);v(this,"_urlData",this.dv(a.react(void 0)));v(this,"_dataSource",new h.CustomDataSource);v(this,"_clusterImages",{});v(this,"_clusterImageAttribute",{});v(this,"_clusterImageUrl","");if(!n.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var l;const s=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(s).then(c=>c.json()).then(c=>{this._clusterImageAttribute=c}).catch(c=>{console.error(c)});for(const c in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,c)){const u=this._clusterImageAttribute[c];this._clusterImages[c]=new h.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new h.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new h.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const r=this._dataSource;(l=n.viewer)==null||l.dataSources.add(r),this.d(()=>{var c;(c=n.viewer)==null||c.dataSources.remove(r)}),r.clustering.enabled=r.clustering.clusterBillboards=r.clustering.clusterLabels=r.clustering.clusterPoints=!0,this.d(a.track([r.clustering,"pixelRange"],[e,"pixelRange"])),this.d(a.track([r.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(a.track([r.clustering,"show"],[e,"show"]));{const c=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(a.ESSceneObject.context.getStrFromEnv(e.url.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}):typeof e.url=="object"?this.urlData=e.url:a.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(a.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};c(),this.d(e.urlChanged.don(c))}{const c=this.dv(a.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(c.don(()=>{this.updateEntityCluster(u)}))}{const c=(u,d)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(d==null?void 0:d.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(d==null?void 0:d.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,d)=>c(u,d)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var g,m,y,_,P,C,S,x,A,R,O,N;const{czmViewer:n,_dataSource:o,sceneObject:s}=e;if(!((g=n.viewer)==null?void 0:g.scene))return;const l=o.entities,c=new h.NearFarScalar(100,1,1e3,1),u=s.heightReference=="None"?h.HeightReference.NONE:s.heightReference=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_TERRAIN;l.removeAll();const d=(m=this.czmViewer.viewer)==null?void 0:m.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(V=>{V.id.billboard.imageSubRegion=void 0}),d&&d())}),p=s.style??a.ESEntityCluster.defaults.style;this._clusterImages[((y=p.nonCluster)==null?void 0:y.mode)??"SquareH01"].heightReference=u,this._clusterImages[((_=p.nonCluster)==null?void 0:_.mode)??"SquareH01"].scaleByDistance=c;const f=[-this._clusterImageAttribute[((P=p.nonCluster)==null?void 0:P.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((C=p.nonCluster)==null?void 0:C.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((S=p.nonCluster)==null?void 0:S.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=p.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let V=0;V<this.urlData.features.length;V++){const U=this.urlData.features[V];if(U.geometry.type=="Point")this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates,f,u,c,(A=p.nonCluster)==null?void 0:A.mode,U.properties);else if(U.geometry.type=="MultiPoint")for(let z=0;z<U.geometry.coordinates.length;z++)this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates[z],f,u,c,(R=p.nonCluster)==null?void 0:R.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let V=0;V<this.urlData.geometries.length;V++){const U=this.urlData.geometries[V];if(U.type=="Point")this._addEntities(l,U.name??(V+1).toString(),U.coordinates,f,u,c,(O=p.nonCluster)==null?void 0:O.mode,U.properties);else if(U.type=="MultiPoint")for(let z=0;z<U.coordinates.length;z++)this._addEntities(l,U.name??(V+1).toString(),U.coordinates[z],f,u,c,(N=p.nonCluster)==null?void 0:N.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.type)}this.updateStyle(u,c)}async updateStyle(e,n){var c,u;const o=this,{_dataSource:s,sceneObject:r}=this,l=((c=r.style)==null?void 0:c.cluster)??a.ESEntityCluster.defaults.style.cluster;s.entities.values.forEach(d=>{h.Entity.prototype&&(d.ESSceneObjectID=r.id)}),s.clustering.clusterEvent.addEventListener(async function(d,p){if(p.label.ESSceneObjectID=p.billboard.ESSceneObjectID=p.point.ESSceneObjectID=r.id,p.label.show=!0,p.label.font="16px sans-serif",p.label.scale=1*o._scaleFactor,p.label.verticalOrigin=h.VerticalOrigin.BOTTOM,p.label.horizontalOrigin=h.HorizontalOrigin.CENTER,p.label.eyeOffset=new h.Cartesian3(0,0,-10),e&&(p.label.heightReference=e),n&&(p.label.scaleByDistance=n),p.billboard.id=p.label.id,p.billboard.show=!0,p.billboard.scale=1*o._scaleFactor,p.billboard.verticalOrigin=h.VerticalOrigin.BOTTOM,p.billboard.horizontalOrigin=h.HorizontalOrigin.CENTER,e&&(p.billboard.heightReference=e),n&&(p.billboard.scaleByDistance=n),l){const f=o.getClusterStyle(l,d.length).mode,g=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];p.label.pixelOffset=new h.Cartesian2(g[0]*o._scaleFactor,g[1]*o._scaleFactor),p.billboard.width=o._clusterImageAttribute[f].imageSize[0],p.billboard.height=o._clusterImageAttribute[f].imageSize[1],p.billboard.pixelOffset=new h.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),p.billboard.setImage(f,o._clusterImageUrl),p.billboard.setImageSubRegion(f,new h.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const d=()=>{const f=s.clustering.pixelRange;s.clustering.pixelRange=0,s.clustering.pixelRange=f};d();let p=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{d()});this.d(()=>{var f;p&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(p))})}}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}_addEntities(e,n,o,s,r,l,c,u){const d=h.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:d,label:{text:n,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,pixelOffset:new h.Cartesian2(s[0]*this._scaleFactor,s[1]*this._scaleFactor),heightReference:r,scaleByDistance:l,eyeOffset:new h.Cartesian3(0,0,-10)},billboard:this._clusterImages[c??"SquareH01"].clone(new h.BillboardGraphics),properties:u})}_getPositionLLH(e){const n=h.Cartographic.fromCartesian(e);return[h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude),n.height]}};v(xl,"type",xl.register("ESCesiumViewer",a.ESEntityCluster.type,xl));let $p=xl;const Al=class Al extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};v(Al,"type",Al.register("ESCesiumViewer",gh.type,Al));let qp=Al;const Tl=class Tl extends qt{constructor(e,n){super(e,n);v(this,"geoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.geoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};v(Tl,"type",Tl.register("ESCesiumViewer",a.ESGeoWater.type,Tl));let Xp=Tl;const Ml=class Ml extends Jt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const r=this.dv(a.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),l=()=>{s.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};l(),this.d(r.don(l))}}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Ml,"type",Ml.register("ESCesiumViewer",fh.type,Ml));let Yp=Ml;class AT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:C,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(...C),u.push(...this.setIndexs(P))}const[f,g,m]=It({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const _=this.setTextureCoordinates(n,o);c.push(..._.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(s,g,l,u,c)}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],m=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],_=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,m],[d,p],[p,y]],C=[[f,g],[f,m],[g,y],[m,y]];return{outlinePionts:[..._,...P,...C],customPrimitivePoints:[u,c,d,p,g,f,m,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=It({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],m=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+m),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Il=class Il extends vt{constructor(e,n){super(e,n);v(this,"_line",this.dv(new be(this.czmViewer,this.sceneObject.id)));v(this,"_czmTexture",this.ad(new ze(this.czmViewer,this.sceneObject.id)));v(this,"_czmCustomPrimitive",this.dv(new De(this.czmViewer,this.sceneObject.id)));v(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new AT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
1745
+ `};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(l.disposableOn(r))}this.dispose(this.flyToEvent.disposableOn(r=>{this.czmCustomPrimitive.flyTo(r)}));{const r=()=>{const c=s.value?s.value:1,u=this.height??un.defaults.height,{textureSizeInMeters:d=un.defaults.textureSizeInMeters}=this,{textureUri:p=un.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:p},u_stScale:[c/d[0],u/d[1]],u_speed:this.textureMoveSpeed??un.defaults.textureMoveSpeed,u_color:this.textureColor??un.defaults.textureColor}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,s.changed));this.dispose(l.disposableOn(r))}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get czmCustomPrimitive(){return this._czmCustomPrimitive}get geoBoundingSphere(){return this._geoBoundingSphere.value}get geoBoundingSphereChanged(){return this._geoBoundingSphere.changed}};v(un,"defaults",{show:!0,allowPicking:!1,positions:[],height:1e3,textureSizeInMeters:[500,500],textureUri:"${earthsdk3-assets-script-dir}/assets/img/location.png",textureMoveSpeed:[0,.3],textureColor:[1,1,1,1]});let Do=un;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:a.reactPositions(void 0),height:void 0,textureSizeInMeters:a.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:a.reactArrayWithUndefined(void 0),textureColor:a.reactArrayWithUndefined(void 0)})})(Do||(Do={})),a.extendClassProps(Do.prototype,Do.createDefaultProps);const Cl=class Cl extends vt{constructor(e,n){super(e,n);v(this,"_czmPolygonFence");v(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Do(n,e.id)),this._czmPolygon=this.dv(new a.ESGeoPolygon),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmPolygonFence,r=this._czmPolygon;n.add(r),this.dispose(()=>n.delete(r)),r.filled=!1,this.d(a.track([r,"points"],[e,"points"])),this.d(a.track([r,"stroked"],[e,"stroked"])),this.d(a.track([r,"strokeColor"],[e,"strokeColor"])),this.d(a.track([r,"strokeWidth"],[e,"strokeWidth"])),this.d(a.track([r,"strokeGround"],[e,"strokeGround"]));{const l={danger:{color:[.99,.98,.57,1],image:"01.png"},checkerboard:{color:[.88,.98,.99,1],image:"02.png"},warning:{color:[1,.93,.58,1],image:"03.png"},cord:{color:[.91,.87,.56,1],image:"04.png"},scanline:{color:[.43,.78,.8,1],image:"05.png"},honeycomb:{color:[.28,.84,.86,1],image:"06.png"},gradientColor:{color:[1,1,1,1],image:"07.png"}},c=(f,g)=>{switch(f){case"danger":return{textureMoveSpeed:[.05,0],textureSizeInMeters:[2,2]};case"checkerboard":return{textureMoveSpeed:[0,0],textureSizeInMeters:[2,2]};case"warning":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"cord":return{textureMoveSpeed:[-.05,0],textureSizeInMeters:[2,2]};case"scanline":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[g,g]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[g*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",d=()=>{const f=e.materialMode,g=l[f];if(!g)return;s.textureUri=u+g.image,s.textureColor=f!=="gradientColor"?g.color:e.fillColor;const{textureMoveSpeed:m,textureSizeInMeters:y}=c(f,e.height);s.textureMoveSpeed=m,s.textureSizeInMeters=y};d();const p=this.disposeVar(a.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(p.disposableOn(d))}{this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"height"],[e,"height"]));{const l=()=>{s.show=e.show&&e.filled};l();const c=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(c.don(l))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonFence:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(Dt(s,o,n,e,r.czmCustomPrimitive),!0):!1}};v(Cl,"type",Cl.register("ESCesiumViewer",a.ESPolygonFence.type,Cl));let Bp=Cl;const _l=class _l extends vt{constructor(e,n){super(e,n);v(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Si(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRectangle;this.dispose(a.bind([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"ground"],[e,"fillGround"])),this.dispose(a.track([s,"strokeGround"],[e,"strokeGround"])),this.dispose(a.track([s,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(a.bind([s,"height"],[e,"height"])),this.dispose(a.bind([s,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(a.bind([s,"rectangle"],[e,"rectangle"])),this.dispose(a.bind([s,"stRotation"],[e,"stRotation"])),this.dispose(a.bind([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"outline"],[e,"stroked"])),this.dispose(a.track([s,"outlineColor"],[e,"strokeColor"]));{const r=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:c,maxPos:u}=a.getMinMaxCorner(l);s.rectangle=[c[0],c[1],u[0],u[1]],s.height=l[1][2],s.extrudedHeight=l[0][2]}else s.rectangle=void 0,s.height=0,s.extrudedHeight=0};r(),this.dispose(e.pointsChanged.disposableOn(()=>r()))}{const r=()=>{e.filled?s.material={type:"Color",color:e.fillColor}:s.material={type:"Color",color:[1,1,1,0]}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(r))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRectangle:r}=this;if(!s.actived)return!1;if(o.flyInParam)return super.flyIn(e,n);if(r.rectangle){const l=[[r.rectangle[0],r.rectangle[1],r.height],[r.rectangle[2],r.rectangle[3],r.height],[r.rectangle[0],r.rectangle[1],r.extrudedHeight],[r.rectangle[2],r.rectangle[3],r.extrudedHeight]];return oe(s,o,n,l,e),!0}return!1}};v(_l,"type",_l.register("ESCesiumViewer",a.ESRectangle.type,_l));let Vp=_l;const Zn=class Zn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const s=a.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],Zn.defaults.imageUrl),r=this.disposeVar(a.react(void 0)),l=()=>{const C=h.Material.fromType(h.Material.ImageType);C.uniforms.image=s.value,C.uniforms.repeat=_e(this.repeat??Zn.defaults.repeat),r.value=C};l();const c=this.disposeVar(a.createNextAnimateFrameEvent(s.changed,this.repeatChanged));this.dispose(c.disposableOn(l));const u=(C,S)=>{const x=new h.PolylineMaterialAppearance({material:S,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const A=[];if(C.length<2)return;A.push(new h.GeometryInstance({geometry:new h.GroundPolylineGeometry({positions:C,width:this.width??Zn.defaults.width,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:h.ArcType[this.arcType??Zn.defaults.arcType]}),id:this}));const R=new Ti({geometryInstances:A,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??Zn.defaults.allowPicking,compressVertices:!1});return R.ESSceneObjectID=n,R};let d;const p=new h.BoundingSphere,f=()=>{d&&(o.scene.primitives.remove(d),d=void 0)};this.dispose(f);const g=()=>{if(f(),!this.positions)return;const C=ut(this.positions);if(C.length<2||!r.value){p.radius=-1;return}h.BoundingSphere.fromPoints(C,p),d=u(C,r.value),d&&o.scene.primitives.add(d)},m=()=>{d&&(d.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(C=>{if(e.actived&&p.radius>0){const S=re(p.center);S&&ne(o,S,p.radius*4,void 0,C)}})),g(),m();const y=this.disposeVar(a.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(y.disposableOn(()=>{g(),m()}));const _=this.disposeVar(a.createNextAnimateFrameEvent(this.showChanged));this.dispose(_.disposableOn(()=>{m()}));const{extensions:P}=e;if(!P){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};v(Zn,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let Ro=Zn;(t=>{t.createDefaultProps=()=>({show:void 0,positions:a.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})(Ro||(Ro={})),a.extendClassProps(Ro.prototype,Ro.createDefaultProps);const Pl=class Pl extends vt{constructor(e,n){super(e,n);v(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new Ro(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmESRoad;{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}this.dispose(a.bind([s,"positions"],[e,"points"])),this.dispose(a.track([s,"width"],[e,"width"])),this.dispose(a.track([s,"arcType"],[e,"arcType"])),this.dispose(a.track([s,"imageUrl"],[e,"imageUrl"])),this.dispose(a.track([s,"repeat"],[e,"repeat"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmESRoad: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmESRoad:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(Pl,"type",Pl.register("ESCesiumViewer",Ch.type,Pl));let Up=Pl;const bl=class bl 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){super(),this._subContainer=l;const d=document.createElement("div");this._subContainer.appendChild(d),this.dispose(()=>this._subContainer.removeChild(d));{const y=()=>{d.style.display=e.show??a.ESScale.defaults.show?"block":"none"};y(),e.dispose(e.showChanged.disposableOn(y))}d.style.position="fixed",d.style.width="125px",d.style.height="30px",d.style.border="1px solid rgba(49,50,56,.8)",d.style.padding="0 5px",d.style.backgroundColor="rgba(37,38,42,.8)",d.style.borderRadius="15px",d.style.pointerEvents="auto",d.style.transition=" right 0.4s linear";{const y=()=>{d.style.bottom=`${e.cssPosition?e.cssPosition[0]:a.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(d.style.right="auto",d.style.left=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`):(d.style.left="auto",d.style.right=`${e.cssPosition?e.cssPosition[1]:a.ESScale.defaults.cssPosition[1]}px`)},_=this.disposeVar(a.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));y(),this.dispose(_.disposableOn(()=>y()))}const p=document.createElement("div");d.appendChild(p),this.dispose(()=>d.removeChild(p)),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";const f=document.createElement("div");d.appendChild(f),this.dispose(()=>d.removeChild(f)),f.style.borderRight="1px solid #fff",f.style.borderLeft="1px solid #fff",f.style.borderBottom="1px solid #fff",f.style.position="absolute",f.style.height="10px",f.style.top="15px",f.style.width="75px",f.style.left=`${60/2}px`;const g=()=>{const y=n.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||y&&y>1e6)d.style.display="none";else{d.style.display="block";const _=n.viewerLegend.legend.computedLengthInStr;_&&(p.innerHTML=_);const P=n.viewerLegend.legend.computedLengthInPixels;if(P){f.style.width=`${P}px`;const C=(135-P)/2;f.style.left=`${C}px`}}};g();const m=setInterval(()=>{g()},200);this.dispose(()=>clearInterval(m))}}}get customDiv(){return this._customDiv}};v(bl,"type",bl.register("ESCesiumViewer",a.ESScale.type,bl));let Wp=bl;const Sl=class Sl extends fe{constructor(e,n){super(e,n);v(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new De(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmCustomPrimitive;this.dispose(a.track([s,"show"],[e,"show"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(Ke([s,"rotation"],[e,"rotation"])),this.dispose(a.track([s,"position"],[e,"position"])),this.dispose(a.track([s,"scale"],[e,"scale"])),this.dispose(a.track([s,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(a.track([s,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(a.track([s,"maximumScale"],[e,"maximumScale"])),this.dispose(a.track([s,"minimumScale"],[e,"minimumScale"])),this.dispose(a.track([s,"pixelSize"],[e,"pixelSize"])),this.dispose(a.track([s,"showSceneScale"],[e,"showSceneScale"])),this.dispose(a.track([s,"modelMatrix"],[e,"modelMatrix"])),this.dispose(a.track([s,"cull"],[e,"cull"])),this.dispose(a.track([s,"boundingVolume"],[e,"boundingVolume"])),this.dispose(a.track([s,"pass"],[e,"pass"])),this.dispose(a.track([s,"primitiveType"],[e,"primitiveType"])),this.dispose(a.track([s,"renderState"],[e,"renderState"])),this.dispose(a.track([s,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(a.track([s,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(a.track([s,"uniformMap"],[e,"uniformMap"])),this.dispose(a.track([s,"attributes"],[e,"attributes"])),this.dispose(a.track([s,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(a.track([s,"attributesJson"],[e,"attributesJson"])),this.dispose(a.track([s,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(a.track([s,"count"],[e,"count"])),this.dispose(a.track([s,"offset"],[e,"offset"])),this.dispose(a.track([s,"instanceCount"],[e,"instanceCount"])),this.dispose(a.track([s,"localPosition"],[e,"localPosition"])),this.dispose(a.track([s,"localScale"],[e,"localScale"])),this.dispose(a.track([s,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(a.track([s,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(a.track([s,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(a.track([s,"occlude"],[e,"occlude"])),this.dispose(a.track([s,"castShadows"],[e,"castShadows"])),this.dispose(a.track([s,"receiveShadows"],[e,"receiveShadows"])),this.dispose(a.track([s,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(a.track([s,"pickOnly"],[e,"pickOnly"])),this.dispose(a.track([s,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const r=()=>{if(e.localRotation){const l=[...e.localRotation];l[0]-=90,s.localRotation=l}else s.localRotation=[-90,0,0]};r(),this.dispose(e.localRotationChanged.disposableOn(r))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmCustomPrimitive:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(Dt(s,o,n,e,r,!0),!0):!1}};v(Sl,"type",Sl.register("ESCesiumViewer",yh.type,Sl));let Gp=Sl;const El=class El extends dh{constructor(e,n){super(e,n);v(this,"czmGeoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.czmGeoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{czmGeoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??a.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESDynamicWater.defaults.flowSpeed});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=e.show&&e.stroked},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=!!(e.show&&e.filled)},u=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{if(!e.points||e.points&&e.points.length<=2){r.positions=[],l.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const d=e.points.map(f=>[f[0],f[1],0]),[p]=yn({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},d);r.positions=[...p,p[0]],l.points=[...p]};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(c))}}visibleDistance(e,n){var o;if((o=n.viewer)!=null&&o.camera&&e.show){const s=a.getDistancesFromPositions([e.position,Gt(n.viewer.camera)],"NONE")[0];let r=!1;e.minVisibleDistance<e.maxVisibleDistance?r=e.minVisibleDistance<s&&s<e.maxVisibleDistance:e.maxVisibleDistance==0&&(r=s>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&r),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&r)}}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmWater:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):r!=null&&r.points?(oe(s,o,n,r.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:n}=this;n&&(e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection)}};v(El,"type",El.register("ESCesiumViewer",a.ESDynamicWater.type,El));let Hp=El;const xl=class xl extends Jt{constructor(e,n){super(e,n);v(this,"_scaleFactor",.6);v(this,"_urlData",this.dv(a.react(void 0)));v(this,"_dataSource",new h.CustomDataSource);v(this,"_clusterImages",{});v(this,"_clusterImageAttribute",{});v(this,"_clusterImageUrl","");if(!n.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var l;const s=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(s).then(c=>c.json()).then(c=>{this._clusterImageAttribute=c}).catch(c=>{console.error(c)});for(const c in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,c)){const u=this._clusterImageAttribute[c];this._clusterImages[c]=new h.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new h.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new h.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const r=this._dataSource;(l=n.viewer)==null||l.dataSources.add(r),this.d(()=>{var c;(c=n.viewer)==null||c.dataSources.remove(r)}),r.clustering.enabled=r.clustering.clusterBillboards=r.clustering.clusterLabels=r.clustering.clusterPoints=!0,this.d(a.track([r.clustering,"pixelRange"],[e,"pixelRange"])),this.d(a.track([r.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(a.track([r.clustering,"show"],[e,"show"]));{const c=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(a.ESSceneObject.context.getStrFromEnv(e.url.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}):typeof e.url=="object"?this.urlData=e.url:a.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(a.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};c(),this.d(e.urlChanged.don(c))}{const c=this.dv(a.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(c.don(()=>{this.updateEntityCluster(u)}))}{const c=(u,d)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(d==null?void 0:d.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(d==null?void 0:d.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,d)=>c(u,d)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var g,m,y,_,P,C,S,x,A,R,O,N;const{czmViewer:n,_dataSource:o,sceneObject:s}=e;if(!((g=n.viewer)==null?void 0:g.scene))return;const l=o.entities,c=new h.NearFarScalar(100,1,1e3,1),u=s.heightReference=="None"?h.HeightReference.NONE:s.heightReference=="CLAMP_TO_GROUND"?h.HeightReference.CLAMP_TO_GROUND:h.HeightReference.CLAMP_TO_TERRAIN;l.removeAll();const d=(m=this.czmViewer.viewer)==null?void 0:m.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(V=>{V.id.billboard.imageSubRegion=void 0}),d&&d())}),p=s.style??a.ESEntityCluster.defaults.style;this._clusterImages[((y=p.nonCluster)==null?void 0:y.mode)??"SquareH01"].heightReference=u,this._clusterImages[((_=p.nonCluster)==null?void 0:_.mode)??"SquareH01"].scaleByDistance=c;const f=[-this._clusterImageAttribute[((P=p.nonCluster)==null?void 0:P.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((C=p.nonCluster)==null?void 0:C.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((S=p.nonCluster)==null?void 0:S.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=p.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let V=0;V<this.urlData.features.length;V++){const U=this.urlData.features[V];if(U.geometry.type=="Point")this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates,f,u,c,(A=p.nonCluster)==null?void 0:A.mode,U.properties);else if(U.geometry.type=="MultiPoint")for(let z=0;z<U.geometry.coordinates.length;z++)this._addEntities(l,U.properties.name??(V+1).toString(),U.geometry.coordinates[z],f,u,c,(R=p.nonCluster)==null?void 0:R.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let V=0;V<this.urlData.geometries.length;V++){const U=this.urlData.geometries[V];if(U.type=="Point")this._addEntities(l,U.name??(V+1).toString(),U.coordinates,f,u,c,(O=p.nonCluster)==null?void 0:O.mode,U.properties);else if(U.type=="MultiPoint")for(let z=0;z<U.coordinates.length;z++)this._addEntities(l,U.name??(V+1).toString(),U.coordinates[z],f,u,c,(N=p.nonCluster)==null?void 0:N.mode,U.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",U.type)}this.updateStyle(u,c)}async updateStyle(e,n){var c,u;const o=this,{_dataSource:s,sceneObject:r}=this,l=((c=r.style)==null?void 0:c.cluster)??a.ESEntityCluster.defaults.style.cluster;s.entities.values.forEach(d=>{h.Entity.prototype&&(d.ESSceneObjectID=r.id)}),s.clustering.clusterEvent.addEventListener(async function(d,p){if(p.label.ESSceneObjectID=p.billboard.ESSceneObjectID=p.point.ESSceneObjectID=r.id,p.label.show=!0,p.label.font="16px sans-serif",p.label.scale=1*o._scaleFactor,p.label.verticalOrigin=h.VerticalOrigin.BOTTOM,p.label.horizontalOrigin=h.HorizontalOrigin.CENTER,p.label.eyeOffset=new h.Cartesian3(0,0,-10),e&&(p.label.heightReference=e),n&&(p.label.scaleByDistance=n),p.billboard.id=p.label.id,p.billboard.show=!0,p.billboard.scale=1*o._scaleFactor,p.billboard.verticalOrigin=h.VerticalOrigin.BOTTOM,p.billboard.horizontalOrigin=h.HorizontalOrigin.CENTER,e&&(p.billboard.heightReference=e),n&&(p.billboard.scaleByDistance=n),l){const f=o.getClusterStyle(l,d.length).mode,g=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];p.label.pixelOffset=new h.Cartesian2(g[0]*o._scaleFactor,g[1]*o._scaleFactor),p.billboard.width=o._clusterImageAttribute[f].imageSize[0],p.billboard.height=o._clusterImageAttribute[f].imageSize[1],p.billboard.pixelOffset=new h.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),p.billboard.setImage(f,o._clusterImageUrl),p.billboard.setImageSubRegion(f,new h.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const d=()=>{const f=s.clustering.pixelRange;s.clustering.pixelRange=0,s.clustering.pixelRange=f};d();let p=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{d()});this.d(()=>{var f;p&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(p))})}}getClusterStyle(e,n){return e.find(o=>{if(o.value!==void 0)return o.value===n;const s=o.minValue!==void 0?o.minValue<=n:!0,r=o.maxValue!==void 0?o.maxValue>=n:!0;return s&&r})}_addEntities(e,n,o,s,r,l,c,u){const d=h.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:d,label:{text:n,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:h.VerticalOrigin.BOTTOM,horizontalOrigin:h.HorizontalOrigin.CENTER,pixelOffset:new h.Cartesian2(s[0]*this._scaleFactor,s[1]*this._scaleFactor),heightReference:r,scaleByDistance:l,eyeOffset:new h.Cartesian3(0,0,-10)},billboard:this._clusterImages[c??"SquareH01"].clone(new h.BillboardGraphics),properties:u})}_getPositionLLH(e){const n=h.Cartographic.fromCartesian(e);return[h.Math.toDegrees(n.longitude),h.Math.toDegrees(n.latitude),n.height]}};v(xl,"type",xl.register("ESCesiumViewer",a.ESEntityCluster.type,xl));let $p=xl;const Al=class Al extends Jt{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyToParam||n.flyInParam?super.flyTo(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(i,e){const{sceneObject:n,czmViewer:o}=this;return o.actived?n.flyInParam?super.flyIn(i,e):(n.esImageryLayer.flyTo(i&&i),n.flyOverEvent.emit(e,"over",o),!0):!1}};v(Al,"type",Al.register("ESCesiumViewer",gh.type,Al));let qp=Al;const Tl=class Tl extends qt{constructor(e,n){super(e,n);v(this,"geoPolyline");v(this,"czmWater");if(!n.viewer){console.warn("viewer is undefined!");return}if(!kt(n.viewer))return;this.geoPolyline=this.dv(new be(n,e.id)),this.czmWater=this.dv(new go(n,e.id));const{geoPolyline:r,czmWater:l}=this;this.d(a.track([l,"allowPicking"],[e,"allowPicking"])),this.d(a.track([l,"ground"],[e,"fillGround"])),this.d(a.track([r,"allowPicking"],[e,"allowPicking"])),this.d(a.track([r,"color"],[e,"strokeColor"])),this.d(a.track([r,"width"],[e,"strokeWidth"])),this.d(a.track([r,"ground"],[e,"strokeGround"]));{const c=this.dv(a.createNextAnimateFrameEvent(e.waterColorChanged,e.waterImageChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowDirectionChanged,e.flowSpeedChanged)),u=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor??a.ESGeoWater.defaults.waterColor,frequency:(e.frequency??a.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??a.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??a.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??a.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??a.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??a.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??a.ESGeoWater.defaults.waterImage});else{const d=Object.assign({},Mu[e.waterType]);d.frequency&&(d.frequency/=10),d.waveVelocity&&(d.waveVelocity/=100),d.amplitude&&(d.amplitude*=100),this.updateWater(d)}};u(),this.d(c.don(u))}{const c=()=>{r.show=!!(e.show&&e.stroked)},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(c)),c()}{const c=()=>{l.show=e.show&&e.filled},u=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(c)),c()}{const c=()=>{e.points&&e.points.length>=3?(r.positions=[...e.points,e.points[0]],l.points=[...e.points]):(r.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],l.points=[])};c();const u=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(c))}this.ad(e.editingChanged.don(c=>{l.updateBoundingSphere(c)}))}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:n}=this;e.waterColor&&n.waterColor!=e.waterColor&&(n.waterColor=e.waterColor),e.specularIntensity!=null&&n.specularIntensity!=e.specularIntensity&&(n.specularIntensity=e.specularIntensity),e.frequency!=null&&n.frequency!=e.frequency&&(n.frequency=e.frequency),e.waveVelocity!=null&&n.animationSpeed!=e.waveVelocity&&(n.animationSpeed=e.waveVelocity),e.amplitude!=null&&n.amplitude!=e.amplitude&&(n.amplitude=e.amplitude),e.flowSpeed!=null&&n.flowSpeed!=e.flowSpeed&&(n.flowSpeed=e.flowSpeed),n.baseWaterImage=e.waterImage,n.stRotation=e.flowDirection}};v(Tl,"type",Tl.register("ESCesiumViewer",a.ESGeoWater.type,Tl));let Xp=Tl;const Ml=class Ml extends Jt{constructor(e,n){super(e,n);v(this,"_czmImagery");if(this._czmImagery=this.dv(new Ln(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmImagery;this.d(a.track([s,"show"],[e,"show"])),this.d(a.track([s,"zIndex"],[e,"zIndex"])),this.d(a.track([s,"rectangle"],[e,"rectangle"])),this.d(a.track([s,"alpha"],[e,"opacity"])),this.d(a.track([s,"splitDirection"],[e,"splitDirection"])),this.d(a.track([s,"brightness"],[e,"czmBrightness"])),this.d(a.track([s,"contrast"],[e,"czmContrast"])),this.d(a.track([s,"hue"],[e,"czmHue"])),this.d(a.track([s,"saturation"],[e,"czmSaturation"])),this.d(a.track([s,"gamma"],[e,"czmGamma"]));{const r=this.dv(a.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),l=()=>{s.imageryProvider={type:"MVTImageryProvider",url:e.url,accessToken:e.accessToken,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,tileSize:e.tileSize,enablePickFeatures:e.allowPicking,rectangle:e.rectangle,style:e.style,scheme:e.scheme}};l(),this.d(r.don(l))}}get czmImagery(){return this._czmImagery}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmImagery:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):(r.flyTo(e&&e),o.flyOverEvent.emit(n,"over",s),!0):!1}};v(Ml,"type",Ml.register("ESCesiumViewer",fh.type,Ml));let Yp=Ml;class xT extends a.Destroyable{constructor(i,e){super(),this._czmESPipeFence=i,this._sceneObject=e;const n=this._sceneObject,o=this._czmESPipeFence,s=o.czmCustomPrimitive;if(!n.points||n.points.length<2){this.clear(s);return}const r=n.points.length;let l=[],c=[],u=[],d=[],p=[];for(let P=0;P<r-1;P++){const{outlinePionts:C,customPrimitivePoints:S}=this.divideFourPoints(n.points[P],n.points[P+1]);d.push(...S),p.push(...C),u.push(...this.setIndexs(P))}const[f,g,m]=It({originPosition:d[0]},d),y=this.setFaces(f);l.push(...y.flat());const _=this.setTextureCoordinates(n,o);c.push(..._.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(s,g,l,u,c)}divideFourPoints(i,e){const n=a.geoHeading(i,e),o=a.geoDestination(i,this._sceneObject.width/2,90+n),s=a.geoDestination(i,this._sceneObject.width/2,n-90),r=a.geoDestination(e,this._sceneObject.width/2,n-90),l=a.geoDestination(e,this._sceneObject.width/2,90+n),c=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],d=[s[0],s[1],s[2]+this._sceneObject.height/2],p=[s[0],s[1],s[2]-this._sceneObject.height/2],f=[l[0],l[1],l[2]+this._sceneObject.height/2],g=[l[0],l[1],l[2]-this._sceneObject.height/2],m=[r[0],r[1],r[2]+this._sceneObject.height/2],y=[r[0],r[1],r[2]-this._sceneObject.height/2],_=[[c,d],[c,f],[c,u],[u,g]],P=[[u,p],[d,m],[d,p],[p,y]],C=[[f,g],[f,m],[g,y],[m,y]];return{outlinePionts:[..._,...P,...C],customPrimitivePoints:[u,c,d,p,g,f,m,y]}}setIndexs(i){const e=i*16;return[e+1,e+0,e+3,e+1,e+3,e+2,e+5,e+4,e+7,e+6,e+5,e+7,e+9,e+8,e+11,e+9,e+11,e+10,e+13,e+12,e+15,e+13,e+15,e+14]}setFaces(i){const e=[],n=i.length/8;for(let s=0;s<n;s++){const r=i.slice(8*s,8*(s+1));e.push(r)}return[...e.map(s=>[s[4],s[5],s[1],s[0],s[5],s[6],s[2],s[1],s[6],s[7],s[3],s[2],s[7],s[4],s[0],s[3]]).flat()]}getDistances(i,e){const[n]=It({originPosition:i[0]},i),o=n.length,s=n.reduce((c,u,d,p)=>{if(d===0)return c.push(0),c;const f=d-1,g=p[f],m=Math.sqrt((g[0]-u[0])*(g[0]-u[0])+(g[1]-u[1])*(g[1]-u[1]));return c.push(c[f]+m),c},[]),r=s[o-1];return e.distances=r,s.map(c=>c/r)}setTextureCoordinates(i,e){if(!i.points||i.points.length<2)return;const n=this.getDistances(i.points,e),o=[];for(let s=1;s<n.length;s++){let r=[];if(s===n.length-1){const l=[1,0,1,1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}else{const l=[n[s],0,n[s],1,n[s-1],1,n[s-1],0];r=[...l,...l,...l,...l]}o.push(r)}return o}updateCustomPrimitive(i,e,n,o,s){i.modelMatrix=e,i.indexTypedArray=new Uint16Array(o),i.attributes={position:{typedArray:new Float32Array(n),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(s),componentsPerAttribute:2}}}clear(i){i.indexTypedArray=void 0,i.modelMatrix=void 0,i.attributes=void 0}}const Il=class Il extends vt{constructor(e,n){super(e,n);v(this,"_line",this.dv(new be(this.czmViewer,this.sceneObject.id)));v(this,"_czmTexture",this.ad(new ze(this.czmViewer,this.sceneObject.id)));v(this,"_czmCustomPrimitive",this.dv(new De(this.czmViewer,this.sceneObject.id)));v(this,"_distances",this.dv(a.react(0)));if(!n.viewer){console.warn("viewer is undefined!");return}const s=this._czmTexture,r=this._line;this.d(a.bind([r,"positions"],[e,"points"])),this.d(a.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(a.track([this.line,"color"],[e,"strokeColor"])),this.d(a.track([this.line,"width"],[e,"strokeWidth"])),this.d(a.track([this.line,"ground"],[e,"strokeGround"]));{const d=this.dv(a.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new a.ObjResettingWithEvent(d,()=>new xT(this,this.sceneObject)))}{const d=()=>{r.show=e.show&&e.stroked};d();const p=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(p.don(d))}this.bindCustomPrimitive(e);let l="";const c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const d=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?l=u:e.materialMode==="color"?l="":l=c,s.uri=l,l==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
1746
1746
  in vec2 v_st;
1747
1747
  void main()
1748
1748
  {
@@ -1781,7 +1781,7 @@ ${$y}
1781
1781
  {
1782
1782
  v_st = a_st;
1783
1783
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
1784
- }`,n.castShadows=!0,n.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{n.show=e.show&&e.filled};o();const s=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(s.don(o))}return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.line.positions?(oe(s,o,n,this.line.positions,e),!0):!1:!1}};v(Il,"type",Il.register("ESCesiumViewer",a.ESPipeFence.type,Il));let Zp=Il;const Dl=class Dl extends Os{constructor(e,n){super(e,n);v(this,"czmCustomPrimitive");v(this,"czmTexture");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.dv(new De(n,e.id)),r=this.ad(new ze(n,e.id));this.czmCustomPrimitive=s,this.czmTexture=r,this.d(a.track([s,"allowPicking"],[e,"allowPicking"]));const l=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new a.ObjResettingWithEvent(l,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new TT(e,this);s.attributes=void 0}))}};v(Dl,"type",Dl.register("ESCesiumViewer",a.ESPipeline.type,Dl));let Qp=Dl;class TT extends a.Destroyable{constructor(i,e){super(),this._sceneObject=i,this._czmESPipeline=e;const n=this._sceneObject,o=this._czmESPipeline,s=o.czmCustomPrimitive,r=o.czmTexture;if(!s||!r)return;{const u=()=>{s.show=n.show&&n.filled};u();const d=this.dv(a.createNextAnimateFrameEvent(n.showChanged,n.filledChanged));this.d(d.don(u))}const l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{n.materialImage.url!=""?r.uri=typeof n.materialImage.url=="string"?n.materialImage.url:n.materialImage.url.url:n.materialMode==="multipleArrows"||n.materialMode==="blue"?r.uri=c:r.uri=l;const p=a.getDistancesFromPositions(n.points,"GEODESIC"),g=p[p.length-1]/n.materialImage.uDis;s.uniformMap={u_image:{type:"texture",id:r.id},u_stScale:[g,2*Math.PI*n.radius/n.materialImage.vDis],u_speed:[n.speed/n.materialImage.uDis,0],u_color:n.fillColor}};u();const d=this.dv(a.createNextAnimateFrameEvent(n.speedChanged,n.materialImageChanged,n.materialModeChanged,n.fillColorChanged));this.d(d.don(u))}(()=>{if(!n.points||n.points.length>=2&&a.equalsN3(n.points[n.points.length-2],n.points[n.points.length-1]))return;const{position:d,modelMatrix:p,indexes:f,uvCoordinates:g}=this.coordinateTransformation(n.points,n.sides);s.modelMatrix=p,s.attributes={position:{typedArray:new Float32Array(d),componentsPerAttribute:3},st:{typedArray:new Float32Array([...g,...g.reverse()]),componentsPerAttribute:2}},s.indexTypedArray=new Uint16Array([...f,...f.reverse()]),s.fragmentShaderSource=`
1784
+ }`,n.castShadows=!0,n.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{n.show=e.show&&e.filled};o();const s=this.dv(a.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(s.don(o))}return n}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):this.line.positions?(oe(s,o,n,this.line.positions,e),!0):!1:!1}};v(Il,"type",Il.register("ESCesiumViewer",a.ESPipeFence.type,Il));let Zp=Il;const Dl=class Dl extends Os{constructor(e,n){super(e,n);v(this,"czmCustomPrimitive");v(this,"czmTexture");if(!n.viewer){console.warn("viewer is undefined!");return}const s=this.dv(new De(n,e.id)),r=this.ad(new ze(n,e.id));this.czmCustomPrimitive=s,this.czmTexture=r,this.d(a.track([s,"allowPicking"],[e,"allowPicking"]));const l=this.dv(a.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new a.ObjResettingWithEvent(l,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new AT(e,this);s.attributes=void 0}))}};v(Dl,"type",Dl.register("ESCesiumViewer",a.ESPipeline.type,Dl));let Qp=Dl;class AT extends a.Destroyable{constructor(i,e){super(),this._sceneObject=i,this._czmESPipeline=e;const n=this._sceneObject,o=this._czmESPipeline,s=o.czmCustomPrimitive,r=o.czmTexture;if(!s||!r)return;{const u=()=>{s.show=n.show&&n.filled};u();const d=this.dv(a.createNextAnimateFrameEvent(n.showChanged,n.filledChanged));this.d(d.don(u))}const l=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),c=a.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{n.materialImage.url!=""?r.uri=typeof n.materialImage.url=="string"?n.materialImage.url:n.materialImage.url.url:n.materialMode==="multipleArrows"||n.materialMode==="blue"?r.uri=c:r.uri=l;const p=a.getDistancesFromPositions(n.points,"GEODESIC"),g=p[p.length-1]/n.materialImage.uDis;s.uniformMap={u_image:{type:"texture",id:r.id},u_stScale:[g,2*Math.PI*n.radius/n.materialImage.vDis],u_speed:[n.speed/n.materialImage.uDis,0],u_color:n.fillColor}};u();const d=this.dv(a.createNextAnimateFrameEvent(n.speedChanged,n.materialImageChanged,n.materialModeChanged,n.fillColorChanged));this.d(d.don(u))}(()=>{if(!n.points||n.points.length>=2&&a.equalsN3(n.points[n.points.length-2],n.points[n.points.length-1]))return;const{position:d,modelMatrix:p,indexes:f,uvCoordinates:g}=this.coordinateTransformation(n.points,n.sides);s.modelMatrix=p,s.attributes={position:{typedArray:new Float32Array(d),componentsPerAttribute:3},st:{typedArray:new Float32Array([...g,...g.reverse()]),componentsPerAttribute:2}},s.indexTypedArray=new Uint16Array([...f,...f.reverse()]),s.fragmentShaderSource=`
1785
1785
  in vec2 v_st;
1786
1786
  uniform sampler2D u_image;
1787
1787
  uniform vec4 u_color;
@@ -1814,7 +1814,7 @@ ${$y}
1814
1814
  vec4 imageColor = texture(u_image, st);
1815
1815
  out_FragColor = imageColor * u_color;
1816
1816
  }
1817
- `;const z=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:B,max:w}=z;f.setLocalAxisedBoundingBox(B,w)},d=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:g}=a.getMinMaxCorner(e.points),m=f[2]-e.depth;if(!a.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=It({originPosition:g},e.points.map((A,R)=>{let O=[...A];return O[2]=m,O}));u(l,g,x[0],"bottom",!0)}const y=this._interpolationAlongPolygon(e.points.map((x,A)=>h.Cartesian3.fromArray(a.lbhToXyz(x))),e.interpolation),_=await n.getHeightsByLonLats(y.map(x=>[x[0],x[1]]));let P=[];for(let x=0;x<y.length;x++){const A=y[x];P.push([A[0],A[1],_[x]??A[2]],[A[0],A[1],m])}const C=It({originPosition:g},P);let S=this._isClockwise(e.points,n);u(s,g,C[0],"side",S)}else s.attributes=void 0,l.attributes=void 0};d();const p=this.dv(a.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(p.don(d))}{const u=()=>{r.uri=e.sideImage.url,c.uri=e.bottomImage.url,s.uniformMap={u_image:{type:"texture",id:r.id},u_color:[1,1,1,e.opacity]},l.uniformMap={u_image:{type:"texture",id:c.id},u_color:[1,1,1,e.opacity]}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(d.don(u))}}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,n){var o=[];for(let c=0;c<e.length;++c){var s=e[c],r=e[(c+1)%e.length],l=this._interpolationAlongLine(s,r,n);o.push(...l)}return o.push(o[0]),o}_interpolationAlongLine(e,n,o){var s=[],r=h.Cartesian3.distance(e,n),l=h.Cartesian3.subtract(n,e,new h.Cartesian3);l.equals(h.Cartesian3.ZERO)||h.Cartesian3.normalize(l,l);for(var c=0;c<r;){var u=new h.Cartesian3(l.x*c,l.y*c,l.z*c),d=h.Cartesian3.add(e,u,new h.Cartesian3);const p=re(d);p&&s.push(p),c+=o}return s}_isClockwise(e,n){if(n.viewer)for(let o=0;o<e.length;o++){let s=h.Cartesian3.fromDegrees(...e[o]),r=h.Cartesian3.fromDegrees(...e[(o+1)%e.length]),l=h.Cartesian3.fromDegrees(...e[(o+2)%e.length]),c=h.Cartesian3.subtract(r,s,new h.Cartesian3),u=h.Cartesian3.subtract(l,r,new h.Cartesian3);if(c.equals(h.Cartesian3.ZERO)||u.equals(h.Cartesian3.ZERO))return!0;if(h.Cartesian3.normalize(c,c),h.Cartesian3.normalize(u,u),Math.abs(h.Cartesian3.dot(c,u))==1){if(o==e.length-1)return!0;continue}let d=h.Cartesian3.cross(c,u,new h.Cartesian3);return h.Cartesian3.dot(d,n.viewer.camera.directionWC)>0}}_triangleIndices(e){let n=new Uint32Array(e*3);for(let o=0;o<e;++o)n[o*3+0]=o,n[o*3+1]=o%2?(o+2)%e:(o+1)%e,n[o*3+2]=o%2?(o+1)%e:(o+2)%e;return n}_getDistance(e,n){return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}};v(Fl,"type",Fl.register("ESCesiumViewer",a.ESPit.type,Fl));let Jp=Fl;const zl=class zl extends qt{constructor(e,n){super(e,n);v(this,"_czmPolygonPrimitive");v(this,"_geoPolylines");if(this._geoPolylines=this.disposeVar(new pi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}{const r=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};r(),this.ad(this.sceneObject.showChanged.don(r))}const s=this._geoPolylines;s.arcType="GEODESIC",this._czmPolygonPrimitive=this.ad(new a.ObjResettingWithEvent(e.fillGroundChanged,()=>e.fillGround?new IT(e,n):new MT(e,n))),this.ad(a.track([s,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}{const r=()=>{if(e.points&&e.points.length>=3&&(s.positions=[[...e.points,e.points[0]]],e.innerRings&&e.innerRings.length>0))for(let c=0;c<e.innerRings.length;c++){const u=e.innerRings[c];s.positions.push([...u,u[0]])}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>r()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(zl,"type",zl.register("ESCesiumViewer",a.ESPolygonWithHole.type,zl));let jp=zl;class MT extends a.Destroyable{constructor(i,e){super();const n=this.ad(new bn(e,i.id));this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"]));{n.perPositionHeight=!0;const o=()=>{n.show=i.show&&i.filled,n.material={type:"Color",color:i.fillColor}};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.filledChanged,i.fillColorChanged));this.dispose(s.don(o))}{const o=()=>{const r={positions:[],holes:[]};if(i.points&&i.points.length>=3){if(r.positions=i.points,i.innerRings&&i.innerRings.length>0)for(let l=0;l<i.innerRings.length;l++){const c=i.innerRings[l];r.holes.push({positions:c})}n.polygonHierarchy=r}else n.polygonHierarchy=r};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.pointsChanged,i.innerRingsChanged));this.dispose(s.disposableOn(()=>o()))}}}class IT extends a.Destroyable{constructor(i,e){super();const n=this.ad(new uo(e,i.id));this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"]));{n.perPositionHeight=!0;const o=()=>{n.show=i.show&&i.filled,n.material={type:"Color",color:i.fillColor}};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.filledChanged,i.fillColorChanged));this.dispose(s.don(o))}{const o=()=>{const r={positions:[],holes:[]};if(i.points&&i.points.length>=3){if(r.positions=i.points,i.innerRings&&i.innerRings.length>0)for(let l=0;l<i.innerRings.length;l++){const c=i.innerRings[l];r.holes.push({positions:c})}n.polygonHierarchy=r}else n.polygonHierarchy=r};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.pointsChanged,i.innerRingsChanged));this.dispose(s.disposableOn(()=>o()))}}}var yt=63710088e-1,ef={centimeters:yt*100,centimetres:yt*100,degrees:yt/111325,feet:yt*3.28084,inches:yt*39.37,kilometers:yt/1e3,kilometres:yt/1e3,meters:yt,metres:yt,miles:yt/1609.344,millimeters:yt*1e3,millimetres:yt*1e3,nauticalmiles:yt/1852,radians:1,yards:yt*1.0936},DT={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/yt,yards:1.0936133},tf={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 Xt(t,i,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=i||{},n.geometry=t,n}function RT(t,i,e){switch(t){case"Point":return ht(i).geometry;case"LineString":return oi(i).geometry;case"Polygon":return it(i).geometry;case"MultiPoint":return qy(i).geometry;case"MultiLineString":return nf(i).geometry;case"MultiPolygon":return of(i).geometry;default:throw new Error(t+" is invalid")}}function ht(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!bh(t[0])||!bh(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Xt(n,i,e)}function FT(t,i,e){return e===void 0&&(e={}),Ot(t.map(function(n){return ht(n,i)}),e)}function it(t,i,e){e===void 0&&(e={});for(var n=0,o=t;n<o.length;n++){var s=o[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var r=0;r<s[s.length-1].length;r++)if(s[s.length-1][r]!==s[0][r])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:t};return Xt(l,i,e)}function zT(t,i,e){return e===void 0&&(e={}),Ot(t.map(function(n){return it(n,i)}),e)}function oi(t,i,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Xt(n,i,e)}function LT(t,i,e){return e===void 0&&(e={}),Ot(t.map(function(n){return oi(n,i)}),e)}function Ot(t,i){i===void 0&&(i={});var e={type:"FeatureCollection"};return i.id&&(e.id=i.id),i.bbox&&(e.bbox=i.bbox),e.features=t,e}function nf(t,i,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:t};return Xt(n,i,e)}function qy(t,i,e){e===void 0&&(e={});var n={type:"MultiPoint",coordinates:t};return Xt(n,i,e)}function of(t,i,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:t};return Xt(n,i,e)}function OT(t,i,e){e===void 0&&(e={});var n={type:"GeometryCollection",geometries:t};return Xt(n,i,e)}function NT(t,i){if(i===void 0&&(i=0),i&&!(i>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,i||0);return Math.round(t*e)/e}function sf(t,i){i===void 0&&(i="kilometers");var e=ef[i];if(!e)throw new Error(i+" units is invalid");return t*e}function rf(t,i){i===void 0&&(i="kilometers");var e=ef[i];if(!e)throw new Error(i+" units is invalid");return t/e}function BT(t,i){return Xy(rf(t,i))}function VT(t){var i=t%360;return i<0&&(i+=360),i}function Xy(t){var i=t%(2*Math.PI);return i*180/Math.PI}function Kr(t){var i=t%360;return i*Math.PI/180}function UT(t,i,e){if(i===void 0&&(i="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return sf(rf(t,i),e)}function WT(t,i,e){if(i===void 0&&(i="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=tf[i];if(!n)throw new Error("invalid original units");var o=tf[e];if(!o)throw new Error("invalid final units");return t/n*o}function bh(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function af(t){return!!t&&t.constructor===Object}function GT(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(i){if(!bh(i))throw new Error("bbox must only contain numbers")})}function HT(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const $T=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:tf,bearingToAzimuth:VT,convertArea:WT,convertLength:UT,degreesToRadians:Kr,earthRadius:yt,factors:ef,feature:Xt,featureCollection:Ot,geometry:RT,geometryCollection:OT,isNumber:bh,isObject:af,lengthToDegrees:BT,lengthToRadians:rf,lineString:oi,lineStrings:LT,multiLineString:nf,multiPoint:qy,multiPolygon:of,point:ht,points:FT,polygon:it,polygons:zT,radiansToDegrees:Xy,radiansToLength:sf,round:NT,unitsFactors:DT,validateBBox:GT,validateId:HT},Symbol.toStringTag,{value:"Module"}));function Sh(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ii(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function qT(t,i,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var n=0,o=t.features;n<o.length;n++){var s=o[n];if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==i)throw new Error("Invalid input to "+e+": must be a "+i+", given "+s.geometry.type)}}function Di(t){return t.type==="Feature"?t.geometry:t}function XT(t,i){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Ri(t,i,e){e===void 0&&(e={});var n=Sh(t),o=Sh(i),s=Kr(o[1]-n[1]),r=Kr(o[0]-n[0]),l=Kr(n[1]),c=Kr(o[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(r/2),2)*Math.cos(l)*Math.cos(c);return sf(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Fo(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 A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){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++,A==="MultiPoint"&&S++}A==="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++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="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(Fo(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function YT(t,i,e,n){var o=e;return Fo(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 Yy(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 ZT(t,i,e){var n=e;return Yy(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function Us(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 QT(t,i,e){var n=e;return Us(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function kT(t){var i=[];return Fo(t,function(e){i.push(e)}),i}function lf(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 KT(t,i,e){var n=e;return lf(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function ji(t,i){lf(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(Xt(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(Xt(p,o),n,u)===!1)return!1}})}function JT(t,i,e){var n=e;return ji(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function Zy(t,i){ji(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(Fo(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 _=oi([l,p],e.properties);if(i(_,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function Qy(t,i,e){var n=e,o=!1;return Zy(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 ky(t,i){if(!t)throw new Error("geojson is required");ji(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(oi(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function jT(t,i,e){var n=e;return ky(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function eM(t,i){if(i=i||{},!af(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),oi([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),oi([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),oi([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),oi([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function tM(t,i){if(i=i||{},!af(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 ht(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),ht(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),ht(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),ht(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),ht(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),ht(c[n][o][s],r,i)}throw new Error("geojson is invalid")}const iM=Object.freeze(Object.defineProperty({__proto__:null,coordAll:kT,coordEach:Fo,coordReduce:YT,featureEach:Us,featureReduce:QT,findPoint:tM,findSegment:eM,flattenEach:ji,flattenReduce:JT,geomEach:lf,geomReduce:KT,lineEach:ky,lineReduce:jT,propEach:Yy,propReduce:ZT,segmentEach:Zy,segmentReduce:Qy},Symbol.toStringTag,{value:"Module"}));function nM(t,i){return i===void 0&&(i={}),Qy(t,function(e,n){var o=n.geometry.coordinates;return e+Ri(o[0],o[1],i)},0)}function oM(t){var i=oi(t),e=nM(i,{units:"meters"});return e}function*sM(t){t.type==="FeatureCollection"?yield*t.features.map(i=>[i.geometry,i]):t.type==="Feature"&&(yield[t.geometry,t])}function*rM(t){for(const[i,e]of sM(t))if(i.type==="LineString")yield[i.coordinates,e];else if(i.type==="MultiLineString")for(let n of i.coordinates)yield[n,e]}function aM(t,i,e){return[...rM(t)].map(([n,o])=>{if(n.length<2)return;const s=n.map(c=>[c[0],c[1],c[2]??0]),l=oM(s)/e;return{positions:s,repeat:l,width:i,extra:{geojson:{feature:o}}}}).filter(n=>!!n)}const Jr=h.ArcType,lM=h.arrayRemoveDuplicates,cM=h.BoundingSphere,Qe=h.Cartesian3,Nt=h.Color,Ws=h.ComponentDatatype,hM=h.Frozen,Yt=h.defined,Gs=h.DeveloperError,Fi=h.Ellipsoid,uM=h.Geometry,Hs=h.GeometryAttribute,dM=h.GeometryAttributes,pM=h.GeometryType,fM=h.IndexDatatype,Ky=h.Math,jr=h.PolylinePipeline,gM=h.PrimitiveType,en=h.VertexFormat;var Jy=[];function mM(t,i,e,n,o){var s=Jy;s.length=o;var r,l=e.red,c=e.green,u=e.blue,d=e.alpha,p=n.red,f=n.green,g=n.blue,m=n.alpha;if(Nt.equals(e,n)){for(r=0;r<o;r++)s[r]=Nt.clone(e);return s}var y=(p-l)/o,_=(f-c)/o,P=(g-u)/o,C=(m-d)/o;for(r=0;r<o;r++)s[r]=new Nt(l+r*y,c+r*_,u+r*P,d+r*C);return s}function $s(t){t=t??hM.EMPTY_OBJECT;var i=t.positions,e=t.colors,n=t.width??1,o=t.colorsPerVertex??!1;if(!Yt(i)||i.length<2)throw new Gs("At least two positions are required.");if(typeof n!="number")throw new Gs("width must be a number");if(Yt(e)&&(o&&e.length<i.length||!o&&e.length<i.length-1))throw new Gs("colors has an invalid length.");this._positions=i,this._colors=e,this._width=n,this._colorsPerVertex=o,this._vertexFormat=en.clone(t.vertexFormat??en.DEFAULT),this._arcType=t.arcType??Jr.GEODESIC,this._granularity=t.granularity??Ky.RADIANS_PER_DEGREE,this._ellipsoid=Fi.clone(t.ellipsoid??Fi.WGS84),this._workerName="createPolylineGeometry";var s=1+i.length*Qe.packedLength;s+=Yt(e)?1+e.length*Nt.packedLength:1,this.packedLength=s+Fi.packedLength+en.packedLength+4}$s.pack=function(t,i,e){if(!Yt(t))throw new Gs("value is required");if(!Yt(i))throw new Gs("array is required");e=e??0;var n,o=t._positions,s=o.length;for(i[e++]=s,n=0;n<s;++n,e+=Qe.packedLength)Qe.pack(o[n],i,e);var r=t._colors;for(s=Yt(r)?r.length:0,i[e++]=s,n=0;n<s;++n,e+=Nt.packedLength)Nt.pack(r[n],i,e);return Fi.pack(t._ellipsoid,i,e),e+=Fi.packedLength,en.pack(t._vertexFormat,i,e),e+=en.packedLength,i[e++]=t._width,i[e++]=t._colorsPerVertex?1:0,i[e++]=t._arcType,i[e]=t._granularity,i};var jy=Fi.clone(Fi.UNIT_SPHERE),e0=new en,zo={positions:void 0,colors:void 0,ellipsoid:jy,vertexFormat:e0,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};$s.unpack=function(t,i,e){if(!Yt(t))throw new Gs("array is required");i=i??0;var n,o=t[i++],s=new Array(o);for(n=0;n<o;++n,i+=Qe.packedLength)s[n]=Qe.unpack(t,i);o=t[i++];var r=o>0?new Array(o):void 0;for(n=0;n<o;++n,i+=Nt.packedLength)r[n]=Nt.unpack(t,i);var l=Fi.unpack(t,i,jy);i+=Fi.packedLength;var c=en.unpack(t,i,e0);i+=en.packedLength;var u=t[i++],d=t[i++]===1,p=t[i++],f=t[i];return Yt(e)?(e._positions=s,e._colors=r,e._ellipsoid=Fi.clone(l,e._ellipsoid),e._vertexFormat=en.clone(c,e._vertexFormat),e._width=u,e._colorsPerVertex=d,e._arcType=p,e._granularity=f,e):(zo.positions=s,zo.colors=r,zo.width=u,zo.colorsPerVertex=d,zo.arcType=p,zo.granularity=f,new $s(zo))};var t0=new Qe,i0=new Qe,n0=new Qe,o0=new Qe;$s.createGeometry=function(t){var i=t._width,e=t._vertexFormat,n=t._colors,o=t._colorsPerVertex,s=t._arcType,r=t._granularity,l=t._ellipsoid,c,u,d,p=lM(t._positions,Qe.equalsEpsilon),f=p.length;if(f<2||i<=0)return;if(s===Jr.GEODESIC||s===Jr.RHUMB){var g,m;s===Jr.GEODESIC?(g=Ky.chordLength(r,l.maximumRadius),m=jr.numberOfPoints):(g=r,m=jr.numberOfPointsRhumbLine);var y=jr.extractHeights(p,l);if(Yt(n)){var _=1;for(c=0;c<f-1;++c)_+=m(p[c],p[c+1],g);var P=new Array(_),C=0;for(c=0;c<f-1;++c){var S=p[c],x=p[c+1],A=n[c],R=m(S,x,g);if(o&&c<_){var O=n[c+1],N=mM(S,x,A,O,R),V=N.length;for(u=0;u<V;++u)P[C++]=N[u]}else for(u=0;u<R;++u)P[C++]=Nt.clone(A)}P[C]=Nt.clone(n[n.length-1]),n=P,Jy.length=0}s===Jr.GEODESIC?p=jr.generateCartesianArc({positions:p,minDistance:g,ellipsoid:l,height:y}):p=jr.generateCartesianRhumbArc({positions:p,granularity:g,ellipsoid:l,height:y})}f=p.length;var U=f*4-4,z=new Float64Array(U*3),B=new Float64Array(U*3),w=new Float64Array(U*3),E=new Float32Array(U*2),D=e.st?new Float32Array(U*2):void 0,L=Yt(n)?new Uint8Array(U*4):void 0,G=0,Y=0,q=0,X=0,Q;let ee=[0];{for(c=0;c<f-1;c++){const Ut=h.Cartesian3.distance(p[c],p[c+1]);ee.push(ee[ee.length-1]+Ut)}ee=ee.map(Ut=>Ut/ee[ee.length-1])}for(u=0;u<f;++u){u===0?(Q=t0,Qe.subtract(p[0],p[1],Q),Qe.add(p[0],Q,Q)):Q=p[u-1],Qe.clone(Q,n0),Qe.clone(p[u],i0),u===f-1?(Q=t0,Qe.subtract(p[f-1],p[f-2],Q),Qe.add(p[f-1],Q,Q)):Q=p[u+1],Qe.clone(Q,o0);var he,ge;Yt(L)&&(u!==0&&!o?he=n[u-1]:he=n[u],u!==f-1&&(ge=n[u]));var ve=u===0?2:0,xe=u===f-1?2:4;for(d=ve;d<xe;++d){Qe.pack(i0,z,G),Qe.pack(n0,B,G),Qe.pack(o0,w,G),G+=3;var Ue=d-2<0?-1:1;if(E[Y++]=2*(d%2)-1,E[Y++]=Ue*i,e.st&&(D[q++]=ee[u],D[q++]=Math.max(E[Y-2],0)),Yt(L)){var qe=d<2?he:ge;L[X++]=Nt.floatToByte(qe.red),L[X++]=Nt.floatToByte(qe.green),L[X++]=Nt.floatToByte(qe.blue),L[X++]=Nt.floatToByte(qe.alpha)}}}var Me=new dM;Me.position=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:z}),Me.prevPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:B}),Me.nextPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:w}),Me.expandAndWidth=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:E}),e.st&&(Me.st=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:D})),Yt(L)&&(Me.color=new Hs({componentDatatype:Ws.UNSIGNED_BYTE,componentsPerAttribute:4,values:L,normalize:!0}));var ue=fM.createTypedArray(U,f*6-6),Fe=0,Ze=0,At=f-1;for(u=0;u<At;++u)ue[Ze++]=Fe,ue[Ze++]=Fe+2,ue[Ze++]=Fe+1,ue[Ze++]=Fe+1,ue[Ze++]=Fe+2,ue[Ze++]=Fe+3,Fe+=4;return new uM({attributes:Me,indices:ue,primitiveType:gM.TRIANGLES,boundingSphere:cM.fromPoints(p),geometryType:pM.POLYLINES})};var cf;function vM(){return typeof cf>"u"&&(cf=new h.EllipsoidGeodesic),cf}function yM(t,i){var e=i/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function wM(t,i,e,n=1){var o=vM(),s=h.Cartesian3.fromDegreesArray([t[0],t[1],i[0],i[1]]),r=[0,0];t.length>=3&&i.length>=3&&(r=[t[2],i[2]]);var l=h.Cartographic.fromDegrees(t[0],t[1]),c=h.Cartographic.fromDegrees(i[0],i[1]);o.setEndPoints(l,c);var u=o.surfaceDistance,d=h.PolylinePipeline.generateCartesianArc({positions:s,height:r,minDistance:u/36}),p=d.length;return d.forEach(function(f,g){var m=g/(p-1),y=yM(m,u*n),_=h.Cartographic.fromCartesian(f);_.height+=y,h.Cartesian3.fromRadians(_.longitude,_.latitude,_.height,h.Ellipsoid.WGS84,d[g])}),d}function CM(t=[.8,.8,0,1],i=!0,e=!0,n){var o;const s=n?{type:"Image",uniforms:{color:new h.Color(...t)}}:{type:"Color",uniforms:{color:new h.Color(...t)}};i?(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!1}),translucent:!1}),o.renderState.blending=h.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n)):(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!0})}),o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n));var r=h.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),l=`out vec4 v_twp;
1817
+ `;const z=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:B,max:w}=z;f.setLocalAxisedBoundingBox(B,w)},d=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:g}=a.getMinMaxCorner(e.points),m=f[2]-e.depth;if(!a.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=It({originPosition:g},e.points.map((A,R)=>{let O=[...A];return O[2]=m,O}));u(l,g,x[0],"bottom",!0)}const y=this._interpolationAlongPolygon(e.points.map((x,A)=>h.Cartesian3.fromArray(a.lbhToXyz(x))),e.interpolation),_=await n.getHeightsByLonLats(y.map(x=>[x[0],x[1]]));let P=[];for(let x=0;x<y.length;x++){const A=y[x];P.push([A[0],A[1],_[x]??A[2]],[A[0],A[1],m])}const C=It({originPosition:g},P);let S=this._isClockwise(e.points,n);u(s,g,C[0],"side",S)}else s.attributes=void 0,l.attributes=void 0};d();const p=this.dv(a.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(p.don(d))}{const u=()=>{r.uri=e.sideImage.url,c.uri=e.bottomImage.url,s.uniformMap={u_image:{type:"texture",id:r.id},u_color:[1,1,1,e.opacity]},l.uniformMap={u_image:{type:"texture",id:c.id},u_color:[1,1,1,e.opacity]}};u();const d=this.ad(a.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(d.don(u))}}flyTo(e,n){const{sceneObject:o,czmViewer:s}=this;return s.actived?o.flyToParam||o.flyInParam?super.flyTo(e,n):o.points?(oe(s,o,n,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,n){var o=[];for(let c=0;c<e.length;++c){var s=e[c],r=e[(c+1)%e.length],l=this._interpolationAlongLine(s,r,n);o.push(...l)}return o.push(o[0]),o}_interpolationAlongLine(e,n,o){var s=[],r=h.Cartesian3.distance(e,n),l=h.Cartesian3.subtract(n,e,new h.Cartesian3);l.equals(h.Cartesian3.ZERO)||h.Cartesian3.normalize(l,l);for(var c=0;c<r;){var u=new h.Cartesian3(l.x*c,l.y*c,l.z*c),d=h.Cartesian3.add(e,u,new h.Cartesian3);const p=re(d);p&&s.push(p),c+=o}return s}_isClockwise(e,n){if(n.viewer)for(let o=0;o<e.length;o++){let s=h.Cartesian3.fromDegrees(...e[o]),r=h.Cartesian3.fromDegrees(...e[(o+1)%e.length]),l=h.Cartesian3.fromDegrees(...e[(o+2)%e.length]),c=h.Cartesian3.subtract(r,s,new h.Cartesian3),u=h.Cartesian3.subtract(l,r,new h.Cartesian3);if(c.equals(h.Cartesian3.ZERO)||u.equals(h.Cartesian3.ZERO))return!0;if(h.Cartesian3.normalize(c,c),h.Cartesian3.normalize(u,u),Math.abs(h.Cartesian3.dot(c,u))==1){if(o==e.length-1)return!0;continue}let d=h.Cartesian3.cross(c,u,new h.Cartesian3);return h.Cartesian3.dot(d,n.viewer.camera.directionWC)>0}}_triangleIndices(e){let n=new Uint32Array(e*3);for(let o=0;o<e;++o)n[o*3+0]=o,n[o*3+1]=o%2?(o+2)%e:(o+1)%e,n[o*3+2]=o%2?(o+1)%e:(o+2)%e;return n}_getDistance(e,n){return Math.sqrt(Math.pow(e[0]-n[0],2)+Math.pow(e[1]-n[1],2))}};v(Fl,"type",Fl.register("ESCesiumViewer",a.ESPit.type,Fl));let Jp=Fl;const zl=class zl extends qt{constructor(e,n){super(e,n);v(this,"_czmPolygonPrimitive");v(this,"_geoPolylines");if(this._geoPolylines=this.disposeVar(new pi(n,e.id)),!n.viewer){console.warn("viewer is undefined!");return}{const r=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};r(),this.ad(this.sceneObject.showChanged.don(r))}const s=this._geoPolylines;s.arcType="GEODESIC",this._czmPolygonPrimitive=this.ad(new a.ObjResettingWithEvent(e.fillGroundChanged,()=>e.fillGround?new MT(e,n):new TT(e,n))),this.ad(a.track([s,"ground"],[e,"strokeGround"])),this.dispose(a.track([s,"allowPicking"],[e,"allowPicking"])),this.dispose(a.track([s,"color"],[e,"strokeColor"])),this.dispose(a.track([s,"width"],[e,"strokeWidth"]));{const r=()=>{s.show=e.show&&e.stroked};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(l.don(r))}{const r=()=>{if(e.points&&e.points.length>=3&&(s.positions=[[...e.points,e.points[0]]],e.innerRings&&e.innerRings.length>0))for(let c=0;c<e.innerRings.length;c++){const u=e.innerRings[c];s.positions.push([...u,u[0]])}};r();const l=this.disposeVar(a.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>r()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive: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}flyIn(e,n){const{sceneObject:o,czmViewer:s,czmPolygonPrimitive:r}=this;return s.actived?o.flyInParam?super.flyIn(e,n):r.positions?(oe(s,o,n,r.positions,e),!0):!1:!1}};v(zl,"type",zl.register("ESCesiumViewer",a.ESPolygonWithHole.type,zl));let jp=zl;class TT extends a.Destroyable{constructor(i,e){super();const n=this.ad(new bn(e,i.id));this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"]));{n.perPositionHeight=!0;const o=()=>{n.show=i.show&&i.filled,n.material={type:"Color",color:i.fillColor}};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.filledChanged,i.fillColorChanged));this.dispose(s.don(o))}{const o=()=>{const r={positions:[],holes:[]};if(i.points&&i.points.length>=3){if(r.positions=i.points,i.innerRings&&i.innerRings.length>0)for(let l=0;l<i.innerRings.length;l++){const c=i.innerRings[l];r.holes.push({positions:c})}n.polygonHierarchy=r}else n.polygonHierarchy=r};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.pointsChanged,i.innerRingsChanged));this.dispose(s.disposableOn(()=>o()))}}}class MT extends a.Destroyable{constructor(i,e){super();const n=this.ad(new uo(e,i.id));this.dispose(a.track([n,"allowPicking"],[i,"allowPicking"]));{n.perPositionHeight=!0;const o=()=>{n.show=i.show&&i.filled,n.material={type:"Color",color:i.fillColor}};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.showChanged,i.filledChanged,i.fillColorChanged));this.dispose(s.don(o))}{const o=()=>{const r={positions:[],holes:[]};if(i.points&&i.points.length>=3){if(r.positions=i.points,i.innerRings&&i.innerRings.length>0)for(let l=0;l<i.innerRings.length;l++){const c=i.innerRings[l];r.holes.push({positions:c})}n.polygonHierarchy=r}else n.polygonHierarchy=r};o();const s=this.disposeVar(a.createNextAnimateFrameEvent(i.pointsChanged,i.innerRingsChanged));this.dispose(s.disposableOn(()=>o()))}}}var yt=63710088e-1,ef={centimeters:yt*100,centimetres:yt*100,degrees:yt/111325,feet:yt*3.28084,inches:yt*39.37,kilometers:yt/1e3,kilometres:yt/1e3,meters:yt,metres:yt,miles:yt/1609.344,millimeters:yt*1e3,millimetres:yt*1e3,nauticalmiles:yt/1852,radians:1,yards:yt*1.0936},IT={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/yt,yards:1.0936133},tf={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 Xt(t,i,e){e===void 0&&(e={});var n={type:"Feature"};return(e.id===0||e.id)&&(n.id=e.id),e.bbox&&(n.bbox=e.bbox),n.properties=i||{},n.geometry=t,n}function DT(t,i,e){switch(t){case"Point":return ht(i).geometry;case"LineString":return oi(i).geometry;case"Polygon":return it(i).geometry;case"MultiPoint":return qy(i).geometry;case"MultiLineString":return nf(i).geometry;case"MultiPolygon":return of(i).geometry;default:throw new Error(t+" is invalid")}}function ht(t,i,e){if(e===void 0&&(e={}),!t)throw new Error("coordinates is required");if(!Array.isArray(t))throw new Error("coordinates must be an Array");if(t.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!bh(t[0])||!bh(t[1]))throw new Error("coordinates must contain numbers");var n={type:"Point",coordinates:t};return Xt(n,i,e)}function RT(t,i,e){return e===void 0&&(e={}),Ot(t.map(function(n){return ht(n,i)}),e)}function it(t,i,e){e===void 0&&(e={});for(var n=0,o=t;n<o.length;n++){var s=o[n];if(s.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var r=0;r<s[s.length-1].length;r++)if(s[s.length-1][r]!==s[0][r])throw new Error("First and last Position are not equivalent.")}var l={type:"Polygon",coordinates:t};return Xt(l,i,e)}function FT(t,i,e){return e===void 0&&(e={}),Ot(t.map(function(n){return it(n,i)}),e)}function oi(t,i,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var n={type:"LineString",coordinates:t};return Xt(n,i,e)}function zT(t,i,e){return e===void 0&&(e={}),Ot(t.map(function(n){return oi(n,i)}),e)}function Ot(t,i){i===void 0&&(i={});var e={type:"FeatureCollection"};return i.id&&(e.id=i.id),i.bbox&&(e.bbox=i.bbox),e.features=t,e}function nf(t,i,e){e===void 0&&(e={});var n={type:"MultiLineString",coordinates:t};return Xt(n,i,e)}function qy(t,i,e){e===void 0&&(e={});var n={type:"MultiPoint",coordinates:t};return Xt(n,i,e)}function of(t,i,e){e===void 0&&(e={});var n={type:"MultiPolygon",coordinates:t};return Xt(n,i,e)}function LT(t,i,e){e===void 0&&(e={});var n={type:"GeometryCollection",geometries:t};return Xt(n,i,e)}function OT(t,i){if(i===void 0&&(i=0),i&&!(i>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,i||0);return Math.round(t*e)/e}function sf(t,i){i===void 0&&(i="kilometers");var e=ef[i];if(!e)throw new Error(i+" units is invalid");return t*e}function rf(t,i){i===void 0&&(i="kilometers");var e=ef[i];if(!e)throw new Error(i+" units is invalid");return t/e}function NT(t,i){return Xy(rf(t,i))}function BT(t){var i=t%360;return i<0&&(i+=360),i}function Xy(t){var i=t%(2*Math.PI);return i*180/Math.PI}function Kr(t){var i=t%360;return i*Math.PI/180}function VT(t,i,e){if(i===void 0&&(i="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return sf(rf(t,i),e)}function UT(t,i,e){if(i===void 0&&(i="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var n=tf[i];if(!n)throw new Error("invalid original units");var o=tf[e];if(!o)throw new Error("invalid final units");return t/n*o}function bh(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function af(t){return!!t&&t.constructor===Object}function WT(t){if(!t)throw new Error("bbox is required");if(!Array.isArray(t))throw new Error("bbox must be an Array");if(t.length!==4&&t.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");t.forEach(function(i){if(!bh(i))throw new Error("bbox must only contain numbers")})}function GT(t){if(!t)throw new Error("id is required");if(["string","number"].indexOf(typeof t)===-1)throw new Error("id must be a number or a string")}const HT=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:tf,bearingToAzimuth:BT,convertArea:UT,convertLength:VT,degreesToRadians:Kr,earthRadius:yt,factors:ef,feature:Xt,featureCollection:Ot,geometry:DT,geometryCollection:LT,isNumber:bh,isObject:af,lengthToDegrees:NT,lengthToRadians:rf,lineString:oi,lineStrings:zT,multiLineString:nf,multiPoint:qy,multiPolygon:of,point:ht,points:RT,polygon:it,polygons:FT,radiansToDegrees:Xy,radiansToLength:sf,round:OT,unitsFactors:IT,validateBBox:WT,validateId:GT},Symbol.toStringTag,{value:"Module"}));function Sh(t){if(!t)throw new Error("coord is required");if(!Array.isArray(t)){if(t.type==="Feature"&&t.geometry!==null&&t.geometry.type==="Point")return t.geometry.coordinates;if(t.type==="Point")return t.coordinates}if(Array.isArray(t)&&t.length>=2&&!Array.isArray(t[0])&&!Array.isArray(t[1]))return t;throw new Error("coord must be GeoJSON Point or an Array of numbers")}function Ii(t){if(Array.isArray(t))return t;if(t.type==="Feature"){if(t.geometry!==null)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function $T(t,i,e){if(!t)throw new Error("No featureCollection passed");if(!t||t.type!=="FeatureCollection")throw new Error("Invalid input to "+e+", FeatureCollection required");for(var n=0,o=t.features;n<o.length;n++){var s=o[n];if(!s||s.type!=="Feature"||!s.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!s.geometry||s.geometry.type!==i)throw new Error("Invalid input to "+e+": must be a "+i+", given "+s.geometry.type)}}function Di(t){return t.type==="Feature"?t.geometry:t}function qT(t,i){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Ri(t,i,e){e===void 0&&(e={});var n=Sh(t),o=Sh(i),s=Kr(o[1]-n[1]),r=Kr(o[0]-n[0]),l=Kr(n[1]),c=Kr(o[1]),u=Math.pow(Math.sin(s/2),2)+Math.pow(Math.sin(r/2),2)*Math.cos(l)*Math.cos(c);return sf(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Fo(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 A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){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++,A==="MultiPoint"&&S++}A==="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++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="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(Fo(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function XT(t,i,e,n){var o=e;return Fo(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 Yy(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 YT(t,i,e){var n=e;return Yy(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function Us(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 ZT(t,i,e){var n=e;return Us(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function QT(t){var i=[];return Fo(t,function(e){i.push(e)}),i}function lf(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 kT(t,i,e){var n=e;return lf(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function ji(t,i){lf(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(Xt(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(Xt(p,o),n,u)===!1)return!1}})}function KT(t,i,e){var n=e;return ji(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function Zy(t,i){ji(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(Fo(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 _=oi([l,p],e.properties);if(i(_,n,o,y,s)===!1)return!1;s++,l=p})===!1)return!1}}})}function Qy(t,i,e){var n=e,o=!1;return Zy(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 ky(t,i){if(!t)throw new Error("geojson is required");ji(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(oi(r[l],e.properties),n,o,l)===!1)return!1;break}}})}function JT(t,i,e){var n=e;return ky(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function jT(t,i){if(i=i||{},!af(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),oi([c[s],c[s+1]],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s-1),oi([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),oi([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),oi([c[n][o][s],c[n][o][s+1]],r,i)}throw new Error("geojson is invalid")}function eM(t,i){if(i=i||{},!af(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 ht(c,r,i);case"MultiPoint":return n<0&&(n=c.length+n),ht(c[n],r,i);case"LineString":return s<0&&(s=c.length+s),ht(c[s],r,i);case"Polygon":return o<0&&(o=c.length+o),s<0&&(s=c[o].length+s),ht(c[o][s],r,i);case"MultiLineString":return n<0&&(n=c.length+n),s<0&&(s=c[n].length+s),ht(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),ht(c[n][o][s],r,i)}throw new Error("geojson is invalid")}const tM=Object.freeze(Object.defineProperty({__proto__:null,coordAll:QT,coordEach:Fo,coordReduce:XT,featureEach:Us,featureReduce:ZT,findPoint:eM,findSegment:jT,flattenEach:ji,flattenReduce:KT,geomEach:lf,geomReduce:kT,lineEach:ky,lineReduce:JT,propEach:Yy,propReduce:YT,segmentEach:Zy,segmentReduce:Qy},Symbol.toStringTag,{value:"Module"}));function iM(t,i){return i===void 0&&(i={}),Qy(t,function(e,n){var o=n.geometry.coordinates;return e+Ri(o[0],o[1],i)},0)}function nM(t){var i=oi(t),e=iM(i,{units:"meters"});return e}function*oM(t){t.type==="FeatureCollection"?yield*t.features.map(i=>[i.geometry,i]):t.type==="Feature"&&(yield[t.geometry,t])}function*sM(t){for(const[i,e]of oM(t))if(i.type==="LineString")yield[i.coordinates,e];else if(i.type==="MultiLineString")for(let n of i.coordinates)yield[n,e]}function rM(t,i,e){return[...sM(t)].map(([n,o])=>{if(n.length<2)return;const s=n.map(c=>[c[0],c[1],c[2]??0]),l=nM(s)/e;return{positions:s,repeat:l,width:i,extra:{geojson:{feature:o}}}}).filter(n=>!!n)}const Jr=h.ArcType,aM=h.arrayRemoveDuplicates,lM=h.BoundingSphere,Qe=h.Cartesian3,Nt=h.Color,Ws=h.ComponentDatatype,cM=h.Frozen,Yt=h.defined,Gs=h.DeveloperError,Fi=h.Ellipsoid,hM=h.Geometry,Hs=h.GeometryAttribute,uM=h.GeometryAttributes,dM=h.GeometryType,pM=h.IndexDatatype,Ky=h.Math,jr=h.PolylinePipeline,fM=h.PrimitiveType,en=h.VertexFormat;var Jy=[];function gM(t,i,e,n,o){var s=Jy;s.length=o;var r,l=e.red,c=e.green,u=e.blue,d=e.alpha,p=n.red,f=n.green,g=n.blue,m=n.alpha;if(Nt.equals(e,n)){for(r=0;r<o;r++)s[r]=Nt.clone(e);return s}var y=(p-l)/o,_=(f-c)/o,P=(g-u)/o,C=(m-d)/o;for(r=0;r<o;r++)s[r]=new Nt(l+r*y,c+r*_,u+r*P,d+r*C);return s}function $s(t){t=t??cM.EMPTY_OBJECT;var i=t.positions,e=t.colors,n=t.width??1,o=t.colorsPerVertex??!1;if(!Yt(i)||i.length<2)throw new Gs("At least two positions are required.");if(typeof n!="number")throw new Gs("width must be a number");if(Yt(e)&&(o&&e.length<i.length||!o&&e.length<i.length-1))throw new Gs("colors has an invalid length.");this._positions=i,this._colors=e,this._width=n,this._colorsPerVertex=o,this._vertexFormat=en.clone(t.vertexFormat??en.DEFAULT),this._arcType=t.arcType??Jr.GEODESIC,this._granularity=t.granularity??Ky.RADIANS_PER_DEGREE,this._ellipsoid=Fi.clone(t.ellipsoid??Fi.WGS84),this._workerName="createPolylineGeometry";var s=1+i.length*Qe.packedLength;s+=Yt(e)?1+e.length*Nt.packedLength:1,this.packedLength=s+Fi.packedLength+en.packedLength+4}$s.pack=function(t,i,e){if(!Yt(t))throw new Gs("value is required");if(!Yt(i))throw new Gs("array is required");e=e??0;var n,o=t._positions,s=o.length;for(i[e++]=s,n=0;n<s;++n,e+=Qe.packedLength)Qe.pack(o[n],i,e);var r=t._colors;for(s=Yt(r)?r.length:0,i[e++]=s,n=0;n<s;++n,e+=Nt.packedLength)Nt.pack(r[n],i,e);return Fi.pack(t._ellipsoid,i,e),e+=Fi.packedLength,en.pack(t._vertexFormat,i,e),e+=en.packedLength,i[e++]=t._width,i[e++]=t._colorsPerVertex?1:0,i[e++]=t._arcType,i[e]=t._granularity,i};var jy=Fi.clone(Fi.UNIT_SPHERE),e0=new en,zo={positions:void 0,colors:void 0,ellipsoid:jy,vertexFormat:e0,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};$s.unpack=function(t,i,e){if(!Yt(t))throw new Gs("array is required");i=i??0;var n,o=t[i++],s=new Array(o);for(n=0;n<o;++n,i+=Qe.packedLength)s[n]=Qe.unpack(t,i);o=t[i++];var r=o>0?new Array(o):void 0;for(n=0;n<o;++n,i+=Nt.packedLength)r[n]=Nt.unpack(t,i);var l=Fi.unpack(t,i,jy);i+=Fi.packedLength;var c=en.unpack(t,i,e0);i+=en.packedLength;var u=t[i++],d=t[i++]===1,p=t[i++],f=t[i];return Yt(e)?(e._positions=s,e._colors=r,e._ellipsoid=Fi.clone(l,e._ellipsoid),e._vertexFormat=en.clone(c,e._vertexFormat),e._width=u,e._colorsPerVertex=d,e._arcType=p,e._granularity=f,e):(zo.positions=s,zo.colors=r,zo.width=u,zo.colorsPerVertex=d,zo.arcType=p,zo.granularity=f,new $s(zo))};var t0=new Qe,i0=new Qe,n0=new Qe,o0=new Qe;$s.createGeometry=function(t){var i=t._width,e=t._vertexFormat,n=t._colors,o=t._colorsPerVertex,s=t._arcType,r=t._granularity,l=t._ellipsoid,c,u,d,p=aM(t._positions,Qe.equalsEpsilon),f=p.length;if(f<2||i<=0)return;if(s===Jr.GEODESIC||s===Jr.RHUMB){var g,m;s===Jr.GEODESIC?(g=Ky.chordLength(r,l.maximumRadius),m=jr.numberOfPoints):(g=r,m=jr.numberOfPointsRhumbLine);var y=jr.extractHeights(p,l);if(Yt(n)){var _=1;for(c=0;c<f-1;++c)_+=m(p[c],p[c+1],g);var P=new Array(_),C=0;for(c=0;c<f-1;++c){var S=p[c],x=p[c+1],A=n[c],R=m(S,x,g);if(o&&c<_){var O=n[c+1],N=gM(S,x,A,O,R),V=N.length;for(u=0;u<V;++u)P[C++]=N[u]}else for(u=0;u<R;++u)P[C++]=Nt.clone(A)}P[C]=Nt.clone(n[n.length-1]),n=P,Jy.length=0}s===Jr.GEODESIC?p=jr.generateCartesianArc({positions:p,minDistance:g,ellipsoid:l,height:y}):p=jr.generateCartesianRhumbArc({positions:p,granularity:g,ellipsoid:l,height:y})}f=p.length;var U=f*4-4,z=new Float64Array(U*3),B=new Float64Array(U*3),w=new Float64Array(U*3),E=new Float32Array(U*2),D=e.st?new Float32Array(U*2):void 0,L=Yt(n)?new Uint8Array(U*4):void 0,G=0,Y=0,q=0,X=0,Q;let ee=[0];{for(c=0;c<f-1;c++){const Ut=h.Cartesian3.distance(p[c],p[c+1]);ee.push(ee[ee.length-1]+Ut)}ee=ee.map(Ut=>Ut/ee[ee.length-1])}for(u=0;u<f;++u){u===0?(Q=t0,Qe.subtract(p[0],p[1],Q),Qe.add(p[0],Q,Q)):Q=p[u-1],Qe.clone(Q,n0),Qe.clone(p[u],i0),u===f-1?(Q=t0,Qe.subtract(p[f-1],p[f-2],Q),Qe.add(p[f-1],Q,Q)):Q=p[u+1],Qe.clone(Q,o0);var he,ge;Yt(L)&&(u!==0&&!o?he=n[u-1]:he=n[u],u!==f-1&&(ge=n[u]));var ve=u===0?2:0,xe=u===f-1?2:4;for(d=ve;d<xe;++d){Qe.pack(i0,z,G),Qe.pack(n0,B,G),Qe.pack(o0,w,G),G+=3;var Ue=d-2<0?-1:1;if(E[Y++]=2*(d%2)-1,E[Y++]=Ue*i,e.st&&(D[q++]=ee[u],D[q++]=Math.max(E[Y-2],0)),Yt(L)){var qe=d<2?he:ge;L[X++]=Nt.floatToByte(qe.red),L[X++]=Nt.floatToByte(qe.green),L[X++]=Nt.floatToByte(qe.blue),L[X++]=Nt.floatToByte(qe.alpha)}}}var Me=new uM;Me.position=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:z}),Me.prevPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:B}),Me.nextPosition=new Hs({componentDatatype:Ws.DOUBLE,componentsPerAttribute:3,values:w}),Me.expandAndWidth=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:E}),e.st&&(Me.st=new Hs({componentDatatype:Ws.FLOAT,componentsPerAttribute:2,values:D})),Yt(L)&&(Me.color=new Hs({componentDatatype:Ws.UNSIGNED_BYTE,componentsPerAttribute:4,values:L,normalize:!0}));var ue=pM.createTypedArray(U,f*6-6),Fe=0,Ze=0,At=f-1;for(u=0;u<At;++u)ue[Ze++]=Fe,ue[Ze++]=Fe+2,ue[Ze++]=Fe+1,ue[Ze++]=Fe+1,ue[Ze++]=Fe+2,ue[Ze++]=Fe+3,Fe+=4;return new hM({attributes:Me,indices:ue,primitiveType:fM.TRIANGLES,boundingSphere:lM.fromPoints(p),geometryType:dM.POLYLINES})};var cf;function mM(){return typeof cf>"u"&&(cf=new h.EllipsoidGeodesic),cf}function vM(t,i){var e=i/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function yM(t,i,e,n=1){var o=mM(),s=h.Cartesian3.fromDegreesArray([t[0],t[1],i[0],i[1]]),r=[0,0];t.length>=3&&i.length>=3&&(r=[t[2],i[2]]);var l=h.Cartographic.fromDegrees(t[0],t[1]),c=h.Cartographic.fromDegrees(i[0],i[1]);o.setEndPoints(l,c);var u=o.surfaceDistance,d=h.PolylinePipeline.generateCartesianArc({positions:s,height:r,minDistance:u/36}),p=d.length;return d.forEach(function(f,g){var m=g/(p-1),y=vM(m,u*n),_=h.Cartographic.fromCartesian(f);_.height+=y,h.Cartesian3.fromRadians(_.longitude,_.latitude,_.height,h.Ellipsoid.WGS84,d[g])}),d}function wM(t=[.8,.8,0,1],i=!0,e=!0,n){var o;const s=n?{type:"Image",uniforms:{color:new h.Color(...t)}}:{type:"Color",uniforms:{color:new h.Color(...t)}};i?(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!1}),translucent:!1}),o.renderState.blending=h.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n)):(o=new h.PolylineMaterialAppearance({material:new h.Material({fabric:s,translucent:!0})}),o.getRenderState=function(){const d=h.Appearance.prototype.getRenderState.call(this);return d.depthTest={enabled:e},d.depthMask=!1,d},o.material.type==="Image"&&(o.material._uniforms.image_1=n));var r=h.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),l=`out vec4 v_twp;
1818
1818
  out vec4 v_color;
1819
1819
  out vec4 v_bgColor;
1820
1820
  out float v_expand;
@@ -1840,7 +1840,7 @@ void main()
1840
1840
  {
1841
1841
  czm_twp2_main();
1842
1842
  float t = v_twp.x; float bidirectional = v_twp.z; t *= 1.03; float alpha0 = smoothstep(t - 0.03, t, v_st.s) * step(v_st.s, t); float mt = 1. - t; float alpha1 = smoothstep(mt + 0.03, mt, v_st.s) * step(mt, v_st.s); float a0 = step(abs(bidirectional - 0.0) - 0.001, 0.); float a1 = step(abs(bidirectional - 1.0) - 0.001, 0.); float db = step(abs(bidirectional - 2.0) - 0.001, 0.); float alpha = alpha0 * (a0 + db) + alpha1 * (a1 + db); alpha = clamp(alpha, 0., 1.); out_FragColor.rgb *= (v_color.rgb * alpha + v_bgColor.rgb * (1. - alpha)); out_FragColor.a *= (v_color.a * alpha + v_bgColor.a * (1. - alpha));}`;return o._fragmentShaderSource=c+`
1843
- `+u,o}function _M(t,i,e,n,o,s,r){const l=$s.createGeometry(new $s({positions:i,width:e,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:n}));if(l){s||(s=h.Color.clone(o||h.Color.WHITE),s.alpha=.2);var c=new h.GeometryInstance({geometry:l,id:t,attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(o||h.Color.WHITE),bgColor:h.ColorGeometryInstanceAttribute.fromColor(s),twp:new h.GeometryInstanceAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:r})}});return c}}const Eh=new h.Cartesian4(0,0,0,0),zi=new h.Cartesian4(0,0,0,0),ea={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function PM(t,i,e,n,o=!0,s=!0,r,l){var c=[];try{t.forEach(function(d,p){var f=d.positions&&d.positions.map(O=>h.Cartesian3.fromDegrees(...O))||wM(d.startPos,d.endPos,void 0,typeof d.heightRatio>"u"?1:d.heightRatio);const g=n(p,void 0,ea),{timeRatio:m,repeat:y,color:_,bidirectional:P,bgColor:C}=g,S=new h.Color(..._),x=new h.Color(...C),A=[m,y,P,0];var R=_M(p,f,d.width,e,S,x,A);if(!R)throw new Error("cannot get geoemetry instance!");c.push(R)})}catch{return}var u=new h.Primitive({geometryInstances:c,appearance:CM(i,o,s,r),asynchronous:!1});return h.Primitive.prototype&&(u.ESSceneObjectID=l),u.update=function(d){const p=this;if(typeof p._batchTable<"u")for(var f=p._batchTableAttributeIndices.twp,g=p._batchTableAttributeIndices.color,m=p._batchTableAttributeIndices.bgColor,y=p._batchTable._numberOfInstances,_=0;_<y;++_){var P=_;ea.timeRatio=0,ea.repeat=1,ea.color.splice(0,4,1,1,1);const C=n(P,d,ea),{timeRatio:S,repeat:x,color:A,bidirectional:R,bgColor:O}=C;Eh.x=S,Eh.y=x,Eh.z=typeof R!="number"?0:R,p._batchTable.setBatchedAttribute(P,f,Eh),zi.x=255*A[0],zi.y=255*A[1],zi.z=255*A[2],zi.w=255*A[3],p._batchTable.setBatchedAttribute(P,g,zi),zi.x=255*O[0],zi.y=255*O[1],zi.z=255*O[2],zi.w=255*O[3],p._batchTable.setBatchedAttribute(P,m,zi)}h.Primitive.prototype.update.call(p,d)},u}class bM extends a.Destroyable{constructor(e,n,o){super();v(this,"_nativePrimitive");this._viewer=e;const s=this._viewer,r=n.routePaths;if(!r)throw new Error("!routePath");const l=n.arcType!==void 0?h.ArcType[n.arcType]:h.ArcType.GEODESIC,c=PM(r,n.color,l,(u,d,p)=>{const f=r[u];if(!n)return p;p.repeat=(f.repeat??1)*n.repeat;const g=f.startTime??n.startTime,m=f.transmissionTime??n.transmissionTime??n.duration??tn.defaults.duration,y=n.currentTime??tn.defaults.currentTime,_=a.clamp((y-g)/m,0,1);p.timeRatio=_/p.repeat;const P=f.color??n.color,C=f.bgColor??n.bgColor;return p.color.splice(0,4,...P),p.bgColor.splice(0,4,...C),p.bidirectional=f.bidirectional??n.bidirectional,(n.routePathCallback&&n.routePathCallback(p,u,d))??p},n.brightening,n.depthTest,o,n.id);c&&(s.scene.primitives.add(c),this.dispose(()=>{s.scene.primitives.remove(c)}),c.show=n.show??!0,this.dispose(n.showChanged.disposableOn(()=>{c&&(c.show=n.show??!0)})),this._nativePrimitive=c)}get nativePrimitive(){return this._nativePrimitive}}const SM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",EM=`默认示例代码
1843
+ `+u,o}function CM(t,i,e,n,o,s,r){const l=$s.createGeometry(new $s({positions:i,width:e,vertexFormat:h.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:n}));if(l){s||(s=h.Color.clone(o||h.Color.WHITE),s.alpha=.2);var c=new h.GeometryInstance({geometry:l,id:t,attributes:{color:h.ColorGeometryInstanceAttribute.fromColor(o||h.Color.WHITE),bgColor:h.ColorGeometryInstanceAttribute.fromColor(s),twp:new h.GeometryInstanceAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:r})}});return c}}const Eh=new h.Cartesian4(0,0,0,0),zi=new h.Cartesian4(0,0,0,0),ea={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function _M(t,i,e,n,o=!0,s=!0,r,l){var c=[];try{t.forEach(function(d,p){var f=d.positions&&d.positions.map(O=>h.Cartesian3.fromDegrees(...O))||yM(d.startPos,d.endPos,void 0,typeof d.heightRatio>"u"?1:d.heightRatio);const g=n(p,void 0,ea),{timeRatio:m,repeat:y,color:_,bidirectional:P,bgColor:C}=g,S=new h.Color(..._),x=new h.Color(...C),A=[m,y,P,0];var R=CM(p,f,d.width,e,S,x,A);if(!R)throw new Error("cannot get geoemetry instance!");c.push(R)})}catch{return}var u=new h.Primitive({geometryInstances:c,appearance:wM(i,o,s,r),asynchronous:!1});return h.Primitive.prototype&&(u.ESSceneObjectID=l),u.update=function(d){const p=this;if(typeof p._batchTable<"u")for(var f=p._batchTableAttributeIndices.twp,g=p._batchTableAttributeIndices.color,m=p._batchTableAttributeIndices.bgColor,y=p._batchTable._numberOfInstances,_=0;_<y;++_){var P=_;ea.timeRatio=0,ea.repeat=1,ea.color.splice(0,4,1,1,1);const C=n(P,d,ea),{timeRatio:S,repeat:x,color:A,bidirectional:R,bgColor:O}=C;Eh.x=S,Eh.y=x,Eh.z=typeof R!="number"?0:R,p._batchTable.setBatchedAttribute(P,f,Eh),zi.x=255*A[0],zi.y=255*A[1],zi.z=255*A[2],zi.w=255*A[3],p._batchTable.setBatchedAttribute(P,g,zi),zi.x=255*O[0],zi.y=255*O[1],zi.z=255*O[2],zi.w=255*O[3],p._batchTable.setBatchedAttribute(P,m,zi)}h.Primitive.prototype.update.call(p,d)},u}class PM extends a.Destroyable{constructor(e,n,o){super();v(this,"_nativePrimitive");this._viewer=e;const s=this._viewer,r=n.routePaths;if(!r)throw new Error("!routePath");const l=n.arcType!==void 0?h.ArcType[n.arcType]:h.ArcType.GEODESIC,c=_M(r,n.color,l,(u,d,p)=>{const f=r[u];if(!n)return p;p.repeat=(f.repeat??1)*n.repeat;const g=f.startTime??n.startTime,m=f.transmissionTime??n.transmissionTime??n.duration??tn.defaults.duration,y=n.currentTime??tn.defaults.currentTime,_=a.clamp((y-g)/m,0,1);p.timeRatio=_/p.repeat;const P=f.color??n.color,C=f.bgColor??n.bgColor;return p.color.splice(0,4,...P),p.bgColor.splice(0,4,...C),p.bidirectional=f.bidirectional??n.bidirectional,(n.routePathCallback&&n.routePathCallback(p,u,d))??p},n.brightening,n.depthTest,o,n.id);c&&(s.scene.primitives.add(c),this.dispose(()=>{s.scene.primitives.remove(c)}),c.show=n.show??!0,this.dispose(n.showChanged.disposableOn(()=>{c&&(c.show=n.show??!0)})),this._nativePrimitive=c)}get nativePrimitive(){return this._nativePrimitive}}const bM="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",SM=`默认示例代码
1844
1844
  \`\`\`
1845
1845
  // result 最后的结果
1846
1846
  // this 是当前的信号传输器集合
@@ -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
- `,Qn=class Qn 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=Qn.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=aM(_,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=Pu(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 ns),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const m=Im(r.scene.context).getTextureHandler(l.value);if(m instanceof ns)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 bM(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(Qn,"whiteGradientImageBase64",SM),v(Qn,"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(Qn,"routePathCallbackStrMd",EM),v(Qn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Qn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let tn=Qn;(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})})(tn||(tn={})),a.extendClassProps(tn.prototype,tn.createDefaultProps);class Bn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new tn(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(Bn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Bn,"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})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const Ll=class Ll extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Bn(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(Ll,"type",Ll.register("ESCesiumViewer",wh.type,Ll));let hf=Ll;function Lo(t){var i=[1/0,1/0,-1/0,-1/0];return Fo(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}Lo.default=Lo;var s0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(vo,function(){function e(C,S,x,A,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,A||C.length-1,R||o)}function n(C,S,x){var A=C[S];C[S]=C[x],C[x]=A}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 A=0;A<S.length;A++)if(x(C,S[A]))return A;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,A,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?A(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,A,R){for(var O=[S,x];O.length;)if(!((x=O.pop())-(S=O.pop())<=A)){var N=S+Math.ceil((x-S)/A/2)*A;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 A=this.toBBox,R=[];S;){for(var O=0;O<S.children.length;O++){var N=S.children[O],V=S.leaf?A(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 A=0;A<S.children.length;A++){var R=S.children[A],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 A=this.data;this.data=x,x=A}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,A,R,O=this.data,N=this.toBBox(C),V=[],U=[];O||V.length;){if(O||(O=V.pop(),A=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)?A?(x++,O=A.children[x],R=!1):O=null:(V.push(O),U.push(x),x=0,A=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,A){var R,O=x-S+1,N=this._maxEntries;if(O<=N)return l(R=_(C.slice(S,x+1)),this.toBBox),R;A||(A=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,A-1))),(R=_([])).leaf=!1,R.height=A;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,A-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,A){for(;A.push(S),!S.leaf&&A.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 A=x?C:this.toBBox(C),R=[],O=this._chooseSubtree(A,this.data,S,R);for(O.children.push(C),u(O,A);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(A,R,S)},s.prototype._split=function(C,S){var x=C[S],A=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,A);var O=this._chooseSplitIndex(x,R,A),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 A,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,A=E,w=Y<w?Y:w):G===B&&Y<w&&(w=Y,A=E)}return A||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var A=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,A)<this._allDistMargin(C,S,x,R)&&C.children.sort(A)},s.prototype._allDistMargin=function(C,S,x,A){C.children.sort(A);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 A=x;A>=0;A--)u(S[A],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})})(s0);var xM=s0.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=Sh(t),o=Di(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&AM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(r0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)r0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function r0(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 AM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function TM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return a0(t);case"FeatureCollection":return MM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return uf(t);default:throw new Error("unknown GeoJSON type")}}function a0(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=l0(t.properties),i.geometry=uf(t.geometry),i}function l0(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]=l0(n):i[e]=n}),i}function MM(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 a0(e)}),i}function uf(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return uf(e)}),i):(i.coordinates=c0(t.coordinates),i)}function c0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return c0(e)})}function h0(t,i){i===void 0&&(i={});var e=typeof i=="object"?i.mutate:i;if(!t)throw new Error("geojson is required");var n=XT(t),o=[];switch(n){case"LineString":o=df(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(r){o.push(df(r))});break;case"MultiPolygon":Ii(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(df(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ii(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 df(t){var i=Ii(t);if(i.length===2&&!u0(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&&d0(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,u0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return d0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function u0(t,i){return t[0]===i[0]&&t[1]===i[1]}function d0(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 IM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return Fo(t,function(s){e+=s[0],n+=s[1],o++},!0),ht([e/o,n/o],i.properties)}function p0(t){if(!t)throw new Error("geojson is required");var i=[];return ji(t,function(e){DM(e,i)}),Ot(i)}function DM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ii(n);break;case"LineString":e=[Ii(n)]}e.forEach(function(o){var s=RM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function RM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=FM(n,o),e.push(s),o}),e}function FM(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 pf={exports:{}},f0={};(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 A(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=A;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})(f0);var Je={};const zM=Wm($T);Object.defineProperty(Je,"__esModule",{value:!0});var wt=zM;function ta(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 A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){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++,A==="MultiPoint"&&S++}A==="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++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="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(ta(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function LM(t,i,e,n){var o=e;return ta(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 g0(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 OM(t,i,e){var n=e;return g0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function m0(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 NM(t,i,e){var n=e;return m0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function BM(t){var i=[];return ta(t,function(e){i.push(e)}),i}function ff(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 VM(t,i,e){var n=e;return ff(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function xh(t,i){ff(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 UM(t,i,e){var n=e;return xh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function v0(t,i){xh(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(ta(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 WM(t,i,e){var n=e,o=!1;return v0(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 y0(t,i){if(!t)throw new Error("geojson is required");xh(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 GM(t,i,e){var n=e;return y0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function HM(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 $M(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=BM,Je.coordEach=ta,Je.coordReduce=LM,Je.featureEach=m0,Je.featureReduce=NM,Je.findPoint=$M,Je.findSegment=HM,Je.flattenEach=xh,Je.flattenReduce=UM,Je.geomEach=ff,Je.geomReduce=VM,Je.lineEach=y0,Je.lineReduce=GM,Je.propEach=g0,Je.propReduce=OM,Je.segmentEach=v0,Je.segmentReduce=WM;var gf={};const qM=Wm(iM);Object.defineProperty(gf,"__esModule",{value:!0});var XM=qM;function mf(t){var i=[1/0,1/0,-1/0,-1/0];return XM.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}mf.default=mf,gf.default=mf;var Li=xM,w0=f0,C0=Je,qs=gf.default,YM=C0.featureEach;C0.coordEach,w0.polygon;var _0=w0.featureCollection;function P0(t){var i=new Li(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.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:qs(o),n.push(o)}):YM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}),Li.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:qs(e),Li.prototype.remove.call(this,e,n)},i.clear=function(){return Li.prototype.clear.call(this)},i.search=function(e){var n=Li.prototype.search.call(this,this.toBBox(e));return _0(n)},i.collides=function(e){return Li.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Li.prototype.all.call(this);return _0(e)},i.toJSON=function(){return Li.prototype.toJSON.call(this)},i.fromJSON=function(e){return Li.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=qs(e);else if(e.type==="FeatureCollection")n=qs(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}pf.exports=P0,pf.exports.default=P0;var ZM=pf.exports;const QM=Ic(ZM);function vf(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=b0(t,i);return o&&n.push(o),Ot(n)}var s=QM();return s.load(p0(i)),Us(p0(t),function(r){Us(s.search(r),function(l){var c=b0(r,l);if(c){var u=Ii(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ot(n)}function b0(t,i){var e=Ii(t),n=Ii(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 Ah(t,i,e){e===void 0&&(e={});for(var n=Sh(t),o=Ii(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")),kM(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function kM(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 KM(t,i){var e=Di(t),n=Di(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return JM(e,n);case"LineString":return Ah(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 jM(e,n);case"LineString":return eI(e,n);case"Polygon":case"MultiPolygon":return tI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return iI(e,n);case"Polygon":case"MultiPolygon":return nI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return oI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function JM(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(E0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function jM(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)E0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function eI(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ah(t.coordinates[n],i))return!1;e||(e=Ah(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function tI(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 iI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ah(t.coordinates[e],i))return!1;return!0}function nI(t,i){var e=Lo(i),n=Lo(t);if(!S0(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=sI(t.coordinates[s],t.coordinates[s+1]);o=Pt(r,i,{ignoreBoundary:!0})}}return o}function oI(t,i){var e=Lo(t),n=Lo(i);if(!S0(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 S0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function E0(t,i){return t[0]===i[0]&&t[1]===i[1]}function sI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function x0(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/Ri([o,s],[r,s],e),u=c*(r-o),d=i/Ri([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?KM(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Ot(n)}function yf(t,i){i===void 0&&(i={});var e=Di(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return rI(e,i);case"MultiPolygon":return aI(e,i);default:throw new Error("invalid poly")}}function rI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return A0(n,o)}function aI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(A0(r,o))}),Ot(s)}function A0(t,i){return t.length>1?nf(t,i):oi(t[0],i)}var T0=Object.prototype.toString,M0=function(i){var e=T0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&T0.call(i.callee)==="[object Function]"),n},wf,I0;function lI(){if(I0)return wf;I0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=M0,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 A=0;A<g.length;++A)C.push(String(A));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 wf=t,wf}var cI=Array.prototype.slice,hI=M0,D0=Object.keys,Th=D0?function(i){return D0(i)}:lI(),R0=Object.keys;Th.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 hI(n)?R0(cI.call(n)):R0(n)})}else Object.keys=Th;return Object.keys||Th};var F0=Th,z0=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},uI=z0,Cf=function(){return uI()&&!!Symbol.toStringTag},L0=Object,O0=Error,dI=EvalError,pI=RangeError,fI=ReferenceError,N0=SyntaxError,Xs=TypeError,gI=URIError,mI=Math.abs,vI=Math.floor,yI=Math.max,wI=Math.min,CI=Math.pow,_I=Math.round,PI=Number.isNaN||function(i){return i!==i},bI=PI,SI=function(i){return bI(i)||i===0?i:i<0?-1:1},EI=Object.getOwnPropertyDescriptor,Mh=EI;if(Mh)try{Mh([],"length")}catch{Mh=null}var Ys=Mh,Ih=Object.defineProperty||!1;if(Ih)try{Ih({},"a",{value:1})}catch{Ih=!1}var Dh=Ih,_f,B0;function xI(){if(B0)return _f;B0=1;var t=typeof Symbol<"u"&&Symbol,i=z0;return _f=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},_f}var V0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,AI=L0,U0=AI.getPrototypeOf||null,TI="Function.prototype.bind called on incompatible ",MI=Object.prototype.toString,II=Math.max,DI="[object Function]",W0=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},RI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},FI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},zI=function(i){var e=this;if(typeof e!="function"||MI.apply(e)!==DI)throw new TypeError(TI+e);for(var n=RI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,W0(n,arguments));return Object(d)===d?d:this}return e.apply(i,W0(n,arguments))},r=II(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+FI(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},LI=zI,ia=Function.prototype.bind||LI,Pf=Function.prototype.call,bf=Function.prototype.apply,OI=typeof Reflect<"u"&&Reflect&&Reflect.apply,NI=ia,BI=bf,VI=Pf,UI=OI,G0=UI||NI.call(VI,BI),WI=ia,GI=Xs,HI=Pf,$I=G0,Sf=function(i){if(i.length<1||typeof i[0]!="function")throw new GI("a function is required");return $I(WI,HI,i)},qI=Sf,H0=Ys,$0;try{$0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ef=!!$0&&H0&&H0(Object.prototype,"__proto__"),q0=Object,X0=q0.getPrototypeOf,XI=Ef&&typeof Ef.get=="function"?qI([Ef.get]):typeof X0=="function"?function(i){return X0(i==null?i:q0(i))}:!1,Y0=V0,Z0=U0,Q0=XI,k0=Y0?function(i){return Y0(i)}:Z0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return Z0(i)}:Q0?function(i){return Q0(i)}:null,YI=Function.prototype.call,ZI=Object.prototype.hasOwnProperty,QI=ia,K0=QI.call(YI,ZI),me,kI=L0,KI=O0,JI=dI,jI=pI,eD=fI,Zs=N0,Qs=Xs,tD=gI,iD=mI,nD=vI,oD=yI,sD=wI,rD=CI,aD=_I,lD=SI,J0=Function,xf=function(t){try{return J0('"use strict"; return ('+t+").constructor;")()}catch{}},na=Ys,cD=Dh,Af=function(){throw new Qs},hD=na?function(){try{return arguments.callee,Af}catch{try{return na(arguments,"callee").get}catch{return Af}}}():Af,ks=xI()(),nt=k0,uD=U0,dD=V0,j0=bf,oa=Pf,Ks={},pD=typeof Uint8Array>"u"||!nt?me:nt(Uint8Array),Oo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":ks&&nt?nt([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":Ks,"%AsyncGenerator%":Ks,"%AsyncGeneratorFunction%":Ks,"%AsyncIteratorPrototype%":Ks,"%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%":KI,"%eval%":eval,"%EvalError%":JI,"%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%":J0,"%GeneratorFunction%":Ks,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ks&&nt?nt(nt([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ks||!nt?me:nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":kI,"%Object.getOwnPropertyDescriptor%":na,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":jI,"%ReferenceError%":eD,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ks||!nt?me:nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ks&&nt?nt(""[Symbol.iterator]()):me,"%Symbol%":ks?Symbol:me,"%SyntaxError%":Zs,"%ThrowTypeError%":hD,"%TypedArray%":pD,"%TypeError%":Qs,"%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%":tD,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":oa,"%Function.prototype.apply%":j0,"%Object.defineProperty%":cD,"%Object.getPrototypeOf%":uD,"%Math.abs%":iD,"%Math.floor%":nD,"%Math.max%":oD,"%Math.min%":sD,"%Math.pow%":rD,"%Math.round%":aD,"%Math.sign%":lD,"%Reflect.getPrototypeOf%":dD};if(nt)try{null.error}catch(t){var fD=nt(nt(t));Oo["%Error.prototype%"]=fD}var gD=function t(i){var e;if(i==="%AsyncFunction%")e=xf("async function () {}");else if(i==="%GeneratorFunction%")e=xf("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=xf("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 Oo[i]=e,e},ew={__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"]},sa=ia,Rh=K0,mD=sa.call(oa,Array.prototype.concat),vD=sa.call(j0,Array.prototype.splice),tw=sa.call(oa,String.prototype.replace),Fh=sa.call(oa,String.prototype.slice),yD=sa.call(oa,RegExp.prototype.exec),wD=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,CD=/\\(\\)?/g,_D=function(i){var e=Fh(i,0,1),n=Fh(i,-1);if(e==="%"&&n!=="%")throw new Zs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Zs("invalid intrinsic syntax, expected opening `%`");var o=[];return tw(i,wD,function(s,r,l,c){o[o.length]=l?tw(c,CD,"$1"):r||s}),o},PD=function(i,e){var n=i,o;if(Rh(ew,n)&&(o=ew[n],n="%"+o[0]+"%"),Rh(Oo,n)){var s=Oo[n];if(s===Ks&&(s=gD(n)),typeof s>"u"&&!e)throw new Qs("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Zs("intrinsic "+i+" does not exist!")},iw=function(i,e){if(typeof i!="string"||i.length===0)throw new Qs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Qs('"allowMissing" argument must be a boolean');if(yD(/^%?[^%]*%?$/,i)===null)throw new Zs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_D(i),o=n.length>0?n[0]:"",s=PD("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],vD(n,mD([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Fh(f,0,1),m=Fh(f,-1);if((g==='"'||g==="'"||g==="`"||m==='"'||m==="'"||m==="`")&&g!==m)throw new Zs("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Rh(Oo,r))l=Oo[r];else if(l!=null){if(!(f in l)){if(!e)throw new Qs("base intrinsic for "+i+" exists, but the property is not available.");return}if(na&&d+1>=n.length){var y=na(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Rh(l,f),l=l[f];p&&!c&&(Oo[r]=l)}}return l},nw=iw,ow=Sf,bD=ow([nw("%String.prototype.indexOf%")]),Tf=function(i,e){var n=nw(i,!!e);return typeof n=="function"&&bD(i,".prototype.")>-1?ow([n]):n},SD=Cf(),ED=Tf,Mf=ED("Object.prototype.toString"),zh=function(i){return SD&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:Mf(i)==="[object Arguments]"},sw=function(i){return zh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&Mf(i)!=="[object Array]"&&"callee"in i&&Mf(i.callee)==="[object Function]"},xD=function(){return zh(arguments)}();zh.isLegacyArguments=sw;var AD=xD?zh:sw,rw=Dh,TD=N0,Js=Xs,aw=Ys,If=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new Js("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Js("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Js("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Js("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Js("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Js("`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=!!aw&&aw(i,e);if(rw)rw(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 TD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Df=Dh,lw=function(){return!!Df};lw.hasArrayLengthDefineBug=function(){if(!Df)return null;try{return Df([],"length",{value:1}).length!==1}catch{return!0}};var Rf=lw,MD=F0,ID=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",DD=Object.prototype.toString,RD=Array.prototype.concat,cw=If,FD=function(t){return typeof t=="function"&&DD.call(t)==="[object Function]"},hw=Rf(),zD=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!FD(n)||!n())return}hw?cw(t,i,e,!0):cw(t,i,e)},uw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=MD(i);ID&&(n=RD.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)zD(t,n[o],i[n[o]],e[n[o]])};uw.supportsDescriptors=!!hw;var ra=uw,dw={exports:{}},LD=iw,pw=If,OD=Rf(),fw=Ys,gw=Xs,ND=LD("%Math.floor%"),BD=function(i,e){if(typeof i!="function")throw new gw("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||ND(e)!==e)throw new gw("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&fw){var r=fw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(OD?pw(i,"length",e,!0,!0):pw(i,"length",e)),i},VD=ia,UD=bf,WD=G0,GD=function(){return WD(VD,UD,arguments)};(function(t){var i=BD,e=Dh,n=Sf,o=GD;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})(dw);var mw=dw.exports,vw=function(t){return t!==t},yw=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||vw(i)&&vw(e))},HD=yw,ww=function(){return typeof Object.is=="function"?Object.is:HD},$D=ww,qD=ra,XD=function(){var i=$D();return qD(Object,{is:i},{is:function(){return Object.is!==i}}),i},YD=ra,ZD=mw,QD=yw,Cw=ww,kD=XD,_w=ZD(Cw(),Object);YD(_w,{getPolyfill:Cw,implementation:QD,shim:kD});var KD=_w,Pw=Tf,JD=Cf(),jD=K0,eR=Ys,Ff;if(JD){var tR=Pw("RegExp.prototype.exec"),bw={},zf=function(){throw bw},Sw={toString:zf,valueOf:zf};typeof Symbol.toPrimitive=="symbol"&&(Sw[Symbol.toPrimitive]=zf),Ff=function(i){if(!i||typeof i!="object")return!1;var e=eR(i,"lastIndex"),n=e&&jD(e,"value");if(!n)return!1;try{tR(i,Sw)}catch(o){return o===bw}}}else{var iR=Pw("Object.prototype.toString"),nR="[object RegExp]";Ff=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:iR(i)===nR}}var oR=Ff,aa=function(){return typeof(function(){}).name=="string"},la=Object.getOwnPropertyDescriptor;if(la)try{la([],"length")}catch{la=null}aa.functionsHaveConfigurableNames=function(){if(!aa()||!la)return!1;var i=la(function(){},"name");return!!i&&!!i.configurable};var sR=Function.prototype.bind;aa.boundFunctionsHaveNames=function(){return aa()&&typeof sR=="function"&&(function(){}).bind().name!==""};var rR=aa,Ew=If,aR=Rf(),lR=rR.functionsHaveConfigurableNames(),cR=Xs,hR=function(i,e){if(typeof i!="function")throw new cR("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||lR)&&(aR?Ew(i,"name",e,!0,!0):Ew(i,"name",e)),i},uR=hR,dR=Xs,pR=Object,xw=uR(function(){if(this==null||this!==pR(this))throw new dR("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),fR=xw,gR=ra.supportsDescriptors,mR=Object.getOwnPropertyDescriptor,Aw=function(){if(gR&&/a/mig.flags==="gim"){var i=mR(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 fR},vR=ra.supportsDescriptors,yR=Aw,wR=Ys,CR=Object.defineProperty,_R=O0,Tw=k0,PR=/a/,bR=function(){if(!vR||!Tw)throw new _R("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=yR(),e=Tw(PR),n=wR(e,"flags");return(!n||n.get!==i)&&CR(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},SR=ra,ER=mw,xR=xw,Mw=Aw,AR=bR,Iw=ER(Mw());SR(Iw,{getPolyfill:Mw,implementation:xR,shim:AR});var TR=Iw,Dw=Tf,MR=Dw("Date.prototype.getDay"),IR=function(i){try{return MR(i),!0}catch{return!1}},DR=Dw("Object.prototype.toString"),RR="[object Date]",FR=Cf(),zR=function(i){return typeof i!="object"||i===null?!1:FR?IR(i):DR(i)===RR},Rw=F0,Fw=AD,zw=KD,Lw=oR,Ow=TR,Nw=zR,Bw=Date.prototype.getTime;function Vw(t,i,e){var n=e||{};return(n.strict?zw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?zw(t,i):t==i:LR(t,i,n)}function Uw(t){return t==null}function Ww(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 LR(t,i,e){var n,o;if(typeof t!=typeof i||Uw(t)||Uw(i)||t.prototype!==i.prototype||Fw(t)!==Fw(i))return!1;var s=Lw(t),r=Lw(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Ow(t)===Ow(i);if(Nw(t)&&Nw(i))return Bw.call(t)===Bw.call(i);var l=Ww(t),c=Ww(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=Rw(t),d=Rw(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],!Vw(t[o],i[o],e))return!1;return!0}var OR=Vw;function NR(t,i){var e=!0;return ji(t,function(n){ji(i,function(o){if(e===!1)return!1;e=BR(n.geometry,o.geometry)})}),e}function BR(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!GR(t.coordinates,i.coordinates);case"LineString":return!Gw(i,t);case"Polygon":return!Pt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Gw(t,i);case"LineString":return!VR(t,i);case"Polygon":return!Hw(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Pt(i,t);case"LineString":return!Hw(t,i);case"Polygon":return!UR(i,t)}}return!1}function Gw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(WR(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function VR(t,i){var e=vf(t,i);return e.features.length>0}function Hw(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=vf(i,yf(t));return s.features.length>0}function UR(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=vf(yf(t),yf(i));return c.features.length>0}function WR(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 GR(t,i){return t[0]===i[0]&&t[1]===i[1]}var HR=OR,Oi=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:$R};Oi.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=$w(t),o=$w(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function $w(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}Oi.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},Oi.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}},Oi.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},Oi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Oi.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},Oi.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)},Oi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Oi.prototype.removePseudo=function(t){return t};function $R(t,i){return HR(t,i,{strict:!0})}var qR=Oi;const XR=Ic(qR);function YR(t,i){var e=Di(t).type,n=Di(i).type;if(e!==n)return!1;var o=new XR({precision:6});return o.compare(h0(t),h0(i))}function ZR(t,i){var e=!1;return ji(t,function(n){ji(i,function(o){if(e===!0)return!0;e=!NR(n.geometry,o.geometry)})}),e}/**
1857
+ `,Qn=class Qn 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=Qn.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=rM(_,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=Pu(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 ns),u=this.disposeVar(a.createProcessingFromAsyncFunc(async g=>{if(!l.value)return;const m=Im(r.scene.context).getTextureHandler(l.value);if(m instanceof ns)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 PM(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(Qn,"whiteGradientImageBase64",bM),v(Qn,"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(Qn,"routePathCallbackStrMd",SM),v(Qn,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Qn,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let tn=Qn;(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})})(tn||(tn={})),a.extendClassProps(tn.prototype,tn.createDefaultProps);class Bn extends a.Destroyable{constructor(e,n){super();v(this,"_flyToEvent",this.disposeVar(new a.Event));v(this,"_collection");this._collection=this.disposeVar(new tn(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(Bn,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),v(Bn,"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})})(Bn||(Bn={})),a.extendClassProps(Bn.prototype,Bn.createDefaultProps);const Ll=class Ll extends vt{constructor(e,n){super(e,n);v(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Bn(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(Ll,"type",Ll.register("ESCesiumViewer",wh.type,Ll));let hf=Ll;function Lo(t){var i=[1/0,1/0,-1/0,-1/0];return Fo(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}Lo.default=Lo;var s0={exports:{}};(function(t,i){(function(e,n){t.exports=n()})(vo,function(){function e(C,S,x,A,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,A||C.length-1,R||o)}function n(C,S,x){var A=C[S];C[S]=C[x],C[x]=A}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 A=0;A<S.length;A++)if(x(C,S[A]))return A;return-1}function l(C,S){c(C,0,C.children.length,S,C)}function c(C,S,x,A,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?A(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,A,R){for(var O=[S,x];O.length;)if(!((x=O.pop())-(S=O.pop())<=A)){var N=S+Math.ceil((x-S)/A/2)*A;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 A=this.toBBox,R=[];S;){for(var O=0;O<S.children.length;O++){var N=S.children[O],V=S.leaf?A(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 A=0;A<S.children.length;A++){var R=S.children[A],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 A=this.data;this.data=x,x=A}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,A,R,O=this.data,N=this.toBBox(C),V=[],U=[];O||V.length;){if(O||(O=V.pop(),A=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)?A?(x++,O=A.children[x],R=!1):O=null:(V.push(O),U.push(x),x=0,A=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,A){var R,O=x-S+1,N=this._maxEntries;if(O<=N)return l(R=_(C.slice(S,x+1)),this.toBBox),R;A||(A=Math.ceil(Math.log(O)/Math.log(N)),N=Math.ceil(O/Math.pow(N,A-1))),(R=_([])).leaf=!1,R.height=A;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,A-1))}}return l(R,this.toBBox),R},s.prototype._chooseSubtree=function(C,S,x,A){for(;A.push(S),!S.leaf&&A.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 A=x?C:this.toBBox(C),R=[],O=this._chooseSubtree(A,this.data,S,R);for(O.children.push(C),u(O,A);S>=0&&R[S].children.length>this._maxEntries;)this._split(R,S),S--;this._adjustParentBBoxes(A,R,S)},s.prototype._split=function(C,S){var x=C[S],A=x.children.length,R=this._minEntries;this._chooseSplitAxis(x,R,A);var O=this._chooseSplitIndex(x,R,A),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 A,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,A=E,w=Y<w?Y:w):G===B&&Y<w&&(w=Y,A=E)}return A||x-S},s.prototype._chooseSplitAxis=function(C,S,x){var A=C.leaf?this.compareMinX:d,R=C.leaf?this.compareMinY:p;this._allDistMargin(C,S,x,A)<this._allDistMargin(C,S,x,R)&&C.children.sort(A)},s.prototype._allDistMargin=function(C,S,x,A){C.children.sort(A);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 A=x;A>=0;A--)u(S[A],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})})(s0);var EM=s0.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=Sh(t),o=Di(i),s=o.type,r=i.bbox,l=o.coordinates;if(r&&xM(n,r)===!1)return!1;s==="Polygon"&&(l=[l]);for(var c=!1,u=0;u<l.length&&!c;u++)if(r0(n,l[u][0],e.ignoreBoundary)){for(var d=!1,p=1;p<l[u].length&&!d;)r0(n,l[u][p],!e.ignoreBoundary)&&(d=!0),p++;d||(c=!0)}return c}function r0(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 xM(t,i){return i[0]<=t[0]&&i[1]<=t[1]&&i[2]>=t[0]&&i[3]>=t[1]}function AM(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return a0(t);case"FeatureCollection":return TM(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return uf(t);default:throw new Error("unknown GeoJSON type")}}function a0(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=l0(t.properties),i.geometry=uf(t.geometry),i}function l0(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]=l0(n):i[e]=n}),i}function TM(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 a0(e)}),i}function uf(t){var i={type:t.type};return t.bbox&&(i.bbox=t.bbox),t.type==="GeometryCollection"?(i.geometries=t.geometries.map(function(e){return uf(e)}),i):(i.coordinates=c0(t.coordinates),i)}function c0(t){var i=t;return typeof i[0]!="object"?i.slice():i.map(function(e){return c0(e)})}function h0(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=df(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(r){o.push(df(r))});break;case"MultiPolygon":Ii(t).forEach(function(r){var l=[];r.forEach(function(c){l.push(df(c))}),o.push(l)});break;case"Point":return t;case"MultiPoint":var s={};Ii(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 df(t){var i=Ii(t);if(i.length===2&&!u0(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&&d0(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,u0(i[0],i[i.length-1])&&o<4)throw new Error("invalid polygon");return d0(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function u0(t,i){return t[0]===i[0]&&t[1]===i[1]}function d0(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 MM(t,i){i===void 0&&(i={});var e=0,n=0,o=0;return Fo(t,function(s){e+=s[0],n+=s[1],o++},!0),ht([e/o,n/o],i.properties)}function p0(t){if(!t)throw new Error("geojson is required");var i=[];return ji(t,function(e){IM(e,i)}),Ot(i)}function IM(t,i){var e=[],n=t.geometry;if(n!==null){switch(n.type){case"Polygon":e=Ii(n);break;case"LineString":e=[Ii(n)]}e.forEach(function(o){var s=DM(o,t.properties);s.forEach(function(r){r.id=i.length,i.push(r)})})}}function DM(t,i){var e=[];return t.reduce(function(n,o){var s=oi([n,o],i);return s.bbox=RM(n,o),e.push(s),o}),e}function RM(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 pf={exports:{}},f0={};(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 A(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=A;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})(f0);var Je={};const FM=Wm(HT);Object.defineProperty(Je,"__esModule",{value:!0});var wt=FM;function ta(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 A=r.type;switch(d=e&&(A==="Polygon"||A==="MultiPolygon")?1:0,A){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++,A==="MultiPoint"&&S++}A==="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++}A==="MultiLineString"&&S++,A==="Polygon"&&x++}A==="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(ta(r.geometries[n],i,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function zM(t,i,e,n){var o=e;return ta(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 g0(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 LM(t,i,e){var n=e;return g0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function m0(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 OM(t,i,e){var n=e;return m0(t,function(o,s){s===0&&e===void 0?n=o:n=i(n,o,s)}),n}function NM(t){var i=[];return ta(t,function(e){i.push(e)}),i}function ff(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 BM(t,i,e){var n=e;return ff(t,function(o,s,r,l,c){s===0&&e===void 0?n=o:n=i(n,o,s,r,l,c)}),n}function xh(t,i){ff(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 VM(t,i,e){var n=e;return xh(t,function(o,s,r){s===0&&r===0&&e===void 0?n=o:n=i(n,o,s,r)}),n}function v0(t,i){xh(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(ta(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 UM(t,i,e){var n=e,o=!1;return v0(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 y0(t,i){if(!t)throw new Error("geojson is required");xh(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 WM(t,i,e){var n=e;return y0(t,function(o,s,r,l){s===0&&e===void 0?n=o:n=i(n,o,s,r,l)}),n}function GM(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 HM(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=NM,Je.coordEach=ta,Je.coordReduce=zM,Je.featureEach=m0,Je.featureReduce=OM,Je.findPoint=HM,Je.findSegment=GM,Je.flattenEach=xh,Je.flattenReduce=VM,Je.geomEach=ff,Je.geomReduce=BM,Je.lineEach=y0,Je.lineReduce=WM,Je.propEach=g0,Je.propReduce=LM,Je.segmentEach=v0,Je.segmentReduce=UM;var gf={};const $M=Wm(tM);Object.defineProperty(gf,"__esModule",{value:!0});var qM=$M;function mf(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}mf.default=mf,gf.default=mf;var Li=EM,w0=f0,C0=Je,qs=gf.default,XM=C0.featureEach;C0.coordEach,w0.polygon;var _0=w0.featureCollection;function P0(t){var i=new Li(t);return i.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:qs(e),Li.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:qs(o),n.push(o)}):XM(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:qs(o),n.push(o)}),Li.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:qs(e),Li.prototype.remove.call(this,e,n)},i.clear=function(){return Li.prototype.clear.call(this)},i.search=function(e){var n=Li.prototype.search.call(this,this.toBBox(e));return _0(n)},i.collides=function(e){return Li.prototype.collides.call(this,this.toBBox(e))},i.all=function(){var e=Li.prototype.all.call(this);return _0(e)},i.toJSON=function(){return Li.prototype.toJSON.call(this)},i.fromJSON=function(e){return Li.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=qs(e);else if(e.type==="FeatureCollection")n=qs(e);else throw new Error("invalid geojson");return{minX:n[0],minY:n[1],maxX:n[2],maxY:n[3]}},i}pf.exports=P0,pf.exports.default=P0;var YM=pf.exports;const ZM=Ic(YM);function vf(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=b0(t,i);return o&&n.push(o),Ot(n)}var s=ZM();return s.load(p0(i)),Us(p0(t),function(r){Us(s.search(r),function(l){var c=b0(r,l);if(c){var u=Ii(c).join(",");e[u]||(e[u]=!0,n.push(c))}})}),Ot(n)}function b0(t,i){var e=Ii(t),n=Ii(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 Ah(t,i,e){e===void 0&&(e={});for(var n=Sh(t),o=Ii(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")),QM(o[s],o[s+1],n,r,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function QM(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 kM(t,i){var e=Di(t),n=Di(i),o=e.type,s=n.type;switch(o){case"Point":switch(s){case"MultiPoint":return KM(e,n);case"LineString":return Ah(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 JM(e,n);case"LineString":return jM(e,n);case"Polygon":case"MultiPolygon":return eI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"LineString":switch(s){case"LineString":return tI(e,n);case"Polygon":case"MultiPolygon":return iI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}case"Polygon":switch(s){case"Polygon":case"MultiPolygon":return nI(e,n);default:throw new Error("feature2 "+s+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function KM(t,i){var e,n=!1;for(e=0;e<i.coordinates.length;e++)if(E0(i.coordinates[e],t.coordinates)){n=!0;break}return n}function JM(t,i){for(var e=0;e<t.coordinates.length;e++){for(var n=!1,o=0;o<i.coordinates.length;o++)E0(t.coordinates[e],i.coordinates[o])&&(n=!0);if(!n)return!1}return!0}function jM(t,i){for(var e=!1,n=0;n<t.coordinates.length;n++){if(!Ah(t.coordinates[n],i))return!1;e||(e=Ah(t.coordinates[n],i,{ignoreEndVertices:!0}))}return e}function eI(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 tI(t,i){for(var e=0;e<t.coordinates.length;e++)if(!Ah(t.coordinates[e],i))return!1;return!0}function iI(t,i){var e=Lo(i),n=Lo(t);if(!S0(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=oI(t.coordinates[s],t.coordinates[s+1]);o=Pt(r,i,{ignoreBoundary:!0})}}return o}function nI(t,i){var e=Lo(t),n=Lo(i);if(!S0(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 S0(t,i){return!(t[0]>i[0]||t[2]<i[2]||t[1]>i[1]||t[3]<i[3])}function E0(t,i){return t[0]===i[0]&&t[1]===i[1]}function oI(t,i){return[(t[0]+i[0])/2,(t[1]+i[1])/2]}function x0(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/Ri([o,s],[r,s],e),u=c*(r-o),d=i/Ri([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?kM(x,e.mask)&&n.push(x):n.push(x),S+=p}C+=u}return Ot(n)}function yf(t,i){i===void 0&&(i={});var e=Di(t);switch(!i.properties&&t.type==="Feature"&&(i.properties=t.properties),e.type){case"Polygon":return sI(e,i);case"MultiPolygon":return rI(e,i);default:throw new Error("invalid poly")}}function sI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{};return A0(n,o)}function rI(t,i){i===void 0&&(i={});var e=Di(t),n=e.coordinates,o=i.properties?i.properties:t.type==="Feature"?t.properties:{},s=[];return n.forEach(function(r){s.push(A0(r,o))}),Ot(s)}function A0(t,i){return t.length>1?nf(t,i):oi(t[0],i)}var T0=Object.prototype.toString,M0=function(i){var e=T0.call(i),n=e==="[object Arguments]";return n||(n=e!=="[object Array]"&&i!==null&&typeof i=="object"&&typeof i.length=="number"&&i.length>=0&&T0.call(i.callee)==="[object Function]"),n},wf,I0;function aI(){if(I0)return wf;I0=1;var t;if(!Object.keys){var i=Object.prototype.hasOwnProperty,e=Object.prototype.toString,n=M0,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 A=0;A<g.length;++A)C.push(String(A));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 wf=t,wf}var lI=Array.prototype.slice,cI=M0,D0=Object.keys,Th=D0?function(i){return D0(i)}:aI(),R0=Object.keys;Th.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 cI(n)?R0(lI.call(n)):R0(n)})}else Object.keys=Th;return Object.keys||Th};var F0=Th,z0=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},hI=z0,Cf=function(){return hI()&&!!Symbol.toStringTag},L0=Object,O0=Error,uI=EvalError,dI=RangeError,pI=ReferenceError,N0=SyntaxError,Xs=TypeError,fI=URIError,gI=Math.abs,mI=Math.floor,vI=Math.max,yI=Math.min,wI=Math.pow,CI=Math.round,_I=Number.isNaN||function(i){return i!==i},PI=_I,bI=function(i){return PI(i)||i===0?i:i<0?-1:1},SI=Object.getOwnPropertyDescriptor,Mh=SI;if(Mh)try{Mh([],"length")}catch{Mh=null}var Ys=Mh,Ih=Object.defineProperty||!1;if(Ih)try{Ih({},"a",{value:1})}catch{Ih=!1}var Dh=Ih,_f,B0;function EI(){if(B0)return _f;B0=1;var t=typeof Symbol<"u"&&Symbol,i=z0;return _f=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:i()},_f}var V0=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,xI=L0,U0=xI.getPrototypeOf||null,AI="Function.prototype.bind called on incompatible ",TI=Object.prototype.toString,MI=Math.max,II="[object Function]",W0=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},DI=function(i,e){for(var n=[],o=e,s=0;o<i.length;o+=1,s+=1)n[s]=i[o];return n},RI=function(t,i){for(var e="",n=0;n<t.length;n+=1)e+=t[n],n+1<t.length&&(e+=i);return e},FI=function(i){var e=this;if(typeof e!="function"||TI.apply(e)!==II)throw new TypeError(AI+e);for(var n=DI(arguments,1),o,s=function(){if(this instanceof o){var d=e.apply(this,W0(n,arguments));return Object(d)===d?d:this}return e.apply(i,W0(n,arguments))},r=MI(0,e.length-n.length),l=[],c=0;c<r;c++)l[c]="$"+c;if(o=Function("binder","return function ("+RI(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},zI=FI,ia=Function.prototype.bind||zI,Pf=Function.prototype.call,bf=Function.prototype.apply,LI=typeof Reflect<"u"&&Reflect&&Reflect.apply,OI=ia,NI=bf,BI=Pf,VI=LI,G0=VI||OI.call(BI,NI),UI=ia,WI=Xs,GI=Pf,HI=G0,Sf=function(i){if(i.length<1||typeof i[0]!="function")throw new WI("a function is required");return HI(UI,GI,i)},$I=Sf,H0=Ys,$0;try{$0=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ef=!!$0&&H0&&H0(Object.prototype,"__proto__"),q0=Object,X0=q0.getPrototypeOf,qI=Ef&&typeof Ef.get=="function"?$I([Ef.get]):typeof X0=="function"?function(i){return X0(i==null?i:q0(i))}:!1,Y0=V0,Z0=U0,Q0=qI,k0=Y0?function(i){return Y0(i)}:Z0?function(i){if(!i||typeof i!="object"&&typeof i!="function")throw new TypeError("getProto: not an object");return Z0(i)}:Q0?function(i){return Q0(i)}:null,XI=Function.prototype.call,YI=Object.prototype.hasOwnProperty,ZI=ia,K0=ZI.call(XI,YI),me,QI=L0,kI=O0,KI=uI,JI=dI,jI=pI,Zs=N0,Qs=Xs,eD=fI,tD=gI,iD=mI,nD=vI,oD=yI,sD=wI,rD=CI,aD=bI,J0=Function,xf=function(t){try{return J0('"use strict"; return ('+t+").constructor;")()}catch{}},na=Ys,lD=Dh,Af=function(){throw new Qs},cD=na?function(){try{return arguments.callee,Af}catch{try{return na(arguments,"callee").get}catch{return Af}}}():Af,ks=EI()(),nt=k0,hD=U0,uD=V0,j0=bf,oa=Pf,Ks={},dD=typeof Uint8Array>"u"||!nt?me:nt(Uint8Array),Oo={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?me:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?me:ArrayBuffer,"%ArrayIteratorPrototype%":ks&&nt?nt([][Symbol.iterator]()):me,"%AsyncFromSyncIteratorPrototype%":me,"%AsyncFunction%":Ks,"%AsyncGenerator%":Ks,"%AsyncGeneratorFunction%":Ks,"%AsyncIteratorPrototype%":Ks,"%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%":kI,"%eval%":eval,"%EvalError%":KI,"%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%":J0,"%GeneratorFunction%":Ks,"%Int8Array%":typeof Int8Array>"u"?me:Int8Array,"%Int16Array%":typeof Int16Array>"u"?me:Int16Array,"%Int32Array%":typeof Int32Array>"u"?me:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":ks&&nt?nt(nt([][Symbol.iterator]())):me,"%JSON%":typeof JSON=="object"?JSON:me,"%Map%":typeof Map>"u"?me:Map,"%MapIteratorPrototype%":typeof Map>"u"||!ks||!nt?me:nt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":QI,"%Object.getOwnPropertyDescriptor%":na,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?me:Promise,"%Proxy%":typeof Proxy>"u"?me:Proxy,"%RangeError%":JI,"%ReferenceError%":jI,"%Reflect%":typeof Reflect>"u"?me:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?me:Set,"%SetIteratorPrototype%":typeof Set>"u"||!ks||!nt?me:nt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?me:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":ks&&nt?nt(""[Symbol.iterator]()):me,"%Symbol%":ks?Symbol:me,"%SyntaxError%":Zs,"%ThrowTypeError%":cD,"%TypedArray%":dD,"%TypeError%":Qs,"%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%":eD,"%WeakMap%":typeof WeakMap>"u"?me:WeakMap,"%WeakRef%":typeof WeakRef>"u"?me:WeakRef,"%WeakSet%":typeof WeakSet>"u"?me:WeakSet,"%Function.prototype.call%":oa,"%Function.prototype.apply%":j0,"%Object.defineProperty%":lD,"%Object.getPrototypeOf%":hD,"%Math.abs%":tD,"%Math.floor%":iD,"%Math.max%":nD,"%Math.min%":oD,"%Math.pow%":sD,"%Math.round%":rD,"%Math.sign%":aD,"%Reflect.getPrototypeOf%":uD};if(nt)try{null.error}catch(t){var pD=nt(nt(t));Oo["%Error.prototype%"]=pD}var fD=function t(i){var e;if(i==="%AsyncFunction%")e=xf("async function () {}");else if(i==="%GeneratorFunction%")e=xf("function* () {}");else if(i==="%AsyncGeneratorFunction%")e=xf("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 Oo[i]=e,e},ew={__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"]},sa=ia,Rh=K0,gD=sa.call(oa,Array.prototype.concat),mD=sa.call(j0,Array.prototype.splice),tw=sa.call(oa,String.prototype.replace),Fh=sa.call(oa,String.prototype.slice),vD=sa.call(oa,RegExp.prototype.exec),yD=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,wD=/\\(\\)?/g,CD=function(i){var e=Fh(i,0,1),n=Fh(i,-1);if(e==="%"&&n!=="%")throw new Zs("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&e!=="%")throw new Zs("invalid intrinsic syntax, expected opening `%`");var o=[];return tw(i,yD,function(s,r,l,c){o[o.length]=l?tw(c,wD,"$1"):r||s}),o},_D=function(i,e){var n=i,o;if(Rh(ew,n)&&(o=ew[n],n="%"+o[0]+"%"),Rh(Oo,n)){var s=Oo[n];if(s===Ks&&(s=fD(n)),typeof s>"u"&&!e)throw new Qs("intrinsic "+i+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:s}}throw new Zs("intrinsic "+i+" does not exist!")},iw=function(i,e){if(typeof i!="string"||i.length===0)throw new Qs("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Qs('"allowMissing" argument must be a boolean');if(vD(/^%?[^%]*%?$/,i)===null)throw new Zs("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=CD(i),o=n.length>0?n[0]:"",s=_D("%"+o+"%",e),r=s.name,l=s.value,c=!1,u=s.alias;u&&(o=u[0],mD(n,gD([0,1],u)));for(var d=1,p=!0;d<n.length;d+=1){var f=n[d],g=Fh(f,0,1),m=Fh(f,-1);if((g==='"'||g==="'"||g==="`"||m==='"'||m==="'"||m==="`")&&g!==m)throw new Zs("property names with quotes must have matching quotes");if((f==="constructor"||!p)&&(c=!0),o+="."+f,r="%"+o+"%",Rh(Oo,r))l=Oo[r];else if(l!=null){if(!(f in l)){if(!e)throw new Qs("base intrinsic for "+i+" exists, but the property is not available.");return}if(na&&d+1>=n.length){var y=na(l,f);p=!!y,p&&"get"in y&&!("originalValue"in y.get)?l=y.get:l=l[f]}else p=Rh(l,f),l=l[f];p&&!c&&(Oo[r]=l)}}return l},nw=iw,ow=Sf,PD=ow([nw("%String.prototype.indexOf%")]),Tf=function(i,e){var n=nw(i,!!e);return typeof n=="function"&&PD(i,".prototype.")>-1?ow([n]):n},bD=Cf(),SD=Tf,Mf=SD("Object.prototype.toString"),zh=function(i){return bD&&i&&typeof i=="object"&&Symbol.toStringTag in i?!1:Mf(i)==="[object Arguments]"},sw=function(i){return zh(i)?!0:i!==null&&typeof i=="object"&&"length"in i&&typeof i.length=="number"&&i.length>=0&&Mf(i)!=="[object Array]"&&"callee"in i&&Mf(i.callee)==="[object Function]"},ED=function(){return zh(arguments)}();zh.isLegacyArguments=sw;var xD=ED?zh:sw,rw=Dh,AD=N0,Js=Xs,aw=Ys,If=function(i,e,n){if(!i||typeof i!="object"&&typeof i!="function")throw new Js("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Js("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Js("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Js("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Js("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Js("`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=!!aw&&aw(i,e);if(rw)rw(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 AD("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Df=Dh,lw=function(){return!!Df};lw.hasArrayLengthDefineBug=function(){if(!Df)return null;try{return Df([],"length",{value:1}).length!==1}catch{return!0}};var Rf=lw,TD=F0,MD=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",ID=Object.prototype.toString,DD=Array.prototype.concat,cw=If,RD=function(t){return typeof t=="function"&&ID.call(t)==="[object Function]"},hw=Rf(),FD=function(t,i,e,n){if(i in t){if(n===!0){if(t[i]===e)return}else if(!RD(n)||!n())return}hw?cw(t,i,e,!0):cw(t,i,e)},uw=function(t,i){var e=arguments.length>2?arguments[2]:{},n=TD(i);MD&&(n=DD.call(n,Object.getOwnPropertySymbols(i)));for(var o=0;o<n.length;o+=1)FD(t,n[o],i[n[o]],e[n[o]])};uw.supportsDescriptors=!!hw;var ra=uw,dw={exports:{}},zD=iw,pw=If,LD=Rf(),fw=Ys,gw=Xs,OD=zD("%Math.floor%"),ND=function(i,e){if(typeof i!="function")throw new gw("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||OD(e)!==e)throw new gw("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],o=!0,s=!0;if("length"in i&&fw){var r=fw(i,"length");r&&!r.configurable&&(o=!1),r&&!r.writable&&(s=!1)}return(o||s||!n)&&(LD?pw(i,"length",e,!0,!0):pw(i,"length",e)),i},BD=ia,VD=bf,UD=G0,WD=function(){return UD(BD,VD,arguments)};(function(t){var i=ND,e=Dh,n=Sf,o=WD;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})(dw);var mw=dw.exports,vw=function(t){return t!==t},yw=function(i,e){return i===0&&e===0?1/i===1/e:!!(i===e||vw(i)&&vw(e))},GD=yw,ww=function(){return typeof Object.is=="function"?Object.is:GD},HD=ww,$D=ra,qD=function(){var i=HD();return $D(Object,{is:i},{is:function(){return Object.is!==i}}),i},XD=ra,YD=mw,ZD=yw,Cw=ww,QD=qD,_w=YD(Cw(),Object);XD(_w,{getPolyfill:Cw,implementation:ZD,shim:QD});var kD=_w,Pw=Tf,KD=Cf(),JD=K0,jD=Ys,Ff;if(KD){var eR=Pw("RegExp.prototype.exec"),bw={},zf=function(){throw bw},Sw={toString:zf,valueOf:zf};typeof Symbol.toPrimitive=="symbol"&&(Sw[Symbol.toPrimitive]=zf),Ff=function(i){if(!i||typeof i!="object")return!1;var e=jD(i,"lastIndex"),n=e&&JD(e,"value");if(!n)return!1;try{eR(i,Sw)}catch(o){return o===bw}}}else{var tR=Pw("Object.prototype.toString"),iR="[object RegExp]";Ff=function(i){return!i||typeof i!="object"&&typeof i!="function"?!1:tR(i)===iR}}var nR=Ff,aa=function(){return typeof(function(){}).name=="string"},la=Object.getOwnPropertyDescriptor;if(la)try{la([],"length")}catch{la=null}aa.functionsHaveConfigurableNames=function(){if(!aa()||!la)return!1;var i=la(function(){},"name");return!!i&&!!i.configurable};var oR=Function.prototype.bind;aa.boundFunctionsHaveNames=function(){return aa()&&typeof oR=="function"&&(function(){}).bind().name!==""};var sR=aa,Ew=If,rR=Rf(),aR=sR.functionsHaveConfigurableNames(),lR=Xs,cR=function(i,e){if(typeof i!="function")throw new lR("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return(!n||aR)&&(rR?Ew(i,"name",e,!0,!0):Ew(i,"name",e)),i},hR=cR,uR=Xs,dR=Object,xw=hR(function(){if(this==null||this!==dR(this))throw new uR("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),pR=xw,fR=ra.supportsDescriptors,gR=Object.getOwnPropertyDescriptor,Aw=function(){if(fR&&/a/mig.flags==="gim"){var i=gR(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 pR},mR=ra.supportsDescriptors,vR=Aw,yR=Ys,wR=Object.defineProperty,CR=O0,Tw=k0,_R=/a/,PR=function(){if(!mR||!Tw)throw new CR("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var i=vR(),e=Tw(_R),n=yR(e,"flags");return(!n||n.get!==i)&&wR(e,"flags",{configurable:!0,enumerable:!1,get:i}),i},bR=ra,SR=mw,ER=xw,Mw=Aw,xR=PR,Iw=SR(Mw());bR(Iw,{getPolyfill:Mw,implementation:ER,shim:xR});var AR=Iw,Dw=Tf,TR=Dw("Date.prototype.getDay"),MR=function(i){try{return TR(i),!0}catch{return!1}},IR=Dw("Object.prototype.toString"),DR="[object Date]",RR=Cf(),FR=function(i){return typeof i!="object"||i===null?!1:RR?MR(i):IR(i)===DR},Rw=F0,Fw=xD,zw=kD,Lw=nR,Ow=AR,Nw=FR,Bw=Date.prototype.getTime;function Vw(t,i,e){var n=e||{};return(n.strict?zw(t,i):t===i)?!0:!t||!i||typeof t!="object"&&typeof i!="object"?n.strict?zw(t,i):t==i:zR(t,i,n)}function Uw(t){return t==null}function Ww(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 zR(t,i,e){var n,o;if(typeof t!=typeof i||Uw(t)||Uw(i)||t.prototype!==i.prototype||Fw(t)!==Fw(i))return!1;var s=Lw(t),r=Lw(i);if(s!==r)return!1;if(s||r)return t.source===i.source&&Ow(t)===Ow(i);if(Nw(t)&&Nw(i))return Bw.call(t)===Bw.call(i);var l=Ww(t),c=Ww(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=Rw(t),d=Rw(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],!Vw(t[o],i[o],e))return!1;return!0}var LR=Vw;function OR(t,i){var e=!0;return ji(t,function(n){ji(i,function(o){if(e===!1)return!1;e=NR(n.geometry,o.geometry)})}),e}function NR(t,i){switch(t.type){case"Point":switch(i.type){case"Point":return!WR(t.coordinates,i.coordinates);case"LineString":return!Gw(i,t);case"Polygon":return!Pt(t,i)}break;case"LineString":switch(i.type){case"Point":return!Gw(t,i);case"LineString":return!BR(t,i);case"Polygon":return!Hw(i,t)}break;case"Polygon":switch(i.type){case"Point":return!Pt(i,t);case"LineString":return!Hw(t,i);case"Polygon":return!VR(i,t)}}return!1}function Gw(t,i){for(var e=0;e<t.coordinates.length-1;e++)if(UR(t.coordinates[e],t.coordinates[e+1],i.coordinates))return!0;return!1}function BR(t,i){var e=vf(t,i);return e.features.length>0}function Hw(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=vf(i,yf(t));return s.features.length>0}function VR(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=vf(yf(t),yf(i));return c.features.length>0}function UR(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 WR(t,i){return t[0]===i[0]&&t[1]===i[1]}var GR=LR,Oi=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:HR};Oi.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=$w(t),o=$w(i);return n.every(function(s){return this.some(function(r){return e.compare(s,r)})},o)}}return!1};function $w(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}Oi.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},Oi.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}},Oi.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},Oi.prototype.comparePath=function(t,i){var e=this;return t.every(function(n,o){return e.compareCoord(n,this[o])},i)},Oi.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},Oi.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)},Oi.prototype.compareBBox=function(t,i){return!!(!t.bbox&&!i.bbox||t.bbox&&i.bbox&&this.compareCoord(t.bbox,i.bbox))},Oi.prototype.removePseudo=function(t){return t};function HR(t,i){return GR(t,i,{strict:!0})}var $R=Oi;const qR=Ic($R);function XR(t,i){var e=Di(t).type,n=Di(i).type;if(e!==n)return!1;var o=new qR({precision:6});return o.compare(h0(t),h0(i))}function YR(t,i){var e=!1;return ji(t,function(n){ji(i,function(o){if(e===!0)return!0;e=!OR(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 QR(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 Vn=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function kR(t,i){return t>i?1:t<i?-1:0}function Un(t,i,e){for(var n=new Vn(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 Lf(t,i,e,n){var o=new Vn(t,i);if(e===null)return o.left=o.right=null,o;e=Un(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 Xw(t,i,e){var n=null,o=null;if(i){i=Un(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 KR(t,i,e){return i===null?t:(t===null||(i=Un(t.key,i,e),i.left=t),i)}function Of(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1878
- `);var s=i+(e?" ":"│ ");t.left&&Of(t.left,s,!1,n,o),t.right&&Of(t.right,s,!0,n,o)}}var Nf=function(){function t(i){i===void 0&&(i=kR),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=Lf(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Vn(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Un(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=Un(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Un(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=Un(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=Un(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 jR(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&&Uf(i,e,0,o-1,s),this._root===null)this._root=Bf(i,e,0,o),this._size=o;else{var r=e2(this.toList(),JR(i,e),s);o=this._size+o,this._root=Vf({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 Of(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=Xw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=Lf(e,n,l,o):r=Lf(e,n,r,o),this._root=KR(r,l,o)},t.prototype.split=function(i){return Xw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return QR(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 Bf(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 Vn(r,l);return c.left=Bf(t,i,e,s),c.right=Bf(t,i,s+1,n),c}return null}function JR(t,i){for(var e=new Vn(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Vn(t[o],i[o]);return n.next=null,e.next}function jR(t){for(var i=t,e=[],n=!1,o=new Vn(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 Vf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Vf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Vf(t,o+1,e),r}return null}function e2(t,i,e){for(var n=new Vn(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 Uf(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}Uf(t,i,e,l,o),Uf(t,i,l+1,n,o)}}const nn=11102230246251565e-32,Ct=134217729,t2=(3+8*nn)*nn;function Wf(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 i2(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function ca(t){return new Float64Array(t)}const n2=(3+16*nn)*nn,o2=(2+12*nn)*nn,s2=(9+64*nn)*nn*nn,js=ca(4),Yw=ca(8),Zw=ca(12),Qw=ca(16),bt=ca(4);function r2(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,m,y,_,P,C,S,x,A,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,A=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=A-O,p=A-P,js[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,js[1]=S-(P+p)+(p-R),N=C+P,p=N-C,js[2]=C-(N-p)+(P-p),js[3]=N;let w=i2(4,js),E=o2*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=s2*r+t2*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,A=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=A-O,p=A-P,bt[0]=A-(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=Wf(4,js,4,bt,Yw);x=V*d,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*d,y=f-(f-d),_=d-y,A=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=A-O,p=A-P,bt[0]=A-(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=Wf(D,Yw,4,bt,Zw);x=l*d,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*d,y=f-(f-d),_=d-y,A=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=A-O,p=A-P,bt[0]=A-(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=Wf(L,Zw,4,bt,Qw);return Qw[G-1]}function a2(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)>=n2*u?c:-r2(t,i,e,n,o,s,u)}const ha=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Gf=(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 Wn=Number.EPSILON;Wn===void 0&&(Wn=Math.pow(2,-52));const l2=Wn*Wn,kw=(t,i)=>{if(-Wn<t&&t<Wn&&-Wn<i&&i<Wn)return 0;const e=t-i;return e*e<l2*t*i?0:t<i?-1:1};class c2{constructor(){this.reset()}reset(){this.xRounder=new Kw,this.yRounder=new Kw}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class Kw{constructor(){this.tree=new Nf,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&kw(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&kw(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const ua=new c2,Lh=(t,i)=>t.x*i.y-t.y*i.x,Jw=(t,i)=>t.x*i.x+t.y*i.y,jw=(t,i,e)=>{const n=a2(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Oh=t=>Math.sqrt(Jw(t,t)),h2=(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 Lh(o,n)/Oh(o)/Oh(n)},u2=(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 Jw(o,n)/Oh(o)/Oh(n)},eC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},tC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},d2=(t,i,e,n)=>{if(i.x===0)return tC(e,n,t.x);if(n.x===0)return tC(t,i,e.x);if(i.y===0)return eC(e,n,t.y);if(n.y===0)return eC(t,i,e.y);const o=Lh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Lh(s,i)/o,l=Lh(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:Gn.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:h2(this.point,i.point,s.point),cosine:u2(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 p2=0;class Gn{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=++p2,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 Gn(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=Gf(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=ha(e,l)&&this.comparePoint(l)===0,d=ha(n,s)&&i.comparePoint(s)===0,p=ha(e,c)&&this.comparePoint(c)===0,f=ha(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=d2(s,this.vector(),l,i.vector());return g===null||!ha(o,g)?null:ua.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 Gn(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=Gn.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 iC{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=ua.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=ua.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Gn.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(Gn.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 f2{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new iC(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 iC(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 nC{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 f2(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 Nh{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 Nh(_.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 Nh(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;jw(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];jw(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 oC{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 g2{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 oC(s));else{const r=s.enclosingRing();r.poly||e.push(new oC(r)),r.poly.addInterior(s)}}return e}}class m2{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gn.compare;this.queue=i,this.tree=new Nf(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 sC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,v2=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class y2{run(i,e,n){vi.type=i,ua.reset();const o=[new nC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new nC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Gf(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(Gf(g.bbox,o[m].bbox)===null)return[]}const s=new Nf(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>sC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new m2(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>sC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>v2)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()}ua.reset();const u=Nh.factory(r.segments);return new g2(u).getGeom()}}const vi=new y2;var w2={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 Bh(t,i,e){e===void 0&&(e={});var n=Di(t),o=Di(i),s=w2.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?it(s[0],e.properties):of(s,e.properties)}function C2(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/Ri([o,c],[r,c],e),p=d*(r-o),f=i*2/Ri([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=_,A=(P-y)/(y-m/2),R=Math.floor(A),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)P2([q,X],p/2,g/2,JSON.parse(n),z,B).forEach(function(ee){e.mask?Bh(e.mask,ee)&&D.push(ee):D.push(ee)});else{var Q=_2([q,X],p/2,g/2,JSON.parse(n),z,B);e.mask?Bh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Ot(D)}function _2(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 P2(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 b2(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/Ri([s,r],[l,r],n),d=u*(l-s),p=e/Ri([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 A=r+C,R=0;R<_;R++){var O=it([[[S,A],[S,A+f],[S+d,A+f],[S+d,A],[S,A]]],n.properties);n.mask?ZR(n.mask,O)&&o.push(O):o.push(O),A+=f}S+=d}return Ot(o)}function S2(t,i,e){return e===void 0&&(e={}),b2(t,i,i,e)}function E2(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Ri([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Ri([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?(Bh(e.mask,f)&&n.push(f),Bh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Ot(n)}function x2(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(qT(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=Lo(t),l;switch(n){case"point":case"points":l=x0(r,i,e);break;case"square":case"squares":l=S2(r,i,e);break;case"hex":case"hexes":l=C2(r,i,e);break;case"triangle":case"triangles":l=E2(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Us(l,function(u){var d=0,p=0;Us(t,function(g){var m=n==="point"?u:IM(u),y=Ri(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=TM(u);f.properties[o]=d/p,c.push(f)}),Ot(c)}function A2(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 rC=(t=0)=>new Promise(i=>setTimeout(i,t));function T2(t,i){const e=Ot(t.map(c=>ht(c))),n=it([t]);return x2(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Pt(ht(c),n))}function M2(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return vr(e)}function I2(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 Ol=class Ol 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.czmPointPrimitiveCollection=this.dv(new mo(n,e.id));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=T2(u,d).map(S=>[...S,e.groundHeight]),f=Math.floor(e.height/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(A=>[A[0],A[1],e.groundHeight+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 rC(),this._stopRun)break e;const x=new Date(g+S*_),A=M2(x);t:for(let R=0;R<p.length;R++){if(await rC(),this._stopRun)break t;A2(p[R],A,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:I2(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=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,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=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,e),!0}return!1}};v(Ol,"type",Ol.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Ol));let Hf=Ol;const aC=(t=0)=>new Promise(i=>setTimeout(i,t)),Xo=class Xo 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=>{Hi(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 ZR(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 Vn=function(){function t(i,e){this.next=null,this.key=i,this.data=e,this.left=null,this.right=null}return t}();function QR(t,i){return t>i?1:t<i?-1:0}function Un(t,i,e){for(var n=new Vn(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 Lf(t,i,e,n){var o=new Vn(t,i);if(e===null)return o.left=o.right=null,o;e=Un(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 Xw(t,i,e){var n=null,o=null;if(i){i=Un(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 kR(t,i,e){return i===null?t:(t===null||(i=Un(t.key,i,e),i.left=t),i)}function Of(t,i,e,n,o){if(t){n(""+i+(e?"└── ":"├── ")+o(t)+`
1878
+ `);var s=i+(e?" ":"│ ");t.left&&Of(t.left,s,!1,n,o),t.right&&Of(t.right,s,!0,n,o)}}var Nf=function(){function t(i){i===void 0&&(i=QR),this._root=null,this._size=0,this._comparator=i}return t.prototype.insert=function(i,e){return this._size++,this._root=Lf(i,e,this._root,this._comparator)},t.prototype.add=function(i,e){var n=new Vn(i,e);this._root===null&&(n.left=n.right=null,this._size++,this._root=n);var o=this._comparator,s=Un(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=Un(i,e,n);var s=n(i,e.key);return s===0?(e.left===null?o=e.right:(o=Un(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=Un(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=Un(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 JR(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&&Uf(i,e,0,o-1,s),this._root===null)this._root=Bf(i,e,0,o),this._size=o;else{var r=jR(this.toList(),KR(i,e),s);o=this._size+o,this._root=Vf({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 Of(this._root,"",!0,function(n){return e.push(n)},i),e.join("")},t.prototype.update=function(i,e,n){var o=this._comparator,s=Xw(i,this._root,o),r=s.left,l=s.right;o(i,e)<0?l=Lf(e,n,l,o):r=Lf(e,n,r,o),this._root=kR(r,l,o)},t.prototype.split=function(i){return Xw(i,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var i,e,n;return ZR(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 Bf(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 Vn(r,l);return c.left=Bf(t,i,e,s),c.right=Bf(t,i,s+1,n),c}return null}function KR(t,i){for(var e=new Vn(null,null),n=e,o=0;o<t.length;o++)n=n.next=new Vn(t[o],i[o]);return n.next=null,e.next}function JR(t){for(var i=t,e=[],n=!1,o=new Vn(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 Vf(t,i,e){var n=e-i;if(n>0){var o=i+Math.floor(n/2),s=Vf(t,i,o),r=t.head;return r.left=s,t.head=t.head.next,r.right=Vf(t,o+1,e),r}return null}function jR(t,i,e){for(var n=new Vn(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 Uf(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}Uf(t,i,e,l,o),Uf(t,i,l+1,n,o)}}const nn=11102230246251565e-32,Ct=134217729,e2=(3+8*nn)*nn;function Wf(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 t2(t,i){let e=i[0];for(let n=1;n<t;n++)e+=i[n];return e}function ca(t){return new Float64Array(t)}const i2=(3+16*nn)*nn,n2=(2+12*nn)*nn,o2=(9+64*nn)*nn*nn,js=ca(4),Yw=ca(8),Zw=ca(12),Qw=ca(16),bt=ca(4);function s2(t,i,e,n,o,s,r){let l,c,u,d,p,f,g,m,y,_,P,C,S,x,A,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,A=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=A-O,p=A-P,js[0]=A-(P+p)+(p-O),C=x+P,p=C-x,S=x-(C-p)+(P-p),P=S-R,p=S-P,js[1]=S-(P+p)+(p-R),N=C+P,p=N-C,js[2]=C-(N-p)+(P-p),js[3]=N;let w=t2(4,js),E=n2*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=o2*r+e2*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,A=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=A-O,p=A-P,bt[0]=A-(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=Wf(4,js,4,bt,Yw);x=V*d,f=Ct*V,g=f-(f-V),m=V-g,f=Ct*d,y=f-(f-d),_=d-y,A=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=A-O,p=A-P,bt[0]=A-(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=Wf(D,Yw,4,bt,Zw);x=l*d,f=Ct*l,g=f-(f-l),m=l-g,f=Ct*d,y=f-(f-d),_=d-y,A=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=A-O,p=A-P,bt[0]=A-(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=Wf(L,Zw,4,bt,Qw);return Qw[G-1]}function r2(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)>=i2*u?c:-s2(t,i,e,n,o,s,u)}const ha=(t,i)=>t.ll.x<=i.x&&i.x<=t.ur.x&&t.ll.y<=i.y&&i.y<=t.ur.y,Gf=(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 Wn=Number.EPSILON;Wn===void 0&&(Wn=Math.pow(2,-52));const a2=Wn*Wn,kw=(t,i)=>{if(-Wn<t&&t<Wn&&-Wn<i&&i<Wn)return 0;const e=t-i;return e*e<a2*t*i?0:t<i?-1:1};class l2{constructor(){this.reset()}reset(){this.xRounder=new Kw,this.yRounder=new Kw}round(i,e){return{x:this.xRounder.round(i),y:this.yRounder.round(e)}}}class Kw{constructor(){this.tree=new Nf,this.round(0)}round(i){const e=this.tree.add(i),n=this.tree.prev(e);if(n!==null&&kw(e.key,n.key)===0)return this.tree.remove(i),n.key;const o=this.tree.next(e);return o!==null&&kw(e.key,o.key)===0?(this.tree.remove(i),o.key):i}}const ua=new l2,Lh=(t,i)=>t.x*i.y-t.y*i.x,Jw=(t,i)=>t.x*i.x+t.y*i.y,jw=(t,i,e)=>{const n=r2(t.x,t.y,i.x,i.y,e.x,e.y);return n>0?-1:n<0?1:0},Oh=t=>Math.sqrt(Jw(t,t)),c2=(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 Lh(o,n)/Oh(o)/Oh(n)},h2=(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 Jw(o,n)/Oh(o)/Oh(n)},eC=(t,i,e)=>i.y===0?null:{x:t.x+i.x/i.y*(e-t.y),y:e},tC=(t,i,e)=>i.x===0?null:{x:e,y:t.y+i.y/i.x*(e-t.x)},u2=(t,i,e,n)=>{if(i.x===0)return tC(e,n,t.x);if(n.x===0)return tC(t,i,e.x);if(i.y===0)return eC(e,n,t.y);if(n.y===0)return eC(t,i,e.y);const o=Lh(i,n);if(o==0)return null;const s={x:e.x-t.x,y:e.y-t.y},r=Lh(s,i)/o,l=Lh(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:Gn.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:c2(this.point,i.point,s.point),cosine:h2(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 d2=0;class Gn{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=++d2,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 Gn(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=Gf(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=ha(e,l)&&this.comparePoint(l)===0,d=ha(n,s)&&i.comparePoint(s)===0,p=ha(e,c)&&this.comparePoint(c)===0,f=ha(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=u2(s,this.vector(),l,i.vector());return g===null||!ha(o,g)?null:ua.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 Gn(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=Gn.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 iC{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=ua.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=ua.round(i[r][0],i[r][1]);c.x===s.x&&c.y===s.y||(this.segments.push(Gn.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(Gn.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 p2{constructor(i,e){if(!Array.isArray(i))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new iC(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 iC(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 nC{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 p2(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 Nh{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 Nh(_.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 Nh(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;jw(p,i,f)!==0&&(e.push(p),i=p)}if(e.length===1)return null;const n=e[0],o=e[1];jw(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 oC{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 f2{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 oC(s));else{const r=s.enclosingRing();r.poly||e.push(new oC(r)),r.poly.addInterior(s)}}return e}}class g2{constructor(i){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Gn.compare;this.queue=i,this.tree=new Nf(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 sC=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,m2=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class v2{run(i,e,n){vi.type=i,ua.reset();const o=[new nC(e,!0)];for(let p=0,f=n.length;p<f;p++)o.push(new nC(n[p],!1));if(vi.numMultiPolys=o.length,vi.type==="difference"){const p=o[0];let f=1;for(;f<o.length;)Gf(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(Gf(g.bbox,o[m].bbox)===null)return[]}const s=new Nf(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>sC)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const r=new g2(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>sC)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(r.segments.length>m2)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()}ua.reset();const u=Nh.factory(r.segments);return new f2(u).getGeom()}}const vi=new v2;var y2={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 Bh(t,i,e){e===void 0&&(e={});var n=Di(t),o=Di(i),s=y2.intersection(n.coordinates,o.coordinates);return s.length===0?null:s.length===1?it(s[0],e.properties):of(s,e.properties)}function w2(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/Ri([o,c],[r,c],e),p=d*(r-o),f=i*2/Ri([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=_,A=(P-y)/(y-m/2),R=Math.floor(A),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)_2([q,X],p/2,g/2,JSON.parse(n),z,B).forEach(function(ee){e.mask?Bh(e.mask,ee)&&D.push(ee):D.push(ee)});else{var Q=C2([q,X],p/2,g/2,JSON.parse(n),z,B);e.mask?Bh(e.mask,Q)&&D.push(Q):D.push(Q)}}}return Ot(D)}function C2(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 _2(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 P2(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/Ri([s,r],[l,r],n),d=u*(l-s),p=e/Ri([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 A=r+C,R=0;R<_;R++){var O=it([[[S,A],[S,A+f],[S+d,A+f],[S+d,A],[S,A]]],n.properties);n.mask?YR(n.mask,O)&&o.push(O):o.push(O),A+=f}S+=d}return Ot(o)}function b2(t,i,e){return e===void 0&&(e={}),P2(t,i,i,e)}function S2(t,i,e){e===void 0&&(e={});for(var n=[],o=i/Ri([t[0],t[1]],[t[2],t[1]],e),s=o*(t[2]-t[0]),r=i/Ri([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?(Bh(e.mask,f)&&n.push(f),Bh(e.mask,g)&&n.push(g)):(n.push(f),n.push(g)),p+=l,d++}c++,u+=s}return Ot(n)}function E2(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($T(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=Lo(t),l;switch(n){case"point":case"points":l=x0(r,i,e);break;case"square":case"squares":l=b2(r,i,e);break;case"hex":case"hexes":l=w2(r,i,e);break;case"triangle":case"triangles":l=S2(r,i,e);break;default:throw new Error("invalid gridType")}var c=[];return Us(l,function(u){var d=0,p=0;Us(t,function(g){var m=n==="point"?u:MM(u),y=Ri(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=AM(u);f.properties[o]=d/p,c.push(f)}),Ot(c)}function x2(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 rC=(t=0)=>new Promise(i=>setTimeout(i,t));function A2(t,i){const e=Ot(t.map(c=>ht(c))),n=it([t]);return E2(e,i,{gridType:"point",units:"meters"}).features.map(c=>c.geometry.coordinates).filter(c=>Pt(ht(c),n))}function T2(t){const i=h.JulianDate.fromDate(t),e=h.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(i);return vr(e)}function M2(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 Ol=class Ol 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.czmPointPrimitiveCollection=this.dv(new mo(n,e.id));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=A2(u,d).map(S=>[...S,e.groundHeight]),f=Math.floor(e.height/d);if(f>0){const S=[...p];for(let x=1;x<=f;x++)p.push(...S.map(A=>[A[0],A[1],e.groundHeight+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 rC(),this._stopRun)break e;const x=new Date(g+S*_),A=T2(x);t:for(let R=0;R<p.length;R++){if(await rC(),this._stopRun)break t;x2(p[R],A,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:M2(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=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,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=o.groundHeight+o.height,c=[];return r.positions.forEach(u=>{c.push([u[0],u[1],o.groundHeight],[u[0],u[1],l])}),oe(s,o,n,c,e),!0}return!1}};v(Ol,"type",Ol.register("ESCesiumViewer",a.ESSunshineAnalysis.type,Ol));let Hf=Ol;const aC=(t=0)=>new Promise(i=>setTimeout(i,t)),Xo=class Xo 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=>{Hi(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=ao([...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=wy(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??Xo.defaults.interpolationDistance,d=this.interpolation??Xo.defaults.interpolation,p=this.offsetHeight??Xo.defaults.offsetHeight,f=this.drillDepth??Xo.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=R2(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=F2(g),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,m);P<0&&(m=lC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=z2(m,_);var x=lC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,A,A),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=er(g,S),O=[],N=[],V=O2(R);if(d&&u>0){var U=L2(R);const q=Math.max(U.maxy-U.miny,U.maxx-U.minx);var z=U2(V,U,u);const X=await $f(z,C,S,m,o.scene,p,f,q);var B=W2(R,u);const Q=await $f(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 $f([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=er([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=er(q,C)}var D=N2(O,V);const L=B2(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 D2([...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(Xo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let No=Xo;(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"])})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);async function D2(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 aC(),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 R2(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 F2(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 lC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function z2(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 er(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 L2(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 O2(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function N2(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=c_.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 B2(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+=V2(o)}return e}function V2(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 U2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)H2([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function W2(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=G2(n,o,i);e.push(...s)}return e}function G2(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 H2(t,i){var e=ht(t);if(!YR(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 $f(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=er(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 aC();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=er([P],e);C.forEach(x=>{x.z+=s}),P=er(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 Nl=class Nl extends qt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new No(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(Nl,"type",Nl.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Nl));let qf=Nl;async function $2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Bl=class Bl 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)),$2(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 A;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=(A=u.extensions)==null?void 0:A.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(Bl,"type",Bl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Bl));let Xf=Bl;const Vl=class Vl 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 A="——免费开源地球可视化开发包";m.innerText=A,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(Vl,"type",Vl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Vl));let Yf=Vl;const cC=h.Math.toDegrees,q2=new h.Cartographic;function hC(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,q2);return[cC(g.longitude),cC(g.latitude),g.height]}const Ul=class Ul 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=hC(_,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(Ul,"type",Ul.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Ul));let Zf=Ul;class da 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 Mi(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]])]]},A=[y,_,P,C],R=this.gridWidth,V=x0(A,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),A=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const R=h.Math.toDegrees,O=A.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=yy(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})})(da||(da={})),a.extendClassProps(da.prototype,da.createDefaultProps);const Wl=class Wl extends qt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new da(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(Wl,"type",Wl.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Wl));let Qf=Wl;const Gl=class Gl 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(Gl,"type",Gl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,Gl));let kf=Gl;const Hl=class Hl 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(Hl,"type",Hl.register("ESCesiumViewer",a.ESHumanPoi.type,Hl));let Kf=Hl;const $l=class $l 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 A=S[x];if(f.getProperty("id").toString()===A[0])return A[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($l,"type",$l.register("ESCesiumViewer",a.ESRtsTileset.type,$l));let Jf=$l;const ql=class ql extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(ql,"type",ql.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,ql));let jf=ql;const Xl=class Xl extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Xl,"type",Xl.register("ESCesiumViewer",a.ESMsTileset.type,Xl));let eg=Xl;const Yl=class Yl 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(Yl,"type",Yl.register("ESCesiumViewer",a.ESStaticMesh.type,Yl));let tg=Yl;const Zl=class Zl 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 vm(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(Zl,"type",Zl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Zl));let ig=Zl;class X2 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 Y2 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=wy(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??Xo.defaults.interpolationDistance,d=this.interpolation??Xo.defaults.interpolation,p=this.offsetHeight??Xo.defaults.offsetHeight,f=this.drillDepth??Xo.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=D2(g);if(isNaN(m.x)||isNaN(m.y)||isNaN(m.z)){console.warn("法向量计算错误!");return}var y=R2(g),_=h.Cartesian3.normalize(y,new h.Cartesian3),P=h.Cartesian3.dot(_,m);P<0&&(m=lC(m),g.reverse());let C=h.Transforms.eastNorthUpToFixedFrame(y),S=h.Matrix4.inverseTransformation(C,new h.Matrix4);if(Math.abs(P)<.999){const q=F2(m,_);var x=lC(y),A=h.Matrix4.fromTranslation(x,new h.Matrix4);S=h.Matrix4.multiply(q,A,A),C=h.Matrix4.inverse(S,new h.Matrix4)}var R=er(g,S),O=[],N=[],V=L2(R);if(d&&u>0){var U=z2(R);const q=Math.max(U.maxy-U.miny,U.maxx-U.minx);var z=V2(V,U,u);const X=await $f(z,C,S,m,o.scene,p,f,q);var B=U2(R,u);const Q=await $f(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 $f([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=er([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=er(q,C)}var D=O2(O,V);const L=N2(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 I2([...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(Xo,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let No=Xo;(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"])})})(No||(No={})),a.extendClassProps(No.prototype,No.createDefaultProps);async function I2(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 aC(),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 D2(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 R2(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 lC(t){return new h.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function F2(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 er(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 z2(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 L2(t){var i=[];return t.forEach(e=>{i.push([e.x,e.y])}),i.push(i[0]),i}function O2(t,i){var e=[];t.forEach(r=>{const l=[r.x,r.y];e.push(l)});var n=c_.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 N2(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+=B2(o)}return e}function B2(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 V2(t,i,e){for(var n=[],o=i.minx;o<i.maxx;o+=e)for(var s=i.miny;s<i.maxy;s+=e)G2([o,s],t)&&n.push(new h.Cartesian3(o,s,0));return n}function U2(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=W2(n,o,i);e.push(...s)}return e}function W2(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 G2(t,i){var e=ht(t);if(!XR(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 $f(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=er(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 aC();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=er([P],e);C.forEach(x=>{x.z+=s}),P=er(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 Nl=class Nl extends qt{constructor(e,n){super(e,n);v(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new No(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(Nl,"type",Nl.register("ESCesiumViewer",a.ESSurfaceAreaMeasurement.type,Nl));let qf=Nl;async function H2(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(i){console.log("复制失败")})}const Bl=class Bl 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)),H2(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 A;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=(A=u.extensions)==null?void 0:A.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(Bl,"type",Bl.register("ESCesiumViewer",a.ESViewerStatusBar.type,Bl));let Xf=Bl;const Vl=class Vl 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 A="——免费开源地球可视化开发包";m.innerText=A,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(Vl,"type",Vl.register("ESCesiumViewer",a.ESViewerStatusBarScale.type,Vl));let Yf=Vl;const cC=h.Math.toDegrees,$2=new h.Cartographic;function hC(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,$2);return[cC(g.longitude),cC(g.latitude),g.height]}const Ul=class Ul 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=hC(_,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(Ul,"type",Ul.register("ESCesiumViewer",a.ESVisibilityAnalysis.type,Ul));let Zf=Ul;class da 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 Mi(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]])]]},A=[y,_,P,C],R=this.gridWidth,V=x0(A,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),A=await g.promise(x);if(y===P-1?this.progress=Math.round(this.progress+100/P):this.progress+=100/P,A&&A.length){const R=h.Math.toDegrees,O=A.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=yy(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})})(da||(da={})),a.extendClassProps(da.prototype,da.createDefaultProps);const Wl=class Wl extends qt{constructor(e,n){super(e,n);v(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new da(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(Wl,"type",Wl.register("ESCesiumViewer",a.ESVolumeMeasurement.type,Wl));let Qf=Wl;const Gl=class Gl 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(Gl,"type",Gl.register("ESCesiumViewer",a.ESGeoExtrudedPolygon.type,Gl));let kf=Gl;const Hl=class Hl 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(Hl,"type",Hl.register("ESCesiumViewer",a.ESHumanPoi.type,Hl));let Kf=Hl;const $l=class $l 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 A=S[x];if(f.getProperty("id").toString()===A[0])return A[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($l,"type",$l.register("ESCesiumViewer",a.ESRtsTileset.type,$l));let Jf=$l;const ql=class ql extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(ql,"type",ql.register("ESCesiumViewer",a.ESRtsFeatureEditing.type,ql));let jf=ql;const Xl=class Xl extends Ds{constructor(i,e){if(super(i,e),!e.viewer){console.warn("viewer is undefined!");return}}};v(Xl,"type",Xl.register("ESCesiumViewer",a.ESMsTileset.type,Xl));let eg=Xl;const Yl=class Yl 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(Yl,"type",Yl.register("ESCesiumViewer",a.ESStaticMesh.type,Yl));let tg=Yl;const Zl=class Zl 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 vm(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(Zl,"type",Zl.register("ESCesiumViewer",a.ESSkylineAnalysis.type,Zl));let ig=Zl;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 X2 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 A=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(A.x,A.y,A.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 Z2{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 uC,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 Q2{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 uC{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 k2{constructor(i={}){v(this,"_config");v(this,"_coordinator");v(this,"_renderer");v(this,"_store");if(this._config={...Bt,...i},this._coordinator=new uC,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 Q2(this._config),this._store=new Z2(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 K2=t=>new k2(t),Ql=class Ql 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 Y2(this,n):new X2(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=K2({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=J2(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(Ql,"type",Ql.register("ESCesiumViewer",a.ESHeatMap.type,Ql));let ng=Ql;function J2(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 kl=class kl 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 mo(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(kl,"type",kl.register("ESCesiumViewer",a.ESGeoPoints.type,kl));let og=kl;const Yo=class Yo extends Wt{constructor(e){super();v(this,"_config",this.disposeVar(a.react(Yo.defaultConfig)));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Yo.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 j2(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(Yo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),v(Yo,"defaultPointerEventFilterFunc",e=>e.button===0),v(Yo,"defaults",{...Wt.defaults,position:[116.39,39.9,0]});let Ni=Yo;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Ni||(Ni={})),a.extendClassProps(Ni.prototype,Ni.createDefaultProps);class j2 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 eF(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 eF extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Yg(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 sg(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(sg(i,ci.defaults.xAxisColor)),n=this.disposeVar(sg(i,ci.defaults.yAxisColor)),o=this.disposeVar(sg(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 Hn=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})})(Hn||(Hn={})),a.extendClassProps(Hn.prototype,Hn.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 Hn(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{dC(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 Hn(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(!jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?eo(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(!vc(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(!jo(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 mu(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],dC(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&&ou(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(A=>{A.pointerEvent&&_(A.pointerEvent)})),await a.step(x,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.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 A=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,A,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,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),A.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 on=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})})(on||(on={})),a.extendClassProps(on.prototype,on.createDefaultProps);function dC(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 rg 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 Zg(this.scene,n,this.normal,o)}}class tF extends rg{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 iF extends rg{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 nF extends rg{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 tr 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(oF(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(sF(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(tr,"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})})(tr||(tr={})),a.extendClassProps(tr.prototype,tr.createDefaultProps);function oF(t){return _u({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 sF(t){return _u({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 A=h.Cartesian3.fromDegrees(C,x,o.heatmap._renderer._min);g.push(A.x,A.y,A.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 Y2{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 uC,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 Z2{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 uC{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 Q2{constructor(i={}){v(this,"_config");v(this,"_coordinator");v(this,"_renderer");v(this,"_store");if(this._config={...Bt,...i},this._coordinator=new uC,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 Z2(this._config),this._store=new Y2(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 k2=t=>new Q2(t),Ql=class Ql 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 X2(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=k2({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=K2(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(Ql,"type",Ql.register("ESCesiumViewer",a.ESHeatMap.type,Ql));let ng=Ql;function K2(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 kl=class kl 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 mo(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(kl,"type",kl.register("ESCesiumViewer",a.ESGeoPoints.type,kl));let og=kl;const Yo=class Yo extends Wt{constructor(e){super();v(this,"_config",this.disposeVar(a.react(Yo.defaultConfig)));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_pointerEventFilterFunc",this.disposeVar(a.react(Yo.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 J2(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(Yo,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),v(Yo,"defaultPointerEventFilterFunc",e=>e.button===0),v(Yo,"defaults",{...Wt.defaults,position:[116.39,39.9,0]});let Ni=Yo;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),position:a.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Ni||(Ni={})),a.extendClassProps(Ni.prototype,Ni.createDefaultProps);class J2 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 j2(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 j2 extends a.Destroyable{constructor(i,e,n){super(),this._owner=i;const{czmViewer:o}=this._owner,s=Yg(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 sg(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(sg(i,ci.defaults.xAxisColor)),n=this.disposeVar(sg(i,ci.defaults.yAxisColor)),o=this.disposeVar(sg(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 Hn=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})})(Hn||(Hn={})),a.extendClassProps(Hn.prototype,Hn.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 Hn(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{dC(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 Hn(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(!jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="y"?eo(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(!vc(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(!jo(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 mu(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],dC(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&&ou(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(A=>{A.pointerEvent&&_(A.pointerEvent)})),await a.step(x,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.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 A=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,A,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,A=>new Promise((R,O)=>{A.disposer.dispose(O),A.disposer.dispose(e.pointerUpEvent.don(()=>{R()})),A.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 on=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})})(on||(on={})),a.extendClassProps(on.prototype,on.createDefaultProps);function dC(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 rg 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 Zg(this.scene,n,this.normal,o)}}class eF extends rg{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 tF extends rg{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 iF extends rg{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 tr 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(nF(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(oF(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(tr,"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})})(tr||(tr={})),a.extendClassProps(tr.prototype,tr.createDefaultProps);function nF(t){return _u({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 oF(t){return _u({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中的一一匹配!
@@ -1921,7 +1921,7 @@ void main()
1921
1921
  {
1922
1922
  out_FragColor = u_color;
1923
1923
  }
1924
- `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},De,t)}class rF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[yi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const m=ag(f,g,d.normal),y=ag(d.origin,f,d.normal),_=ag(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[yi.rotationNum[u]]=n.startRotation+m,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=_}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[yi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Wi(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function ag(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const Zo=class Zo extends Zt{constructor(e){super();v(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));v(this,"_movingPlaneType",this.disposeVar(a.react("none")));v(this,"_circles");v(this,"_czmCameraModel");v(this,"_cartesian");v(this,"_planes",{heading:this.disposeVar(new tF(this)),pitch:this.disposeVar(new iF(this)),roll:this.disposeVar(new nF(this))});v(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new rF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Le(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new rt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new tr(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=Zo.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[Zo.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[Zo.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};v(Zo,"rotationNum",{heading:0,pitch:1,roll:2}),v(Zo,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let yi=Zo;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(yi||(yi={})),a.extendClassProps(yi.prototype,yi.createDefaultProps);const Qo=class Qo extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Qo.defaults.positions[0],this.stopPosition??Qo.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Qo.defaults.positions[0],i??Qo.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new be(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};v(Qo,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Bo=Qo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(Bo||(Bo={})),a.extendClassProps(Bo.prototype,Bo.createDefaultProps);class sn extends Zt{constructor(e){super();v(this,"_lastPosition");v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),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,"_scaleAxis");v(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const m=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=m:p-=m),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=m:f-=m),p<=0&&(p+=m),f<=0&&(f+=m),this.scale=[p??1,f??1,this.scale[2]??1]})})));v(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!vc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);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];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new mu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=sn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const m=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{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((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??sn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ou(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(m=>{m.pointerEvent&&u(m.pointerEvent)})),await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const m=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,m,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),m.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new Bo(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(sn||(sn={})),a.extendClassProps(sn.prototype,sn.createDefaultProps);const Kn=class Kn extends Wt{constructor(e){super();v(this,"_editingPoints",this.disposeVar(new a.ObservableArray));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_currentProcess");v(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));v(this,"_status",this.disposeVar(a.react("None")));v(this,"_positionsChanged",this.ad(new a.Event));v(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??Kn.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??Kn.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new be(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};v(Kn,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),v(Kn,"defaults",{...Wt.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Kn.baseImageUrl+"point-green.png",otherControlPointImageUrl:Kn.baseImageUrl+"point-yellow.png"});let ri=Kn;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let aF=0;class pC extends a.Destroyable{constructor(e,n){super();v(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_id",aF++);v(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new as(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class fC extends pC{constructor(i,e){super(i,e)}}class Xe extends ri{constructor(e){super(e);v(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));v(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Ni(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Xe.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new fC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Xe.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new lF(this,s)));const d=l.disposer.disposeVar(new hF(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Xe||(Xe={})),a.extendClassProps(Xe.prototype,Xe.createDefaultProps);class lF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new fC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Xe.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Xe.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function cF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class hF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(cF(e,n)))),(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class gC extends Xe{constructor(i){super(i),this.loop=!1}}class mC extends Xe{constructor(i){super(i),this.loop=!0}}class Vh extends pC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??Ee.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??Ee.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??Ee.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=lu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??Ee.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??Ee.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Vh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class Ee extends ri{constructor(e){super(e);v(this,"_menuPoiCommand",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new uF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new on(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??Ee.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new dF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??Ee.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Ee.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Ee.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=lu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Vh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??Ee.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Vh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(Ee||(Ee={})),a.extendClassProps(Ee.prototype,Ee.createDefaultProps);class uF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class dF extends a.Destroyable{constructor(e){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new pF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class pF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class vC extends Ee{constructor(i){super(i),this.loop=!1}}class yC extends Ee{constructor(i){super(i),this.loop=!0}}class ir extends Xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(ir||(ir={})),a.extendClassProps(ir.prototype,ir.createDefaultProps);class Vo extends Ee{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(Vo||(Vo={})),a.extendClassProps(Vo.prototype,Vo.createDefaultProps);class wC extends Xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class CC extends Ee{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class nr extends Xe{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class or extends Ee{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class _C extends Vo{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class _t extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);v(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Xe&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning)){if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}}else this.currentEditing instanceof Ni&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Kl=class Kl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Ni(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};v(Kl,"type",Kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,Kl));let lg=Kl;const Jl=class Jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};v(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,Jl));let cg=Jl;const jl=class jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};v(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,jl));let hg=jl;const ec=class ec extends _t{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new on(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=It({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=It({originPosition:r},[u.position])[0][0];u.position=yn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=It({originPosition:r},u.points)[0];u.points=yn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=It({originPosition:r},[s])[0][0];const c=It({originPosition:r},o.points)[0];o.points=yn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};v(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,ec));let Uh=ec;const tc=class tc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new ir(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(Ke([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Le(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Wi(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};v(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,tc));let ug=tc;const ic=class ic extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new Vo(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(Ke([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Le(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Wi(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,ic));let dg=ic;const nc=class nc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new mC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};v(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,nc));let pg=nc;const oc=class oc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};v(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,oc));let fg=oc;const sc=class sc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new gC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};v(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,sc));let gg=sc;const rc=class rc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new vC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};v(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,rc));let mg=rc;const ac=class ac extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};v(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,ac));let vg=ac;const lc=class lc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};v(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,lc));let yg=lc;const cc=class cc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};v(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,cc));let wg=cc;const hc=class hc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};v(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,hc));let Cg=hc;const uc=class uc extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new _C(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=[a.ESClassification,a.ESPolygonFence,a.ESSunshineAnalysis].some(m=>s instanceof m);let d=a.getMinMaxCorner(s.points).center;d[2]=s.points[0][2];let p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(m=>[m[0],m[1],m[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(uc,"type",uc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,uc));let _g=uc;const ot=class ot extends a.Destroyable{constructor(e,n,o,s=!0){super();v(this,"editingModes",[]);v(this,"editingID");v(this,"useKeyToSwitch");v(this,"currentIndex",0);v(this,"currentEditingMode");v(this,"currentEditingWrapper");v(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));v(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(ot.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_ESCAPE&&ot.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===ot.MOUSE_LEFT&&a.nextAnimateFrame(()=>{ot.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&ot.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){ot.stop(),ot.esEditModeInstance=new ot(e,n,o,s)}static stop(){const e=ot.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}ot.esEditModeInstance=void 0}};v(ot,"KEY_ESCAPE","Escape"),v(ot,"KEY_SPACE","Space"),v(ot,"MOUSE_LEFT",0),v(ot,"esEditModeInstance");let Wh=ot;function PC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Uh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class fF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.registerCreatedEventUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class gF extends a.Destroyable{constructor(e){super();v(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new fF(e,n)}))}}class mF extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new vF(i)}))}}class vF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new yF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class yF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class wF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class CF extends a.Destroyable{constructor(e){var r;super();v(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Po(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function _F(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.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}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function PF(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function bF(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function SF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function EF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function xF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),m=new s,y=new s;d.prototype.createMesh=function(_){_=_??ye.Frozen.EMPTY_OBJECT;const P=_.tilingScheme,C=_.x,S=_.y,x=_.level,A=_.exaggeration??1,R=_.exaggerationRelativeHeight??0,O=_.throttle??!0,N=P.ellipsoid;P.tileXYToNativeRectangle(C,S,x,m),P.tileXYToRectangle(C,S,x,y);const V=N.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const z=(O?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:m,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:N,skirtHeight:this._skirtHeight,exaggeration:A,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(z))return;const B=this;return z.then(function(w){return B._mesh=new u(V,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,i.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),c.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),B._minimumHeight=w.minimumHeight,B._maximumHeight=w.maximumHeight,B._buffer=void 0,B._mesh})}}function AF(){return h.VERSION.split(".").map(i=>parseInt(i))}let Pg;function TF(){return Pg||(Pg=AF()),Pg}function MF(){const t=TF();t[0]===1&&t[1]>=92?xF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function IF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function DF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function RF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const FF=`#ifdef GL_OES_standard_derivatives
1924
+ `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},De,t)}class sF extends a.HasOwner{constructor(i){super(i);const{czmViewer:e}=this.owner;let n;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(s=>{const r=n=this._getStartInfo(s.pointerEvent);r&&(this.owner.hoveredPlaneType=r.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(s=>{n&&n.currentPlaneType!=="none"&&(o.restart(void 0,e,n),n=void 0)})),this.dispose(e.dblclickEvent.disposableOn(s=>{const r=this._getStartInfo(s.pointerEvent);if(r&&r.currentPlaneType!=="none"){const{currentPlaneType:l}=r,c=[...this.owner.selfRotation];c[yi.rotationNum[l]]=0,this.owner.selfRotation=c;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(a.createProcessingFromAsyncFunc(async(i,e,n)=>{const o=this.owner.circles[n.currentPlaneType];e.incrementDisabledInputStack(),i.disposer.dispose(()=>e.decrementDisabledInputStack()),i.disposer.dispose(e.pointerMoveEvent.don(s=>{if(n&&s.pointerEvent){const{offsetX:r,offsetY:l}=s.pointerEvent,c=[r,l],{currentPlaneType:u}=n;if(u==="none")return;const d=this.owner.getPlane(u);if(!n.currentV)return;const p=d.pick(c);if(!p||!this.owner.cartesian)return;const f=h.Cartesian3.subtract(n.currentV,this.owner.cartesian,new h.Cartesian3);h.Cartesian3.normalize(f,f);const g=h.Cartesian3.subtract(p,this.owner.cartesian,new h.Cartesian3);if(h.Cartesian3.normalize(g,g),!d.normal||!d.origin)return;const m=ag(f,g,d.normal),y=ag(d.origin,f,d.normal),_=ag(d.origin,g,d.normal);{const P=[...this.owner.selfRotation];P[yi.rotationNum[u]]=n.startRotation+m,this.owner.selfRotation=P,o.circleStartRotation=y,o.circleEndRotation=_}}})),this.owner.movingPlaneType=n.currentPlaneType,i.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),i.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await a.step(i,s=>new Promise((r,l)=>{s.disposer.dispose(l),s.disposer.dispose(e.pointerUpEvent.don(()=>{r()})),s.disposer.dispose(e.pointerOutEvent.don(()=>{r()}))}))}))}_pickPlane(i,e,n,o,s){const r=this.owner.cartesian;if(!r)return;const{selfRotation:l}=this.owner,c=this.owner.getPlane(n).pick(o);if(!c)return;const u=h.Cartesian3.distance(r,c),d=s/4,p=d*3/128;if(!(u>=d-p&&u<=d+p))return;const g=h.Cartesian3.distance(e.camera.positionWC,c);i.currentD2c<=g||(i.currentPlaneType=n,i.currentD2c=g,i.currentV=c,i.startRotation=l[yi.rotationNum[n]])}_getStartInfo(i){var d;const{czmViewer:e}=this.owner,n=(d=e.viewer)==null?void 0:d.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Wi(n,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:s,offsetY:r}=i,l=[s,r],c=i.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:c};return this._pickPlane(u,n,"heading",l,o),this._pickPlane(u,n,"pitch",l,o),this._pickPlane(u,n,"roll",l,o),u}}function ag(t,i,e){const n=h.Cartesian3.cross(i,t,new h.Cartesian3);if(n.equals(h.Cartesian3.ZERO))return 0;h.Cartesian3.normalize(n,n);const o=h.Cartesian3.dot(n,e);let s=Math.acos(h.Cartesian3.dot(t,i))*180/Math.PI;return s=o>0?s:-s,s}const Zo=class Zo extends Zt{constructor(e){super();v(this,"_hoveredPlaneType",this.disposeVar(a.react("none")));v(this,"_movingPlaneType",this.disposeVar(a.react("none")));v(this,"_circles");v(this,"_czmCameraModel");v(this,"_cartesian");v(this,"_planes",{heading:this.disposeVar(new eF(this)),pitch:this.disposeVar(new tF(this)),roll:this.disposeVar(new iF(this))});v(this,"_rotatorRunningResetting");this._czmViewer=e;const n=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new a.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new sF(this)})),this._circles={heading:this._createRotatorCircle(n,"heading"),pitch:this._createRotatorCircle(n,"pitch"),roll:this._createRotatorCircle(n,"roll")},!!n.viewer){{const s=()=>{this._cartesian=this.position&&Le(this.position)||void 0};s(),this.dispose(this.positionChanged.disposableOn(s))}this._createCameraModel(n)}}get hoveredPlaneType(){return this._hoveredPlaneType.value}set hoveredPlaneType(e){this._hoveredPlaneType.value=e}get hoveredPlaneTypeChanged(){return this._hoveredPlaneType.changed}get movingPlaneType(){return this._movingPlaneType.value}set movingPlaneType(e){this._movingPlaneType.value=e}get movingPlaneTypeChanged(){return this._movingPlaneType.changed}get circles(){return this._circles}get czmCameraModel(){return this._czmCameraModel}get cartesian(){return this._cartesian}get czmViewer(){return this._czmViewer}getPlane(e){return this._planes[e]}get rotatorRunningResetting(){return this._rotatorRunningResetting}_createCameraModel(e){this._czmCameraModel=new rt(e),this._czmCameraModel.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._czmCameraModel.localRotation=[90,0,0],this._czmCameraModel.allowPicking=!1,this._czmCameraModel.opaquePass="OVERLAY",this.dispose(a.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],n=>n*.1)),this.dispose(a.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(a.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const n=()=>{const o=Ie({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=h.Matrix4.toArray(o))};n(),this.dispose(this.selfRotationChanged.disposableOn(n))}{const n=()=>{this.circles.heading.show=this.enabled,this.circles.pitch.show=this.enabled,this.circles.roll.show=this.enabled,this._czmCameraModel&&(this._czmCameraModel.show=this.enabled&&this.showHelper)};n(),this.dispose(this.enabledChanged.disposableOn(n)),this.dispose(this.showHelperChanged.disposableOn(n))}}_createRotatorCircle(e,n){const o=this.ad(new tr(e));this.dispose(a.track([o,"position"],[this,"position"])),this.dispose(a.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(a.track([o,"debug"],[this,"debug"])),this.dispose(a.track([o,"rotation"],[this,"rotation"]));{const s=()=>{o.selfRotation=Zo.rotationFuncs[n](this.selfRotation),o.circleRotation=this.selfRotation[Zo.rotationNum[n]]};s(),this.dispose(this.selfRotationChanged.disposableOn(s))}{const s=()=>{const r=this.movingPlaneType===n,l=this.hoveredPlaneType===n,u=[0,0,0,r||l?1:.8];u[Zo.rotationNum[n]]=1,o.color=u};s(),this.dispose(this.movingPlaneTypeChanged.disposableOn(s)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(s))}return o}};v(Zo,"rotationNum",{heading:0,pitch:1,roll:2}),v(Zo,"rotationFuncs",{heading:([e,n,o])=>[0,0,0],pitch:([e,n,o])=>[e,0,-90],roll:([e,n,o])=>[e,n+90,0]});let yi=Zo;(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),rotation:a.reactArray([0,0,0]),selfRotation:a.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(yi||(yi={})),a.extendClassProps(yi.prototype,yi.createDefaultProps);const Qo=class Qo extends a.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(i){this.positions=[i??Qo.defaults.positions[0],this.stopPosition??Qo.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(i){this.positions=[this.startPosition??Qo.defaults.positions[0],i??Qo.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(i,e){if(super(),!i.viewer)return;const o=this.ad(new be(i,e));o.arcType="RHUMB";const s=this.ad(new ti(i,e));this.ad(a.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(a.track([s,"allowPicking"],[this,"allowPicking"]));{const r=()=>{o.show=s.show=this.show};r(),this.ad(this.showChanged.don(r))}{const r=()=>{o.width=this.width/2,s.pixelSize=this.width};r(),this.ad(this.widthChanged.don(r))}{const r=()=>{o.color=s.color=this.color};r(),this.ad(this.colorChanged.don(r))}{const r=()=>{o.positions=this.positions,s.position=this.stopPosition};r(),this.dispose(this.startPositionChanged.disposableOn(r)),this.dispose(this.stopPositionChanged.disposableOn(r))}}};v(Qo,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let Bo=Qo;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:a.reactPositions(t.defaults.positions),width:10,color:a.reactArray([1,0,0,1])})})(Bo||(Bo={})),a.extendClassProps(Bo.prototype,Bo.createDefaultProps);class sn extends Zt{constructor(e){super();v(this,"_lastPosition");v(this,"_opInfo",{step:this.ad(a.react(!1)),moved:this.ad(a.react(!1)),constraintMode:this.disposeVar(a.react("none")),originPosition:this.disposeVar(a.reactArray([0,0,0])),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,"_scaleAxis");v(this,"_pickingXYProcessing",e=>this.disposeVar(new a.Processing((n,o,s)=>{const r=[0,0,0],l=new h.Cartographic;return e.pointerMoveEvent.disposableOn(c=>{if(!c.pointerEvent||!e.viewer)return;const u=ui(a.getDomEventCurrentTargetPos(c.pointerEvent));if(!jo(e.viewer.scene,u,this._opInfo.originPosition.value[2],l))return;Jn(l,r),this._opInfo.constraintMode.value==="x"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value,r,r):this._opInfo.constraintMode.value==="y"?eo(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,r,r):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=r,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const d=[0,0,0];a.geoRhumbDestination(r,s,o,d),this._opInfo.targetPosition.value=d;let p=this.scale[0],f=this.scale[1];const g=a.geoDistance(d,this._opInfo.originPosition.value)-a.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...d];const m=this._opInfo.originDimensions.value[0]/100;g!=0&&this._opInfo.constraintMode.value==="y"&&(g>0?p+=m:p-=m),g!=0&&this._opInfo.constraintMode.value==="x"&&(g>0?f+=m:f-=m),p<=0&&(p+=m),f<=0&&(f+=m),this.scale=[p??1,f??1,this.scale[2]??1]})})));v(this,"_pickingZProcessing",e=>this.disposeVar(new a.Processing(()=>{const n=new h.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(s=>{if(!s.pointerEvent||!e.viewer)return;const r=ui(a.getDomEventCurrentTargetPos(s.pointerEvent));if(!vc(e.viewer.scene,Le(this._opInfo.originPosition.value),r,n))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);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];let u=this.scale[2];const d=o[2]-this._lastPosition[2];this._lastPosition=[...o];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&(d>0?u+=p:u-=p),u<=0&&(u+=p),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const n=e.viewer;if(!n)return;const{scene:o}=n;this.ad(new mu(e,this.positionReact,this._opInfo.originDimensions,this.axisPixelSize)),this.ad(e.dblclickEvent.don(()=>{this.enabled=!1})),this._scaleAxis={zAxis:this._createScaleAxis(e,"zAxis"),yAxis:this._createScaleAxis(e,"yAxis"),xAxis:this._createScaleAxis(e,"xAxis")};{const s=()=>{if(!this._scaleAxis)return;const{zAxis:r,yAxis:l,xAxis:c}=this._scaleAxis,u=this._opInfo.constraintMode.value,d=this._opInfo.step;r.color=[0,0,1,.99],l.color=[0,1,0,.99],c.color=[1,0,0,.99],u==="x"?c.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="y"?l.color=d?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(r.color=d?[1,1,0,.8]:[1,1,0,.99])};s(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(s)),this.dispose(this._opInfo.step.changed.disposableOn(s))}{const s=()=>{if(!this._scaleAxis)return;const{position:l=sn.defaults.position}=this,{zAxis:c,yAxis:u,xAxis:d}=this._scaleAxis;c.startPosition=u.startPosition=d.startPosition=l;const[p,f,g]=l;c.stopPosition=[p,f,g+this._opInfo.originDimensions.value[2]];const m=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[0],90);m&&(d.stopPosition=m);const y=a.geoRhumbDestination(l,this._opInfo.originDimensions.value[1],0);y&&(u.stopPosition=y)};s();const r=this.ad(a.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(r.don(s))}{const s=()=>{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((r,l)=>r===this._opInfo.targetPosition.value[l])){this._opInfo.moved.value=!0;return}};s(),this.dispose(this._opInfo.originHeading.changed.disposableOn(s)),this.dispose(this._opInfo.originPosition.changed.disposableOn(s)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(s)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(s))}{const s=this._pickingXYProcessing(e),r=this._pickingZProcessing(e),l=()=>{const f=[...this.position??sn.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},c={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const g={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ou(f,o,g,this.axisSnapPixelSize,c),this._opInfo.constraintMode.value=c.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=c.startDragPos},d=this.disposeVar(a.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await a.step(f,async g=>{g.disposer.dispose((l(),this.positionChanged.disposableOn(l))),g.disposer.dispose(e.pointerMoveEvent.disposableOn(m=>{m.pointerEvent&&u(m.pointerEvent)})),await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerDownEvent.don(P=>{P.pointerEvent&&u(P.pointerEvent),P.pointerEvent&&P.pointerEvent.button===0&&c.constraintMode!=="none"&&y()}))}))}),this._opInfo.step.value=!1,await a.step(f,async g=>{if(e.incrementDisabledInputStack(),g.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const m=a.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),y=a.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);s.restart(void 0,m,y),g.disposer.dispose(()=>s.cancel())}else this._opInfo.constraintMode.value==="z"&&(r.restart(),g.disposer.dispose(()=>r.cancel()));await a.step(g,m=>new Promise((y,_)=>{m.disposer.dispose(_),m.disposer.dispose(e.pointerUpEvent.don(()=>{y()})),m.disposer.dispose(e.pointerOutEvent.don(()=>{y()}))})),this._lastPosition=void 0}),d.restart()})),p=()=>{this.enabled?d.restart():d.isRunning&&d.cancel()};p(),this.dispose(this.enabledChanged.disposableOn(p))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,n){const o=this.ad(new Bo(e));return o.width=10,this.ad(a.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...Zt.createDefaultProps(),scale:a.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(sn||(sn={})),a.extendClassProps(sn.prototype,sn.createDefaultProps);const Kn=class Kn extends Wt{constructor(e){super();v(this,"_editingPoints",this.disposeVar(new a.ObservableArray));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_currentProcess");v(this,"_menuPoiEnabled",this.disposeVar(a.react(!1)));v(this,"_status",this.disposeVar(a.react("None")));v(this,"_positionsChanged",this.ad(new a.Event));v(this,"_cursorInfo");this._czmViewer=e,this.enabled=!1,this.createPolyline(e),this._createCursorInfo(e),this.dispose(()=>this.resetPositions()),this.dispose(()=>this.editingPoints.length=0),this.dispose(this.editingPoints.changedEvent.disposableOn(()=>this.positionsChanged.emit())),this.dispose(this.editingPoints.toChangeEvent.disposableOn(n=>{for(let{start:o,deleteCount:s,items:r}of n){for(const l of r)l.menuPoi.enabled=this.menuPoiEnabled??!1;for(let l=o;l<o+s;++l)this.editingPoints.get(l).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let n of this.editingPoints)n.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(n=>{this.ad(()=>{var o;((o=n.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(n=>{this._currentProcess&&(n?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const n=()=>{this.polylineShow=this.czmViewer.editingLineShow};n(),this.ad(this.czmViewer.editingLineShowChanged.don(n))}}get editingPoints(){return this._editingPoints}get cancelEvent(){return this._cancelEvent}cancel(){this._cancelEvent.emit()}get currentProcess(){return this._currentProcess}set currentProcess(e){this._currentProcess=e}get menuPoiEnabled(){return this._menuPoiEnabled.value}set menuPoiEnabled(e){this._menuPoiEnabled.value=e}get menuPoiEnabledChanged(){return this._menuPoiEnabled.changed}get status(){return this._status.value}get statusChanged(){return this._status.changed}set status(e){this._status.value=e}getPositions(){const e=[];for(let n of this._editingPoints)n.position&&e.push([...n.position]);return e}resetPositions(e){if(this.enabled??Kn.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const n=e||[];return!(n.length===this.editingPoints.length&&n.every((o,s)=>o.every((r,l)=>{const c=this.editingPoints.get(s);return c.position&&c.position[l]===r})))}forceResetPositions(e){(this.enabled??Kn.defaults.enabled)&&(this.enabled=!1),this.resetPositions(e)}get positions(){return this.getPositions()}set positions(e){this.resetPositions(e)}get positionsChanged(){return this._positionsChanged}get czmViewer(){return this._czmViewer}get cursorInfo(){return this._cursorInfo}createPolyline(e){const n=this.ad(new be(e));this.ad(a.track([n,"color"],[this,"polylineColor"])),this.ad(a.track([n,"width"],[this,"polylineWidth"])),this.ad(a.track([n,"show"],[this,"polylineShow"])),this.ad(a.track([n,"arcType"],[this,"polylineArcType"])),this.ad(a.track([n,"loop"],[this,"loop"]));{const o=()=>{const s=[];for(const r of this.getPositions())r[2]-=e.editingHeightOffset??0,s.push(r);n.positions=s};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const n=this._cursorInfo=this.ad(new a.CursorInfo(e.container,a.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(n){if(!this.hideCursorInfo){n.show=!1;return}o==="Adding"?(n.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",n.show=!0):o==="Modifying"||o==="Modifying_Point"?(n.text="Esc键或左键双击:退出编辑状态",n.show=!0):o==="None"&&(n.text="",n.show=!1)}}))}};v(Kn,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),v(Kn,"defaults",{...Wt.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:Kn.baseImageUrl+"point-green.png",otherControlPointImageUrl:Kn.baseImageUrl+"point-yellow.png"});let ri=Kn;(t=>{t.createDefaultProps=()=>({...Wt.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:a.reactArray([1,1,1,1]),polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,firstControlPointImageUrl:t.baseImageUrl+"point-green.png",otherControlPointImageUrl:t.baseImageUrl+"point-yellow.png",hideCursorInfo:!1,middlePointShow:!0})})(ri||(ri={})),a.extendClassProps(ri.prototype,ri.createDefaultProps);let rF=0;class pC extends a.Destroyable{constructor(e,n){super();v(this,"_position",this.disposeVar(a.reactArrayWithUndefined(void 0)));v(this,"_id",rF++);v(this,"_menuPoi");n&&(this.position=n),e.debug&&console.log(`PolylinePositionEditor creating! ${this.id}`),this.dispose(()=>{e.debug&&console.log(`PolylinePositionEditor destroying! ${this.id}`)});const o=this._menuPoi=this.ad(new as(e.czmViewer));o.enabled=!1,this.ad(a.track([o,"show"],[e,"enabled"]));{const s=()=>{if(this.position===void 0){o.position=void 0;return}const r=[...this.position];r[2]-=e.czmViewer.editingHeightOffset??0,o.position=r,e.positionsChanged.emit()};s(),this.d(this.positionChanged.don(s))}{const s=()=>{const r=e.editingPoints.indexOf(this)+1;r!==0&&(o.title=`控制点${r}`,r===1?o.imageUri=e.firstControlPointImageUrl??ri.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ri.defaults.otherControlPointImageUrl)};s(),this.dispose(e.editingPoints.changedEvent.disposableOn(s))}}get position(){return this._position.value}set position(e){this._position.value=e}get positionChanged(){return this._position.changed}get id(){return this._id}get menuPoi(){return this._menuPoi}}class fC extends pC{constructor(i,e){super(i,e)}}class Xe extends ri{constructor(e){super(e);v(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new a.Event));v(this,"placeEditing");if(!e.viewer)return;const n=this.placeEditing=this.ad(new Ni(e));n.enabled=!1,this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Xe.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Xe.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(a.step(o,async s=>{const r=s.disposer,l=r.ad(this._addingEditingProcessing());r.dispose(()=>"adding canceled!"),r.dispose(this.cancelEvent.disposableOn(()=>l.cancel())),await s.promise(new Promise(c=>{r.dispose(l.completeEvent.disposableOnce(c))}))}))})),this.dispose(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new fC(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Xe.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},n=a.createProcessingFromAsyncFunc(async o=>{let s=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(a.step(o,async l=>{let c;!e()&&(c=l.disposer.disposeVar(new aF(this,s)));const d=l.disposer.disposeVar(new cF(this,s));return l.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>d.do())),await l.promise(new Promise(p=>{c&&l.disposer.dispose(c.overEvent.disposableOnce(f=>{f?(s++,p(!0)):p(!1)})),l.disposer.dispose(d.overEvent.disposableOnce(f=>{f?(s--,p(!0)):p(!1)})),l.disposer.dispose(this.cancelEvent.disposableOn(()=>p(!1)))}))}))&&n.restart()});return n.start(),n}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps()})})(Xe||(Xe={})),a.extendClassProps(Xe.prototype,Xe.createDefaultProps);class aF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));const{placeEditing:o}=e;let s=new fC(e,void 0);e.editingPoints.splice(n,0,s);const r=()=>{(e.debug??Xe.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(s);if(u===-1)throw new Error("currentPosEditor not found");e.editingPoints.splice(u,1)};if(o.enabled??!1)throw console.error("placeEditing.enabled is true!"),new Error("placeEditing.enabled is true!");this.dispose(a.track([s,"position"],[o,"position"])),o.enabled=!0;let l=!1;const c=()=>{r(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!l&&c()}),this.dispose(o.overEvent.disposableOnce(()=>{l=!0,s.position===void 0?c():this._overEvent.emit(!0)})),(e.debug??Xe.defaults.debug)&&console.log(`PointAdding creating! index(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PointAdding destroying! index(${n})`)})}get overEvent(){return this._overEvent}}function lF(t,i){const e=t.editingPoints,n=i-1;return n<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(n,1),!0)}class cF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_doEvent",this.disposeVar(new a.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(lF(e,n)))),(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${n})`),this.dispose(()=>{(e.debug??Xe.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${n})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class gC extends Xe{constructor(i){super(i),this.loop=!1}}class mC extends Xe{constructor(i){super(i),this.loop=!0}}class Vh extends pC{constructor(i,e){super(i,e);{const{menuPoi:n}=this;n.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],n.clickCommandName="modify",n.rightClickCommandName="delete",this.dispose(n.commandEvent.disposableOn(o=>{i.menuPoiCommand(this,o)})),this.dispose(n.dbclickEvent.disposableOn(()=>{i.menuPoiCommand(this,"dbClick")}))}if(i.middlePointShow){const n=this.ad(new _i(i.czmViewer));{n.imageUri=i.firstControlPointImageUrl??Ee.defaults.firstControlPointImageUrl,n.tooltip="点击增加一个控制点",n.bgColor=[0,0,0,.6],n.fgColor=[1,1,1,1],n.size=[8,8],n.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{n.enabled=n.show=!1},s=()=>{var g;if(!(i.enabled??Ee.defaults.enabled))return o();const r=i.editingPoints.indexOf(this),l=i.editingPoints,c=l.length;if(r===-1||c===0||!(i.loop??Ee.defaults.loop)&&r+1>=c)return o();const u=this.position;if(!u)return o();const d=(g=l.get((r+1)%c))==null?void 0:g.position;if(!d)return o();const p=lu(u,d);if(!p)return o();p[2]-=i.czmViewer.editingHeightOffset??0,n.position=p;const f=c<(i.maxPointsNum??Ee.defaults.maxPointsNum);n.enabled=n.show=f};s(),this.dispose(i.positionsChanged.disposableOn(s)),this.dispose(i.loopChanged.disposableOn(s)),this.dispose(i.enabledChanged.disposableOn(s))}this.dispose(n.clickEvent.disposableOn(o=>{if(o.button!==0||i.editingPoints.length>=(i.maxPointsNum??Ee.defaults.maxPointsNum))return;const s=i.editingPoints.indexOf(this);if(s===-1)return;const r=n.position?[...n.position]:void 0;r&&(r[2]+=i.czmViewer.editingHeightOffset??0);let l=new Vh(i,r);i.editingPoints.splice(s+1,0,l),i.modify(l)}))}}}}class Ee extends ri{constructor(e){super(e);v(this,"_menuPoiCommand",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"translationEditing");{const s=this.ad(a.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new a.ObjResettingWithEvent(s,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new hF(this.editingPoints.get(0),this)}))}const n=this.translationEditing=this.disposeVar(new on(e));n.enabled=!1;const o=async(s,r)=>{if((this.debug??Ee.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",r=await s.promise(a.step(s,async l=>{const c=l.disposer,u=c.ad(new uF(this));return c.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(r===-1||r>=this.editingPoints.length?0:r)),c.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),c.dispose(this._forceModifyPosEditorEvent.disposableOn(p=>u.modify(p))),await l.promise(new Promise(p=>{c.dispose(u.overEvent.disposableOnce(f=>{p(f)}))}))})),r===-1)(this.debug??Ee.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??Ee.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??Ee.defaults.loop;const c=this.editingPoints.get(r-1).position;if(!c)return;let u=r%this.editingPoints.length;const p=this.editingPoints.get(u).position;if(!p)return;const f=lu(c,p);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let g=new Vh(this,f);this.editingPoints.splice(r,0,g),await o(s,r)}};this.currentProcess=this.disposeVar(a.createProcessingFromAsyncFunc(async s=>{s.disposer.dispose(()=>{(this.debug??Ee.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(s,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,n){this._menuPoiCommand.emit(e,n)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const n=e?e.map(o=>new Vh(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...n),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ri.createDefaultProps(),moveWithFirstPosition:!1})})(Ee||(Ee={})),a.extendClassProps(Ee.prototype,Ee.createDefaultProps);class hF extends a.Destroyable{constructor(i,e){super(),this._firstPositionEditor=i,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((n,o)=>{if(n===void 0||o===void 0)return;var s=[n[0]-o[0],n[1]-o[1],n[2]-o[2]];const r=this.multiPointsModifyEditing.editingPoints.length;for(let l=1;l<r;l++){const c=this.multiPointsModifyEditing.editingPoints.get(l),u=c.position;u!==void 0&&(c.position=[u[0]+s[0],u[1]+s[1],u[2]+s[2]])}})}}class uF extends a.Destroyable{constructor(e){super();v(this,"_overEvent",this.disposeVar(new a.Event));v(this,"_cancelEvent",this.disposeVar(new a.Event));v(this,"_forceModifyPosEditorEvent",this.disposeVar(new a.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let n;const o=()=>{n==null||n.destroy(),n=void 0,e.status="Modifying"};this.dispose(o);const s=r=>{o(),e.status="Modifying_Point",n=new dF(e,r),n.dispose(n.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(s)),this.dispose(e._menuPoiCommand.disposableOn((r,l)=>{if(l==="delete"){if(e.editingPoints.length<=2)return;const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(c,1)}else if(l==="modify")s(r);else if(l==="add"){const c=e.editingPoints.indexOf(r);if(c===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(c+1)}else l==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${l})`)})),this.dispose(this._cancelEvent.disposableOn(()=>{this._overEvent.emit(-1)}))}get overEvent(){return this._overEvent}cancel(){this._cancelEvent.emit()}modify(e){this._forceModifyPosEditorEvent.emit(e)}}class dF extends a.Destroyable{constructor(e,n){super();v(this,"_overEvent",this.disposeVar(new a.Event));this._modifying=e,this._posEditor=n,this.dispose(this._posEditor.toDestroyEvent.disposableOn(()=>{this._overEvent.emit()}));const{translationEditing:o}=this._modifying;if(o.enabled=!0,o.heading=0,this.dispose(()=>{o.enabled=!1}),!this._posEditor.position)throw console.error("!this._posEditor.position"),new Error("!this._posEditor.position");o.position=this._posEditor.position,this.dispose(a.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(s=>{s||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class vC extends Ee{constructor(i){super(i),this.loop=!1}}class yC extends Ee{constructor(i){super(i),this.loop=!0}}class ir extends Xe{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2;{const e=()=>{if(!this.positions||this.positions.length==0){this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];return}if(this.positions.length==1){this.distance=1,this.rotation=[90,0,0];return}this.startPosition=this.positions[0],this.endPosition=this.positions[1];const n=a.geoHeading(this.startPosition,this.endPosition),o=a.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/o)*180/Math.PI,l=Math.sqrt(o*o+s*s);this.rotation=[n,r,0],this.distance=l};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([90,0,0]),distance:a.react(1)})})(ir||(ir={})),a.extendClassProps(ir.prototype,ir.createDefaultProps);class Vo extends Ee{init(){const i=this.startPosition;if(!i)return;const e=this.distance,n=this.rotation,o=e*Math.cos(n[1]*Math.PI/180),s=a.geoDestination(i,o,n[0]);if(!s){this.positions=[i];return}const r=e*Math.sin(n[1]*Math.PI/180);s[2]+=r,this.positions=[i,s],this.editingPoints.length==2&&(this.editingPoints.get(0).position=i,this.editingPoints.get(1).position=s)}constructor(i){super(i),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var l;if(!((l=this.positions)!=null&&l.length))return this.distance=1,this.rotation=[90,0,0],this.startPosition=[0,0,0];if(this.startPosition=this.positions[0],this.positions.length==1)return this.editingPoints.get(0).menuPoi.commands=[["add","增加控制点","",Ee.baseImageUrl+"add.png"],["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let c of this.editingPoints)c.menuPoi.commands=[["delete","删除当前控制点","",Ee.baseImageUrl+"delete.png"],["modify","修改当前控制点","",Ee.baseImageUrl+"modify.png"]];const n=a.geoDistance(this.startPosition,this.endPosition);if(Math.abs(n)<=0)return this.rotation=[90,0,0],this.distance=1;const o=a.geoHeading(this.startPosition,this.endPosition),s=this.endPosition[2]-this.startPosition[2],r=Math.atan(s/n)*180/Math.PI;this.rotation=[o,r,0],this.distance=Math.hypot(n,s)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),startPosition:a.reactArrayWithUndefined(void 0),endPosition:a.reactArrayWithUndefined(void 0),rotation:a.reactArray([0,0,0]),distance:a.react(0)})})(Vo||(Vo={})),a.extendClassProps(Vo.prototype,Vo.createDefaultProps);class wC extends Xe{constructor(i){super(i),this.loop=!1,this.polylineShow=!1}}class CC extends Ee{constructor(i){super(i),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class nr extends Xe{constructor(i){super(i),i.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Xe.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(nr||(nr={})),a.extendClassProps(nr.prototype,nr.createDefaultProps);class or extends Ee{constructor(i){if(super(i),!!i.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const n=[...this.positions[0]];n[2]-=i.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=i.editingHeightOffset??0,[n,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(i){const e=this.ad(new pi(i));e.topOrBottom="bottom",this.ad(a.track([e,"color"],[this,"polylineColor"])),this.ad(a.track([e,"width"],[this,"polylineWidth"])),this.ad(a.track([e,"show"],[this,"polylineShow"])),this.ad(a.track([e,"arcType"],[this,"polylineArcType"])),this.ad(a.track([e,"loop"],[this,"loop"])),this.ad(a.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Ee.createDefaultProps(),visibilityPositions:a.reactPositionsSet(void 0)})})(or||(or={})),a.extendClassProps(or.prototype,or.createDefaultProps);class _C extends Vo{constructor(i){super(i),this.firstControlPointImageUrl=this.otherControlPointImageUrl,this.translationEditing.xAxisShow=!1,this.translationEditing.yAxisShow=!1,this.translationEditing.zAxisShow=!0,this.translationEditing.showCircle=!1,this.rotation=[0,90,0]}}class _t extends a.EngineObject{constructor(e,n,o){super(e,n,o??!0);v(this,"_currentEditing",this.disposeVar(a.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var s;if(this.currentEditing)if(this.currentEditing instanceof Xe&&((s=this.currentEditing.currentProcess)!=null&&s.isRunning)){if(this.currentEditing.currentProcess.cancel(),e!=null&&e.position){if(this.currentEditing.positions.length>1)return;e.position=this.currentEditing.positions[0]??[0,0,0],e!=null&&e.rotation&&(e.rotation=[0,0,0]),e!=null&&e.far&&(e.far=1),e!=null&&e.radius&&(e.radius=1),e!=null&&e.distance&&(e.distance=1)}}else this.currentEditing instanceof Ni&&this.currentEditing.enabled&&(e.position=[0,0,0])}))}get currentEditing(){return this._currentEditing.value}set currentEditing(e){this._currentEditing.value=e}get currentEditingChanged(){return this._currentEditing.changed}}const Kl=class Kl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new Ni(e));if(this.ad(e.clickEvent.don(o=>{var s;((s=o.pointerEvent)==null?void 0:s.button)==2&&(n.enabled=!0)})),Reflect.has(i,"position")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),n.enabled=!n.position||a.equalsN3(n.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${i.typeName} 坐标属性无法绑定位置编辑`)}};v(Kl,"type",Kl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Place,Kl));let lg=Kl;const Jl=class Jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yi(e));if(n.rotation=[90,0,0],this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);o&&(this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"])),this.ad(a.bind([n,"selfRotation"],[i,"rotation"])))});else if(Reflect.has(i,"position")&&Reflect.has(i,"rotation")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${i.typeName} 旋转属性无法绑定旋转编辑`)}};v(Jl,"type",Jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Rotation,Jl));let cg=Jl;const jl=class jl extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new sn(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")&&Reflect.has(i,"scale")){const o=i;this.ad(a.bind([n,"position"],[o,"position"])),this.ad(a.bind([n,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${i.typeName} 缩放属性无法绑定缩放编辑`)}};v(jl,"type",jl.registerEditing("ESCesiumViewer",a.ESJEditingMode.Scale,jl));let hg=jl;const ec=class ec extends _t{constructor(i,e){super(Array.isArray(i)?i[0]:i,e,!0);const n=this.currentEditing=this.ad(new on(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(i)){const o=[];for(let s=0;s<i.length;s++){const r=i[s];Reflect.has(r,"position")?o.push(r.position):r.points&&o.push(...r.points)}n.position=a.getMinMaxCorner(o).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(!(!s||!r)){var l=It({originPosition:r},[s])[0][0];i.forEach(c=>{const u=c;if(Reflect.has(c,"position")){const d=It({originPosition:r},[u.position])[0][0];u.position=yn({originPosition:r},[[d[0]+l[0],d[1]+l[1],d[2]+l[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const d=It({originPosition:r},u.points)[0];u.points=yn({originPosition:r},d.map(p=>[p[0]+l[0],p[1]+l[1],p[2]+l[2]]))[0]}})}}))}else if(Reflect.has(i,"position"))this.ad(a.bind([n,"position"],[i,"position"]));else if(i instanceof a.ES3DTileset)a.registerCreatedEventUpdate(this,i,()=>{const o=e.getEngineObject(i);this.ad(a.bind([n,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(i,"points")){const o=i;if(o.points===void 0||o.points.length===0){this.destroy();return}n.position=a.getMinMaxCorner(o.points).center,this.ad(n.positionChanged.disposableOn((s,r)=>{if(s===void 0||r===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var l=It({originPosition:r},[s])[0][0];const c=It({originPosition:r},o.points)[0];o.points=yn({originPosition:r},c.map(u=>[u[0]+l[0],u[1]+l[1],u[2]+l[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${i.typeName} 坐标属性无法绑定平移编辑`)}};v(ec,"type",ec.registerEditing("ESCesiumViewer",a.ESJEditingMode.Translation,ec));let Uh=ec;const tc=class tc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new ir(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"position")){const o=i;if(this.ad(a.bind([n,"startPosition"],[o,"position"])),this.ad(Ke([n,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(a.bind([n,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(a.bind([n,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(a.bind([n,"distance"],[o,"distance"]));else{const s=Le(o.position);if(h.Cartesian3.ZERO.equals(s)||!e.viewer)return;n.distance=Wi(e.viewer.scene,s,100)??1}}else if(Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${i.typeName} 坐标属性无法绑定双点追加编辑`);n.startPosition&&!a.equalsN3(n.startPosition,[0,0,0])&&n.init(),n.enabled=!0}};v(tc,"type",tc.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsAppend,tc));let ug=tc;const ic=class ic extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new Vo(e));if(Reflect.has(i,"position")){const s=i;if(this.ad(a.bind([n,"startPosition"],[s,"position"])),this.ad(Ke([n,"rotation"],[s,"rotation"])),Reflect.has(s,"far"))this.ad(a.bind([n,"distance"],[s,"far"]));else if(Reflect.has(s,"radius"))this.ad(a.bind([n,"distance"],[s,"radius"]));else if(Reflect.has(s,"distance"))this.ad(a.bind([n,"distance"],[s,"distance"]));else{const r=Le(s.position);if(h.Cartesian3.ZERO.equals(r)||!e.viewer)return;n.distance=Wi(e.viewer.scene,r,100)??1}}else if(Reflect.has(i,"points")){const s=i;if(s.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.moveWithFirstPosition=!1;const r=()=>n.positions=s.points??[];r(),this.ad(s.pointsChanged.don(()=>!n.enabled&&r())),this.ad(a.track([s,"points"],[n,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${i.typeName} 坐标属性无法绑定双点修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(ic,"type",ic.registerEditing("ESCesiumViewer",a.ESJEditingMode.DoublePointsModify,ic));let dg=ic;const nc=class nc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new mC(e));this.ad(n.enabledChanged.don(s=>{!s&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))}));const o=i;if(Reflect.has(o,"points")){const s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};v(nc,"type",nc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularAppend,nc));let pg=nc;const oc=class oc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new yC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${i.typeName} 坐标属性无法绑定环形插值编辑`)}};v(oc,"type",oc.registerEditing("ESCesiumViewer",a.ESJEditingMode.CircularInsert,oc));let fg=oc;const sc=class sc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new gC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${i.typeName} 坐标属性无法绑定线段追加编辑`)}};v(sc,"type",sc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringAppend,sc));let gg=sc;const rc=class rc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new vC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${i.typeName} 坐标属性无法绑定线段插入编辑`)}};v(rc,"type",rc.registerEditing("ESCesiumViewer",a.ESJEditingMode.LineStringInsert,rc));let mg=rc;const ac=class ac extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new wC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${i.typeName} 坐标属性无法绑定散点追加编辑`)}};v(ac,"type",ac.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterAppend,ac));let vg=ac;const lc=class lc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new CC(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${i.typeName} 坐标属性无法绑定散点修改编辑`)}};v(lc,"type",lc.registerEditing("ESCesiumViewer",a.ESJEditingMode.ScatterModify,lc));let yg=lc;const cc=class cc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new nr(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${i.typeName} 坐标属性无法绑定可见性追加编辑`)}};v(cc,"type",cc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityAppend,cc));let wg=cc;const hc=class hc extends _t{constructor(i,e){super(i,e,!0);const n=this.currentEditing=this.ad(new or(e));if(this.ad(n.enabledChanged.don(o=>{!o&&this.ad(a.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(i,"points")){const o=i,s=()=>n.positions=o.points??[];s(),this.ad(o.pointsChanged.don(()=>!n.enabled&&s())),n.enabled=!0,this.ad(a.track([o,"points"],[n,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${i.typeName} 坐标属性无法绑定可见性修改编辑`)}};v(hc,"type",hc.registerEditing("ESCesiumViewer",a.ESJEditingMode.VisibilityModify,hc));let Cg=hc;const uc=class uc extends _t{constructor(i,e){if(super(i,e,!0),!e.viewer)return;const n=this.currentEditing=this.ad(new _C(e));if(Reflect.has(i,"points")){const s=i,r=Reflect.has(s,"extrudedHeight"),l=Reflect.has(s,"height"),c=Reflect.has(s,"perPositionHeight")?s.perPositionHeight:!r,u=[a.ESClassification,a.ESPolygonFence,a.ESSunshineAnalysis].some(m=>s instanceof m);let d=a.getMinMaxCorner(s.points).center;d[2]=s.points[0][2];let p=[...d],f=u?s.points[0][2]:0;c?r?p[2]=s.extrudedHeight:p[2]=s.height+f:(l&&(d[2]=s.height),r&&(p[2]=s.extrudedHeight)),n.startPosition=d,n.distance=p[2]-d[2],n.moveWithFirstPosition=!1;let g=[...d];this.ad(n.positionsChanged.don(()=>{n.positions.length===2&&(c?(s.points=s.points.map(m=>[m[0],m[1],m[2]+n.positions[0][2]-g[2]]),r?s.extrudedHeight=n.positions[1][2]:l&&(s.height=n.positions[1][2]-(u?n.positions[0][2]:0))):(l&&(s.height=n.positions[0][2]),r&&(s.extrudedHeight=n.positions[1][2])),g=[...n.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${i.typeName} 坐标属性无法绑定高度修改编辑`);n.init(),n.enabled=!0;const o=this.ad(a.createNextAnimateFrameEvent(n.enabledChanged,n.startPositionChanged));this.ad(o.don(()=>{(!n.enabled||!n.startPosition||a.equalsN3(n.startPosition,[0,0,0]))&&this.destroy()}))}};v(uc,"type",uc.registerEditing("ESCesiumViewer",a.ESJEditingMode.HeightModify,uc));let _g=uc;const ot=class ot extends a.Destroyable{constructor(e,n,o,s=!0){super();v(this,"editingModes",[]);v(this,"editingID");v(this,"useKeyToSwitch");v(this,"currentIndex",0);v(this,"currentEditingMode");v(this,"currentEditingWrapper");v(this,"_notSupportedEditCount",this.disposeVar(a.react(0)));v(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&a.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=n;const r=(Array.isArray(o)?o:[o]).filter(l=>n.supportEditingModes().includes(l));if(this.editingModes=r,this.editingID=n.editingID,this.useKeyToSwitch=s,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",r);else{console.warn("[ESEditMode] 无可用的编辑模式");return}this._bindEvents(),this._createEditingMode(this.currentIndex),this._emitEditingEvent("start",{modes:this.editingModes})}get notSupportedEditCount(){return this._notSupportedEditCount.value}set notSupportedEditCount(e){this._notSupportedEditCount.value=e}get notSupportedEditCountChanged(){return this._notSupportedEditCount.changed}_emitEditingEvent(e,n){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:n})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(ot.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_ESCAPE&&ot.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var n;return((n=e.pointerEvent)==null?void 0:n.button)===ot.MOUSE_LEFT&&a.nextAnimateFrame(()=>{ot.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===ot.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&ot.stop()}))}_cleanupCurrentWrapper(){this.currentEditingWrapper&&!this.currentEditingWrapper.isDestroyed()&&this.currentEditingWrapper.destroy(),this.currentEditingWrapper=void 0}_createEditingMode(e){if(this.editingModes.length){e>=this.editingModes.length&&(e=0),this.currentIndex=e,this.currentEditingMode=this.editingModes[e];try{const n=a.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!n){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new n(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(n){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,n),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,n,o,s=!0){ot.stop(),ot.esEditModeInstance=new ot(e,n,o,s)}static stop(){const e=ot.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:n,sceneObject:o,editingID:s,editingModes:r}=e;e.destroy(),n.editingEvent.emit({objectIDs:[o.parentID],editingID:s,type:"end",add:{modes:r}})}ot.esEditModeInstance=void 0}};v(ot,"KEY_ESCAPE","Escape"),v(ot,"KEY_SPACE","Space"),v(ot,"MOUSE_LEFT",0),v(ot,"esEditModeInstance");let Wh=ot;function PC(){const t=a.createProcessingFromAsyncFunc(async(i,e,n,o)=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"start"});const s=()=>{e.editingEvent.emit({objectIDs:n.map(c=>c.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};i.disposer.ad(s);const r=c=>{c.code=="Escape"&&s()};i.disposer.ad(e.keyDownEvent.don(r));const l=new Uh(n,e);i.disposer.ad(()=>{!l.isDestroyed()&&l.destroy()}),await i.promise(new Promise(c=>{l.isDestroyed()&&c(),i.disposer.ad(l.toDestroyEvent.don(()=>{console.log("移动结束"),c()})),i.disposer.ad(e.dblclickEvent.don(()=>c()))}))});return t}class pF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i,a.registerCreatedEventUpdate(this,e,()=>{let n;const o=i.getEngineObject(e);e instanceof a.ESBoxClipping&&(n=o.czmBoxClippingPlanes),!(!n||!("computedClippingPlanes"in n)||!("computedClippingPlanesChanged"in n))&&(this.dispose(a.track([this._czmViewer,"sceneGlobeClippingPlanes"],[n,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class fF extends a.Destroyable{constructor(e){super();v(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new a.ESSceneObjectWithId));this.dispose(a.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new a.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:n}=this._clippingPlanesSceneObjectWithId;if(n)return new pF(e,n)}))}}class gF extends a.Destroyable{constructor(i){super(),this.dv(new a.ObjResettingWithEvent(i.sceneGlobeClippingPolygonsIdChanged,(e,n)=>{if(!(!e||e===n||e&&e.length===0))return new mF(i)}))}}class mF extends a.Destroyable{constructor(i){super(),this._czmViewer=i,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,n=o=>{if(!o)return;const s=this.dv(a.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new a.ObjResettingWithEvent(s,()=>{if(o)return new vF(i,o)}))};for(let o=0;o<e.length;o++){const s=e[o],r=a.ESSceneObject.getSceneObjById(s);if(!r)return;let l;r instanceof a.ESExcavate?a.registerCreatedEventUpdate(this,r,()=>{l=i.getEngineObject(r).czmPolygonClipping,n(l)}):r instanceof a.ESHole&&a.registerCreatedEventUpdate(this,r.excavate,()=>{l=i.getEngineObject(r.excavate).czmPolygonClipping,n(l)})}}}class vF extends a.Destroyable{constructor(i,e){super(),this._czmViewer=i;const n=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(n&&n.length>0){const s={polygons:[],enabled:!0,inverse:!1};for(let r=0;r<n.length;r++){const l=n[r],c=a.ESSceneObject.getSceneObjById(l);if(!c)return;let u;if(c instanceof a.ESExcavate?u=i.getEngineObject(c).czmPolygonClipping:c instanceof a.ESHole&&(u=i.getEngineObject(c.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(s.polygons[r]={positions:u.positions},s.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=s}}}class yF extends a.Destroyable{constructor(i,e){var r;super(),this._viewer=i;const n=(r=this._viewer.extensions)==null?void 0:r.pickingManager;if(!n)return;const{objectsToExclude:o}=n,s=Array.isArray(e)?[...e]:[e];for(const l of s){if(o.includes(l))throw new Error("objectsToExclude.includes(p)");o.push(l)}this.dispose(()=>{for(let l of s){const c=o.indexOf(l);if(c===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(c,1)}})}}class wF extends a.Destroyable{constructor(e){var r;super();v(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Po(e)),this._czmGlobeMaterial.show=!0;let n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),o=(r=this._czmViewer.viewer)==null?void 0:r.scene.preUpdate.addEventListener(()=>{var c;const l=n.elevationContour.show&&(((c=this._czmViewer.getCameraInfo())==null?void 0:c.position[2])??0)<=n.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==l&&(this._czmGlobeMaterial.enableContour=l)});this.d(()=>{o&&o()});const s=()=>{n=Object.assign({},Te.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",n.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),n.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),n.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=n.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=n.elevationContour.width,this._czmGlobeMaterial.contourColor=n.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:n.elevationRamp.minHeight,maxHeight:n.elevationRamp.maxHeight,color:n.elevationRamp.color}};s(),this.d(this._czmViewer.terrainShaderChanged.don(s))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function CF(t,i){const e={animation:!1,baseLayerPicker:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,infoBox:!1,sceneModePicker:!1,selectionIndicator:!1,timeline:!1,navigationHelpButton:!1,navigationInstructionsInitiallyVisible:!1,scene3DOnly:!0,...i??{}},n=new h.Viewer(t,e);return n.imageryLayers.removeAll(),n.extend(h.viewerCesiumInspectorMixin),n.cesiumInspector.container.style.display="none",n.extend(h.viewerCesium3DTilesInspectorMixin),n.cesium3DTilesInspector.container.style.display="none",n.cesium3DTilesInspector.viewModel.picking=!1,n.clock.currentTime=h.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),n.scene.screenSpaceCameraController.lookEventTypes=[{eventType:h.CameraEventType.RIGHT_DRAG}],n.scene.screenSpaceCameraController.zoomEventTypes=[h.CameraEventType.WHEEL,h.CameraEventType.PINCH,{eventType:h.CameraEventType.RIGHT_DRAG,modifier:h.KeyboardEventModifier.SHIFT}],n.scene.screenSpaceCameraController.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}],n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_CLICK),n.screenSpaceEventHandler.removeInputAction(h.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),n._cesiumWidget._creditContainer.style.display="none",n}function _F(){h.Cesium3DTile.prototype.updateTransform=function(t,i){t=t??h.Matrix4.IDENTITY;const e=h.Matrix4.multiplyTransformation(t,this.transform,new h.Matrix4),n=!h.Matrix4.equals(e,this.computedTransform),o=h.defined(i)&&(this._verticalExaggeration!==i.verticalExaggeration||this._verticalExaggerationRelativeHeight!==i.verticalExaggerationRelativeHeight);if(!n&&!o)return;n&&h.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=i.verticalExaggeration,this._verticalExaggerationRelativeHeight=i.verticalExaggerationRelativeHeight);const s=this._header,r=this._contentHeader;this._boundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform),h.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform)),h.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(s.viewerRequestVolume,this.computedTransform)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()}}function PF(){Reflect.getOwnPropertyDescriptor(h.Camera.prototype,"_currentFlight")||Object.defineProperties(h.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var i=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,i)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new h.Event),this._vtxf_currentFlightEvent}}})}function bF(){const t=new h.Matrix4;function i(n,o){const s=n.positionWC;h.Matrix4.clone(n.transform,t),n.lookAtTransform(h.Matrix4.IDENTITY),n.look(s,o),n.lookAtTransform(t)}const e=Math.PI/60;h.Camera.prototype.lookLeft=function(n){n=n??e,this._mode!==h.SceneMode.SCENE2D&&i(this,-n)},h.Camera.prototype.lookRight=function(n){this.lookLeft(-n)}}function SF(){if(!h.DepthPlane.xbsjFixed){h.DepthPlane.xbsjFixed=!0;var t=h.DepthPlane.prototype.update;h.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var i=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=i.context,n=new h.Geometry({attributes:{position:new h.GeometryAttribute({componentDatatype:h.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:h.PrimitiveType.TRIANGLES});this._va=h.VertexArray.fromGeometry({context:e,geometry:n,attributeLocations:{position:0},bufferUsage:h.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function EF(t){const i=t.BoundingSphere,e=t.Cartesian3,n=t.defined,o=t.OrientedBoundingBox,s=t.Rectangle,r=t.TaskProcessor,l=t.TerrainData,c=t.TerrainEncoding,u=t.TerrainMesh,d=t.GoogleEarthEnterpriseTerrainData,p="createVerticesFromGoogleEarthEnterpriseBuffer",f=new r(p),g=new r(p,l.maximumAsynchronousTasks),m=new s,y=new s;d.prototype.createMesh=function(_){_=_??ye.Frozen.EMPTY_OBJECT;const P=_.tilingScheme,C=_.x,S=_.y,x=_.level,A=_.exaggeration??1,R=_.exaggerationRelativeHeight??0,O=_.throttle??!0,N=P.ellipsoid;P.tileXYToNativeRectangle(C,S,x,m),P.tileXYToRectangle(C,S,x,y);const V=N.cartographicToCartesian(s.center(y));this._skirtHeight=6378137*.3;const z=(O?g:f).scheduleTask({buffer:this._buffer,nativeRectangle:m,rectangle:s.clone(y),relativeToCenter:V,ellipsoid:N,skirtHeight:this._skirtHeight,exaggeration:A,exaggerationRelativeHeight:R,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!n(z))return;const B=this;return z.then(function(w){return B._mesh=new u(V,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,i.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),c.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),B._minimumHeight=w.minimumHeight,B._maximumHeight=w.maximumHeight,B._buffer=void 0,B._mesh})}}function xF(){return h.VERSION.split(".").map(i=>parseInt(i))}let Pg;function AF(){return Pg||(Pg=xF()),Pg}function TF(){const t=AF();t[0]===1&&t[1]>=92?EF(h):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function MF(){const t=h.Resource.prototype.fetchJson,i=h.Resource.prototype.fetchArrayBuffer;h.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getJson(n)}else return t.call(this,...e)},h.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${a.defaultLocalFileServer.prefix}`)){const n=this.url.substring(8);return a.defaultLocalFileServer.getArrayBuffer(n).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return i.call(this,...e)}}function IF(){const t=h.ModelSceneGraph.prototype.buildDrawCommands;h.ModelSceneGraph.prototype.buildDrawCommands=function(...i){const e=this._model,n=e.modelMatrix;e.modelMatrix=h.Matrix4.IDENTITY;const o=t.call(this,...i);return e.modelMatrix=n,o}}function DF(){const t=h.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const RF=`#ifdef GL_OES_standard_derivatives
1925
1925
  #extension GL_OES_standard_derivatives : enable
1926
1926
  #endif
1927
1927
 
@@ -1955,7 +1955,7 @@ material.alpha = materialInput.color.a;
1955
1955
 
1956
1956
  return material;
1957
1957
  }
1958
- `;h.Material.GlobeLevelMaterialType="GlobelLevel",h.Material._materialCache.addMaterial(h.Material.GlobeLevelMaterialType,{fabric:{type:h.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new h.Cartesian3(0,0,0),input_highlights:new h.Cartesian3(1,1,1),midtones:new h.Cartesian3(.5,.5,.5),output_shadows:new h.Cartesian3(0,0,0),output_highlights:new h.Cartesian3(1,1,1)},source:FF},translucent:!1});const{PrimitiveRenderResources:zF,ModelUtility:LF,Cartesian3:ai,Matrix4:sr,ModelRenderResources:OF,defined:NF,NodeRenderResources:BF,BoundingSphere:rn,ModelDrawCommands:VF}=h,UF=new ai,WF=new ai,bC=new ai,SC=new ai;class GF extends zF{constructor(i,e,n){if(super(i,e),!i.runtimeNode.instancingTranslationMin||!i.runtimeNode.instancingTranslationMax)return;const o=sr.inverse(n,new sr),s=LF.getPositionMinMax(e.primitive,sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMin,bC),sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMax,SC));this.positionMin=ai.clone(s.min,new ai),this.positionMax=ai.clone(s.max,new ai),this.boundingSphere=rn.fromCornerPoints(this.positionMin,this.positionMax,new rn)}}function HF(){h.ModelSceneGraph.prototype.buildDrawCommands=function(t){const i=this._model,e=new OF(i);i.statistics.clear(),this.configurePipeline(t);const n=this.modelPipelineStages;let o,s,r;for(o=0;o<n.length;o++)n[o].process(e,i,t);const l=ai.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,UF),c=ai.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,WF);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!NF(u))continue;u.configurePipeline();const d=u.pipelineStages,p=new BF(e,u);for(s=0;s<d.length;s++)d[s].process(p,u.node,t);const f=u.computedTransform;for(s=0;s<u.runtimePrimitives.length;s++){const g=u.runtimePrimitives[s];g.configurePipeline(t);const m=g.pipelineStages,y=new GF(p,g,f);for(r=0;r<m.length;r++)m[r].process(y,g.primitive,t);g.boundingSphere=rn.clone(y.boundingSphere,new rn);const _=sr.multiplyByPoint(f,y.positionMin,bC),P=sr.multiplyByPoint(f,y.positionMax,SC);ai.minimumByComponent(l,_,l),ai.maximumByComponent(c,P,c);const C=VF.buildModelDrawCommand(y,t);g.drawCommand=C}}this._boundingSphere=rn.fromCornerPoints(l,c,new rn),this._boundingSphere=rn.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=rn.transform(this._boundingSphere,this._components.transform,this._boundingSphere),i._boundingSphere=rn.transform(this._boundingSphere,i.modelMatrix,i._boundingSphere),i._initialRadius=i._boundingSphere.radius,i._boundingSphere.radius*=i._clampedScale}}const dc=class dc extends a.Destroyable{constructor(){super(),h.ParticleSystem.prototype.update=function(i){const e=i.time;i.time=this._falseTime;try{dc.oldUpdate.call(this,i),this._particles.forEach(n=>{h.Billboard.prototype&&(n._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}i.time=e},this.d(()=>{h.ParticleSystem.prototype.update=dc.oldUpdate})}};v(dc,"oldUpdate",h.ParticleSystem.prototype.update);let bg=dc;function $F(){if(h.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(h.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,h.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=h.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class qF{constructor(i){v(this,"index");v(this,"image");v(this,"resolve");v(this,"reject");v(this,"rectangle");this.index=i.index,this.image=i.image,this.resolve=i.resolve,this.reject=i.reject,this.rectangle=void 0}}function XF(){h.TextureAtlas.prototype._resize=function(t,i=0){const e=this._borderWidthInPixels,n=this._rectangles,o=this._imagesToAddQueue,s=this._texture;let r=s.width,l=s.height;const c=this._subRegions,u=n.map((P,C)=>new qF({index:C,image:P})).filter((P,C)=>h.defined(P.image)&&!h.defined(c.get(C)));let d=0,p=0,f=0;for(let P=i;P<o.length;++P){const{width:C,height:S}=o[P].image;d=Math.max(d,C),p=Math.max(p,S),f+=C*S,u.push(o[P])}r=Math.max(d,r),l=Math.max(p,l),t.webgl2||(r=h.Math.nextPowerOfTwo(r),l=h.Math.nextPowerOfTwo(l));const g=Math.sqrt(f);l*=Math.ceil(g/l),r*=Math.ceil(g/r),u.sort(({image:P},{image:C})=>C.height*C.width-P.height*P.width);const m=new Array(this._nextIndex);for(const P of this._subRegions.keys())h.defined(c.get(P))&&(m[P]=n[P]);let y,_=!1;for(;!_;){y=new h.TexturePacker({height:l,width:r,borderPadding:e});let P;for(P=0;P<u.length;++P){const{index:C,image:S}=u[P];if(!h.defined(S))continue;const x=y.pack(C,S);if(!h.defined(x)){r>l?l*=2:r*=2;break}m[C]=x.rectangle}_=P===u.length}this._texturePacker=y,this._texture=this._copyFromTexture(t,r,l,m),s.destroy(),this._rectangles=m,this._guid=h.createGuid()}}const $n={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:YF,Indices:ZF,FeatureIdAttribute:EC,FeatureIdTexture:xC,FeatureIdImplicitRange:AC,MorphTarget:QF,Primitive:kF,Instances:KF,Skin:JF,Node:jF,AnimatedPropertyType:ez,AnimationSampler:tz,AnimationTarget:iz,AnimationChannel:nz,Animation:oz,ArticulationStage:sz,Articulation:rz,Asset:az,Scene:lz,Components:cz,MetallicRoughness:hz,SpecularGlossiness:uz,Specular:dz,Anisotropy:Sg,Clearcoat:Eg,Material:pz}=h.ModelComponents;function fz(){h.GltfLoader.prototype.process=function(t){if(h.Check.typeOf.object("frameState",t),this._state===$n.LOADED&&!h.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=gz(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),h.defined(this._processError)){this._state=$n.FAILED;const o=this._processError;this._processError=void 0,xg(this,o)}const i=this._textureErrors.pop();if(h.defined(i)){const o=this.getError("Failed to load glTF texture",i);throw o.name="TextureError",o}if(this._state===$n.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=$n.FAILED,xg(this,o)}let n=!1;try{n=this._processTextures(t)}catch(o){this._textureState=$n.FAILED,xg(this,o)}return this._incrementallyLoadTextures?e:e&&n}}async function gz(t,i){h.FeatureDetection.supportsWebP.initialized||await h.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new h.SupportedImageFormats({webp:h.FeatureDetection.supportsWebP(),basis:i.context.supportsBasis});const e=vz(t,i);return t._state=$n.PROCESSING,t._textureState=$n.PROCESSING,h.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(h.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const mz=new h.Cartesian3;function vz(t,i){const e=t.gltfJson,n=e.extensions??h.Frozen.EMPTY_OBJECT,o=n.EXT_structural_metadata,s=n.EXT_feature_metadata,r=n.CESIUM_RTC;if(h.defined(s)){const C=s.featureTables,S=s.featureTextures,x=h.defined(C)?C:[],A=h.defined(S)?S:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(A).sort()}const l=yz(t,i),c=bz(t,l),u=Sz(t,l),d=Ez(e),p=xz(e,l),f=new cz,g=new az,m=e.asset.copyright;if(h.defined(m)){const C=m.split(";").map(function(S){return new h.Credit(S.trim())});g.credits=C}if(f.asset=g,f.scene=p,f.nodes=l,f.skins=c,f.animations=u,f.articulations=d,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,h.defined(r)){const C=h.Cartesian3.fromArray(r.center,0,mz);f.transform=h.Matrix4.fromTranslation(C,f.transform)}if(t._components=f,h.defined(o)||h.defined(s)){const C=Az(t,o,s,i);t._loaderPromises.push(C)}const y=n.NGA_gpm_local;if(h.defined(y)){const C=h.GltfGpmLoader.load(y);t._components.extensions.NGA_gpm_local=C}const _=e.meshes;if(h.defined(_))for(const C of _){const S=C.primitives;if(h.defined(S))for(const x of S){const A=x.extensions;if(h.defined(A)){const R=A.NGA_gpm_local;if(h.defined(R)){const O=Tz(t,e,R,i);t._loaderPromises.push(O)}}}}const P=[];return OC(P,t._loaderPromises),t._incrementallyLoadTextures||OC(P,t._texturesPromises),Promise.all(P)}function yz(t,i){const e=t.gltfJson.nodes;if(!h.defined(e))return[];const n=e.map(function(o,s){const r=wz(t,o,i);return r.index=s,r});for(let o=0;o<n.length;++o){const s=e[o].children;if(h.defined(s))for(let r=0;r<s.length;++r)n[o].children.push(n[s[r]])}return n}function wz(t,i,e){const n=new jF;n.name=i.name,n.matrix=Qt(h.Matrix4,i.matrix),n.translation=Qt(h.Cartesian3,i.translation),n.rotation=Qt(h.Quaternion,i.rotation),n.scale=Qt(h.Cartesian3,i.scale);const o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.EXT_mesh_gpu_instancing,r=o.AGI_articulations;if(h.defined(s)){if(t._loadForClassification)throw new h.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");n.instances=Mz(t,o,e)}h.defined(r)&&(n.articulationName=r.articulationName);const l=i.mesh;if(h.defined(l)){const c=t.gltfJson.meshes[l],u=c.primitives;for(let f=0;f<u.length;++f)n.primitives.push(Cz(t,u[f],h.defined(n.instances),e));const d=i.weights??c.weights,p=n.primitives[0].morphTargets;n.morphWeights=h.defined(d)?d.slice():new Array(p.length).fill(0)}return n}function Cz(t,i,e,n){const o=new kF,s=new h.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(s);const r=i.material;h.defined(r)&&(o.material=_z(t,t.gltfJson.materials[r],n));const l=i.extensions??h.Frozen.EMPTY_OBJECT;let c=!1;const u=l.CESIUM_primitive_outline;t._loadPrimitiveOutline&&h.defined(u)&&(c=!0,s.needsOutlines=!0,s.outlineIndices=Iz(t,u));const d=l.KHR_spz_gaussian_splats_compression;h.defined(d)&&(c=!0,s.needsGaussianSplats=!0);const p=t._loadForClassification,f=l.KHR_draco_mesh_compression;let g=!1;const m=i.attributes;if(h.defined(m))for(const R in m){if(!m.hasOwnProperty(R))continue;const O=m[R],N=Ag(t,h.VertexAttributeSemantic,R),V=N.modelSemantic;if(p&&!Rz(V))continue;V===h.VertexAttributeSemantic.FEATURE_ID&&(g=!0);const U=TC(t,O,N,i,f,d,e,c,n);s.attributePlans.push(U),o.attributes.push(U.attribute)}const y=i.targets;if(h.defined(y)&&!p)for(let R=0;R<y.length;++R)o.morphTargets.push(Fz(t,y[R],c,s,n));const _=i.indices;if(h.defined(_)){const R=zz(t,_,i,f,g,c,n);h.defined(R)&&(s.indicesPlan=R,o.indices=R.indices)}const P=l.EXT_structural_metadata,C=l.EXT_mesh_features,S=l.EXT_feature_metadata,x=h.defined(S);h.defined(C)?Lz(t,o,C,n):x&&Oz(t,o,S,n),h.defined(P)?Nz(o,P):x&&Bz(t,o,S);const A=i.mode;if(p&&A!==h.PrimitiveType.TRIANGLES)throw new h.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=A,o}function _z(t,i,e){const n=new pz,o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.KHR_materials_pbrSpecularGlossiness,r=o.KHR_materials_specular,l=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=i.pbrMetallicRoughness;return n.unlit=h.defined(o.KHR_materials_unlit),h.defined(s)?n.specularGlossiness=Pz(t,s,e):(h.defined(u)&&(n.metallicRoughness=Vz(t,u,e)),h.defined(r)&&!n.unlit&&(n.specular=Uz(t,r,e)),h.defined(l)&&!n.unlit&&(n.anisotropy=Wz(t,l,e)),h.defined(c)&&!n.unlit&&(n.clearcoat=Gz(t,c,e))),h.defined(i.emissiveTexture)&&(n.emissiveTexture=St(t,i.emissiveTexture,e,void 0)),h.defined(i.normalTexture)&&!t._loadForClassification&&(n.normalTexture=St(t,i.normalTexture,e,void 0)),h.defined(i.occlusionTexture)&&(n.occlusionTexture=St(t,i.occlusionTexture,e,void 0)),n.emissiveFactor=Qt(h.Cartesian3,i.emissiveFactor),n.alphaMode=i.alphaMode,n.alphaCutoff=i.alphaCutoff,n.doubleSided=i.doubleSided,n.name=i.name,n}function Pz(t,i,e){const{diffuseTexture:n,specularGlossinessTexture:o,diffuseFactor:s,specularFactor:r,glossinessFactor:l}=i,c=new uz;return h.defined(n)&&(c.diffuseTexture=St(t,n,e,void 0)),h.defined(o)&&(c.specularGlossinessTexture=St(t,o,e,void 0)),c.diffuseFactor=Qt(h.Cartesian4,s),c.specularFactor=Qt(h.Cartesian3,r),c.glossinessFactor=l,c}function xg(t,i){throw t.unload(),t.getError("Failed to load glTF",i)}function bz(t,i){const e=t.gltfJson.skins;if(t._loadForClassification||!h.defined(e))return[];const n=e.map(function(s,r){const l=Hz(t,s,i);return l.index=r,l}),o=t.gltfJson.nodes;for(let s=0;s<i.length;++s){const r=o[s].skin;h.defined(r)&&(i[s].skin=n[r])}return n}function Sz(t,i){const e=t.gltfJson.animations;return t._loadForClassification||!h.defined(e)?[]:e.map(function(o,s){const r=$z(t,o,i);return r.index=s,r})}function Ez(t){var n;const e=(n=(t.extensions??h.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:n.articulations;return h.defined(e)?e.map(qz):[]}function xz(t,i){const e=new lz,n=Xz(t);return e.nodes=n.map(function(o){return i[o]}),e}async function Az(t,i,e,n){const o=new h.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:i,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function Tz(t,i,e,n){const o=new h.GltfMeshPrimitiveGpmLoader({gltf:i,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Qt(t,i){if(h.defined(i))return t===Number?i[0]:t.unpack(i)}function Mz(t,i,e){const n=i.EXT_mesh_gpu_instancing,o=new KF,s=n.attributes;if(h.defined(s))for(const u in s){if(!s.hasOwnProperty(u))continue;const d=s[u];o.attributes.push(Yz(t,d,s,u,e))}const r=n.extensions??h.Frozen.EMPTY_OBJECT,l=i.EXT_instance_features,c=r.EXT_feature_metadata;return h.defined(l)?Zz(o,l):h.defined(c)&&Qz(t.gltfJson,o,c,t._sortedPropertyTableIds),o}function Iz(t,i){const e=i.indices,n=t.gltfJson.accessors[e];return Gh(t,n,!1)}const Dz={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function Ag(t,i,e){let n=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(n="_FEATURE_ID_0");const o=i.fromGltfSemantic(n),s=Dz;return s.gltfSemantic=e,s.renamedSemantic=n,s.modelSemantic=o,s}function Rz(t){const i=t===h.VertexAttributeSemantic.POSITION,e=t===h.VertexAttributeSemantic.FEATURE_ID,n=t===h.VertexAttributeSemantic.TEXCOORD;return i||e||n}function TC(t,i,e,n,o,s,r,l,c){const u=e.modelSemantic,d=u===h.VertexAttributeSemantic.POSITION,p=u===h.VertexAttributeSemantic.FEATURE_ID,f=d&&!r&&t._loadAttributesFor2D&&!c.scene3DOnly,g=d&&t._enablePick&&!c.context.webgl2,m=t._loadForClassification&&p,y=t._loadAttributesAsTypedArray,_=!y,P=y||f||g||m,x=MC(t,i,e,n,o,s,l?!1:_,l?!0:P,c),A=new h.PrimitiveLoadPlan.AttributeLoadPlan(x);return A.loadBuffer=_,A.loadTypedArray=P,A}function Fz(t,i,e,n,o){const s=new QF,r=void 0,l=void 0,c=void 0,u=!1;for(const d in i){if(!i.hasOwnProperty(d))continue;const p=i[d],f=Ag(t,VertexAttributeSemantic,d),g=TC(t,p,f,r,l,c,u,e,o);s.attributes.push(g.attribute),n.attributePlans.push(g)}return s}function zz(t,i,e,n,o,s,r){const l=t.gltfJson.accessors[i],c=l.bufferView;if(!h.defined(n)&&!h.defined(c))return;const u=new ZF;u.count=l.count;const d=t._loadAttributesAsTypedArray,p=(t._loadIndicesForWireframe||t._enablePick)&&!r.context.webgl2,f=t._loadForClassification&&o,m=!d,y=d||p||f,C=kz(t,i,e,n,s?!1:m,s?!0:y,r),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{u.indexDatatype=C.indexDatatype,u.buffer=C.buffer,u.typedArray=C.typedArray};const A=new h.PrimitiveLoadPlan.IndicesLoadPlan(u);return A.loadBuffer=m,A.loadTypedArray=y,A}function Lz(t,i,e,n){let o;h.defined(e)&&h.defined(e.featureIds)?o=e.featureIds:o=[];for(let s=0;s<o.length;s++){const r=o[s],l=`featureId_${s}`;let c;h.defined(r.texture)?c=Kz(t,r,n,l):h.defined(r.attribute)?c=IC(r,l):c=DC(r,l),i.featureIds.push(c)}}function Oz(t,i,e,n){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let s=0;const r=e.featureIdAttributes;if(h.defined(r))for(let c=0;c<r.length;++c){const u=r[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;let m;h.defined(u.featureIds.attribute)?m=RC(u,p,f,g):m=FC(u,p,f,g),i.featureIds.push(m)}const l=e.featureIdTextures;if(h.defined(l))for(let c=0;c<l.length;++c){const u=l[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;const m=Jz(t,u,p,n,f,g);i.featureIds.push(m)}}function Nz(t,i){if(!h.defined(i))return;const{propertyTextures:e,propertyAttributes:n}=i;h.defined(e)&&(t.propertyTextureIds=e),h.defined(n)&&(t.propertyAttributeIds=n)}function Bz(t,i,e){h.defined(e.featureTextures)&&(i.propertyTextureIds=e.featureTextures.map(function(n){return t._sortedFeatureTextureIds.indexOf(n)}))}function Vz(t,i,e){const{baseColorTexture:n,metallicRoughnessTexture:o,baseColorFactor:s,metallicFactor:r,roughnessFactor:l}=i,c=new hz;return h.defined(n)&&(c.baseColorTexture=St(t,n,e,void 0)),h.defined(o)&&(c.metallicRoughnessTexture=St(t,o,e,void 0)),c.baseColorFactor=Qt(h.Cartesian4,s),c.metallicFactor=r,c.roughnessFactor=l,c}function Uz(t,i,e){const{specularFactor:n,specularTexture:o,specularColorFactor:s,specularColorTexture:r}=i,l=new dz;return h.defined(o)&&(l.specularTexture=St(t,o,e,void 0)),h.defined(r)&&(l.specularColorTexture=St(t,r,e,void 0)),l.specularFactor=n,l.specularColorFactor=Qt(h.Cartesian3,s),l}function Wz(t,i,e){const{anisotropyStrength:n=Sg.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Sg.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:s}=i,r=new Sg;return h.defined(s)&&(r.anisotropyTexture=St(t,s,e,void 0)),r.anisotropyStrength=n,r.anisotropyRotation=o,r}function Gz(t,i,e){const{clearcoatFactor:n=Eg.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:s=Eg.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:r,clearcoatNormalTexture:l}=i,c=new Eg;return h.defined(o)&&(c.clearcoatTexture=St(t,o,e,void 0)),h.defined(r)&&(c.clearcoatRoughnessTexture=St(t,r,e,void 0)),h.defined(l)&&(c.clearcoatNormalTexture=St(t,l,e,void 0)),c.clearcoatFactor=n,c.clearcoatRoughnessFactor=s,c}function St(t,i,e,n){const o=t.gltfJson,s=h.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:i.index,supportedImageFormats:t._supportedImageFormats});if(!h.defined(s))return;const r=h.ResourceCache.getTextureLoader({gltf:o,textureInfo:i,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),l=h.GltfLoaderUtil.createModelTextureReader({textureInfo:i}),c=t._textureLoaders.length;t._textureLoaders.push(r);const u=r.load().catch(d=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw d;t._textureState=$n.FAILED,t._textureErrors.push(d)}});return t._texturesPromises.push(u),t._textureCallbacks[c]=()=>{l.texture=r.texture,h.defined(n)&&(l.texture.sampler=n)},l}function Hz(t,i,e){const n=new JF,o=i.joints;n.joints=o.map(r=>e[r]);const s=i.inverseBindMatrices;if(h.defined(s)){const r=t.gltfJson.accessors[s];n.inverseBindMatrices=Gh(t,r,void 0)}else n.inverseBindMatrices=new Array(o.length).fill(h.Matrix4.IDENTITY);return n}function $z(t,i,e){const n=new oz;n.name=i.name;const o=i.samplers.map(function(r,l){const c=jz(t,r);return c.index=l,c}),s=i.channels.map(function(r){return eL(r,o,e)});return n.samplers=o,n.channels=s,n}function qz(t){const i=new rz;return i.name=t.name,i.stages=t.stages.map(iL),i}function Xz(t){let i;return h.defined(t.scenes)&&h.defined(t.scene)&&(i=t.scenes[t.scene].nodes),i=i??t.nodes,i=h.defined(i)?i:[],i}function Yz(t,i,e,n,o){const s=t.gltfJson.accessors,r=h.defined(e.ROTATION),l=h.defined(e.TRANSLATION)&&h.defined(s[e.TRANSLATION].min)&&h.defined(s[e.TRANSLATION].max),c=Ag(t,h.InstanceAttributeSemantic,n),u=c.modelSemantic,d=u===h.InstanceAttributeSemantic.TRANSLATION||u===h.InstanceAttributeSemantic.ROTATION||u===h.InstanceAttributeSemantic.SCALE,p=u===h.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||r&&d||!o.context.instancedArrays,g=t._enablePick&&!o.context.webgl2,m=!f,y=t._loadAttributesFor2D&&!o.scene3DOnly;return MC(t,i,c,void 0,void 0,void 0,m,f||p&&(!l||y||g),o)}function Zz(t,i){const e=i.featureIds;for(let n=0;n<e.length;n++){const o=e[n],s=`instanceFeatureId_${n}`;let r;h.defined(o.attribute)?r=IC(o,s):r=DC(o,s),t.featureIds.push(r)}}function Qz(t,i,e,n){const o=t.extensions.EXT_feature_metadata.featureTables,s=e.featureIdAttributes;if(h.defined(s))for(let r=0;r<s.length;++r){const l=s[r],c=l.featureTable,u=n.indexOf(c),d=o[c].count,p=`instanceFeatureId_${r}`;let f;h.defined(l.featureIds.attribute)?f=RC(l,u,d,p):f=FC(l,u,d,p),i.featureIds.push(f)}}function Gh(t,i,e){const n=new Array(i.count),o=i.bufferView;if(h.defined(o)){const s=tL(t,o),r=nL(t,s,i,e,n);return t._loaderPromises.push(r),n}return oL(i,n)}function MC(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,d=u.accessors[i],p=d.bufferView,f=e.gltfSemantic,g=e.renamedSemantic,m=e.modelSemantic,y=h.defined(m)?zC(g):void 0,P=sL(u,i,f,m,y);if(!h.defined(o)&&!h.defined(p)&&!h.defined(s))return P;const C=rL(t,i,f,n,o,s,r,l,c),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();return t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{h.defined(o)&&h.defined(o.attributes)&&h.defined(o.attributes[f])?aL(P,C,r,l):h.defined(s)?lL(P,C,r,l):cL(u,d,P,C,r,l)},P}function kz(t,i,e,n,o,s,r){return h.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:i,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:r,primitive:e,draco:n,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:s})}function Kz(t,i,e,n){const o=new xC;o.featureCount=i.featureCount,o.nullFeatureId=i.nullFeatureId,o.propertyTableId=i.propertyTable,o.label=i.label,o.positionalLabel=n;const s=i.texture;o.textureReader=St(t,s,e,h.Sampler.NEAREST);const l=(h.defined(s.channels)?s.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=l,o}function IC(t,i){const e=new EC;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=i,e}function DC(t,i){const e=new AC;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=i,e.offset=0,e.repeat=1,e}function RC(t,i,e,n){const o=new EC,s=t.featureIds;return o.featureCount=e,o.propertyTableId=i,o.setIndex=zC(s.attribute),o.positionalLabel=n,o}function FC(t,i,e,n){const o=new AC,s=t.featureIds;o.propertyTableId=i,o.featureCount=e,o.offset=s.constant??0;const r=s.divisor??0;return o.repeat=r===0?void 0:r,o.positionalLabel=n,o}function Jz(t,i,e,n,o,s){const r=new xC,l=i.featureIds,c=l.texture;return r.featureCount=o,r.propertyTableId=e,r.textureReader=St(t,c,n,h.Sampler.NEAREST),r.textureReader.channels=l.channels,r.positionalLabel=s,r}function jz(t,i){const e=new tz,n=t.gltfJson.accessors,o=n[i.input];e.input=Gh(t,o,void 0);const s=i.interpolation;e.interpolation=h.InterpolationType[s]??h.InterpolationType.LINEAR;const r=n[i.output];return e.output=Gh(t,r,!0),e}function eL(t,i,e){const n=new nz,o=t.sampler;return n.sampler=i[o],n.target=hL(t.target,e),n}function tL(t,i){const e=h.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:i,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function iL(t){const i=new sz;i.name=t.name;const e=t.type.toUpperCase();return i.type=h.ArticulationStageType[e],i.minimumValue=t.minimumValue,i.maximumValue=t.maximumValue,i.initialValue=t.initialValue,i}async function nL(t,i,e,n,o){const{gltfJson:s}=t;if(await i.load(),t.isDestroyed())return;const r=LC(s,e,i.typedArray);n=n??!1,uL(e,r,o,n)}function oL(t,i){const e=t.type;if(e===h.AttributeType.SCALAR)return i.fill(0);const n=h.AttributeType.getMathType(e);return i.fill(n.clone(n.ZERO))}function zC(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function sL(t,i,e,n,o){var p;const s=t.accessors[i],r=h.AttributeType.getMathType(s.type),l=s.normalized??!1,c=new YF;c.name=e,c.semantic=n,c.setIndex=o,c.constant=dL(r),c.componentDatatype=s.componentType,c.normalized=l,c.count=s.count,c.type=s.type,c.min=Qt(r,s.min),c.max=Qt(r,s.max),c.byteOffset=s.byteOffset,c.byteStride=h.getAccessorByteStride(t,s),h.hasExtension(s,"WEB3D_quantized_attributes")&&pL(s.extensions.WEB3D_quantized_attributes,c,r);const u=c.semantic===h.VertexAttributeSemantic.POSITION||c.semantic===h.VertexAttributeSemantic.NORMAL||c.semantic===h.VertexAttributeSemantic.TANGENT||c.semantic===h.VertexAttributeSemantic.TEXCOORD||c.semantic===h.VertexAttributeSemantic.FEATURE_ID||c.semantic===h.VertexAttributeSemantic.SCALE||c.semantic===h.VertexAttributeSemantic.ROTATION;return((p=t.extensionsRequired)==null?void 0:p.includes("KHR_mesh_quantization"))&&l&&u&&gL(c,r),c}function rL(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,p=u.accessors[i].bufferView;return h.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:c,bufferViewId:p,primitive:n,draco:o,spz:s,attributeSemantic:e,accessorId:i,asynchronous:t._asynchronous,loadBuffer:r,loadTypedArray:l})}function aL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=i.quantization,e&&(t.buffer=i.buffer),n){const o=h.defined(i.quantization)?i.quantization.componentDatatype:t.componentDatatype;t.typedArray=h.ComponentDatatype.createArrayBufferView(o,i.typedArray.buffer)}}function lL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=i.buffer),n&&h.defined(i.typedArray)&&(t.typedArray=h.ComponentDatatype.createArrayBufferView(t.componentDatatype,i.typedArray.buffer)),t.semantic===h.VertexAttributeSemantic.POSITION){const o=r=>{let l=1/0,c=-1/0,u=1/0,d=-1/0,p=1/0,f=-1/0;for(let g=0;g<r.length;g+=3){const m=r[g],y=r[g+1],_=r[g+2];l=Math.min(l,m),c=Math.max(c,m),u=Math.min(u,y),d=Math.max(d,y),p=Math.min(p,_),f=Math.max(f,_)}return[new h.Cartesian3(l,u,p),new h.Cartesian3(c,d,f)]},s=t.typedArray;[t.min,t.max]=o(s)}}function cL(t,i,e,n,o,s){if(o&&(e.buffer=n.buffer),s){const r=n.typedArray;e.typedArray=LC(t,i,r),o||(e.byteOffset=0,e.byteStride=void 0)}}function hL(t,i){const e=new iz,n=t.node;if(!h.defined(n))return;e.node=i[n];const o=t.path.toUpperCase();return e.path=ez[o],e}function LC(t,i,e){let n=i.byteOffset;const o=h.getAccessorByteStride(t,i),s=i.count,r=h.numberOfComponentsForType(i.type),l=i.componentType,c=h.ComponentDatatype.getSizeInBytes(l),u=c*r,d=s*r;if(o===u)return e=new Uint8Array(e),h.ComponentDatatype.createArrayBufferView(l,e.buffer,e.byteOffset+n,d);const p=h.ComponentDatatype.createTypedArray(l,d),f=new DataView(e.buffer),g=new Array(r),m=h.getComponentReader(i.componentType);n=e.byteOffset+n;for(let y=0;y<s;++y){m(f,n,r,c,g);for(let _=0;_<r;++_)p[y*r+_]=g[_];n+=o}return p}function uL(t,i,e,n){const o=t.type,s=t.count;if(o===h.AttributeType.SCALAR)for(let r=0;r<s;r++)e[r]=i[r];else if(o===h.AttributeType.VEC4&&n)for(let r=0;r<s;r++)e[r]=h.Quaternion.unpack(i,r*4);else{const r=h.AttributeType.getMathType(o),l=h.AttributeType.getNumberOfComponents(o);for(let c=0;c<s;c++)e[c]=r.unpack(i,c*l)}return e}function dL(t){return t===Number?0:new t}function pL(t,i,e){const n=t.decodeMatrix,o=Qt(e,t.decodedMin),s=Qt(e,t.decodedMax);h.defined(o)&&h.defined(s)&&(i.min=o,i.max=s);const r=new h.ModelComponents.Quantization;r.componentDatatype=i.componentDatatype,r.type=i.type,n.length===4?(r.quantizedVolumeOffset=n[2],r.quantizedVolumeStepSize=n[0]):n.length===9?(r.quantizedVolumeOffset=new h.Cartesian2(n[6],n[7]),r.quantizedVolumeStepSize=new h.Cartesian2(n[0],n[4])):n.length===16?(r.quantizedVolumeOffset=new h.Cartesian3(n[12],n[13],n[14]),r.quantizedVolumeStepSize=new h.Cartesian3(n[0],n[5],n[10])):n.length===25&&(r.quantizedVolumeOffset=new h.Cartesian4(n[20],n[21],n[22],n[23]),r.quantizedVolumeStepSize=new h.Cartesian4(n[0],n[6],n[12],n[18])),i.quantization=r}const fL={VEC2:new h.Cartesian2(-1,-1),VEC3:new h.Cartesian3(-1,-1,-1),VEC4:new h.Cartesian4(-1,-1,-1,-1)};function gL(t,i){const e=mL(t.componentDatatype),n=fL[t.type];let o=t.min;h.defined(o)&&(o=i.divideByScalar(o,e,o),o=i.maximumByComponent(o,n,o));let s=t.max;h.defined(s)&&(s=i.divideByScalar(s,e,s),s=i.maximumByComponent(s,n,s)),t.min=o,t.max=s}function mL(t){switch(t){case h.ComponentDatatype.BYTE:return 127;case h.ComponentDatatype.UNSIGNED_BYTE:return 255;case h.ComponentDatatype.SHORT:return 32767;case h.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function OC(t,i){if(!h.defined(i))return;const e=i.length;if(e===0)return;const n=t.length;t.length+=e;for(let o=0;o<e;o++)t[n+o]=i[o]}h.Material.XbsjPolylineArrow="XbsjPolylineArrow",h.Material._materialCache.addMaterial(h.Material.XbsjPolylineArrow,{fabric:{type:h.Material.XbsjPolylineArrow,uniforms:{color:new h.Color(1,1,1,1),arrowColor:new h.Color(1,1,1,1),image:a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
1958
+ `;h.Material.GlobeLevelMaterialType="GlobelLevel",h.Material._materialCache.addMaterial(h.Material.GlobeLevelMaterialType,{fabric:{type:h.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new h.Cartesian3(0,0,0),input_highlights:new h.Cartesian3(1,1,1),midtones:new h.Cartesian3(.5,.5,.5),output_shadows:new h.Cartesian3(0,0,0),output_highlights:new h.Cartesian3(1,1,1)},source:RF},translucent:!1});const{PrimitiveRenderResources:FF,ModelUtility:zF,Cartesian3:ai,Matrix4:sr,ModelRenderResources:LF,defined:OF,NodeRenderResources:NF,BoundingSphere:rn,ModelDrawCommands:BF}=h,VF=new ai,UF=new ai,bC=new ai,SC=new ai;class WF extends FF{constructor(i,e,n){if(super(i,e),!i.runtimeNode.instancingTranslationMin||!i.runtimeNode.instancingTranslationMax)return;const o=sr.inverse(n,new sr),s=zF.getPositionMinMax(e.primitive,sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMin,bC),sr.multiplyByPoint(o,i.runtimeNode.instancingTranslationMax,SC));this.positionMin=ai.clone(s.min,new ai),this.positionMax=ai.clone(s.max,new ai),this.boundingSphere=rn.fromCornerPoints(this.positionMin,this.positionMax,new rn)}}function GF(){h.ModelSceneGraph.prototype.buildDrawCommands=function(t){const i=this._model,e=new LF(i);i.statistics.clear(),this.configurePipeline(t);const n=this.modelPipelineStages;let o,s,r;for(o=0;o<n.length;o++)n[o].process(e,i,t);const l=ai.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,VF),c=ai.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,UF);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!OF(u))continue;u.configurePipeline();const d=u.pipelineStages,p=new NF(e,u);for(s=0;s<d.length;s++)d[s].process(p,u.node,t);const f=u.computedTransform;for(s=0;s<u.runtimePrimitives.length;s++){const g=u.runtimePrimitives[s];g.configurePipeline(t);const m=g.pipelineStages,y=new WF(p,g,f);for(r=0;r<m.length;r++)m[r].process(y,g.primitive,t);g.boundingSphere=rn.clone(y.boundingSphere,new rn);const _=sr.multiplyByPoint(f,y.positionMin,bC),P=sr.multiplyByPoint(f,y.positionMax,SC);ai.minimumByComponent(l,_,l),ai.maximumByComponent(c,P,c);const C=BF.buildModelDrawCommand(y,t);g.drawCommand=C}}this._boundingSphere=rn.fromCornerPoints(l,c,new rn),this._boundingSphere=rn.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=rn.transform(this._boundingSphere,this._components.transform,this._boundingSphere),i._boundingSphere=rn.transform(this._boundingSphere,i.modelMatrix,i._boundingSphere),i._initialRadius=i._boundingSphere.radius,i._boundingSphere.radius*=i._clampedScale}}const dc=class dc extends a.Destroyable{constructor(){super(),h.ParticleSystem.prototype.update=function(i){const e=i.time;i.time=this._falseTime;try{dc.oldUpdate.call(this,i),this._particles.forEach(n=>{h.Billboard.prototype&&(n._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}i.time=e},this.d(()=>{h.ParticleSystem.prototype.update=dc.oldUpdate})}};v(dc,"oldUpdate",h.ParticleSystem.prototype.update);let bg=dc;function HF(){if(h.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(h.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,h.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=h.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class $F{constructor(i){v(this,"index");v(this,"image");v(this,"resolve");v(this,"reject");v(this,"rectangle");this.index=i.index,this.image=i.image,this.resolve=i.resolve,this.reject=i.reject,this.rectangle=void 0}}function qF(){h.TextureAtlas.prototype._resize=function(t,i=0){const e=this._borderWidthInPixels,n=this._rectangles,o=this._imagesToAddQueue,s=this._texture;let r=s.width,l=s.height;const c=this._subRegions,u=n.map((P,C)=>new $F({index:C,image:P})).filter((P,C)=>h.defined(P.image)&&!h.defined(c.get(C)));let d=0,p=0,f=0;for(let P=i;P<o.length;++P){const{width:C,height:S}=o[P].image;d=Math.max(d,C),p=Math.max(p,S),f+=C*S,u.push(o[P])}r=Math.max(d,r),l=Math.max(p,l),t.webgl2||(r=h.Math.nextPowerOfTwo(r),l=h.Math.nextPowerOfTwo(l));const g=Math.sqrt(f);l*=Math.ceil(g/l),r*=Math.ceil(g/r),u.sort(({image:P},{image:C})=>C.height*C.width-P.height*P.width);const m=new Array(this._nextIndex);for(const P of this._subRegions.keys())h.defined(c.get(P))&&(m[P]=n[P]);let y,_=!1;for(;!_;){y=new h.TexturePacker({height:l,width:r,borderPadding:e});let P;for(P=0;P<u.length;++P){const{index:C,image:S}=u[P];if(!h.defined(S))continue;const x=y.pack(C,S);if(!h.defined(x)){r>l?l*=2:r*=2;break}m[C]=x.rectangle}_=P===u.length}this._texturePacker=y,this._texture=this._copyFromTexture(t,r,l,m),s.destroy(),this._rectangles=m,this._guid=h.createGuid()}}const $n={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:XF,Indices:YF,FeatureIdAttribute:EC,FeatureIdTexture:xC,FeatureIdImplicitRange:AC,MorphTarget:ZF,Primitive:QF,Instances:kF,Skin:KF,Node:JF,AnimatedPropertyType:jF,AnimationSampler:ez,AnimationTarget:tz,AnimationChannel:iz,Animation:nz,ArticulationStage:oz,Articulation:sz,Asset:rz,Scene:az,Components:lz,MetallicRoughness:cz,SpecularGlossiness:hz,Specular:uz,Anisotropy:Sg,Clearcoat:Eg,Material:dz}=h.ModelComponents;function pz(){h.GltfLoader.prototype.process=function(t){if(h.Check.typeOf.object("frameState",t),this._state===$n.LOADED&&!h.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=fz(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),h.defined(this._processError)){this._state=$n.FAILED;const o=this._processError;this._processError=void 0,xg(this,o)}const i=this._textureErrors.pop();if(h.defined(i)){const o=this.getError("Failed to load glTF texture",i);throw o.name="TextureError",o}if(this._state===$n.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=$n.FAILED,xg(this,o)}let n=!1;try{n=this._processTextures(t)}catch(o){this._textureState=$n.FAILED,xg(this,o)}return this._incrementallyLoadTextures?e:e&&n}}async function fz(t,i){h.FeatureDetection.supportsWebP.initialized||await h.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new h.SupportedImageFormats({webp:h.FeatureDetection.supportsWebP(),basis:i.context.supportsBasis});const e=mz(t,i);return t._state=$n.PROCESSING,t._textureState=$n.PROCESSING,h.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(h.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const gz=new h.Cartesian3;function mz(t,i){const e=t.gltfJson,n=e.extensions??h.Frozen.EMPTY_OBJECT,o=n.EXT_structural_metadata,s=n.EXT_feature_metadata,r=n.CESIUM_RTC;if(h.defined(s)){const C=s.featureTables,S=s.featureTextures,x=h.defined(C)?C:[],A=h.defined(S)?S:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(A).sort()}const l=vz(t,i),c=Pz(t,l),u=bz(t,l),d=Sz(e),p=Ez(e,l),f=new lz,g=new rz,m=e.asset.copyright;if(h.defined(m)){const C=m.split(";").map(function(S){return new h.Credit(S.trim())});g.credits=C}if(f.asset=g,f.scene=p,f.nodes=l,f.skins=c,f.animations=u,f.articulations=d,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,h.defined(r)){const C=h.Cartesian3.fromArray(r.center,0,gz);f.transform=h.Matrix4.fromTranslation(C,f.transform)}if(t._components=f,h.defined(o)||h.defined(s)){const C=xz(t,o,s,i);t._loaderPromises.push(C)}const y=n.NGA_gpm_local;if(h.defined(y)){const C=h.GltfGpmLoader.load(y);t._components.extensions.NGA_gpm_local=C}const _=e.meshes;if(h.defined(_))for(const C of _){const S=C.primitives;if(h.defined(S))for(const x of S){const A=x.extensions;if(h.defined(A)){const R=A.NGA_gpm_local;if(h.defined(R)){const O=Az(t,e,R,i);t._loaderPromises.push(O)}}}}const P=[];return OC(P,t._loaderPromises),t._incrementallyLoadTextures||OC(P,t._texturesPromises),Promise.all(P)}function vz(t,i){const e=t.gltfJson.nodes;if(!h.defined(e))return[];const n=e.map(function(o,s){const r=yz(t,o,i);return r.index=s,r});for(let o=0;o<n.length;++o){const s=e[o].children;if(h.defined(s))for(let r=0;r<s.length;++r)n[o].children.push(n[s[r]])}return n}function yz(t,i,e){const n=new JF;n.name=i.name,n.matrix=Qt(h.Matrix4,i.matrix),n.translation=Qt(h.Cartesian3,i.translation),n.rotation=Qt(h.Quaternion,i.rotation),n.scale=Qt(h.Cartesian3,i.scale);const o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.EXT_mesh_gpu_instancing,r=o.AGI_articulations;if(h.defined(s)){if(t._loadForClassification)throw new h.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");n.instances=Tz(t,o,e)}h.defined(r)&&(n.articulationName=r.articulationName);const l=i.mesh;if(h.defined(l)){const c=t.gltfJson.meshes[l],u=c.primitives;for(let f=0;f<u.length;++f)n.primitives.push(wz(t,u[f],h.defined(n.instances),e));const d=i.weights??c.weights,p=n.primitives[0].morphTargets;n.morphWeights=h.defined(d)?d.slice():new Array(p.length).fill(0)}return n}function wz(t,i,e,n){const o=new QF,s=new h.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(s);const r=i.material;h.defined(r)&&(o.material=Cz(t,t.gltfJson.materials[r],n));const l=i.extensions??h.Frozen.EMPTY_OBJECT;let c=!1;const u=l.CESIUM_primitive_outline;t._loadPrimitiveOutline&&h.defined(u)&&(c=!0,s.needsOutlines=!0,s.outlineIndices=Mz(t,u));const d=l.KHR_spz_gaussian_splats_compression;h.defined(d)&&(c=!0,s.needsGaussianSplats=!0);const p=t._loadForClassification,f=l.KHR_draco_mesh_compression;let g=!1;const m=i.attributes;if(h.defined(m))for(const R in m){if(!m.hasOwnProperty(R))continue;const O=m[R],N=Ag(t,h.VertexAttributeSemantic,R),V=N.modelSemantic;if(p&&!Dz(V))continue;V===h.VertexAttributeSemantic.FEATURE_ID&&(g=!0);const U=TC(t,O,N,i,f,d,e,c,n);s.attributePlans.push(U),o.attributes.push(U.attribute)}const y=i.targets;if(h.defined(y)&&!p)for(let R=0;R<y.length;++R)o.morphTargets.push(Rz(t,y[R],c,s,n));const _=i.indices;if(h.defined(_)){const R=Fz(t,_,i,f,g,c,n);h.defined(R)&&(s.indicesPlan=R,o.indices=R.indices)}const P=l.EXT_structural_metadata,C=l.EXT_mesh_features,S=l.EXT_feature_metadata,x=h.defined(S);h.defined(C)?zz(t,o,C,n):x&&Lz(t,o,S,n),h.defined(P)?Oz(o,P):x&&Nz(t,o,S);const A=i.mode;if(p&&A!==h.PrimitiveType.TRIANGLES)throw new h.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=A,o}function Cz(t,i,e){const n=new dz,o=i.extensions??h.Frozen.EMPTY_OBJECT,s=o.KHR_materials_pbrSpecularGlossiness,r=o.KHR_materials_specular,l=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,u=i.pbrMetallicRoughness;return n.unlit=h.defined(o.KHR_materials_unlit),h.defined(s)?n.specularGlossiness=_z(t,s,e):(h.defined(u)&&(n.metallicRoughness=Bz(t,u,e)),h.defined(r)&&!n.unlit&&(n.specular=Vz(t,r,e)),h.defined(l)&&!n.unlit&&(n.anisotropy=Uz(t,l,e)),h.defined(c)&&!n.unlit&&(n.clearcoat=Wz(t,c,e))),h.defined(i.emissiveTexture)&&(n.emissiveTexture=St(t,i.emissiveTexture,e,void 0)),h.defined(i.normalTexture)&&!t._loadForClassification&&(n.normalTexture=St(t,i.normalTexture,e,void 0)),h.defined(i.occlusionTexture)&&(n.occlusionTexture=St(t,i.occlusionTexture,e,void 0)),n.emissiveFactor=Qt(h.Cartesian3,i.emissiveFactor),n.alphaMode=i.alphaMode,n.alphaCutoff=i.alphaCutoff,n.doubleSided=i.doubleSided,n.name=i.name,n}function _z(t,i,e){const{diffuseTexture:n,specularGlossinessTexture:o,diffuseFactor:s,specularFactor:r,glossinessFactor:l}=i,c=new hz;return h.defined(n)&&(c.diffuseTexture=St(t,n,e,void 0)),h.defined(o)&&(c.specularGlossinessTexture=St(t,o,e,void 0)),c.diffuseFactor=Qt(h.Cartesian4,s),c.specularFactor=Qt(h.Cartesian3,r),c.glossinessFactor=l,c}function xg(t,i){throw t.unload(),t.getError("Failed to load glTF",i)}function Pz(t,i){const e=t.gltfJson.skins;if(t._loadForClassification||!h.defined(e))return[];const n=e.map(function(s,r){const l=Gz(t,s,i);return l.index=r,l}),o=t.gltfJson.nodes;for(let s=0;s<i.length;++s){const r=o[s].skin;h.defined(r)&&(i[s].skin=n[r])}return n}function bz(t,i){const e=t.gltfJson.animations;return t._loadForClassification||!h.defined(e)?[]:e.map(function(o,s){const r=Hz(t,o,i);return r.index=s,r})}function Sz(t){var n;const e=(n=(t.extensions??h.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:n.articulations;return h.defined(e)?e.map($z):[]}function Ez(t,i){const e=new az,n=qz(t);return e.nodes=n.map(function(o){return i[o]}),e}async function xz(t,i,e,n){const o=new h.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:i,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function Az(t,i,e,n){const o=new h.GltfMeshPrimitiveGpmLoader({gltf:i,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:n,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function Qt(t,i){if(h.defined(i))return t===Number?i[0]:t.unpack(i)}function Tz(t,i,e){const n=i.EXT_mesh_gpu_instancing,o=new kF,s=n.attributes;if(h.defined(s))for(const u in s){if(!s.hasOwnProperty(u))continue;const d=s[u];o.attributes.push(Xz(t,d,s,u,e))}const r=n.extensions??h.Frozen.EMPTY_OBJECT,l=i.EXT_instance_features,c=r.EXT_feature_metadata;return h.defined(l)?Yz(o,l):h.defined(c)&&Zz(t.gltfJson,o,c,t._sortedPropertyTableIds),o}function Mz(t,i){const e=i.indices,n=t.gltfJson.accessors[e];return Gh(t,n,!1)}const Iz={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function Ag(t,i,e){let n=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(n="_FEATURE_ID_0");const o=i.fromGltfSemantic(n),s=Iz;return s.gltfSemantic=e,s.renamedSemantic=n,s.modelSemantic=o,s}function Dz(t){const i=t===h.VertexAttributeSemantic.POSITION,e=t===h.VertexAttributeSemantic.FEATURE_ID,n=t===h.VertexAttributeSemantic.TEXCOORD;return i||e||n}function TC(t,i,e,n,o,s,r,l,c){const u=e.modelSemantic,d=u===h.VertexAttributeSemantic.POSITION,p=u===h.VertexAttributeSemantic.FEATURE_ID,f=d&&!r&&t._loadAttributesFor2D&&!c.scene3DOnly,g=d&&t._enablePick&&!c.context.webgl2,m=t._loadForClassification&&p,y=t._loadAttributesAsTypedArray,_=!y,P=y||f||g||m,x=MC(t,i,e,n,o,s,l?!1:_,l?!0:P,c),A=new h.PrimitiveLoadPlan.AttributeLoadPlan(x);return A.loadBuffer=_,A.loadTypedArray=P,A}function Rz(t,i,e,n,o){const s=new ZF,r=void 0,l=void 0,c=void 0,u=!1;for(const d in i){if(!i.hasOwnProperty(d))continue;const p=i[d],f=Ag(t,VertexAttributeSemantic,d),g=TC(t,p,f,r,l,c,u,e,o);s.attributes.push(g.attribute),n.attributePlans.push(g)}return s}function Fz(t,i,e,n,o,s,r){const l=t.gltfJson.accessors[i],c=l.bufferView;if(!h.defined(n)&&!h.defined(c))return;const u=new YF;u.count=l.count;const d=t._loadAttributesAsTypedArray,p=(t._loadIndicesForWireframe||t._enablePick)&&!r.context.webgl2,f=t._loadForClassification&&o,m=!d,y=d||p||f,C=Qz(t,i,e,n,s?!1:m,s?!0:y,r),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{u.indexDatatype=C.indexDatatype,u.buffer=C.buffer,u.typedArray=C.typedArray};const A=new h.PrimitiveLoadPlan.IndicesLoadPlan(u);return A.loadBuffer=m,A.loadTypedArray=y,A}function zz(t,i,e,n){let o;h.defined(e)&&h.defined(e.featureIds)?o=e.featureIds:o=[];for(let s=0;s<o.length;s++){const r=o[s],l=`featureId_${s}`;let c;h.defined(r.texture)?c=kz(t,r,n,l):h.defined(r.attribute)?c=IC(r,l):c=DC(r,l),i.featureIds.push(c)}}function Lz(t,i,e,n){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let s=0;const r=e.featureIdAttributes;if(h.defined(r))for(let c=0;c<r.length;++c){const u=r[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;let m;h.defined(u.featureIds.attribute)?m=RC(u,p,f,g):m=FC(u,p,f,g),i.featureIds.push(m)}const l=e.featureIdTextures;if(h.defined(l))for(let c=0;c<l.length;++c){const u=l[c],d=u.featureTable,p=t._sortedPropertyTableIds.indexOf(d),f=o[d].count,g=`featureId_${s}`;s++;const m=Kz(t,u,p,n,f,g);i.featureIds.push(m)}}function Oz(t,i){if(!h.defined(i))return;const{propertyTextures:e,propertyAttributes:n}=i;h.defined(e)&&(t.propertyTextureIds=e),h.defined(n)&&(t.propertyAttributeIds=n)}function Nz(t,i,e){h.defined(e.featureTextures)&&(i.propertyTextureIds=e.featureTextures.map(function(n){return t._sortedFeatureTextureIds.indexOf(n)}))}function Bz(t,i,e){const{baseColorTexture:n,metallicRoughnessTexture:o,baseColorFactor:s,metallicFactor:r,roughnessFactor:l}=i,c=new cz;return h.defined(n)&&(c.baseColorTexture=St(t,n,e,void 0)),h.defined(o)&&(c.metallicRoughnessTexture=St(t,o,e,void 0)),c.baseColorFactor=Qt(h.Cartesian4,s),c.metallicFactor=r,c.roughnessFactor=l,c}function Vz(t,i,e){const{specularFactor:n,specularTexture:o,specularColorFactor:s,specularColorTexture:r}=i,l=new uz;return h.defined(o)&&(l.specularTexture=St(t,o,e,void 0)),h.defined(r)&&(l.specularColorTexture=St(t,r,e,void 0)),l.specularFactor=n,l.specularColorFactor=Qt(h.Cartesian3,s),l}function Uz(t,i,e){const{anisotropyStrength:n=Sg.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Sg.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:s}=i,r=new Sg;return h.defined(s)&&(r.anisotropyTexture=St(t,s,e,void 0)),r.anisotropyStrength=n,r.anisotropyRotation=o,r}function Wz(t,i,e){const{clearcoatFactor:n=Eg.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:s=Eg.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:r,clearcoatNormalTexture:l}=i,c=new Eg;return h.defined(o)&&(c.clearcoatTexture=St(t,o,e,void 0)),h.defined(r)&&(c.clearcoatRoughnessTexture=St(t,r,e,void 0)),h.defined(l)&&(c.clearcoatNormalTexture=St(t,l,e,void 0)),c.clearcoatFactor=n,c.clearcoatRoughnessFactor=s,c}function St(t,i,e,n){const o=t.gltfJson,s=h.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:i.index,supportedImageFormats:t._supportedImageFormats});if(!h.defined(s))return;const r=h.ResourceCache.getTextureLoader({gltf:o,textureInfo:i,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),l=h.GltfLoaderUtil.createModelTextureReader({textureInfo:i}),c=t._textureLoaders.length;t._textureLoaders.push(r);const u=r.load().catch(d=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw d;t._textureState=$n.FAILED,t._textureErrors.push(d)}});return t._texturesPromises.push(u),t._textureCallbacks[c]=()=>{l.texture=r.texture,h.defined(n)&&(l.texture.sampler=n)},l}function Gz(t,i,e){const n=new KF,o=i.joints;n.joints=o.map(r=>e[r]);const s=i.inverseBindMatrices;if(h.defined(s)){const r=t.gltfJson.accessors[s];n.inverseBindMatrices=Gh(t,r,void 0)}else n.inverseBindMatrices=new Array(o.length).fill(h.Matrix4.IDENTITY);return n}function Hz(t,i,e){const n=new nz;n.name=i.name;const o=i.samplers.map(function(r,l){const c=Jz(t,r);return c.index=l,c}),s=i.channels.map(function(r){return jz(r,o,e)});return n.samplers=o,n.channels=s,n}function $z(t){const i=new sz;return i.name=t.name,i.stages=t.stages.map(tL),i}function qz(t){let i;return h.defined(t.scenes)&&h.defined(t.scene)&&(i=t.scenes[t.scene].nodes),i=i??t.nodes,i=h.defined(i)?i:[],i}function Xz(t,i,e,n,o){const s=t.gltfJson.accessors,r=h.defined(e.ROTATION),l=h.defined(e.TRANSLATION)&&h.defined(s[e.TRANSLATION].min)&&h.defined(s[e.TRANSLATION].max),c=Ag(t,h.InstanceAttributeSemantic,n),u=c.modelSemantic,d=u===h.InstanceAttributeSemantic.TRANSLATION||u===h.InstanceAttributeSemantic.ROTATION||u===h.InstanceAttributeSemantic.SCALE,p=u===h.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||r&&d||!o.context.instancedArrays,g=t._enablePick&&!o.context.webgl2,m=!f,y=t._loadAttributesFor2D&&!o.scene3DOnly;return MC(t,i,c,void 0,void 0,void 0,m,f||p&&(!l||y||g),o)}function Yz(t,i){const e=i.featureIds;for(let n=0;n<e.length;n++){const o=e[n],s=`instanceFeatureId_${n}`;let r;h.defined(o.attribute)?r=IC(o,s):r=DC(o,s),t.featureIds.push(r)}}function Zz(t,i,e,n){const o=t.extensions.EXT_feature_metadata.featureTables,s=e.featureIdAttributes;if(h.defined(s))for(let r=0;r<s.length;++r){const l=s[r],c=l.featureTable,u=n.indexOf(c),d=o[c].count,p=`instanceFeatureId_${r}`;let f;h.defined(l.featureIds.attribute)?f=RC(l,u,d,p):f=FC(l,u,d,p),i.featureIds.push(f)}}function Gh(t,i,e){const n=new Array(i.count),o=i.bufferView;if(h.defined(o)){const s=eL(t,o),r=iL(t,s,i,e,n);return t._loaderPromises.push(r),n}return nL(i,n)}function MC(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,d=u.accessors[i],p=d.bufferView,f=e.gltfSemantic,g=e.renamedSemantic,m=e.modelSemantic,y=h.defined(m)?zC(g):void 0,P=oL(u,i,f,m,y);if(!h.defined(o)&&!h.defined(p)&&!h.defined(s))return P;const C=sL(t,i,f,n,o,s,r,l,c),S=t._geometryLoaders.length;t._geometryLoaders.push(C);const x=C.load();return t._loaderPromises.push(x),t._geometryCallbacks[S]=()=>{h.defined(o)&&h.defined(o.attributes)&&h.defined(o.attributes[f])?rL(P,C,r,l):h.defined(s)?aL(P,C,r,l):lL(u,d,P,C,r,l)},P}function Qz(t,i,e,n,o,s,r){return h.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:i,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:r,primitive:e,draco:n,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:s})}function kz(t,i,e,n){const o=new xC;o.featureCount=i.featureCount,o.nullFeatureId=i.nullFeatureId,o.propertyTableId=i.propertyTable,o.label=i.label,o.positionalLabel=n;const s=i.texture;o.textureReader=St(t,s,e,h.Sampler.NEAREST);const l=(h.defined(s.channels)?s.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=l,o}function IC(t,i){const e=new EC;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=i,e}function DC(t,i){const e=new AC;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=i,e.offset=0,e.repeat=1,e}function RC(t,i,e,n){const o=new EC,s=t.featureIds;return o.featureCount=e,o.propertyTableId=i,o.setIndex=zC(s.attribute),o.positionalLabel=n,o}function FC(t,i,e,n){const o=new AC,s=t.featureIds;o.propertyTableId=i,o.featureCount=e,o.offset=s.constant??0;const r=s.divisor??0;return o.repeat=r===0?void 0:r,o.positionalLabel=n,o}function Kz(t,i,e,n,o,s){const r=new xC,l=i.featureIds,c=l.texture;return r.featureCount=o,r.propertyTableId=e,r.textureReader=St(t,c,n,h.Sampler.NEAREST),r.textureReader.channels=l.channels,r.positionalLabel=s,r}function Jz(t,i){const e=new ez,n=t.gltfJson.accessors,o=n[i.input];e.input=Gh(t,o,void 0);const s=i.interpolation;e.interpolation=h.InterpolationType[s]??h.InterpolationType.LINEAR;const r=n[i.output];return e.output=Gh(t,r,!0),e}function jz(t,i,e){const n=new iz,o=t.sampler;return n.sampler=i[o],n.target=cL(t.target,e),n}function eL(t,i){const e=h.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:i,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function tL(t){const i=new oz;i.name=t.name;const e=t.type.toUpperCase();return i.type=h.ArticulationStageType[e],i.minimumValue=t.minimumValue,i.maximumValue=t.maximumValue,i.initialValue=t.initialValue,i}async function iL(t,i,e,n,o){const{gltfJson:s}=t;if(await i.load(),t.isDestroyed())return;const r=LC(s,e,i.typedArray);n=n??!1,hL(e,r,o,n)}function nL(t,i){const e=t.type;if(e===h.AttributeType.SCALAR)return i.fill(0);const n=h.AttributeType.getMathType(e);return i.fill(n.clone(n.ZERO))}function zC(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function oL(t,i,e,n,o){var p;const s=t.accessors[i],r=h.AttributeType.getMathType(s.type),l=s.normalized??!1,c=new XF;c.name=e,c.semantic=n,c.setIndex=o,c.constant=uL(r),c.componentDatatype=s.componentType,c.normalized=l,c.count=s.count,c.type=s.type,c.min=Qt(r,s.min),c.max=Qt(r,s.max),c.byteOffset=s.byteOffset,c.byteStride=h.getAccessorByteStride(t,s),h.hasExtension(s,"WEB3D_quantized_attributes")&&dL(s.extensions.WEB3D_quantized_attributes,c,r);const u=c.semantic===h.VertexAttributeSemantic.POSITION||c.semantic===h.VertexAttributeSemantic.NORMAL||c.semantic===h.VertexAttributeSemantic.TANGENT||c.semantic===h.VertexAttributeSemantic.TEXCOORD||c.semantic===h.VertexAttributeSemantic.FEATURE_ID||c.semantic===h.VertexAttributeSemantic.SCALE||c.semantic===h.VertexAttributeSemantic.ROTATION;return((p=t.extensionsRequired)==null?void 0:p.includes("KHR_mesh_quantization"))&&l&&u&&fL(c,r),c}function sL(t,i,e,n,o,s,r,l,c){const u=t.gltfJson,p=u.accessors[i].bufferView;return h.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:c,bufferViewId:p,primitive:n,draco:o,spz:s,attributeSemantic:e,accessorId:i,asynchronous:t._asynchronous,loadBuffer:r,loadTypedArray:l})}function rL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=i.quantization,e&&(t.buffer=i.buffer),n){const o=h.defined(i.quantization)?i.quantization.componentDatatype:t.componentDatatype;t.typedArray=h.ComponentDatatype.createArrayBufferView(o,i.typedArray.buffer)}}function aL(t,i,e,n){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=i.buffer),n&&h.defined(i.typedArray)&&(t.typedArray=h.ComponentDatatype.createArrayBufferView(t.componentDatatype,i.typedArray.buffer)),t.semantic===h.VertexAttributeSemantic.POSITION){const o=r=>{let l=1/0,c=-1/0,u=1/0,d=-1/0,p=1/0,f=-1/0;for(let g=0;g<r.length;g+=3){const m=r[g],y=r[g+1],_=r[g+2];l=Math.min(l,m),c=Math.max(c,m),u=Math.min(u,y),d=Math.max(d,y),p=Math.min(p,_),f=Math.max(f,_)}return[new h.Cartesian3(l,u,p),new h.Cartesian3(c,d,f)]},s=t.typedArray;[t.min,t.max]=o(s)}}function lL(t,i,e,n,o,s){if(o&&(e.buffer=n.buffer),s){const r=n.typedArray;e.typedArray=LC(t,i,r),o||(e.byteOffset=0,e.byteStride=void 0)}}function cL(t,i){const e=new tz,n=t.node;if(!h.defined(n))return;e.node=i[n];const o=t.path.toUpperCase();return e.path=jF[o],e}function LC(t,i,e){let n=i.byteOffset;const o=h.getAccessorByteStride(t,i),s=i.count,r=h.numberOfComponentsForType(i.type),l=i.componentType,c=h.ComponentDatatype.getSizeInBytes(l),u=c*r,d=s*r;if(o===u)return e=new Uint8Array(e),h.ComponentDatatype.createArrayBufferView(l,e.buffer,e.byteOffset+n,d);const p=h.ComponentDatatype.createTypedArray(l,d),f=new DataView(e.buffer),g=new Array(r),m=h.getComponentReader(i.componentType);n=e.byteOffset+n;for(let y=0;y<s;++y){m(f,n,r,c,g);for(let _=0;_<r;++_)p[y*r+_]=g[_];n+=o}return p}function hL(t,i,e,n){const o=t.type,s=t.count;if(o===h.AttributeType.SCALAR)for(let r=0;r<s;r++)e[r]=i[r];else if(o===h.AttributeType.VEC4&&n)for(let r=0;r<s;r++)e[r]=h.Quaternion.unpack(i,r*4);else{const r=h.AttributeType.getMathType(o),l=h.AttributeType.getNumberOfComponents(o);for(let c=0;c<s;c++)e[c]=r.unpack(i,c*l)}return e}function uL(t){return t===Number?0:new t}function dL(t,i,e){const n=t.decodeMatrix,o=Qt(e,t.decodedMin),s=Qt(e,t.decodedMax);h.defined(o)&&h.defined(s)&&(i.min=o,i.max=s);const r=new h.ModelComponents.Quantization;r.componentDatatype=i.componentDatatype,r.type=i.type,n.length===4?(r.quantizedVolumeOffset=n[2],r.quantizedVolumeStepSize=n[0]):n.length===9?(r.quantizedVolumeOffset=new h.Cartesian2(n[6],n[7]),r.quantizedVolumeStepSize=new h.Cartesian2(n[0],n[4])):n.length===16?(r.quantizedVolumeOffset=new h.Cartesian3(n[12],n[13],n[14]),r.quantizedVolumeStepSize=new h.Cartesian3(n[0],n[5],n[10])):n.length===25&&(r.quantizedVolumeOffset=new h.Cartesian4(n[20],n[21],n[22],n[23]),r.quantizedVolumeStepSize=new h.Cartesian4(n[0],n[6],n[12],n[18])),i.quantization=r}const pL={VEC2:new h.Cartesian2(-1,-1),VEC3:new h.Cartesian3(-1,-1,-1),VEC4:new h.Cartesian4(-1,-1,-1,-1)};function fL(t,i){const e=gL(t.componentDatatype),n=pL[t.type];let o=t.min;h.defined(o)&&(o=i.divideByScalar(o,e,o),o=i.maximumByComponent(o,n,o));let s=t.max;h.defined(s)&&(s=i.divideByScalar(s,e,s),s=i.maximumByComponent(s,n,s)),t.min=o,t.max=s}function gL(t){switch(t){case h.ComponentDatatype.BYTE:return 127;case h.ComponentDatatype.UNSIGNED_BYTE:return 255;case h.ComponentDatatype.SHORT:return 32767;case h.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function OC(t,i){if(!h.defined(i))return;const e=i.length;if(e===0)return;const n=t.length;t.length+=e;for(let o=0;o<e;o++)t[n+o]=i[o]}h.Material.XbsjPolylineArrow="XbsjPolylineArrow",h.Material._materialCache.addMaterial(h.Material.XbsjPolylineArrow,{fabric:{type:h.Material.XbsjPolylineArrow,uniforms:{color:new h.Color(1,1,1,1),arrowColor:new h.Color(1,1,1,1),image:a.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
1959
1959
  uniform vec4 color; // 叠加颜色
1960
1960
  uniform vec4 arrowColor; // 箭头颜色
1961
1961
  uniform sampler2D image; // 箭头贴图
@@ -1991,8 +1991,8 @@ return material;
1991
1991
  material.alpha = fragColor.a;
1992
1992
 
1993
1993
  return material;
1994
- }`},translucent:!0}),bF(),SF(),EF(),MF(),IF(),DF(),RF(),PF(),HF(),$F(),XF(),fz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function vL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class yL 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(),Tg(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=_F;await l.promise(vL());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 WC(d,e);Tg(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 wL=new h.EllipsoidTerrainProvider;class NC 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)??wL}))}_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 BC 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 $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class CL 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 _L 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 PL 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 _L(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class bL 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 PL(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class VC extends a.Destroyable{constructor(e){super();v(this,"_czmImageryWrappers",new Set);v(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new CL(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 bL(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 UC 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 A;if(p?A=await m.pickFromRayMostDetailed(P,this.objectsToExclude):A=m.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=re(A.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 A,R,O,N;let y=n.scene.pick(_e(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await SL(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=(A=document.elementFromPoint(d[0]+V,d[1]+U))==null?void 0:A.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:vr(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:vr(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)):gu(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 SL(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 EL 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 Tg(t,i){a.setExtProp(t,"_viewerExtensions",i)}class WC 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 VC(this.viewer)),this._terrainManager=this.dv(new NC(this.viewer)),this._labelManager=this.dv(new BC(this.viewer)),this._poiContext=this.disposeVar(new Dm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new EL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new UC(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 GC=new h.Cartesian3,HC=new h.Cartesian3;function $C(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,GC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,HC);else var c=h.Cartesian3.cross(t.up,r,HC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,GC);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){$C(t,i,!1)}function XC(t,i){$C(t,-i,!0)}class xL 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&&XC(s,-d*p),r.MoveRight&&XC(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 Hh 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(`
1995
- `))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=Hh.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 AL extends a.Destroyable{constructor(e){super();v(this,"_keyStatus");v(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Hh(this)),this._cameraOp=this.dv(new xL(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const kh=class kh extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!1)));v(this,"_keyStatusMap",this.dv(a.react(kh.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 AL(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(kh,"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 $h=kh;function TL(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 ML 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;TL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const Kh=class Kh extends a.Destroyable{constructor(e){super();v(this,"_mouseMoving",this.dv(new ML(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=Kh.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(Kh,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Mg=Kh;class IL 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 Mg(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 DL extends a.Destroyable{constructor(e){super();v(this,"viewer");v(this,"_mouseCameraController",this.dv(new IL(this)));v(this,"_keyboardCameraController",this.dv(new $h(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 YC(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 Ig(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=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 RL 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=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.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??Bi.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 Bi 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 RL(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(Bi,"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})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class pa extends a.Destroyable{constructor(e){super();v(this,"_geoCameraController");v(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(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 FL(this,e);if(this.lineMode==="manual")return new zL(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})})(pa||(pa={})),a.extendClassProps(pa.prototype,pa.createDefaultProps);class FL extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class zL 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 LL 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 OL 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 LL(s,e)}))}}class fa extends a.Destroyable{constructor(e){super();v(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new OL(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})})(fa||(fa={})),a.extendClassProps(fa.prototype,fa.createDefaultProps);class NL 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 BL 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 NL(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 VL 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 UL 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 VL(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 WL 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 DL(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=$h.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new BL(e)),this._rotatePoint=this.dv(new UL(e)),this._followController=this.dv(new fa(e)),this._pathCameraController=this.dv(new pa(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=dm(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&&YC(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=>{Ig(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=>{Ig(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=>{Ig(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&&YC(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 GL=[{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 HL 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 GL)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ga 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})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const $L=`
1994
+ }`},translucent:!0}),PF(),bF(),SF(),TF(),MF(),IF(),DF(),_F(),GF(),HF(),qF(),pz(),h.Camera.DEFAULT_VIEW_RECTANGLE=h.Rectangle.fromDegrees(70,5,140,55);function mL(){return new Promise((t,i)=>h.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class vL 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(),Tg(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=CF;await l.promise(mL());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 WC(d,e);Tg(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 yL=new h.EllipsoidTerrainProvider;class NC 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)??yL}))}_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 BC 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 $i&&d.canvasObj&&(d.canvasObj.czmCanvasPoi.zOrder=r),r--})}}class wL 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 CL 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 _L 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 CL(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class PL 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 _L(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class VC extends a.Destroyable{constructor(e){super();v(this,"_czmImageryWrappers",new Set);v(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new wL(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 PL(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 UC 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 A;if(p?A=await m.pickFromRayMostDetailed(P,this.objectsToExclude):A=m.pickFromRay(P,this.objectsToExclude),A&&A.position){const R=re(A.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 A,R,O,N;let y=n.scene.pick(_e(d),p&&p[0],p&&p[1]);!y&&h.defined(n.scene.globe)&&(y=await bL(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=(A=document.elementFromPoint(d[0]+V,d[1]+U))==null?void 0:A.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:vr(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:vr(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)):gu(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 bL(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 SL 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 Tg(t,i){a.setExtProp(t,"_viewerExtensions",i)}class WC 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 VC(this.viewer)),this._terrainManager=this.dv(new NC(this.viewer)),this._labelManager=this.dv(new BC(this.viewer)),this._poiContext=this.disposeVar(new Dm(this._viewer)),this._cursorPositionInfo=this.disposeVar(new SL(this._viewer)),this.ad(n.viewerChanged.don(()=>{this._pickingManager=this.dv(new UC(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 GC=new h.Cartesian3,HC=new h.Cartesian3;function $C(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,GC),l=h.Cartesian3.dot(t.direction,r);if(l>-.9&&l<.9)var c=h.Cartesian3.cross(t.direction,r,HC);else var c=h.Cartesian3.cross(t.up,r,HC);var u=c;if(e){var d=h.Cartesian3.cross(r,c,GC);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){$C(t,i,!1)}function XC(t,i){$C(t,-i,!0)}class EL 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&&XC(s,-d*p),r.MoveRight&&XC(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 Hh 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(`
1995
+ `))};n(),this.d(e.currentKeyIdsChanged.don(n))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:n}=this._keyboardCameraControllerRunning;{const o=s=>{const r=Hh.getKeyId(s);this._currentKeyIds.has(r)||(this._currentKeyIds.add(r),this._currentKeyIdsChanged.emit())};this.d(n.keyDownEvent.don(o))}{const o=s=>{const r=Hh.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 xL extends a.Destroyable{constructor(e){super();v(this,"_keyStatus");v(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new Hh(this)),this._cameraOp=this.dv(new EL(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const kh=class kh extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!1)));v(this,"_keyStatusMap",this.dv(a.react(kh.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 xL(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(kh,"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 $h=kh;function AL(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 TL 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;AL(r,s)};n.addEventListener("pointermove",o),this.dispose(()=>n.removeEventListener("pointermove",o))}}}const Kh=class Kh extends a.Destroyable{constructor(e){super();v(this,"_mouseMoving",this.dv(new TL(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=Kh.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(Kh,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Mg=Kh;class ML 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 Mg(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 IL extends a.Destroyable{constructor(e){super();v(this,"viewer");v(this,"_mouseCameraController",this.dv(new ML(this)));v(this,"_keyboardCameraController",this.dv(new $h(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 YC(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 Ig(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=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 DL 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=Bi.defaults.offsetRotation}=i,u=[...c];a.Vector.set(s,0,0,0),l&&(i.relativeRotation??Bi.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??Bi.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 Bi 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 DL(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(Bi,"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})})(Bi||(Bi={})),a.extendClassProps(Bi.prototype,Bi.createDefaultProps);class pa extends a.Destroyable{constructor(e){super();v(this,"_geoCameraController");v(this,"_geoPolylinePath");this._geoCameraController=this.dv(new Bi(e)),this._geoPolylinePath=this.dv(new Ms(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 RL(this,e);if(this.lineMode==="manual")return new FL(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})})(pa||(pa={})),a.extendClassProps(pa.prototype,pa.createDefaultProps);class RL extends a.Destroyable{constructor(i,e){if(super(),!e.viewer)throw new Error("viewer is undefined");i.offsetRotation=[-90,0,0]}}class FL 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 zL 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 LL 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 zL(s,e)}))}}class fa extends a.Destroyable{constructor(e){super();v(this,"_geoCameraController");this._geoCameraController=this.dv(new Bi(e)),this.d(a.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new a.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new LL(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})})(fa||(fa={})),a.extendClassProps(fa.prototype,fa.createDefaultProps);class OL 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 NL 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 OL(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 BL 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 VL 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 BL(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 UL 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 IL(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=$h.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var n;(n=this._viewer.subContainer)==null||n.focus()}))}this._rotateGlobe=this.dv(new NL(e)),this._rotatePoint=this.dv(new VL(e)),this._followController=this.dv(new fa(e)),this._pathCameraController=this.dv(new pa(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=dm(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&&YC(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=>{Ig(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=>{Ig(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=>{Ig(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&&YC(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 WL=[{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 GL 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 WL)o.add(s(l))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class ga 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})})(ga||(ga={})),a.extendClassProps(ga.prototype,ga.createDefaultProps);const HL=`
1996
1996
  float getDistance(sampler2D depthTexture, vec2 texCoords)
1997
1997
  {
1998
1998
  float depth = czm_unpackDepth(texture(depthTexture, texCoords));
@@ -2028,7 +2028,7 @@ return material;
2028
2028
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
2029
2029
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
2030
2030
  }
2031
- `;class qL extends a.Destroyable{constructor(e){super();v(this,"_show",this.dv(a.react(!1)));v(this,"postProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(n.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new h.PostProcessStage({name:"earthsdk3_fog",fragmentShader:$L,uniforms:{fogByDistance:new h.Cartesian4(10,0,1e3,.9),fogColor:h.Color.WHITE}}),n.scene.postProcessStages.add(this.postProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const XL=`
2031
+ `;class $L extends a.Destroyable{constructor(e){super();v(this,"_show",this.dv(a.react(!1)));v(this,"postProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(n.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new h.PostProcessStage({name:"earthsdk3_fog",fragmentShader:HL,uniforms:{fogByDistance:new h.Cartesian4(10,0,1e3,.9),fogColor:h.Color.WHITE}}),n.scene.postProcessStages.add(this.postProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const qL=`
2032
2032
  uniform sampler2D colorTexture;
2033
2033
  in vec2 v_textureCoordinates;
2034
2034
 
@@ -2055,7 +2055,7 @@ void main(void){
2055
2055
 
2056
2056
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);
2057
2057
  }
2058
- `;class YL extends a.Destroyable{constructor(e){super();v(this,"_show",this.dv(a.react(!1)));v(this,"rainPostProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(n.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new h.PostProcessStage({name:"earthsdk3_rain",fragmentShader:XL}),n.scene.postProcessStages.add(this.rainPostProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const ZL=`
2058
+ `;class XL extends a.Destroyable{constructor(e){super();v(this,"_show",this.dv(a.react(!1)));v(this,"rainPostProcess");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(n.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const s=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new h.PostProcessStage({name:"earthsdk3_rain",fragmentShader:qL}),n.scene.postProcessStages.add(this.rainPostProcess)))};s(),this.d(this.showChanged.don(s))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const YL=`
2059
2059
  uniform sampler2D colorTexture; //输入的场景渲染照片
2060
2060
  in vec2 v_textureCoordinates;
2061
2061
 
@@ -2086,7 +2086,7 @@ void main(void){
2086
2086
  finalColor=(vec3(c)); //屏幕上雪的颜色
2087
2087
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); //将雪和三维场景融合
2088
2088
  }
2089
- `,QL=`
2089
+ `,ZL=`
2090
2090
  #extension GL_OES_standard_derivatives : enable
2091
2091
  uniform sampler2D colorTexture;
2092
2092
  uniform sampler2D depthTexture;
@@ -2126,7 +2126,7 @@ void main() {
2126
2126
  }
2127
2127
  out_FragColor = mix(color, vec4(1.0), dotNumWC*alpha);
2128
2128
  }
2129
- `;class kL extends a.Destroyable{constructor(e){super();v(this,"_show",this.dv(a.react(!1)));v(this,"_alpha",this.dv(a.react(0)));v(this,"snow");v(this,"snowCover");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}let{snow:o,snowCover:s}=this;const r=()=>{o&&(n.scene.postProcessStages.remove(o),o=void 0)};this.d(r);const l=()=>{s&&(n.scene.postProcessStages.remove(s),s=void 0)};this.d(l);const c=()=>{if(!s)return;const d=h.Math.clamp(this.alpha,0,1);s.uniforms.alpha=d};c(),this.d(this.alphaChanged.don(c));const u=()=>{r(),l(),(this.show??!0)&&(o=new h.PostProcessStage({name:"earthsdk3_snow",fragmentShader:ZL}),n.scene.postProcessStages.add(o),s=new h.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:QL,uniforms:{alpha:this.alpha}}),n.scene.postProcessStages.add(s),c())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class KL extends a.Destroyable{constructor(e){super();v(this,"rain");v(this,"cloud");v(this,"snow");v(this,"fog");v(this,"depthOfField");const n=e.viewer;if(!n)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new YL(e)),s=this.dv(new HL(e)),r=this.dv(new kL(e)),l=this.dv(new qL(e)),c=this.dv(new ga(e));this.rain=o,this.cloud=s,this.snow=r,this.fog=l,this.depthOfField=c;{const{scene:u}=n,d=()=>{u.sun&&(u.sun.show=e.sun??Te.defaults.sun),u.globe.enableLighting=e.sun??Te.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?s.show=!0:s.show=!1,e.snow>0&&e.snow<=1?(r.show=!0,r.alpha=e.snow):r.show=!1,e.fog>0&&e.fog<=1?l.show=!0:l.show=!1,e.depthOfField>0&&e.depthOfField<=1?c.show=!0:c.show=!1};d();const p=this.dv(a.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(p.don(d))}}}const Dg=h.BoundingRectangle,JL=h.Color,qn=h.defined,jL=h.destroyObject,ZC=h.DeveloperError,e4=h.RenderState,t4=h.ShaderSource,i4=h._shadersViewportQuadFS,n4=h.BlendingState,QC=h.Material;function qh(t){this.show=!0;let i;qn(i)||(i=new Dg),this.rectangle=Dg.clone(i),qn(t)||(t=QC.fromType(QC.ColorType,{color:new JL(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}qh.prototype.update=function(t){if(this.show){if(!qn(this.material))throw new ZC("this.material must be defined.");if(!qn(this.rectangle))throw new ZC("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var i=this._rs;(!qn(i)||!Dg.equals(i.viewport,this.rectangle))&&(this._rs=e4.fromCache({blending:n4.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var n=t.context;if(this._material!==this.material||!qn(this._overlayCommand)){this._material=this.material,qn(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new t4({sources:[this._material.shaderSource,i4]});this._overlayCommand=n.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(n),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},qh.prototype.isDestroyed=function(){return!1},qh.prototype.destroy=function(){return qn(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),jL(this)};function kC(t){const{positiveX:i,negativeX:e,positiveY:n,negativeY:o,positiveZ:s,negativeZ:r}=t;if(!i||!e||!n||!o||!s||!r){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:a.ESSceneObject.context.getStrFromEnv(i),negativeX:a.ESSceneObject.context.getStrFromEnv(e),positiveY:a.ESSceneObject.context.getStrFromEnv(n),negativeY:a.ESSceneObject.context.getStrFromEnv(o),positiveZ:a.ESSceneObject.context.getStrFromEnv(s),negativeZ:a.ESSceneObject.context.getStrFromEnv(r)}}const o4=`in vec3 v_outerPositionWC;
2129
+ `;class QL extends a.Destroyable{constructor(e){super();v(this,"_show",this.dv(a.react(!1)));v(this,"_alpha",this.dv(a.react(0)));v(this,"snow");v(this,"snowCover");const n=e.viewer;if(!n){console.warn("viewer is undefined!");return}let{snow:o,snowCover:s}=this;const r=()=>{o&&(n.scene.postProcessStages.remove(o),o=void 0)};this.d(r);const l=()=>{s&&(n.scene.postProcessStages.remove(s),s=void 0)};this.d(l);const c=()=>{if(!s)return;const d=h.Math.clamp(this.alpha,0,1);s.uniforms.alpha=d};c(),this.d(this.alphaChanged.don(c));const u=()=>{r(),l(),(this.show??!0)&&(o=new h.PostProcessStage({name:"earthsdk3_snow",fragmentShader:YL}),n.scene.postProcessStages.add(o),s=new h.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:ZL,uniforms:{alpha:this.alpha}}),n.scene.postProcessStages.add(s),c())};u(),this.d(this.showChanged.don(u))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}get alpha(){return this._alpha.value}set alpha(e){this._alpha.value=e}get alphaChanged(){return this._alpha.changed}}class kL extends a.Destroyable{constructor(e){super();v(this,"rain");v(this,"cloud");v(this,"snow");v(this,"fog");v(this,"depthOfField");const n=e.viewer;if(!n)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new XL(e)),s=this.dv(new GL(e)),r=this.dv(new QL(e)),l=this.dv(new $L(e)),c=this.dv(new ga(e));this.rain=o,this.cloud=s,this.snow=r,this.fog=l,this.depthOfField=c;{const{scene:u}=n,d=()=>{u.sun&&(u.sun.show=e.sun??Te.defaults.sun),u.globe.enableLighting=e.sun??Te.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?s.show=!0:s.show=!1,e.snow>0&&e.snow<=1?(r.show=!0,r.alpha=e.snow):r.show=!1,e.fog>0&&e.fog<=1?l.show=!0:l.show=!1,e.depthOfField>0&&e.depthOfField<=1?c.show=!0:c.show=!1};d();const p=this.dv(a.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(p.don(d))}}}const Dg=h.BoundingRectangle,KL=h.Color,qn=h.defined,JL=h.destroyObject,ZC=h.DeveloperError,jL=h.RenderState,e4=h.ShaderSource,t4=h._shadersViewportQuadFS,i4=h.BlendingState,QC=h.Material;function qh(t){this.show=!0;let i;qn(i)||(i=new Dg),this.rectangle=Dg.clone(i),qn(t)||(t=QC.fromType(QC.ColorType,{color:new KL(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}qh.prototype.update=function(t){if(this.show){if(!qn(this.material))throw new ZC("this.material must be defined.");if(!qn(this.rectangle))throw new ZC("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var i=this._rs;(!qn(i)||!Dg.equals(i.viewport,this.rectangle))&&(this._rs=jL.fromCache({blending:i4.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var n=t.context;if(this._material!==this.material||!qn(this._overlayCommand)){this._material=this.material,qn(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new e4({sources:[this._material.shaderSource,t4]});this._overlayCommand=n.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(n),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},qh.prototype.isDestroyed=function(){return!1},qh.prototype.destroy=function(){return qn(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),JL(this)};function kC(t){const{positiveX:i,negativeX:e,positiveY:n,negativeY:o,positiveZ:s,negativeZ:r}=t;if(!i||!e||!n||!o||!s||!r){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:a.ESSceneObject.context.getStrFromEnv(i),negativeX:a.ESSceneObject.context.getStrFromEnv(e),positiveY:a.ESSceneObject.context.getStrFromEnv(n),negativeY:a.ESSceneObject.context.getStrFromEnv(o),positiveZ:a.ESSceneObject.context.getStrFromEnv(s),negativeZ:a.ESSceneObject.context.getStrFromEnv(r)}}const n4=`in vec3 v_outerPositionWC;
2130
2130
 
2131
2131
  uniform vec3 u_hsbShift;
2132
2132
 
@@ -2205,7 +2205,7 @@ void main (void)
2205
2205
  out_FragColor = color;
2206
2206
  // ------------------ skybox vtxf end -------------------
2207
2207
  }
2208
- `,Xn=h.Cartesian3,an=h.defined,s4=h.destroyObject,r4=h.Ellipsoid,KC=h.EllipsoidGeometry,a4=h.GeometryPipeline,rr=h.Math,ln=h.Matrix4,l4=h.VertexFormat,c4=h.BufferUsage,h4=h.DrawCommand,u4=h.RenderState,d4=h.ShaderProgram,JC=h.ShaderSource,p4=h.VertexArray,jC=h._shadersAtmosphereCommon,e_=h._shadersSkyAtmosphereCommon,f4=h._shadersSkyAtmosphereVS,g4=h.Axis,m4=h.BlendingState,v4=h.CullFace,t_=h.SceneMode,Xh=h.Transforms,y4=h.Matrix3,i_=h.DeveloperError,w4=h.loadCubeMap,C4=h.CubeMap;function ar(t,i){t=t??r4.WGS84,this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Xn.multiplyByScalar(t.radii,e,new Xn);this._scaleMatrix=ln.fromScale(n),this._modelMatrix=new ln,this._command=new h4({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Xn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Xn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Xn;const o=new Xn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new y4,ln.getMatrix3(s._eunMatrix||ln.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(ar.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ar.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Rg=new ln;ar.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==t_.SCENE3D&&e!==t_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const m=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!an(o.positiveX)||!an(o.negativeX)||!an(o.positiveY)||!an(o.negativeY)||!an(o.positiveZ)||!an(o.negativeZ))throw new i_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new i_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?w4(m,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new C4({context:m,source:o}))}const s=ln.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Xn.ZERO,Rg),r=ln.multiplyTransformation(s,g4.Y_UP_TO_Z_UP,Rg),l=ln.multiply(this._scaleMatrix,r,Rg);ln.clone(l,this._modelMatrix);const c=t.context,u=_4(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!an(i)||!i.show,f=this._command;if(Xh.eastUpNorthToFixedFrame=Xh.eastUpNorthToFixedFrame||Xh.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Xh.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!an(f.vertexArray)){const m=KC.createGeometry(new KC({radii:new Xn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:l4.POSITION_ONLY}));f.vertexArray=p4.fromGeometry({context:c,geometry:m,attributeLocations:a4.createAttributeLocations(m),bufferUsage:c4.STATIC_DRAW}),f.renderState=u4.fromCache({cull:{enabled:!0,face:v4.FRONT},blending:m4.ALPHA_BLEND,depthMask:!1})}const g=u|p<<2|d<<3;if(g!==this._flags){this._flags=g;const m=[];u&&m.push("COLOR_CORRECT"),p&&m.push("PER_FRAGMENT_ATMOSPHERE"),d&&m.push("GLOBE_TRANSLUCENT");const y=new JC({defines:m,sources:[jC,e_,f4]}),_=new JC({defines:m,sources:[jC,e_,o4]});this._spSkyAtmosphere=d4.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:_}),f.shaderProgram=this._spSkyAtmosphere}if(an(this._cubeMap))return f};function _4(t){return!(rr.equalsEpsilon(t.hueShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.saturationShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.brightnessShift,0,rr.EPSILON7))}ar.prototype.isDestroyed=function(){return!1},ar.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),s4(this)};const mr=class mr extends a.Destroyable{constructor(e,n){super();v(this,"_navigationManager");v(this,"_envManager");v(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new WL(s)),this._envManager=this.dv(new KL(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new mr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=kC(this._czmViewer.xbsjLocalBoxSources);if(l)return new mr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=Te.latestDefaultAccessToken??Te.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(Ci(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,g){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(m,y)=>a.registerEventUpdate(this,m,y),p=Te.defaults,f=(m,y)=>d(s[m+"Changed"],()=>{if(!Reflect.has(s,m))throw new Error(`!Reflect.has(czmViewer, ${m})`);if(!Reflect.has(p,m))throw new Error(`!Reflect.has(CzmViewer.defaults, ${m})`);y(s[m]??p[m])}),g=(m,y)=>d(s[m+"Changed"],()=>{if(!Reflect.has(s,m))throw new Error(`!Reflect.has(czmViewer, ${m})`);y(s[m])});f("splitPosition",m=>o.scene.splitPosition=m),f("resolutionScale",m=>o.resolutionScale=m),f("msaaSamples",m=>o.scene.msaaSamples=m),g("shadows",m=>o.shadows=m),f("scenePpsfxaaEnabled",m=>l.postProcessStages.fxaa.enabled=m),g("scenePpsAmbientOcclusionEnabled",m=>l.postProcessStages.ambientOcclusion.enabled=m),g("scenePpsAmbientOcclusionAmbientOcclusionOnly",m=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=m),g("scenePpsAmbientOcclusionIntensity",m=>l.postProcessStages.ambientOcclusion.uniforms.intensity=m),g("scenePpsAmbientOcclusionBias",m=>l.postProcessStages.ambientOcclusion.uniforms.bias=m),g("scenePpsAmbientOcclusionLengthCap",m=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=m),g("scenePpsAmbientOcclusionStepSize",m=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=m),g("scenePpsAmbientOcclusionBlurStepSize",m=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=m),g("scenePpsBloomEnabled",m=>l.postProcessStages.bloom.enabled=m),g("scenePpsBloomGlowOnly",m=>l.postProcessStages.bloom.uniforms.glowOnly=m),g("scenePpsBloomContrast",m=>l.postProcessStages.bloom.uniforms.contrast=m),g("scenePpsBloomBrightness",m=>l.postProcessStages.bloom.uniforms.brightness=m),g("scenePpsBloomDelta",m=>l.postProcessStages.bloom.uniforms.delta=m),g("scenePpsBloomSigma",m=>l.postProcessStages.bloom.uniforms.sigma=m),g("scenePpsBloomStepSize",m=>l.postProcessStages.bloom.uniforms.stepSize=m),f("globeShow",m=>l.globe.show=m),f("depthTestAgainstTerrain",m=>{l.globe.depthTestAgainstTerrain=m}),l.globe.translucency.enabled=!0,f("terrainOpacity",m=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(m,0,1)}),f("sceneGlobeShadows",m=>l.globe.shadows=h.ShadowMode[m]),g("sceneGlobeTerrainExaggeration",m=>l.globe.terrainExaggeration=m),g("sceneGlobeTerrainExaggerationRelativeHeight",m=>l.globe.terrainExaggerationRelativeHeight=m),g("sceneGlobeVerticalExaggeration",m=>l.globe.verticalExaggeration=m),g("sceneGlobeVerticalExaggerationRelativeHeight",m=>l.globe.verticalExaggerationRelativeHeight=m),g("sceneGlobeBackFaceCulling",m=>l.globe.backFaceCulling=m),g("sceneGlobeShowSkirts",m=>l.globe.showSkirts=m),g("sceneGlobeShowWaterEffect",m=>l.globe.showWaterEffect=m),g("sceneGlobeBaseColor",m=>l.globe.baseColor=te(m)),g("sceneGlobeCartographicLimitRectangle",m=>l.globe.cartographicLimitRectangle=Ne(m)),g("sceneGlobeClippingPlanes",m=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=wr(m??{enabled:!1});return}pc(l.globe.clippingPlanes,m)}),g("sceneGlobeClippingPolygons",m=>{l.globe.clippingPolygons=m?fc(m):void 0}),f("sceneSunGlowFactor",m=>l.sun&&(l.sun.glowFactor=m)),f("moon",m=>l.moon&&(l.moon.show=m)),f("sceneMoonOnlySunLighting",m=>l.moon&&(l.moon.onlySunLighting=m)),f("sceneMoonTextureUrl",m=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(m))),g("sceneSkyBoxShow",m=>l._xbsjOriginSkyBox.show=m),f("sceneSkyBoxSources",m=>l._xbsjOriginSkyBox.sources=m&&kC(m)),g("atmosphere",m=>o.scene._xbsjOriginSkyAtmosphere.show=m),g("sceneBackgroundColor",m=>o.scene.backgroundColor=te(m)),f("sceneFogEnabled",m=>l.fog.enabled=m),f("sceneFogDensity",m=>l.fog.density=m),f("sceneFogScreenSpaceErrorFactor",m=>l.fog.screenSpaceErrorFactor=m),f("sceneFogMinimumBrightness",m=>l.fog.minimumBrightness=m),f("sceneDebugShowFramesPerSecond",m=>l.debugShowFramesPerSecond=m),f("sceneDebugShowCommands",m=>l.debugShowCommands=m),f("sceneDebugShowFrustums",m=>l.debugShowFrustums=m),f("sceneDebugShowFrustumPlanes",m=>l.debugShowFrustumPlanes=m),f("sceneDebugShowDepthFrustum",m=>l.debugShowDepthFrustum=m),f("sceneGlobeUndergroundColor",m=>u.undergroundColor=te(m)),f("sceneGlobeUndergroundColorAlphaByDistance",m=>u.undergroundColorAlphaByDistance=dn(m)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",m=>u.translucency.backFaceAlphaByDistance=m&&dn(m)),g("sceneGlobeTranslucencyFrontFaceAlphaByDistance",m=>u.translucency.frontFaceAlphaByDistance=m&&dn(m)),f("sceneGlobeTranslucencyRectangle",m=>u.translucency.rectangle=Ne(m)),f("sceneSplitPosition",m=>l.splitPosition=a.clamp(m,0,1)),f("sceneSsccEnableCollisionDetection",m=>l.screenSpaceCameraController.enableCollisionDetection=m),f("sceneSsccZoomFactor",m=>l.screenSpaceCameraController._zoomFactor=m);{const m=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};m(),this.d(s.showCesiumInspectorChanged.don(m))}f("cesiumInspectorWireframe",m=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=m)});{const m=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};m(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(m))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new bg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};v(mr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new qh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),v(mr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();v(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new ar(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let Fg=mr;function P4(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function b4(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[P4(r,c,l,u,d),s]}const S4=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function E4(t){return-Math.log2(t/S4)}var zg=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function x4(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=zg[++e];);const n=i/zg[e-1]|0;return[n*zg[e-1],n,e]}class A4 extends a.Destroyable{constructor(){super();v(this,"_lengthInPixels",this.disposeVar(a.react(100)));v(this,"_resolution",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=x4(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class T4 extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!0)));v(this,"_resolution",this.dv(a.react(void 0)));v(this,"_center",this.dv(a.react(void 0)));v(this,"_zoom",this.dv(a.react(void 0)));v(this,"_legend",this.dv(new A4));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise(b4(this._czmViewer));if(c){const[u,d]=c;s=u,r=E4(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function M4(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:I4}=h,{ShaderDestination:Uo}=h,n_={name:"FlattenedPipelineStage"};n_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Uo.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Uo.BOTH),n.addUniform("vec4","u_flattenedBound",Uo.BOTH),n.addUniform("bool","u_flattened",Uo.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Uo.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Uo.BOTH),n.addUniform("bool","u_flattenDiscard",Uo.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=I4(o,t.uniformMap)}};function o_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function s_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function r_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function a_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(n_),n}}o_(),s_(),r_(),a_();const D4=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(Te.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),R4=`
2208
+ `,Xn=h.Cartesian3,an=h.defined,o4=h.destroyObject,s4=h.Ellipsoid,KC=h.EllipsoidGeometry,r4=h.GeometryPipeline,rr=h.Math,ln=h.Matrix4,a4=h.VertexFormat,l4=h.BufferUsage,c4=h.DrawCommand,h4=h.RenderState,u4=h.ShaderProgram,JC=h.ShaderSource,d4=h.VertexArray,jC=h._shadersAtmosphereCommon,e_=h._shadersSkyAtmosphereCommon,p4=h._shadersSkyAtmosphereVS,f4=h.Axis,g4=h.BlendingState,m4=h.CullFace,t_=h.SceneMode,Xh=h.Transforms,v4=h.Matrix3,i_=h.DeveloperError,y4=h.loadCubeMap,w4=h.CubeMap;function ar(t,i){t=t??s4.WGS84,this.show=!0,this.sources=i,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,n=Xn.multiplyByScalar(t.radii,e,new Xn);this._scaleMatrix=ln.fromScale(n),this._modelMatrix=new ln,this._command=new c4({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new Xn(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new Xn(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new Xn;const o=new Xn;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const s=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return s._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return s._hueSaturationBrightness.x=s.hueShift,s._hueSaturationBrightness.y=s.saturationShift,s._hueSaturationBrightness.z=s.brightnessShift,s._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return s.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return s.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return s.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return s.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return s.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return s.atmosphereMieAnisotropy},u_rotateMatrix:function(){return s._scratchRoateMatrix=s._scratchRoateMatrix||new v4,ln.getMatrix3(s._eunMatrix||ln.IDENTITY,s._scratchRoateMatrix)},u_cubeMap:function(){return s._cubeMap}}}Object.defineProperties(ar.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),ar.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const Rg=new ln;ar.prototype.update=function(t,i){if(!this.show)return;const e=t.mode;if(e!==t_.SCENE3D&&e!==t_.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const m=t.context;var n=this;this._sources=this.sources;var o=this.sources;if(!an(o.positiveX)||!an(o.negativeX)||!an(o.positiveY)||!an(o.negativeY)||!an(o.positiveZ)||!an(o.negativeZ))throw new i_("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new i_("this.sources properties must all be the same type.");typeof o.positiveX=="string"?y4(m,this._sources).then(function(y){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=y}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new w4({context:m,source:o}))}const s=ln.fromRotationTranslation(t.context.uniformState.inverseViewRotation,Xn.ZERO,Rg),r=ln.multiplyTransformation(s,f4.Y_UP_TO_Z_UP,Rg),l=ln.multiply(this._scaleMatrix,r,Rg);ln.clone(l,this._modelMatrix);const c=t.context,u=C4(this),d=t.globeTranslucencyState.translucent,p=this.perFragmentAtmosphere||d||!an(i)||!i.show,f=this._command;if(Xh.eastUpNorthToFixedFrame=Xh.eastUpNorthToFixedFrame||Xh.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=Xh.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!an(f.vertexArray)){const m=KC.createGeometry(new KC({radii:new Xn(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:a4.POSITION_ONLY}));f.vertexArray=d4.fromGeometry({context:c,geometry:m,attributeLocations:r4.createAttributeLocations(m),bufferUsage:l4.STATIC_DRAW}),f.renderState=h4.fromCache({cull:{enabled:!0,face:m4.FRONT},blending:g4.ALPHA_BLEND,depthMask:!1})}const g=u|p<<2|d<<3;if(g!==this._flags){this._flags=g;const m=[];u&&m.push("COLOR_CORRECT"),p&&m.push("PER_FRAGMENT_ATMOSPHERE"),d&&m.push("GLOBE_TRANSLUCENT");const y=new JC({defines:m,sources:[jC,e_,p4]}),_=new JC({defines:m,sources:[jC,e_,n4]});this._spSkyAtmosphere=u4.fromCache({context:c,vertexShaderSource:y,fragmentShaderSource:_}),f.shaderProgram=this._spSkyAtmosphere}if(an(this._cubeMap))return f};function C4(t){return!(rr.equalsEpsilon(t.hueShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.saturationShift,0,rr.EPSILON7)&&rr.equalsEpsilon(t.brightnessShift,0,rr.EPSILON7))}ar.prototype.isDestroyed=function(){return!1},ar.prototype.destroy=function(){const t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),o4(this)};const mr=class mr extends a.Destroyable{constructor(e,n){super();v(this,"_navigationManager");v(this,"_envManager");v(this,"_reu",(e,n)=>a.registerEventUpdate(this,e,n));this._czmViewer=e,this._viewer=n;const o=this.viewer,s=this.czmViewer,r=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new UL(s)),this._envManager=this.dv(new kL(s)),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new mr.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new a.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const l=kC(this._czmViewer.xbsjLocalBoxSources);if(l)return new mr.LocalSkyBoxResetting(this._czmViewer,this._viewer,l)}));{this._reu(s.disabledInputStackChanged,()=>{const c=s.disabledInputStack===0;r.enableInputs=c,r.enableTranslate=c,r.enableZoom=c,r.enableRotate=c,r.enableTilt=c,r.enableLook=c});class l extends a.Destroyable{constructor(){super(),s.incrementDisabledInputStack(),this.dispose(()=>s.decrementDisabledInputStack())}}this.disposeVar(new a.ObjResettingWithEvent(s.sceneSsccEnableInputsChanged,()=>s.sceneSsccEnableInputs??!0?void 0:new l))}this.d(o.scene.camera.changed.addEventListener(()=>s.cameraChanged.emit()));{const l=()=>{const c=Te.latestDefaultAccessToken??Te.currentDefaultAccessToken;h.Ion.defaultAccessToken=s.ionAccessToken===""?c:s.ionAccessToken};l(),this.dispose(s.ionAccessTokenChanged.disposableOn(l))}{const{scene:l}=o,c=()=>{if(l.globe.show=s.globeShow??!0,"fov"in l.camera.frustum){const d=l.camera.frustum.aspectRatio;if(!d){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}l.camera.frustum.fov=h.Math.toRadians(d>=1?s.fov:s.fov/d)}};c();const u=this.dv(a.createNextAnimateFrameEvent(s.globeShowChanged,s.fovChanged));this.d(u.don(c))}o.clockViewModel.currentTime=h.JulianDate.fromDate(new Date(s.currentTime)),this.dispose(s.currentTimeChanged.disposableOn(()=>{if(s.currentTime===void 0)return;const l=h.JulianDate.fromDate(new Date(s.currentTime));h.JulianDate.equals(l,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=l)})),this.dispose(Ci(o.clockViewModel,"currentTime",l=>{const c=h.JulianDate.toDate(o.clockViewModel.currentTime).getTime();c!==s.currentTime&&(s.currentTime=c)}));{let l=h.getTimestamp(),c=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=h.getTimestamp();c++;var d=u-l;d>1e3&&(s._fps.value=c*1e3/d|0,l=u,c=0)}))}{const l=new h.SunLight,c=new h.DirectionalLight({direction:o.scene.camera.directionWC});class u extends a.Destroyable{constructor(){super();const p=s.flashLighting??!1;o.scene.light=p?c:l,p&&this.dispose(o.scene.preRender.addEventListener(function(f,g){c.direction=h.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new a.ObjResettingWithEvent(s.flashLightingChanged,()=>new u))}{const{scene:l}=o,{screenSpaceCameraController:c,globe:u}=l,d=(m,y)=>a.registerEventUpdate(this,m,y),p=Te.defaults,f=(m,y)=>d(s[m+"Changed"],()=>{if(!Reflect.has(s,m))throw new Error(`!Reflect.has(czmViewer, ${m})`);if(!Reflect.has(p,m))throw new Error(`!Reflect.has(CzmViewer.defaults, ${m})`);y(s[m]??p[m])}),g=(m,y)=>d(s[m+"Changed"],()=>{if(!Reflect.has(s,m))throw new Error(`!Reflect.has(czmViewer, ${m})`);y(s[m])});f("splitPosition",m=>o.scene.splitPosition=m),f("resolutionScale",m=>o.resolutionScale=m),f("msaaSamples",m=>o.scene.msaaSamples=m),g("shadows",m=>o.shadows=m),f("scenePpsfxaaEnabled",m=>l.postProcessStages.fxaa.enabled=m),g("scenePpsAmbientOcclusionEnabled",m=>l.postProcessStages.ambientOcclusion.enabled=m),g("scenePpsAmbientOcclusionAmbientOcclusionOnly",m=>l.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=m),g("scenePpsAmbientOcclusionIntensity",m=>l.postProcessStages.ambientOcclusion.uniforms.intensity=m),g("scenePpsAmbientOcclusionBias",m=>l.postProcessStages.ambientOcclusion.uniforms.bias=m),g("scenePpsAmbientOcclusionLengthCap",m=>l.postProcessStages.ambientOcclusion.uniforms.lengthCap=m),g("scenePpsAmbientOcclusionStepSize",m=>l.postProcessStages.ambientOcclusion.uniforms.stepSize=m),g("scenePpsAmbientOcclusionBlurStepSize",m=>l.postProcessStages.ambientOcclusion.uniforms.blurStepSize=m),g("scenePpsBloomEnabled",m=>l.postProcessStages.bloom.enabled=m),g("scenePpsBloomGlowOnly",m=>l.postProcessStages.bloom.uniforms.glowOnly=m),g("scenePpsBloomContrast",m=>l.postProcessStages.bloom.uniforms.contrast=m),g("scenePpsBloomBrightness",m=>l.postProcessStages.bloom.uniforms.brightness=m),g("scenePpsBloomDelta",m=>l.postProcessStages.bloom.uniforms.delta=m),g("scenePpsBloomSigma",m=>l.postProcessStages.bloom.uniforms.sigma=m),g("scenePpsBloomStepSize",m=>l.postProcessStages.bloom.uniforms.stepSize=m),f("globeShow",m=>l.globe.show=m),f("depthTestAgainstTerrain",m=>{l.globe.depthTestAgainstTerrain=m}),l.globe.translucency.enabled=!0,f("terrainOpacity",m=>{l.globe.translucency.frontFaceAlpha=l.globe.translucency.backFaceAlpha=a.clamp(m,0,1)}),f("sceneGlobeShadows",m=>l.globe.shadows=h.ShadowMode[m]),g("sceneGlobeTerrainExaggeration",m=>l.globe.terrainExaggeration=m),g("sceneGlobeTerrainExaggerationRelativeHeight",m=>l.globe.terrainExaggerationRelativeHeight=m),g("sceneGlobeVerticalExaggeration",m=>l.globe.verticalExaggeration=m),g("sceneGlobeVerticalExaggerationRelativeHeight",m=>l.globe.verticalExaggerationRelativeHeight=m),g("sceneGlobeBackFaceCulling",m=>l.globe.backFaceCulling=m),g("sceneGlobeShowSkirts",m=>l.globe.showSkirts=m),g("sceneGlobeShowWaterEffect",m=>l.globe.showWaterEffect=m),g("sceneGlobeBaseColor",m=>l.globe.baseColor=te(m)),g("sceneGlobeCartographicLimitRectangle",m=>l.globe.cartographicLimitRectangle=Ne(m)),g("sceneGlobeClippingPlanes",m=>{if(!l.globe.clippingPlanes){l.globe.clippingPlanes=wr(m??{enabled:!1});return}pc(l.globe.clippingPlanes,m)}),g("sceneGlobeClippingPolygons",m=>{l.globe.clippingPolygons=m?fc(m):void 0}),f("sceneSunGlowFactor",m=>l.sun&&(l.sun.glowFactor=m)),f("moon",m=>l.moon&&(l.moon.show=m)),f("sceneMoonOnlySunLighting",m=>l.moon&&(l.moon.onlySunLighting=m)),f("sceneMoonTextureUrl",m=>l.moon&&(l.moon.textureUrl=a.ESSceneObject.context.getStrFromEnv(m))),g("sceneSkyBoxShow",m=>l._xbsjOriginSkyBox.show=m),f("sceneSkyBoxSources",m=>l._xbsjOriginSkyBox.sources=m&&kC(m)),g("atmosphere",m=>o.scene._xbsjOriginSkyAtmosphere.show=m),g("sceneBackgroundColor",m=>o.scene.backgroundColor=te(m)),f("sceneFogEnabled",m=>l.fog.enabled=m),f("sceneFogDensity",m=>l.fog.density=m),f("sceneFogScreenSpaceErrorFactor",m=>l.fog.screenSpaceErrorFactor=m),f("sceneFogMinimumBrightness",m=>l.fog.minimumBrightness=m),f("sceneDebugShowFramesPerSecond",m=>l.debugShowFramesPerSecond=m),f("sceneDebugShowCommands",m=>l.debugShowCommands=m),f("sceneDebugShowFrustums",m=>l.debugShowFrustums=m),f("sceneDebugShowFrustumPlanes",m=>l.debugShowFrustumPlanes=m),f("sceneDebugShowDepthFrustum",m=>l.debugShowDepthFrustum=m),f("sceneGlobeUndergroundColor",m=>u.undergroundColor=te(m)),f("sceneGlobeUndergroundColorAlphaByDistance",m=>u.undergroundColorAlphaByDistance=dn(m)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",m=>u.translucency.backFaceAlphaByDistance=m&&dn(m)),g("sceneGlobeTranslucencyFrontFaceAlphaByDistance",m=>u.translucency.frontFaceAlphaByDistance=m&&dn(m)),f("sceneGlobeTranslucencyRectangle",m=>u.translucency.rectangle=Ne(m)),f("sceneSplitPosition",m=>l.splitPosition=a.clamp(m,0,1)),f("sceneSsccEnableCollisionDetection",m=>l.screenSpaceCameraController.enableCollisionDetection=m),f("sceneSsccZoomFactor",m=>l.screenSpaceCameraController._zoomFactor=m);{const m=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=s.showCesiumInspector??!1?"block":"none")};m(),this.d(s.showCesiumInspectorChanged.don(m))}f("cesiumInspectorWireframe",m=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=m)});{const m=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=s.showCesium3DTilesInspector??!1?"block":"none")};m(),this.dispose(s.showCesium3DTilesInspectorChanged.disposableOn(m))}this.ad(new a.ObjResettingWithEvent(s.particleGlobalControlChanged,()=>{if(!s.particleGlobalControl)return new bg}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};v(mr,"BackGroundResetting",class extends a.Destroyable{constructor(n,o){super(),this._czmViewer=n,this._viewer=o;const s=new qh;s.material=h.Material.fromType("Image");const r=this._viewer;r.scene.skyBox=s,this.dispose(()=>r.scene.skyBox=r.scene._xbsjOriginSkyBox);{const l=()=>{s.show=this._czmViewer.sceneSkyBoxShow};l(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.color=te(this._czmViewer.xbsjBackgroundColor)};l(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(l))}{const l=()=>{s.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};l(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(l))}}}),v(mr,"LocalSkyBoxResetting",class extends a.Destroyable{constructor(o,s,r){super();v(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=s,this._sources=r,this._skyAtmosphere=new ar(void 0,this._sources);const l=this._viewer;l.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>l.scene.skyAtmosphere=l.scene._xbsjOriginSkyAtmosphere);{const c=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};c(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(c))}}get skyAtmosphere(){return this._skyAtmosphere}});let Fg=mr;function _4(t,i,e,n,o){var s=h.Cartesian3.subtract(t,e,new h.Cartesian3),r=h.Cartesian3.dot(s,i);if(!(r<=0))return r*Math.tan(n*.5)*2/o}async function P4(t){const{viewer:i}=t;if(!i)return;const{width:e,height:n}=i.canvas,o=t.quickPickPosition([e*.5,n*.5]);if(!o)return;const s=await o;if(!s)return;const r=h.Cartesian3.fromDegrees(...s);if(!r)return;const l=i.camera.positionWC,c=i.camera.directionWC,u=i.camera.frustum.fovy;if(u===void 0)return;const d=i.canvas.height;return[_4(r,c,l,u,d),s]}const b4=h.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function S4(t){return-Math.log2(t/b4)}var zg=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function E4(t){const i=t|0;if(i<1||i>1e8)return;let e=-1;for(;i>=zg[++e];);const n=i/zg[e-1]|0;return[n*zg[e-1],n,e]}class x4 extends a.Destroyable{constructor(){super();v(this,"_lengthInPixels",this.disposeVar(a.react(100)));v(this,"_resolution",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInPixels",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInMeters",this.disposeVar(a.react(void 0)));v(this,"_computedLengthInStr",this.disposeVar(a.react(void 0)));{const e=()=>{let n,o;const{lengthInPixels:s,resolution:r}=this;if(s&&r){const l=E4(s*r);if(l){const[c,u,d]=l;o=c,n=c/r}}this._computedLengthInPixels.value=n,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const n=this.computedLengthInMeters;if(!n){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=n>1e3?`${n/1e3|0}km`:`${n}m`};e(),this.dispose(this.computedLengthInMetersChanged.disposableOn(e))}}get lengthInPixels(){return this._lengthInPixels.value}set lengthInPixels(e){this._lengthInPixels.value=e}get lengthInPixelsChanged(){return this._lengthInPixels.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get computedLengthInPixels(){return this._computedLengthInPixels.value}get computedLengthInPixelsChanged(){return this._computedLengthInPixels.changed}get computedLengthInMeters(){return this._computedLengthInMeters.value}get computedLengthInMetersChanged(){return this._computedLengthInMeters.changed}get computedLengthInStr(){return this._computedLengthInStr.value}get computedLengthInStrChanged(){return this._computedLengthInStr.changed}}class A4 extends a.Destroyable{constructor(e){super();v(this,"_enabled",this.dv(a.react(!0)));v(this,"_resolution",this.dv(a.react(void 0)));v(this,"_center",this.dv(a.react(void 0)));v(this,"_zoom",this.dv(a.react(void 0)));v(this,"_legend",this.dv(new x4));this._czmViewer=e;{const n=this.dv(a.createProcessingFromAsyncFunc(async o=>{let s,r,l;await o.promise(a.sleep(1e3));const c=await o.promise(P4(this._czmViewer));if(c){const[u,d]=c;s=u,r=S4(u),l=d}this._resolution.value=s,this._zoom.value=r,this._center.value=l}));n.restart();{const o=()=>{this.enabled?n.restart():n.cancel()};o();const s=this.dv(a.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(s.disposableOn(o))}}{const n=()=>{this._legend.resolution=this.resolution};n(),this.dispose(this.resolutionChanged.disposableOn(n))}}get enabled(){return this._enabled.value}set enabled(e){this._enabled.value=e}get enabledChanged(){return this._enabled.changed}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}get resolutionChanged(){return this._resolution.changed}get center(){return this._center.value}get centerChanged(){return this._center.changed}get zoom(){return this._zoom.value}get zoomChanged(){return this._zoom.changed}get legend(){return this._legend}get length(){return(this.legend.computedLengthInMeters??-1)/(this.legend.computedLengthInPixels??1)}}function T4(t,i){try{const e=h.Ellipsoid.WGS84,n=e.scaleToGeodeticSurface(t);return i=h.Transforms.eastNorthUpToFixedFrame(n,e,i),i}catch{return h.Matrix4.clone(h.Matrix4.IDENTITY,i)}}const{combine:M4}=h,{ShaderDestination:Uo}=h,n_={name:"FlattenedPipelineStage"};n_.process=function(t,i,e){if(i.xbsjFlattened){const n=t.shaderBuilder;n.addDefine("XBSJ_FLATTERN",void 0,Uo.BOTH),n.addUniform("sampler2D","u_flattenedPolygonTexture",Uo.BOTH),n.addUniform("vec4","u_flattenedBound",Uo.BOTH),n.addUniform("bool","u_flattened",Uo.BOTH),n.addUniform("mat4","u_inverseModelElevationMatrix",Uo.BOTH),n.addUniform("mat4","u_inverseElevationModelMatrix",Uo.BOTH),n.addUniform("bool","u_flattenDiscard",Uo.BOTH);const o={u_flattenedBound:function(){return i.xbsjFlattenedBound??h.Cartesian4.ZERO},u_flattened:function(){return i.xbsjFlattened},u_inverseModelElevationMatrix:function(){const s=e.context.uniformState.inverseModel??h.Matrix4.IDENTITY;return i._uniformElevationInverseModelMatrix=h.Matrix4.multiply(s,i.xbsjElevationMatrix??h.Matrix4.IDENTITY,i._uniformElevationInverseModelMatrix??new h.Matrix4),i._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const s=e.context.uniformState.model??h.Matrix4.IDENTITY;return i._uniformInverseElevationModelMatrix=h.Matrix4.multiply(i.xbsjElevationMatrixInv??h.Matrix4.IDENTITY,s,i._uniformInverseElevationModelMatrix??new h.Matrix4),i._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return i.xbsjGetFlattenedTextureFunc?i.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=M4(o,t.uniformMap)}};function o_(){Object.defineProperties(h.Model.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){t!==this._xbsjFlattened&&this.resetDrawCommands(),this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){t!==this._xbsjElevationMatrix&&this.resetDrawCommands(),this._xbsjElevationMatrix=t,this._xbsjElevationMatrixInv=this._xbsjElevationMatrix&&h.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new h.Matrix4)}},xbsjElevationMatrixInv:{get:function(){return this._xbsjElevationMatrixInv}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){t!==this._xbsjFlattenedBound&&this.resetDrawCommands(),this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){t!==this._xbsjGetFlattenedTextureFunc&&this.resetDrawCommands(),this._xbsjGetFlattenedTextureFunc=t}}})}function s_(){Object.defineProperties(h.Cesium3DTileset.prototype,{xbsjFlattened:{get:function(){return this._xbsjFlattened??!1},set:function(t){this._xbsjFlattened=t}},xbsjElevationMatrix:{get:function(){return this._xbsjElevationMatrix},set:function(t){this._xbsjElevationMatrix=t}},xbsjFlattenedBound:{get:function(){return this._xbsjFlattenedBound},set:function(t){this._xbsjFlattenedBound=t}},xbsjGetFlattenedTextureFunc:{get:function(){return this._xbsjGetFlattenedTextureFunc},set:function(t){this._xbsjGetFlattenedTextureFunc=t}}})}function r_(){const t=h.Model3DTileContent.prototype.update;h.Model3DTileContent.prototype.update=function(i,e,...n){const o=this._model;return o.xbsjFlattened=i.xbsjFlattened,o.xbsjElevationMatrix=i.xbsjElevationMatrix,o.xbsjFlattenedBound=i.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=i.xbsjGetFlattenedTextureFunc,t.call(this,i,e,...n)}}function a_(){const t=h.ModelSceneGraph.prototype.configurePipeline;h.ModelSceneGraph.prototype.configurePipeline=function(i,...e){const n=t.call(this,i,...e),o=this._model,s=this.modelPipelineStages;return o.xbsjFlattened&&s.push(n_),n}}o_(),s_(),r_(),a_();const I4=()=>({createCesiumViewerFuncStr:void 0,flashLighting:void 0,resolutionScale:void 0,msaaSamples:void 0,shadows:!1,sceneSplitPosition:void 0,sceneGlobeShadows:void 0,sceneGlobeTerrainExaggeration:1,sceneGlobeTerrainExaggerationRelativeHeight:0,sceneGlobeVerticalExaggeration:1,sceneGlobeVerticalExaggerationRelativeHeight:0,sceneGlobeBackFaceCulling:!0,sceneGlobeShowSkirts:!0,sceneGlobeShowWaterEffect:!0,sceneGlobeBaseColor:a.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:a.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:a.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:a.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:a.reactArray([]),sceneGlobeUndergroundColor:a.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:a.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:a.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:a.reactJson(Te.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:a.reactArray([1,1,1,1]),xbsjLocalBoxSources:a.reactJsonWithUndefined(void 0),sceneBackgroundColor:a.reactArray([0,0,0,0]),sceneFogEnabled:void 0,sceneFogDensity:void 0,sceneFogScreenSpaceErrorFactor:void 0,sceneFogMinimumBrightness:void 0,sceneSsccEnableInputs:void 0,sceneSsccEnableCollisionDetection:void 0,sceneSsccZoomFactor:void 0,scenePpsfxaaEnabled:void 0,scenePpsAmbientOcclusionEnabled:!1,scenePpsAmbientOcclusionAmbientOcclusionOnly:!1,scenePpsAmbientOcclusionIntensity:3,scenePpsAmbientOcclusionBias:.1,scenePpsAmbientOcclusionLengthCap:.03,scenePpsAmbientOcclusionStepSize:1,scenePpsAmbientOcclusionBlurStepSize:.86,scenePpsBloomEnabled:!1,scenePpsBloomGlowOnly:!1,scenePpsBloomContrast:128,scenePpsBloomBrightness:-.3,scenePpsBloomDelta:1,scenePpsBloomSigma:3.78,scenePpsBloomStepSize:5,sceneDebugShowFramesPerSecond:void 0,sceneDebugShowCommands:void 0,sceneDebugShowFrustums:void 0,sceneDebugShowFrustumPlanes:void 0,sceneDebugShowDepthFrustum:void 0,showCesiumInspector:void 0,cesiumInspectorWireframe:void 0,showCesium3DTilesInspector:void 0,particleGlobalControl:!1}),D4=`
2209
2209
  #### 示例代码1
2210
2210
  \`\`\`
2211
2211
  async function initCesiumViewer(container, czmViewer) {
@@ -2280,7 +2280,7 @@ async function initCesiumViewer(container, czmViewer) {
2280
2280
  return viewer;
2281
2281
  }
2282
2282
  \`\`\`
2283
- `,F4=`async function initCesiumViewer(container, czmViewer) {
2283
+ `,R4=`async function initCesiumViewer(container, czmViewer) {
2284
2284
  const viewer = await XE2.g.defaultCreateCesiumViewerFunc(container, czmViewer);
2285
2285
 
2286
2286
  // 若原Czm版权信息展示位置遮挡重要信息,可将以下语句解注释,在别的位置展示
@@ -2288,13 +2288,13 @@ async function initCesiumViewer(container, czmViewer) {
2288
2288
 
2289
2289
  return viewer;
2290
2290
  }
2291
- `;function z4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
2291
+ `;function F4(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
2292
2292
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
2293
2293
  gitee地址:${t}
2294
- `;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",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new gF(this)),this.ad(new mF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new CF(this)})),this._viewerLegend=this.dv(new T4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(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 yL(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&&Er(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&&Er(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&&Er(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 bm(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 yn(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创建函数",F4,R4,!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",z4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",wF),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(),...D4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.17",e="2025-10-22T09:16:13.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="cdf0459633f31b3c6dce81ced3cf33b7abab0ce4",l=((Date.now()-1761124573e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2294
+ `;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",Wh);v(this,"_moveObjectsProcess",this.ad(PC()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new fF(this)),this.ad(new gF(this)),this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new wF(this)})),this._viewerLegend=this.dv(new A4(this)),this._viewerInstance=this.dv(new a.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new Fg(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 vL(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&&Er(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&&Er(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&&Er(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 bm(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 yn(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创建函数",R4,D4,!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",F4),v(st,"currentDefaultAccessToken",h.Ion.defaultAccessToken),v(st,"latestDefaultAccessToken"),v(st,"ObjectsToExcludeWrapper",yF),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(),...I4()})})(Te||(Te={})),a.extendClassProps(Te.prototype,Te.createDefaultProps),M.copyright=void 0;try{const t="earthsdk3-cesium",i="3.5.0-beta.19",e="2025-10-23T01:49:54.000Z",n="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",s="6d8cabe0d96dbee0d9cdcce3808aae369317c4c5",l=((Date.now()-1761184194e3)/36e5).toFixed(1),c=`%c🌏 ${t}%c ${i}.${s.slice(0,8)}.${e} (距今${l}个小时)
2295
2295
  %c${o?o+`
2296
2296
  `:""}当前网站正在使用${t},此软件版权归${n}所有
2297
- `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","cdf0459633f31b3c6dce81ced3cf33b7abab0ce4")},get info(){return c},get date(){return"2025-10-22T09:16:13.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.17"},get name(){return"earthsdk3-cesium"},get commitId(){return"cdf0459633f31b3c6dce81ced3cf33b7abab0ce4"},print(){console.info(this.info,`
2297
+ `;M.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","6d8cabe0d96dbee0d9cdcce3808aae369317c4c5")},get info(){return c},get date(){return"2025-10-23T01:49:54.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.19"},get name(){return"earthsdk3-cesium"},get commitId(){return"6d8cabe0d96dbee0d9cdcce3808aae369317c4c5"},print(){console.info(this.info,`
2298
2298
  font-size: 18px;
2299
2299
  font-weight: 1000;
2300
2300
  line-height: 1;
@@ -2311,4 +2311,4 @@ async function initCesiumViewer(container, czmViewer) {
2311
2311
  color: rgb(0, 120, 215);
2312
2312
  padding-bottom: 2px;
2313
2313
  padding-left: 35px;
2314
- `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=M.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&M.copyright.print()}catch{}d_(),M.BaseEditingWrapper=_t,M.CircularAppendEditing=mC,M.CircularAppendEditingWrapper=pg,M.CircularInsertEditing=yC,M.CircularInsertEditingWrapper=fg,M.CurrentPositionsCenter=vu,M.CurrentScale=mu,M.CurrentSceneScalePoi=wm,M.CursorFloatDiv=xP,M.CursorInfo=AP,M.Czm3DTiles=Pe,M.CzmCameraChanged=mc,M.CzmCanvasAndDivSwitchPoi=MP,M.CzmCanvasPoi=Fu,M.CzmCircle=fo,M.CzmCircleGroundPrimitive=xn,M.CzmCircleOutlinePrimitive=An,M.CzmCirclePrimitive=En,M.CzmClippingPlanes=Is,M.CzmClock=ae,M.CzmCustomPrimitive=De,M.CzmDivPoi=zu,M.CzmES3DTileset=Ds,M.CzmESAlarm=Ud,M.CzmESApertureEffect=Wd,M.CzmESAreaMeasurement=Gd,M.CzmESBlastParticleSystem=Hd,M.CzmESBoxClipping=$d,M.CzmESCameraView=qd,M.CzmESCameraVisibleRange=Xd,M.CzmESCar=Yd,M.CzmESCityBasePoint=Qd,M.CzmESClassification=kd,M.CzmESClippingPlane=Nd,M.CzmESCustomPrimitive=Gp,M.CzmESCzml=Kd,M.CzmESDataMesh=Jd,M.CzmESDirectionMeasurement=jd,M.CzmESDistanceMeasurement=ep,M.CzmESDynamicWater=Hp,M.CzmESEntityCluster=$p,M.CzmESExcavate=tp,M.CzmESFireParticleSystem=ip,M.CzmESGeHistoryImagery=qp,M.CzmESGeoBezierPath=op,M.CzmESGeoDiv=sp,M.CzmESGeoDivTextPoi=rp,M.CzmESGeoExtrudedPolygon=kf,M.CzmESGeoJson=ap,M.CzmESGeoLineString=Os,M.CzmESGeoPoints=og,M.CzmESGeoPolygon=qt,M.CzmESGeoPolygonImpl=Mi,M.CzmESGeoRectangle=lp,M.CzmESGeoSmoothPolygon=cp,M.CzmESGeoVector=vt,M.CzmESGeoWater=Xp,M.CzmESGltfModel=hp,M.CzmESHeatMap=ng,M.CzmESHeightMeasurement=up,M.CzmESHuman=pp,M.CzmESHumanPoi=Kf,M.CzmESImageLabel=fp,M.CzmESImageryLayer=gp,M.CzmESKml=Mp,M.CzmESLabel=Hr,M.CzmESLocalCircle=Ip,M.CzmESLocalLineString=Dp,M.CzmESLocalLineStringZ=Rp,M.CzmESLocalPolygon=Fp,M.CzmESLocalPolygonZ=zp,M.CzmESLocalRectangle=Lp,M.CzmESLocalSkyBox=mp,M.CzmESLocalVector=dh,M.CzmESLocationMeasurement=vp,M.CzmESMVTLayer=Yp,M.CzmESMsTileset=eg,M.CzmESNavigator=Op,M.CzmESObjectWithLocation=fe,M.CzmESParticleSystemPrimitive=yp,M.CzmESPath=Np,M.CzmESPipeFence=Zp,M.CzmESPipeline=Qp,M.CzmESPipeserTileset=Kp,M.CzmESPit=Jp,M.CzmESPoi2D=wp,M.CzmESPoi3D=Cp,M.CzmESPolygonFence=Bp,M.CzmESPolygonFlattenedPlane=Vd,M.CzmESPolygonWithHole=jp,M.CzmESRectangle=Vp,M.CzmESRoad=Up,M.CzmESRtsFeatureEditing=jf,M.CzmESRtsTileset=Jf,M.CzmESScale=Wp,M.CzmESSignalTransmission=hf,M.CzmESSkylineAnalysis=ig,M.CzmESStaticMesh=tg,M.CzmESSubmergingAnalysis=_p,M.CzmESSunshineAnalysis=Hf,M.CzmESSurfaceAreaMeasurement=qf,M.CzmESTerrainLayer=Pp,M.CzmESTextLabel=bp,M.CzmESUEWidget=Sp,M.CzmESUnrealActor=Ep,M.CzmESVideoFusion=xp,M.CzmESViewShed=Ap,M.CzmESViewerStatusBar=Xf,M.CzmESViewerStatusBarScale=Yf,M.CzmESVisibilityAnalysis=Zf,M.CzmESVisualObject=Jt,M.CzmESVolumeMeasurement=Qf,M.CzmESWidget=Tp,M.CzmFlattenedPlane=Nn,M.CzmGlobeMaterial=Po,M.CzmImageModel=qi,M.CzmImagery=Ln,M.CzmModelPrimitive=rt,M.CzmParticleSystemPrimitive=bi,M.CzmPicking=vm,M.CzmPoint=ti,M.CzmPointPrimitiveCollection=mo,M.CzmPoisContext=Dm,M.CzmPolygon=rs,M.CzmPolygonClipping=Ns,M.CzmPolygonGroundPrimitive=ss,M.CzmPolygonGroundPrimitiveWithHeight=uo,M.CzmPolygonPrimitive=Cn,M.CzmPolygonPrimitiveWithHeight=bn,M.CzmPolygonWithHeight=Sn,M.CzmPolyline=be,M.CzmPolylineGroundPrimitive=cs,M.CzmPolylinePrimitive=hs,M.CzmPolylines=pi,M.CzmPolylinesGroundPrimitive=os,M.CzmPolylinesPrimitive=$t,M.CzmRectangle=Si,M.CzmSignalTransmission=Bn,M.CzmTexture=ze,M.CzmView=Rt,M.CzmViewDistanceRangeControl=jn,M.CzmWater=go,M.CzmWaterPrimitive=Mr,M.DoublePointsAppendEditing=ir,M.DoublePointsAppendEditingWrapper=ug,M.DoublePointsModifyEditing=Vo,M.DoublePointsModifyEditingWrapper=dg,M.ESCesiumViewer=Te,M.ESCustomPrimitive=yh,M.ESGeHistoryImagery=gh,M.ESGeoBezierPath=_h,M.ESGeoSmoothPolygon=Yr,M.ESKml=mh,M.ESLocalLineString=vh,M.ESLocalLineStringZ=Xr,M.ESMVTLayer=fh,M.ESRoad=Ch,M.ESSignalTransmission=wh,M.GeoCanvasImagePoi=_i,M.GeoCanvasMenuPoi=as,M.GeoCanvasPoi=$i,M.GeoCanvasPointPoi=_n,M.GeoCustomDivPoi=We,M.GeoDivSwitchPoi=ho,M.GeoDivTextPoi=Pi,M.GeoPolylinePath=Bs,M.HeightModifyEditing=_C,M.HeightModifyEditingWrapper=_g,M.ImageLabel2D=Ly,M.ImageLabel3D=Oy,M.ImageriesManager=VC,M.LabelManager=BC,M.LineStringAppendEditing=gC,M.LineStringAppendEditingWrapper=gg,M.LineStringInsertEditing=vC,M.LineStringInsertEditingWrapper=mg,M.PickingManager=UC,M.PlaceEditing=Ni,M.PlaceEditingWrapper=lg,M.PolylinePath=Ms,M.ResourceHandler=ns,M.RotationEditing=yi,M.RotationEditingWrapper=cg,M.ScaleEditing=sn,M.ScaleEditingWrapper=hg,M.ScatterAppendEditing=wC,M.ScatterAppendEditingWrapper=vg,M.ScatterModifyEditing=CC,M.ScatterModifyEditingWrapper=yg,M.SharedTexturePool=Mm,M.SmoothMoving=ym,M.TerrainManager=NC,M.TextLabel2D=By,M.TextLabel3D=Vy,M.ToGCJ02WebMercatorTilingScheme=ey,M.ToWGS84WebMercatorTilingScheme=ty,M.TranslationEditing=on,M.TranslationEditingWrapper=Uh,M.ViewerExtensions=WC,M.VisibilityAppendEditing=nr,M.VisibilityAppendEditingWrapper=wg,M.VisibilityModifyEditing=or,M.VisibilityModifyEditingWrapper=Cg,M.Widget2D=Pn,M.Widget3D=Mc,M.WinPosFromCartesian=yc,M.XbsjGroundPolylinePrimitive=Ti,M._ESEditModeInstance=Wh,M.angleToHumanStr=br,M.areaToHumanStr=T1,M.bindNorthRotation=Ke,M.capture=bm,M.checkAndConvertImage=A1,M.computeCutPoint=hC,M.computeCzmModelMatrix=Ie,M.computePickingInfoWithCoordinates=ou,M.createClippingPlaneCollection=wr,M.createClippingPolygonCollection=fc,M.createGeoBoudingSphereReactFromPositions=Pm,M.createHelperLine=O_,M.createInfoPoi=Eu,M.createInnerClassFromJson=_u,M.createInnerHtmlWithWhiteTextBlackBackground=ao,M.createMaterialFromJson=Qg,M.createMaterialRef=di,M.createMoveObjectsProcessing=PC,M.createPolygonHierarchy=Gi,M.createTexture=so,M.createTextureFromImage=Du,M.createTilingSchema=wi,M.czmFlyTo=Er,M.czmModelActiveAnimationsWithVisible=Pc,M.czmSubscribeAndEvaluate=Ci,M.defaultFlyToRotation=jt,M.distanceToHumanStr=Sc,M.extendComponentProps=M1,M.flyTo=ne,M.flyWithPosition=ei,M.flyWithPositions=oe,M.flyWithPrimitive=Dt,M.fromCartesian=f_,M.fromCartesian2=Ng,M.fromCartesian3=vr,M.fromCartesian4=Bg,M.fromCartographic=Jn,M.fromColor=m_,M.fromDistanceDisplayCondition=w_,M.fromEllipsoid=A_,M.fromHeadingPitchRoll=y_,M.fromNearFarScalar=v_,M.fromQuaternion=__,M.fromRectangle=E_,M.generateCartesianArc=lm,M.geoNeareastPointOnRhumbLine=eo,M.geoNeareastPointOnRhumbLine2=N_,M.geoPolylineToBezierSpline=xu,M.getCameraPosition=Gt,M.getCameraRotation=Jo,M.getCameraTargetPos=Gg,M.getCenterAndViewDistance=Au,M.getCzmCode=b1,M.getDefaultComponentProps=I1,M.getDefaultWinPosAndDepth=q_,M.getDetailedTerrainDistance=xm,M.getDirectionVectorFromRotation=jg,M.getDistancesAndTimePosRotsFromPositions=pu,M.getElevationMatrix=M4,M.getEllipsoidGeodesicCenter=lu,M.getFlyToCenterAndRotation=Ec,M.getFoveatedInterpolationCallback=dy,M.getFuncFromStr=Pu,M.getGroundTerrainDistance=Em,M.getGroundTerrainDistances=Sm,M.getIncludedAngleFromPositions=dm,M.getInverseModelMatrix=hm,M.getMinMaxPosition=_m,M.getModelMatrixFromPosition=fu,M.getObjectProperties=lo,M.getPointerEventButton=Hi,M.getPolygonPointsFromHierarchy=gu,M.getQuaternion=eu,M.getQuaternionWithXForwardZUp=Ug,M.getQuaternionWithYForwardZUp=gc,M.getResource=Ht,M.getSceneScaleForScreenPixelSize=Wi,M.getSharedTexturePool=Im,M.getTilingSchemeStr=VE,M.getViewerExtensions=kt,M.getWinPos=Jg,M.getXbsjWaterMaterial=fm,M.hackCesium3DTileset=s_,M.hackCzmModel3DTileContent=r_,M.hackModel=o_,M.hackModelSceneGraph=a_,M.imgUrlToBase64=co,M.localPositionToPosition=vn,M.localPositionsToPositions=yn,M.merge3dTilesServer=m1,M.pickHeightPosition=vc,M.pickPosition=Yg,M.pickVirtualEarth=jo,M.pickVirtualPlane=Zg,M.positionAndRotationToQuaternion=S_,M.positionFromCartesian=re,M.positionToCartesian=Le,M.positionToHumanStr=bu,M.positionToLocalPosition=um,M.positionsToLocalPositions=It,M.positionsToUniqueCartesians=ut,M.rectangleIsGlobal=Cu,M.rpToap=bc,M.setClippingPlaneCollection=pc,M.setCylinderGeometry=Su,M.setModelMaterial=Pr,M.setRectangleGeometry=Cm,M.setViewerExtensions=Tg,M.toCartesian=ui,M.toCartesian2=_e,M.toCartesian3=hi,M.toCartesian4=jh,M.toCartographic=g_,M.toCoefficients=wu,M.toColor=te,M.toDistanceDisplayCondition=yr,M.toEllipsoid=we,M.toHeadingPitchRoll=Vg,M.toNearFarScalar=dn,M.toQuaternion=C_,M.toRectangle=Ne,M.toRgbaString=wn,M.updateEnvironmentMapManager=yu,M.updateMaterialFromJson=au,M.winPosAndDepthEqual=Kg,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});
2314
+ `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=M.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&M.copyright.print()}catch{}d_(),M.BaseEditingWrapper=_t,M.CircularAppendEditing=mC,M.CircularAppendEditingWrapper=pg,M.CircularInsertEditing=yC,M.CircularInsertEditingWrapper=fg,M.CurrentPositionsCenter=vu,M.CurrentScale=mu,M.CurrentSceneScalePoi=wm,M.CursorFloatDiv=xP,M.CursorInfo=AP,M.Czm3DTiles=Pe,M.CzmCameraChanged=mc,M.CzmCanvasAndDivSwitchPoi=MP,M.CzmCanvasPoi=Fu,M.CzmCircle=fo,M.CzmCircleGroundPrimitive=xn,M.CzmCircleOutlinePrimitive=An,M.CzmCirclePrimitive=En,M.CzmClippingPlanes=Is,M.CzmClock=ae,M.CzmCustomPrimitive=De,M.CzmDivPoi=zu,M.CzmES3DTileset=Ds,M.CzmESAlarm=Ud,M.CzmESApertureEffect=Wd,M.CzmESAreaMeasurement=Gd,M.CzmESBlastParticleSystem=Hd,M.CzmESBoxClipping=$d,M.CzmESCameraView=qd,M.CzmESCameraVisibleRange=Xd,M.CzmESCar=Yd,M.CzmESCityBasePoint=Qd,M.CzmESClassification=kd,M.CzmESClippingPlane=Nd,M.CzmESCustomPrimitive=Gp,M.CzmESCzml=Kd,M.CzmESDataMesh=Jd,M.CzmESDirectionMeasurement=jd,M.CzmESDistanceMeasurement=ep,M.CzmESDynamicWater=Hp,M.CzmESEntityCluster=$p,M.CzmESExcavate=tp,M.CzmESFireParticleSystem=ip,M.CzmESGeHistoryImagery=qp,M.CzmESGeoBezierPath=op,M.CzmESGeoDiv=sp,M.CzmESGeoDivTextPoi=rp,M.CzmESGeoExtrudedPolygon=kf,M.CzmESGeoJson=ap,M.CzmESGeoLineString=Os,M.CzmESGeoPoints=og,M.CzmESGeoPolygon=qt,M.CzmESGeoPolygonImpl=Mi,M.CzmESGeoRectangle=lp,M.CzmESGeoSmoothPolygon=cp,M.CzmESGeoVector=vt,M.CzmESGeoWater=Xp,M.CzmESGltfModel=hp,M.CzmESHeatMap=ng,M.CzmESHeightMeasurement=up,M.CzmESHuman=pp,M.CzmESHumanPoi=Kf,M.CzmESImageLabel=fp,M.CzmESImageryLayer=gp,M.CzmESKml=Mp,M.CzmESLabel=Hr,M.CzmESLocalCircle=Ip,M.CzmESLocalLineString=Dp,M.CzmESLocalLineStringZ=Rp,M.CzmESLocalPolygon=Fp,M.CzmESLocalPolygonZ=zp,M.CzmESLocalRectangle=Lp,M.CzmESLocalSkyBox=mp,M.CzmESLocalVector=dh,M.CzmESLocationMeasurement=vp,M.CzmESMVTLayer=Yp,M.CzmESMsTileset=eg,M.CzmESNavigator=Op,M.CzmESObjectWithLocation=fe,M.CzmESParticleSystemPrimitive=yp,M.CzmESPath=Np,M.CzmESPipeFence=Zp,M.CzmESPipeline=Qp,M.CzmESPipeserTileset=Kp,M.CzmESPit=Jp,M.CzmESPoi2D=wp,M.CzmESPoi3D=Cp,M.CzmESPolygonFence=Bp,M.CzmESPolygonFlattenedPlane=Vd,M.CzmESPolygonWithHole=jp,M.CzmESRectangle=Vp,M.CzmESRoad=Up,M.CzmESRtsFeatureEditing=jf,M.CzmESRtsTileset=Jf,M.CzmESScale=Wp,M.CzmESSignalTransmission=hf,M.CzmESSkylineAnalysis=ig,M.CzmESStaticMesh=tg,M.CzmESSubmergingAnalysis=_p,M.CzmESSunshineAnalysis=Hf,M.CzmESSurfaceAreaMeasurement=qf,M.CzmESTerrainLayer=Pp,M.CzmESTextLabel=bp,M.CzmESUEWidget=Sp,M.CzmESUnrealActor=Ep,M.CzmESVideoFusion=xp,M.CzmESViewShed=Ap,M.CzmESViewerStatusBar=Xf,M.CzmESViewerStatusBarScale=Yf,M.CzmESVisibilityAnalysis=Zf,M.CzmESVisualObject=Jt,M.CzmESVolumeMeasurement=Qf,M.CzmESWidget=Tp,M.CzmFlattenedPlane=Nn,M.CzmGlobeMaterial=Po,M.CzmImageModel=qi,M.CzmImagery=Ln,M.CzmModelPrimitive=rt,M.CzmParticleSystemPrimitive=bi,M.CzmPicking=vm,M.CzmPoint=ti,M.CzmPointPrimitiveCollection=mo,M.CzmPoisContext=Dm,M.CzmPolygon=rs,M.CzmPolygonClipping=Ns,M.CzmPolygonGroundPrimitive=ss,M.CzmPolygonGroundPrimitiveWithHeight=uo,M.CzmPolygonPrimitive=Cn,M.CzmPolygonPrimitiveWithHeight=bn,M.CzmPolygonWithHeight=Sn,M.CzmPolyline=be,M.CzmPolylineGroundPrimitive=cs,M.CzmPolylinePrimitive=hs,M.CzmPolylines=pi,M.CzmPolylinesGroundPrimitive=os,M.CzmPolylinesPrimitive=$t,M.CzmRectangle=Si,M.CzmSignalTransmission=Bn,M.CzmTexture=ze,M.CzmView=Rt,M.CzmViewDistanceRangeControl=jn,M.CzmWater=go,M.CzmWaterPrimitive=Mr,M.DoublePointsAppendEditing=ir,M.DoublePointsAppendEditingWrapper=ug,M.DoublePointsModifyEditing=Vo,M.DoublePointsModifyEditingWrapper=dg,M.ESCesiumViewer=Te,M.ESCustomPrimitive=yh,M.ESGeHistoryImagery=gh,M.ESGeoBezierPath=_h,M.ESGeoSmoothPolygon=Yr,M.ESKml=mh,M.ESLocalLineString=vh,M.ESLocalLineStringZ=Xr,M.ESMVTLayer=fh,M.ESRoad=Ch,M.ESSignalTransmission=wh,M.GeoCanvasImagePoi=_i,M.GeoCanvasMenuPoi=as,M.GeoCanvasPoi=$i,M.GeoCanvasPointPoi=_n,M.GeoCustomDivPoi=We,M.GeoDivSwitchPoi=ho,M.GeoDivTextPoi=Pi,M.GeoPolylinePath=Bs,M.HeightModifyEditing=_C,M.HeightModifyEditingWrapper=_g,M.ImageLabel2D=Ly,M.ImageLabel3D=Oy,M.ImageriesManager=VC,M.LabelManager=BC,M.LineStringAppendEditing=gC,M.LineStringAppendEditingWrapper=gg,M.LineStringInsertEditing=vC,M.LineStringInsertEditingWrapper=mg,M.PickingManager=UC,M.PlaceEditing=Ni,M.PlaceEditingWrapper=lg,M.PolylinePath=Ms,M.ResourceHandler=ns,M.RotationEditing=yi,M.RotationEditingWrapper=cg,M.ScaleEditing=sn,M.ScaleEditingWrapper=hg,M.ScatterAppendEditing=wC,M.ScatterAppendEditingWrapper=vg,M.ScatterModifyEditing=CC,M.ScatterModifyEditingWrapper=yg,M.SharedTexturePool=Mm,M.SmoothMoving=ym,M.TerrainManager=NC,M.TextLabel2D=By,M.TextLabel3D=Vy,M.ToGCJ02WebMercatorTilingScheme=ey,M.ToWGS84WebMercatorTilingScheme=ty,M.TranslationEditing=on,M.TranslationEditingWrapper=Uh,M.ViewerExtensions=WC,M.VisibilityAppendEditing=nr,M.VisibilityAppendEditingWrapper=wg,M.VisibilityModifyEditing=or,M.VisibilityModifyEditingWrapper=Cg,M.Widget2D=Pn,M.Widget3D=Mc,M.WinPosFromCartesian=yc,M.XbsjGroundPolylinePrimitive=Ti,M._ESEditModeInstance=Wh,M.angleToHumanStr=br,M.areaToHumanStr=T1,M.bindNorthRotation=Ke,M.capture=bm,M.checkAndConvertImage=A1,M.computeCutPoint=hC,M.computeCzmModelMatrix=Ie,M.computePickingInfoWithCoordinates=ou,M.createClippingPlaneCollection=wr,M.createClippingPolygonCollection=fc,M.createGeoBoudingSphereReactFromPositions=Pm,M.createHelperLine=O_,M.createInfoPoi=Eu,M.createInnerClassFromJson=_u,M.createInnerHtmlWithWhiteTextBlackBackground=ao,M.createMaterialFromJson=Qg,M.createMaterialRef=di,M.createMoveObjectsProcessing=PC,M.createPolygonHierarchy=Gi,M.createTexture=so,M.createTextureFromImage=Du,M.createTilingSchema=wi,M.czmFlyTo=Er,M.czmModelActiveAnimationsWithVisible=Pc,M.czmSubscribeAndEvaluate=Ci,M.defaultFlyToRotation=jt,M.distanceToHumanStr=Sc,M.extendComponentProps=M1,M.flyTo=ne,M.flyWithPosition=ei,M.flyWithPositions=oe,M.flyWithPrimitive=Dt,M.fromCartesian=f_,M.fromCartesian2=Ng,M.fromCartesian3=vr,M.fromCartesian4=Bg,M.fromCartographic=Jn,M.fromColor=m_,M.fromDistanceDisplayCondition=w_,M.fromEllipsoid=A_,M.fromHeadingPitchRoll=y_,M.fromNearFarScalar=v_,M.fromQuaternion=__,M.fromRectangle=E_,M.generateCartesianArc=lm,M.geoNeareastPointOnRhumbLine=eo,M.geoNeareastPointOnRhumbLine2=N_,M.geoPolylineToBezierSpline=xu,M.getCameraPosition=Gt,M.getCameraRotation=Jo,M.getCameraTargetPos=Gg,M.getCenterAndViewDistance=Au,M.getCzmCode=b1,M.getDefaultComponentProps=I1,M.getDefaultWinPosAndDepth=q_,M.getDetailedTerrainDistance=xm,M.getDirectionVectorFromRotation=jg,M.getDistancesAndTimePosRotsFromPositions=pu,M.getElevationMatrix=T4,M.getEllipsoidGeodesicCenter=lu,M.getFlyToCenterAndRotation=Ec,M.getFoveatedInterpolationCallback=dy,M.getFuncFromStr=Pu,M.getGroundTerrainDistance=Em,M.getGroundTerrainDistances=Sm,M.getIncludedAngleFromPositions=dm,M.getInverseModelMatrix=hm,M.getMinMaxPosition=_m,M.getModelMatrixFromPosition=fu,M.getObjectProperties=lo,M.getPointerEventButton=Hi,M.getPolygonPointsFromHierarchy=gu,M.getQuaternion=eu,M.getQuaternionWithXForwardZUp=Ug,M.getQuaternionWithYForwardZUp=gc,M.getResource=Ht,M.getSceneScaleForScreenPixelSize=Wi,M.getSharedTexturePool=Im,M.getTilingSchemeStr=VE,M.getViewerExtensions=kt,M.getWinPos=Jg,M.getXbsjWaterMaterial=fm,M.hackCesium3DTileset=s_,M.hackCzmModel3DTileContent=r_,M.hackModel=o_,M.hackModelSceneGraph=a_,M.imgUrlToBase64=co,M.localPositionToPosition=vn,M.localPositionsToPositions=yn,M.merge3dTilesServer=m1,M.pickHeightPosition=vc,M.pickPosition=Yg,M.pickVirtualEarth=jo,M.pickVirtualPlane=Zg,M.positionAndRotationToQuaternion=S_,M.positionFromCartesian=re,M.positionToCartesian=Le,M.positionToHumanStr=bu,M.positionToLocalPosition=um,M.positionsToLocalPositions=It,M.positionsToUniqueCartesians=ut,M.rectangleIsGlobal=Cu,M.rpToap=bc,M.setClippingPlaneCollection=pc,M.setCylinderGeometry=Su,M.setModelMaterial=Pr,M.setRectangleGeometry=Cm,M.setViewerExtensions=Tg,M.toCartesian=ui,M.toCartesian2=_e,M.toCartesian3=hi,M.toCartesian4=jh,M.toCartographic=g_,M.toCoefficients=wu,M.toColor=te,M.toDistanceDisplayCondition=yr,M.toEllipsoid=we,M.toHeadingPitchRoll=Vg,M.toNearFarScalar=dn,M.toQuaternion=C_,M.toRectangle=Ne,M.toRgbaString=wn,M.updateEnvironmentMapManager=yu,M.updateMaterialFromJson=au,M.winPosAndDepthEqual=Kg,Object.defineProperty(M,Symbol.toStringTag,{value:"Module"})});