earthsdk3-cesium 3.5.0-beta.14 → 3.5.0-beta.16

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.
Files changed (29) hide show
  1. package/dist/earthsdk3-cesium.iife.js +65 -64
  2. package/dist/earthsdk3-cesium.js +2871 -2867
  3. package/dist/earthsdk3-cesium.umd.cjs +89 -88
  4. package/dist/types/CzmObjects/base/InnerClass/Polyline/index.d.ts +1 -0
  5. package/dist/types/CzmObjects/base/InnerClass/Polyline/index.d.ts.map +1 -1
  6. package/dist/types/CzmObjects/base/InnerClass/XbsjGroundPolylinePrimitive/GroundPolylinePrimitive.d.ts +148 -0
  7. package/dist/types/CzmObjects/general/CzmESApertureEffect/index.d.ts +3 -0
  8. package/dist/types/CzmObjects/general/CzmESApertureEffect/index.d.ts.map +1 -1
  9. package/dist/types/CzmObjects/general/CzmESPath/index.d.ts.map +1 -1
  10. package/dist/types/CzmObjects/general/CzmESPolygonWithHole/index.d.ts.map +1 -1
  11. package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/XbsjPolylineGeometry.d.ts +3 -0
  12. package/dist/types/CzmObjects/general/CzmESSignalTransmission/XbsjPolyline/xbsjCreateODLinesPrimitive.d.ts +29 -0
  13. package/dist/types/CzmObjects/general/CzmESVideoFusion/XbsjCameraVideo/XbsjCameraVideo.d.ts +18 -0
  14. package/dist/types/CzmObjects/general/CzmESViewShed/XbsjViewshed/XbsjViewshed.d.ts +16 -0
  15. package/dist/types/ESCesiumViewer/BackGroundImage/BackGroundImage.d.ts +5 -0
  16. package/dist/types/ESCesiumViewer/LocalSkyBox/SkyAtmosphere.d.ts +14 -0
  17. package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatPipelineStage.d.ts +12 -0
  18. package/dist/types/ESCesiumViewer/initCesiumViewer/GaussianSplattingExtend/GaussianSplatTexturePipelineStage.d.ts +11 -0
  19. package/dist/types/ESCesiumViewer/initCesiumViewer/fixGoogleEarth/cesiumFixGoogleEarth.d.ts +1 -0
  20. package/dist/types/ESJTypesCzm/czmObject/CzmMaterialJsonType.d.ts +38 -36
  21. package/dist/types/ESJTypesCzm/czmObject/CzmMaterialJsonType.d.ts.map +1 -1
  22. package/dist/types/ESObjects/ESGeHistoryImagery/index.d.ts +1 -0
  23. package/dist/types/ESObjects/ESGeHistoryImagery/index.d.ts.map +1 -1
  24. package/dist/types/__declares/cesium.d.ts +417 -0
  25. package/dist/types/utils/czmUtils/createMaterialRef.d.ts.map +1 -1
  26. package/dist/types/utils/czmUtils/todo/generateCartesianArc/czm/generateCartesianArc.d.ts +8 -0
  27. package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/index.d.ts +37 -0
  28. package/dist/types/utils/generalUtils/geoPolylineToBezierSpline/bezierSpline/lib/spline.d.ts +62 -0
  29. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- var EarthSDK3_Cesium=function(re,Xe,c){"use strict";var UH=Object.defineProperty;var OH=(re,Xe,c)=>Xe in re?UH(re,Xe,{enumerable:!0,configurable:!0,writable:!0,value:c}):re[Xe]=c;var L=(re,Xe,c)=>OH(re,typeof Xe!="symbol"?Xe+"":Xe,c);var ds=typeof document<"u"?document.currentScript:null;function wE(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const _=wE(Xe);window.Cesium=_;function bE(){Object.keys(_).forEach(t=>{_[t].prototype&&Object.defineProperty(_[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:c.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 n=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);n&&(_.Ion.defaultAccessToken=n[1],console.log("更新默认Cesium.Ion.Token成功"))});const xu=class xu extends c.Destroyable{};L(xu,"defaults",{enabled:!0}),L(xu,"createDefaultProps",()=>({...xu.defaults}));let In=xu;c.extendClassProps(In.prototype,In.createDefaultProps);class Nn extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r,a)=>this.flyTo(o,r,a))),this.d(n.flyInEvent.don((o,r,a)=>this.flyIn(o,r,a))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:a}=o;n.flyInParam={position:r,rotation:a,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(n,e,i,o,r,a,s,l="default"){const{sceneObject:u,czmViewer:A}=this,h=A.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:a??0,pDelta:s??0},e,l);h&&h.then(f=>{})}flyTo(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}flyIn(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}get czmViewer(){return this.viewer}}function ft(t,n){return _.Cartesian3.fromDegrees(...t,void 0,n)}const xE=new _.Cartographic;function Ue(t,n){const e=_.Cartographic.fromCartesian(t,void 0,xE);if(e)return n=n||[0,0,0],n[0]=_.Math.toDegrees(e.longitude),n[1]=_.Math.toDegrees(e.latitude),n[2]=e.height,n}function Ze(t,n){return n=n||new _.Cartesian2,n.x=t[0],n.y=t[1],n}function Vv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function ri(t,n){return n=n||new _.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function $a(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function np(t,n){return n=n||new _.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Nv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function oi(t,n){if(t.length===4)return np(t,n);if(t.length===3)return ri(t,n);if(t.length===2)return Ze(t,n);throw new Error("toCartesian error: should not be here!")}function _E(t,n){if(t instanceof _.Cartesian2)return Vv(t,n);if(t instanceof _.Cartesian3)return $a(t,n);if(t instanceof _.Cartesian4)return Nv(t,n);throw new Error("fromCartesian error: should not be here!")}function CE(t,n){return n=n||new _.Cartographic,n.longitude=_.Math.toRadians(t[0]),n.latitude=_.Math.toRadians(t[1]),n.height=t[2],n}function Ao(t,n){return n=n||[0,0,0],n[0]=_.Math.toDegrees(t.longitude),n[1]=_.Math.toDegrees(t.latitude),n[2]=t.height,n}function Be(t,n){return n=n||new _.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function SE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function gr(t,n){return n=n||new _.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function EE(t,n){return n=n||[0,0,0,0],n[0]=t.near,n[1]=t.nearValue,n[2]=t.far,n[3]=t.farValue,n}function Hv(t,n){return n=n||new _.HeadingPitchRoll,n.heading=_.Math.toRadians(t[0]-90),n.pitch=_.Math.toRadians(t[1]),n.roll=_.Math.toRadians(t[2]),n}function PE(t,n){return n=n||[0,0,0],n[0]=_.Math.toDegrees(t.heading+_.Math.PI_OVER_TWO),n[1]=_.Math.toDegrees(t.pitch),n[2]=_.Math.toDegrees(t.roll),n}function Xa(t,n){return n=n||new _.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function BE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function TE(t,n){return n=n||new _.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function IE(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}const FE=new _.HeadingPitchRoll,ME=new _.Cartesian3;function DE(t,n,e){const i=Hv(n,FE),o=ft(t,ME);return _.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function mt(t,n){return n=n||new _.Rectangle,n.west=t[0]*Math.PI/180,n.south=t[1]*Math.PI/180,n.east=t[2]*Math.PI/180,n.north=t[3]*Math.PI/180,n}function RE(t,n){return n=n||[0,0,0,0],n[0]=t.west,n[1]=t.south,n[2]=t.east,n[3]=t.north,n}const UE=new _.Cartesian3;function qe(t,n){return n=n||new _.Ellipsoid,_.Ellipsoid.fromCartesian3(_.Cartesian3.fromArray(t,void 0,UE),n)}function OE(t,n){return n=n||[0,0,0],n[0]=t.radii.x,n[1]=t.radii.y,n[2]=t.radii.z,n}function mi(t){if(t.type==="GeographicTilingScheme")return new _.GeographicTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),rectangle:t.rectangle&&mt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new _.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ax({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new lx({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function Ya(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:a,edgeWidth:s}=t;let l=o&&_.Matrix4.fromArray(o);return n&&(l=l||_.Matrix4.clone(_.Matrix4.IDENTITY,new _.Matrix4),_.Matrix4.multiply(n,l,l)),new _.ClippingPlaneCollection({planes:e&&e.map(u=>new _.ClippingPlane(ri(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:a&&Be(a),edgeWidth:s})}function vh(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new _.ClippingPlane(ri(r.normal),r.distance));let o=i.modelMatrix&&_.Matrix4.fromArray(i.modelMatrix)||_.Matrix4.clone(_.Matrix4.IDENTITY,new _.Matrix4);e&&_.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Be(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function wh(t){const{polygons:n,enabled:e,inverse:i}=t;return new _.ClippingPolygonCollection({polygons:n&&n.map(o=>new _.ClippingPolygon({positions:o.positions.map(r=>ft(r))})),enabled:e,inverse:i})}function bh(t,n){return ip(t,_.Cartesian3.UNIT_Y,_.Cartesian3.UNIT_Z,_.Cartesian3.UNIT_X,n)}function Gv(t,n){return ip(t,_.Cartesian3.UNIT_X,_.Cartesian3.UNIT_Z,new _.Cartesian3(0,-1,0),n)}function ip(t,n,e,i,o){const[r,a,s]=t,l=_.Quaternion.fromAxisAngle(e,_.Math.toRadians(-r)),u=_.Quaternion.fromAxisAngle(i,_.Math.toRadians(a)),A=_.Quaternion.fromAxisAngle(n,_.Math.toRadians(s)),h=_.Quaternion.clone(_.Quaternion.IDENTITY,o);return _.Quaternion.multiply(A,h,h),_.Quaternion.multiply(u,h,h),_.Quaternion.multiply(l,h,h),h}function yr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Wv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function st(t,n){if(!((!t.localScale||yr(t.localScale,3))&&(!t.localRotation||yr(t.localRotation,3))&&(!t.localPosition||yr(t.localPosition,3))&&(!t.localModelMatrix||yr(t.localModelMatrix,16))&&(!t.scale||yr(t.scale,3))&&(!t.rotation||yr(t.rotation,3))&&(!t.position||yr(t.position,3))&&(!t.modelMatrix||yr(t.modelMatrix,16)))||t.localScale&&!Wv(t.localScale)||t.scale&&!Wv(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 i=n??_.Matrix4.clone(_.Matrix4.IDENTITY);if(t.localScale){const[o,r,a]=t.localScale??[1,1,1],s=_.Matrix4.fromScale(_.Cartesian3.fromElements(o,r,a),new _.Matrix4);_.Matrix4.multiply(s,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=_.Quaternion.fromAxisAngle(_.Cartesian3.UNIT_Z,_.Math.toRadians(90)),r=_.Matrix3.fromQuaternion(o);_.Matrix4.multiply(_.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=bh(t.localRotation),r=_.Matrix3.fromQuaternion(o);_.Matrix4.multiply(_.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=_.Matrix4.fromTranslation(_.Cartesian3.fromArray(t.localPosition));_.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=_.Matrix4.fromArray(t.localModelMatrix);_.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=_.Matrix4.fromScale(_.Cartesian3.fromElements(o,o,o),new _.Matrix4);_.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,a]=t.scale??[1,1,1],s=_.Matrix4.fromScale(_.Cartesian3.fromElements(o,r,a),new _.Matrix4);_.Matrix4.multiply(s,i,i)}if(t.rotation){const o=bh(t.rotation),r=_.Matrix3.fromQuaternion(o);_.Matrix4.multiply(_.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=_.Cartesian3.fromDegrees(...t.position),r=_.Transforms.eastNorthUpToFixedFrame(o);_.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=_.Matrix4.fromArray(t.modelMatrix);_.Matrix4.multiply(o,i,i)}return i}const LE=new _.Cartesian3,Ja=new _.HeadingPitchRoll,zE=new _.Matrix4,kE=new _.Cartesian3,QE=new _.Cartographic;function VE(t,n=[0,0,0],e=0,i){const[o,r,a]=t,s=_.Cartesian3.fromDegrees(o,r,a,void 0,LE),l=[...n];for(let A=0;A<3;++A)l[A]=_.Math.RADIANS_PER_DEGREE*l[A];if(e!==0){Ja.heading=l[0],Ja.pitch=l[1],Ja.roll=l[2],Ja.heading-=_.Math.PI_OVER_TWO;const A=_.Transforms.headingPitchRollToFixedFrame(s,Ja,void 0,void 0,zE),h=_.Matrix4.multiplyByPointAsVector(A,_.Cartesian3.UNIT_X,kE);_.Cartesian3.multiplyByScalar(h,e,h),_.Cartesian3.subtract(s,h,s)}const u=_.Cartographic.fromCartesian(s,void 0,QE);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function jv(t,n,e,i){return VE(t,n,e,i)}const vr=_.Math.toDegrees;function Fn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=o,n):[vr(e),vr(i),o]}function ms(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=vr(o),n):[e,i,o].map(vr)}class xh extends c.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new _.Matrix4);L(this,"_originProjMatrix",new _.Matrix4);L(this,"_changed",new c.Event);this._scene=e;const i=this._scene.camera;_.Matrix4.clone(i.viewMatrix,this._originViewMatrix),_.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){_.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(_.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),_.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(_.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class NE extends c.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class HE extends c.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new c.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new NE(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class fo extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(c.react(1)));L(this,"_viewDistance",this.disposeVar(c.react(0)));L(this,"_debug",this.disposeVar(c.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new HE(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:a,czmViewer:s}=this,[l,u,A]=c.getReactFuncs(i),[h,f,d]=c.getReactFuncs(a),[p,g,v]=r?c.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let x=1,E=Number.NEGATIVE_INFINITY;const B=l(),P=h(),I=p?p():0,M=s.getCurrentCameraInfo();if(!B||!P||!M){this._viewDistance.value=E,this._visibleAlpha.value=x;return}E=c.cartesianDistance(M.position,P)-(I??0);const[F,S,T,w]=B;F>S||S>T||T>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=T?x=1:E<=F||E>=w?x=0:E>F&&E<S?S-F<=0?x=0:x=(E-F)/(S-F):E>T&&E<w?(w<=T&&(x=0),x=(w-E)/(w-T)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=x};y();const m=[s.cameraChanged,A,d];v&&m.push(v);const b=this.disposeVar(c.createNextAnimateFrameEvent(...m));this.dispose(b.disposableOn(y))}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 GE=new _.BoundingSphere(_.Cartesian3.ZERO,0);function Ni(t,n,e){var i=GE;_.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function $t(t,n=!1){const e=t.length;let i;const o=[];for(let r=0;r<e;++r){const[a,s,l]=t[r],u=n?_.Cartesian3.fromDegrees(a,s):_.Cartesian3.fromDegrees(a,s,l);if(!u)continue;const{x:A,y:h,z:f}=u;[A,h,f].every(Number.isFinite)&&(!i||!_.Cartesian3.equals(i,u))&&(i=u,o.push(i))}return o}function po(t,n,e,i){const o=c.geoRhumbDistance(t,e),r=c.geoRhumbHeading(t,e),a=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return a>0?c.geoRhumbDestination(t,o,n,i):c.geoRhumbDestination(t,o,n+180,i),[a>0?o:-o,i]}function WE(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const a=c.geoRhumbDestination(t,i*r,n);a&&o.push(a)}return o}function jE(t,n){return c.geoNearestPointOnLine(t,n).geometry.coordinates}const qv=new _.Cartesian3,qE=new _.Ray,KE=new _.Plane(_.Cartesian3.UNIT_X,0);function _h(t,n,e,i){const o=_.Cartesian3.normalize(n,qv),r=_.Cartesian3.cross(t.camera.right,o,qv);_.Cartesian3.normalize(r,r);const a=_.Plane.fromPointNormal(n,r,KE),s=t.camera.getPickRay(e,qE);if(s)return _.IntersectionTests.rayPlane(s,a,i)}const rp=new _.Cartesian3,ZE=new _.Ray,$E=new _.Cartographic,XE=new _.Ellipsoid;function gs(t,n,e,i){const o=t.camera.getPickRay(n,ZE);if(!o)return;const r=_.Cartesian3.fromElements(e,e,e,rp),a=_.Cartesian3.add(r,_.Ellipsoid.WGS84.radii,rp),s=_.Ellipsoid.fromCartesian3(a,XE),l=_.IntersectionTests.rayEllipsoid(o,s);if(l){const u=l.start>0?l.start:l.stop;if(u){const A=_.Ray.getPoint(o,u,rp),h=_.Cartographic.fromCartesian(A,void 0,$E);return i=i||new _.Cartographic,i.longitude=h.longitude,i.latitude=h.latitude,i.height=e,i}else return}else return}function ys(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function Kv(t){const n=_.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const Zv=new _.Cartographic,$v=new _.Cartesian3,gn=[0,0,0],wr=[0,0,0],op=new _.Cartesian2,sp=new _.Cartesian3;function ap(t,n,e,i,o,r){o.constraintMode="none",ys([0,0,0],o.startDragPos),r=r||{},oi(c.getDomEventCurrentTargetPos(t),op);const a=e.position;if(!ft(a,sp))return;const s=Ni(n,sp,i);if(s===void 0||!_h(n,sp,op,$v)||!Ue($v,gn))return;const l=Kv(gn[2])*c.geoDistance(a,gn);if(!r.z&&l<s&&Math.abs(a[2]-gn[2])<e.dimensions[0]&&gn[2]>a[2])return o.constraintMode="z",ys(gn,o.startDragPos),!0;if(!gs(n,op,a[2],Zv)||!Ao(Zv,gn))return;const u=Kv(a[2])*c.geoDistance(a,gn),A=e.dimensions[0];if(!(u>1.05*A)){if(!r.zAxis&&u>.95*A&&u<=1.05*A){o.constraintMode="zAxis",ys(gn,o.startDragPos);return}{const[h,f]=po(a,e.heading+90,gn,wr);if(!r.x&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,gn)<s)){o.constraintMode="x",ys(wr,o.startDragPos);return}}{const[h,f]=po(a,e.heading,gn,wr);if(!r.y&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,gn)<s)){o.constraintMode="y",ys(wr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",ys(gn,o.startDragPos))}}async function Xv(t,n,e,i){var s;const o=(s=t.viewer)==null?void 0:s.scene;if(!o)throw new Error("!scene");const r=c.getDomEventCurrentTargetPos(n),a=oi(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=gs(o,a,e);return l?Ao(l):void 0}}let lp,up;function Yv(t,n,e,i,o){o=o||new _.Cartesian3,lp=lp||new _.Ray,up=up||new _.Plane(_.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,lp),a=_.Plane.fromPointNormal(n,e,up);return o=_.IntersectionTests.rayPlane(r,a,o),o}function Jv(t){const n=_.Material.fromType(t.type);return cp(n,t),n}function yn(t){return t&&c.ESSceneObject.context.getStrFromEnv(t)||_.Material.DefaultImageId}function YE(t){return{x:t[0],y:t[1]}}function cp(t,n){n.type==="Color"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.gapColor=Be(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.outlineColor=Be(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.color=Be(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Be(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Ze(n.lineCount??[8,8]),t.uniforms.lineThickness=Ze(n.lineThickness??[1,1]),t.uniforms.lineOffset=Ze(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Be(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Be(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Be(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Be(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Be(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Be(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=yn(n.specularMap),t.uniforms.normalMap=yn(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Be(n.color??[1,0,0,.7]),t.uniforms.rimColor=Be(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Be(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Be(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=YE(n.fadeDirection??[!0,!0]),t.uniforms.time=Ze(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Be(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=yn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=yn(n.image):n.type==="ElevationBand"?(t.uniforms.color=yn(n.colors),t.uniforms.heights=yn(n.heights)):n.type==="XbsjPolylineArrow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.image=yn(n.image),t.uniforms.repeat=n.repeat??60,t.uniforms.speed=n.speed??1,t.uniforms.lineLength=n.lineLength??1):console.warn(`未知材质类型,无法更新 ${n.type}`)}function si(t,n){const e=c.react(void 0);let i="";const[o,r,a]=c.getReactFuncs(t),s=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=Jv(l)):e.value&&cp(e.value,l):(i="",e.value=void 0)}catch{}};return s(),e.dispose(a.disposableOn(s)),e}function Hi(t,n=!1){const e=$t(t.positions,n),i=t.holes&&t.holes.map(o=>Hi(o));return{positions:e,holes:i}}function hp(t,n){const e=Math.PI/180,i=1/e,o=new _.Cartographic(t[0]*e,t[1]*e,t[2]),r=new _.Cartographic(n[0]*e,n[1]*e,n[2]),a=new _.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new _.Cartographic);if(a)return a.height=(o.height+r.height)*.5,[a.longitude*i,a.latitude*i,a.height]}const e0=new _.Cartesian4,JE=new _.Matrix4;function e2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function t0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function n0(t,n,e){if(t.scene.mode!==_.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,a=t.camera.frustum.projectionMatrix,s=_.Matrix4.multiply(a,r,JE),l=_.Matrix4.multiplyByVector(s,_.Cartesian4.fromElements(n.x,n.y,n.z,1,e0),e0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),A=i*(l.y*.5+.5),h=o-u,f=i-A,d=l.z;if(!(u<0||A<0||h<0||f<0||d<0||d>1))return e?(e.left=u,e.top=f,e.right=h,e.bottom=A,e.depth=d):e={left:u,top:f,right:h,bottom:A,depth:d},e}const mo={left:0,top:0,right:0,bottom:0,depth:0};class Ch extends c.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new _.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new c.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new xh(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}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 i=n0(this._viewer,this._cartesian,mo);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?t0(this._winPos,mo)||(e=!0,this._winPos.left=mo.left,this._winPos.top=mo.top,this._winPos.right=mo.right,this._winPos.bottom=mo.bottom,this._winPos.depth=mo.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){_.Cartesian3.equals(this._cartesian,e)||(_.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function i0(t){const n=_.Math.toRadians(t[0]),e=_.Math.toRadians(t[1]),i=_.Math.toRadians(t[2]),o=_.Matrix3.fromHeadingPitchRoll(new _.HeadingPitchRoll(n,e,i)),r=new _.Cartesian3;return _.Matrix3.multiplyByVector(o,_.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const t2=_.Check,go=_.defined,r0=_.Math.EPSILON10;function n2(t,n,e,i){if(t2.defined("equalsEpsilon",n),!go(t))return;e=e??!1;const o=go(i),r=t.length;if(r<2)return t;let a,s=t[0],l,u,A=0,h=-1;for(a=1;a<r;++a)l=t[a],n(s,l,r0)?(go(u)||(u=t.slice(0,a),A=a-1,h=0),o&&i.push(a)):(go(u)&&(u.push(l),A=a,o&&(h=i.length)),s=l);return e&&n(t[0],t[r-1],r0)&&(o&&(go(u)?i.splice(h,0,A):i.push(r-1)),go(u)?u.length-=1:u=t.slice(0,-1)),go(u)?u:t}const Ne=_.Cartesian3,vs=_.Cartographic,yo=_.defined,o0=_.DeveloperError,s0=_.Ellipsoid,i2=_.EllipsoidGeodesic,a0=_.EllipsoidRhumbLine,r2=_.IntersectionTests,Ap=_.Math,ws=_.Matrix4,vo=_.Plane,Ft={};Ft.numberOfPoints=function(t,n,e){const i=Ne.distance(t,n);return Math.ceil(i/e)},Ft.numberOfPointsRhumbLine=function(t,n,e){const i=Math.pow(t.longitude-n.longitude,2)+Math.pow(t.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(e*e))))};const o2=new vs;Ft.extractHeights=function(t,n){const e=t.length,i=new Array(e);for(let o=0;o<e;o++){const r=t[o];i[o]=n.cartesianToCartographic(r,o2).height}return i};const s2=new ws,a2=new Ne,l0=new Ne,l2=new vo(Ne.UNIT_X,0),u0=new Ne,u2=new vo(Ne.UNIT_X,0),c2=new Ne,h2=new Ne,fp=[];function c0(t,n,e){const i=fp;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const a=(e-n)/t;for(o=0;o<t;o++){const s=n+o*a;i[o]=s}return i}const Sh=new vs,Eh=new vs,br=new Ne,pp=new Ne,A2=new Ne,dp=new i2;let el=new a0;function f2(t,n,e,i,o,r,a,s){const l=i.scaleToGeodeticSurface(t,pp),u=i.scaleToGeodeticSurface(n,A2),A=Ft.numberOfPoints(t,n,e),h=i.cartesianToCartographic(l,Sh),f=i.cartesianToCartographic(u,Eh),d=c0(A,o,r);dp.setEndPoints(h,f);const p=dp.surfaceDistance/A;let g=s;h.height=o;let v=i.cartographicToCartesian(h,br);Ne.pack(v,a,g),g+=3;for(let y=1;y<A;y++){const m=dp.interpolateUsingSurfaceDistance(y*p,Eh);m.height=d[y],v=i.cartographicToCartesian(m,br),Ne.pack(v,a,g),g+=3}return g}function p2(t,n,e,i,o,r,a,s){const l=i.cartesianToCartographic(t,Sh),u=i.cartesianToCartographic(n,Eh),A=Ft.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const h=c0(A,o,r);el.ellipsoid.equals(i)||(el=new a0(void 0,void 0,i)),el.setEndPoints(l,u);const f=el.surfaceDistance/A;let d=s;l.height=o;let p=i.cartographicToCartesian(l,br);Ne.pack(p,a,d),d+=3;for(let g=1;g<A;g++){const v=el.interpolateUsingSurfaceDistance(g*f,Eh);v.height=h[g],p=i.cartographicToCartesian(v,br),Ne.pack(p,a,d),d+=3}return d}Ft.wrapLongitude=function(t,n){const e=[],i=[];if(yo(t)&&t.length>0){n=n??ws.IDENTITY;const o=ws.inverseTransformation(n,s2),r=ws.multiplyByPoint(o,Ne.ZERO,a2),a=Ne.normalize(ws.multiplyByPointAsVector(o,Ne.UNIT_Y,l0),l0),s=vo.fromPointNormal(r,a,l2),l=Ne.normalize(ws.multiplyByPointAsVector(o,Ne.UNIT_X,u0),u0),u=vo.fromPointNormal(r,l,u2);let A=1;e.push(Ne.clone(t[0]));let h=e[0];const f=t.length;for(let d=1;d<f;++d){const p=t[d];if(vo.getPointDistance(u,h)<0||vo.getPointDistance(u,p)<0){const g=r2.lineSegmentPlane(h,p,s,c2);if(yo(g)){const v=Ne.multiplyByScalar(a,5e-9,h2);vo.getPointDistance(s,h)<0&&Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),i.push(A+1),Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),A=1}}e.push(Ne.clone(t[d])),A++,h=p}i.push(A)}return{positions:e,lengths:i}},Ft.generateArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new o0("options.positions is required.");const e=n.length,i=t.ellipsoid??s0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const g=i.scaleToGeodeticSurface(n[0],pp);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(g,br);Ne.multiplyByScalar(v,o,v),Ne.add(g,v,g)}return[g.x,g.y,g.z]}let a=t.minDistance;if(!yo(a)){const g=t.granularity??Ap.RADIANS_PER_DEGREE;a=Ap.chordLength(g,i.maximumRadius)}let s=0,l;for(l=0;l<e-1;l++)s+=Ft.numberOfPoints(n[l],n[l+1],a);const u=(s+1)*3,A=new Array(u);let h=0;for(l=0;l<e-1;l++){const g=n[l],v=n[l+1],y=r?o[l]:o,m=r?o[l+1]:o;h=f2(g,v,a,i,y,m,A,h)}fp.length=0;const f=n[e-1],d=i.cartesianToCartographic(f,Sh);d.height=r?o[e-1]:o;const p=i.cartographicToCartesian(d,br);return Ne.pack(p,A,u-3),A};const h0=new vs,d2=new vs;Ft.generateRhumbArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new o0("options.positions is required.");const e=n.length,i=t.ellipsoid??s0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],pp);if(o=r?o[0]:o,o!==0){const m=i.geodeticSurfaceNormal(y,br);Ne.multiplyByScalar(m,o,m),Ne.add(y,m,y)}return[y.x,y.y,y.z]}const a=t.granularity??Ap.RADIANS_PER_DEGREE;let s=0,l,u=i.cartesianToCartographic(n[0],h0),A;for(l=0;l<e-1;l++)A=i.cartesianToCartographic(n[l+1],d2),s+=Ft.numberOfPointsRhumbLine(u,A,a),u=vs.clone(A,h0);const h=(s+1)*3,f=new Array(h);let d=0;for(l=0;l<e-1;l++){const y=n[l],m=n[l+1],b=r?o[l]:o,x=r?o[l+1]:o;d=p2(y,m,a,i,b,x,f,d)}fp.length=0;const p=n[e-1],g=i.cartesianToCartographic(p,Sh);g.height=r?o[e-1]:o;const v=i.cartographicToCartesian(g,br);return Ne.pack(v,f,h-3),f},Ft.generateCartesianArc=function(t){const n=Ft.generateArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i},Ft.generateCartesianRhumbArc=function(t){const n=Ft.generateRhumbArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i};const Ph=_.ArcType,m2=_.Cartesian3,g2=_.Math;function A0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=n2(t.positions,m2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===Ph.GEODESIC||n===Ph.RHUMB){let s;n===Ph.GEODESIC?(s=g2.chordLength(e,i.maximumRadius),Ft.numberOfPoints):(s=e,Ft.numberOfPointsRhumbLine);const l=Ft.extractHeights(r,i);n===Ph.GEODESIC?r=Ft.generateCartesianArc({positions:r,minDistance:s,ellipsoid:i,height:l}):r=Ft.generateCartesianRhumbArc({positions:r,granularity:s,ellipsoid:i,height:l})}return r}}function mp(t,n="GEODESIC",e){const o=t.map(c.lbhToXyz).map(h=>_.Cartesian3.fromArray(h));let r;if(e>0&&n!=="NONE"){if(r=A0({arcType:_.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:_.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let a=0;const s=[0],l=r.length;for(let h=1;h<l;++h)a+=_.Cartesian3.distance(r[h-1],r[h]),s.push(a);const u=r.map(h=>c.xyzToLbh([h.x,h.y,h.z]));return{timePosRots:s.map((h,f)=>[s[f],u[f],void 0]),distances:s}}function f0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function gp(t,n){const e=_.Matrix4.clone(_.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:a="YForwardZUp"}=t;if(i){const[s,l,u]=i;_.Transforms.eastNorthUpToFixedFrame(_.Cartesian3.fromDegrees(s,l,u),void 0,e)}if(o){const s=new _.Quaternion;a==="YForwardZUp"?bh(o,s):a==="XForwardZUp"&&Gv(o,s);const l=_.Matrix3.fromQuaternion(s);_.Matrix4.multiply(e,_.Matrix4.fromRotationTranslation(l),e)}return r&&_.Matrix4.multiplyByScale(e,oi(r),e),f0(e,n)}const y2=new _.Matrix4;function p0(t,n){const e=_.Matrix4.fromArray(t,0,y2);return _.Matrix4.inverse(e,e),f0(e,n)}const v2=new _.Matrix4,w2=new _.Cartesian3;function d0(t,n,e){const[i,o,r]=n,a=_.Cartesian3.fromDegrees(i,o,r,void 0,w2),s=_.Matrix4.fromArray(t,0,v2),l=_.Matrix4.multiplyByPoint(s,a,a),{x:u,y:A,z:h}=l;return e=e||[0,0,0],e[0]=u,e[1]=A,e[2]=h,e}const b2=new _.Matrix4,x2=new _.Cartesian3,_2=new _.Cartographic;function xr(t,n,e){const[i,o,r]=n,a=_.Cartesian3.fromElements(i,o,r,x2),s=_.Matrix4.fromArray(t,0,b2),l=_.Matrix4.multiplyByPoint(s,a,a),u=_.Cartographic.fromCartesian(l,void 0,_2);return e=e||[0,0,0],e[0]=_.Math.toDegrees(u.longitude),e[1]=_.Math.toDegrees(u.latitude),e[2]=u.height,e}function vn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=gp({position:e,rotation:i,scale:o,initialRotationMode:r}),s=p0(a);return[n.map(u=>d0(s,u)),a,s]}function _r(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=gp({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>xr(a,l)),a]}function m0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=Xe.Cartesian3.fromDegrees(...t[e]),o=Xe.Cartesian3.fromDegrees(...t[e+1]),r=Xe.Cartesian3.fromDegrees(...t[e+2]),a=Xe.Cartesian3.angleBetween(Xe.Cartesian3.subtract(i,o,new Xe.Cartesian3),Xe.Cartesian3.subtract(r,o,new Xe.Cartesian3));n.push(isNaN(a)?0:Xe.Math.toDegrees(a))}return n}function yp(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>Ue(i)))),t.holes&&t.holes.forEach(i=>{e=yp(i,e)}),e}function Mn(t){return typeof t=="string"?c.ESSceneObject.context.getStrFromEnv(t):new _.Resource({url:c.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 vp extends c.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[a,s,l]=c.getReactFuncs(e),[u,A,h]=c.getReactFuncs(i),f=new _.Cartesian3,d=()=>{let p=a();p&&(p=[...p],n.editingHeightOffset&&(p[2]-=n.editingHeightOffset),_.Cartesian3.fromDegrees(...p,void 0,f))};d(),this.dispose(l.disposableOn(d)),this.dispose(r.preUpdate.addEventListener(()=>{if(_.Cartesian3.ZERO.equals(f))return;const p=Ni(r,f,o);p!==void 0?A([p,p,p]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${p??"undefined"}`)}))}}function C2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:_.Matrix4.toArray(_.Matrix4.IDENTITY);let e,i,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=_.Cartesian3.add(r,_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new _.Cartesian3),i=_.Cartesian3.add(r,_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new _.Cartesian3),o=_.Cartesian3.add(r,_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new _.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=_.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=_.Cartesian3.add(r,_.Cartesian3.fromArray([f,0,0]),new _.Cartesian3),i=_.Cartesian3.add(r,_.Cartesian3.fromArray([0,f,0]),new _.Cartesian3),o=_.Cartesian3.add(r,_.Cartesian3.fromArray([0,0,f]),new _.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let a,s,l,u,A,h;return _.Matrix4.IDENTITY.equals(_.Matrix4.fromArray(n))?(a=Ue(e),u=Ue(_.Cartesian3.add(r,_.Cartesian3.subtract(r,e,new _.Cartesian3),new _.Cartesian3)),s=Ue(i),A=Ue(_.Cartesian3.add(r,_.Cartesian3.subtract(r,i,new _.Cartesian3),new _.Cartesian3)),l=Ue(o),h=Ue(_.Cartesian3.add(r,_.Cartesian3.subtract(r,o,new _.Cartesian3),new _.Cartesian3))):(a=xr(n,[e.x,e.y,e.z]),u=xr(n,[-e.x,-e.y,-e.z]),s=xr(n,[i.x,i.y,i.z]),A=xr(n,[-i.x,-i.y,-i.z]),l=xr(n,[o.x,o.y,o.z]),h=xr(n,[-o.x,-o.y,-o.z])),!a||!u||!s||!A||!l||!h?"无法生成包围盒,请检查包围盒是否正确":[_.Math.toRadians(Math.min(a[0],u[0],s[0],A[0],l[0],h[0])),_.Math.toRadians(Math.min(a[1],u[1],s[1],A[1],l[1],h[1])),_.Math.toRadians(Math.max(a[0],u[0],s[0],A[0],l[0],h[0])),_.Math.toRadians(Math.max(a[1],u[1],s[1],A[1],l[1],h[1])),Math.min(a[2],u[2],s[2],A[2],l[2],h[2]),Math.max(a[2],u[2],s[2],A[2],l[2],h[2])]}const g0=c.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await c.step(t,async l=>new Promise(async(u,A)=>{for(let h=0;h<n.length;h++){const f=n[h];await fetch(f).then(d=>d.json()).then(d=>{d&&!Reflect.has(d,"success")?i[f]=d:o.push({index:h,url:f,message:d.message}),h==n.length-1&&u()}).catch(d=>{o.push({index:h,url:f,message:d}),h==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],a=[],s=[];for(const l in i){const u=i[l];a.push(u.geometricError??u.root.geometricError??0);const A=C2(u);r.push(A),s.push({content:{uri:l},boundingVolume:{region:A},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...a),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=s),e});function S2(t){return new Promise((n,e)=>{g0.restart(void 0,t),g0.completeEvent.don(i=>{n(i)})})}class wp extends c.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(c.react(0)));const[i,o,r]=c.getReactFuncs(e);{const a=()=>{const s=i();if(s){const{center:l,minPos:u,maxPos:A}=c.getMinMaxCorner(s);this._center.value=l,this._radius.value=c.geoDistance(u,A)/2}else this._center.value=void 0};a(),this.dispose(r.disposableOn(a))}}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 y0(t){return new _.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new _.Color(.2,.3,.6,1),blendColor:new _.Color(0,1,.699,1),specularMap:_.Material.DefaultImageId,normalMap:_.Material.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1,...t},source:`// Thanks for the contribution Jonas
1
+ var EarthSDK3_Cesium=function(re,Xe,c){"use strict";var OH=Object.defineProperty;var LH=(re,Xe,c)=>Xe in re?OH(re,Xe,{enumerable:!0,configurable:!0,writable:!0,value:c}):re[Xe]=c;var L=(re,Xe,c)=>LH(re,typeof Xe!="symbol"?Xe+"":Xe,c);var ds=typeof document<"u"?document.currentScript:null;function wE(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return n.default=t,Object.freeze(n)}const _=wE(Xe);window.Cesium=_;function bE(){Object.keys(_).forEach(t=>{_[t].prototype&&Object.defineProperty(_[t].prototype,"ESSceneObjectID",{writable:!0,enumerable:!0,value:c.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 n=t.match(/defaultAccessToken\s*=\s*["'`](.*?)["'`]/);n&&(_.Ion.defaultAccessToken=n[1],console.log("更新默认Cesium.Ion.Token成功"))});const xu=class xu extends c.Destroyable{};L(xu,"defaults",{enabled:!0}),L(xu,"createDefaultProps",()=>({...xu.defaults}));let In=xu;c.extendClassProps(In.prototype,In.createDefaultProps);class Nn extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.flyToEvent.don((o,r,a)=>this.flyTo(o,r,a))),this.d(n.flyInEvent.don((o,r,a)=>this.flyIn(o,r,a))),this.dispose(n.calcFlyInParamEvent.disposableOn(()=>{if(!e.actived)return;const o=e.getCameraInfo();if(!o)return;const{position:r,rotation:a}=o;n.flyInParam={position:r,rotation:a,flyDuration:1}})),this.dispose(n.calcFlyToParamEvent.disposableOn(()=>{n.useCalcFlyToParamInESObjectWithLocation||console.warn("calcFlyToParam无法调用,该对象缺少position属性!")}))}flyToWithPromise(n,e,i,o,r,a,s,l="default"){const{sceneObject:u,czmViewer:A}=this,h=A.flyTo({distance:i??0,heading:o?o[0]:0,pitch:o?o[1]:0,flyDuration:r??1,hDelta:a??0,pDelta:s??0},e,l);h&&h.then(f=>{})}flyTo(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam&&(o.useCalcFlyToParamInESObjectWithLocation||console.warn("flyToParam无法使用,该对象缺少position属性,若飞行失败,请清空flyToParam后重试!")),o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}flyIn(n,e,i="default"){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam){const{position:a,rotation:s,flyDuration:l}=o.flyInParam,u=n??l;return this.flyToWithPromise(e,a,void 0,s,u,void 0,void 0,i),!0}return!1}get czmViewer(){return this.viewer}}function ft(t,n){return _.Cartesian3.fromDegrees(...t,void 0,n)}const xE=new _.Cartographic;function Ue(t,n){const e=_.Cartographic.fromCartesian(t,void 0,xE);if(e)return n=n||[0,0,0],n[0]=_.Math.toDegrees(e.longitude),n[1]=_.Math.toDegrees(e.latitude),n[2]=e.height,n}function Ze(t,n){return n=n||new _.Cartesian2,n.x=t[0],n.y=t[1],n}function Vv(t,n){return n=n||[0,0],n[0]=t.x,n[1]=t.y,n}function ri(t,n){return n=n||new _.Cartesian3,n.x=t[0],n.y=t[1],n.z=t[2],n}function $a(t,n){return n=n||[0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n}function np(t,n){return n=n||new _.Cartesian4,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function Nv(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}function oi(t,n){if(t.length===4)return np(t,n);if(t.length===3)return ri(t,n);if(t.length===2)return Ze(t,n);throw new Error("toCartesian error: should not be here!")}function _E(t,n){if(t instanceof _.Cartesian2)return Vv(t,n);if(t instanceof _.Cartesian3)return $a(t,n);if(t instanceof _.Cartesian4)return Nv(t,n);throw new Error("fromCartesian error: should not be here!")}function CE(t,n){return n=n||new _.Cartographic,n.longitude=_.Math.toRadians(t[0]),n.latitude=_.Math.toRadians(t[1]),n.height=t[2],n}function Ao(t,n){return n=n||[0,0,0],n[0]=_.Math.toDegrees(t.longitude),n[1]=_.Math.toDegrees(t.latitude),n[2]=t.height,n}function Be(t,n){return n=n||new _.Color,n.red=t[0],n.green=t[1],n.blue=t[2],n.alpha=t[3],n}function SE(t,n){return n=n||[0,0,0,0],n[0]=t.red,n[1]=t.green,n[2]=t.blue,n[3]=t.alpha,n}function gr(t,n){return n=n||new _.NearFarScalar,n.near=t[0],n.nearValue=t[1],n.far=t[2],n.farValue=t[3],n}function EE(t,n){return n=n||[0,0,0,0],n[0]=t.near,n[1]=t.nearValue,n[2]=t.far,n[3]=t.farValue,n}function Hv(t,n){return n=n||new _.HeadingPitchRoll,n.heading=_.Math.toRadians(t[0]-90),n.pitch=_.Math.toRadians(t[1]),n.roll=_.Math.toRadians(t[2]),n}function PE(t,n){return n=n||[0,0,0],n[0]=_.Math.toDegrees(t.heading+_.Math.PI_OVER_TWO),n[1]=_.Math.toDegrees(t.pitch),n[2]=_.Math.toDegrees(t.roll),n}function Xa(t,n){return n=n||new _.DistanceDisplayCondition,n.near=t[0],n.far=t[1],n}function BE(t,n){return n=n||[0,0],n[0]=t.near,n[1]=t.far,n}function TE(t,n){return n=n||new _.Quaternion,n.x=t[0],n.y=t[1],n.z=t[2],n.w=t[3],n}function IE(t,n){return n=n||[0,0,0,0],n[0]=t.x,n[1]=t.y,n[2]=t.z,n[3]=t.w,n}const FE=new _.HeadingPitchRoll,ME=new _.Cartesian3;function DE(t,n,e){const i=Hv(n,FE),o=ft(t,ME);return _.Transforms.headingPitchRollQuaternion(o,i,void 0,void 0,e)}function mt(t,n){return n=n||new _.Rectangle,n.west=t[0]*Math.PI/180,n.south=t[1]*Math.PI/180,n.east=t[2]*Math.PI/180,n.north=t[3]*Math.PI/180,n}function RE(t,n){return n=n||[0,0,0,0],n[0]=t.west,n[1]=t.south,n[2]=t.east,n[3]=t.north,n}const UE=new _.Cartesian3;function qe(t,n){return n=n||new _.Ellipsoid,_.Ellipsoid.fromCartesian3(_.Cartesian3.fromArray(t,void 0,UE),n)}function OE(t,n){return n=n||[0,0,0],n[0]=t.radii.x,n[1]=t.radii.y,n[2]=t.radii.z,n}function mi(t){if(t.type==="GeographicTilingScheme")return new _.GeographicTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),rectangle:t.rectangle&&mt(t.rectangle),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY});if(t.type==="WebMercatorTilingScheme")return new _.WebMercatorTilingScheme({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToGCJ02WebMercatorTilingScheme")return new ax({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});if(t.type==="ToWGS84WebMercatorTilingScheme")return new lx({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),numberOfLevelZeroTilesX:t.numberOfLevelZeroTilesX,numberOfLevelZeroTilesY:t.numberOfLevelZeroTilesY,rectangleSouthwestInMeters:t.rectangleSouthwestInMeters&&Ze(t.rectangleSouthwestInMeters),rectangleNortheastInMeters:t.rectangleNortheastInMeters&&Ze(t.rectangleNortheastInMeters)});console.warn(`未能识别的类型tilingSchemaJson.type: ${t.type}`)}function Ya(t,n){const{planes:e,enabled:i,modelMatrix:o,unionClippingRegions:r,edgeColor:a,edgeWidth:s}=t;let l=o&&_.Matrix4.fromArray(o);return n&&(l=l||_.Matrix4.clone(_.Matrix4.IDENTITY,new _.Matrix4),_.Matrix4.multiply(n,l,l)),new _.ClippingPlaneCollection({planes:e&&e.map(u=>new _.ClippingPlane(ri(u.normal),u.distance)),enabled:i,modelMatrix:l,unionClippingRegions:r,edgeColor:a&&Be(a),edgeWidth:s})}function vh(t,n,e){const i=n;if(!i){t.removeAll(),t.enabled=!1;return}if(t.removeAll(),i.planes)for(let r of i.planes)t.add(new _.ClippingPlane(ri(r.normal),r.distance));let o=i.modelMatrix&&_.Matrix4.fromArray(i.modelMatrix)||_.Matrix4.clone(_.Matrix4.IDENTITY,new _.Matrix4);e&&_.Matrix4.multiply(e,o,o),t.enabled=i.enabled??!0,t.modelMatrix=o,t.unionClippingRegions=i.unionClippingRegions??!1,t.edgeColor=Be(i.edgeColor??[1,1,1,1]),t.edgeWidth=i.edgeWidth??2}function wh(t){const{polygons:n,enabled:e,inverse:i}=t;return new _.ClippingPolygonCollection({polygons:n&&n.map(o=>new _.ClippingPolygon({positions:o.positions.map(r=>ft(r))})),enabled:e,inverse:i})}function bh(t,n){return ip(t,_.Cartesian3.UNIT_Y,_.Cartesian3.UNIT_Z,_.Cartesian3.UNIT_X,n)}function Gv(t,n){return ip(t,_.Cartesian3.UNIT_X,_.Cartesian3.UNIT_Z,new _.Cartesian3(0,-1,0),n)}function ip(t,n,e,i,o){const[r,a,s]=t,l=_.Quaternion.fromAxisAngle(e,_.Math.toRadians(-r)),u=_.Quaternion.fromAxisAngle(i,_.Math.toRadians(a)),A=_.Quaternion.fromAxisAngle(n,_.Math.toRadians(s)),h=_.Quaternion.clone(_.Quaternion.IDENTITY,o);return _.Quaternion.multiply(A,h,h),_.Quaternion.multiply(u,h,h),_.Quaternion.multiply(l,h,h),h}function yr(t,n){return Array.isArray(t)?t.length!==n?(console.warn(`array.length !== ${n}`),!1):t.every(e=>Number.isFinite(e))?!0:(console.warn("!array.every(v => Number.isFinite(v))"),!1):(console.warn("!Array.isArray(array)"),!1)}function Wv(t){return t.some(n=>n===0)?(console.warn("array.some(e => e === 0)"),!1):!0}function st(t,n){if(!((!t.localScale||yr(t.localScale,3))&&(!t.localRotation||yr(t.localRotation,3))&&(!t.localPosition||yr(t.localPosition,3))&&(!t.localModelMatrix||yr(t.localModelMatrix,16))&&(!t.scale||yr(t.scale,3))&&(!t.rotation||yr(t.rotation,3))&&(!t.position||yr(t.position,3))&&(!t.modelMatrix||yr(t.modelMatrix,16)))||t.localScale&&!Wv(t.localScale)||t.scale&&!Wv(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 i=n??_.Matrix4.clone(_.Matrix4.IDENTITY);if(t.localScale){const[o,r,a]=t.localScale??[1,1,1],s=_.Matrix4.fromScale(_.Cartesian3.fromElements(o,r,a),new _.Matrix4);_.Matrix4.multiply(s,i,i)}if((t.initialRotation??"yForwardzUp")==="xForwardzUp"){const o=_.Quaternion.fromAxisAngle(_.Cartesian3.UNIT_Z,_.Math.toRadians(90)),r=_.Matrix3.fromQuaternion(o);_.Matrix4.multiply(_.Matrix4.fromRotationTranslation(r),i,i)}if(t.localRotation){const o=bh(t.localRotation),r=_.Matrix3.fromQuaternion(o);_.Matrix4.multiply(_.Matrix4.fromRotationTranslation(r),i,i)}if(t.localPosition){const o=_.Matrix4.fromTranslation(_.Cartesian3.fromArray(t.localPosition));_.Matrix4.multiply(o,i,i)}if(t.localModelMatrix){const o=_.Matrix4.fromArray(t.localModelMatrix);_.Matrix4.multiply(o,i,i)}if(t.sceneScaleFromPixelSize!==void 0&&Number.isFinite(t.sceneScaleFromPixelSize)){const o=t.sceneScaleFromPixelSize,r=_.Matrix4.fromScale(_.Cartesian3.fromElements(o,o,o),new _.Matrix4);_.Matrix4.multiply(r,i,i)}if(t.scale){const[o,r,a]=t.scale??[1,1,1],s=_.Matrix4.fromScale(_.Cartesian3.fromElements(o,r,a),new _.Matrix4);_.Matrix4.multiply(s,i,i)}if(t.rotation){const o=bh(t.rotation),r=_.Matrix3.fromQuaternion(o);_.Matrix4.multiply(_.Matrix4.fromRotationTranslation(r),i,i)}if(t.position){const o=_.Cartesian3.fromDegrees(...t.position),r=_.Transforms.eastNorthUpToFixedFrame(o);_.Matrix4.multiply(r,i,i)}if(t.modelMatrix){const o=_.Matrix4.fromArray(t.modelMatrix);_.Matrix4.multiply(o,i,i)}return i}const LE=new _.Cartesian3,Ja=new _.HeadingPitchRoll,zE=new _.Matrix4,kE=new _.Cartesian3,QE=new _.Cartographic;function VE(t,n=[0,0,0],e=0,i){const[o,r,a]=t,s=_.Cartesian3.fromDegrees(o,r,a,void 0,LE),l=[...n];for(let A=0;A<3;++A)l[A]=_.Math.RADIANS_PER_DEGREE*l[A];if(e!==0){Ja.heading=l[0],Ja.pitch=l[1],Ja.roll=l[2],Ja.heading-=_.Math.PI_OVER_TWO;const A=_.Transforms.headingPitchRollToFixedFrame(s,Ja,void 0,void 0,zE),h=_.Matrix4.multiplyByPointAsVector(A,_.Cartesian3.UNIT_X,kE);_.Cartesian3.multiplyByScalar(h,e,h),_.Cartesian3.subtract(s,h,s)}const u=_.Cartographic.fromCartesian(s,void 0,QE);if(u)return i=i||[0,0,0],i[0]=u.longitude*180/Math.PI,i[1]=u.latitude*180/Math.PI,i[2]=u.height,i}function jv(t,n,e,i){return VE(t,n,e,i)}const vr=_.Math.toDegrees;function Fn(t,n){const{longitude:e,latitude:i,height:o}=t.positionCartographic;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=o,n):[vr(e),vr(i),o]}function ms(t,n){const{heading:e,pitch:i,roll:o}=t;return n?(n[0]=vr(e),n[1]=vr(i),n[2]=vr(o),n):[e,i,o].map(vr)}class xh extends c.Destroyable{constructor(e){super();L(this,"_originViewMatrix",new _.Matrix4);L(this,"_originProjMatrix",new _.Matrix4);L(this,"_changed",new c.Event);this._scene=e;const i=this._scene.camera;_.Matrix4.clone(i.viewMatrix,this._originViewMatrix),_.Matrix4.clone(i.frustum.projectionMatrix,this._originViewMatrix),this.dispose(this._scene.preUpdate.addEventListener(()=>{this._update()}))}_update(){_.Matrix4.equals(this._scene.camera.viewMatrix,this._originViewMatrix)||(_.Matrix4.clone(this._scene.camera.viewMatrix,this._originViewMatrix),this._changed.emit()),_.Matrix4.equals(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix)||(_.Matrix4.clone(this._scene.camera.frustum.projectionMatrix,this._originProjMatrix),this._changed.emit())}get changed(){return this._changed}}class NE extends c.Destroyable{constructor(n){super();const e=()=>{};this.dispose(n.viewDistanceChanged.disposableOn(e)),this.dispose(n.visibleAlphaChanged.disposableOn(e))}}class HE extends c.Destroyable{constructor(e){super();L(this,"_debugObjResetting");this._control=e,this._debugObjResetting=this.disposeVar(new c.ObjResettingWithEvent(this._control.debugChanged,()=>{if(this._control.debug)return new NE(this._control)}))}get debugObjResetting(){return this._debugObjResetting}}class fo extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_visibleAlpha",this.disposeVar(c.react(1)));L(this,"_viewDistance",this.disposeVar(c.react(0)));L(this,"_debug",this.disposeVar(c.react(!1)));L(this,"_viewDistanceDebug",this.disposeVar(new HE(this)));this._czmViewer=e,this._positionReact=o;const{positionReact:a,czmViewer:s}=this,[l,u,A]=c.getReactFuncs(i),[h,f,d]=c.getReactFuncs(a),[p,g,v]=r?c.getReactFuncs(r):[void 0,void 0,void 0],y=()=>{let x=1,E=Number.NEGATIVE_INFINITY;const B=l(),P=h(),I=p?p():0,M=s.getCurrentCameraInfo();if(!B||!P||!M){this._viewDistance.value=E,this._visibleAlpha.value=x;return}E=c.cartesianDistance(M.position,P)-(I??0);const[F,S,T,w]=B;F>S||S>T||T>w?console.error("viewDistanceRange存在问题,需要满足逐级增大的条件,否则不生效!"):E>=S&&E<=T?x=1:E<=F||E>=w?x=0:E>F&&E<S?S-F<=0?x=0:x=(E-F)/(S-F):E>T&&E<w?(w<=T&&(x=0),x=(w-E)/(w-T)):(x=1,console.error("不应该运行至此!")),this._viewDistance.value=E,this._visibleAlpha.value=x};y();const m=[s.cameraChanged,A,d];v&&m.push(v);const b=this.disposeVar(c.createNextAnimateFrameEvent(...m));this.dispose(b.disposableOn(y))}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 GE=new _.BoundingSphere(_.Cartesian3.ZERO,0);function Ni(t,n,e){var i=GE;_.Cartesian3.clone(n,i.center);const o=t.camera.getPixelSize(i,t.drawingBufferWidth,t.drawingBufferHeight);if(o<=0)return;const r=e*o;if(Number.isFinite(r)&&r>0)return r}function $t(t,n=!1){const e=t.length;let i;const o=[];for(let r=0;r<e;++r){const[a,s,l]=t[r],u=n?_.Cartesian3.fromDegrees(a,s):_.Cartesian3.fromDegrees(a,s,l);if(!u)continue;const{x:A,y:h,z:f}=u;[A,h,f].every(Number.isFinite)&&(!i||!_.Cartesian3.equals(i,u))&&(i=u,o.push(i))}return o}function po(t,n,e,i){const o=c.geoRhumbDistance(t,e),r=c.geoRhumbHeading(t,e),a=Math.cos(r*Math.PI/180)*Math.cos(n*Math.PI/180)+Math.sin(r*Math.PI/180)*Math.sin(n*Math.PI/180);return a>0?c.geoRhumbDestination(t,o,n,i):c.geoRhumbDestination(t,o,n+180,i),[a>0?o:-o,i]}function WE(t,n,e){const i=e*.1,o=[];for(let r=-9;r<10;++r){const a=c.geoRhumbDestination(t,i*r,n);a&&o.push(a)}return o}function jE(t,n){return c.geoNearestPointOnLine(t,n).geometry.coordinates}const qv=new _.Cartesian3,qE=new _.Ray,KE=new _.Plane(_.Cartesian3.UNIT_X,0);function _h(t,n,e,i){const o=_.Cartesian3.normalize(n,qv),r=_.Cartesian3.cross(t.camera.right,o,qv);_.Cartesian3.normalize(r,r);const a=_.Plane.fromPointNormal(n,r,KE),s=t.camera.getPickRay(e,qE);if(s)return _.IntersectionTests.rayPlane(s,a,i)}const rp=new _.Cartesian3,ZE=new _.Ray,$E=new _.Cartographic,XE=new _.Ellipsoid;function gs(t,n,e,i){const o=t.camera.getPickRay(n,ZE);if(!o)return;const r=_.Cartesian3.fromElements(e,e,e,rp),a=_.Cartesian3.add(r,_.Ellipsoid.WGS84.radii,rp),s=_.Ellipsoid.fromCartesian3(a,XE),l=_.IntersectionTests.rayEllipsoid(o,s);if(l){const u=l.start>0?l.start:l.stop;if(u){const A=_.Ray.getPoint(o,u,rp),h=_.Cartographic.fromCartesian(A,void 0,$E);return i=i||new _.Cartographic,i.longitude=h.longitude,i.latitude=h.latitude,i.height=e,i}else return}else return}function ys(t,n){n[0]=t[0],n[1]=t[1],n[2]=t[2]}function Kv(t){const n=_.Ellipsoid.WGS84.minimumRadius;return(t+n)/n}const Zv=new _.Cartographic,$v=new _.Cartesian3,gn=[0,0,0],wr=[0,0,0],op=new _.Cartesian2,sp=new _.Cartesian3;function ap(t,n,e,i,o,r){o.constraintMode="none",ys([0,0,0],o.startDragPos),r=r||{},oi(c.getDomEventCurrentTargetPos(t),op);const a=e.position;if(!ft(a,sp))return;const s=Ni(n,sp,i);if(s===void 0||!_h(n,sp,op,$v)||!Ue($v,gn))return;const l=Kv(gn[2])*c.geoDistance(a,gn);if(!r.z&&l<s&&Math.abs(a[2]-gn[2])<e.dimensions[0]&&gn[2]>a[2])return o.constraintMode="z",ys(gn,o.startDragPos),!0;if(!gs(n,op,a[2],Zv)||!Ao(Zv,gn))return;const u=Kv(a[2])*c.geoDistance(a,gn),A=e.dimensions[0];if(!(u>1.05*A)){if(!r.zAxis&&u>.95*A&&u<=1.05*A){o.constraintMode="zAxis",ys(gn,o.startDragPos);return}{const[h,f]=po(a,e.heading+90,gn,wr);if(!r.x&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,gn)<s)){o.constraintMode="x",ys(wr,o.startDragPos);return}}{const[h,f]=po(a,e.heading,gn,wr);if(!r.y&&h>0&&f&&(wr[2]=a[2],c.geoDistance(wr,gn)<s)){o.constraintMode="y",ys(wr,o.startDragPos);return}}r.xy||(o.constraintMode="xy",ys(gn,o.startDragPos))}}async function Xv(t,n,e,i){var s;const o=(s=t.viewer)==null?void 0:s.scene;if(!o)throw new Error("!scene");const r=c.getDomEventCurrentTargetPos(n),a=oi(r);if(e===void 0){const l=t.quickPickPosition(r);return l?await l:void 0}else{const l=gs(o,a,e);return l?Ao(l):void 0}}let lp,up;function Yv(t,n,e,i,o){o=o||new _.Cartesian3,lp=lp||new _.Ray,up=up||new _.Plane(_.Cartesian3.UNIT_X,0);const r=t.camera.getPickRay(i,lp),a=_.Plane.fromPointNormal(n,e,up);return o=_.IntersectionTests.rayPlane(r,a,o),o}function Jv(t){const n=_.Material.fromType(t.type);return cp(n,t),n}function yn(t){return t&&c.ESSceneObject.context.getStrFromEnv(t)||_.Material.DefaultImageId}function YE(t){return{x:t[0],y:t[1]}}function cp(t,n){n.type==="Color"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineArrow"?t.uniforms.color=Be(n.color??[1,1,1,1]):n.type==="PolylineDash"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.gapColor=Be(n.gapColor??[0,0,0,0]),t.uniforms.dashLength=n.dashLength??16,t.uniforms.dashPattern=n.dashPattern??255):n.type==="PolylineGlow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.glowPower=n.glowPower??.25,t.uniforms.taperPower=n.taperPower??1):n.type==="PolylineOutline"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.outlineColor=Be(n.outlineColor??[1,0,0,1]),t.uniforms.outlineWidth=n.outlineWidth??1):n.type==="Image"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.color=Be(n.color??[1,1,1,1])):n.type==="DiffuseMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="AlphaMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"a"):n.type==="SpecularMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r"):n.type==="EmissionMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb"):n.type==="BumpMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channel=n.channel??"r",t.uniforms.strength=n.strength??.8):n.type==="NormalMap"?(t.uniforms.image=yn(n.image),t.uniforms.repeat=Ze(n.repeat??[1,1]),t.uniforms.channels=n.channels??"rgb",t.uniforms.strength=n.strength??.8):n.type==="Grid"?(t.uniforms.color=Be(n.color??[0,1,0,1]),t.uniforms.cellAlpha=n.cellAlpha??.1,t.uniforms.lineCount=Ze(n.lineCount??[8,8]),t.uniforms.lineThickness=Ze(n.lineThickness??[1,1]),t.uniforms.lineOffset=Ze(n.lineOffset??[0,0])):n.type==="Stripe"?(t.uniforms.evenColor=Be(n.evenColor??[1,1,1,.5]),t.uniforms.oddColor=Be(n.oddColor??[0,0,1,.5]),t.uniforms.horizontal=n.horizontal??!0,t.uniforms.offset=n.offset??0,t.uniforms.repeat=n.repeat??5):n.type==="Checkerboard"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,1,.5]),t.uniforms.darkColor=Be(n.darkColor??[0,0,0,.5]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Dot"?(t.uniforms.lightColor=Be(n.lightColor??[1,1,0,.75]),t.uniforms.darkColor=Be(n.darkColor??[0,1,1,.75]),t.uniforms.repeat=Ze(n.repeat??[5,5])):n.type==="Water"?(t.uniforms.baseWaterColor=Be(n.baseWaterColor??[.2,.3,.6,1]),t.uniforms.blendColor=Be(n.blendColor??[0,1,.699,1]),t.uniforms.specularMap=yn(n.specularMap),t.uniforms.normalMap=yn(n.normalMap),t.uniforms.frequency=n.frequency??10,t.uniforms.animationSpeed=n.animationSpeed??.01,t.uniforms.amplitude=n.amplitude??1,t.uniforms.specularIntensity=n.specularIntensity??.5,t.uniforms.fadeFactor=n.fadeFactor??1):n.type==="RimLighting"?(t.uniforms.color=Be(n.color??[1,0,0,.7]),t.uniforms.rimColor=Be(n.rimColor??[1,1,1,.4]),t.uniforms.width=n.width??.3):n.type==="Fade"?(t.uniforms.fadeInColor=Be(n.fadeInColor??[1,0,0,1]),t.uniforms.fadeOutColor=Be(n.fadeOutColor??[0,0,0,0]),t.uniforms.maximumDistance=n.maximumDistance??.5,t.uniforms.repeat=n.repeat??!0,t.uniforms.fadeDirection=YE(n.fadeDirection??[!0,!0]),t.uniforms.time=Ze(n.time??[.5,.5])):n.type==="ElevationContour"?(t.uniforms.color=Be(n.color??[1,0,0,1]),t.uniforms.spacing=n.spacing??100,t.uniforms.width=n.width??1):n.type==="ElevationRamp"?(t.uniforms.image=yn(n.image),t.uniforms.minimumHeight=n.minimumHeight??0,t.uniforms.maximumHeight=n.maximumHeight??1e4):n.type==="AspectRamp"?t.uniforms.image=yn(n.image):n.type==="ElevationBand"?(t.uniforms.color=yn(n.colors),t.uniforms.heights=yn(n.heights)):n.type==="XbsjPolylineArrow"?(t.uniforms.color=Be(n.color??[1,1,1,1]),t.uniforms.image=yn(n.image),t.uniforms.repeat=n.repeat??60,t.uniforms.speed=n.speed??1,t.uniforms.lineLength=n.lineLength??1,t.uniforms.arrowColor=Be(n.arrowColor??[1,1,1,1])):console.warn(`未知材质类型,无法更新 ${n.type}`)}function si(t,n){const e=c.react(void 0);let i="";const[o,r,a]=c.getReactFuncs(t),s=()=>{try{const l=o()??n;l?i!==l.type?(i=l.type,e.value=Jv(l)):e.value&&cp(e.value,l):(i="",e.value=void 0)}catch{}};return s(),e.dispose(a.disposableOn(s)),e}function Hi(t,n=!1){const e=$t(t.positions,n),i=t.holes&&t.holes.map(o=>Hi(o));return{positions:e,holes:i}}function hp(t,n){const e=Math.PI/180,i=1/e,o=new _.Cartographic(t[0]*e,t[1]*e,t[2]),r=new _.Cartographic(n[0]*e,n[1]*e,n[2]),a=new _.EllipsoidGeodesic(o,r).interpolateUsingFraction(.5,new _.Cartographic);if(a)return a.height=(o.height+r.height)*.5,[a.longitude*i,a.latitude*i,a.height]}const e0=new _.Cartesian4,JE=new _.Matrix4;function e2(){return{left:0,top:0,right:0,bottom:0,depth:0}}function t0(t,n){return t.left===n.left&&t.right===n.right&&t.bottom===n.bottom&&t.top===n.top&&t.depth===n.depth}function n0(t,n,e){if(t.scene.mode!==_.SceneMode.SCENE3D)return;const i=t.canvas.clientHeight,o=t.canvas.clientWidth,r=t.camera.viewMatrix,a=t.camera.frustum.projectionMatrix,s=_.Matrix4.multiply(a,r,JE),l=_.Matrix4.multiplyByVector(s,_.Cartesian4.fromElements(n.x,n.y,n.z,1,e0),e0);l.x/=l.w,l.y/=l.w,l.z/=l.w,l.w=1;const u=o*(l.x*.5+.5),A=i*(l.y*.5+.5),h=o-u,f=i-A,d=l.z;if(!(u<0||A<0||h<0||f<0||d<0||d>1))return e?(e.left=u,e.top=f,e.right=h,e.bottom=A,e.depth=d):e={left:u,top:f,right:h,bottom:A,depth:d},e}const mo={left:0,top:0,right:0,bottom:0,depth:0};class Ch extends c.Destroyable{constructor(e,i=!0,o){super();L(this,"_cartesian",new _.Cartesian3);L(this,"_winPos",{left:0,top:0,right:0,bottom:0,depth:0});L(this,"_winPosValid",!1);L(this,"_changedEvent",new c.Event);L(this,"_enabled",!0);this._viewer=e,o=o||this.disposeVar(new xh(this._viewer.scene)),this.dispose(o.changed.disposableOn(()=>this._updateWinPos())),this.dispose(()=>{this._changedEvent.empty||console.warn("WinPosFromCartesian需要销毁,但是changed事件仍有监听,代码未必有错,但是说明代码不严谨。")}),this.enabled=i}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 i=n0(this._viewer,this._cartesian,mo);!!i!==this._winPosValid&&(e=!0,this._winPosValid=!!i),this._winPosValid?t0(this._winPos,mo)||(e=!0,this._winPos.left=mo.left,this._winPos.top=mo.top,this._winPos.right=mo.right,this._winPos.bottom=mo.bottom,this._winPos.depth=mo.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){_.Cartesian3.equals(this._cartesian,e)||(_.Cartesian3.clone(e,this._cartesian),this._updateWinPos())}get changed(){return this._changedEvent}get winPosValid(){return this._winPosValid}get winPos(){return this._winPos}}function i0(t){const n=_.Math.toRadians(t[0]),e=_.Math.toRadians(t[1]),i=_.Math.toRadians(t[2]),o=_.Matrix3.fromHeadingPitchRoll(new _.HeadingPitchRoll(n,e,i)),r=new _.Cartesian3;return _.Matrix3.multiplyByVector(o,_.Cartesian3.UNIT_X,r),[r.x,r.y,r.z]}const t2=_.Check,go=_.defined,r0=_.Math.EPSILON10;function n2(t,n,e,i){if(t2.defined("equalsEpsilon",n),!go(t))return;e=e??!1;const o=go(i),r=t.length;if(r<2)return t;let a,s=t[0],l,u,A=0,h=-1;for(a=1;a<r;++a)l=t[a],n(s,l,r0)?(go(u)||(u=t.slice(0,a),A=a-1,h=0),o&&i.push(a)):(go(u)&&(u.push(l),A=a,o&&(h=i.length)),s=l);return e&&n(t[0],t[r-1],r0)&&(o&&(go(u)?i.splice(h,0,A):i.push(r-1)),go(u)?u.length-=1:u=t.slice(0,-1)),go(u)?u:t}const Ne=_.Cartesian3,vs=_.Cartographic,yo=_.defined,o0=_.DeveloperError,s0=_.Ellipsoid,i2=_.EllipsoidGeodesic,a0=_.EllipsoidRhumbLine,r2=_.IntersectionTests,Ap=_.Math,ws=_.Matrix4,vo=_.Plane,Ft={};Ft.numberOfPoints=function(t,n,e){const i=Ne.distance(t,n);return Math.ceil(i/e)},Ft.numberOfPointsRhumbLine=function(t,n,e){const i=Math.pow(t.longitude-n.longitude,2)+Math.pow(t.latitude-n.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(e*e))))};const o2=new vs;Ft.extractHeights=function(t,n){const e=t.length,i=new Array(e);for(let o=0;o<e;o++){const r=t[o];i[o]=n.cartesianToCartographic(r,o2).height}return i};const s2=new ws,a2=new Ne,l0=new Ne,l2=new vo(Ne.UNIT_X,0),u0=new Ne,u2=new vo(Ne.UNIT_X,0),c2=new Ne,h2=new Ne,fp=[];function c0(t,n,e){const i=fp;i.length=t;let o;if(n===e){for(o=0;o<t;o++)i[o]=n;return i}const a=(e-n)/t;for(o=0;o<t;o++){const s=n+o*a;i[o]=s}return i}const Sh=new vs,Eh=new vs,br=new Ne,pp=new Ne,A2=new Ne,dp=new i2;let el=new a0;function f2(t,n,e,i,o,r,a,s){const l=i.scaleToGeodeticSurface(t,pp),u=i.scaleToGeodeticSurface(n,A2),A=Ft.numberOfPoints(t,n,e),h=i.cartesianToCartographic(l,Sh),f=i.cartesianToCartographic(u,Eh),d=c0(A,o,r);dp.setEndPoints(h,f);const p=dp.surfaceDistance/A;let g=s;h.height=o;let v=i.cartographicToCartesian(h,br);Ne.pack(v,a,g),g+=3;for(let y=1;y<A;y++){const m=dp.interpolateUsingSurfaceDistance(y*p,Eh);m.height=d[y],v=i.cartographicToCartesian(m,br),Ne.pack(v,a,g),g+=3}return g}function p2(t,n,e,i,o,r,a,s){const l=i.cartesianToCartographic(t,Sh),u=i.cartesianToCartographic(n,Eh),A=Ft.numberOfPointsRhumbLine(l,u,e);l.height=0,u.height=0;const h=c0(A,o,r);el.ellipsoid.equals(i)||(el=new a0(void 0,void 0,i)),el.setEndPoints(l,u);const f=el.surfaceDistance/A;let d=s;l.height=o;let p=i.cartographicToCartesian(l,br);Ne.pack(p,a,d),d+=3;for(let g=1;g<A;g++){const v=el.interpolateUsingSurfaceDistance(g*f,Eh);v.height=h[g],p=i.cartographicToCartesian(v,br),Ne.pack(p,a,d),d+=3}return d}Ft.wrapLongitude=function(t,n){const e=[],i=[];if(yo(t)&&t.length>0){n=n??ws.IDENTITY;const o=ws.inverseTransformation(n,s2),r=ws.multiplyByPoint(o,Ne.ZERO,a2),a=Ne.normalize(ws.multiplyByPointAsVector(o,Ne.UNIT_Y,l0),l0),s=vo.fromPointNormal(r,a,l2),l=Ne.normalize(ws.multiplyByPointAsVector(o,Ne.UNIT_X,u0),u0),u=vo.fromPointNormal(r,l,u2);let A=1;e.push(Ne.clone(t[0]));let h=e[0];const f=t.length;for(let d=1;d<f;++d){const p=t[d];if(vo.getPointDistance(u,h)<0||vo.getPointDistance(u,p)<0){const g=r2.lineSegmentPlane(h,p,s,c2);if(yo(g)){const v=Ne.multiplyByScalar(a,5e-9,h2);vo.getPointDistance(s,h)<0&&Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),i.push(A+1),Ne.negate(v,v),e.push(Ne.add(g,v,new Ne)),A=1}}e.push(Ne.clone(t[d])),A++,h=p}i.push(A)}return{positions:e,lengths:i}},Ft.generateArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new o0("options.positions is required.");const e=n.length,i=t.ellipsoid??s0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const g=i.scaleToGeodeticSurface(n[0],pp);if(o=r?o[0]:o,o!==0){const v=i.geodeticSurfaceNormal(g,br);Ne.multiplyByScalar(v,o,v),Ne.add(g,v,g)}return[g.x,g.y,g.z]}let a=t.minDistance;if(!yo(a)){const g=t.granularity??Ap.RADIANS_PER_DEGREE;a=Ap.chordLength(g,i.maximumRadius)}let s=0,l;for(l=0;l<e-1;l++)s+=Ft.numberOfPoints(n[l],n[l+1],a);const u=(s+1)*3,A=new Array(u);let h=0;for(l=0;l<e-1;l++){const g=n[l],v=n[l+1],y=r?o[l]:o,m=r?o[l+1]:o;h=f2(g,v,a,i,y,m,A,h)}fp.length=0;const f=n[e-1],d=i.cartesianToCartographic(f,Sh);d.height=r?o[e-1]:o;const p=i.cartographicToCartesian(d,br);return Ne.pack(p,A,u-3),A};const h0=new vs,d2=new vs;Ft.generateRhumbArc=function(t){yo(t)||(t={});const n=t.positions;if(!yo(n))throw new o0("options.positions is required.");const e=n.length,i=t.ellipsoid??s0.WGS84;let o=t.height??0;const r=Array.isArray(o);if(e<1)return[];if(e===1){const y=i.scaleToGeodeticSurface(n[0],pp);if(o=r?o[0]:o,o!==0){const m=i.geodeticSurfaceNormal(y,br);Ne.multiplyByScalar(m,o,m),Ne.add(y,m,y)}return[y.x,y.y,y.z]}const a=t.granularity??Ap.RADIANS_PER_DEGREE;let s=0,l,u=i.cartesianToCartographic(n[0],h0),A;for(l=0;l<e-1;l++)A=i.cartesianToCartographic(n[l+1],d2),s+=Ft.numberOfPointsRhumbLine(u,A,a),u=vs.clone(A,h0);const h=(s+1)*3,f=new Array(h);let d=0;for(l=0;l<e-1;l++){const y=n[l],m=n[l+1],b=r?o[l]:o,x=r?o[l+1]:o;d=p2(y,m,a,i,b,x,f,d)}fp.length=0;const p=n[e-1],g=i.cartesianToCartographic(p,Sh);g.height=r?o[e-1]:o;const v=i.cartographicToCartesian(g,br);return Ne.pack(v,f,h-3),f},Ft.generateCartesianArc=function(t){const n=Ft.generateArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i},Ft.generateCartesianRhumbArc=function(t){const n=Ft.generateRhumbArc(t),e=n.length/3,i=new Array(e);for(let o=0;o<e;o++)i[o]=Ne.unpack(n,o*3);return i};const Ph=_.ArcType,m2=_.Cartesian3,g2=_.Math;function A0(t){const n=t.arcType,e=t.granularity,i=t.ellipsoid,o=[];let r=n2(t.positions,m2.equalsEpsilon,!1,o);if(!(r.length<2)){if(n===Ph.GEODESIC||n===Ph.RHUMB){let s;n===Ph.GEODESIC?(s=g2.chordLength(e,i.maximumRadius),Ft.numberOfPoints):(s=e,Ft.numberOfPointsRhumbLine);const l=Ft.extractHeights(r,i);n===Ph.GEODESIC?r=Ft.generateCartesianArc({positions:r,minDistance:s,ellipsoid:i,height:l}):r=Ft.generateCartesianRhumbArc({positions:r,granularity:s,ellipsoid:i,height:l})}return r}}function mp(t,n="GEODESIC",e){const o=t.map(c.lbhToXyz).map(h=>_.Cartesian3.fromArray(h));let r;if(e>0&&n!=="NONE"){if(r=A0({arcType:_.ArcType[n??"GEODESIC"],granularity:e,ellipsoid:_.Ellipsoid.WGS84,positions:o}),!r)return}else r=o;let a=0;const s=[0],l=r.length;for(let h=1;h<l;++h)a+=_.Cartesian3.distance(r[h-1],r[h]),s.push(a);const u=r.map(h=>c.xyzToLbh([h.x,h.y,h.z]));return{timePosRots:s.map((h,f)=>[s[f],u[f],void 0]),distances:s}}function f0(t,n){n=n??new Array(16);for(let e=0;e<16;++e)n[e]=t[e];return n}function gp(t,n){const e=_.Matrix4.clone(_.Matrix4.IDENTITY),{position:i,rotation:o,scale:r,initialRotationMode:a="YForwardZUp"}=t;if(i){const[s,l,u]=i;_.Transforms.eastNorthUpToFixedFrame(_.Cartesian3.fromDegrees(s,l,u),void 0,e)}if(o){const s=new _.Quaternion;a==="YForwardZUp"?bh(o,s):a==="XForwardZUp"&&Gv(o,s);const l=_.Matrix3.fromQuaternion(s);_.Matrix4.multiply(e,_.Matrix4.fromRotationTranslation(l),e)}return r&&_.Matrix4.multiplyByScale(e,oi(r),e),f0(e,n)}const y2=new _.Matrix4;function p0(t,n){const e=_.Matrix4.fromArray(t,0,y2);return _.Matrix4.inverse(e,e),f0(e,n)}const v2=new _.Matrix4,w2=new _.Cartesian3;function d0(t,n,e){const[i,o,r]=n,a=_.Cartesian3.fromDegrees(i,o,r,void 0,w2),s=_.Matrix4.fromArray(t,0,v2),l=_.Matrix4.multiplyByPoint(s,a,a),{x:u,y:A,z:h}=l;return e=e||[0,0,0],e[0]=u,e[1]=A,e[2]=h,e}const b2=new _.Matrix4,x2=new _.Cartesian3,_2=new _.Cartographic;function xr(t,n,e){const[i,o,r]=n,a=_.Cartesian3.fromElements(i,o,r,x2),s=_.Matrix4.fromArray(t,0,b2),l=_.Matrix4.multiplyByPoint(s,a,a),u=_.Cartographic.fromCartesian(l,void 0,_2);return e=e||[0,0,0],e[0]=_.Math.toDegrees(u.longitude),e[1]=_.Math.toDegrees(u.latitude),e[2]=u.height,e}function vn(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=gp({position:e,rotation:i,scale:o,initialRotationMode:r}),s=p0(a);return[n.map(u=>d0(s,u)),a,s]}function _r(t,n){const{originPosition:e,originRotation:i,originScale:o,initialRotationMode:r}=t,a=gp({position:e,rotation:i,scale:o,initialRotationMode:r});return[n.map(l=>xr(a,l)),a]}function m0(t){if(t.length<2)return console.error("getIncludedAngleFromPositions需要传入的点不能少于三个!!!!!"),!1;let n=[];for(let e=0;e<t.length-2;e++){const i=Xe.Cartesian3.fromDegrees(...t[e]),o=Xe.Cartesian3.fromDegrees(...t[e+1]),r=Xe.Cartesian3.fromDegrees(...t[e+2]),a=Xe.Cartesian3.angleBetween(Xe.Cartesian3.subtract(i,o,new Xe.Cartesian3),Xe.Cartesian3.subtract(r,o,new Xe.Cartesian3));n.push(isNaN(a)?0:Xe.Math.toDegrees(a))}return n}function yp(t,n){let e=n||[];return t.positions&&(e[e.length]??(e[e.length]=[]),e[e.length-1].push(...t.positions.map(i=>Ue(i)))),t.holes&&t.holes.forEach(i=>{e=yp(i,e)}),e}function Mn(t){return typeof t=="string"?c.ESSceneObject.context.getStrFromEnv(t):new _.Resource({url:c.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 vp extends c.Destroyable{constructor(n,e,i,o){if(super(),!n.viewer)return;const{scene:r}=n.viewer,[a,s,l]=c.getReactFuncs(e),[u,A,h]=c.getReactFuncs(i),f=new _.Cartesian3,d=()=>{let p=a();p&&(p=[...p],n.editingHeightOffset&&(p[2]-=n.editingHeightOffset),_.Cartesian3.fromDegrees(...p,void 0,f))};d(),this.dispose(l.disposableOn(d)),this.dispose(r.preUpdate.addEventListener(()=>{if(_.Cartesian3.ZERO.equals(f))return;const p=Ni(r,f,o);p!==void 0?A([p,p,p]):console.warn(`CzmGeoCoordinatesEditor warn: scale: ${p??"undefined"}`)}))}}function C2(t){const n=Reflect.has(t.root,"transform")?t.root.transform:_.Matrix4.toArray(_.Matrix4.IDENTITY);let e,i,o,r;if(Reflect.has(t.root.boundingVolume,"region"))return t.root.boundingVolume.region;if(Reflect.has(t.root.boundingVolume,"box"))r=_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(0,3)),e=_.Cartesian3.add(r,_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(3,6)),new _.Cartesian3),i=_.Cartesian3.add(r,_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(6,9)),new _.Cartesian3),o=_.Cartesian3.add(r,_.Cartesian3.fromArray(t.root.boundingVolume.box.slice(9,12)),new _.Cartesian3);else if(Reflect.has(t.root.boundingVolume,"sphere")){const f=t.root.boundingVolume.sphere[3];r=_.Cartesian3.fromArray(t.root.boundingVolume.sphere.slice(0,3)),e=_.Cartesian3.add(r,_.Cartesian3.fromArray([f,0,0]),new _.Cartesian3),i=_.Cartesian3.add(r,_.Cartesian3.fromArray([0,f,0]),new _.Cartesian3),o=_.Cartesian3.add(r,_.Cartesian3.fromArray([0,0,f]),new _.Cartesian3)}if(!e||!i||!o||!r)return"无法生成包围盒,请检查包围盒是否正确";let a,s,l,u,A,h;return _.Matrix4.IDENTITY.equals(_.Matrix4.fromArray(n))?(a=Ue(e),u=Ue(_.Cartesian3.add(r,_.Cartesian3.subtract(r,e,new _.Cartesian3),new _.Cartesian3)),s=Ue(i),A=Ue(_.Cartesian3.add(r,_.Cartesian3.subtract(r,i,new _.Cartesian3),new _.Cartesian3)),l=Ue(o),h=Ue(_.Cartesian3.add(r,_.Cartesian3.subtract(r,o,new _.Cartesian3),new _.Cartesian3))):(a=xr(n,[e.x,e.y,e.z]),u=xr(n,[-e.x,-e.y,-e.z]),s=xr(n,[i.x,i.y,i.z]),A=xr(n,[-i.x,-i.y,-i.z]),l=xr(n,[o.x,o.y,o.z]),h=xr(n,[-o.x,-o.y,-o.z])),!a||!u||!s||!A||!l||!h?"无法生成包围盒,请检查包围盒是否正确":[_.Math.toRadians(Math.min(a[0],u[0],s[0],A[0],l[0],h[0])),_.Math.toRadians(Math.min(a[1],u[1],s[1],A[1],l[1],h[1])),_.Math.toRadians(Math.max(a[0],u[0],s[0],A[0],l[0],h[0])),_.Math.toRadians(Math.max(a[1],u[1],s[1],A[1],l[1],h[1])),Math.min(a[2],u[2],s[2],A[2],l[2],h[2]),Math.max(a[2],u[2],s[2],A[2],l[2],h[2])]}const g0=c.createProcessingFromAsyncFunc(async(t,n)=>{let e={state:"success",tilesUrl:{asset:{version:"1.1"},geometricError:0,refine:"REPLACE",root:{boundingVolume:{region:[]},geometricError:0,refine:"REPLACE",children:[]}}},i={},o=[];if(await c.step(t,async l=>new Promise(async(u,A)=>{for(let h=0;h<n.length;h++){const f=n[h];await fetch(f).then(d=>d.json()).then(d=>{d&&!Reflect.has(d,"success")?i[f]=d:o.push({index:h,url:f,message:d.message}),h==n.length-1&&u()}).catch(d=>{o.push({index:h,url:f,message:d}),h==n.length-1&&u()})}})),o.length>0&&(e.state="error",e.info=o,o.length==n.length))return e.tilesUrl=void 0,e;const r=[],a=[],s=[];for(const l in i){const u=i[l];a.push(u.geometricError??u.root.geometricError??0);const A=C2(u);r.push(A),s.push({content:{uri:l},boundingVolume:{region:A},geometricError:u.geometricError,refine:"REPLACE"})}return e.tilesUrl&&(e.tilesUrl.geometricError=e.tilesUrl.root.geometricError=Math.max(...a),e.tilesUrl.root.boundingVolume.region=[Math.min(...r.map(l=>l[0])),Math.min(...r.map(l=>l[1])),Math.max(...r.map(l=>l[2])),Math.max(...r.map(l=>l[3])),Math.min(...r.map(l=>l[4])),Math.max(...r.map(l=>l[5]))],e.tilesUrl.root.children=s),e});function S2(t){return new Promise((n,e)=>{g0.restart(void 0,t),g0.completeEvent.don(i=>{n(i)})})}class wp extends c.Destroyable{constructor(e){super();L(this,"_center",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_radius",this.disposeVar(c.react(0)));const[i,o,r]=c.getReactFuncs(e);{const a=()=>{const s=i();if(s){const{center:l,minPos:u,maxPos:A}=c.getMinMaxCorner(s);this._center.value=l,this._radius.value=c.geoDistance(u,A)/2}else this._center.value=void 0};a(),this.dispose(r.disposableOn(a))}}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 y0(t){return new _.Material({fabric:{type:"XbsjWater",uniforms:{baseWaterImage:"",repeatX:1,repeatY:1,flowSpeed:0,baseWaterColor:new _.Color(.2,.3,.6,1),blendColor:new _.Color(0,1,.699,1),specularMap:_.Material.DefaultImageId,normalMap:_.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;
@@ -263,7 +263,7 @@ ${L0}
263
263
  ${this.text??"请输入内容"}
264
264
  </div>
265
265
  </div>
266
- </div>`;A?o.innerHTML=h:o.innerHTML=f},s=u=>{const A=this.showIcon??!0;if(A){const h=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-icon")[0];h&&(h.onclick=()=>{(this.editing??!1)||(this.showIcon=!A)})}else{const h=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-infos")[0];h&&(h.onclick=()=>{(this.editing??!1)||(this.showIcon=!A)})}};this.dispose(o.innerHtmlMounted.disposableOn(u=>{u&&s(u)})),a();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged,this.textChanged,this.showIconChanged,this.sizeChanged));this.dispose(l.disposableOn(a)),this.dispose(r.changed.disposableOn(a))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}L(So,"defaults",{text:"请输入内容"}),(t=>{t.createDefaultProps=()=>({...c.ESSceneObject.createDefaultProps(),show:!0,position:c.reactArrayWithUndefined(void 0),text:void 0,editing:!1,showIcon:!0,size:[50,50],originRatioAndOffset:c.reactArray([.5,1,0,0]),uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",zOrder:0})})(So||(So={})),c.extendClassProps(So.prototype,So.createDefaultProps);function Rh(t){return`rgba(${t[0]*255|0}, ${t[1]*255|0}, ${t[2]*255|0}, ${t[3]})`}class WP extends c.Destroyable{constructor(n,e,i){super();const o=()=>e.radius=n.radius??6;o(),this.dispose(n.radiusChanged.disposableOn(o));const r=()=>e.text=n.text;r(),this.dispose(n.textChanged.disposableOn(r));const a=()=>e.font=n.font;a(),this.dispose(n.fontChanged.disposableOn(a));const s=()=>e.fontStyle=n.fontColor&&Rh(n.fontColor);s(),this.dispose(n.fontColorChanged.disposableOn(s));const l=()=>e.fillStyle=n.color&&Rh(n.color);l(),this.dispose(n.colorChanged.disposableOn(l));const u=()=>e.outlineStyle=n.outlineColor&&Rh(n.outlineColor);u(),this.dispose(n.outlineColorChanged.disposableOn(u));const A=()=>e.selectedStyle=n.selectedColor&&Rh(n.selectedColor);A(),this.dispose(n.selectedColorChanged.disposableOn(A)),this.dispose(e.clickEvent.disposableOn((h,f,d,p,g)=>{n.clickEvent.emit(g)})),this.dispose(e.dbclickEvent.disposableOn((h,f,d,p,g)=>{n.dbclickEvent.emit(g)})),this.dispose(c.bind([e,"selected"],[n,"selected"])),this.dispose(c.bind([e,"hovered"],[n,"hovered"]))}}function Es(t,n,e,i,o){t.beginPath(),t.moveTo(n+i,e),t.arc(n,e,i,0,2*Math.PI),t.fillStyle=o,t.fill()}function jP(t,n,e,i,o,r){t.font=o;const a=t.measureText(i),s=a.actualBoundingBoxLeft+a.actualBoundingBoxRight,l=Number.isFinite(a.fontBoundingBoxAscent)?a.fontBoundingBoxAscent:a.actualBoundingBoxAscent,u=Number.isFinite(a.fontBoundingBoxDescent)?a.fontBoundingBoxDescent:a.actualBoundingBoxDescent;let A=l+u;t.fillStyle=r,t.fillText(i,n-s*.5,e+A*.5-u)}const z0=6;class qP extends c.CanvasPoi{constructor(e){super(e);L(this,"_scale",c.react(1));L(this,"_text",c.react(void 0));L(this,"_font",c.react(void 0));L(this,"_fontStyle",c.react(void 0));L(this,"_radius",c.react(void 0));L(this,"_outlineStyle",c.react(void 0));L(this,"_selectedStyle",c.react(void 0));L(this,"_fillStyle",c.react(void 0));const i=this.disposeVar(new c.Transition(100)),o=this.disposeVar(new c.Transition(100)),r=()=>{this._clickEvent&&!this._clickEvent.empty&&(this._scale.value=(1+.1*o.current)*(1+.2*i.current))};this.dispose(o.currentChanged.disposableOn(r)),this.dispose(i.currentChanged.disposableOn(r)),this.dispose(this.activedChanged.disposableOn(a=>{o.target=a?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(a=>{i.target=a?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(a=>{this.needRedraw()})),this.dispose(this._scale.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._text.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._font.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._fontStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._radius.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._fillStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._outlineStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._selectedStyle.changed.disposableOn(()=>this.needRedraw()))}get scale(){return this._scale.value}set scale(e){this._scale.value=e}get scaleChanged(){return this._scale.changed}get text(){return this._text.value}set text(e){this._text.value=e}get textChanged(){return this._text.changed}get font(){return this._font.value}set font(e){this._font.value=e}get fontChanged(){return this._font.changed}get fontStyle(){return this._fontStyle.value}set fontStyle(e){this._fontStyle.value=e}get fontStyleChanged(){return this._fontStyle.changed}get radius(){return this._radius.value}set radius(e){this._radius.value=e}get radiusChanged(){return this._radius.changed}get outlineStyle(){return this._outlineStyle.value}set outlineStyle(e){this._outlineStyle.value=e}get outlineStyleChanged(){return this._outlineStyle.changed}get selectedStyle(){return this._selectedStyle.value}set selectedStyle(e){this._selectedStyle.value=e}get selectedStyleChanged(){return this._selectedStyle.changed}get fillStyle(){return this._fillStyle.value}set fillStyle(e){this._fillStyle.value=e}get fillStyleChanged(){return this._fillStyle.changed}draw(e){if(!this._show)return;const[i,o]=this._winPos,r=e.globalAlpha;e.globalAlpha=this.opacity;const a=(this._radius.value??z0)*this._scale.value;if(this.selected&&Es(e,i,o,a+3,this._selectedStyle.value??"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Es(e,i,o,a+1,this._fillStyle.value??"#FFF"),this._outlineStyle.value&&(this.hovered?Es(e,i,o,a+1,this._outlineStyle.value):Es(e,i,o,a+1,this._outlineStyle.value)),Es(e,i,o,a,this._fillStyle.value??"#FFF"),this._text.value){const s=this._font.value??"bold 10px Arial",l=this._fontStyle.value??"#000";jP(e,i,o,this._text.value,s,l)}e.globalAlpha=r}drawForPick(e,i){if(!this._show)return;const[o,r]=this._winPos,a=(this._radius.value??z0)*this._scale.value,s=i("default");Es(e,o,r,a,s)}}class Er extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));L(this,"_geoCanvasPoi");this._geoCanvasPoi=this.disposeVar(new Wi(e,i));const{geoCanvasPoi:o}=this;o.canvasPoiClassAndCreateFunc=[qP,(r,a)=>new WP(this,r,a)],this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([o,"enabled"],[this,"enabled"])),this.dispose(c.bind([o,"position"],[this,"position"])),this.dispose(c.bind([o,"positionEditing"],[this,"positionEditing"])),this.dispose(c.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(c.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(this._clickEvent.disposableOn(r=>{this.pickOnClick&&this.pickedEvent.emit(new c.ESJPickedResult({type:"viewerPicking",pointerEvent:r}))}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get geoCanvasPoi(){return this._geoCanvasPoi}}L(Er,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,radius:6,text:"",font:"bold 10px Arial",fontColor:c.reactArray([1,1,1,1]),color:c.reactArray([1,1,1,1]),outlineColor:c.reactArray([0,0,0,1]),selectedColor:c.reactArray([0,0,0,1]),hovered:!1,selected:!1,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,pickOnClick:!1})})(Er||(Er={})),c.extendClassProps(Er.prototype,Er.createDefaultProps);class Ps extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o)return;const r=this.disposeVar(si([this,"material"])),a=(p,g)=>{const v=new _.PolylineMaterialAppearance({material:g,renderState:{depthTest:{enabled:this.depthTest??!1}}});v.renderState.depthMask=!1;const y=[];if(p.length<2)return;this.arcType==="NONE"&&console.warn("贴地折线不能使用NONE模式,如果客户设定为此模式,则强制使用GEODESIC模式来处理!");const m=this.arcType!=="RHUMB"?"GEODESIC":"RHUMB";y.push(new _.GeometryInstance({geometry:new _.GroundPolylineGeometry({positions:p,width:this.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:_.ArcType[m]}),id:this}));const b=new _.GroundPolylinePrimitive({geometryInstances:y,appearance:v,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return _.GroundPolylinePrimitive.prototype&&(b.ESSceneObjectID=i),b};let s;const l=new _.BoundingSphere,u=()=>{s&&(o.scene.primitives.remove(s),s=void 0)};this.dispose(u);const A=()=>{if(u(),!(this.show??!0)||!this.positions)return;const p=$t(this.positions);if(p.length<2||!r.value){l.radius=-1;return}_.BoundingSphere.fromPoints(p,l),s=a(p,r.value),s&&o.scene.primitives.add(s)},h=()=>{s&&(s.show=this.show??!0)};A(),h();const f=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{A(),h()}));const d=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(p=>{if(e.actived&&(f.flush(),d.flush(),l.radius>0)){const g=Ue(l.center);g&&Fe(o,g,l.radius*4,void 0,p)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,material:c.reactJson({type:"Color"}),depthTest:void 0})})(Ps||(Ps={})),c.extendClassProps(Ps.prototype,Ps.createDefaultProps);class Bs extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o)return;const r=this.disposeVar(si([this,"material"])),a=(p,g)=>{const v=new _.PolylineMaterialAppearance({material:g,renderState:{depthTest:{enabled:this.depthTest??!1}}});v.renderState.depthMask=!1;const y=[];if(p.length<2)return;y.push(new _.GeometryInstance({geometry:new _.PolylineGeometry({positions:p,width:this.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:this.arcType&&_.ArcType[this.arcType]}),id:this}));const m=new _.Primitive({geometryInstances:y,appearance:v,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return _.Primitive.prototype&&(m.ESSceneObjectID=i),m};let s;const l=new _.BoundingSphere,u=()=>{s&&(o.scene.primitives.remove(s),s=void 0)};this.dispose(u);const A=()=>{if(u(),!this.positions)return;const p=$t(this.positions);if(p.length<2||!r.value){l.radius=-1;return}_.BoundingSphere.fromPoints(p,l),s=a(p,r.value),s&&o.scene.primitives.add(s)},h=()=>{s&&(s.show=this.show??!0)};A(),h();const f=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{A(),h()}));const d=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(p=>{if(e.actived&&(d.flush(),f.flush(),l.radius>0)){const g=Ue(l.center);g&&Fe(o,g,l.radius*4,void 0,p)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,material:c.reactJson({type:"Color"}),depthTest:void 0})})(Bs||(Bs={})),c.extendClassProps(Bs.prototype,Bs.createDefaultProps);class Ye extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_polylineOrGroundPolylineResetting");L(this,"_czmViewVisibleDistanceRangeControl");L(this,"_id",this.disposeVar(c.react(c.createGuid())));L(this,"_positionsCenter");i&&(this.id=i),this._positionsCenter=this.ad(new wp(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new fo(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(c.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._polylineOrGroundPolylineResetting=this.disposeVar(new c.ObjResettingWithEvent(this.groundChanged,()=>this.ground?new ZP(e,this):new KP(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylineOrGroundPolylineResetting(){return this._polylineOrGroundPolylineResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(Ye,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),loop:!1,width:2,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,customArrow:!1,customArrowParams:c.reactJson({repeat:60,speed:.1,color:[1,1,1,1],image:"",lineLength:10}),arcType:"GEODESIC",depthTest:!1,zIndex:0,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Ye||(Ye={})),c.extendClassProps(Ye.prototype,Ye.createDefaultProps);class KP extends c.Destroyable{constructor(n,e){super();const i=this.disposeVar(new Bs(n,e.id));this.dispose(c.track([i,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([i,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(...V0(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const r=()=>{const{visibleAlpha:a}=e.czmViewVisibleDistanceRangeControl;i.show=e.show&&a>0,i.arcType=e.arcType,i.width=e.width,i.positions=Q0(e),i.material=k0(e)};r(),this.dispose(o.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flush(),e.viewDistanceRange||i.flyTo(r)}))}}class ZP extends c.Destroyable{constructor(n,e){super();const i=this.disposeVar(new Ps(n,e.id));this.dispose(c.track([i,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([i,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(...V0(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const r=()=>{const{visibleAlpha:a}=e.czmViewVisibleDistanceRangeControl;i.show=e.show&&a>0,i.arcType=e.arcType,i.width=e.width,i.positions=Q0(e),i.material=k0(e)};r(),this.dispose(o.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flush(),e.viewDistanceRange||i.flyTo(r)}))}}function k0(t){const n=t.color,e=t.gapColor;let i;return t.hasDash?i={type:"PolylineDash",color:n,gapColor:e,dashLength:t.dashLength,dashPattern:t.dashPattern}:t.customArrow?i={type:"XbsjPolylineArrow",...t.customArrowParams}:t.hasArrow?i={type:"PolylineArrow",color:n}:i={type:"Color",color:n},i}function Q0(t){return t.loop&&t.positions&&t.positions.length>=3?[...t.positions,t.positions[0]]:t.positions}function V0(t){return[t.showChanged,t.positionsChanged,t.loopChanged,t.widthChanged,t.colorChanged,t.hasDashChanged,t.gapColorChanged,t.dashLengthChanged,t.dashPatternChanged,t.hasArrowChanged,t.customArrowChanged,t.arcTypeChanged,t.depthTestChanged,t.customArrowParamsChanged]}function $P(t){if(t.type==="BoxEmitter"){const n=t.dimensions;return n?new _.BoxEmitter(ri(n)):void 0}else if(t.type==="CircleEmitter"){const n=t.radius;return new _.CircleEmitter(n)}else if(t.type==="ConeEmitter"){const n=t.angle;return new _.ConeEmitter(n)}else if(t.type==="SphereEmitter"){const n=t.radius;return new _.SphereEmitter(n)}}const ki=class ki extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_updateCallbackFunc",this.disposeVar(c.react(void 0)));L(this,"_disposeUpdateCallbackFunc",(()=>{this.dispose(this.updateCallbackFuncChanged.don(e=>{e?this.updateCallback=e.toString():this.updateCallback=void 0}))})());L(this,"_disposeUpdateCallback",(()=>{this.dispose(this.updateCallbackChanged.don(e=>{e?this.updateCallbackFunc=Function('"use strict";return ('+e+")")():this.updateCallbackFunc=void 0}))})());L(this,"_primitive");this._player=this.disposeVar(new c.Player);const o=e.viewer;if(o){{const r=ki.defaults;this.dispose(c.bind([this._player,"loop"],[this,"playingLoop"],a=>a??r.playingLoop,a=>a??r.playingLoop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],a=>a??r.currentTime,a=>a??r.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],a=>a??r.duration,a=>a??r.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],a=>a??r.playing,a=>a??r.playing)),this.dispose(c.bind([this._player,"speed"],[this,"playingSpeed"],a=>a??r.playingSpeed,a=>a??r.playingSpeed))}{const r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.dispose(r);const a=()=>{const y=this.position??[0,0,0];return _.Transforms.eastNorthUpToFixedFrame(_.Cartesian3.fromDegrees(y[0],y[1],y[2]))},s=()=>{const y=this.rotation??[0,0,0],m=this.translation??[0,0,0],b=_.HeadingPitchRoll.fromDegrees(y[0],y[1],y[2],new _.HeadingPitchRoll);let x=new _.TranslationRotationScale;return x.translation=_.Cartesian3.fromElements(m[0],m[1],m[2],new _.Cartesian3),x.rotation=_.Quaternion.fromHeadingPitchRoll(b,new _.Quaternion),_.Matrix4.fromTranslationRotationScale(x,new _.Matrix4)},l=()=>{if(!this.bursts)return;let y=[];return this.bursts.forEach(m=>{const b=new _.ParticleBurst({time:m[0],minimum:m[1],maximum:m[2]});y.push(b)}),y},u=()=>{const y=a(),m=s(),b=l(),x=$P(this.emitter??ki.defaults.emitter),E=new _.ParticleSystem({emitter:x,bursts:b,modelMatrix:y,emitterModelMatrix:m,updateCallback:this.updateCallbackFunc?(B,P)=>{this.updateCallbackFunc&&this.updateCallbackFunc(B,P)}:void 0,image:c.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:ki.defaults.image),imageSize:Ze(this.imageSize??ki.defaults.imageSize),minimumImageSize:this.minimumImageSize&&Ze(this.minimumImageSize),maximumImageSize:this.maximumImageSize&&Ze(this.maximumImageSize),show:this.show,emissionRate:this.emissionRate,loop:this.loop,scale:this.scale,startScale:this.startScale,endScale:this.endScale??ki.defaults.endScale,color:this.color&&Be(this.color),startColor:this.startColor&&Be(this.startColor),endColor:this.endColor&&Be(this.endColor),sizeInMeters:this.sizeInMeters,speed:this.speed,minimumSpeed:this.minimumSpeed,maximumSpeed:this.maximumSpeed,lifetime:this.lifetime,particleLife:this.particleLife??ki.defaults.particleLife,minimumParticleLife:this.minimumParticleLife,maximumParticleLife:this.maximumParticleLife,mass:this.mass,minimumMass:this.minimumMass,maximumMass:this.maximumMass});return _.ParticleSystem.prototype&&(E.ESSceneObjectID=i),E},A=()=>{r(),this._primitive=u(),this._primitive&&o.scene.primitives.add(this._primitive)},h=()=>{if(!this._primitive)return;const y=this.show??!0;this._primitive.show=y,this.image&&(this._primitive.image=c.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:ki.defaults.image))};A(),h();const f=this.disposeVar(c.createNextAnimateFrameEvent(this.emitterChanged,this.burstsChanged,this.emissionRateChanged,this.loopChanged,this.scaleChanged,this.startScaleChanged,this.endScaleChanged,this.colorChanged,this.startColorChanged,this.endColorChanged,this.imageSizeChanged,this.minimumImageSizeChanged,this.maximumImageSizeChanged,this.sizeInMetersChanged,this.speedChanged,this.minimumSpeedChanged,this.maximumSpeedChanged,this.lifetimeChanged,this.particleLifeChanged,this.minimumParticleLifeChanged,this.maximumParticleLifeChanged,this.massChanged,this.minimumMassChanged,this.maximumMassChanged,this.updateCallbackFuncChanged));this.dispose(f.disposableOn(()=>{A(),h()}));const d=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged,this.imageChanged));this.dispose(d.disposableOn(()=>{h()}));const p=()=>{if(!this._primitive)return;const y=a(),m=s();this._primitive.modelMatrix=y,this._primitive.emitterModelMatrix=m},g=this.disposeVar(c.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.translationChanged));this.dispose(g.disposableOn(p));const v=()=>{this._primitive&&(this._primitive.timeStamp=this.currentTime)};v(),this.dispose(this.currentTimeChanged.disposableOn(v)),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}const y=this.position[2]+100;Fe(o,this.position,y,void 0,1e3)}))}}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get updateCallbackFunc(){return this._updateCallbackFunc.value}set updateCallbackFunc(e){this._updateCallbackFunc.value=e}get updateCallbackFuncChanged(){return this._updateCallbackFunc.changed}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get primitive(){return this._primitive}};L(ki,"defaults",{playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0,ratio:0,particleLife:.5,endScale:4,imageSize:[20,20],image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",emitter:{type:"CircleEmitter",radius:.5}});let wi=ki;(t=>{t.createDefaultProps=()=>({emitter:c.reactJsonWithUndefined(void 0),bursts:c.reactArrayCollectionWithUndefined(void 0),position:c.reactArrayWithUndefined(void 0),translation:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),image:void 0,imageSize:void 0,minimumImageSize:void 0,maximumImageSize:void 0,show:void 0,updateCallback:void 0,emissionRate:void 0,loop:void 0,scale:void 0,startScale:void 0,endScale:void 0,color:c.reactArrayWithUndefined(void 0),startColor:c.reactArrayWithUndefined(void 0),endColor:c.reactArrayWithUndefined(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:void 0,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:void 0,currentTime:void 0,duration:void 0,playingSpeed:void 0,playing:void 0})})(wi||(wi={})),c.extendClassProps(wi.prototype,wi.createDefaultProps);class XP extends c.Destroyable{constructor(e,i){super();L(this,"_model");L(this,"_geoPoint");L(this,"_geoAxis");this._model=this.disposeVar(new Ht(i,e.id)),this._geoPoint=this.disposeVar(new Wn(i,e.id)),this._geoAxis=this.disposeVar(new Ye(i,e.id)),this._geoAxis.hasArrow=!0,this._geoAxis.width=10;{this._model.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._model.localRotation=[90,0,0],this._model.allowPicking=!1,this._model.pixelSize=30;{const o=()=>{e.position&&(this._model.position=jv(e.position,e.rotation??[0,0,0],e.viewDistance??0),this._model.rotation=e.rotation??[0,0,0])};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.viewDistanceChanged));this.dispose(r.disposableOn(o))}{const o=()=>{const a=i.getCameraInfo();if(!a)return;const s=a.position,l=this._model.position;if(!l)return;const u=_.Cartesian3.fromDegrees(l[0],l[1],l[2]),A=_.Cartesian3.fromDegrees(s[0],s[1],s[2]),h=_.Cartesian3.distanceSquared(u,A);this._model.show=h>1};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(i.cameraChanged,this._model.positionChanged));this.dispose(r.disposableOn(o))}}{this._geoAxis.width=6,this._geoAxis.color=[1,1,0,.7];{const o=()=>{e.position&&this.model.position&&(this._geoAxis.positions=[this.model.position,e.position])};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this._model.positionChanged));this.dispose(r.disposableOn(o))}}}get model(){return this._model}get geoPoint(){return this._geoPoint}get geoAxis(){return this._geoAxis}}const fr=class fr extends c.Destroyable{constructor(e,i){super();L(this,"_captureEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));this._czmViewer=e,i&&(this.id=i);const o=e.viewer;if(!o)return;this.disposeVar(new c.ObjResettingWithEvent(this.showChanged,()=>{if(this.show&&this.position)return new XP(this,e)})),this.default&&this.flyTo(void 0,!1);const r=this.disposeVar(c.createProcessingFromAsyncFunc(async s=>{const{position:l,rotation:u,viewDistance:A,duration:h=1e3}=this;if(l){const f=Fe(o,l,A,u,h,()=>{this.enabled=!1});f&&await s.promise(f),this.enabled=!1}}));this.dispose(this.enabledChanged.disposableOn(()=>{r.isRunning&&r.cancel(),this.enabled&&r.restart()}));const a=this.disposeVar(c.createProcessingFromAsyncFunc(async(s,l,u)=>{const A=e.capture(l,u);if(!A)return;const h=await s.promise(A);h&&(this.thumbnail=h)}));this.dispose(this.captureEvent.disposableOn((s,l)=>{a.restart(void 0,s??fr.defaults.thumbnailWidth,l??fr.defaults.thumbnailHeight)}))}get captureEvent(){return this._captureEvent}capture(e,i){this._captureEvent.emit(e,i)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}resetWithCurrentCamera(e){const{_czmViewer:i}=this;if(!i.actived)return;const{viewer:o}=this._czmViewer;if(!o)return;const r=this;e&fr.ResetFlag.Position&&(r.position=Fn(o.camera)),e&fr.ResetFlag.Rotation&&(r.rotation=ms(o.camera)),e&fr.ResetFlag.ViewDistance&&(r.viewDistance=0)}flyTo(e,i,o="default"){if((i??!0)&&!this._czmViewer.actived)return;const{_czmViewer:{viewer:r}}=this,{position:a,rotation:s,viewDistance:l,duration:u}=this;!r||!a||Fe(r,a,l,s,e??u,void 0,o)}};L(fr,"ResetFlag",{Position:1,Rotation:2,ViewDistance:4}),L(fr,"defaults",{thumbnailWidth:64,thumbnailHeight:64,enabled:!0,show:!1,position:[116.39,39.9,100],duration:1e3,default:!1,thumbnail:""});let bn=fr;(t=>{t.createDefaultProps=()=>({enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,show:!1,rotation:c.reactArray([0,0,0]),viewDistance:0,duration:void 0,default:!1,thumbnail:""})})(bn||(bn={})),c.extendClassProps(bn.prototype,bn.createDefaultProps);function N0(t,n){let e=[0,0];if(!t||!n)return e;const i=t.cloneNode(!0);i.style.position="absolute",i.style.top="0",i.style.zIndex="-1",document.body.appendChild(i);const o=i.querySelector(`.${n}-anchor`)??i.querySelector(`.${n}-iconBox`);if(o&&o.parentElement){const r=(o.parentElement.offsetTop+o.parentElement.offsetHeight-(["Flag01"].includes(n)?10:["P3D02","P3D04"].includes(n)?15:0))/i.offsetHeight;e=[(o.offsetLeft+o.width/2)/i.offsetWidth,r<1?r:1]}return document.body.removeChild(i),e}class Pr extends c.Destroyable{constructor(e,i,o,r,a=!0){super();L(this,"widgetInfo");L(this,"_czmGeoCustomDivPoi");L(this,"sceneObject");L(this,"domSize");L(this,"_defaultAnchor",this.disposeVar(c.react([0,0])));L(this,"flyTo",(e,i)=>{if(this.czmGeoCustomDivPoi.position){Fe(this._czmViewer.viewer,this.czmGeoCustomDivPoi.position,1e3,Hn,e);return}this.czmGeoCustomDivPoi.flyTo(e&&e*1e3)});L(this,"createInstanceClass",()=>{let e=this;return class extends c.Destroyable{constructor(o,r,a){if(super(),this._subContainer=o,!a||!(a instanceof ot))return;const s=e.widgetInfo;this._subContainer.appendChild(s),this.dispose(()=>{this._subContainer.removeChild(s)});{const l=()=>{s.style.pointerEvents=e.sceneObject.editing?"none":"all"};l(),this.d(e.sceneObject.editingChanged.don(l))}}}});this._sceneObject=e,this._czmViewer=i,this._widgetInfo=o,this._drawWidget=r,this._czmGeoCustomDivPoi=this.disposeVar(new wt(i,e.id));let s=this.sceneObject=this._sceneObject;this._czmViewer,this.widgetInfo=this._widgetInfo,s instanceof c.ESPoi2D&&(this.defaultAnchor=N0(this.widgetInfo,s.mode));const{czmGeoCustomDivPoi:l}=this;this.d(c.track([l,"zOrder"],[s,"zOrder"])),this.dispose(c.track([l,"show"],[s,"show"])),this.dispose(c.bind([l,"position"],[s,"position"])),s instanceof c.ESWidget&&this.dispose(c.track([l,"opacity"],[s,"opacity"]));{const u=this.dv(c.createNextAnimateFrameEvent(s.allowPickingChanged,s.editingChanged)),A=()=>{s.allowPicking&&!s.editing?l.allowPicking=!0:l.allowPicking=!1};A(),this.d(u.don(A))}if(this.d(l.pickedEvent.don(u=>{var f;const A=(f=_o(u,"pickResult"))==null?void 0:f.pointerEvent;if(!A)return;const h={type:A.buttons!=0&&A.button==0?"leftClick":A.button==2?"rightClick":void 0,add:{mousePos:[A.offsetX,A.offsetY]}};h.type==null&&(h.type=A.type),s.widgetEvent.emit(h)})),(()=>{try{r?l.instanceClass=this.createInstanceClass():l.instanceClass=void 0}catch(A){console.log(A)}})(),a){const u=()=>{const h=s.anchor,f=s.offset;h?l.originRatioAndOffset=[...h,-f[0],-f[1]]:l.originRatioAndOffset=[0,0,0,0]};u();const A=this.ad(c.createNextAnimateFrameEvent(s.anchorChanged,s.offsetChanged));this.dispose(A.disposableOn(u))}{const u=async()=>{let h,f;if((!this.domSize||this.domSize.width==0||this.domSize.height==0)&&(this.domSize=this.widgetInfo.getBoundingClientRect(),this.domSize.width==0||this.domSize.height==0)){const d=setTimeout(()=>{u(),clearTimeout(d)},200);return}s.sizeByContent?(h=this.domSize.width,f=this.domSize.height):(h=s.size[0],f=s.size[1]),this.widgetInfo.style.transform=`scale(${h/this.domSize.width*s.scale[1]},${f/this.domSize.height*s.scale[2]})`,this.widgetInfo.style.transformOrigin=`${s.anchor[0]*100}% ${s.anchor[1]*100}%`};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(s.sizeChanged,s.sizeByContentChanged,s.scaleChanged));this.dispose(A.disposableOn(u))}}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}get defaultAnchor(){return this._defaultAnchor.value}set defaultAnchor(e){this._defaultAnchor.value=e}get defaultAnchorChanged(){return this._defaultAnchor.changed}}/*!
266
+ </div>`;A?o.innerHTML=h:o.innerHTML=f},s=u=>{const A=this.showIcon??!0;if(A){const h=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-icon")[0];h&&(h.onclick=()=>{(this.editing??!1)||(this.showIcon=!A)})}else{const h=u.querySelectorAll("#xbsj-geoDivSwitchPoi-defaultpoi-infos")[0];h&&(h.onclick=()=>{(this.editing??!1)||(this.showIcon=!A)})}};this.dispose(o.innerHtmlMounted.disposableOn(u=>{u&&s(u)})),a();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged,this.textChanged,this.showIconChanged,this.sizeChanged));this.dispose(l.disposableOn(a)),this.dispose(r.changed.disposableOn(a))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}L(So,"defaults",{text:"请输入内容"}),(t=>{t.createDefaultProps=()=>({...c.ESSceneObject.createDefaultProps(),show:!0,position:c.reactArrayWithUndefined(void 0),text:void 0,editing:!1,showIcon:!0,size:[50,50],originRatioAndOffset:c.reactArray([.5,1,0,0]),uri:"${earthsdk3-assets-script-dir}/assets/img/location.png",zOrder:0})})(So||(So={})),c.extendClassProps(So.prototype,So.createDefaultProps);function Rh(t){return`rgba(${t[0]*255|0}, ${t[1]*255|0}, ${t[2]*255|0}, ${t[3]})`}class WP extends c.Destroyable{constructor(n,e,i){super();const o=()=>e.radius=n.radius??6;o(),this.dispose(n.radiusChanged.disposableOn(o));const r=()=>e.text=n.text;r(),this.dispose(n.textChanged.disposableOn(r));const a=()=>e.font=n.font;a(),this.dispose(n.fontChanged.disposableOn(a));const s=()=>e.fontStyle=n.fontColor&&Rh(n.fontColor);s(),this.dispose(n.fontColorChanged.disposableOn(s));const l=()=>e.fillStyle=n.color&&Rh(n.color);l(),this.dispose(n.colorChanged.disposableOn(l));const u=()=>e.outlineStyle=n.outlineColor&&Rh(n.outlineColor);u(),this.dispose(n.outlineColorChanged.disposableOn(u));const A=()=>e.selectedStyle=n.selectedColor&&Rh(n.selectedColor);A(),this.dispose(n.selectedColorChanged.disposableOn(A)),this.dispose(e.clickEvent.disposableOn((h,f,d,p,g)=>{n.clickEvent.emit(g)})),this.dispose(e.dbclickEvent.disposableOn((h,f,d,p,g)=>{n.dbclickEvent.emit(g)})),this.dispose(c.bind([e,"selected"],[n,"selected"])),this.dispose(c.bind([e,"hovered"],[n,"hovered"]))}}function Es(t,n,e,i,o){t.beginPath(),t.moveTo(n+i,e),t.arc(n,e,i,0,2*Math.PI),t.fillStyle=o,t.fill()}function jP(t,n,e,i,o,r){t.font=o;const a=t.measureText(i),s=a.actualBoundingBoxLeft+a.actualBoundingBoxRight,l=Number.isFinite(a.fontBoundingBoxAscent)?a.fontBoundingBoxAscent:a.actualBoundingBoxAscent,u=Number.isFinite(a.fontBoundingBoxDescent)?a.fontBoundingBoxDescent:a.actualBoundingBoxDescent;let A=l+u;t.fillStyle=r,t.fillText(i,n-s*.5,e+A*.5-u)}const z0=6;class qP extends c.CanvasPoi{constructor(e){super(e);L(this,"_scale",c.react(1));L(this,"_text",c.react(void 0));L(this,"_font",c.react(void 0));L(this,"_fontStyle",c.react(void 0));L(this,"_radius",c.react(void 0));L(this,"_outlineStyle",c.react(void 0));L(this,"_selectedStyle",c.react(void 0));L(this,"_fillStyle",c.react(void 0));const i=this.disposeVar(new c.Transition(100)),o=this.disposeVar(new c.Transition(100)),r=()=>{this._clickEvent&&!this._clickEvent.empty&&(this._scale.value=(1+.1*o.current)*(1+.2*i.current))};this.dispose(o.currentChanged.disposableOn(r)),this.dispose(i.currentChanged.disposableOn(r)),this.dispose(this.activedChanged.disposableOn(a=>{o.target=a?1:0,this.needRedraw()})),this.dispose(this.hoveredChanged.disposableOn(a=>{i.target=a?1:0,this.needRedraw()})),this.dispose(this.selectedChanged.disposableOn(a=>{this.needRedraw()})),this.dispose(this._scale.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._text.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._font.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._fontStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._radius.changed.disposableOn(()=>(this.needRedraw(),this.needPickRedraw()))),this.dispose(this._fillStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._outlineStyle.changed.disposableOn(()=>this.needRedraw())),this.dispose(this._selectedStyle.changed.disposableOn(()=>this.needRedraw()))}get scale(){return this._scale.value}set scale(e){this._scale.value=e}get scaleChanged(){return this._scale.changed}get text(){return this._text.value}set text(e){this._text.value=e}get textChanged(){return this._text.changed}get font(){return this._font.value}set font(e){this._font.value=e}get fontChanged(){return this._font.changed}get fontStyle(){return this._fontStyle.value}set fontStyle(e){this._fontStyle.value=e}get fontStyleChanged(){return this._fontStyle.changed}get radius(){return this._radius.value}set radius(e){this._radius.value=e}get radiusChanged(){return this._radius.changed}get outlineStyle(){return this._outlineStyle.value}set outlineStyle(e){this._outlineStyle.value=e}get outlineStyleChanged(){return this._outlineStyle.changed}get selectedStyle(){return this._selectedStyle.value}set selectedStyle(e){this._selectedStyle.value=e}get selectedStyleChanged(){return this._selectedStyle.changed}get fillStyle(){return this._fillStyle.value}set fillStyle(e){this._fillStyle.value=e}get fillStyleChanged(){return this._fillStyle.changed}draw(e){if(!this._show)return;const[i,o]=this._winPos,r=e.globalAlpha;e.globalAlpha=this.opacity;const a=(this._radius.value??z0)*this._scale.value;if(this.selected&&Es(e,i,o,a+3,this._selectedStyle.value??"#F00"),this.actived&&this._clickEvent&&!this._clickEvent.empty&&Es(e,i,o,a+1,this._fillStyle.value??"#FFF"),this._outlineStyle.value&&(this.hovered?Es(e,i,o,a+1,this._outlineStyle.value):Es(e,i,o,a+1,this._outlineStyle.value)),Es(e,i,o,a,this._fillStyle.value??"#FFF"),this._text.value){const s=this._font.value??"bold 10px Arial",l=this._fontStyle.value??"#000";jP(e,i,o,this._text.value,s,l)}e.globalAlpha=r}drawForPick(e,i){if(!this._show)return;const[o,r]=this._winPos,a=(this._radius.value??z0)*this._scale.value,s=i("default");Es(e,o,r,a,s)}}class Er extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_clickEvent",this.disposeVar(new c.Event));L(this,"_dbclickEvent",this.disposeVar(new c.Event));L(this,"_geoCanvasPoi");this._geoCanvasPoi=this.disposeVar(new Wi(e,i));const{geoCanvasPoi:o}=this;o.canvasPoiClassAndCreateFunc=[qP,(r,a)=>new WP(this,r,a)],this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([o,"enabled"],[this,"enabled"])),this.dispose(c.bind([o,"position"],[this,"position"])),this.dispose(c.bind([o,"positionEditing"],[this,"positionEditing"])),this.dispose(c.track([o,"viewDistanceRange"],[this,"viewDistanceRange"])),this.dispose(c.track([o,"viewDistanceDebug"],[this,"viewDistanceDebug"])),this.dispose(this.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(this._clickEvent.disposableOn(r=>{this.pickOnClick&&this.pickedEvent.emit(new c.ESJPickedResult({type:"viewerPicking",pointerEvent:r}))}))}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get clickEvent(){return this._clickEvent}get dbclickEvent(){return this._dbclickEvent}get geoCanvasPoi(){return this._geoCanvasPoi}}L(Er,"defaults",{viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,radius:6,text:"",font:"bold 10px Arial",fontColor:c.reactArray([1,1,1,1]),color:c.reactArray([1,1,1,1]),outlineColor:c.reactArray([0,0,0,1]),selectedColor:c.reactArray([0,0,0,1]),hovered:!1,selected:!1,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1,pickOnClick:!1})})(Er||(Er={})),c.extendClassProps(Er.prototype,Er.createDefaultProps);class Ps extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o)return;const r=this.disposeVar(si([this,"material"])),a=(p,g)=>{const v=new _.PolylineMaterialAppearance({material:g,renderState:{depthTest:{enabled:this.depthTest??!1}}});v.renderState.depthMask=!1;const y=[];if(p.length<2)return;this.arcType==="NONE"&&console.warn("贴地折线不能使用NONE模式,如果客户设定为此模式,则强制使用GEODESIC模式来处理!");const m=this.arcType!=="RHUMB"?"GEODESIC":"RHUMB";y.push(new _.GeometryInstance({geometry:new _.GroundPolylineGeometry({positions:p,width:this.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:_.ArcType[m]}),id:this}));const b=new _.GroundPolylinePrimitive({geometryInstances:y,appearance:v,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return _.GroundPolylinePrimitive.prototype&&(b.ESSceneObjectID=i),b};let s;const l=new _.BoundingSphere,u=()=>{s&&(o.scene.primitives.remove(s),s=void 0)};this.dispose(u);const A=()=>{if(u(),!(this.show??!0)||!this.positions)return;const p=$t(this.positions);if(p.length<2||!r.value){l.radius=-1;return}_.BoundingSphere.fromPoints(p,l),s=a(p,r.value),s&&o.scene.primitives.add(s)},h=()=>{s&&(s.show=this.show??!0)};A(),h();const f=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{A(),h()}));const d=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(p=>{if(e.actived&&(f.flush(),d.flush(),l.radius>0)){const g=Ue(l.center);g&&Fe(o,g,l.radius*4,void 0,p)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,material:c.reactJson({type:"Color"}),depthTest:void 0})})(Ps||(Ps={})),c.extendClassProps(Ps.prototype,Ps.createDefaultProps);class Bs extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o)return;const r=this.disposeVar(si([this,"material"])),a=(p,g)=>{const v=new _.PolylineMaterialAppearance({material:g,renderState:{depthTest:{enabled:this.depthTest??!1}}});v.renderState.depthMask=!1;const y=[];if(p.length<2)return;y.push(new _.GeometryInstance({geometry:new _.PolylineGeometry({positions:p,width:this.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:this.arcType&&_.ArcType[this.arcType]}),id:this}));const m=new _.Primitive({geometryInstances:y,appearance:v,asynchronous:!1,allowPicking:this.allowPicking,compressVertices:!1});return _.Primitive.prototype&&(m.ESSceneObjectID=i),m};let s;const l=new _.BoundingSphere,u=()=>{s&&(o.scene.primitives.remove(s),s=void 0)};this.dispose(u);const A=()=>{if(u(),!this.positions)return;const p=$t(this.positions);if(p.length<2||!r.value){l.radius=-1;return}_.BoundingSphere.fromPoints(p,l),s=a(p,r.value),s&&o.scene.primitives.add(s)},h=()=>{s&&(s.show=this.show??!0)};A(),h();const f=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,r.changed,this.arcTypeChanged,this.allowPickingChanged,this.depthTestChanged));this.dispose(f.disposableOn(()=>{A(),h()}));const d=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(d.disposableOn(()=>{h()})),this.dispose(this.flyToEvent.disposableOn(p=>{if(e.actived&&(d.flush(),f.flush(),l.radius>0)){const g=Ue(l.center);g&&Fe(o,g,l.radius*4,void 0,p)}}))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}}(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,material:c.reactJson({type:"Color"}),depthTest:void 0})})(Bs||(Bs={})),c.extendClassProps(Bs.prototype,Bs.createDefaultProps);class Ye extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_polylineOrGroundPolylineResetting");L(this,"_czmViewVisibleDistanceRangeControl");L(this,"_id",this.disposeVar(c.react(c.createGuid())));L(this,"_positionsCenter");i&&(this.id=i),this._positionsCenter=this.ad(new wp(this.positionsReact)),this._czmViewVisibleDistanceRangeControl=this.disposeVar(new fo(e,[this,"viewDistanceRange"],this._positionsCenter.centerReact)),this.dispose(c.track([this._czmViewVisibleDistanceRangeControl,"debug"],[this,"viewDistanceDebug"])),this._polylineOrGroundPolylineResetting=this.disposeVar(new c.ObjResettingWithEvent(this.groundChanged,()=>this.ground?new ZP(e,this):new KP(e,this)))}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get polylineOrGroundPolylineResetting(){return this._polylineOrGroundPolylineResetting}get czmViewVisibleDistanceRangeControl(){return this._czmViewVisibleDistanceRangeControl}get visibleAlpha(){return this._czmViewVisibleDistanceRangeControl.visibleAlpha}get visibleAlphaChanged(){return this._czmViewVisibleDistanceRangeControl.visibleAlphaChanged}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(Ye,"defaults",{positions:[],viewDistanceRange:[1e3,1e4,3e4,6e4]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),loop:!1,width:2,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,customArrow:!1,customArrowParams:c.reactJson({repeat:60,speed:.1,color:[1,1,1,1],arrowColor:[1,1,1,1],image:"",lineLength:10}),arcType:"GEODESIC",depthTest:!1,zIndex:0,viewDistanceRange:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})})(Ye||(Ye={})),c.extendClassProps(Ye.prototype,Ye.createDefaultProps);class KP extends c.Destroyable{constructor(n,e){super();const i=this.disposeVar(new Bs(n,e.id));this.dispose(c.track([i,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([i,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(...V0(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const r=()=>{const{visibleAlpha:a}=e.czmViewVisibleDistanceRangeControl;i.show=e.show&&a>0,i.arcType=e.arcType,i.width=e.width,i.positions=Q0(e),i.material=k0(e)};r(),this.dispose(o.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flush(),e.viewDistanceRange||i.flyTo(r)}))}}class ZP extends c.Destroyable{constructor(n,e){super();const i=this.disposeVar(new Ps(n,e.id));this.dispose(c.track([i,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([i,"depthTest"],[e,"depthTest"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(...V0(e),e.czmViewVisibleDistanceRangeControl.visibleAlphaChanged));{const r=()=>{const{visibleAlpha:a}=e.czmViewVisibleDistanceRangeControl;i.show=e.show&&a>0,i.arcType=e.arcType,i.width=e.width,i.positions=Q0(e),i.material=k0(e)};r(),this.dispose(o.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flush(),e.viewDistanceRange||i.flyTo(r)}))}}function k0(t){const n=t.color,e=t.gapColor;let i;return t.hasDash?i={type:"PolylineDash",color:n,gapColor:e,dashLength:t.dashLength,dashPattern:t.dashPattern}:t.customArrow?i={type:"XbsjPolylineArrow",...t.customArrowParams}:t.hasArrow?i={type:"PolylineArrow",color:n}:i={type:"Color",color:n},i}function Q0(t){return t.loop&&t.positions&&t.positions.length>=3?[...t.positions,t.positions[0]]:t.positions}function V0(t){return[t.showChanged,t.positionsChanged,t.loopChanged,t.widthChanged,t.colorChanged,t.hasDashChanged,t.gapColorChanged,t.dashLengthChanged,t.dashPatternChanged,t.hasArrowChanged,t.customArrowChanged,t.arcTypeChanged,t.depthTestChanged,t.customArrowParamsChanged]}function $P(t){if(t.type==="BoxEmitter"){const n=t.dimensions;return n?new _.BoxEmitter(ri(n)):void 0}else if(t.type==="CircleEmitter"){const n=t.radius;return new _.CircleEmitter(n)}else if(t.type==="ConeEmitter"){const n=t.angle;return new _.ConeEmitter(n)}else if(t.type==="SphereEmitter"){const n=t.radius;return new _.SphereEmitter(n)}}const ki=class ki extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_updateCallbackFunc",this.disposeVar(c.react(void 0)));L(this,"_disposeUpdateCallbackFunc",(()=>{this.dispose(this.updateCallbackFuncChanged.don(e=>{e?this.updateCallback=e.toString():this.updateCallback=void 0}))})());L(this,"_disposeUpdateCallback",(()=>{this.dispose(this.updateCallbackChanged.don(e=>{e?this.updateCallbackFunc=Function('"use strict";return ('+e+")")():this.updateCallbackFunc=void 0}))})());L(this,"_primitive");this._player=this.disposeVar(new c.Player);const o=e.viewer;if(o){{const r=ki.defaults;this.dispose(c.bind([this._player,"loop"],[this,"playingLoop"],a=>a??r.playingLoop,a=>a??r.playingLoop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],a=>a??r.currentTime,a=>a??r.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],a=>a??r.duration,a=>a??r.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],a=>a??r.playing,a=>a??r.playing)),this.dispose(c.bind([this._player,"speed"],[this,"playingSpeed"],a=>a??r.playingSpeed,a=>a??r.playingSpeed))}{const r=()=>{this._primitive&&o.scene.primitives.remove(this._primitive),this._primitive=void 0};this.dispose(r);const a=()=>{const y=this.position??[0,0,0];return _.Transforms.eastNorthUpToFixedFrame(_.Cartesian3.fromDegrees(y[0],y[1],y[2]))},s=()=>{const y=this.rotation??[0,0,0],m=this.translation??[0,0,0],b=_.HeadingPitchRoll.fromDegrees(y[0],y[1],y[2],new _.HeadingPitchRoll);let x=new _.TranslationRotationScale;return x.translation=_.Cartesian3.fromElements(m[0],m[1],m[2],new _.Cartesian3),x.rotation=_.Quaternion.fromHeadingPitchRoll(b,new _.Quaternion),_.Matrix4.fromTranslationRotationScale(x,new _.Matrix4)},l=()=>{if(!this.bursts)return;let y=[];return this.bursts.forEach(m=>{const b=new _.ParticleBurst({time:m[0],minimum:m[1],maximum:m[2]});y.push(b)}),y},u=()=>{const y=a(),m=s(),b=l(),x=$P(this.emitter??ki.defaults.emitter),E=new _.ParticleSystem({emitter:x,bursts:b,modelMatrix:y,emitterModelMatrix:m,updateCallback:this.updateCallbackFunc?(B,P)=>{this.updateCallbackFunc&&this.updateCallbackFunc(B,P)}:void 0,image:c.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:ki.defaults.image),imageSize:Ze(this.imageSize??ki.defaults.imageSize),minimumImageSize:this.minimumImageSize&&Ze(this.minimumImageSize),maximumImageSize:this.maximumImageSize&&Ze(this.maximumImageSize),show:this.show,emissionRate:this.emissionRate,loop:this.loop,scale:this.scale,startScale:this.startScale,endScale:this.endScale??ki.defaults.endScale,color:this.color&&Be(this.color),startColor:this.startColor&&Be(this.startColor),endColor:this.endColor&&Be(this.endColor),sizeInMeters:this.sizeInMeters,speed:this.speed,minimumSpeed:this.minimumSpeed,maximumSpeed:this.maximumSpeed,lifetime:this.lifetime,particleLife:this.particleLife??ki.defaults.particleLife,minimumParticleLife:this.minimumParticleLife,maximumParticleLife:this.maximumParticleLife,mass:this.mass,minimumMass:this.minimumMass,maximumMass:this.maximumMass});return _.ParticleSystem.prototype&&(E.ESSceneObjectID=i),E},A=()=>{r(),this._primitive=u(),this._primitive&&o.scene.primitives.add(this._primitive)},h=()=>{if(!this._primitive)return;const y=this.show??!0;this._primitive.show=y,this.image&&(this._primitive.image=c.ESSceneObject.context.getStrFromEnv(this.image&&this.image.length!=0?this.image:ki.defaults.image))};A(),h();const f=this.disposeVar(c.createNextAnimateFrameEvent(this.emitterChanged,this.burstsChanged,this.emissionRateChanged,this.loopChanged,this.scaleChanged,this.startScaleChanged,this.endScaleChanged,this.colorChanged,this.startColorChanged,this.endColorChanged,this.imageSizeChanged,this.minimumImageSizeChanged,this.maximumImageSizeChanged,this.sizeInMetersChanged,this.speedChanged,this.minimumSpeedChanged,this.maximumSpeedChanged,this.lifetimeChanged,this.particleLifeChanged,this.minimumParticleLifeChanged,this.maximumParticleLifeChanged,this.massChanged,this.minimumMassChanged,this.maximumMassChanged,this.updateCallbackFuncChanged));this.dispose(f.disposableOn(()=>{A(),h()}));const d=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged,this.imageChanged));this.dispose(d.disposableOn(()=>{h()}));const p=()=>{if(!this._primitive)return;const y=a(),m=s();this._primitive.modelMatrix=y,this._primitive.emitterModelMatrix=m},g=this.disposeVar(c.createNextAnimateFrameEvent(this.positionChanged,this.rotationChanged,this.translationChanged));this.dispose(g.disposableOn(p));const v=()=>{this._primitive&&(this._primitive.timeStamp=this.currentTime)};v(),this.dispose(this.currentTimeChanged.disposableOn(v)),this.dispose(this.flyToEvent.disposableOn(()=>{if(!this.position){console.warn("当前没有位置信息,无法飞入!");return}const y=this.position[2]+100;Fe(o,this.position,y,void 0,1e3)}))}}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get player(){return this._player}get updateCallbackFunc(){return this._updateCallbackFunc.value}set updateCallbackFunc(e){this._updateCallbackFunc.value=e}get updateCallbackFuncChanged(){return this._updateCallbackFunc.changed}get ratio(){return this._player.ratio}set ratio(e){this._player.ratio=e}get ratioChanged(){return this._player.ratioChanged}get primitive(){return this._primitive}};L(ki,"defaults",{playingLoop:!0,currentTime:0,duration:6e3,playingSpeed:1,playing:!0,ratio:0,particleLife:.5,endScale:4,imageSize:[20,20],image:"${earthsdk3-assets-script-dir}/assets/img/smoke.png",emitter:{type:"CircleEmitter",radius:.5}});let wi=ki;(t=>{t.createDefaultProps=()=>({emitter:c.reactJsonWithUndefined(void 0),bursts:c.reactArrayCollectionWithUndefined(void 0),position:c.reactArrayWithUndefined(void 0),translation:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),image:void 0,imageSize:void 0,minimumImageSize:void 0,maximumImageSize:void 0,show:void 0,updateCallback:void 0,emissionRate:void 0,loop:void 0,scale:void 0,startScale:void 0,endScale:void 0,color:c.reactArrayWithUndefined(void 0),startColor:c.reactArrayWithUndefined(void 0),endColor:c.reactArrayWithUndefined(void 0),sizeInMeters:void 0,speed:void 0,minimumSpeed:void 0,maximumSpeed:void 0,lifetime:void 0,particleLife:void 0,minimumParticleLife:void 0,maximumParticleLife:void 0,mass:void 0,minimumMass:void 0,maximumMass:void 0,playingLoop:void 0,currentTime:void 0,duration:void 0,playingSpeed:void 0,playing:void 0})})(wi||(wi={})),c.extendClassProps(wi.prototype,wi.createDefaultProps);class XP extends c.Destroyable{constructor(e,i){super();L(this,"_model");L(this,"_geoPoint");L(this,"_geoAxis");this._model=this.disposeVar(new Ht(i,e.id)),this._geoPoint=this.disposeVar(new Wn(i,e.id)),this._geoAxis=this.disposeVar(new Ye(i,e.id)),this._geoAxis.hasArrow=!0,this._geoAxis.width=10;{this._model.url="${earthsdk3-assets-script-dir}/assets/glb/camera1/camera1.gltf",this._model.localRotation=[90,0,0],this._model.allowPicking=!1,this._model.pixelSize=30;{const o=()=>{e.position&&(this._model.position=jv(e.position,e.rotation??[0,0,0],e.viewDistance??0),this._model.rotation=e.rotation??[0,0,0])};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.viewDistanceChanged));this.dispose(r.disposableOn(o))}{const o=()=>{const a=i.getCameraInfo();if(!a)return;const s=a.position,l=this._model.position;if(!l)return;const u=_.Cartesian3.fromDegrees(l[0],l[1],l[2]),A=_.Cartesian3.fromDegrees(s[0],s[1],s[2]),h=_.Cartesian3.distanceSquared(u,A);this._model.show=h>1};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(i.cameraChanged,this._model.positionChanged));this.dispose(r.disposableOn(o))}}{this._geoAxis.width=6,this._geoAxis.color=[1,1,0,.7];{const o=()=>{e.position&&this.model.position&&(this._geoAxis.positions=[this.model.position,e.position])};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this._model.positionChanged));this.dispose(r.disposableOn(o))}}}get model(){return this._model}get geoPoint(){return this._geoPoint}get geoAxis(){return this._geoAxis}}const fr=class fr extends c.Destroyable{constructor(e,i){super();L(this,"_captureEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));this._czmViewer=e,i&&(this.id=i);const o=e.viewer;if(!o)return;this.disposeVar(new c.ObjResettingWithEvent(this.showChanged,()=>{if(this.show&&this.position)return new XP(this,e)})),this.default&&this.flyTo(void 0,!1);const r=this.disposeVar(c.createProcessingFromAsyncFunc(async s=>{const{position:l,rotation:u,viewDistance:A,duration:h=1e3}=this;if(l){const f=Fe(o,l,A,u,h,()=>{this.enabled=!1});f&&await s.promise(f),this.enabled=!1}}));this.dispose(this.enabledChanged.disposableOn(()=>{r.isRunning&&r.cancel(),this.enabled&&r.restart()}));const a=this.disposeVar(c.createProcessingFromAsyncFunc(async(s,l,u)=>{const A=e.capture(l,u);if(!A)return;const h=await s.promise(A);h&&(this.thumbnail=h)}));this.dispose(this.captureEvent.disposableOn((s,l)=>{a.restart(void 0,s??fr.defaults.thumbnailWidth,l??fr.defaults.thumbnailHeight)}))}get captureEvent(){return this._captureEvent}capture(e,i){this._captureEvent.emit(e,i)}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}resetWithCurrentCamera(e){const{_czmViewer:i}=this;if(!i.actived)return;const{viewer:o}=this._czmViewer;if(!o)return;const r=this;e&fr.ResetFlag.Position&&(r.position=Fn(o.camera)),e&fr.ResetFlag.Rotation&&(r.rotation=ms(o.camera)),e&fr.ResetFlag.ViewDistance&&(r.viewDistance=0)}flyTo(e,i,o="default"){if((i??!0)&&!this._czmViewer.actived)return;const{_czmViewer:{viewer:r}}=this,{position:a,rotation:s,viewDistance:l,duration:u}=this;!r||!a||Fe(r,a,l,s,e??u,void 0,o)}};L(fr,"ResetFlag",{Position:1,Rotation:2,ViewDistance:4}),L(fr,"defaults",{thumbnailWidth:64,thumbnailHeight:64,enabled:!0,show:!1,position:[116.39,39.9,100],duration:1e3,default:!1,thumbnail:""});let bn=fr;(t=>{t.createDefaultProps=()=>({enabled:!0,position:c.reactArrayWithUndefined(void 0),positionEditing:!1,show:!1,rotation:c.reactArray([0,0,0]),viewDistance:0,duration:void 0,default:!1,thumbnail:""})})(bn||(bn={})),c.extendClassProps(bn.prototype,bn.createDefaultProps);function N0(t,n){let e=[0,0];if(!t||!n)return e;const i=t.cloneNode(!0);i.style.position="absolute",i.style.top="0",i.style.zIndex="-1",document.body.appendChild(i);const o=i.querySelector(`.${n}-anchor`)??i.querySelector(`.${n}-iconBox`);if(o&&o.parentElement){const r=(o.parentElement.offsetTop+o.parentElement.offsetHeight-(["Flag01"].includes(n)?10:["P3D02","P3D04"].includes(n)?15:0))/i.offsetHeight;e=[(o.offsetLeft+o.width/2)/i.offsetWidth,r<1?r:1]}return document.body.removeChild(i),e}class Pr extends c.Destroyable{constructor(e,i,o,r,a=!0){super();L(this,"widgetInfo");L(this,"_czmGeoCustomDivPoi");L(this,"sceneObject");L(this,"domSize");L(this,"_defaultAnchor",this.disposeVar(c.react([0,0])));L(this,"flyTo",(e,i)=>{if(this.czmGeoCustomDivPoi.position){Fe(this._czmViewer.viewer,this.czmGeoCustomDivPoi.position,1e3,Hn,e);return}this.czmGeoCustomDivPoi.flyTo(e&&e*1e3)});L(this,"createInstanceClass",()=>{let e=this;return class extends c.Destroyable{constructor(o,r,a){if(super(),this._subContainer=o,!a||!(a instanceof ot))return;const s=e.widgetInfo;this._subContainer.appendChild(s),this.dispose(()=>{this._subContainer.removeChild(s)});{const l=()=>{s.style.pointerEvents=e.sceneObject.editing?"none":"all"};l(),this.d(e.sceneObject.editingChanged.don(l))}}}});this._sceneObject=e,this._czmViewer=i,this._widgetInfo=o,this._drawWidget=r,this._czmGeoCustomDivPoi=this.disposeVar(new wt(i,e.id));let s=this.sceneObject=this._sceneObject;this._czmViewer,this.widgetInfo=this._widgetInfo,s instanceof c.ESPoi2D&&(this.defaultAnchor=N0(this.widgetInfo,s.mode));const{czmGeoCustomDivPoi:l}=this;this.d(c.track([l,"zOrder"],[s,"zOrder"])),this.dispose(c.track([l,"show"],[s,"show"])),this.dispose(c.bind([l,"position"],[s,"position"])),s instanceof c.ESWidget&&this.dispose(c.track([l,"opacity"],[s,"opacity"]));{const u=this.dv(c.createNextAnimateFrameEvent(s.allowPickingChanged,s.editingChanged)),A=()=>{s.allowPicking&&!s.editing?l.allowPicking=!0:l.allowPicking=!1};A(),this.d(u.don(A))}if(this.d(l.pickedEvent.don(u=>{var f;const A=(f=_o(u,"pickResult"))==null?void 0:f.pointerEvent;if(!A)return;const h={type:A.buttons!=0&&A.button==0?"leftClick":A.button==2?"rightClick":void 0,add:{mousePos:[A.offsetX,A.offsetY]}};h.type==null&&(h.type=A.type),s.widgetEvent.emit(h)})),(()=>{try{r?l.instanceClass=this.createInstanceClass():l.instanceClass=void 0}catch(A){console.log(A)}})(),a){const u=()=>{const h=s.anchor,f=s.offset;h?l.originRatioAndOffset=[...h,-f[0],-f[1]]:l.originRatioAndOffset=[0,0,0,0]};u();const A=this.ad(c.createNextAnimateFrameEvent(s.anchorChanged,s.offsetChanged));this.dispose(A.disposableOn(u))}{const u=async()=>{let h,f;if((!this.domSize||this.domSize.width==0||this.domSize.height==0)&&(this.domSize=this.widgetInfo.getBoundingClientRect(),this.domSize.width==0||this.domSize.height==0)){const d=setTimeout(()=>{u(),clearTimeout(d)},200);return}s.sizeByContent?(h=this.domSize.width,f=this.domSize.height):(h=s.size[0],f=s.size[1]),this.widgetInfo.style.transform=`scale(${h/this.domSize.width*s.scale[1]},${f/this.domSize.height*s.scale[2]})`,this.widgetInfo.style.transformOrigin=`${s.anchor[0]*100}% ${s.anchor[1]*100}%`};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(s.sizeChanged,s.sizeByContentChanged,s.scaleChanged));this.dispose(A.disposableOn(u))}}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}get defaultAnchor(){return this._defaultAnchor.value}set defaultAnchor(e){this._defaultAnchor.value=e}get defaultAnchorChanged(){return this._defaultAnchor.changed}}/*!
267
267
  * html2canvas 1.4.1 <https://html2canvas.hertzen.com>
268
268
  * Copyright (c) 2022 Niklas von Hertzen <https://hertzen.com>
269
269
  * Released under MIT License
@@ -400,7 +400,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
400
400
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w,C=!0,D=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){D=!0,w=R},f:function(){try{C||F.return==null||F.return()}finally{if(D)throw w}}}}function u(I,M){(M==null||M>I.length)&&(M=I.length);for(var F=0,S=new Array(M);F<M;F++)S[F]=I[F];return S}function A(I,M){for(var F=0;F<M.length;F++){var S=M[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}var h=s(4832).FillLayoutArray,f=s(8669).members,d=s(8500).SegmentVector,p=s(9063).ProgramConfigurationSet,g=s(9631),v=g.LineIndexArray,y=g.TriangleIndexArray,m=s(1438),b=s(9187),x=s(937),E=s(8583),B=s(1786).register,P=function(){function I(S){(function(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")})(this,I),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(T){return T.id}),this.index=S.index,this.layoutVertexArray=new h,this.indexArray=new y,this.indexArray2=new v,this.programConfigurations=new p(f,S.layers,S.zoom),this.segments=new d,this.segments2=new d}var M,F;return M=I,(F=[{key:"populate",value:function(S,T){var w,C=l(S);try{for(C.s();!(w=C.n()).done;){var D=w.value,R=D.feature,U=D.index,O=D.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},R)){var z=m(R);this.addFeature(R,z),T.featureIndex.insert(R,z,U,O,this.index)}}}catch(k){C.e(k)}finally{C.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=S.createIndexBuffer(this.indexArray),this.indexBuffer2=S.createIndexBuffer(this.indexArray2),this.programConfigurations.upload(S)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.indexBuffer2.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.segments2.destroy())}},{key:"addFeature",value:function(S,T){var w,C=l(x(T,500));try{for(C.s();!(w=C.n()).done;){var D,R=w.value,U=0,O=l(R);try{for(O.s();!(D=O.n()).done;)U+=D.value.length}catch(ce){O.e(ce)}finally{O.f()}var z,k=this.segments.prepareSegment(U,this.layoutVertexArray,this.indexArray),Q=k.vertexLength,N=[],j=[],J=l(R);try{for(J.s();!(z=J.n()).done;){var ee=z.value;if(ee.length!==0){ee!==R[0]&&j.push(N.length/2);var ie=this.segments2.prepareSegment(ee.length,this.layoutVertexArray,this.indexArray2),oe=ie.vertexLength;this.layoutVertexArray.emplaceBack(ee[0].x,ee[0].y),this.indexArray2.emplaceBack(oe+ee.length-1,oe),N.push(ee[0].x),N.push(ee[0].y);for(var ue=1;ue<ee.length;ue++)this.layoutVertexArray.emplaceBack(ee[ue].x,ee[ue].y),this.indexArray2.emplaceBack(oe+ue-1,oe+ue),N.push(ee[ue].x),N.push(ee[ue].y);ie.vertexLength+=ee.length,ie.primitiveLength+=ee.length}}}catch(ce){J.e(ce)}finally{J.f()}var le=b(N,j);E(le.length%3==0);for(var ne=0;ne<le.length;ne+=3)this.indexArray.emplaceBack(Q+le[ne],Q+le[ne+1],Q+le[ne+2]);k.vertexLength+=U,k.primitiveLength+=le.length/3}}catch(ce){C.e(ce)}finally{C.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,S)}}])&&A(M.prototype,F),Object.defineProperty(M,"prototype",{writable:!1}),I}();B("FillBucket",P,{omit:["layers"]}),r.exports=P},163:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",components:2,type:"Int16"},{name:"a_normal_ed",components:4,type:"Int16"}],4)},8294:function(r,a,s){function l(T,w){var C=typeof Symbol<"u"&&T[Symbol.iterator]||T["@@iterator"];if(!C){if(Array.isArray(T)||(C=function(k,Q){if(k){if(typeof k=="string")return u(k,Q);var N=Object.prototype.toString.call(k).slice(8,-1);return N==="Object"&&k.constructor&&(N=k.constructor.name),N==="Map"||N==="Set"?Array.from(k):N==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(N)?u(k,Q):void 0}}(T))||w){C&&(T=C);var D=0,R=function(){};return{s:R,n:function(){return D>=T.length?{done:!0}:{done:!1,value:T[D++]}},e:function(k){throw k},f:R}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
401
401
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var U,O=!0,z=!1;return{s:function(){C=C.call(T)},n:function(){var k=C.next();return O=k.done,k},e:function(k){z=!0,U=k},f:function(){try{O||C.return==null||C.return()}finally{if(z)throw U}}}}function u(T,w){(w==null||w>T.length)&&(w=T.length);for(var C=0,D=new Array(w);C<w;C++)D[C]=T[C];return D}function A(T,w){for(var C=0;C<w.length;C++){var D=w[C];D.enumerable=D.enumerable||!1,D.configurable=!0,"value"in D&&(D.writable=!0),Object.defineProperty(T,D.key,D)}}var h=s(4832).FillExtrusionLayoutArray,f=s(163).members,d=s(8500),p=d.SegmentVector,g=d.MAX_VERTEX_ARRAY_LENGTH,v=s(9063).ProgramConfigurationSet,y=s(9631).TriangleIndexArray,m=s(1438),b=s(900),x=s(9187),E=s(937),B=s(8583),P=s(1786).register,I=Math.pow(2,13);function M(T,w,C,D,R,U,O,z){T.emplaceBack(w,C,2*Math.floor(D*I)+O,R*I*2,U*I*2,Math.round(z))}var F=function(){function T(D){(function(R,U){if(!(R instanceof U))throw new TypeError("Cannot call a class as a function")})(this,T),this.zoom=D.zoom,this.overscaling=D.overscaling,this.layers=D.layers,this.layerIds=this.layers.map(function(R){return R.id}),this.index=D.index,this.layoutVertexArray=new h,this.indexArray=new y,this.programConfigurations=new v(f,D.layers,D.zoom),this.segments=new p}var w,C;return w=T,(C=[{key:"populate",value:function(D,R){var U,O=l(D);try{for(O.s();!(U=O.n()).done;){var z=U.value,k=z.feature,Q=z.index,N=z.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},k)){var j=m(k);this.addFeature(k,j),R.featureIndex.insert(k,j,Q,N,this.index)}}}catch(J){O.e(J)}finally{O.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(D){this.layoutVertexBuffer=D.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=D.createIndexBuffer(this.indexArray),this.programConfigurations.upload(D)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(D,R){var U,O,z=l(E(R,500));try{for(z.s();!(U=z.n()).done;){var k,Q=U.value,N=0,j=l(Q);try{for(j.s();!(k=j.n()).done;)N+=k.value.length}catch(ye){j.e(ye)}finally{j.f()}var J,ee=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray),ie=l(Q);try{for(ie.s();!(J=ie.n()).done;){var oe=J.value;if(oe.length!==0&&!((O=oe).every(function(ye){return ye.x<0})||O.every(function(ye){return ye.x>b})||O.every(function(ye){return ye.y<0})||O.every(function(ye){return ye.y>b})))for(var ue=0,le=0;le<oe.length;le++){var ne=oe[le];if(le>=1){var ce=oe[le-1];if(!S(ne,ce)){ee.vertexLength+4>g&&(ee=this.segments.prepareSegment(4,this.layoutVertexArray,this.indexArray));var $=ne.sub(ce)._perp()._unit(),q=ce.dist(ne);ue+q>32768&&(ue=0),M(this.layoutVertexArray,ne.x,ne.y,$.x,$.y,0,0,ue),M(this.layoutVertexArray,ne.x,ne.y,$.x,$.y,0,1,ue),ue+=q,M(this.layoutVertexArray,ce.x,ce.y,$.x,$.y,0,0,ue),M(this.layoutVertexArray,ce.x,ce.y,$.x,$.y,0,1,ue);var G=ee.vertexLength;this.indexArray.emplaceBack(G,G+1,G+2),this.indexArray.emplaceBack(G+1,G+2,G+3),ee.vertexLength+=4,ee.primitiveLength+=2}}}}}catch(ye){ie.e(ye)}finally{ie.f()}ee.vertexLength+N>g&&(ee=this.segments.prepareSegment(N,this.layoutVertexArray,this.indexArray));var Z,K=[],W=[],H=ee.vertexLength,X=l(Q);try{for(X.s();!(Z=X.n()).done;){var Y=Z.value;if(Y.length!==0){Y!==Q[0]&&W.push(K.length/2);for(var se=0;se<Y.length;se++){var Ae=Y[se];M(this.layoutVertexArray,Ae.x,Ae.y,0,0,1,1,0),K.push(Ae.x),K.push(Ae.y)}}}}catch(ye){X.e(ye)}finally{X.f()}var fe=x(K,W);B(fe.length%3==0);for(var de=0;de<fe.length;de+=3)this.indexArray.emplaceBack(H+fe[de],H+fe[de+1],H+fe[de+2]);ee.primitiveLength+=fe.length/3,ee.vertexLength+=N}}catch(ye){z.e(ye)}finally{z.f()}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,D)}}])&&A(w.prototype,C),Object.defineProperty(w,"prototype",{writable:!1}),T}();function S(T,w){return T.x===w.x&&(T.x<0||T.x>b)||T.y===w.y&&(T.y<0||T.y>b)}P("FillExtrusionBucket",F,{omit:["layers"]}),r.exports=F},7832:function(r,a,s){function l(v){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(y){return typeof y}:function(y){return y&&typeof Symbol=="function"&&y.constructor===Symbol&&y!==Symbol.prototype?"symbol":typeof y},l(v)}function u(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")}function A(v,y){return A=Object.setPrototypeOf||function(m,b){return m.__proto__=b,m},A(v,y)}function h(v,y){if(y&&(l(y)==="object"||typeof y=="function"))return y;if(y!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}(v)}function f(v){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(y){return y.__proto__||Object.getPrototypeOf(y)},f(v)}var d=s(6677),p=s(1786).register,g=function(v){(function(B,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function");B.prototype=Object.create(P&&P.prototype,{constructor:{value:B,writable:!0,configurable:!0}}),Object.defineProperty(B,"prototype",{writable:!1}),P&&A(B,P)})(E,v);var y,m,b,x=(m=E,b=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}(),function(){var B,P=f(m);if(b){var I=f(this).constructor;B=Reflect.construct(P,arguments,I)}else B=P.apply(this,arguments);return h(this,B)});function E(){return u(this,E),x.apply(this,arguments)}return y=E,Object.defineProperty(y,"prototype",{writable:!1}),y}(d);p("HeatmapBucket",g,{omit:["layers"]}),r.exports=g},9379:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos_normal",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint8"}],4)},6905:function(r,a,s){function l(I,M){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||M){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
402
402
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w,C=!0,D=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){D=!0,w=R},f:function(){try{C||F.return==null||F.return()}finally{if(D)throw w}}}}function u(I,M){(M==null||M>I.length)&&(M=I.length);for(var F=0,S=new Array(M);F<M;F++)S[F]=I[F];return S}function A(I,M){for(var F=0;F<M.length;F++){var S=M[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}var h=s(4832).LineLayoutArray,f=s(9379).members,d=s(8500).SegmentVector,p=s(9063).ProgramConfigurationSet,g=s(9631).TriangleIndexArray,v=s(1438),y=s(900),m=s(8929).VectorTileFeature.types,b=s(1786).register,x=Math.cos(Math.PI/180*37.5),E=Math.pow(2,14)/.5;function B(I,M,F,S,T,w,C){I.emplaceBack(M.x,M.y,S?1:0,T?1:-1,Math.round(63*F.x)+128,Math.round(63*F.y)+128,1+(w===0?0:w<0?-1:1)|(.5*C&63)<<2,.5*C>>6)}var P=function(){function I(S){(function(T,w){if(!(T instanceof w))throw new TypeError("Cannot call a class as a function")})(this,I),this.zoom=S.zoom,this.overscaling=S.overscaling,this.layers=S.layers,this.layerIds=this.layers.map(function(T){return T.id}),this.index=S.index,this.layoutVertexArray=new h,this.indexArray=new g,this.programConfigurations=new p(f,S.layers,S.zoom),this.segments=new d}var M,F;return M=I,(F=[{key:"populate",value:function(S,T){var w,C=l(S);try{for(C.s();!(w=C.n()).done;){var D=w.value,R=D.feature,U=D.index,O=D.sourceLayerIndex;if(this.layers[0]._featureFilter({zoom:this.zoom},R)){var z=v(R);this.addFeature(R,z),T.featureIndex.insert(R,z,U,O,this.index)}}}catch(k){C.e(k)}finally{C.f()}}},{key:"isEmpty",value:function(){return this.layoutVertexArray.length===0}},{key:"upload",value:function(S){this.layoutVertexBuffer=S.createVertexBuffer(this.layoutVertexArray,f),this.indexBuffer=S.createIndexBuffer(this.indexArray),this.programConfigurations.upload(S)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy())}},{key:"addFeature",value:function(S,T){var w,C=this.layers[0].layout,D=C.get("line-join").evaluate(S),R=C.get("line-cap"),U=C.get("line-miter-limit"),O=C.get("line-round-limit"),z=l(T);try{for(z.s();!(w=z.n()).done;){var k=w.value;this.addLine(k,S,D,R,U,O)}}catch(Q){z.e(Q)}finally{z.f()}}},{key:"addLine",value:function(S,T,w,C,D,R){for(var U=m[T.type]==="Polygon",O=S.length;O>=2&&S[O-1].equals(S[O-2]);)O--;for(var z=0;z<O-1&&S[z].equals(S[z+1]);)z++;if(!(O<(U?3:2))){w==="bevel"&&(D=1.05);var k=y/(512*this.overscaling)*15,Q=S[z],N=this.segments.prepareSegment(10*O,this.layoutVertexArray,this.indexArray);this.distance=0;var j,J,ee,ie=C,oe=U?"butt":C,ue=!0,le=void 0,ne=void 0,ce=void 0,$=void 0;this.e1=this.e2=this.e3=-1,U&&(j=S[O-2],$=Q.sub(j)._unit()._perp());for(var q=z;q<O;q++)if(!(ne=U&&q===O-1?S[z+1]:S[q+1])||!S[q].equals(ne)){$&&(ce=$),j&&(le=j),j=S[q],$=ne?ne.sub(j)._unit()._perp():ce;var G=(ce=ce||$).add($);G.x===0&&G.y===0||G._unit();var Z=G.x*$.x+G.y*$.y,K=Z!==0?1/Z:1/0,W=Z<x&&le&&ne;if(W&&q>z){var H=j.dist(le);if(H>2*k){var X=j.sub(j.sub(le)._mult(k/H)._round());this.distance+=X.dist(le),this.addCurrentVertex(X,this.distance,ce.mult(1),0,0,!1,N),le=X}}var Y=le&&ne,se=Y?w:ne?ie:oe;if(Y&&se==="round"&&(K<R?se="miter":K<=2&&(se="fakeround")),se==="miter"&&K>D&&(se="bevel"),se==="bevel"&&(K>2&&(se="flipbevel"),K<D&&(se="miter")),le&&(this.distance+=j.dist(le)),se==="miter")G._mult(K),this.addCurrentVertex(j,this.distance,G,0,0,!1,N);else if(se==="flipbevel"){if(K>100)G=$.clone().mult(-1);else{var Ae=ce.x*$.y-ce.y*$.x>0?-1:1,fe=K*ce.add($).mag()/ce.sub($).mag();G._perp()._mult(fe*Ae)}this.addCurrentVertex(j,this.distance,G,0,0,!1,N),this.addCurrentVertex(j,this.distance,G.mult(-1),0,0,!1,N)}else if(se==="bevel"||se==="fakeround"){var de=ce.x*$.y-ce.y*$.x>0,ye=-Math.sqrt(K*K-1);if(de?(ee=0,J=ye):(J=0,ee=ye),ue||this.addCurrentVertex(j,this.distance,ce,J,ee,!1,N),se==="fakeround"){for(var Ce=Math.floor(8*(.5-(Z-.5))),Se=void 0,Re=0;Re<Ce;Re++)Se=$.mult((Re+1)/(Ce+1))._add(ce)._unit(),this.addPieSliceVertex(j,this.distance,Se,de,N);this.addPieSliceVertex(j,this.distance,G,de,N);for(var Ie=Ce-1;Ie>=0;Ie--)Se=ce.mult((Ie+1)/(Ce+1))._add($)._unit(),this.addPieSliceVertex(j,this.distance,Se,de,N)}ne&&this.addCurrentVertex(j,this.distance,$,-J,-ee,!1,N)}else se==="butt"?(ue||this.addCurrentVertex(j,this.distance,ce,0,0,!1,N),ne&&this.addCurrentVertex(j,this.distance,$,0,0,!1,N)):se==="square"?(ue||(this.addCurrentVertex(j,this.distance,ce,1,1,!1,N),this.e1=this.e2=-1),ne&&this.addCurrentVertex(j,this.distance,$,-1,-1,!1,N)):se==="round"&&(ue||(this.addCurrentVertex(j,this.distance,ce,0,0,!1,N),this.addCurrentVertex(j,this.distance,ce,1,1,!0,N),this.e1=this.e2=-1),ne&&(this.addCurrentVertex(j,this.distance,$,-1,-1,!0,N),this.addCurrentVertex(j,this.distance,$,0,0,!1,N)));if(W&&q<O-1){var Le=j.dist(ne);if(Le>2*k){var je=j.add(ne.sub(j)._mult(k/Le)._round());this.distance+=je.dist(j),this.addCurrentVertex(je,this.distance,$.mult(1),0,0,!1,N),j=je}}ue=!1}this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length,T)}}},{key:"addCurrentVertex",value:function(S,T,w,C,D,R,U){var O,z=this.layoutVertexArray,k=this.indexArray;O=w.clone(),C&&O._sub(w.perp()._mult(C)),B(z,S,O,R,!1,C,T),this.e3=U.vertexLength++,this.e1>=0&&this.e2>=0&&(k.emplaceBack(this.e1,this.e2,this.e3),U.primitiveLength++),this.e1=this.e2,this.e2=this.e3,O=w.mult(-1),D&&O._sub(w.perp()._mult(D)),B(z,S,O,R,!0,-D,T),this.e3=U.vertexLength++,this.e1>=0&&this.e2>=0&&(k.emplaceBack(this.e1,this.e2,this.e3),U.primitiveLength++),this.e1=this.e2,this.e2=this.e3,T>E/2&&(this.distance=0,this.addCurrentVertex(S,this.distance,w,C,D,R,U))}},{key:"addPieSliceVertex",value:function(S,T,w,C,D){w=w.mult(C?-1:1);var R=this.layoutVertexArray,U=this.indexArray;B(R,S,w,!1,C,0,T),this.e3=D.vertexLength++,this.e1>=0&&this.e2>=0&&(U.emplaceBack(this.e1,this.e2,this.e3),D.primitiveLength++),C?this.e2=this.e3:this.e1=this.e3}}])&&A(M.prototype,F),Object.defineProperty(M,"prototype",{writable:!1}),I}();b("LineBucket",P,{omit:["layers"]}),r.exports=P},1203:function(r,a,s){var l=s(6693).createLayout,u={symbolLayoutAttributes:l([{name:"a_pos_offset",components:4,type:"Int16"},{name:"a_data",components:4,type:"Uint16"}]),dynamicLayoutAttributes:l([{name:"a_projected_pos",components:3,type:"Float32"}],4),placementOpacityAttributes:l([{name:"a_fade_opacity",components:1,type:"Uint32"}],4),collisionVertexAttributes:l([{name:"a_placed",components:2,type:"Uint8"}],4),collisionBox:l([{type:"Int16",name:"anchorPointX"},{type:"Int16",name:"anchorPointY"},{type:"Int16",name:"x1"},{type:"Int16",name:"y1"},{type:"Int16",name:"x2"},{type:"Int16",name:"y2"},{type:"Uint32",name:"featureIndex"},{type:"Uint16",name:"sourceLayerIndex"},{type:"Uint16",name:"bucketIndex"},{type:"Int16",name:"radius"},{type:"Int16",name:"signedDistanceFromAnchor"}]),collisionBoxLayout:l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),collisionCircleLayout:l([{name:"a_pos",components:2,type:"Int16"},{name:"a_anchor_pos",components:2,type:"Int16"},{name:"a_extrude",components:2,type:"Int16"}],4),placement:l([{type:"Int16",name:"anchorX"},{type:"Int16",name:"anchorY"},{type:"Uint16",name:"glyphStartIndex"},{type:"Uint16",name:"numGlyphs"},{type:"Uint32",name:"vertexStartIndex"},{type:"Uint32",name:"lineStartIndex"},{type:"Uint32",name:"lineLength"},{type:"Uint16",name:"segment"},{type:"Uint16",name:"lowerSize"},{type:"Uint16",name:"upperSize"},{type:"Float32",name:"lineOffsetX"},{type:"Float32",name:"lineOffsetY"},{type:"Uint8",name:"writingMode"},{type:"Uint8",name:"hidden"}]),glyphOffset:l([{type:"Float32",name:"offsetX"}]),lineVertex:l([{type:"Int16",name:"x"},{type:"Int16",name:"y"},{type:"Int16",name:"tileUnitDistanceFromAnchor"}])};r.exports=u},5571:function(r,a,s){function l(q,G){var Z=typeof Symbol<"u"&&q[Symbol.iterator]||q["@@iterator"];if(!Z){if(Array.isArray(q)||(Z=function(se,Ae){if(se){if(typeof se=="string")return u(se,Ae);var fe=Object.prototype.toString.call(se).slice(8,-1);return fe==="Object"&&se.constructor&&(fe=se.constructor.name),fe==="Map"||fe==="Set"?Array.from(se):fe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(fe)?u(se,Ae):void 0}}(q))||G){Z&&(q=Z);var K=0,W=function(){};return{s:W,n:function(){return K>=q.length?{done:!0}:{done:!1,value:q[K++]}},e:function(se){throw se},f:W}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
403
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,X=!0,Y=!1;return{s:function(){Z=Z.call(q)},n:function(){var se=Z.next();return X=se.done,se},e:function(se){Y=!0,H=se},f:function(){try{X||Z.return==null||Z.return()}finally{if(Y)throw H}}}}function u(q,G){(G==null||G>q.length)&&(G=q.length);for(var Z=0,K=new Array(G);Z<G;Z++)K[Z]=q[Z];return K}function A(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function h(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function f(q,G,Z){return G&&h(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var d=s(1203),p=d.symbolLayoutAttributes,g=d.collisionVertexAttributes,v=d.collisionBoxLayout,y=d.collisionCircleLayout,m=d.dynamicLayoutAttributes,b=s(4832),x=b.SymbolLayoutArray,E=b.SymbolDynamicLayoutArray,B=b.SymbolOpacityArray,P=b.CollisionBoxLayoutArray,I=b.CollisionCircleLayoutArray,M=b.CollisionVertexArray,F=b.PlacedSymbolArray,S=b.GlyphOffsetArray,T=b.SymbolLineVertexArray,w=s(5550),C=s(8500).SegmentVector,D=s(9063).ProgramConfigurationSet,R=s(9631),U=R.TriangleIndexArray,O=R.LineIndexArray,z=s(1447),k=s(8376),Q=s(6584),N=s(1438),j=s(8929).VectorTileFeature.types,J=s(7899),ee=(s(1397),s(724).getSizeData),ie=s(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ue(q,G,Z,K,W,H,X,Y){q.emplaceBack(G,Z,Math.round(64*K),Math.round(64*W),H,X,Y?Y[0]:0,Y?Y[1]:0)}function le(q,G,Z){q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z)}var ne=function(){function q(G){A(this,q),this.layoutVertexArray=new x,this.indexArray=new U,this.programConfigurations=G,this.segments=new C,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new B,this.placedSymbolArray=new F}return f(q,[{key:"upload",value:function(G,Z){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,p.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,Z),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,m.members,!0),this.opacityVertexBuffer=G.createVertexBuffer(this.opacityVertexArray,oe,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),q}();ie("SymbolBuffers",ne);var ce=function(){function q(G,Z,K){A(this,q),this.layoutVertexArray=new G,this.layoutAttributes=Z,this.indexArray=new K,this.segments=new C,this.collisionVertexArray=new M}return f(q,[{key:"upload",value:function(G){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=G.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=G.createVertexBuffer(this.collisionVertexArray,g.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),q}();ie("CollisionBuffers",ce);var $=function(){function q(G){A(this,q),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(W){return W.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var Z=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ee(this.zoom,Z["text-size"]),this.iconSizeData=ee(this.zoom,Z["icon-size"]);var K=this.layers[0].layout;this.sortFeaturesByY=K.get("text-allow-overlap")||K.get("icon-allow-overlap")||K.get("text-ignore-placement")||K.get("icon-ignore-placement")}return f(q,[{key:"createArrays",value:function(){this.text=new ne(new D(p.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new ne(new D(p.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new ce(P,v.members,O),this.collisionCircle=new ce(I,y.members,U),this.glyphOffsetArray=new S,this.lineVertexArray=new T}},{key:"populate",value:function(G,Z){var K=this.layers[0],W=K.layout,H=W.get("text-font"),X=W.get("text-field"),Y=W.get("icon-image"),se=(X.value.kind!=="constant"||X.value.value.length>0)&&(H.value.kind!=="constant"||H.value.value.length>0),Ae=Y.value.kind!=="constant"||Y.value.value&&Y.value.value.length>0;if(this.features=[],se||Ae){var fe,de=Z.iconDependencies,ye=Z.glyphDependencies,Ce={zoom:this.zoom},Se=l(G);try{for(Se.s();!(fe=Se.n()).done;){var Re=fe.value,Ie=Re.feature,Le=Re.index,je=Re.sourceLayerIndex;if(K._featureFilter(Ce,Ie)){var Oe=void 0;se&&(Oe=K.getValueAndResolveTokens("text-field",Ie),Oe=z(Oe,K,Ie));var At=void 0;if(Ae&&(At=K.getValueAndResolveTokens("icon-image",Ie)),Oe||At){var Bt={text:Oe,icon:At,index:Le,sourceLayerIndex:je,geometry:N(Ie),properties:Ie.properties,type:j[Ie.type]};if(Ie.id!==void 0&&(Bt.id=Ie.id),this.features.push(Bt),At&&(de[At]=!0),Oe){for(var nt=H.evaluate(Ie).join(","),mn=ye[nt]=ye[nt]||{},ct=W.get("text-rotation-alignment")==="map"&&W.get("symbol-placement")==="line",Vi=Q.allowsVerticalWritingMode(Oe),di=0;di<Oe.length;di++)if(mn[Oe.charCodeAt(di)]=!0,ct&&Vi){var mr=J.lookup[Oe.charAt(di)];mr&&(mn[mr.charCodeAt(0)]=!0)}}}}}}catch(RH){Se.e(RH)}finally{Se.f()}W.get("symbol-placement")==="line"&&(this.features=k(this.features))}}},{key:"isEmpty",value:function(){return this.symbolInstances.length===0}},{key:"upload",value:function(G){this.text.upload(G,this.sortFeaturesByY),this.icon.upload(G,this.sortFeaturesByY),this.collisionBox.upload(G),this.collisionCircle.upload(G)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(G,Z){var K=this.lineVertexArray.length;if(G.segment!==void 0){for(var W=G.dist(Z[G.segment+1]),H=G.dist(Z[G.segment]),X={},Y=G.segment+1;Y<Z.length;Y++)X[Y]={x:Z[Y].x,y:Z[Y].y,tileUnitDistanceFromAnchor:W},Y<Z.length-1&&(W+=Z[Y+1].dist(Z[Y]));for(var se=G.segment||0;se>=0;se--)X[se]={x:Z[se].x,y:Z[se].y,tileUnitDistanceFromAnchor:H},se>0&&(H+=Z[se-1].dist(Z[se]));for(var Ae=0;Ae<Z.length;Ae++){var fe=X[Ae];this.lineVertexArray.emplaceBack(fe.x,fe.y,fe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:K,lineLength:this.lineVertexArray.length-K}}},{key:"addSymbols",value:function(G,Z,K,W,H,X,Y,se,Ae,fe){var de,ye=G.indexArray,Ce=G.layoutVertexArray,Se=G.dynamicLayoutVertexArray,Re=G.segments.prepareSegment(4*Z.length,G.layoutVertexArray,G.indexArray),Ie=this.glyphOffsetArray.length,Le=Re.vertexLength,je=l(Z);try{for(je.s();!(de=je.n()).done;){var Oe=de.value,At=Oe.tl,Bt=Oe.tr,nt=Oe.bl,mn=Oe.br,ct=Oe.tex,Vi=Re.vertexLength,di=Oe.glyphOffset[1];ue(Ce,se.x,se.y,At.x,di+At.y,ct.x,ct.y,K),ue(Ce,se.x,se.y,Bt.x,di+Bt.y,ct.x+ct.w,ct.y,K),ue(Ce,se.x,se.y,nt.x,di+nt.y,ct.x,ct.y+ct.h,K),ue(Ce,se.x,se.y,mn.x,di+mn.y,ct.x+ct.w,ct.y+ct.h,K),le(Se,se,0),ye.emplaceBack(Vi,Vi+1,Vi+2),ye.emplaceBack(Vi+1,Vi+2,Vi+3),Re.vertexLength+=4,Re.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(mr){je.e(mr)}finally{je.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Ie,this.glyphOffsetArray.length-Ie,Le,Ae,fe,se.segment,K?K[0]:0,K?K[1]:0,W[0],W[1],Y,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,X)}},{key:"_addCollisionDebugVertex",value:function(G,Z,K,W,H){return Z.emplaceBack(0,0),G.emplaceBack(K.x,K.y,W.x,W.y,Math.round(H.x),Math.round(H.y))}},{key:"addCollisionDebugVertices",value:function(G,Z,K,W,H,X,Y,se){var Ae=H.segments.prepareSegment(4,H.layoutVertexArray,H.indexArray),fe=Ae.vertexLength,de=H.layoutVertexArray,ye=H.collisionVertexArray;if(this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(G,Z)),this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(K,Z)),this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(K,W)),this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(G,W)),Ae.vertexLength+=4,se){var Ce=H.indexArray;Ce.emplaceBack(fe,fe+1,fe+2),Ce.emplaceBack(fe,fe+2,fe+3),Ae.primitiveLength+=2}else{var Se=H.indexArray;Se.emplaceBack(fe,fe+1),Se.emplaceBack(fe+1,fe+2),Se.emplaceBack(fe+2,fe+3),Se.emplaceBack(fe+3,fe),Ae.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,Z=l(this.symbolInstances);try{for(Z.s();!(G=Z.n()).done;){var K=G.value;K.textCollisionFeature={boxStartIndex:K.textBoxStartIndex,boxEndIndex:K.textBoxEndIndex},K.iconCollisionFeature={boxStartIndex:K.iconBoxStartIndex,boxEndIndex:K.iconBoxEndIndex};for(var W=0;W<2;W++){var H=K[W===0?"textCollisionFeature":"iconCollisionFeature"];if(H)for(var X=H.boxStartIndex;X<H.boxEndIndex;X++){var Y=this.collisionBoxArray.get(X),se=Y.x1,Ae=Y.y1,fe=Y.x2,de=Y.y2,ye=Y.radius>0;this.addCollisionDebugVertices(se,Ae,fe,de,ye?this.collisionCircle:this.collisionBox,Y.anchorPoint,K,ye)}}}}catch(Ce){Z.e(Ce)}finally{Z.f()}}},{key:"deserializeCollisionBoxes",value:function(G,Z,K,W,H){for(var X={},Y=Z;Y<K;Y++){var se=G.get(Y);if(se.radius===0){X.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}X.textCircles||(X.textCircles=[]),X.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var Ae=W;Ae<H;Ae++){var fe=G.get(Ae);if(fe.radius===0){X.iconBox={x1:fe.x1,y1:fe.y1,x2:fe.x2,y2:fe.y2,anchorPointX:fe.anchorPointX,anchorPointY:fe.anchorPointY};break}}return X}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasCollisionBoxData",value:function(){return this.collisionBox.segments.get().length>0}},{key:"hasCollisionCircleData",value:function(){return this.collisionCircle.segments.get().length>0}},{key:"sortFeatures",value:function(G){var Z=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var K=[],W=0;W<this.symbolInstances.length;W++)K.push(W);var H=Math.sin(G),X=Math.cos(G);K.sort(function(je,Oe){var At=Z.symbolInstances[je],Bt=Z.symbolInstances[Oe];return(H*At.anchor.x+X*At.anchor.y|0)-(H*Bt.anchor.x+X*Bt.anchor.y|0)||Bt.featureIndex-At.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var Y=0,se=K;Y<se.length;Y++){var Ae,fe=se[Y],de=l(this.symbolInstances[fe].placedTextSymbolIndices);try{for(de.s();!(Ae=de.n()).done;)for(var ye=Ae.value,Ce=this.text.placedSymbolArray.get(ye),Se=Ce.vertexStartIndex+4*Ce.numGlyphs,Re=Ce.vertexStartIndex;Re<Se;Re+=4)this.text.indexArray.emplaceBack(Re,Re+1,Re+2),this.text.indexArray.emplaceBack(Re+1,Re+2,Re+3)}catch(je){de.e(je)}finally{de.f()}var Ie=this.icon.placedSymbolArray.get(fe);if(Ie.numGlyphs){var Le=Ie.vertexStartIndex;this.icon.indexArray.emplaceBack(Le,Le+1,Le+2),this.icon.indexArray.emplaceBack(Le+1,Le+2,Le+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),q}();ie("SymbolBucket",$,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),$.MAX_GLYPHS=65535,$.addDynamicAttributes=le,r.exports=$},900:function(r){r.exports=8192},5346:function(r,a,s){function l(I,M){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||M){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
403
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var H,X=!0,Y=!1;return{s:function(){Z=Z.call(q)},n:function(){var se=Z.next();return X=se.done,se},e:function(se){Y=!0,H=se},f:function(){try{X||Z.return==null||Z.return()}finally{if(Y)throw H}}}}function u(q,G){(G==null||G>q.length)&&(G=q.length);for(var Z=0,K=new Array(G);Z<G;Z++)K[Z]=q[Z];return K}function A(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function h(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function f(q,G,Z){return G&&h(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var d=s(1203),p=d.symbolLayoutAttributes,g=d.collisionVertexAttributes,v=d.collisionBoxLayout,y=d.collisionCircleLayout,m=d.dynamicLayoutAttributes,b=s(4832),x=b.SymbolLayoutArray,E=b.SymbolDynamicLayoutArray,B=b.SymbolOpacityArray,P=b.CollisionBoxLayoutArray,I=b.CollisionCircleLayoutArray,M=b.CollisionVertexArray,F=b.PlacedSymbolArray,S=b.GlyphOffsetArray,T=b.SymbolLineVertexArray,w=s(5550),C=s(8500).SegmentVector,D=s(9063).ProgramConfigurationSet,R=s(9631),U=R.TriangleIndexArray,O=R.LineIndexArray,z=s(1447),k=s(8376),Q=s(6584),N=s(1438),j=s(8929).VectorTileFeature.types,J=s(7899),ee=(s(1397),s(724).getSizeData),ie=s(1786).register,oe=[{name:"a_fade_opacity",components:1,type:"Uint8",offset:0}];function ue(q,G,Z,K,W,H,X,Y){q.emplaceBack(G,Z,Math.round(64*K),Math.round(64*W),H,X,Y?Y[0]:0,Y?Y[1]:0)}function le(q,G,Z){q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z),q.emplaceBack(G.x,G.y,Z)}var ne=function(){function q(G){A(this,q),this.layoutVertexArray=new x,this.indexArray=new U,this.programConfigurations=G,this.segments=new C,this.dynamicLayoutVertexArray=new E,this.opacityVertexArray=new B,this.placedSymbolArray=new F}return f(q,[{key:"upload",value:function(G,Z){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,p.members),this.indexBuffer=G.createIndexBuffer(this.indexArray,Z),this.programConfigurations.upload(G),this.dynamicLayoutVertexBuffer=G.createVertexBuffer(this.dynamicLayoutVertexArray,m.members,!0),this.opacityVertexBuffer=G.createVertexBuffer(this.opacityVertexArray,oe,!0),this.opacityVertexBuffer.itemSize=1}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.programConfigurations.destroy(),this.segments.destroy(),this.dynamicLayoutVertexBuffer.destroy(),this.opacityVertexBuffer.destroy())}}]),q}();ie("SymbolBuffers",ne);var ce=function(){function q(G,Z,K){A(this,q),this.layoutVertexArray=new G,this.layoutAttributes=Z,this.indexArray=new K,this.segments=new C,this.collisionVertexArray=new M}return f(q,[{key:"upload",value:function(G){this.layoutVertexBuffer=G.createVertexBuffer(this.layoutVertexArray,this.layoutAttributes),this.indexBuffer=G.createIndexBuffer(this.indexArray),this.collisionVertexBuffer=G.createVertexBuffer(this.collisionVertexArray,g.members,!0)}},{key:"destroy",value:function(){this.layoutVertexBuffer&&(this.layoutVertexBuffer.destroy(),this.indexBuffer.destroy(),this.segments.destroy(),this.collisionVertexBuffer.destroy())}}]),q}();ie("CollisionBuffers",ce);var $=function(){function q(G){A(this,q),this.collisionBoxArray=G.collisionBoxArray,this.zoom=G.zoom,this.overscaling=G.overscaling,this.layers=G.layers,this.layerIds=this.layers.map(function(W){return W.id}),this.index=G.index,this.pixelRatio=G.pixelRatio;var Z=this.layers[0]._unevaluatedLayout._values;this.textSizeData=ee(this.zoom,Z["text-size"]),this.iconSizeData=ee(this.zoom,Z["icon-size"]);var K=this.layers[0].layout;this.sortFeaturesByY=K.get("text-allow-overlap")||K.get("icon-allow-overlap")||K.get("text-ignore-placement")||K.get("icon-ignore-placement")}return f(q,[{key:"createArrays",value:function(){this.text=new ne(new D(p.members,this.layers,this.zoom,function(G){return/^text/.test(G)})),this.icon=new ne(new D(p.members,this.layers,this.zoom,function(G){return/^icon/.test(G)})),this.collisionBox=new ce(P,v.members,O),this.collisionCircle=new ce(I,y.members,U),this.glyphOffsetArray=new S,this.lineVertexArray=new T}},{key:"populate",value:function(G,Z){var K=this.layers[0],W=K.layout,H=W.get("text-font"),X=W.get("text-field"),Y=W.get("icon-image"),se=(X.value.kind!=="constant"||X.value.value.length>0)&&(H.value.kind!=="constant"||H.value.value.length>0),Ae=Y.value.kind!=="constant"||Y.value.value&&Y.value.value.length>0;if(this.features=[],se||Ae){var fe,de=Z.iconDependencies,ye=Z.glyphDependencies,Ce={zoom:this.zoom},Se=l(G);try{for(Se.s();!(fe=Se.n()).done;){var Re=fe.value,Ie=Re.feature,Le=Re.index,je=Re.sourceLayerIndex;if(K._featureFilter(Ce,Ie)){var Oe=void 0;se&&(Oe=K.getValueAndResolveTokens("text-field",Ie),Oe=z(Oe,K,Ie));var At=void 0;if(Ae&&(At=K.getValueAndResolveTokens("icon-image",Ie)),Oe||At){var Bt={text:Oe,icon:At,index:Le,sourceLayerIndex:je,geometry:N(Ie),properties:Ie.properties,type:j[Ie.type]};if(Ie.id!==void 0&&(Bt.id=Ie.id),this.features.push(Bt),At&&(de[At]=!0),Oe){for(var nt=H.evaluate(Ie).join(","),mn=ye[nt]=ye[nt]||{},ct=W.get("text-rotation-alignment")==="map"&&W.get("symbol-placement")==="line",Vi=Q.allowsVerticalWritingMode(Oe),di=0;di<Oe.length;di++)if(mn[Oe.charCodeAt(di)]=!0,ct&&Vi){var mr=J.lookup[Oe.charAt(di)];mr&&(mn[mr.charCodeAt(0)]=!0)}}}}}}catch(UH){Se.e(UH)}finally{Se.f()}W.get("symbol-placement")==="line"&&(this.features=k(this.features))}}},{key:"isEmpty",value:function(){return this.symbolInstances.length===0}},{key:"upload",value:function(G){this.text.upload(G,this.sortFeaturesByY),this.icon.upload(G,this.sortFeaturesByY),this.collisionBox.upload(G),this.collisionCircle.upload(G)}},{key:"destroy",value:function(){this.text.destroy(),this.icon.destroy(),this.collisionBox.destroy(),this.collisionCircle.destroy()}},{key:"addToLineVertexArray",value:function(G,Z){var K=this.lineVertexArray.length;if(G.segment!==void 0){for(var W=G.dist(Z[G.segment+1]),H=G.dist(Z[G.segment]),X={},Y=G.segment+1;Y<Z.length;Y++)X[Y]={x:Z[Y].x,y:Z[Y].y,tileUnitDistanceFromAnchor:W},Y<Z.length-1&&(W+=Z[Y+1].dist(Z[Y]));for(var se=G.segment||0;se>=0;se--)X[se]={x:Z[se].x,y:Z[se].y,tileUnitDistanceFromAnchor:H},se>0&&(H+=Z[se-1].dist(Z[se]));for(var Ae=0;Ae<Z.length;Ae++){var fe=X[Ae];this.lineVertexArray.emplaceBack(fe.x,fe.y,fe.tileUnitDistanceFromAnchor)}}return{lineStartIndex:K,lineLength:this.lineVertexArray.length-K}}},{key:"addSymbols",value:function(G,Z,K,W,H,X,Y,se,Ae,fe){var de,ye=G.indexArray,Ce=G.layoutVertexArray,Se=G.dynamicLayoutVertexArray,Re=G.segments.prepareSegment(4*Z.length,G.layoutVertexArray,G.indexArray),Ie=this.glyphOffsetArray.length,Le=Re.vertexLength,je=l(Z);try{for(je.s();!(de=je.n()).done;){var Oe=de.value,At=Oe.tl,Bt=Oe.tr,nt=Oe.bl,mn=Oe.br,ct=Oe.tex,Vi=Re.vertexLength,di=Oe.glyphOffset[1];ue(Ce,se.x,se.y,At.x,di+At.y,ct.x,ct.y,K),ue(Ce,se.x,se.y,Bt.x,di+Bt.y,ct.x+ct.w,ct.y,K),ue(Ce,se.x,se.y,nt.x,di+nt.y,ct.x,ct.y+ct.h,K),ue(Ce,se.x,se.y,mn.x,di+mn.y,ct.x+ct.w,ct.y+ct.h,K),le(Se,se,0),ye.emplaceBack(Vi,Vi+1,Vi+2),ye.emplaceBack(Vi+1,Vi+2,Vi+3),Re.vertexLength+=4,Re.primitiveLength+=2,this.glyphOffsetArray.emplaceBack(Oe.glyphOffset[0])}}catch(mr){je.e(mr)}finally{je.f()}G.placedSymbolArray.emplaceBack(se.x,se.y,Ie,this.glyphOffsetArray.length-Ie,Le,Ae,fe,se.segment,K?K[0]:0,K?K[1]:0,W[0],W[1],Y,!1),G.programConfigurations.populatePaintArrays(G.layoutVertexArray.length,X)}},{key:"_addCollisionDebugVertex",value:function(G,Z,K,W,H){return Z.emplaceBack(0,0),G.emplaceBack(K.x,K.y,W.x,W.y,Math.round(H.x),Math.round(H.y))}},{key:"addCollisionDebugVertices",value:function(G,Z,K,W,H,X,Y,se){var Ae=H.segments.prepareSegment(4,H.layoutVertexArray,H.indexArray),fe=Ae.vertexLength,de=H.layoutVertexArray,ye=H.collisionVertexArray;if(this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(G,Z)),this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(K,Z)),this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(K,W)),this._addCollisionDebugVertex(de,ye,X,Y.anchor,new w(G,W)),Ae.vertexLength+=4,se){var Ce=H.indexArray;Ce.emplaceBack(fe,fe+1,fe+2),Ce.emplaceBack(fe,fe+2,fe+3),Ae.primitiveLength+=2}else{var Se=H.indexArray;Se.emplaceBack(fe,fe+1),Se.emplaceBack(fe+1,fe+2),Se.emplaceBack(fe+2,fe+3),Se.emplaceBack(fe+3,fe),Ae.primitiveLength+=4}}},{key:"generateCollisionDebugBuffers",value:function(){var G,Z=l(this.symbolInstances);try{for(Z.s();!(G=Z.n()).done;){var K=G.value;K.textCollisionFeature={boxStartIndex:K.textBoxStartIndex,boxEndIndex:K.textBoxEndIndex},K.iconCollisionFeature={boxStartIndex:K.iconBoxStartIndex,boxEndIndex:K.iconBoxEndIndex};for(var W=0;W<2;W++){var H=K[W===0?"textCollisionFeature":"iconCollisionFeature"];if(H)for(var X=H.boxStartIndex;X<H.boxEndIndex;X++){var Y=this.collisionBoxArray.get(X),se=Y.x1,Ae=Y.y1,fe=Y.x2,de=Y.y2,ye=Y.radius>0;this.addCollisionDebugVertices(se,Ae,fe,de,ye?this.collisionCircle:this.collisionBox,Y.anchorPoint,K,ye)}}}}catch(Ce){Z.e(Ce)}finally{Z.f()}}},{key:"deserializeCollisionBoxes",value:function(G,Z,K,W,H){for(var X={},Y=Z;Y<K;Y++){var se=G.get(Y);if(se.radius===0){X.textBox={x1:se.x1,y1:se.y1,x2:se.x2,y2:se.y2,anchorPointX:se.anchorPointX,anchorPointY:se.anchorPointY};break}X.textCircles||(X.textCircles=[]),X.textCircles.push(se.anchorPointX,se.anchorPointY,se.radius,se.signedDistanceFromAnchor,1)}for(var Ae=W;Ae<H;Ae++){var fe=G.get(Ae);if(fe.radius===0){X.iconBox={x1:fe.x1,y1:fe.y1,x2:fe.x2,y2:fe.y2,anchorPointX:fe.anchorPointX,anchorPointY:fe.anchorPointY};break}}return X}},{key:"hasTextData",value:function(){return this.text.segments.get().length>0}},{key:"hasIconData",value:function(){return this.icon.segments.get().length>0}},{key:"hasCollisionBoxData",value:function(){return this.collisionBox.segments.get().length>0}},{key:"hasCollisionCircleData",value:function(){return this.collisionCircle.segments.get().length>0}},{key:"sortFeatures",value:function(G){var Z=this;if(this.sortFeaturesByY&&this.sortedAngle!==G&&(this.sortedAngle=G,!(this.text.segments.get().length>1||this.icon.segments.get().length>1))){for(var K=[],W=0;W<this.symbolInstances.length;W++)K.push(W);var H=Math.sin(G),X=Math.cos(G);K.sort(function(je,Oe){var At=Z.symbolInstances[je],Bt=Z.symbolInstances[Oe];return(H*At.anchor.x+X*At.anchor.y|0)-(H*Bt.anchor.x+X*Bt.anchor.y|0)||Bt.featureIndex-At.featureIndex}),this.text.indexArray.clear(),this.icon.indexArray.clear();for(var Y=0,se=K;Y<se.length;Y++){var Ae,fe=se[Y],de=l(this.symbolInstances[fe].placedTextSymbolIndices);try{for(de.s();!(Ae=de.n()).done;)for(var ye=Ae.value,Ce=this.text.placedSymbolArray.get(ye),Se=Ce.vertexStartIndex+4*Ce.numGlyphs,Re=Ce.vertexStartIndex;Re<Se;Re+=4)this.text.indexArray.emplaceBack(Re,Re+1,Re+2),this.text.indexArray.emplaceBack(Re+1,Re+2,Re+3)}catch(je){de.e(je)}finally{de.f()}var Ie=this.icon.placedSymbolArray.get(fe);if(Ie.numGlyphs){var Le=Ie.vertexStartIndex;this.icon.indexArray.emplaceBack(Le,Le+1,Le+2),this.icon.indexArray.emplaceBack(Le+1,Le+2,Le+3)}}this.text.indexBuffer&&this.text.indexBuffer.updateData(this.text.indexArray),this.icon.indexBuffer&&this.icon.indexBuffer.updateData(this.icon.indexArray)}}}]),q}();ie("SymbolBucket",$,{omit:["layers","collisionBoxArray","features","compareText"],shallow:["symbolInstances"]}),$.MAX_GLYPHS=65535,$.addDynamicAttributes=le,r.exports=$},900:function(r){r.exports=8192},5346:function(r,a,s){function l(I,M){var F=typeof Symbol<"u"&&I[Symbol.iterator]||I["@@iterator"];if(!F){if(Array.isArray(I)||(F=function(R,U){if(R){if(typeof R=="string")return u(R,U);var O=Object.prototype.toString.call(R).slice(8,-1);return O==="Object"&&R.constructor&&(O=R.constructor.name),O==="Map"||O==="Set"?Array.from(R):O==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(O)?u(R,U):void 0}}(I))||M){F&&(I=F);var S=0,T=function(){};return{s:T,n:function(){return S>=I.length?{done:!0}:{done:!1,value:I[S++]}},e:function(R){throw R},f:T}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
404
404
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var w,C=!0,D=!1;return{s:function(){F=F.call(I)},n:function(){var R=F.next();return C=R.done,R},e:function(R){D=!0,w=R},f:function(){try{C||F.return==null||F.return()}finally{if(D)throw w}}}}function u(I,M){(M==null||M>I.length)&&(M=I.length);for(var F=0,S=new Array(M);F<M;F++)S[F]=I[F];return S}function A(I,M){for(var F=0;F<M.length;F++){var S=M[F];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(I,S.key,S)}}s(5550);var h=s(1438),f=s(900),d=s(1693),p=s(1412),g=s(621),v=s(8929),y=s(3614),m=s(3076),b=s(8316).arraysIntersect,x=(s(4792).OverscaledTileID,s(1786).register),E=s(4832).FeatureIndexArray,B=function(){function I(S,T,w,C){(function(D,R){if(!(D instanceof R))throw new TypeError("Cannot call a class as a function")})(this,I),this.tileID=S,this.overscaling=T,this.x=S.canonical.x,this.y=S.canonical.y,this.z=S.canonical.z,this.grid=w||new p(f,16,0),this.featureIndexArray=C||new E}var M,F;return M=I,(F=[{key:"insert",value:function(S,T,w,C,D){var R=this.featureIndexArray.length;this.featureIndexArray.emplaceBack(w,C,D);for(var U=0;U<T.length;U++){for(var O=T[U],z=[1/0,1/0,-1/0,-1/0],k=0;k<O.length;k++){var Q=O[k];z[0]=Math.min(z[0],Q.x),z[1]=Math.min(z[1],Q.y),z[2]=Math.max(z[2],Q.x),z[3]=Math.max(z[3],Q.y)}this.grid.insert(R,z[0],z[1],z[2],z[3])}}},{key:"query",value:function(S,T){this.vtLayers||(this.vtLayers=new v.VectorTile(new y(this.rawTileData)).layers,this.sourceLayerCoder=new g(this.vtLayers?Object.keys(this.vtLayers).sort():["_geojsonTileLayer"]));for(var w={},C=S.params||{},D=f/S.tileSize/S.scale,R=d(C.filter),U=S.queryGeometry,O=S.additionalRadius*D,z=1/0,k=1/0,Q=-1/0,N=-1/0,j=0;j<U.length;j++)for(var J=U[j],ee=0;ee<J.length;ee++){var ie=J[ee];z=Math.min(z,ie.x),k=Math.min(k,ie.y),Q=Math.max(Q,ie.x),N=Math.max(N,ie.y)}var oe=this.grid.query(z-O,k-O,Q+O,N+O);oe.sort(P),this.filterMatching(w,oe,this.featureIndexArray,U,R,C.layers,T,S.bearing,D);var ue=S.collisionIndex?S.collisionIndex.queryRenderedSymbols(U,this.tileID,f/S.tileSize,S.collisionBoxArray,S.sourceID,S.bucketInstanceIds):[];return ue.sort(),this.filterMatching(w,ue,S.collisionBoxArray,U,R,C.layers,T,S.bearing,D),w}},{key:"filterMatching",value:function(S,T,w,C,D,R,U,O,z){for(var k,Q=0;Q<T.length;Q++){var N=T[Q];if(N!==k){k=N;var j=w.get(N),J=this.bucketLayerIDs[j.bucketIndex];if(!R||b(R,J)){var ee=this.sourceLayerCoder.decode(j.sourceLayerIndex),ie=this.vtLayers[ee].feature(j.featureIndex);if(D({zoom:this.tileID.overscaledZ},ie))for(var oe=null,ue=0;ue<J.length;ue++){var le=J[ue];if(!(R&&R.indexOf(le)<0)){var ne=U[le];if(ne&&(ne.type==="symbol"||(oe||(oe=h(ie)),ne.queryIntersectsFeature(C,ie,oe,this.z,O,z)))){var ce=new m(ie,this.z,this.x,this.y);ce.layer=ne.serialize();var $=S[le];$===void 0&&($=S[le]=[]),$.push({featureIndex:N,feature:ce})}}}}}}}},{key:"hasLayer",value:function(S){var T,w=l(this.bucketLayerIDs);try{for(w.s();!(T=w.n()).done;){var C,D=l(T.value);try{for(D.s();!(C=D.n()).done;)if(S===C.value)return!0}catch(R){D.e(R)}finally{D.f()}}}catch(R){w.e(R)}finally{w.f()}return!1}}])&&A(M.prototype,F),Object.defineProperty(M,"prototype",{writable:!1}),I}();function P(I,M){return M-I}x("FeatureIndex",B,{omit:["rawTileData","sourceLayerCoder","collisionIndex"]}),r.exports=B},9631:function(r,a,s){r.exports={LineIndexArray:s(4832).LineIndexArray,TriangleIndexArray:s(4832).TriangleIndexArray}},1438:function(r,a,s){var l=s(8316),u=s(900),A={min:-1*Math.pow(2,15),max:Math.pow(2,15)-1};r.exports=function(h){for(var f=u/h.extent,d=h.loadGeometry(),p=0;p<d.length;p++)for(var g=d[p],v=0;v<g.length;v++){var y=g[v];y.x=Math.round(y.x*f),y.y=Math.round(y.y*f),(y.x<A.min||y.x>A.max||y.y<A.min||y.y>A.max)&&l.warnOnce("Geometry exceeds allowed extent, reduce your vector tile buffer size")}return d}},3326:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2}])},9063:function(r,a,s){function l(S,T){var w=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!w){if(Array.isArray(S)||(w=function(z,k){if(z){if(typeof z=="string")return u(z,k);var Q=Object.prototype.toString.call(z).slice(8,-1);return Q==="Object"&&z.constructor&&(Q=z.constructor.name),Q==="Map"||Q==="Set"?Array.from(z):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?u(z,k):void 0}}(S))||T){w&&(S=w);var C=0,D=function(){};return{s:D,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(z){throw z},f:D}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
405
405
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var R,U=!0,O=!1;return{s:function(){w=w.call(S)},n:function(){var z=w.next();return U=z.done,z},e:function(z){O=!0,R=z},f:function(){try{U||w.return==null||w.return()}finally{if(O)throw R}}}}function u(S,T){(T==null||T>S.length)&&(T=S.length);for(var w=0,C=new Array(T);w<T;w++)C[w]=S[w];return C}function A(S,T){if(!(S instanceof T))throw new TypeError("Cannot call a class as a function")}function h(S,T){for(var w=0;w<T.length;w++){var C=T[w];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(S,C.key,C)}}function f(S,T,w){return T&&h(S.prototype,T),w&&h(S,w),Object.defineProperty(S,"prototype",{writable:!1}),S}var d=s(9207).j,p=(s(6016),s(1786).register),g=s(5615).PossiblyEvaluatedPropertyValue,v=s(4832),y=v.StructArrayLayout1f4,m=v.StructArrayLayout2f8,b=v.StructArrayLayout4f16;function x(S){return[d(255*S.r,255*S.g),d(255*S.b,255*S.a)]}var E=function(){function S(T,w,C){A(this,S),this.value=T,this.name=w,this.type=C,this.statistics={max:-1/0}}return f(S,[{key:"defines",value:function(){return["#define HAS_UNIFORM_u_".concat(this.name)]}},{key:"populatePaintArray",value:function(){}},{key:"upload",value:function(){}},{key:"destroy",value:function(){}},{key:"setUniforms",value:function(T,w,C,D){var R=D.constantOr(this.value),U=T.gl;this.type==="color"?U.uniform4f(w.uniforms["u_".concat(this.name)],R.r,R.g,R.b,R.a):U.uniform1f(w.uniforms["u_".concat(this.name)],R)}}]),S}(),B=function(){function S(T,w,C){A(this,S),this.expression=T,this.name=w,this.type=C,this.statistics={max:-1/0};var D=C==="color"?m:y;this.paintVertexAttributes=[{name:"a_".concat(w),type:"Float32",components:C==="color"?2:1,offset:0}],this.paintVertexArray=new D}return f(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(T,w){var C=this.paintVertexArray,D=C.length;C.reserve(T);var R=this.expression.evaluate({zoom:0},w);if(this.type==="color")for(var U=x(R),O=D;O<T;O++)C.emplaceBack(U[0],U[1]);else{for(var z=D;z<T;z++)C.emplaceBack(R);this.statistics.max=Math.max(this.statistics.max,R)}}},{key:"upload",value:function(T){this.paintVertexArray&&(this.paintVertexBuffer=T.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"setUniforms",value:function(T,w){T.gl.uniform1f(w.uniforms["a_".concat(this.name,"_t")],0)}}]),S}(),P=function(){function S(T,w,C,D,R){A(this,S),this.expression=T,this.name=w,this.type=C,this.useIntegerZoom=D,this.zoom=R,this.statistics={max:-1/0};var U=C==="color"?b:m;this.paintVertexAttributes=[{name:"a_".concat(w),type:"Float32",components:C==="color"?4:2,offset:0}],this.paintVertexArray=new U}return f(S,[{key:"defines",value:function(){return[]}},{key:"populatePaintArray",value:function(T,w){var C=this.paintVertexArray,D=C.length;C.reserve(T);var R=this.expression.evaluate({zoom:this.zoom},w),U=this.expression.evaluate({zoom:this.zoom+1},w);if(this.type==="color")for(var O=x(R),z=x(U),k=D;k<T;k++)C.emplaceBack(O[0],O[1],z[0],z[1]);else{for(var Q=D;Q<T;Q++)C.emplaceBack(R,U);this.statistics.max=Math.max(this.statistics.max,R,U)}}},{key:"upload",value:function(T){this.paintVertexArray&&(this.paintVertexBuffer=T.createVertexBuffer(this.paintVertexArray,this.paintVertexAttributes))}},{key:"destroy",value:function(){this.paintVertexBuffer&&this.paintVertexBuffer.destroy()}},{key:"interpolationFactor",value:function(T){return this.useIntegerZoom?this.expression.interpolationFactor(Math.floor(T),this.zoom,this.zoom+1):this.expression.interpolationFactor(T,this.zoom,this.zoom+1)}},{key:"setUniforms",value:function(T,w,C){T.gl.uniform1f(w.uniforms["a_".concat(this.name,"_t")],this.interpolationFactor(C.zoom))}}]),S}(),I=function(){function S(){A(this,S),this.binders={},this.cacheKey="",this._buffers=[]}return f(S,[{key:"populatePaintArrays",value:function(T,w){for(var C in this.binders)this.binders[C].populatePaintArray(T,w)}},{key:"defines",value:function(){var T=[];for(var w in this.binders)T.push.apply(T,this.binders[w].defines());return T}},{key:"setUniforms",value:function(T,w,C,D){for(var R in this.binders)this.binders[R].setUniforms(T,w,D,C.get(R))}},{key:"getPaintVertexBuffers",value:function(){return this._buffers}},{key:"upload",value:function(T){for(var w in this.binders)this.binders[w].upload(T);var C=[];for(var D in this.binders){var R=this.binders[D];(R instanceof B||R instanceof P)&&R.paintVertexBuffer&&C.push(R.paintVertexBuffer)}this._buffers=C}},{key:"destroy",value:function(){for(var T in this.binders)this.binders[T].destroy()}}],[{key:"createDynamic",value:function(T,w,C){var D=new S,R=[];for(var U in T.paint._values)if(C(U)){var O=T.paint.get(U);if(O instanceof g&&O.property.specification["property-function"]){var z=F(U,T.type),k=O.property.specification.type,Q=O.property.useIntegerZoom;O.value.kind==="constant"?(D.binders[U]=new E(O.value,z,k),R.push("/u_".concat(z))):O.value.kind==="source"?(D.binders[U]=new B(O.value,z,k),R.push("/a_".concat(z))):(D.binders[U]=new P(O.value,z,k,Q,w),R.push("/z_".concat(z)))}}return D.cacheKey=R.sort().join(""),D}}]),S}(),M=function(){function S(T,w,C){var D=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){return!0};A(this,S),this.programConfigurations={};var R,U=l(w);try{for(U.s();!(R=U.n()).done;){var O=R.value;this.programConfigurations[O.id]=I.createDynamic(O,C,D),this.programConfigurations[O.id].layoutAttributes=T}}catch(z){U.e(z)}finally{U.f()}}return f(S,[{key:"populatePaintArrays",value:function(T,w){for(var C in this.programConfigurations)this.programConfigurations[C].populatePaintArrays(T,w)}},{key:"get",value:function(T){return this.programConfigurations[T]}},{key:"upload",value:function(T){for(var w in this.programConfigurations)this.programConfigurations[w].upload(T)}},{key:"destroy",value:function(){for(var T in this.programConfigurations)this.programConfigurations[T].destroy()}}]),S}();function F(S,T){return{"text-opacity":"opacity","icon-opacity":"opacity","text-color":"fill_color","icon-color":"fill_color","text-halo-color":"halo_color","icon-halo-color":"halo_color","text-halo-blur":"halo_blur","icon-halo-blur":"halo_blur","text-halo-width":"halo_width","icon-halo-width":"halo_width","line-gap-width":"gapwidth"}[S]||S.replace("".concat(T,"-"),"").replace(/-/g,"_")}p("ConstantBinder",E),p("SourceExpressionBinder",B),p("CompositeExpressionBinder",P),p("ProgramConfiguration",I,{omit:["_buffers"]}),p("ProgramConfigurationSet",M),r.exports={ProgramConfiguration:I,ProgramConfigurationSet:M}},2596:function(r,a,s){var l=s(6693).createLayout;r.exports=l([{name:"a_pos",type:"Int16",components:2},{name:"a_texture_pos",type:"Int16",components:2}])},8500:function(r,a,s){function l(g,v){(v==null||v>g.length)&&(v=g.length);for(var y=0,m=new Array(v);y<v;y++)m[y]=g[y];return m}function u(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")}function A(g,v){for(var y=0;y<v.length;y++){var m=v[y];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(g,m.key,m)}}var h=s(8316).warnOnce,f=s(1786).register,d=Math.pow(2,16)-1,p=function(){function g(){var m=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u(this,g),this.segments=m}var v,y;return v=g,(y=[{key:"prepareSegment",value:function(m,b,x){var E=this.segments[this.segments.length-1];return m>d&&h("Max vertices per segment is ".concat(d,": bucket requested ").concat(m)),(!E||E.vertexLength+m>r.exports.MAX_VERTEX_ARRAY_LENGTH)&&(E={vertexOffset:b.length,primitiveOffset:x.length,vertexLength:0,primitiveLength:0},this.segments.push(E)),E}},{key:"get",value:function(){return this.segments}},{key:"destroy",value:function(){var m,b=function(B,P){var I=typeof Symbol<"u"&&B[Symbol.iterator]||B["@@iterator"];if(!I){if(Array.isArray(B)||(I=function(C,D){if(C){if(typeof C=="string")return l(C,D);var R=Object.prototype.toString.call(C).slice(8,-1);return R==="Object"&&C.constructor&&(R=C.constructor.name),R==="Map"||R==="Set"?Array.from(C):R==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(R)?l(C,D):void 0}}(B))||P){I&&(B=I);var M=0,F=function(){};return{s:F,n:function(){return M>=B.length?{done:!0}:{done:!1,value:B[M++]}},e:function(C){throw C},f:F}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
406
406
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var S,T=!0,w=!1;return{s:function(){I=I.call(B)},n:function(){var C=I.next();return T=C.done,C},e:function(C){w=!0,S=C},f:function(){try{T||I.return==null||I.return()}finally{if(w)throw S}}}}(this.segments);try{for(b.s();!(m=b.n()).done;){var x=m.value;for(var E in x.vaos)x.vaos[E].destroy()}}catch(B){b.e(B)}finally{b.f()}}}])&&A(v.prototype,y),Object.defineProperty(v,"prototype",{writable:!1}),g}();f("SegmentVector",p),r.exports={SegmentVector:p,MAX_VERTEX_ARRAY_LENGTH:d}},3892:function(r){function a(l,u){for(var A=0;A<u.length;A++){var h=u[A];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(l,h.key,h)}}var s=function(){function l(h,f,d){(function(p,g){if(!(p instanceof g))throw new TypeError("Cannot call a class as a function")})(this,l),this.column=h,this.row=f,this.zoom=d}var u,A;return u=l,(A=[{key:"clone",value:function(){return new l(this.column,this.row,this.zoom)}},{key:"zoomTo",value:function(h){return this.clone()._zoomTo(h)}},{key:"sub",value:function(h){return this.clone()._sub(h)}},{key:"_zoomTo",value:function(h){var f=Math.pow(2,h-this.zoom);return this.column*=f,this.row*=f,this.zoom=h,this}},{key:"_sub",value:function(h){return h=h.zoomTo(this.zoom),this.column-=h.column,this.row-=h.row,this}}])&&a(u.prototype,A),Object.defineProperty(u,"prototype",{writable:!1}),l}();r.exports=s},9069:function(r,a,s){function l(f){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d},l(f)}function u(f,d){for(var p=0;p<d.length;p++){var g=d[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(f,g.key,g)}}var A=s(8316).wrap,h=function(){function f(v,y){if(function(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")}(this,f),isNaN(v)||isNaN(y))throw new Error("Invalid LngLat object: (".concat(v,", ").concat(y,")"));if(this.lng=+v,this.lat=+y,this.lat>90||this.lat<-90)throw new Error("Invalid LngLat latitude value: must be between -90 and 90")}var d,p,g;return d=f,g=[{key:"convert",value:function(v){if(v instanceof f)return v;if(Array.isArray(v)&&(v.length===2||v.length===3))return new f(Number(v[0]),Number(v[1]));if(!Array.isArray(v)&&l(v)==="object"&&v!==null)return new f(Number(v.lng),Number(v.lat));throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: <lng>, lat: <lat>}, or an array of [<lng>, <lat>]")}}],(p=[{key:"wrap",value:function(){return new f(A(this.lng,-180,180),this.lat)}},{key:"toArray",value:function(){return[this.lng,this.lat]}},{key:"toString",value:function(){return"LngLat(".concat(this.lng,", ").concat(this.lat,")")}},{key:"toBounds",value:function(v){var y=360*v/40075017,m=y/Math.cos(Math.PI/180*this.lat);return new(s(4899))(new f(this.lng-m,this.lat-y),new f(this.lng+m,this.lat+y))}}])&&u(d.prototype,p),g&&u(d,g),Object.defineProperty(d,"prototype",{writable:!1}),f}();r.exports=h},4899:function(r,a,s){function l(h,f){for(var d=0;d<f.length;d++){var p=f[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}var u=s(9069),A=function(){function h(g,v){(function(y,m){if(!(y instanceof m))throw new TypeError("Cannot call a class as a function")})(this,h),g&&(v?this.setSouthWest(g).setNorthEast(v):g.length===4?this.setSouthWest([g[0],g[1]]).setNorthEast([g[2],g[3]]):this.setSouthWest(g[0]).setNorthEast(g[1]))}var f,d,p;return f=h,p=[{key:"convert",value:function(g){return!g||g instanceof h?g:new h(g)}}],(d=[{key:"setNorthEast",value:function(g){return this._ne=g instanceof u?new u(g.lng,g.lat):u.convert(g),this}},{key:"setSouthWest",value:function(g){return this._sw=g instanceof u?new u(g.lng,g.lat):u.convert(g),this}},{key:"extend",value:function(g){var v,y,m=this._sw,b=this._ne;if(g instanceof u)v=g,y=g;else{if(!(g instanceof h))return Array.isArray(g)?g.every(Array.isArray)?this.extend(h.convert(g)):this.extend(u.convert(g)):this;if(v=g._sw,y=g._ne,!v||!y)return this}return m||b?(m.lng=Math.min(v.lng,m.lng),m.lat=Math.min(v.lat,m.lat),b.lng=Math.max(y.lng,b.lng),b.lat=Math.max(y.lat,b.lat)):(this._sw=new u(v.lng,v.lat),this._ne=new u(y.lng,y.lat)),this}},{key:"getCenter",value:function(){return new u((this._sw.lng+this._ne.lng)/2,(this._sw.lat+this._ne.lat)/2)}},{key:"getSouthWest",value:function(){return this._sw}},{key:"getNorthEast",value:function(){return this._ne}},{key:"getNorthWest",value:function(){return new u(this.getWest(),this.getNorth())}},{key:"getSouthEast",value:function(){return new u(this.getEast(),this.getSouth())}},{key:"getWest",value:function(){return this._sw.lng}},{key:"getSouth",value:function(){return this._sw.lat}},{key:"getEast",value:function(){return this._ne.lng}},{key:"getNorth",value:function(){return this._ne.lat}},{key:"toArray",value:function(){return[this._sw.toArray(),this._ne.toArray()]}},{key:"toString",value:function(){return"LngLatBounds(".concat(this._sw.toString(),", ").concat(this._ne.toString(),")")}},{key:"isEmpty",value:function(){return!(this._sw&&this._ne)}}])&&l(f.prototype,d),p&&l(f,p),Object.defineProperty(f,"prototype",{writable:!1}),h}();r.exports=A},7773:function(r,a,s){function l(P,I){for(var M=0;M<I.length;M++){var F=I[M];F.enumerable=F.enumerable||!1,F.configurable=!0,"value"in F&&(F.writable=!0),Object.defineProperty(P,F.key,F)}}var u=s(9069),A=s(5550),h=s(3892),f=s(8316),d=s(2643).number,p=s(1803),g=s(4792),v=(g.CanonicalTileID,g.UnwrappedTileID),y=s(900),m=s(3226),b=m.vec4,x=m.mat4,E=m.mat2,B=function(){function P(F,S,T){(function(w,C){if(!(w instanceof C))throw new TypeError("Cannot call a class as a function")})(this,P),this.tileSize=512,this._renderWorldCopies=T===void 0||T,this._minZoom=F||0,this._maxZoom=S||22,this.latRange=[-85.05113,85.05113],this.width=0,this.height=0,this._center=new u(0,0),this.zoom=0,this.angle=0,this._fov=.6435011087932844,this._pitch=0,this._unmodified=!0,this._posMatrixCache={}}var I,M;return I=P,(M=[{key:"clone",value:function(){var F=new P(this._minZoom,this._maxZoom,this._renderWorldCopies);return F.tileSize=this.tileSize,F.latRange=this.latRange,F.width=this.width,F.height=this.height,F._center=this._center,F.zoom=this.zoom,F.angle=this.angle,F._fov=this._fov,F._pitch=this._pitch,F._unmodified=this._unmodified,F._calcMatrices(),F}},{key:"minZoom",get:function(){return this._minZoom},set:function(F){this._minZoom!==F&&(this._minZoom=F,this.zoom=Math.max(this.zoom,F))}},{key:"maxZoom",get:function(){return this._maxZoom},set:function(F){this._maxZoom!==F&&(this._maxZoom=F,this.zoom=Math.min(this.zoom,F))}},{key:"renderWorldCopies",get:function(){return this._renderWorldCopies}},{key:"worldSize",get:function(){return this.tileSize*this.scale}},{key:"centerPoint",get:function(){return this.size._div(2)}},{key:"size",get:function(){return new A(this.width,this.height)}},{key:"bearing",get:function(){return-this.angle/Math.PI*180},set:function(F){var S=-f.wrap(F,-180,180)*Math.PI/180;this.angle!==S&&(this._unmodified=!1,this.angle=S,this._calcMatrices(),this.rotationMatrix=E.create(),E.rotate(this.rotationMatrix,this.rotationMatrix,this.angle))}},{key:"pitch",get:function(){return this._pitch/Math.PI*180},set:function(F){var S=f.clamp(F,0,60)/180*Math.PI;this._pitch!==S&&(this._unmodified=!1,this._pitch=S,this._calcMatrices())}},{key:"fov",get:function(){return this._fov/Math.PI*180},set:function(F){F=Math.max(.01,Math.min(60,F)),this._fov!==F&&(this._unmodified=!1,this._fov=F/180*Math.PI,this._calcMatrices())}},{key:"zoom",get:function(){return this._zoom},set:function(F){var S=Math.min(Math.max(F,this.minZoom),this.maxZoom);this._zoom!==S&&(this._unmodified=!1,this._zoom=S,this.scale=this.zoomScale(S),this.tileZoom=Math.floor(S),this.zoomFraction=S-this.tileZoom,this._constrain(),this._calcMatrices())}},{key:"center",get:function(){return this._center},set:function(F){F.lat===this._center.lat&&F.lng===this._center.lng||(this._unmodified=!1,this._center=F,this._constrain(),this._calcMatrices())}},{key:"coveringZoomLevel",value:function(F){return(F.roundZoom?Math.round:Math.floor)(this.zoom+this.scaleZoom(this.tileSize/F.tileSize))}},{key:"getVisibleUnwrappedCoordinates",value:function(F){var S=this.pointCoordinate(new A(0,0),0),T=this.pointCoordinate(new A(this.width,0),0),w=Math.floor(S.column),C=Math.floor(T.column),D=[new v(0,F)];if(this._renderWorldCopies)for(var R=w;R<=C;R++)R!==0&&D.push(new v(R,F));return D}},{key:"coveringTiles",value:function(F){var S=this.coveringZoomLevel(F),T=S;if(F.minzoom!==void 0&&S<F.minzoom)return[];F.maxzoom!==void 0&&S>F.maxzoom&&(S=F.maxzoom);var w=this.pointCoordinate(this.centerPoint,S),C=new A(w.column-.5,w.row-.5),D=[this.pointCoordinate(new A(0,0),S),this.pointCoordinate(new A(this.width,0),S),this.pointCoordinate(new A(this.width,this.height),S),this.pointCoordinate(new A(0,this.height),S)];return p(S,D,F.reparseOverscaled?T:S,this._renderWorldCopies).sort(function(R,U){return C.dist(R.canonical)-C.dist(U.canonical)})}},{key:"resize",value:function(F,S){this.width=F,this.height=S,this.pixelsToGLUnits=[2/F,-2/S],this._constrain(),this._calcMatrices()}},{key:"unmodified",get:function(){return this._unmodified}},{key:"zoomScale",value:function(F){return Math.pow(2,F)}},{key:"scaleZoom",value:function(F){return Math.log(F)/Math.LN2}},{key:"project",value:function(F){return new A(this.lngX(F.lng),this.latY(F.lat))}},{key:"unproject",value:function(F){return new u(this.xLng(F.x),this.yLat(F.y))}},{key:"x",get:function(){return this.lngX(this.center.lng)}},{key:"y",get:function(){return this.latY(this.center.lat)}},{key:"point",get:function(){return new A(this.x,this.y)}},{key:"lngX",value:function(F){return(180+F)*this.worldSize/360}},{key:"latY",value:function(F){return(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+F*Math.PI/360)))*this.worldSize/360}},{key:"xLng",value:function(F){return 360*F/this.worldSize-180}},{key:"yLat",value:function(F){var S=180-360*F/this.worldSize;return 360/Math.PI*Math.atan(Math.exp(S*Math.PI/180))-90}},{key:"setLocationAtPoint",value:function(F,S){var T=this.pointCoordinate(S)._sub(this.pointCoordinate(this.centerPoint));this.center=this.coordinateLocation(this.locationCoordinate(F)._sub(T)),this._renderWorldCopies&&(this.center=this.center.wrap())}},{key:"locationPoint",value:function(F){return this.coordinatePoint(this.locationCoordinate(F))}},{key:"pointLocation",value:function(F){return this.coordinateLocation(this.pointCoordinate(F))}},{key:"locationCoordinate",value:function(F){return new h(this.lngX(F.lng)/this.tileSize,this.latY(F.lat)/this.tileSize,this.zoom).zoomTo(this.tileZoom)}},{key:"coordinateLocation",value:function(F){var S=F.zoomTo(this.zoom);return new u(this.xLng(S.column*this.tileSize),this.yLat(S.row*this.tileSize))}},{key:"pointCoordinate",value:function(F,S){S===void 0&&(S=this.tileZoom);var T=[F.x,F.y,0,1],w=[F.x,F.y,1,1];b.transformMat4(T,T,this.pixelMatrixInverse),b.transformMat4(w,w,this.pixelMatrixInverse);var C=T[3],D=w[3],R=T[1]/C,U=w[1]/D,O=T[2]/C,z=w[2]/D,k=O===z?0:(0-O)/(z-O);return new h(d(T[0]/C,w[0]/D,k)/this.tileSize,d(R,U,k)/this.tileSize,this.zoom)._zoomTo(S)}},{key:"coordinatePoint",value:function(F){var S=F.zoomTo(this.zoom),T=[S.column*this.tileSize,S.row*this.tileSize,0,1];return b.transformMat4(T,T,this.pixelMatrix),new A(T[0]/T[3],T[1]/T[3])}},{key:"calculatePosMatrix",value:function(F){var S=F.key;if(this._posMatrixCache[S])return this._posMatrixCache[S];var T=F.canonical,w=this.worldSize/this.zoomScale(T.z),C=T.x+Math.pow(2,T.z)*F.wrap,D=x.identity(new Float64Array(16));return x.translate(D,D,[C*w,T.y*w,0]),x.scale(D,D,[w/y,w/y,1]),x.multiply(D,this.projMatrix,D),this._posMatrixCache[S]=new Float32Array(D),this._posMatrixCache[S]}},{key:"_constrain",value:function(){if(this.center&&this.width&&this.height&&!this._constraining){this._constraining=!0;var F,S,T,w,C=-90,D=90,R=-180,U=180,O=this.size,z=this._unmodified;if(this.latRange){var k=this.latRange;C=this.latY(k[1]),F=(D=this.latY(k[0]))-C<O.y?O.y/(D-C):0}if(this.lngRange){var Q=this.lngRange;R=this.lngX(Q[0]),S=(U=this.lngX(Q[1]))-R<O.x?O.x/(U-R):0}var N=Math.max(S||0,F||0);if(N)return this.center=this.unproject(new A(S?(U+R)/2:this.x,F?(D+C)/2:this.y)),this.zoom+=this.scaleZoom(N),this._unmodified=z,void(this._constraining=!1);if(this.latRange){var j=this.y,J=O.y/2;j-J<C&&(w=C+J),j+J>D&&(w=D-J)}if(this.lngRange){var ee=this.x,ie=O.x/2;ee-ie<R&&(T=R+ie),ee+ie>U&&(T=U-ie)}T===void 0&&w===void 0||(this.center=this.unproject(new A(T!==void 0?T:this.x,w!==void 0?w:this.y))),this._unmodified=z,this._constraining=!1}}},{key:"_calcMatrices",value:function(){if(this.height){this.cameraToCenterDistance=.5/Math.tan(this._fov/2)*this.height;var F=this._fov/2,S=Math.PI/2+this._pitch,T=Math.sin(F)*this.cameraToCenterDistance/Math.sin(Math.PI-S-F),w=1.01*(Math.cos(Math.PI/2-this._pitch)*T+this.cameraToCenterDistance),C=new Float64Array(16);x.perspective(C,this._fov,this.width/this.height,1,w),x.scale(C,C,[1,-1,1]),x.translate(C,C,[0,0,-this.cameraToCenterDistance]),x.rotateX(C,C,this._pitch),x.rotateZ(C,C,this.angle),x.translate(C,C,[-this.x,-this.y,0]);var D=this.worldSize/(2*Math.PI*6378137*Math.abs(Math.cos(this.center.lat*(Math.PI/180))));if(x.scale(C,C,[1,1,D,1]),this.projMatrix=C,C=x.create(),x.scale(C,C,[this.width/2,-this.height/2,1]),x.translate(C,C,[1,-1,0]),this.pixelMatrix=x.multiply(new Float64Array(16),C,this.projMatrix),!(C=x.invert(new Float64Array(16),this.pixelMatrix)))throw new Error("failed to invert matrix");this.pixelMatrixInverse=C,this._posMatrixCache={}}}}])&&l(I.prototype,M),Object.defineProperty(I,"prototype",{writable:!1}),P}();r.exports=B},129:function(r,a,s){function l(h,f,d){return Object.defineProperty(h,"prototype",{writable:!1}),h}var u=s(6016),A=l(function h(f,d,p){(function(g,v){if(!(g instanceof v))throw new TypeError("Cannot call a class as a function")})(this,h),this.blendFunction=f,this.blendColor=d,this.mask=p});A.Replace=[1,0],A.disabled=new A(A.Replace,u.transparent,[!1,!1,!1,!1]),A.unblended=new A(A.Replace,u.transparent,[!0,!0,!0,!0]),A.alphaBlended=new A([1,771],u.transparent,[!0,!0,!0,!0]),r.exports=A},206:function(r,a,s){function l(oe,ue){for(var le=0;le<ue.length;le++){var ne=ue[le];ne.enumerable=ne.enumerable||!1,ne.configurable=!0,"value"in ne&&(ne.writable=!0),Object.defineProperty(oe,ne.key,ne)}}var u=s(7612),A=s(3292),h=s(5197),f=(s(6937),s(2749),s(129)),d=s(8316),p=s(2578),g=p.ClearColor,v=p.ClearDepth,y=p.ClearStencil,m=p.ColorMask,b=p.DepthMask,x=p.StencilMask,E=p.StencilFunc,B=p.StencilOp,P=p.StencilTest,I=p.DepthRange,M=p.DepthTest,F=p.DepthFunc,S=p.Blend,T=p.BlendFunc,w=p.BlendColor,C=p.Program,D=p.LineWidth,R=p.ActiveTextureUnit,U=p.Viewport,O=p.BindFramebuffer,z=p.BindRenderbuffer,k=p.BindTexture,Q=p.BindVertexBuffer,N=p.BindElementBuffer,j=p.BindVertexArrayOES,J=p.PixelStoreUnpack,ee=p.PixelStoreUnpackPremultiplyAlpha,ie=function(){function oe(ne){(function(ce,$){if(!(ce instanceof $))throw new TypeError("Cannot call a class as a function")})(this,oe),this.gl=ne,this.extVertexArrayObject=this.gl.getExtension("OES_vertex_array_object"),this.lineWidthRange=ne.getParameter(ne.ALIASED_LINE_WIDTH_RANGE),this.clearColor=new g(this),this.clearDepth=new v(this),this.clearStencil=new y(this),this.colorMask=new m(this),this.depthMask=new b(this),this.stencilMask=new x(this),this.stencilFunc=new E(this),this.stencilOp=new B(this),this.stencilTest=new P(this),this.depthRange=new I(this),this.depthTest=new M(this),this.depthFunc=new F(this),this.blend=new S(this),this.blendFunc=new T(this),this.blendColor=new w(this),this.program=new C(this),this.lineWidth=new D(this),this.activeTexture=new R(this),this.viewport=new U(this),this.bindFramebuffer=new O(this),this.bindRenderbuffer=new z(this),this.bindTexture=new k(this),this.bindVertexBuffer=new Q(this),this.bindElementBuffer=new N(this),this.bindVertexArrayOES=this.extVertexArrayObject&&new j(this),this.pixelStoreUnpack=new J(this),this.pixelStoreUnpackPremultiplyAlpha=new ee(this),this.extTextureFilterAnisotropic=ne.getExtension("EXT_texture_filter_anisotropic")||ne.getExtension("MOZ_EXT_texture_filter_anisotropic")||ne.getExtension("WEBKIT_EXT_texture_filter_anisotropic"),this.extTextureFilterAnisotropic&&(this.extTextureFilterAnisotropicMax=ne.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)),this.extTextureHalfFloat=ne.getExtension("OES_texture_half_float"),this.extTextureHalfFloat&&ne.getExtension("OES_texture_half_float_linear")}var ue,le;return ue=oe,(le=[{key:"createIndexBuffer",value:function(ne,ce){return new u(this,ne,ce)}},{key:"createVertexBuffer",value:function(ne,ce,$){return new A(this,ne,ce,$)}},{key:"createRenderbuffer",value:function(ne,ce,$){var q=this.gl,G=q.createRenderbuffer();return this.bindRenderbuffer.set(G),q.renderbufferStorage(q.RENDERBUFFER,ne,ce,$),this.bindRenderbuffer.set(null),G}},{key:"createFramebuffer",value:function(ne,ce){return new h(this,ne,ce)}},{key:"clear",value:function(ne){var ce=ne.color,$=ne.depth,q=this.gl,G=0;ce&&(G|=q.COLOR_BUFFER_BIT,this.clearColor.set(ce),this.colorMask.set([!0,!0,!0,!0])),$!==void 0&&(G|=q.DEPTH_BUFFER_BIT,this.clearDepth.set($),this.depthMask.set(!0)),q.clear(G)}},{key:"setDepthMode",value:function(ne){ne.func!==this.gl.ALWAYS||ne.mask?(this.depthTest.set(!0),this.depthFunc.set(ne.func),this.depthMask.set(ne.mask),this.depthRange.set(ne.range)):this.depthTest.set(!1)}},{key:"setStencilMode",value:function(ne){ne.func!==this.gl.ALWAYS||ne.mask?(this.stencilTest.set(!0),this.stencilMask.set(ne.mask),this.stencilOp.set([ne.fail,ne.depthFail,ne.pass]),this.stencilFunc.set({func:ne.test.func,ref:ne.ref,mask:ne.test.mask})):this.stencilTest.set(!1)}},{key:"setColorMode",value:function(ne){d.deepEqual(ne.blendFunction,f.Replace)?this.blend.set(!1):(this.blend.set(!0),this.blendFunc.set(ne.blendFunction),this.blendColor.set(ne.blendColor)),this.colorMask.set(ne.mask)}}])&&l(ue.prototype,le),Object.defineProperty(ue,"prototype",{writable:!1}),oe}();r.exports=ie},6937:function(r){function a(l,u,A){return Object.defineProperty(l,"prototype",{writable:!1}),l}var s=a(function l(u,A,h){(function(f,d){if(!(f instanceof d))throw new TypeError("Cannot call a class as a function")})(this,l),this.func=u,this.mask=A,this.range=h});s.ReadOnly=!1,s.ReadWrite=!0,s.disabled=new s(519,s.ReadOnly,[0,1]),r.exports=s},5197:function(r,a,s){function l(d,p){for(var g=0;g<p.length;g++){var v=p[g];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(d,v.key,v)}}var u=s(2578),A=u.ColorAttachment,h=u.DepthAttachment,f=function(){function d(v,y,m){(function(E,B){if(!(E instanceof B))throw new TypeError("Cannot call a class as a function")})(this,d),this.context=v,this.width=y,this.height=m;var b=v.gl,x=this.framebuffer=b.createFramebuffer();this.colorAttachment=new A(v,x),this.depthAttachment=new h(v,x)}var p,g;return p=d,(g=[{key:"destroy",value:function(){var v=this.context.gl,y=this.colorAttachment.get();y&&v.deleteTexture(y);var m=this.depthAttachment.get();m&&v.deleteRenderbuffer(m),v.deleteFramebuffer(this.framebuffer)}}])&&l(p.prototype,g),Object.defineProperty(p,"prototype",{writable:!1}),d}();r.exports=f},7612:function(r,a,s){function l(h,f){for(var d=0;d<f.length;d++){var p=f[d];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(h,p.key,p)}}var u=s(8583),A=function(){function h(p,g,v){(function(m,b){if(!(m instanceof b))throw new TypeError("Cannot call a class as a function")})(this,h),this.context=p;var y=p.gl;this.buffer=y.createBuffer(),this.dynamicDraw=!!v,this.unbindVAO(),p.bindElementBuffer.set(this.buffer),y.bufferData(y.ELEMENT_ARRAY_BUFFER,g.arrayBuffer,this.dynamicDraw?y.DYNAMIC_DRAW:y.STATIC_DRAW),this.dynamicDraw||delete g.arrayBuffer}var f,d;return f=h,(d=[{key:"unbindVAO",value:function(){this.context.extVertexArrayObject&&this.context.bindVertexArrayOES.set(null)}},{key:"bind",value:function(){this.context.bindElementBuffer.set(this.buffer)}},{key:"updateData",value:function(p){var g=this.context.gl;u(this.dynamicDraw),this.unbindVAO(),this.bind(),g.bufferSubData(g.ELEMENT_ARRAY_BUFFER,0,p.arrayBuffer)}},{key:"destroy",value:function(){var p=this.context.gl;this.buffer&&(p.deleteBuffer(this.buffer),delete this.buffer)}}])&&l(f.prototype,d),Object.defineProperty(f,"prototype",{writable:!1}),h}();r.exports=A},2749:function(r){function a(u,A,h){return Object.defineProperty(u,"prototype",{writable:!1}),u}var s=7680,l=a(function u(A,h,f,d,p,g){(function(v,y){if(!(v instanceof y))throw new TypeError("Cannot call a class as a function")})(this,u),this.test=A,this.ref=h,this.mask=f,this.fail=d,this.depthFail=p,this.pass=g});l.disabled=new l({func:519,mask:0},0,0,s,s,s),r.exports=l},2578:function(r,a,s){function l(q){return l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(G){return typeof G}:function(G){return G&&typeof Symbol=="function"&&G.constructor===Symbol&&G!==Symbol.prototype?"symbol":typeof G},l(q)}function u(q,G){if(typeof G!="function"&&G!==null)throw new TypeError("Super expression must either be null or a function");q.prototype=Object.create(G&&G.prototype,{constructor:{value:q,writable:!0,configurable:!0}}),Object.defineProperty(q,"prototype",{writable:!1}),G&&A(q,G)}function A(q,G){return A=Object.setPrototypeOf||function(Z,K){return Z.__proto__=K,Z},A(q,G)}function h(q){var G=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var Z,K=d(q);if(G){var W=d(this).constructor;Z=Reflect.construct(K,arguments,W)}else Z=K.apply(this,arguments);return f(this,Z)}}function f(q,G){if(G&&(l(G)==="object"||typeof G=="function"))return G;if(G!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(Z){if(Z===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Z}(q)}function d(q){return d=Object.setPrototypeOf?Object.getPrototypeOf:function(G){return G.__proto__||Object.getPrototypeOf(G)},d(q)}function p(q,G){if(!(q instanceof G))throw new TypeError("Cannot call a class as a function")}function g(q,G){for(var Z=0;Z<G.length;Z++){var K=G[Z];K.enumerable=K.enumerable||!1,K.configurable=!0,"value"in K&&(K.writable=!0),Object.defineProperty(q,K.key,K)}}function v(q,G,Z){return G&&g(q.prototype,G),Object.defineProperty(q,"prototype",{writable:!1}),q}var y=s(6016),m=s(8316),b=function(){function q(G){p(this,q),this.context=G,this.current=y.transparent}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.r===Z.r&&G.g===Z.g&&G.b===Z.b&&G.a===Z.a||(this.context.gl.clearColor(G.r,G.g,G.b,G.a),this.current=G)}}]),q}(),x=function(){function q(G){p(this,q),this.context=G,this.current=1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearDepth(G),this.current=G)}}]),q}(),E=function(){function q(G){p(this,q),this.context=G,this.current=0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.clearStencil(G),this.current=G)}}]),q}(),B=function(){function q(G){p(this,q),this.context=G,this.current=[!0,!0,!0,!0]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]&&G[3]===Z[3]||(this.context.gl.colorMask(G[0],G[1],G[2],G[3]),this.current=G)}}]),q}(),P=function(){function q(G){p(this,q),this.context=G,this.current=!0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthMask(G),this.current=G)}}]),q}(),I=function(){function q(G){p(this,q),this.context=G,this.current=255}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.stencilMask(G),this.current=G)}}]),q}(),M=function(){function q(G){p(this,q),this.context=G,this.current={func:G.gl.ALWAYS,ref:0,mask:255}}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.func===Z.func&&G.ref===Z.ref&&G.mask===Z.mask||(this.context.gl.stencilFunc(G.func,G.ref,G.mask),this.current=G)}}]),q}(),F=function(){function q(G){p(this,q),this.context=G;var Z=this.context.gl;this.current=[Z.KEEP,Z.KEEP,Z.KEEP]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]||(this.context.gl.stencilOp(G[0],G[1],G[2]),this.current=G)}}]),q}(),S=function(){function q(G){p(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.STENCIL_TEST):Z.disable(Z.STENCIL_TEST),this.current=G}}}]),q}(),T=function(){function q(G){p(this,q),this.context=G,this.current=[0,1]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]||(this.context.gl.depthRange(G[0],G[1]),this.current=G)}}]),q}(),w=function(){function q(G){p(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.DEPTH_TEST):Z.disable(Z.DEPTH_TEST),this.current=G}}}]),q}(),C=function(){function q(G){p(this,q),this.context=G,this.current=G.gl.LESS}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.depthFunc(G),this.current=G)}}]),q}(),D=function(){function q(G){p(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;G?Z.enable(Z.BLEND):Z.disable(Z.BLEND),this.current=G}}}]),q}(),R=function(){function q(G){p(this,q),this.context=G;var Z=this.context.gl;this.current=[Z.ONE,Z.ZERO]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]||(this.context.gl.blendFunc(G[0],G[1]),this.current=G)}}]),q}(),U=function(){function q(G){p(this,q),this.context=G,this.current=y.transparent}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G.r===Z.r&&G.g===Z.g&&G.b===Z.b&&G.a===Z.a||(this.context.gl.blendColor(G.r,G.g,G.b,G.a),this.current=G)}}]),q}(),O=function(){function q(G){p(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.useProgram(G),this.current=G)}}]),q}(),z=function(){function q(G){p(this,q),this.context=G,this.current=1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.context.lineWidthRange,K=m.clamp(G,Z[0],Z[1]);this.current!==K&&(this.context.gl.lineWidth(K),this.current=G)}}]),q}(),k=function(){function q(G){p(this,q),this.context=G,this.current=G.gl.TEXTURE0}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&(this.context.gl.activeTexture(G),this.current=G)}}]),q}(),Q=function(){function q(G){p(this,q),this.context=G;var Z=this.context.gl;this.current=[0,0,Z.drawingBufferWidth,Z.drawingBufferHeight]}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.current;G[0]===Z[0]&&G[1]===Z[1]&&G[2]===Z[2]&&G[3]===Z[3]||(this.context.gl.viewport(G[0],G[1],G[2],G[3]),this.current=G)}}]),q}(),N=function(){function q(G){p(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindFramebuffer(Z.FRAMEBUFFER,G),this.current=G}}}]),q}(),j=function(){function q(G){p(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindRenderbuffer(Z.RENDERBUFFER,G),this.current=G}}}]),q}(),J=function(){function q(G){p(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindTexture(Z.TEXTURE_2D,G),this.current=G}}}]),q}(),ee=function(){function q(G){p(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.bindBuffer(Z.ARRAY_BUFFER,G),this.current=G}}}]),q}(),ie=function(){function q(G){p(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){var Z=this.context.gl;Z.bindBuffer(Z.ELEMENT_ARRAY_BUFFER,G),this.current=G}}]),q}(),oe=function(){function q(G){p(this,q),this.context=G,this.current=null}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){this.current!==G&&this.context.extVertexArrayObject&&(this.context.extVertexArrayObject.bindVertexArrayOES(G),this.current=G)}}]),q}(),ue=function(){function q(G){p(this,q),this.context=G,this.current=4}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.pixelStorei(Z.UNPACK_ALIGNMENT,G),this.current=G}}}]),q}(),le=function(){function q(G){p(this,q),this.context=G,this.current=!1}return v(q,[{key:"get",value:function(){return this.current}},{key:"set",value:function(G){if(this.current!==G){var Z=this.context.gl;Z.pixelStorei(Z.UNPACK_PREMULTIPLY_ALPHA_WEBGL,G),this.current=G}}}]),q}(),ne=function(){function q(G,Z){p(this,q),this.context=G,this.current=null,this.parent=Z}return v(q,[{key:"get",value:function(){return this.current}}]),q}(),ce=function(q){u(Z,q);var G=h(Z);function Z(K,W){var H;return p(this,Z),(H=G.call(this,K,W)).dirty=!1,H}return v(Z,[{key:"set",value:function(K){if(this.dirty||this.current!==K){var W=this.context.gl;this.context.bindFramebuffer.set(this.parent),W.framebufferTexture2D(W.FRAMEBUFFER,W.COLOR_ATTACHMENT0,W.TEXTURE_2D,K,0),this.current=K,this.dirty=!1}}},{key:"setDirty",value:function(){this.dirty=!0}}]),Z}(ne),$=function(q){u(Z,q);var G=h(Z);function Z(){return p(this,Z),G.apply(this,arguments)}return v(Z,[{key:"set",value:function(K){if(this.current!==K){var W=this.context.gl;this.context.bindFramebuffer.set(this.parent),W.framebufferRenderbuffer(W.FRAMEBUFFER,W.DEPTH_ATTACHMENT,W.RENDERBUFFER,K),this.current=K}}}]),Z}(ne);r.exports={ClearColor:b,ClearDepth:x,ClearStencil:E,ColorMask:B,DepthMask:P,StencilMask:I,StencilFunc:M,StencilOp:F,StencilTest:S,DepthRange:T,DepthTest:w,DepthFunc:C,Blend:D,BlendFunc:R,BlendColor:U,Program:O,LineWidth:z,ActiveTextureUnit:k,Viewport:Q,BindFramebuffer:N,BindRenderbuffer:j,BindTexture:J,BindVertexBuffer:ee,BindElementBuffer:ie,BindVertexArrayOES:oe,PixelStoreUnpack:ue,PixelStoreUnpackPremultiplyAlpha:le,ColorAttachment:ce,DepthAttachment:$}},3292:function(r,a,s){function l(f,d){for(var p=0;p<d.length;p++){var g=d[p];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(f,g.key,g)}}var u=s(8583),A={Int8:"BYTE",Uint8:"UNSIGNED_BYTE",Int16:"SHORT",Uint16:"UNSIGNED_SHORT",Int32:"INT",Uint32:"UNSIGNED_INT",Float32:"FLOAT"},h=function(){function f(g,v,y,m){(function(x,E){if(!(x instanceof E))throw new TypeError("Cannot call a class as a function")})(this,f),this.length=v.length,this.attributes=y,this.itemSize=v.bytesPerElement,this.dynamicDraw=m,this.context=g;var b=g.gl;this.buffer=b.createBuffer(),g.bindVertexBuffer.set(this.buffer),b.bufferData(b.ARRAY_BUFFER,v.arrayBuffer,this.dynamicDraw?b.DYNAMIC_DRAW:b.STATIC_DRAW),this.dynamicDraw||delete v.arrayBuffer}var d,p;return d=f,(p=[{key:"bind",value:function(){this.context.bindVertexBuffer.set(this.buffer)}},{key:"updateData",value:function(g){u(g.length===this.length);var v=this.context.gl;this.bind(),v.bufferSubData(v.ARRAY_BUFFER,0,g.arrayBuffer)}},{key:"enableAttributes",value:function(g,v){for(var y=0;y<this.attributes.length;y++){var m=this.attributes[y],b=v.attributes[m.name];b!==void 0&&g.enableVertexAttribArray(b)}}},{key:"setVertexAttribPointers",value:function(g,v,y){for(var m=0;m<this.attributes.length;m++){var b=this.attributes[m],x=v.attributes[b.name];x!==void 0&&g.vertexAttribPointer(x,b.components,g[A[b.type]],!1,this.itemSize,b.offset+this.itemSize*(y||0))}}},{key:"destroy",value:function(){var g=this.context.gl;this.buffer&&(g.deleteBuffer(this.buffer),delete this.buffer)}}])&&l(d.prototype,p),Object.defineProperty(d,"prototype",{writable:!1}),f}();r.exports=h},5579:function(r,a,s){var l=s(2235),u=s(3103),A=s(4147).i8,h=s(2062),f=s(3340),d=s(3600),p=s(5060),g=s(7316),v=s(8841),y=s(3316),m=s(650),b=s(56),x=s(9069),E=s(4899),B=s(5550),P=s(1495),I=s(6752),M=s(4781),F=s(1282);r.exports={version:A,supported:l,workerCount:Math.max(Math.floor(u.hardwareConcurrency/2),1),setRTLTextPlugin:M.setRTLTextPlugin,Map:h,NavigationControl:f,GeolocateControl:d,AttributionControl:p,ScaleControl:g,FullscreenControl:v,Popup:y,Marker:m,Style:b,LngLat:x,LngLatBounds:E,Point:B,Evented:P,config:I,BasicRenderer:F,get accessToken(){return I.ACCESS_TOKEN},set accessToken(S){I.ACCESS_TOKEN=S}}},5155:function(r,a,s){function l(f,d){(d==null||d>f.length)&&(d=f.length);for(var p=0,g=new Array(d);p<d;p++)g[p]=f[p];return g}var u=s(7650),A=s(2749),h=s(6937);r.exports=function(f,d,p){var g=p.paint.get("background-color"),v=p.paint.get("background-opacity");if(v!==0){var y,m=f.context,b=m.gl,x=f.transform,E=x.tileSize,B=p.paint.get("background-pattern"),P=B||g.a!==1||v!==1?"translucent":"opaque";if(f.renderPass===P){if(m.setStencilMode(A.disabled),m.setDepthMode(f.depthModeForSublayer(0,P==="opaque"?h.ReadWrite:h.ReadOnly)),m.setColorMode(f.colorModeForRenderPass()),B){if(u.isPatternMissing(B,f))return;y=f.useProgram("backgroundPattern"),u.prepare(B,f,y),f.tileExtentPatternVAO.bind(m,y,f.tileExtentBuffer,[])}else y=f.useProgram("background"),b.uniform4fv(y.uniforms.u_color,[g.r,g.g,g.b,g.a]),f.tileExtentVAO.bind(m,y,f.tileExtentBuffer,[]);b.uniform1f(y.uniforms.u_opacity,v);var I,M=function(S,T){var w=typeof Symbol<"u"&&S[Symbol.iterator]||S["@@iterator"];if(!w){if(Array.isArray(S)||(w=function(z,k){if(z){if(typeof z=="string")return l(z,k);var Q=Object.prototype.toString.call(z).slice(8,-1);return Q==="Object"&&z.constructor&&(Q=z.constructor.name),Q==="Map"||Q==="Set"?Array.from(z):Q==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Q)?l(z,k):void 0}}(S))||T){w&&(S=w);var C=0,D=function(){};return{s:D,n:function(){return C>=S.length?{done:!0}:{done:!1,value:S[C++]}},e:function(z){throw z},f:D}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
@@ -2421,7 +2421,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
2421
2421
  //material.diffuse = vec3(0.0, 0.0, 1.0);
2422
2422
  //material.diffuse.g = -fsInput.attributes.positionEC.z / 1.0e4;
2423
2423
  }
2424
- `});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}const FU=(t,n)=>{if(!t)return;const e=6378137*Math.PI/180,[i,o,r]=t,s=1/(e*Math.cos(o*Math.PI/180));return[n[0]/s,n[1]/s,n[2]]},MU=(t,n)=>{const e=6378137*Math.PI/180,[i,o,r]=t,a=n,l=1/(e*Math.cos(o*Math.PI/180));return[i+l*a[0],o+l*a[1],r+a[2]]};function Af(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function DU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,Af(t.rgba)];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,Af(t.rgba)];if(i)return[`\${${n}} >= ${t.minValue}`,Af(t.rgba)];if(o)return[`\${${n}} <= ${t.maxValue}`,Af(t.rgba)];if(!e&&!i&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(r){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${r}`)}}function RU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,t.visable.toString()];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,t.visable.toString()];if(i)return[`\${${n}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${n}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!i&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(r){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${r}`)}}const Qi=class Qi extends Nn{constructor(e,i){super(e,i);L(this,"_czm3DTiles");L(this,"_clippingPlanes");L(this,"_flattenedPlane");L(this,"_styleColor",this.dv(c.react(void 0)));L(this,"_highlightStyleColor",this.dv(c.react(void 0)));L(this,"_styleVisable",this.dv(c.react(void 0)));this._flattenedPlane=this.dv(new Xr(i,e.id)),this._czm3DTiles=this.dv(new $e(i,this,e.id)),this._clippingPlanes=this.dv(new aa(i,e.id));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._czm3DTiles;this.ad(e.setMaterialEvent.don(l=>{r.setMaterial(l)}));{const l=()=>{r.origin&&(e.offset||(e.offset=[0,0,0]),r.position=MU(r.origin,e.offset))};l(),this.d(e.offsetChanged.don(l)),this.d(r.originChanged.don(l))}{const l=()=>{if(!r.position)return;const A=r.position.map((h,f)=>{if(r.origin)return h-r.origin[f]});r.origin&&(e.offset=FU(r.origin,A))};l();const u=this.ad(c.createNextAnimateFrameEvent(r.positionChanged));this.d(u.don(l))}const a=this._clippingPlanes,s=this._flattenedPlane;this.d(e.setFeatureColorEvent.don((l,u)=>{const h=u.reverse().map(f=>DU(f,l));this.setFeatureColor(h)})),this.d(e.setFeatureVisableEvent.don((l,u)=>{const h=u.reverse().map(f=>RU(f,l));this.setFeatureVisable(h)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((l,u)=>{this.highlightFeature(l,u)})),this.d(e.highlightFeatureAndFlyToEvent.don((l,u,A,h)=>{A&&this.highlightFeature(l,A);const f=new _.Cartesian3(u[0],u[1],u[2]),d=new _.BoundingSphere(f,u[3]);o.camera.flyToBoundingSphere(d,{duration:h??1})})),Qi.strokeFeaturePostProcess.register(this),this.ad(()=>{Qi.strokeFeaturePostProcess.unregister(this)}),this.ad(e.strokeFeatureEvent.don((l,u)=>{u&&Qi.strokeFeaturePostProcess.setStrokeColor(u),Qi.strokeFeaturePostProcess.setStrokeSelect(this,l)})),this.d(r.czmTilesetReadyEvent.don(l=>{const u=A=>{if(l.style=void 0,A.length===0)return;const h=[...A],f=[],d=[];let p;h.forEach(g=>{Array.isArray(g.condition)?(f.push({condition:g.condition,color:g.color??[1,1,1,1]}),d.push({condition:g.condition,show:g.show??!0})):(f.push({condition:[g.condition],color:g.color??[1,1,1,1]}),d.push({condition:[g.condition],show:g.show??!0}))});{const g=(y,m)=>{try{let b;return f.forEach(x=>{if(b===void 0){const E=EU(x,y);E.length>0&&!E.includes(!1)&&(b=_U(x.color,m))}}),b||_.Color.clone(_.Color.WHITE,m)}catch{return _.Color.clone(_.Color.WHITE,m)}},v=y=>{try{let m;return d.forEach(b=>{if(m===void 0){const x=PU(b,y);x.length>0&&!x.includes(!1)&&(m=b.show)}}),m!==void 0?m:!0}catch{return!0}};p=new _.Cesium3DTileStyle({color:{evaluateColor:function(y,m){return g(y,m)}},show:{evaluate:function(y){return v(y)}}})}l.style=p};this.d(e.setFeatureStyleEvent.don(A=>{u(A)})),this.d(e.resetFeatureStyleEvent.don(()=>{l.style=void 0}));{const A=this,h=[],f=l.tileLoad.addEventListener(function(p){try{const v=p.content.getFeature(0),m=v.getPropertyIds().map(E=>{const B=v.getProperty(E);return{key:E,type:typeof B}}),b=h.map(E=>E.key),x=m.filter(E=>!b.includes(E.key));h.push(...x)}catch{}});this.d(()=>{f()});const d=async()=>{try{h.length>0?e._featureTableResultEvent.emit(h):e._featureTableResultEvent.emit(void 0)}catch(p){console.warn(`CzmES3DTileset GetFeatureTable: ${p}`),e._featureTableResultEvent.emit(void 0)}};A.d(e.getFeatureTableEvent.don(()=>{d()}))}{const A=h=>{r.tileset.featureIdLabel=`featureId_${h}`};this.ad(e.featureIdLabelChanged.don(h=>{A(h)}))}})),this.d(r.czmTilesetReadyEvent.don((l,u)=>{e.supportEdit=r.supportEdit,e.tilesetReady.emit(l)})),r.absoluteClippingPlanes=!0,r.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,r.clippingPlanesId=this.clippingPlanes.id,this.d(c.track([s,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(c.track([a,"enabled"],[e,"clippingPlaneEnabled"])),this.d(c.track([a,"planeIds"],[e,"clippingPlaneIds"])),this.d(c.track([a,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(c.track([a,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(c.track([a,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{r.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{r.clippingPolygonsId=e.excavateId}));{const l=()=>{typeof e.url=="string"?e.url=c.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=c.ESSceneObject.context.getStrFromEnv(e.url.url)),r.url=e.url};l(),this.d(e.urlChanged.don(l))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"colorBlendMode"],[e,"colorBlendMode"])),this.d(c.track([r,"cacheBytes"],[e,"cacheBytes"])),this.d(c.track([r,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(c.track([r,"allowPicking"],[e,"allowPicking"])),this.d(c.bind([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(c.track([r,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(c.track([r,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(c.track([r,"classificationType"],[e,"czmClassificationType"])),this.d(c.track([r,"styleJson"],[e,"czmStyleJson"])),this.d(c.bind([r,"rotation"],[e,"rotation"])),this.d(c.track([r,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(c.track([r,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(c.track([r,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(c.track([r,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"])),this.ad(c.bind([r,"splitDirection"],[e,"splitDirection"]));{const l=u=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:u}:{atmosphereScatteringIntensity:u}};l(e.czmAtmosphereScatteringIntensity),l(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(u=>l(u))),this.ad(e.czmLuminanceAtZenithChanged.don(u=>l(u)))}{const l=()=>{var u,A;(u=e.czmEnvironmentMapManager)!=null&&u.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(A=e.czmEnvironmentMapManager)==null?void 0:A.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const u=e.materialMode??c.ES3DTileset.defaults.materialMode;Cx=e.materialParams.baseColor??[1,1,1],u==="normal"?r.customShaderInstanceClass=void 0:u==="technology"&&(r.customShaderInstanceClass=void 0,r.customShaderInstanceClass=IU)};this.d(e.materialModeChanged.don(u=>{l()})),this.d(e.materialParamsChanged.don(()=>{l()})),l()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,i){const o=i??"rgba(255,0,0,1)",s=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let l={};const u=this.styleColor?[s,...this.styleColor]:[s];this.styleVisable?l={show:{conditions:[...this.styleVisable]},color:{conditions:[...u]}}:l={color:{conditions:[...u]}},console.log("style",l),this._czm3DTiles.styleJson=l,this.highlightStyleColor=[...s]}setFeatureColor(e){const i=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let r={};this.styleVisable?i?r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,i]}}:r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:i?r={color:{conditions:[...o,i]}}:r={color:{conditions:[...o]}},console.log("style",r),this._czm3DTiles.styleJson=r,this.styleColor=[...o]}setFeatureVisable(e){let i={};const o=this.highlightStyleColor,r=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?i={show:{conditions:[...r]},color:{conditions:[o,...this.styleColor]}}:i={show:{conditions:[...r]},color:{conditions:[...this.styleColor]}}:o?i={show:{conditions:[...r]},color:{conditions:[o]}}:i={show:{conditions:[...r]}},console.log("style",i),this._czm3DTiles.styleJson=i,this.styleVisable=[...r]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Qi,"type",Qi.register("ESCesiumViewer",c.ES3DTileset.type,Qi)),L(Qi,"strokeFeaturePostProcess",new xU);let la=Qi;const Fu=class Fu extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),a=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.dv(new Ht(this.czmViewer,this.sceneObject.id));const s=this._czmModelPrimitive;this.d(s.readyEvent.don(l=>{e.readyEvent.emit(l)})),this.ad(c.bind([s,"position"],[e,"position"])),this.ad(Mt([s,"rotation"],[e,"rotation"])),this.ad(c.track([s,"show"],[e,"show"])),s.activeAnimationsAnimateWhilePaused=!0,s.activeAnimationsJson=[{index:0,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}];{const l=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(l.don(u))}{const l=()=>{const u=e.mode;u==="circle"?s.url=r:(u==="cylinder"||u===void 0)&&(s.url=a)};l(),this.dispose(e.modeChanged.disposableOn(()=>{l()}))}{const l=()=>{const A=e.radius??c.ESAlarm.defaults.radius;s.scale=[A*e.scale[0],A*e.scale[1],A*e.scale[2]]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(u.disposableOn(()=>{l()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&wn(r,o,i,e,a,!0),!0)}};L(Fu,"type",Fu.register("ESCesiumViewer",c.ESAlarm.type,Fu));let Vm=Fu;const Mu=class Mu extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new at(i,this.sceneObject.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),r.indexTypedArray=new Uint16Array([0,1,2,0,2,3]),r.uniformMap={u_color:[0,.7,1,1]};{const s={scan:`
2424
+ `});this._customShader=o}update(){alert("暂未实现!")}get customShader(){return this._customShader}}const FU=(t,n)=>{if(!t)return;const e=6378137*Math.PI/180,[i,o,r]=t,s=1/(e*Math.cos(o*Math.PI/180));return[n[0]/s,n[1]/s,n[2]]},MU=(t,n)=>{const e=6378137*Math.PI/180,[i,o,r]=t,a=n,l=1/(e*Math.cos(o*Math.PI/180));return[i+l*a[0],o+l*a[1],r+a[2]]};function Af(t){return`rgba(${t[0]*255},${t[1]*255},${t[2]*255},${t[3]})`}function DU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,Af(t.rgba)];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,Af(t.rgba)];if(i)return[`\${${n}} >= ${t.minValue}`,Af(t.rgba)];if(o)return[`\${${n}} <= ${t.maxValue}`,Af(t.rgba)];if(!e&&!i&&!o)throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在!`)}catch(r){throw new Error(`Feature Color JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, rgba值为0~1且必须存在! ${r}`)}}function RU(t,n){const e=Reflect.has(t,"value"),i=Reflect.has(t,"minValue"),o=Reflect.has(t,"maxValue");try{const r=typeof t.value=="string"?`'${t.value}'`:t.value;if(e)return[`\${${n}} === `+r,t.visable.toString()];if(i&&o)return[`\${${n}} >= ${t.minValue} && \${${n}} <= ${t.maxValue}`,t.visable.toString()];if(i)return[`\${${n}} >= ${t.minValue}`,t.visable.toString()];if(o)return[`\${${n}} <= ${t.maxValue}`,t.visable.toString()];if(!e&&!i&&!o)throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在!`)}catch(r){throw new Error(`Feature Visable JSON错误,${t}中至少应该有一个属性,value|minValue|maxValue, visable必须存在! ${r}`)}}const Qi=class Qi extends Nn{constructor(e,i){super(e,i);L(this,"_czm3DTiles");L(this,"_clippingPlanes");L(this,"_flattenedPlane");L(this,"_styleColor",this.dv(c.react(void 0)));L(this,"_highlightStyleColor",this.dv(c.react(void 0)));L(this,"_styleVisable",this.dv(c.react(void 0)));this._flattenedPlane=this.dv(new Xr(i,e.id)),this._czm3DTiles=this.dv(new $e(i,this,e.id)),this._clippingPlanes=this.dv(new aa(i,e.id));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._czm3DTiles;this.ad(e.setMaterialEvent.don(l=>{r.setMaterial(l)}));{const l=()=>{r.origin&&(e.offset||(e.offset=[0,0,0]),r.position=MU(r.origin,e.offset))};l(),this.d(e.offsetChanged.don(l)),this.d(r.originChanged.don(l))}{const l=()=>{if(!r.position)return;const A=r.position.map((h,f)=>{if(r.origin)return h-r.origin[f]});r.origin&&(e.offset=FU(r.origin,A))};l();const u=this.ad(c.createNextAnimateFrameEvent(r.positionChanged));this.d(u.don(l))}const a=this._clippingPlanes,s=this._flattenedPlane;this.d(e.setFeatureColorEvent.don((l,u)=>{const h=u.reverse().map(f=>DU(f,l));this.setFeatureColor(h)})),this.d(e.setFeatureVisableEvent.don((l,u)=>{const h=u.reverse().map(f=>RU(f,l));this.setFeatureVisable(h)})),this.d(e.resetFeatureStyleEvent.don(()=>{this.resetFeatureStyle()})),this.d(e.highlightFeatureEvent.don((l,u)=>{this.highlightFeature(l,u)})),this.d(e.highlightFeatureAndFlyToEvent.don((l,u,A,h)=>{A&&this.highlightFeature(l,A);const f=new _.Cartesian3(u[0],u[1],u[2]),d=new _.BoundingSphere(f,u[3]);o.camera.flyToBoundingSphere(d,{duration:h??1})})),Qi.strokeFeaturePostProcess.register(this),this.ad(()=>{Qi.strokeFeaturePostProcess.unregister(this)}),this.ad(e.strokeFeatureEvent.don((l,u)=>{u&&Qi.strokeFeaturePostProcess.setStrokeColor(u),Qi.strokeFeaturePostProcess.setStrokeSelect(this,l)})),this.d(r.czmTilesetReadyEvent.don(l=>{const u=A=>{if(l.style=void 0,A.length===0)return;const h=[...A],f=[],d=[];let p;h.forEach(g=>{Array.isArray(g.condition)?(f.push({condition:g.condition,color:g.color??[1,1,1,1]}),d.push({condition:g.condition,show:g.show??!0})):(f.push({condition:[g.condition],color:g.color??[1,1,1,1]}),d.push({condition:[g.condition],show:g.show??!0}))});{const g=(y,m)=>{try{let b;return f.forEach(x=>{if(b===void 0){const E=EU(x,y);E.length>0&&!E.includes(!1)&&(b=_U(x.color,m))}}),b||_.Color.clone(_.Color.WHITE,m)}catch{return _.Color.clone(_.Color.WHITE,m)}},v=y=>{try{let m;return d.forEach(b=>{if(m===void 0){const x=PU(b,y);x.length>0&&!x.includes(!1)&&(m=b.show)}}),m!==void 0?m:!0}catch{return!0}};p=new _.Cesium3DTileStyle({color:{evaluateColor:function(y,m){return g(y,m)}},show:{evaluate:function(y){return v(y)}}})}l.style=p};this.d(e.setFeatureStyleEvent.don(A=>{u(A)})),this.d(e.resetFeatureStyleEvent.don(()=>{l.style=void 0}));{const A=this,h=[],f=l.tileLoad.addEventListener(function(p){try{const v=p.content.getFeature(0),m=v.getPropertyIds().map(E=>{const B=v.getProperty(E);return{key:E,type:typeof B}}),b=h.map(E=>E.key),x=m.filter(E=>!b.includes(E.key));h.push(...x)}catch{}});this.d(()=>{f()});const d=async()=>{try{h.length>0?e._featureTableResultEvent.emit(h):e._featureTableResultEvent.emit(void 0)}catch(p){console.warn(`CzmES3DTileset GetFeatureTable: ${p}`),e._featureTableResultEvent.emit(void 0)}};A.d(e.getFeatureTableEvent.don(()=>{d()}))}{const A=h=>{r.tileset.featureIdLabel=`featureId_${h}`};this.ad(e.featureIdLabelChanged.don(h=>{A(h)}))}})),this.d(r.czmTilesetReadyEvent.don((l,u)=>{e.supportEdit=r.supportEdit,e.tilesetReady.emit(l)})),r.absoluteClippingPlanes=!0,r.czmFlattenedPlaneId=this.flattenedPlane.id,e.flattenedPlaneId=this.flattenedPlane.id,r.clippingPlanesId=this.clippingPlanes.id,this.d(c.track([s,"enabled"],[e,"flattenedPlaneEnabled"])),this.d(c.track([a,"enabled"],[e,"clippingPlaneEnabled"])),this.d(c.track([a,"planeIds"],[e,"clippingPlaneIds"])),this.d(c.track([a,"unionClippingRegions"],[e,"unionClippingRegions"])),this.d(c.track([a,"edgeColor"],[e,"clippingPlaneEdgeColor"])),this.d(c.track([a,"edgeWidth"],[e,"clippingPlaneEdgeWidth"])),this.d(e.clippingPlaneIdChanged.don(()=>{r.clippingPlanesId=e.clippingPlaneId})),this.d(e.excavateIdChanged.don(()=>{r.clippingPolygonsId=e.excavateId}));{const l=()=>{typeof e.url=="string"?e.url=c.ESSceneObject.context.getStrFromEnv(e.url):e.url&&(e.url.url=c.ESSceneObject.context.getStrFromEnv(e.url.url)),r.url=e.url};l(),this.d(e.urlChanged.don(l))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"colorBlendMode"],[e,"colorBlendMode"])),this.d(c.track([r,"cacheBytes"],[e,"cacheBytes"])),this.d(c.track([r,"maximumCacheOverflowBytes"],[e,"cacheBytes"])),this.d(c.track([r,"allowPicking"],[e,"allowPicking"])),this.d(c.bind([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"])),this.d(c.track([r,"maximumScreenSpaceError"],[e,"maximumScreenSpaceError"])),this.d(c.track([r,"maximumMemoryUsage"],[e,"czmMaximumMemoryUsage"])),this.d(c.track([r,"classificationType"],[e,"czmClassificationType"])),this.d(c.track([r,"styleJson"],[e,"czmStyleJson"])),this.d(c.bind([r,"rotation"],[e,"rotation"])),this.d(c.track([r,"backFaceCulling"],[e,"czmBackFaceCulling"])),this.d(c.track([r,"debugShowBoundingVolume"],[e,"czmDebugShowBoundingVolume"])),this.d(c.track([r,"debugShowContentBoundingVolume"],[e,"czmDebugShowContentBoundingVolume"])),this.d(c.track([r,"skipLevelOfDetail"],[e,"czmSkipLevelOfDetail"])),this.ad(c.bind([r,"splitDirection"],[e,"splitDirection"]));{const l=u=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:u}:{atmosphereScatteringIntensity:u}};l(e.czmAtmosphereScatteringIntensity),l(e.czmLuminanceAtZenith),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(u=>l(u))),this.ad(e.czmLuminanceAtZenithChanged.don(u=>l(u)))}{const l=()=>{var u,A;(u=e.czmEnvironmentMapManager)!=null&&u.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=e.czmLuminanceAtZenith=(A=e.czmEnvironmentMapManager)==null?void 0:A.atmosphereScatteringIntensity)};l(),this.ad(e.czmEnvironmentMapManagerChanged.don(l))}{const l=()=>{const u=e.materialMode??c.ES3DTileset.defaults.materialMode;Cx=e.materialParams.baseColor??[1,1,1],u==="normal"?r.customShaderInstanceClass=void 0:u==="technology"&&(r.customShaderInstanceClass=void 0,r.customShaderInstanceClass=IU)};this.d(e.materialModeChanged.don(u=>{l()})),this.d(e.materialParamsChanged.don(()=>{l()})),l()}}get czm3DTiles(){return this._czm3DTiles}get clippingPlanes(){return this._clippingPlanes}get flattenedPlane(){return this._flattenedPlane}get styleColor(){return this._styleColor.value}set styleColor(e){this._styleColor.value=e}get highlightStyleColor(){return this._highlightStyleColor.value}set highlightStyleColor(e){this._highlightStyleColor.value=e}get styleVisable(){return this._styleVisable.value}set styleVisable(e){this._styleVisable.value=e}highlightFeature(e,i){const o=i??"rgba(255,0,0,1)",s=["${id} === "+(typeof e=="string"?`'${e}'`:e),o];let l={};const u=this.styleColor?[s,...this.styleColor]:[s];this.styleVisable?l={show:{conditions:[...this.styleVisable]},color:{conditions:[...u]}}:l={color:{conditions:[...u]}},console.log("style",l),this._czm3DTiles.styleJson=l,this.highlightStyleColor=[...s]}setFeatureColor(e){const i=this.highlightStyleColor,o=this.styleColor?[...e,...this.styleColor]:[...e];let r={};this.styleVisable?i?r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o,i]}}:r={show:{conditions:[...this.styleVisable]},color:{conditions:[...o]}}:i?r={color:{conditions:[...o,i]}}:r={color:{conditions:[...o]}},console.log("style",r),this._czm3DTiles.styleJson=r,this.styleColor=[...o]}setFeatureVisable(e){let i={};const o=this.highlightStyleColor,r=this.styleVisable?[...e,...this.styleVisable]:[...e];this.styleColor?o?i={show:{conditions:[...r]},color:{conditions:[o,...this.styleColor]}}:i={show:{conditions:[...r]},color:{conditions:[...this.styleColor]}}:o?i={show:{conditions:[...r]},color:{conditions:[o]}}:i={show:{conditions:[...r]}},console.log("style",i),this._czm3DTiles.styleJson=i,this.styleVisable=[...r]}resetFeatureStyle(){this.czm3DTiles.styleJson=void 0,this.styleColor=void 0,this.highlightStyleColor=void 0,this.styleVisable=void 0}flyTo(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czm3DTiles:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Qi,"type",Qi.register("ESCesiumViewer",c.ES3DTileset.type,Qi)),L(Qi,"strokeFeaturePostProcess",new xU);let la=Qi;const Fu=class Fu extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_b.glb"),a=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/warning/warning_a.glb");this._czmModelPrimitive=this.dv(new Ht(this.czmViewer,this.sceneObject.id));const s=this._czmModelPrimitive;this.d(s.readyEvent.don(l=>{e.readyEvent.emit(l)})),this.ad(c.bind([s,"position"],[e,"position"])),this.ad(Mt([s,"rotation"],[e,"rotation"])),this.ad(c.track([s,"show"],[e,"show"])),s.activeAnimationsAnimateWhilePaused=!0,s.activeAnimationsJson=[{index:0,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}];{const l=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?s.allowPicking=!0:s.allowPicking=!1};u(),this.d(l.don(u))}{const l=()=>{const u=e.mode;u==="circle"?s.url=r:(u==="cylinder"||u===void 0)&&(s.url=a)};l(),this.dispose(e.modeChanged.disposableOn(()=>{l()}))}{const l=()=>{const A=e.radius??c.ESAlarm.defaults.radius;s.scale=[A*e.scale[0],A*e.scale[1],A*e.scale[2]]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.radiusChanged,e.scaleChanged));this.dispose(u.disposableOn(()=>{l()}))}}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&wn(r,o,i,e,a,!0),!0)}};L(Fu,"type",Fu.register("ESCesiumViewer",c.ESAlarm.type,Fu));let Vm=Fu;const UU={scan:`
2425
2425
  in vec2 v_st;
2426
2426
  uniform vec4 u_color;
2427
2427
  void main()
@@ -2448,12 +2448,12 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
2448
2448
  alpha = smoothstep(0.0, 1.0, alpha);
2449
2449
  alpha +=step(d,1.) * step(movingCircleD, d) * step(d, movingCircleD + .2) * smoothstep(movingCircleD, movingCircleD + .2, d) ;
2450
2450
  out_FragColor = vec4(u_color.rgb, alpha);
2451
- }`},l=()=>{r.fragmentShaderSource=s[e.mode]};l(),this.ad(e.modeChanged.don(l))}const a=()=>{const s=e.radius*2,l=e.radius*2;r.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-s*.5,-l*.5,0],max:[s*.5,l*.5,0]}},r.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*s,-.5*l,0,.5*s,-.5*l,0,.5*s,.5*l,0,-.5*s,.5*l,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}}};a(),this.dispose(e.radiusChanged.don(()=>a()))}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(wn(r,o,i,e,a,!0),!0)}};L(Mu,"type",Mu.register("ESCesiumViewer",c.ESApertureEffect.type,Mu));let Nm=Mu;const UU=t=>{const n=[];if(t){const e=t.length;let i=0;for(let o=0;o<e;++o){const r=(o+1)%e,a=c.geoDistance(t[o],t[r]),s=Math.abs(t[o][2]-t[r][2]),l=Math.sqrt(a*a+s*s);i+=l,n.push(i)}}return n},Sx=t=>{let n;return t?(t.length<3?n=0:n=c.geoArea(t),n):0},Ex=t=>{let n;return t?(t.length<3?n=void 0:n=c.geoCenterOfMass(t),n):void 0};function OU(t,n,e){const i=[];for(const o of e)switch(o){case"SquareMeter_SquareKilometer":t>=1e6?i.push(`面积:${(t/1e6).toFixed(2)} km²`):i.push(`面积:${t.toFixed(2)} m²`);break;case"MU_Hectare":const r=t*(1/666.7);if(r>=15){const a=r/15;i.push(`面积:${a.toFixed(2)} 公顷`)}else i.push(`面积:${r.toFixed(2)} 亩`);break;case"PerimeterMeter_PerimeterKilometer":n>=1e3?i.push(`周长:${(n/1e3).toFixed(2)} km`):i.push(`周长:${n.toFixed(2)} m`);break}return i}class ua extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.dv(new c.Event));L(this,"_area",this.dv(c.react(0)));L(this,"_centerOfMass",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distances",this.dv(c.reactArray([])));L(this,"_geoPolyline");L(this,"_id",this.dv(c.react(c.createGuid())));i&&(this.id=i);{const o=()=>{this._distances.value=UU(this.positions),this._area.value=Sx(this.positions),this._centerOfMass.value=Ex(this.positions)};o();const r=this.dv(c.createNextAnimateFrameEvent(this.positionsChanged));this.dispose(r.disposableOn(o))}{const o=this._geoPolyline=this.dv(new Ye(e,i));o.loop=!0,o.arcType="GEODESIC",this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([o,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([o,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([o,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([o,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([o,"positions"],[this,"positions"])),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([o,"width"],[this,"width"])),this.dispose(c.bind([o,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([o,"ground"],[this,"strokeGround"]))}{const o=this.dv(new Ti(e,i));o.outline=!1;const r=()=>{o.positions=this.positions};r(),this.dispose(this.positionsChanged.disposableOn(r));const a=()=>{const s=this.fillColor;o.color=[s[0],s[1],s[2],s[3]*.5]};a(),this.dispose(this.fillColorChanged.disposableOn(a)),this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([o,"ground"],[this,"ground"])),this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([o,"depthTest"],[this,"depthTest"])),this.d(this.flyToEvent.don(s=>{o.flyTo(s)}))}{const o=this.dv(new wt(e,i)),r=this.dv(c.createNextAnimateFrameEvent(this.areaChanged,this.centerOfMassChanged,this.distancesChanged,this.unitsChanged)),a=()=>{if(this.distances.length===0){o.innerHTML="";return}const s=OU(this.area,this.distances[this.distances.length-1],this.units);o.innerHTML=xo([...s].join(`
2451
+ }`},Mu=class Mu extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new at(i,this.sceneObject.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this;r.indexTypedArray=new Uint16Array([0,1,2,0,2,3]),this.ad(c.track([r,"show"],[e,"show"])),this.ad(c.track([r,"allowPicking"],[e,"allowPicking"])),this.ad(Mt([r,"rotation"],[e,"rotation"])),this.ad(c.bind([r,"position"],[e,"position"])),this.ad(c.track([r,"scale"],[e,"scale"])),this.ad(c.createEventsCallFunc(e.colorChanged,()=>this.updateColor(),{immediate:!0})),this.ad(c.createEventsCallFunc(e.modeChanged,()=>this.updataMode(),{immediate:!0})),this.ad(c.createEventsCallFunc(e.radiusChanged,()=>this.updateRadius(),{immediate:!0}))}get czmCustomPrimitive(){return this._czmCustomPrimitive}updateColor(){this.czmCustomPrimitive.uniformMap={u_color:this.sceneObject.color??c.ESApertureEffect.defaults.color}}updataMode(){this.czmCustomPrimitive.fragmentShaderSource=UU[this.sceneObject.mode]}updateRadius(){const e=this.sceneObject.radius*2,i=this.sceneObject.radius*2;this.czmCustomPrimitive.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:[-e*.5,-i*.5,0],max:[e*.5,i*.5,0]}},this.czmCustomPrimitive.attributes={position:{componentsPerAttribute:3,typedArray:new Float32Array([-.5*e,-.5*i,0,.5*e,-.5*i,0,.5*e,.5*i,0,-.5*e,.5*i,0])},normal:{componentsPerAttribute:3,typedArray:new Float32Array([0,0,1,0,0,1,0,0,1,0,0,1])},textureCoordinates:{componentsPerAttribute:2,typedArray:new Float32Array([-1,-1,1,-1,1,1,-1,1])}}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(wn(r,o,i,e,a,!0),!0)}};L(Mu,"type",Mu.register("ESCesiumViewer",c.ESApertureEffect.type,Mu));let Nm=Mu;const OU=t=>{const n=[];if(t){const e=t.length;let i=0;for(let o=0;o<e;++o){const r=(o+1)%e,a=c.geoDistance(t[o],t[r]),s=Math.abs(t[o][2]-t[r][2]),l=Math.sqrt(a*a+s*s);i+=l,n.push(i)}}return n},Sx=t=>{let n;return t?(t.length<3?n=0:n=c.geoArea(t),n):0},Ex=t=>{let n;return t?(t.length<3?n=void 0:n=c.geoCenterOfMass(t),n):void 0};function LU(t,n,e){const i=[];for(const o of e)switch(o){case"SquareMeter_SquareKilometer":t>=1e6?i.push(`面积:${(t/1e6).toFixed(2)} km²`):i.push(`面积:${t.toFixed(2)} m²`);break;case"MU_Hectare":const r=t*(1/666.7);if(r>=15){const a=r/15;i.push(`面积:${a.toFixed(2)} 公顷`)}else i.push(`面积:${r.toFixed(2)} 亩`);break;case"PerimeterMeter_PerimeterKilometer":n>=1e3?i.push(`周长:${(n/1e3).toFixed(2)} km`):i.push(`周长:${n.toFixed(2)} m`);break}return i}class ua extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.dv(new c.Event));L(this,"_area",this.dv(c.react(0)));L(this,"_centerOfMass",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distances",this.dv(c.reactArray([])));L(this,"_geoPolyline");L(this,"_id",this.dv(c.react(c.createGuid())));i&&(this.id=i);{const o=()=>{this._distances.value=OU(this.positions),this._area.value=Sx(this.positions),this._centerOfMass.value=Ex(this.positions)};o();const r=this.dv(c.createNextAnimateFrameEvent(this.positionsChanged));this.dispose(r.disposableOn(o))}{const o=this._geoPolyline=this.dv(new Ye(e,i));o.loop=!0,o.arcType="GEODESIC",this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([o,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([o,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([o,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([o,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([o,"positions"],[this,"positions"])),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([o,"width"],[this,"width"])),this.dispose(c.bind([o,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([o,"ground"],[this,"strokeGround"]))}{const o=this.dv(new Ti(e,i));o.outline=!1;const r=()=>{o.positions=this.positions};r(),this.dispose(this.positionsChanged.disposableOn(r));const a=()=>{const s=this.fillColor;o.color=[s[0],s[1],s[2],s[3]*.5]};a(),this.dispose(this.fillColorChanged.disposableOn(a)),this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([o,"ground"],[this,"ground"])),this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([o,"depthTest"],[this,"depthTest"])),this.d(this.flyToEvent.don(s=>{o.flyTo(s)}))}{const o=this.dv(new wt(e,i)),r=this.dv(c.createNextAnimateFrameEvent(this.areaChanged,this.centerOfMassChanged,this.distancesChanged,this.unitsChanged)),a=()=>{if(this.distances.length===0){o.innerHTML="";return}const s=LU(this.area,this.distances[this.distances.length-1],this.units);o.innerHTML=xo([...s].join(`
2452
2452
  `))};a(),this.dispose(r.disposableOn(a)),this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([o,"shadowDom"],[this,"shadowDom"])),this.dispose(c.bind([o,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(c.track([o,"position"],[this,"centerOfMass"])),this.ad(o.pickedEvent.don(s=>{Gi(s)===0&&this.pickedEvent.emit(s)}))}}get pickedEvent(){return this._pickedEvent}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get area(){return this._area.value}get areaChanged(){return this._area.changed}get centerOfMass(){return this._centerOfMass.value}get centerOfMassChanged(){return this._centerOfMass.changed}get distances(){return this._distances.value}get distancesChanged(){return this._distances.changed}get geoPolyline(){return this._geoPolyline}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}}L(ua,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:2,color:c.reactArray([1,1,1,.5]),fillColor:c.reactArray([1,1,1,.5]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:void 0,depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!0,ground:!0,units:c.reactArray(["SquareMeter_SquareKilometer","MU_Hectare","PerimeterMeter_PerimeterKilometer"])})})(ua||(ua={})),c.extendClassProps(ua.prototype,ua.createDefaultProps);const Du=class Du extends Un{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new ua(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}e.strokeGround=!1,e.fillGround=!1;const r=this._czmAreaMeasurement;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"units"],[e,"units"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"])),this.d(c.bind([r,"ground"],[e,"fillGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.color=e.strokeColor;const u=e.strokeStyle;if(u.material==="hasDash"&&u.materialParams)try{const h=u.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0;const A=e.strokeMaterial??"normal";A==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):A==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}{const a=()=>{if(e.filled)r.fillColor=e.fillColor;else{r.fillColor=[1,1,1,0];return}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Du,"type",Du.register("ESCesiumViewer",c.ESAreaMeasurement.type,Du));let Hm=Du;const Ru=class Ru extends He{constructor(e,i){super(e,i);L(this,"_czmBlastParticeSystem");if(this._czmBlastParticeSystem=this.dv(new wi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmBlastParticeSystem:r}=this;{r.updateCallback=`
2453
2453
  function (particle, dt) {
2454
2454
  particle.velocity = Cesium.Cartesian3.ZERO;
2455
2455
  }
2456
- `;const a={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},s=Object.keys(a);for(const l of s)r[l]=a[l]}{const a=()=>{r.startScale=1*(e.scale[0]>0?e.scale[0]:1),r.endScale=10*(e.scale[0]>0?e.scale[0]:1)};a(),this.ad(e.scaleChanged.don(a))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"translation"],[e,"translation"])),this.d(Mt([r,"rotation"],[e,"rotation"])),this.d(c.track([r,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBlastParticeSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Hn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Ru,"type",Ru.register("ESCesiumViewer",c.ESBlastParticleSystem.type,Ru));let Gm=Ru;function LU(t,n,e){const i=t,o=n,r=[[i[0],i[1],i[2]],[o[0],i[1],i[2]],[o[0],o[1],i[2]],[i[0],o[1],i[2]],[i[0],i[1],o[2]],[o[0],i[1],o[2]],[o[0],o[1],o[2]],[i[0],o[1],o[2]]],a=_.Math.toDegrees,s=r.map(u=>{const A=_.Matrix4.multiplyByPoint(e,_.Cartesian3.fromElements(...u),new _.Cartesian3),h=_.Cartographic.fromCartesian(A);return[a(h.longitude),a(h.latitude),h.height]});return[[s[0],s[1],s[2],s[3],s[0]],[s[4],s[5],s[6],s[7],s[4]],[s[0],s[4]],[s[1],s[5]],[s[2],s[6]],[s[3],s[7]]]}class ca extends c.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(c.react(c.createGuid())));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_computedClippingPlanes",this.disposeVar(c.react(void 0)));L(this,"_polylines");i&&(this.id=i),this._polylines=this.disposeVar(new Dn(e,i)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof ot)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const r=this.minSize,a=this.maxSize,s=[a[0]-r[0],a[1]-r[1],a[2]-r[2]],l=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);Fe(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{e instanceof ot&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&i||"")};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(r.disposableOn(o)),this.ad(()=>{e instanceof ot&&e.sceneGlobeClippingPlanesId===i&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const a=this.minSize,s=this.maxSize,l=[s[0]-a[0],s[1]-a[1],s[2]-a[2]],u=this.reverse?-1:1,A=[...this.modelMatrix];let h=[];if(this.position){const f=st({position:this.position,rotation:this.rotation});if(f){const d=_.Matrix4.fromArray(this.modelMatrix),p=_.Matrix4.multiply(f,d,new _.Matrix4);_.Matrix4.toArray(p,A),h=LU(this.minSize,this.maxSize,p)}}this.polylines.positions=h,this._computedClippingPlanes.value={planes:[{normal:[-1*u,0,0],distance:(l[0]+a[0])*u},{normal:[1*u,0,0],distance:-a[0]*u},{normal:[0,-1*u,0],distance:(l[1]+a[1])*u},{normal:[0,1*u,0],distance:-a[1]*u},{normal:[0,0,-1*u],distance:(l[2]+a[2])*u},{normal:[0,0,1*u],distance:-a[2]*u}],enabled:this.enabled,modelMatrix:A,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(c.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(c.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(c.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}L(ca,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),modelMatrix:c.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2,minSize:c.reactArray([-100,-100,-100]),maxSize:c.reactArray([100,100,100])})})(ca||(ca={})),c.extendClassProps(ca.prototype,ca.createDefaultProps);let zU=class extends c.Destroyable{constructor(n,e){super(),this._czmESBoxClippingPlanes=n,this._eS3DTileset=e;const i=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=i,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const Uu=class Uu extends He{constructor(e,i){super(e,i);L(this,"_czmBoxClippingPlanes");L(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this._czmBoxClippingPlanes=this.ad(new ca(i,e.id)),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof c.ES3DTileset&&this.sceneObject.show)return new zU(this,l)}))}),!i.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:a}=this;{const s=()=>{a.enabled=e.show,a.showHelper=e.show};s(),this.dispose(e.showChanged.don(s))}{const s=()=>{a.reverse=!e.reverse};s(),this.dispose(e.reverseChanged.don(s))}{const s=()=>{e.targetID?a.applyOnTerrain=!1:a.applyOnTerrain=!0};s(),this.dispose(e.targetIDChanged.don(s))}{const s=()=>{const[l,u,A]=e.size;a.minSize=[-.5*l,-.5*u,-.5*A],a.maxSize=[.5*l,.5*u,.5*A]};s(),this.dispose(e.sizeChanged.don(s))}this.dispose(c.bind([a,"position"],[e,"position"])),this.dispose(c.bind([a,"rotation"],[e,"rotation"])),this.dispose(c.track([a,"edgeColor"],[e,"edgeColor"])),this.dispose(c.track([a,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Gn(r,o,i,o.position,Math.max(...o.size),e,!0),!0):!1}};L(Uu,"type",Uu.register("ESCesiumViewer",c.ESBoxClipping.type,Uu));let Wm=Uu;const Ou=class Ou extends He{constructor(e,i){super(e,i);L(this,"_view");if(this._view=this.disposeVar(new bn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{view:r}=this;this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"thumbnail"],[e,"thumbnail"])),this.dispose(c.bind([r,"duration"],[e,"duration"])),r.show=!1,this.dispose(e.flyInEvent.disposableOn((a,s,l="default")=>{r.flyTo(e.duration??a??1,void 0,l)})),!r.position&&!r.rotation&&r.resetWithCurrentCamera(bn.ResetFlag.Position|bn.ResetFlag.Rotation|bn.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{r.resetWithCurrentCamera(bn.ResetFlag.Position|bn.ResetFlag.Rotation|bn.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((a,s)=>{r.capture(a??64,s??64)}))}get view(){return this._view}flyTo(e,i){const{sceneObject:o,czmViewer:r,view:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Ou,"type",Ou.register("ESCesiumViewer",c.ESCameraView.type,Ou));let jm=Ou;const Lu=class Lu extends He{constructor(e,i){super(e,i);L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new at(i,e.id)),this._czmTexture=this.dv(new ht(i,e.id));const r=this._czmESCustomPrimitive,a=this._czmTexture;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"]));{const s=()=>{const u=e.far*Math.tan(Math.PI*(e.fov/360))*2,A=u/e.aspectRatio,h=e.far,f=e.near*Math.tan(Math.PI*(e.fov/360))*2,d=f/e.aspectRatio,p=e.near,g=[p,-f/2,-d/2],v=[p,-f/2,d/2],y=[p,f/2,d/2],m=[p,f/2,-d/2],b=[h,-u/2,-A/2],x=[h,-u/2,A/2],E=[h,u/2,A/2],B=[h,u/2,-A/2],P=[...g,...v,...y,...m,...b,...x,...E,...B],I=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],M=[...I,...I.reverse()],F=[1,0],S=[1,1],T=[1,0],w=[1,1],C=[0,0],D=[0,1],R=[0,0],U=[0,1],O=[...F,...S,...T,...w,...C,...D,...R,...U];r.indexTypedArray=new Uint16Array(M),r.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(O),componentsPerAttribute:2}},a.uri=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,1]};const z=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:k,max:Q}=z;r.setLocalAxisedBoundingBox(k,Q)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(l.disposableOn(()=>s()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i),!0;{const a=Math.max(o.far,o.near)??c.ESCameraVisibleRange.defaults.far;return o.position?(Gn(r,o,i,o.position,a,e),!0):!1}}};L(Lu,"type",Lu.register("ESCesiumViewer",c.ESCameraVisibleRange.type,Lu));let qm=Lu;const zu=class zu extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,e.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};u(),this.d(l.don(u))}const a=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),s=()=>{switch(e.mode){case"policeCar":r.url=a;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>s())),s()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a):!1}};L(zu,"type",zu.register("ESCesiumViewer",c.ESCar.type,zu));let Km=zu;const Zm={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},ku=class ku extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_circleCustomPrimitive");L(this,"_cylinderCustomPrimitive");L(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new at(e,i)),this._cylinderCustomPrimitive=this.disposeVar(new at(e,i)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new at(e,i));const{circleCustomPrimitive:o}=this;C0(o,{width:120,height:120}),o.fragmentShaderSource=`
2456
+ `;const a={emitter:{type:"CircleEmitter",radius:.1},startColor:[1,0,0,1],endColor:[1,.5,0,.5],particleLife:1,emissionRate:2,lifetime:1,imageSize:[1,1],sizeInMeters:!0},s=Object.keys(a);for(const l of s)r[l]=a[l]}{const a=()=>{r.startScale=1*(e.scale[0]>0?e.scale[0]:1),r.endScale=10*(e.scale[0]>0?e.scale[0]:1)};a(),this.ad(e.scaleChanged.don(a))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"translation"],[e,"translation"])),this.d(Mt([r,"rotation"],[e,"rotation"])),this.d(c.track([r,"image"],[e,"image"]))}get czmBlastParticeSystem(){return this._czmBlastParticeSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBlastParticeSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Hn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Ru,"type",Ru.register("ESCesiumViewer",c.ESBlastParticleSystem.type,Ru));let Gm=Ru;function zU(t,n,e){const i=t,o=n,r=[[i[0],i[1],i[2]],[o[0],i[1],i[2]],[o[0],o[1],i[2]],[i[0],o[1],i[2]],[i[0],i[1],o[2]],[o[0],i[1],o[2]],[o[0],o[1],o[2]],[i[0],o[1],o[2]]],a=_.Math.toDegrees,s=r.map(u=>{const A=_.Matrix4.multiplyByPoint(e,_.Cartesian3.fromElements(...u),new _.Cartesian3),h=_.Cartographic.fromCartesian(A);return[a(h.longitude),a(h.latitude),h.height]});return[[s[0],s[1],s[2],s[3],s[0]],[s[4],s[5],s[6],s[7],s[4]],[s[0],s[4]],[s[1],s[5]],[s[2],s[6]],[s[3],s[7]]]}class ca extends c.Destroyable{constructor(e,i){super();L(this,"_id",this.disposeVar(c.react(c.createGuid())));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_computedClippingPlanes",this.disposeVar(c.react(void 0)));L(this,"_polylines");i&&(this.id=i),this._polylines=this.disposeVar(new Dn(e,i)),this._polylines.arcType="NONE",this.ad(this.flyToEvent.disposableOn(o=>{if(!(e instanceof ot)||!e.actived)return;if(!this.position){console.warn("CzmBoxClippingPlanes warning: 没有位置,无法飞入!");return}const r=this.minSize,a=this.maxSize,s=[a[0]-r[0],a[1]-r[1],a[2]-r[2]],l=Math.sqrt(s[0]*s[0]+s[1]*s[1]+s[2]*s[2]);Fe(e.viewer,this.position,l*2,void 0,o)}));{const o=()=>{e instanceof ot&&(e.sceneGlobeClippingPlanesId=this.applyOnTerrain&&i||"")};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.applyOnTerrainChanged,this.computedClippingPlanesChanged));this.ad(r.disposableOn(o)),this.ad(()=>{e instanceof ot&&e.sceneGlobeClippingPlanesId===i&&(e.sceneGlobeClippingPlanes=void 0)})}{const o=()=>{const a=this.minSize,s=this.maxSize,l=[s[0]-a[0],s[1]-a[1],s[2]-a[2]],u=this.reverse?-1:1,A=[...this.modelMatrix];let h=[];if(this.position){const f=st({position:this.position,rotation:this.rotation});if(f){const d=_.Matrix4.fromArray(this.modelMatrix),p=_.Matrix4.multiply(f,d,new _.Matrix4);_.Matrix4.toArray(p,A),h=zU(this.minSize,this.maxSize,p)}}this.polylines.positions=h,this._computedClippingPlanes.value={planes:[{normal:[-1*u,0,0],distance:(l[0]+a[0])*u},{normal:[1*u,0,0],distance:-a[0]*u},{normal:[0,-1*u,0],distance:(l[1]+a[1])*u},{normal:[0,1*u,0],distance:-a[1]*u},{normal:[0,0,-1*u],distance:(l[2]+a[2])*u},{normal:[0,0,1*u],distance:-a[2]*u}],enabled:this.enabled,modelMatrix:A,unionClippingRegions:!this.reverse,edgeColor:this.edgeColor,edgeWidth:this.edgeWidth}};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.enabledChanged,this.positionChanged,this.rotationChanged,this.modelMatrixChanged,this.reverseChanged,this.edgeColorChanged,this.edgeWidthChanged,this.minSizeChanged,this.maxSizeChanged));this.dispose(r.disposableOn(o))}this.dispose(c.track([this.polylines,"color"],[this,"edgeColor"])),this.dispose(c.track([this.polylines,"width"],[this,"edgeWidth"])),this.dispose(c.track([this.polylines,"show"],[this,"showHelper"]))}get id(){return this._id.value}set id(e){this._id.value=e}get idChanged(){return this._id.changed}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}get computedClippingPlanes(){return this._computedClippingPlanes.value}set computedClippingPlanes(e){this._computedClippingPlanes.value=e}get computedClippingPlanesChanged(){return this._computedClippingPlanes.changed}get polylines(){return this._polylines}}L(ca,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({enabled:!0,showHelper:!0,applyOnTerrain:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),modelMatrix:c.reactArray([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2,minSize:c.reactArray([-100,-100,-100]),maxSize:c.reactArray([100,100,100])})})(ca||(ca={})),c.extendClassProps(ca.prototype,ca.createDefaultProps);let kU=class extends c.Destroyable{constructor(n,e){super(),this._czmESBoxClippingPlanes=n,this._eS3DTileset=e;const i=this._czmESBoxClippingPlanes.czmBoxClippingPlanes.id;this._eS3DTileset.clippingPlaneId=i,this.dispose(()=>{this._eS3DTileset.clippingPlaneId=""})}};const Uu=class Uu extends He{constructor(e,i){super(e,i);L(this,"_czmBoxClippingPlanes");L(this,"_tilesSceneObjectWithId");this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this._czmBoxClippingPlanes=this.ad(new ca(i,e.id)),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged,this.czmBoxClippingPlanes.enabledChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l}=this.tilesSceneObjectWithId;if(l&&l instanceof c.ES3DTileset&&this.sceneObject.show)return new kU(this,l)}))}),!i.viewer){console.warn("viewer is undefined!");return}const{czmBoxClippingPlanes:a}=this;{const s=()=>{a.enabled=e.show,a.showHelper=e.show};s(),this.dispose(e.showChanged.don(s))}{const s=()=>{a.reverse=!e.reverse};s(),this.dispose(e.reverseChanged.don(s))}{const s=()=>{e.targetID?a.applyOnTerrain=!1:a.applyOnTerrain=!0};s(),this.dispose(e.targetIDChanged.don(s))}{const s=()=>{const[l,u,A]=e.size;a.minSize=[-.5*l,-.5*u,-.5*A],a.maxSize=[.5*l,.5*u,.5*A]};s(),this.dispose(e.sizeChanged.don(s))}this.dispose(c.bind([a,"position"],[e,"position"])),this.dispose(c.bind([a,"rotation"],[e,"rotation"])),this.dispose(c.track([a,"edgeColor"],[e,"edgeColor"])),this.dispose(c.track([a,"edgeWidth"],[e,"edgeWidth"]))}get czmBoxClippingPlanes(){return this._czmBoxClippingPlanes}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Gn(r,o,i,o.position,Math.max(...o.size),e,!0),!0):!1}};L(Uu,"type",Uu.register("ESCesiumViewer",c.ESBoxClipping.type,Uu));let Wm=Uu;const Ou=class Ou extends He{constructor(e,i){super(e,i);L(this,"_view");if(this._view=this.disposeVar(new bn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{view:r}=this;this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"thumbnail"],[e,"thumbnail"])),this.dispose(c.bind([r,"duration"],[e,"duration"])),r.show=!1,this.dispose(e.flyInEvent.disposableOn((a,s,l="default")=>{r.flyTo(e.duration??a??1,void 0,l)})),!r.position&&!r.rotation&&r.resetWithCurrentCamera(bn.ResetFlag.Position|bn.ResetFlag.Rotation|bn.ResetFlag.ViewDistance),this.dispose(e.resetWithCurrentCameraEvent.disposableOn(()=>{r.resetWithCurrentCamera(bn.ResetFlag.Position|bn.ResetFlag.Rotation|bn.ResetFlag.ViewDistance)})),this.dispose(e.captureEvent.disposableOn((a,s)=>{r.capture(a??64,s??64)}))}get view(){return this._view}flyTo(e,i){const{sceneObject:o,czmViewer:r,view:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Ou,"type",Ou.register("ESCesiumViewer",c.ESCameraView.type,Ou));let jm=Ou;const Lu=class Lu extends He{constructor(e,i){super(e,i);L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmESCustomPrimitive=this.disposeVar(new at(i,e.id)),this._czmTexture=this.dv(new ht(i,e.id));const r=this._czmESCustomPrimitive,a=this._czmTexture;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"]));{const s=()=>{const u=e.far*Math.tan(Math.PI*(e.fov/360))*2,A=u/e.aspectRatio,h=e.far,f=e.near*Math.tan(Math.PI*(e.fov/360))*2,d=f/e.aspectRatio,p=e.near,g=[p,-f/2,-d/2],v=[p,-f/2,d/2],y=[p,f/2,d/2],m=[p,f/2,-d/2],b=[h,-u/2,-A/2],x=[h,-u/2,A/2],E=[h,u/2,A/2],B=[h,u/2,-A/2],P=[...g,...v,...y,...m,...b,...x,...E,...B],I=[0,4,5,0,5,1,1,5,6,1,6,2,2,6,7,2,7,3,3,7,4,3,4,0],M=[...I,...I.reverse()],F=[1,0],S=[1,1],T=[1,0],w=[1,1],C=[0,0],D=[0,1],R=[0,0],U=[0,1],O=[...F,...S,...T,...w,...C,...D,...R,...U];r.indexTypedArray=new Uint16Array(M),r.attributes={position:{typedArray:new Float32Array(P),componentsPerAttribute:3},st:{typedArray:new Float32Array(O),componentsPerAttribute:2}},a.uri=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/visible_img.png"),r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,1]};const z=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!z)return;const{min:k,max:Q}=z;r.setLocalAxisedBoundingBox(k,Q)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged,e.farChanged,e.nearChanged));this.dispose(l.disposableOn(()=>s()))}}get czmESCustomPrimitive(){return this._czmESCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i),!0;{const a=Math.max(o.far,o.near)??c.ESCameraVisibleRange.defaults.far;return o.position?(Gn(r,o,i,o.position,a,e),!0):!1}}};L(Lu,"type",Lu.register("ESCesiumViewer",c.ESCameraVisibleRange.type,Lu));let qm=Lu;const zu=class zu extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");if(!i.viewer){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,e.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"]));{const l=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),u=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};u(),this.d(l.don(u))}const a=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/car/PoliceCar.glb"),s=()=>{switch(e.mode){case"policeCar":r.url=a;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>s())),s()}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a):!1}};L(zu,"type",zu.register("ESCesiumViewer",c.ESCar.type,zu));let Km=zu;const Zm={depthTest:{enabled:!0},cull:{enabled:!0,face:1029},blending:{enabled:!0,equationRgb:32774,equationAlpha:32774,functionSourceRgb:770,functionSourceAlpha:1,functionDestinationRgb:771,functionDestinationAlpha:771}},ku=class ku extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_circleCustomPrimitive");L(this,"_cylinderCustomPrimitive");L(this,"_cylinderParticlesCustomPrimitive");this._circleCustomPrimitive=this.disposeVar(new at(e,i)),this._cylinderCustomPrimitive=this.disposeVar(new at(e,i)),this._cylinderParticlesCustomPrimitive=this.disposeVar(new at(e,i));const{circleCustomPrimitive:o}=this;C0(o,{width:120,height:120}),o.fragmentShaderSource=`
2457
2457
  in vec2 v_st;
2458
2458
  uniform vec4 u_color;
2459
2459
  void main()
@@ -2485,7 +2485,7 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
2485
2485
  out_FragColor = imageColor * u_color;
2486
2486
  out_FragColor.a *= smoothstep(1., 0.8, v_st.t);
2487
2487
  }
2488
- `,a.pass="TRANSLUCENT",a.renderState=Zm,a.allowPickingDepth=!1,this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([r,"show"],[this,"show"])),this.dispose(c.track([a,"show"],[this,"show"])),this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([r,"position"],[this,"position"])),this.dispose(c.track([a,"position"],[this,"position"])),this.dispose(c.track([o,"rotation"],[this,"rotation"])),this.dispose(c.track([r,"rotation"],[this,"rotation"])),this.dispose(c.track([a,"rotation"],[this,"rotation"])),this.dispose(c.track([o,"scale"],[this,"scale"])),this.dispose(c.track([r,"scale"],[this,"scale"])),this.dispose(c.track([a,"scale"],[this,"scale"]));{const s={type:"image",uri:ku.defaultParticlesImageUri},l=()=>{o.uniformMap={u_color:this.color??[1,1,0,2]},r.uniformMap={u_color:this.color??[1,1,0,2]},a.uniformMap={u_color:this.color??[1,1,0,2],u_image:s}};l(),this.dispose(this.colorChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(s=>{r.flyTo(s)})),this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([a,"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}};L(ku,"defaultParticlesImageUri","${earthsdk3-assets-script-dir}/assets/img/particles.png");let Ho=ku;(t=>{t.createDefaultProps=()=>({show:void 0,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),scale:c.reactArrayWithUndefined(void 0),color:c.reactArrayWithUndefined(void 0),allowPicking:void 0})})(Ho||(Ho={})),c.extendClassProps(Ho.prototype,Ho.createDefaultProps);const Qu=class Qu extends He{constructor(e,i){super(e,i);L(this,"_czmCityBasePoint");if(this._czmCityBasePoint=this.disposeVar(new Ho(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCityBasePoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"]))}get czmCityBasePoint(){return this._czmCityBasePoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCityBasePoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a.cylinderCustomPrimitive,!0),!0):!1}};L(Qu,"type",Qu.register("ESCesiumViewer",c.ESCityBasePoint.type,Qu));let $m=Qu;class Go extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.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 c.ObjResettingWithEvent(r,()=>{if(this.polygonHierarchy)return new kU(this,e)}));const a=new _.BoundingSphere;{const s=()=>{if(!this.polygonHierarchy)return;const l=$t(this.polygonHierarchy.positions);if(l.length<3){a.radius=-1;return}_.BoundingSphere.fromPoints(l,a)};s(),this.polygonHierarchyChanged.disposableOn(s)}this.dispose(this.flyToEvent.disposableOn(s=>{if(e.actived&&a.radius>0){const l=Ue(a.center);l&&Fe(o,l,a.radius*4,void 0,s)}}))}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}}L(Go,"defaults",{color:[1,1,1,.5]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,color:c.reactArrayWithUndefined(void 0),stRotation:void 0,polygonHierarchy:c.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"})})(Go||(Go={})),c.extendClassProps(Go.prototype,Go.createDefaultProps);class kU extends c.HasOwner{constructor(n,e){if(super(n),!e)throw new Error("!czmViewer");const i=this.owner;if(!i.polygonHierarchy)throw new Error("polygonHierarchy is required");const o=[],r=new _.GeometryInstance({geometry:new _.PolygonGeometry({vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Hi(i.polygonHierarchy),stRotation:i.stRotation&&_.Math.toRadians(i.stRotation),arcType:i.arcType&&_.ArcType[i.arcType],height:i.height,extrudedHeight:i.extrudedHeight,perPositionHeight:i.perPositionHeight,closeTop:i.closeTop,closeBottom:i.closeBottom,ellipsoid:i.ellipsoid&&qe(i.ellipsoid),granularity:i.granularity!==void 0?_.Math.toRadians(i.granularity):void 0}),attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(new _.Color(...i.color??Go.defaults.color)),show:new _.ShowGeometryInstanceAttribute(!0)},id:this});o.push(r);const a=new _.ClassificationPrimitive({geometryInstances:o,asynchronous:!1,allowPicking:i.allowPicking,compressVertices:!1,classificationType:Xt.classificationTypeMap[i.classificationType]});_.ClassificationPrimitive.prototype&&(a.ESSceneObjectID=n.id);{if(!e)throw new Error("!this.owner.czmViewer");const{viewer:s}=e;if(!s)throw new Error("!czmViewer.viewer");s.scene.primitives.add(a),this.dispose(()=>s.scene.primitives.remove(a))}{const s=()=>{a.show=i.show??!0};s(),this.dispose(i.showChanged.disposableOn(s))}}}class QU extends c.Destroyable{constructor(e,i){super();L(this,"_czmClassificationPolygonPrimitive");this._czmClassificationPolygonPrimitive=this.disposeVar(new Go(i,e.id));const o=this._czmClassificationPolygonPrimitive;{const r=()=>{const s=e.show,l=e.fill;if(o.show=s&&l,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};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.classificationTypeChanged));this.dispose(a.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(c.track([o,"allowPicking"],[e,"allowPicking"]))}}class ha extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_helperPolygon");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i);{const o=this.disposeVar(new zr(e,i));this._helperPolygon=o,this.dispose(c.track([o,"show"],[this,"showHelper"],r=>r));{const r=()=>{o.show=this.showHelper};r(),this.dispose(this.showHelperChanged.disposableOn(r))}this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([o,"outline"],[this,"outline"])),this.dispose(c.track([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.track([o,"outlineWidth"],[this,"outlineWidth"])),o.fill=!1,o.color=[0,0,0,0],this.dispose(c.track([o,"positions"],[this,"positions"])),this.dispose(c.track([o,"depth"],[this,"depth"])),this.dispose(c.track([o,"zIndex"],[this,"zIndex"]))}this.disposeVar(new c.ObjResettingWithEvent(this.depthChanged,()=>{if(!(this.depth===void 0||this.depth<0))return new QU(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}}L(ha,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,showHelper:!1,allowPicking:!1,classificationType:"BOTH",outline:!0,outlineColor:c.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:c.reactArray([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0,zIndex:0})})(ha||(ha={})),c.extendClassProps(ha.prototype,ha.createDefaultProps);const Vu=class Vu extends on{constructor(e,i){super(e,i);L(this,"_polygon");if(this._polygon=this.disposeVar(new ha(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._polygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"depth"],[e,"height"])),this.dispose(c.track([r,"showHelper"],[e,"stroked"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"fill"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"]))}get polygon(){return this._polygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,polygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,polygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Vu,"type",Vu.register("ESCesiumViewer",c.ESClassification.type,Vu));let Xm=Vu;const VU=[{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]}}],NU=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
2488
+ `,a.pass="TRANSLUCENT",a.renderState=Zm,a.allowPickingDepth=!1,this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([r,"show"],[this,"show"])),this.dispose(c.track([a,"show"],[this,"show"])),this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([r,"position"],[this,"position"])),this.dispose(c.track([a,"position"],[this,"position"])),this.dispose(c.track([o,"rotation"],[this,"rotation"])),this.dispose(c.track([r,"rotation"],[this,"rotation"])),this.dispose(c.track([a,"rotation"],[this,"rotation"])),this.dispose(c.track([o,"scale"],[this,"scale"])),this.dispose(c.track([r,"scale"],[this,"scale"])),this.dispose(c.track([a,"scale"],[this,"scale"]));{const s={type:"image",uri:ku.defaultParticlesImageUri},l=()=>{o.uniformMap={u_color:this.color??[1,1,0,2]},r.uniformMap={u_color:this.color??[1,1,0,2]},a.uniformMap={u_color:this.color??[1,1,0,2],u_image:s}};l(),this.dispose(this.colorChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(s=>{r.flyTo(s)})),this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([a,"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}};L(ku,"defaultParticlesImageUri","${earthsdk3-assets-script-dir}/assets/img/particles.png");let Ho=ku;(t=>{t.createDefaultProps=()=>({show:void 0,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),scale:c.reactArrayWithUndefined(void 0),color:c.reactArrayWithUndefined(void 0),allowPicking:void 0})})(Ho||(Ho={})),c.extendClassProps(Ho.prototype,Ho.createDefaultProps);const Qu=class Qu extends He{constructor(e,i){super(e,i);L(this,"_czmCityBasePoint");if(this._czmCityBasePoint=this.disposeVar(new Ho(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCityBasePoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"]))}get czmCityBasePoint(){return this._czmCityBasePoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCityBasePoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a.cylinderCustomPrimitive,!0),!0):!1}};L(Qu,"type",Qu.register("ESCesiumViewer",c.ESCityBasePoint.type,Qu));let $m=Qu;class Go extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.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 c.ObjResettingWithEvent(r,()=>{if(this.polygonHierarchy)return new QU(this,e)}));const a=new _.BoundingSphere;{const s=()=>{if(!this.polygonHierarchy)return;const l=$t(this.polygonHierarchy.positions);if(l.length<3){a.radius=-1;return}_.BoundingSphere.fromPoints(l,a)};s(),this.polygonHierarchyChanged.disposableOn(s)}this.dispose(this.flyToEvent.disposableOn(s=>{if(e.actived&&a.radius>0){const l=Ue(a.center);l&&Fe(o,l,a.radius*4,void 0,s)}}))}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}}L(Go,"defaults",{color:[1,1,1,.5]}),(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,arcType:void 0,color:c.reactArrayWithUndefined(void 0),stRotation:void 0,polygonHierarchy:c.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"})})(Go||(Go={})),c.extendClassProps(Go.prototype,Go.createDefaultProps);class QU extends c.HasOwner{constructor(n,e){if(super(n),!e)throw new Error("!czmViewer");const i=this.owner;if(!i.polygonHierarchy)throw new Error("polygonHierarchy is required");const o=[],r=new _.GeometryInstance({geometry:new _.PolygonGeometry({vertexFormat:_.MaterialAppearance.MaterialSupport.ALL.vertexFormat,polygonHierarchy:Hi(i.polygonHierarchy),stRotation:i.stRotation&&_.Math.toRadians(i.stRotation),arcType:i.arcType&&_.ArcType[i.arcType],height:i.height,extrudedHeight:i.extrudedHeight,perPositionHeight:i.perPositionHeight,closeTop:i.closeTop,closeBottom:i.closeBottom,ellipsoid:i.ellipsoid&&qe(i.ellipsoid),granularity:i.granularity!==void 0?_.Math.toRadians(i.granularity):void 0}),attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(new _.Color(...i.color??Go.defaults.color)),show:new _.ShowGeometryInstanceAttribute(!0)},id:this});o.push(r);const a=new _.ClassificationPrimitive({geometryInstances:o,asynchronous:!1,allowPicking:i.allowPicking,compressVertices:!1,classificationType:Xt.classificationTypeMap[i.classificationType]});_.ClassificationPrimitive.prototype&&(a.ESSceneObjectID=n.id);{if(!e)throw new Error("!this.owner.czmViewer");const{viewer:s}=e;if(!s)throw new Error("!czmViewer.viewer");s.scene.primitives.add(a),this.dispose(()=>s.scene.primitives.remove(a))}{const s=()=>{a.show=i.show??!0};s(),this.dispose(i.showChanged.disposableOn(s))}}}class VU extends c.Destroyable{constructor(e,i){super();L(this,"_czmClassificationPolygonPrimitive");this._czmClassificationPolygonPrimitive=this.disposeVar(new Go(i,e.id));const o=this._czmClassificationPolygonPrimitive;{const r=()=>{const s=e.show,l=e.fill;if(o.show=s&&l,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};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.fillChanged,e.outlineChanged,e.outlineColorChanged,e.outlineWidthChanged,e.colorChanged,e.positionsChanged,e.depthChanged,e.classificationTypeChanged));this.dispose(a.disposableOn(r))}this.dispose(e.flyToEvent.disposableOn(r=>{o.flyTo(r)})),this.dispose(c.track([o,"allowPicking"],[e,"allowPicking"]))}}class ha extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_helperPolygon");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i);{const o=this.disposeVar(new zr(e,i));this._helperPolygon=o,this.dispose(c.track([o,"show"],[this,"showHelper"],r=>r));{const r=()=>{o.show=this.showHelper};r(),this.dispose(this.showHelperChanged.disposableOn(r))}this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([o,"outline"],[this,"outline"])),this.dispose(c.track([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.track([o,"outlineWidth"],[this,"outlineWidth"])),o.fill=!1,o.color=[0,0,0,0],this.dispose(c.track([o,"positions"],[this,"positions"])),this.dispose(c.track([o,"depth"],[this,"depth"])),this.dispose(c.track([o,"zIndex"],[this,"zIndex"]))}this.disposeVar(new c.ObjResettingWithEvent(this.depthChanged,()=>{if(!(this.depth===void 0||this.depth<0))return new VU(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}}L(ha,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,showHelper:!1,allowPicking:!1,classificationType:"BOTH",outline:!0,outlineColor:c.reactArray([1,1,1,1]),outlineWidth:2,fill:!0,color:c.reactArray([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0,zIndex:0})})(ha||(ha={})),c.extendClassProps(ha.prototype,ha.createDefaultProps);const Vu=class Vu extends on{constructor(e,i){super(e,i);L(this,"_polygon");if(this._polygon=this.disposeVar(new ha(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._polygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"depth"],[e,"height"])),this.dispose(c.track([r,"showHelper"],[e,"stroked"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"fill"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"]))}get polygon(){return this._polygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,polygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,polygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Vu,"type",Vu.register("ESCesiumViewer",c.ESClassification.type,Vu));let Xm=Vu;const NU=[{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]}}],HU=`第一个packet代表了cesium场景(cesium时间轴的范围,当前时刻,倍速等信息)之外,其他的packet都可以理解为描述某一时间范围内的entity的行为。
2489
2489
  \`\`\`
2490
2490
  [{
2491
2491
  "id": "document",
@@ -2555,12 +2555,12 @@ class CityShaderInstance extends xbsj['xr-base-utils'].Destroyable {
2555
2555
  }
2556
2556
  }
2557
2557
  }
2558
- `,HU=`data 路径都可以使用下面回调函数
2558
+ `,GU=`data 路径都可以使用下面回调函数
2559
2559
  \`\`\`
2560
2560
  ${Px}
2561
2561
  \`\`\`
2562
2562
 
2563
- `,Bx=Date.now();new Date(Bx).toISOString(),new Date(Bx+864e5).toISOString();const Nu=class Nu extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new c.Event));L(this,"_dataSource",this.disposeVar(c.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(c.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(c.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(c.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(c.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(c.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(c.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(c.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 r=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(r);const a=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:u}=this;this.startTime=_.JulianDate.toDate(u.clock.startTime).getTime(),this.stopTime=_.JulianDate.toDate(u.clock.stopTime).getTime(),this.currentTime=_.JulianDate.toDate(u.clock.currentTime).getTime(),this.multiplier=u.clock.multiplier,this.clockStep=ze.getClockStep(u.clock.clockStep),this.clockRange=ze.getClockRange(u.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(a));const s=()=>{this.dataSource&&(this.dataSource.show=this.show??Nu.defaults.show)};s(),this.dispose(this.showChanged.disposableOn(s));const l=this.disposeVar(c.react(void 0));{const u=()=>{var f;if(this.uri)if(this.uri&&typeof this.uri!="string")(f=_.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(d=>d);else return c.ESSceneObject.context.getStrFromEnv(this.uri)},A=()=>{l.value=this.data??u()};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.dispose(h.disposableOn(A))}{const u=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{if(r(),!l.value)return;let d;try{d=await _.CzmlDataSource.load(l.value)}catch(p){console.error(`加载czml错误:${p}`),console.error(p)}if(d&&(f.check(),d.entities.values.forEach(p=>{_.Entity.prototype&&(d.ESSceneObjectID=i)}),o.dataSources.add(d),this._dataSource.value=d,s(),(this.autoResetClock??Nu.defaults.autoResetClock)&&a(),!!this.loadFun))try{this.loadFun(d)}catch(p){console.error(p)}})),A=()=>{u.isRunning&&u.cancel(),u.restart()};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(l.changed,this.loadFunChanged));this.dispose(h.disposableOn(A))}{const u=()=>{if(this.loadFuncStr)try{const A=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=A}catch(A){console.error(A),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}};L(Nu,"defaults",{show:!0,allowPicking:!0,data:VU,dataMd:NU,autoResetClock:!0,clockEnabled:!1,startTime:ze.defaults.startTime,stopTime:ze.defaults.stopTime,currentTime:ze.defaults.currentTime,multiplier:ze.defaults.multiplier,clockStep:ze.defaults.clockStep,clockRange:ze.defaults.clockRange,shouldAnimate:ze.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:Px,defaultLoadFuncDocStr:HU});let Wo=Nu;(t=>{t.createDefaultProps=()=>({show:void 0,uri:void 0,allowPicking:void 0,data:c.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})})(Wo||(Wo={})),c.extendClassProps(Wo.prototype,Wo.createDefaultProps);const Hu=class Hu extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Wo(e,n.id));this.dispose(c.track([o,"show"],[n,"show"])),this.dispose(c.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(c.bind([o,"data"],[n,"data"])),this.dispose(c.bind([o,"uri"],[n,"uri"])),this.dispose(c.bind([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(c.bind([o,"autoResetClock"],[n,"autoResetClock"])),this.dispose(c.bind([o,"clockEnabled"],[n,"clockEnabled"])),this.dispose(c.bind([o,"startTime"],[n,"startTime"])),this.dispose(c.bind([o,"stopTime"],[n,"stopTime"])),this.dispose(c.bind([o,"currentTime"],[n,"currentTime"])),this.dispose(c.bind([o,"multiplier"],[n,"multiplier"])),this.dispose(c.bind([o,"clockStep"],[n,"clockStep"])),this.dispose(c.bind([o,"clockRange"],[n,"clockRange"])),this.dispose(c.bind([o,"shouldAnimate"],[n,"shouldAnimate"])),this.dispose(n.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r)}))}};L(Hu,"type",Hu.register("ESCesiumViewer",c.ESCzml.type,Hu));let Ym=Hu;async function GU(t,n){const e=c.fetchArrayBuffer(t+"index.bin"),i=c.fetchArrayBuffer(t+"vertex.bin"),o=[...new Array(n).keys()].map(h=>h.toString().padStart(6,"0")).map(h=>`${t}bins/R2DC${h}.bin`).map(h=>c.fetchArrayBuffer(h)),r=await Promise.all([e,i,...o]);if(r.some(h=>h===void 0)){console.warn("有数据未能解析!");return}const[a,...s]=r,l=new Uint16Array(a),[u,...A]=s.map(h=>new Float32Array(h));return{indexBuffer:l,vertexBuffer:u,propBuffers:A}}function*WU(t){const e=t.length/3|0;for(let i=0;i<e;++i)yield[t[i*3+0],t[i*3+1],t[i*3+2]]}const Gu=class Gu extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");L(this,"_czmTexture");if(this._czmCustomPrimitive=this.disposeVar(new at(i,e.id)),this._czmTexture=this.ad(new ht(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this,{czmTexture:a}=this;{a.uri="",a.size=[1024,1],a.enabled=!0;const l=new c.ColorStops,u=()=>{l.value=e.colorStops??c.ESDataMesh.defaults.colorStops;const A=l.getColorsInUint8(new Uint8Array(1024*4));a.copyTexture({source:{width:1024,height:1,arrayBufferView:A}})};u(),this.dispose(e.colorStopsChanged.disposableOn(u))}this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),r.cull=!1,r.vertexShaderSource=`
2563
+ `,Bx=Date.now();new Date(Bx).toISOString(),new Date(Bx+864e5).toISOString();const Nu=class Nu extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new c.Event));L(this,"_dataSource",this.disposeVar(c.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(c.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(c.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(c.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(c.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(c.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(c.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(c.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 r=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource,!0),this._dataSource.value=void 0)};this.dispose(r);const a=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:u}=this;this.startTime=_.JulianDate.toDate(u.clock.startTime).getTime(),this.stopTime=_.JulianDate.toDate(u.clock.stopTime).getTime(),this.currentTime=_.JulianDate.toDate(u.clock.currentTime).getTime(),this.multiplier=u.clock.multiplier,this.clockStep=ze.getClockStep(u.clock.clockStep),this.clockRange=ze.getClockRange(u.clock.clockRange)};this.dispose(this.resetClockEvent.disposableOn(a));const s=()=>{this.dataSource&&(this.dataSource.show=this.show??Nu.defaults.show)};s(),this.dispose(this.showChanged.disposableOn(s));const l=this.disposeVar(c.react(void 0));{const u=()=>{var f;if(this.uri)if(this.uri&&typeof this.uri!="string")(f=_.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(d=>d);else return c.ESSceneObject.context.getStrFromEnv(this.uri)},A=()=>{l.value=this.data??u()};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.dispose(h.disposableOn(A))}{const u=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{if(r(),!l.value)return;let d;try{d=await _.CzmlDataSource.load(l.value)}catch(p){console.error(`加载czml错误:${p}`),console.error(p)}if(d&&(f.check(),d.entities.values.forEach(p=>{_.Entity.prototype&&(d.ESSceneObjectID=i)}),o.dataSources.add(d),this._dataSource.value=d,s(),(this.autoResetClock??Nu.defaults.autoResetClock)&&a(),!!this.loadFun))try{this.loadFun(d)}catch(p){console.error(p)}})),A=()=>{u.isRunning&&u.cancel(),u.restart()};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(l.changed,this.loadFunChanged));this.dispose(h.disposableOn(A))}{const u=()=>{if(this.loadFuncStr)try{const A=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=A}catch(A){console.error(A),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}};L(Nu,"defaults",{show:!0,allowPicking:!0,data:NU,dataMd:HU,autoResetClock:!0,clockEnabled:!1,startTime:ze.defaults.startTime,stopTime:ze.defaults.stopTime,currentTime:ze.defaults.currentTime,multiplier:ze.defaults.multiplier,clockStep:ze.defaults.clockStep,clockRange:ze.defaults.clockRange,shouldAnimate:ze.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/simple.czml",defaultLoadFuncStr:Px,defaultLoadFuncDocStr:GU});let Wo=Nu;(t=>{t.createDefaultProps=()=>({show:void 0,uri:void 0,allowPicking:void 0,data:c.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})})(Wo||(Wo={})),c.extendClassProps(Wo.prototype,Wo.createDefaultProps);const Hu=class Hu extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Wo(e,n.id));this.dispose(c.track([o,"show"],[n,"show"])),this.dispose(c.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(c.bind([o,"data"],[n,"data"])),this.dispose(c.bind([o,"uri"],[n,"uri"])),this.dispose(c.bind([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(c.bind([o,"autoResetClock"],[n,"autoResetClock"])),this.dispose(c.bind([o,"clockEnabled"],[n,"clockEnabled"])),this.dispose(c.bind([o,"startTime"],[n,"startTime"])),this.dispose(c.bind([o,"stopTime"],[n,"stopTime"])),this.dispose(c.bind([o,"currentTime"],[n,"currentTime"])),this.dispose(c.bind([o,"multiplier"],[n,"multiplier"])),this.dispose(c.bind([o,"clockStep"],[n,"clockStep"])),this.dispose(c.bind([o,"clockRange"],[n,"clockRange"])),this.dispose(c.bind([o,"shouldAnimate"],[n,"shouldAnimate"])),this.dispose(n.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r)}))}};L(Hu,"type",Hu.register("ESCesiumViewer",c.ESCzml.type,Hu));let Ym=Hu;async function WU(t,n){const e=c.fetchArrayBuffer(t+"index.bin"),i=c.fetchArrayBuffer(t+"vertex.bin"),o=[...new Array(n).keys()].map(h=>h.toString().padStart(6,"0")).map(h=>`${t}bins/R2DC${h}.bin`).map(h=>c.fetchArrayBuffer(h)),r=await Promise.all([e,i,...o]);if(r.some(h=>h===void 0)){console.warn("有数据未能解析!");return}const[a,...s]=r,l=new Uint16Array(a),[u,...A]=s.map(h=>new Float32Array(h));return{indexBuffer:l,vertexBuffer:u,propBuffers:A}}function*jU(t){const e=t.length/3|0;for(let i=0;i<e;++i)yield[t[i*3+0],t[i*3+1],t[i*3+2]]}const Gu=class Gu extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");L(this,"_czmTexture");if(this._czmCustomPrimitive=this.disposeVar(new at(i,e.id)),this._czmTexture=this.ad(new ht(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCustomPrimitive:r}=this,{czmTexture:a}=this;{a.uri="",a.size=[1024,1],a.enabled=!0;const l=new c.ColorStops,u=()=>{l.value=e.colorStops??c.ESDataMesh.defaults.colorStops;const A=l.getColorsInUint8(new Uint8Array(1024*4));a.copyTexture({source:{width:1024,height:1,arrayBufferView:A}})};u(),this.dispose(e.colorStopsChanged.disposableOn(u))}this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),r.cull=!1,r.vertexShaderSource=`
2564
2564
  precision highp float;
2565
2565
  in vec3 a_position;
2566
2566
  in vec3 a_prop;
@@ -2590,7 +2590,7 @@ ${Px}
2590
2590
  // out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, (a + .1)*4.);
2591
2591
  out_FragColor = vec4(texture(u_gradientMap, vec2(a, .5)).rgb, a);
2592
2592
  }
2593
- `,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let s=this.disposeVar(c.react(void 0));{const l=this.disposeVar(c.createProcessingFromAsyncFunc(async A=>{s.value=void 0;const h=e.url??c.ESDataMesh.defaults.url;if(!h)return;await A.promise(c.sleep(200));const f=(e.maxTime??23)|0;s.value=await A.promise(GU(c.ESSceneObject.context.getStrFromEnv(typeof h=="string"?h:h.url),f+1))}));l.start();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(h){this._buffer=h}[Symbol.iterator](){return WU(this._buffer)}}const u=()=>{if(!s.value)return;const{vertexBuffer:A,propBuffers:h,indexBuffer:f}=s.value,{minPos:d,maxPos:p}=c.getMinMaxCorner(new l(A));r.setLocalAxisedBoundingBox(d,p);const g=(e.maxTime??23)|0;let v=(e.currentTime??c.ESDataMesh.defaults.currentTime)/g;v=v<0?0:v>1?1:v;const y=v*g;let m=v*g|0,b=y-m;if(m>=g&&(m=g-1,b=1),!Number.isFinite(b)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=f,!h[m]||!h[m+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:A,componentsPerAttribute:3},a_prop:{typedArray:h[m],componentsPerAttribute:3},a_prop2:{typedArray:h[m+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${a.id}`},u_stripMinMaxValue:[e.minPropValue??c.ESDataMesh.defaults.minPropValue,e.maxPropValue??c.ESDataMesh.defaults.maxPropValue],u_ratio:b}};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(s.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a,!0),!0):!1}};L(Gu,"type",Gu.register("ESCesiumViewer",c.ESDataMesh.type,Gu));let Jm=Gu;const ls=class ls extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_heading",this.disposeVar(c.react(0)));L(this,"_textFunc",this.disposeVar(c.react(void 0)));const o=this;{const s=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=c.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=c.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=c.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?c.clampN180_180(u):c.clamp0_360(u)}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(s))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(c.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(c.bind([r,"arcType"],[o,"arcType"])),this.dispose(c.bind([r,"color"],[o,"color"])),this.dispose(c.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(c.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(c.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(c.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(c.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(c.bind([r,"positions"],[o,"positions"])),this.dispose(c.bind([r,"show"],[o,"show"])),this.dispose(c.bind([r,"width"],[o,"width"])),this.dispose(c.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(c.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(s=>{e.actived&&r.flyTo(s)}));const a=this.disposeVar(new wt(e,i));this.dispose(c.bind([a,"shadowDom"],[o,"shadowDom"])),this.dispose(c.bind([a,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(c.bind([a,"show"],[o,"show"]));{const s=()=>{o.positions&&o.positions.length>=2?a.position=o.positions[1]:a.position=void 0};s(),this.dispose(o.positionsChanged.disposableOn(s))}{const s=()=>{const{heading:u}=o,A=(o.textFunc??ls.defaultTextFunc_度格式)(u);a.innerHTML=xo(`方向: ${A}`,24)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(s))}this.ad(a.pickedEvent.don(s=>{Gi(s)===0&&this.pickedEvent.emit(s)}))}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}};L(ls,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(ls,"defaultTextFunc_度分格式",e=>`${nl(e,!0)}`),L(ls,"defaultTextFunc_度分秒格式",e=>`${nl(e,!1)}`),L(ls,"defaults",{positions:[]});let jo=ls;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:8,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(jo||(jo={})),c.extendClassProps(jo.prototype,jo.createDefaultProps);const Wu=class Wu extends on{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new jo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Wu,"type",Wu.register("ESCesiumViewer",c.ESDirectionMeasurement.type,Wu));let eg=Wu;class Aa extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distances",this.disposeVar(c.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await B0(e.viewer,this.positions??[]):this._distances.value=c.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const a=this.disposeVar(new Ye(e,i));a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"positions"],[this,"positions"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([a,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&a.flyTo(s)}));{const s=[],l=()=>{for(let A of s)A.destroy();s.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const h=Bp("起点",this.positions[0],e,i);h.dispose(c.track([h,"show"],[this,"show"])),h.dispose(c.track([h,"shadowDom"],[this,"shadowDom"])),h.dispose(c.track([h,"cssAllInitial"],[this,"cssAllInitial"])),s.push(h)}const A=this.distances.length;for(let h=0;h<A;++h){const f=this.distances[h],d=this.positions[h+1],p=Bp(`长度: ${Ih(f)}`,d,e,i);p.dispose(c.track([p,"show"],[this,"show"])),p.dispose(c.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(c.track([p,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(p.pickedEvent.don(g=>{Gi(g)===0&&this.pickedEvent.emit(g)})),s.push(p)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>c.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}}L(Aa,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Aa||(Aa={})),c.extendClassProps(Aa.prototype,Aa.createDefaultProps);const ju=class ju extends on{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(ju,"type",ju.register("ESCesiumViewer",c.ESGeoLineString.type,ju));let fa=ju;const qu=class qu extends fa{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Aa(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(qu,"type",qu.register("ESCesiumViewer",c.ESDistanceMeasurement.type,qu));let tg=qu;class pa extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i)}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:c.reactPositions(void 0),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2})})(pa||(pa={})),c.extendClassProps(pa.prototype,pa.createDefaultProps);class jU extends c.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];c.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class qU extends c.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];c.ESSceneObject.getSceneObjById(i)||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 Ku=class Ku extends Un{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new pa(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const a=this._czmPolygonClipping;a.showHelper=!1,this.dispose(c.bind([a,"positions"],[e,"points"])),this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.reverse=e.mode!=="in"};s(),this.dispose(e.modeChanged.disposableOn(s))}c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new qU(this):!l||!(l instanceof c.ES3DTileset)?void 0:new jU(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Ku,"type",Ku.register("ESCesiumViewer",c.ESExcavate.type,Ku));let ng=Ku;const Zu=class Zu extends He{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new wi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const a=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};a(),this.ad(e.scaleChanged.don(a))}this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"translation"],[e,"translation"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Hn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Zu,"type",Zu.register("ESCesiumViewer",c.ESFireParticleSystem.type,Zu));let ig=Zu;class da extends c.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));L(this,"_ratio",this.disposeVar(c.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new c.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new Er(e,i)),this._player=this.disposeVar(new c.Player),this.dispose(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(c.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(c.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(c.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(c.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(c.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(c.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(c.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(c.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(c.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(c.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(c.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPath,"show"],[this,"show"])),this.dispose(c.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(c.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const a=this.granularity*Math.PI/180,s=mp(this.positions,this.arcType??"GEODESIC",a);if(s){this._geoPath.timePosRots=s.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(c.bind([this._player,"loop"],[this,"loop"])),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._player,"duration"],[this,"duration"])),this.dispose(c.bind([this._player,"playing"],[this,"playing"])),this.dispose(c.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,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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"})})(da||(da={})),c.extendClassProps(da.prototype,da.createDefaultProps);class jl extends c.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));this._geoPolylinePath=this.disposeVar(new da(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(c.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(c.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(c.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(c.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(c.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(c.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(c.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(c.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(c.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(c.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(c.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(c.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(c.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const a=Tp(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=a}else this._geoPolylinePath.positions=void 0}catch(a){console.error(a),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(a=>{this._geoPolylinePath.flyTo(a)}))}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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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})})(jl||(jl={})),c.extendClassProps(jl.prototype,jl.createDefaultProps);const KU=[["256",256],["512",512],["1024",1024]],ZU=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Tn=class Tn extends c.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new c.Event));this.ad(c.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(c.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"accessToken"],"令牌",Tn.defaults.accessToken),new c.Number4Property([this,"rectangle"],"矩形范围",Tn.defaults.rectangle),new c.JsonProperty([this,"url"],"服务地址",Tn.defaults.url),new c.JsonProperty([this,"style"],"样式配置",Tn.defaults.style),new c.NumberProperty([this,"zIndex"],"层级序号",Tn.defaults.zIndex),new c.EnumProperty([this,"tileSize"],KU,"瓦片大小",256),new c.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Tn.defaults.maximumLevel),new c.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Tn.defaults.minimumLevel),new c.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Tn.defaults.scheme)],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EnumProperty([this,"splitDirection"],ZU,"splitDirection","NONE"),new c.GroupProperty([],"czm","czm"),new c.NumberProperty([this,"czmAlpha"],"透明度"),new c.NumberProperty([this,"czmBrightness"],"亮度"),new c.NumberProperty([this,"czmContrast"],"对比度"),new c.NumberProperty([this,"czmHue"],"色相"),new c.NumberProperty([this,"czmSaturation"],"饱和度"),new c.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(Tn,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),rectangle:c.reactJsonWithUndefined([-180,-90,180,90]),url:c.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:c.reactArrayWithUndefined([]),scheme:c.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(Tn,"type",Tn.register("ESMVTLayer",Tn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let ff=Tn;const $U=t=>{const n=[{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:i}of n)if(t>=e)return i;return 20},XU=async(t,n,e)=>(await fetch(`http://abc.gggis.com:13001/xyzinfo/${e}/${t}/${n}`)).json(),YU=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=$U(o);let a=Math.floor((e+180)/360*Math.pow(2,r+1)),s=Math.floor((90-i)/180*Math.pow(2,r));return await XU(a,s,r)};class JU extends c.Destroyable{constructor(n,e,i){super();const o=async()=>{const a=await YU(n);e.datesEvent.emit(a,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const a=()=>{const s=e.currentDate?e.currentDate:0;i.url=`http://abc.gggis.com:13001/timetile/tms/${s}/tilemapresource.xml`};a(),this.d(e.currentDateChanged.don(a))}}}const Wa=class Wa extends c.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new c.ESImageryLayer));L(this,"_datesEvent",this.dv(new c.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(c.track([i,"show"],[this,"show"])),this.d(c.track([i,"zIndex"],[this,"zIndex"])),this.d(c.track([i,"rectangle"],[this,"rectangle"])),this.d(c.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(c.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new JU(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"currentDate"],"时间","0"),new c.NumberProperty([this,"zIndex"],"层级",0),new c.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(Wa,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:c.reactArray([-180,-90,180,90])})),L(Wa,"type",Wa.register("ESGeHistoryImagery",Wa,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let pf=Wa;const Tx=`async (dataSource, viewer) => {
2593
+ `,r.uniformMap={u_gradientMap:{type:"texture",id:"5d45a4a4-4f5d-4424-aea5-181de75bd13b"},u_stripMinMaxValue:[0,1],u_ratio:0};let s=this.disposeVar(c.react(void 0));{const l=this.disposeVar(c.createProcessingFromAsyncFunc(async A=>{s.value=void 0;const h=e.url??c.ESDataMesh.defaults.url;if(!h)return;await A.promise(c.sleep(200));const f=(e.maxTime??23)|0;s.value=await A.promise(WU(c.ESSceneObject.context.getStrFromEnv(typeof h=="string"?h:h.url),f+1))}));l.start();const u=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.maxTimeChanged));this.dispose(u.disposableOn(()=>l.restart()))}{class l{constructor(h){this._buffer=h}[Symbol.iterator](){return jU(this._buffer)}}const u=()=>{if(!s.value)return;const{vertexBuffer:A,propBuffers:h,indexBuffer:f}=s.value,{minPos:d,maxPos:p}=c.getMinMaxCorner(new l(A));r.setLocalAxisedBoundingBox(d,p);const g=(e.maxTime??23)|0;let v=(e.currentTime??c.ESDataMesh.defaults.currentTime)/g;v=v<0?0:v>1?1:v;const y=v*g;let m=v*g|0,b=y-m;if(m>=g&&(m=g-1,b=1),!Number.isFinite(b)){console.error("!Number.isFinite(rr)");debugger;return}if(r.indexTypedArray=f,!h[m]||!h[m+1]){console.error("!propBuffers[i] || !propBuffers[i + 1]");debugger}r.attributes={a_position:{typedArray:A,componentsPerAttribute:3},a_prop:{typedArray:h[m],componentsPerAttribute:3},a_prop2:{typedArray:h[m+1],componentsPerAttribute:3}},r.uniformMap={u_gradientMap:{type:"texture",id:`${a.id}`},u_stripMinMaxValue:[e.minPropValue??c.ESDataMesh.defaults.minPropValue,e.maxPropValue??c.ESDataMesh.defaults.maxPropValue],u_ratio:b}};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(s.changed.disposableOn(u))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a,!0),!0):!1}};L(Gu,"type",Gu.register("ESCesiumViewer",c.ESDataMesh.type,Gu));let Jm=Gu;const ls=class ls extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_heading",this.disposeVar(c.react(0)));L(this,"_textFunc",this.disposeVar(c.react(void 0)));const o=this;{const s=()=>{if(this.positions&&this.positions.length>=2){let u=0;this.arcType===void 0||this.arcType==="GEODESIC"?u=c.geoHeading(this.positions[0],this.positions[1]):this.arcType==="RHUMB"?u=c.geoRhumbHeading(this.positions[0],this.positions[1]):this.arcType==="NONE"?u=c.geoHeading(this.positions[0],this.positions[1]):console.warn(`未知的arcType: ${this.arcType},导致距离无法计算!`),this._heading.value=this.angleMode==="-180~180"?c.clampN180_180(u):c.clamp0_360(u)}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.angleModeChanged));this.dispose(l.disposableOn(s))}const r=this.disposeVar(new Ye(e,i));r.loop=!1,this.dispose(c.track([r,"allowPicking"],[o,"allowPicking"])),this.dispose(c.bind([r,"arcType"],[o,"arcType"])),this.dispose(c.bind([r,"color"],[o,"color"])),this.dispose(c.bind([r,"dashLength"],[o,"dashLength"])),this.dispose(c.bind([r,"dashPattern"],[o,"dashPattern"])),this.dispose(c.bind([r,"gapColor"],[o,"gapColor"])),this.dispose(c.bind([r,"hasArrow"],[o,"hasArrow"])),this.dispose(c.bind([r,"hasDash"],[o,"hasDash"])),this.dispose(c.bind([r,"positions"],[o,"positions"])),this.dispose(c.bind([r,"show"],[o,"show"])),this.dispose(c.bind([r,"width"],[o,"width"])),this.dispose(c.bind([r,"depthTest"],[o,"depthTest"])),this.dispose(c.bind([r,"ground"],[o,"strokeGround"])),this.dispose(o.flyToEvent.disposableOn(s=>{e.actived&&r.flyTo(s)}));const a=this.disposeVar(new wt(e,i));this.dispose(c.bind([a,"shadowDom"],[o,"shadowDom"])),this.dispose(c.bind([a,"cssAllInitial"],[o,"cssAllInitial"])),this.dispose(c.bind([a,"show"],[o,"show"]));{const s=()=>{o.positions&&o.positions.length>=2?a.position=o.positions[1]:a.position=void 0};s(),this.dispose(o.positionsChanged.disposableOn(s))}{const s=()=>{const{heading:u}=o,A=(o.textFunc??ls.defaultTextFunc_度格式)(u);a.innerHTML=xo(`方向: ${A}`,24)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(o.headingChanged,o.textFuncChanged));this.dispose(l.disposableOn(s))}this.ad(a.pickedEvent.don(s=>{Gi(s)===0&&this.pickedEvent.emit(s)}))}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}};L(ls,"defaultTextFunc_度格式",e=>`${e.toFixed(5)}°`),L(ls,"defaultTextFunc_度分格式",e=>`${nl(e,!0)}`),L(ls,"defaultTextFunc_度分秒格式",e=>`${nl(e,!1)}`),L(ls,"defaults",{positions:[]});let jo=ls;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:8,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,angleMode:"-180~180",strokeGround:!1})})(jo||(jo={})),c.extendClassProps(jo.prototype,jo.createDefaultProps);const Wu=class Wu extends on{constructor(e,i){super(e,i);L(this,"_czmDirectionMeasurement");if(this._czmDirectionMeasurement=this.disposeVar(new jo(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDirectionMeasurement;r.angleMode="0~360",this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):u==="normal"?(r.hasDash=!1,r.hasArrow=!1):(r.hasDash=!1,r.hasArrow=!0);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDirectionMeasurement(){return this._czmDirectionMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDirectionMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Wu,"type",Wu.register("ESCesiumViewer",c.ESDirectionMeasurement.type,Wu));let eg=Wu;class Aa extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distances",this.disposeVar(c.reactArray([])));const o=async()=>{this.strokeGround&&e.viewer?this._distances.value=await B0(e.viewer,this.positions??[]):this._distances.value=c.getDistancesFromPositions(this.positions??[],this.arcType)};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.strokeGroundChanged));this.dispose(r.disposableOn(o));const a=this.disposeVar(new Ye(e,i));a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"positions"],[this,"positions"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"])),this.dispose(c.bind([a,"ground"],[this,"strokeGround"])),this.dispose(this.flyToEvent.disposableOn(s=>{e.actived&&a.flyTo(s)}));{const s=[],l=()=>{for(let A of s)A.destroy();s.length=0};this.dispose(l);const u=()=>{if(l(),!this.positions)return;if(this.positions.length>0&&this.distances.length>0){const h=Bp("起点",this.positions[0],e,i);h.dispose(c.track([h,"show"],[this,"show"])),h.dispose(c.track([h,"shadowDom"],[this,"shadowDom"])),h.dispose(c.track([h,"cssAllInitial"],[this,"cssAllInitial"])),s.push(h)}const A=this.distances.length;for(let h=0;h<A;++h){const f=this.distances[h],d=this.positions[h+1],p=Bp(`长度: ${Ih(f)}`,d,e,i);p.dispose(c.track([p,"show"],[this,"show"])),p.dispose(c.track([p,"shadowDom"],[this,"shadowDom"])),p.dispose(c.track([p,"cssAllInitial"],[this,"cssAllInitial"])),this.ad(p.pickedEvent.don(g=>{Gi(g)===0&&this.pickedEvent.emit(g)})),s.push(p)}};u(),this.dispose(this.distancesChanged.disposableOn(()=>c.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}}L(Aa,"defaults",{positions:[]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1,strokeGround:!1})})(Aa||(Aa={})),c.extendClassProps(Aa.prototype,Aa.createDefaultProps);const ju=class ju extends on{constructor(e,i){super(e,i);L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoPolyline;this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get geoPolyline(){return this._geoPolyline}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolyline:a}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(ju,"type",ju.register("ESCesiumViewer",c.ESGeoLineString.type,ju));let fa=ju;const qu=class qu extends fa{constructor(e,i){super(e,i);L(this,"_czmDistanceMeasurement");if(this._czmDistanceMeasurement=this.disposeVar(new Aa(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmDistanceMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmDistanceMeasurement(){return this._czmDistanceMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmDistanceMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(qu,"type",qu.register("ESCesiumViewer",c.ESDistanceMeasurement.type,qu));let tg=qu;class pa extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i)}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:c.reactPositions(void 0),reverse:!1,edgeColor:c.reactArray([1,1,1,1]),edgeWidth:2})})(pa||(pa={})),c.extendClassProps(pa.prototype,pa.createDefaultProps);class qU extends c.Destroyable{constructor(n,e){super(),this._czmESExcavate=n,this._eS3DTileset=e;for(let i=0;i<this._eS3DTileset.excavateId.length;i++){const o=this._eS3DTileset.excavateId[i];c.ESSceneObject.getSceneObjById(o)||this._eS3DTileset.excavateId.splice(i,1)}this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId,this._czmESExcavate.czmPolygonClipping.id],this.dispose(()=>{this._eS3DTileset.excavateId=[...this._eS3DTileset.excavateId.filter(i=>i!==this._czmESExcavate.czmPolygonClipping.id)]})}}class KU extends c.Destroyable{constructor(n){if(super(),this._czmESExcavate=n,!!this._czmESExcavate.viewer){for(let e=0;e<this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId.length;e++){const i=this._czmESExcavate.viewer.sceneGlobeClippingPolygonsId[e];c.ESSceneObject.getSceneObjById(i)||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 Ku=class Ku extends Un{constructor(e,i){super(e,i);L(this,"_czmPolygonClipping");L(this,"_tilesSceneObjectWithId");this._czmPolygonClipping=this.ad(new pa(i,e.id)),this._tilesSceneObjectWithId=this.disposeVar(new c.ESSceneObjectWithId);const o=this.ad(c.react(this.sceneObject.targetID));if(this.ad(e.targetIDChanged.don(()=>{const s=c.ESSceneObject.getSceneObject(e.targetID);o.value=s?(s.components.main??s).id:""})),this.dispose(c.track([this._tilesSceneObjectWithId,"id"],o)),this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged)),!i.viewer)return;const a=this._czmPolygonClipping;a.showHelper=!1,this.dispose(c.bind([a,"positions"],[e,"points"])),this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.reverse=e.mode!=="in"};s(),this.dispose(e.modeChanged.disposableOn(s))}c.registerCreatedEventUpdate(this,e,()=>{const s=this.disposeVar(c.createNextAnimateFrameEvent(this.tilesSceneObjectWithId.sceneObjectChanged,this.sceneObject.showChanged));this.disposeVar(new c.ObjResettingWithEvent(s,()=>{const{sceneObject:l,id:u}=this.tilesSceneObjectWithId;if(this.sceneObject.show)return u===""?new KU(this):!l||!(l instanceof c.ES3DTileset)?void 0:new qU(this,l)}))})}get czmPolygonClipping(){return this._czmPolygonClipping}get tilesSceneObjectWithId(){return this._tilesSceneObjectWithId}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonClipping:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Ku,"type",Ku.register("ESCesiumViewer",c.ESExcavate.type,Ku));let ng=Ku;const Zu=class Zu extends He{constructor(e,i){super(e,i);L(this,"_czmFireParticleSystem");if(this._czmFireParticleSystem=this.disposeVar(new wi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmFireParticleSystem;r.endColor=[1,1,0,.4],r.startColor=[1,0,0,.5],r.particleLife=1,r.emissionRate=30,r.lifetime=1,r.imageSize=[1,1],r.emitter={type:"CircleEmitter",radius:.1},r.sizeInMeters=!0;{const a=()=>{r.startScale=10*(e.scale[0]>0?e.scale[0]:1),r.endScale=5*(e.scale[0]>0?e.scale[0]:1),r.minimumSpeed=10*(e.scale[0]>0?e.scale[0]:1),r.maximumSpeed=15*(e.scale[0]>0?e.scale[0]:1)};a(),this.ad(e.scaleChanged.don(a))}this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"translation"],[e,"translation"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"image"],[e,"image"]))}get czmFireParticleSystem(){return this._czmFireParticleSystem}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmFireParticleSystem:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Hn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(Zu,"type",Zu.register("ESCesiumViewer",c.ESFireParticleSystem.type,Zu));let ig=Zu;class da extends c.Destroyable{constructor(e,i){super();L(this,"_geoPath");L(this,"_geoPolyline");L(this,"_geoCanvasPointPoi");L(this,"_player");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));L(this,"_ratio",this.disposeVar(c.PlayerProperty.createPlayingRatio([this,"currentTime"],[this,"duration"])));this._geoPath=this.disposeVar(new c.ESPathImpl),this._geoPolyline=this.disposeVar(new Ye(e,i)),this._geoCanvasPointPoi=this.disposeVar(new Er(e,i)),this._player=this.disposeVar(new c.Player),this.dispose(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.dispose(c.track([this._geoPolyline,"width"],[this,"width"])),this.dispose(c.track([this._geoPolyline,"ground"],[this,"ground"])),this.dispose(c.track([this._geoPolyline,"color"],[this,"color"])),this.dispose(c.track([this._geoPolyline,"hasDash"],[this,"hasDash"])),this.dispose(c.track([this._geoPolyline,"gapColor"],[this,"gapColor"])),this.dispose(c.track([this._geoPolyline,"dashLength"],[this,"dashLength"])),this.dispose(c.track([this._geoPolyline,"dashPattern"],[this,"dashPattern"])),this.dispose(c.track([this._geoPolyline,"hasArrow"],[this,"hasArrow"])),this.dispose(c.track([this._geoPolyline,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolyline,"arcType"],[this,"arcType"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"show"])),this.dispose(c.track([this._geoPolyline,"show"],[this,"polylineShow"])),this.dispose(c.track([this._geoPolyline,"allowPicking"],[this,"allowPicking"])),this.dispose(c.track([this._geoPath,"currentTime"],[this,"currentDistance"])),this.dispose(c.track([this._geoPath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPath,"show"],[this,"show"])),this.dispose(c.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(c.track([this._geoCanvasPointPoi,"position"],[this,"currentPosition"]));{const o=()=>{if(this.positions){const a=this.granularity*Math.PI/180,s=mp(this.positions,this.arcType??"GEODESIC",a);if(s){this._geoPath.timePosRots=s.timePosRots,this.rotationRadius.some(l=>l>0)?(this._geoPath.addAroundPoints(this.rotationRadius,!0),this._geoPath.computeRotIfUndefinedUsingLerp(!0),this._geoPath.rotLerpMode="Lerp"):(this._geoPath.computeRotIfUndefinedUsingPrevLine(!0),this._geoPath.rotLerpMode=this.rotLerpMode);return}}this._geoPath.timePosRots=[]};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged,this.granularityChanged,this.rotationRadiusChanged,this.rotLerpModeChanged));this.dispose(r.disposableOn(o))}{const o=()=>{if((this._player.duration??3e3)<=0){this.currentDistance=0;return}const r=this.totalDistance*((this._player.currentTime??0)/(this._player.duration??3e3));Math.abs(r-this.currentDistance)>.01&&(this.currentDistance=r)};o(),this.dispose(this._player.currentTimeChanged.disposableOn(o))}{const o=()=>{if(this.totalDistance<=0){this._player.currentTime=0;return}const r=this.currentDistance/this.totalDistance*(this.duration??3e3);Math.abs(r-(this._player.currentTime??0))>.01&&(this._player.currentTime=r)};o(),this.dispose(this.currentDistanceChanged.disposableOn(o))}this.dispose(c.bind([this._player,"loop"],[this,"loop"])),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._player,"duration"],[this,"duration"])),this.dispose(c.bind([this._player,"playing"],[this,"playing"])),this.dispose(c.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,i){const o=this._geoPath.subPath(e,i);if(o)return o.map(r=>r[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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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"})})(da||(da={})),c.extendClassProps(da.prototype,da.createDefaultProps);class jl extends c.Destroyable{constructor(e,i){super();L(this,"_geoPolylinePath");L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_currentDistance",this.disposeVar(c.react(0)));this._geoPolylinePath=this.disposeVar(new da(e,i)),this._geoPolylinePath.rotLerpMode="Lerp",this.dispose(c.bind([this._geoPolylinePath,"show"],[this,"show"])),this.dispose(c.bind([this._geoPolylinePath,"currentPoiShow"],[this,"currentPoiShow"])),this.dispose(c.bind([this._geoPolylinePath,"polylineShow"],[this,"polylineShow"])),this.dispose(c.bind([this._geoPolylinePath,"width"],[this,"width"])),this.dispose(c.bind([this._geoPolylinePath,"ground"],[this,"ground"])),this.dispose(c.bind([this._geoPolylinePath,"color"],[this,"color"])),this.dispose(c.bind([this._geoPolylinePath,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([this._geoPolylinePath,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([this._geoPolylinePath,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([this._geoPolylinePath,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([this._geoPolylinePath,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([this._geoPolylinePath,"arcType"],[this,"arcType"])),this.dispose(c.bind([this._geoPolylinePath,"currentDistance"],[this,"currentDistance"])),this.dispose(c.bind([this._geoPolylinePath,"loop"],[this,"loop"])),this.dispose(c.bind([this._geoPolylinePath,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._geoPolylinePath,"duration"],[this,"duration"])),this.dispose(c.bind([this._geoPolylinePath,"playing"],[this,"playing"])),this.dispose(c.bind([this._geoPolylinePath,"speed"],[this,"speed"])),this.dispose(c.bind([this._geoPolylinePath,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._geoPolylinePath,"leadTime"],[this,"leadTime"])),this.dispose(c.track([this._geoPolylinePath,"trailTime"],[this,"trailTime"])),this.dispose(c.track([this._geoPolylinePath,"allowPicking"],[this,"allowPicking"]));const o=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.resolutionChanged,this.sharpnessChanged)),r=()=>{try{if(this.positions&&this.positions.length>=2){const a=Tp(this.positions,this.resolution,this.sharpness);this._geoPolylinePath.positions=a}else this._geoPolylinePath.positions=void 0}catch(a){console.error(a),this._geoPolylinePath.positions=void 0}};r(),this.dispose(o.disposableOn(r)),this.dispose(this._flyToEvent.disposableOn(a=>{this._geoPolylinePath.flyTo(a)}))}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:c.reactPositions(void 0),width:1,ground:!1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.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})})(jl||(jl={})),c.extendClassProps(jl.prototype,jl.createDefaultProps);const ZU=[["256",256],["512",512],["1024",1024]],$U=[["LEFT","LEFT"],["NONE","NONE"],["RIGHT","RIGHT"]],Tn=class Tn extends c.ESVisualObject{constructor(e){super(e);L(this,"_pickFeaturesEvent",this.dv(new c.Event));this.ad(c.bind([this,"czmSplitDirection"],[this,"splitDirection"])),this.ad(c.bind([this,"czmAlpha"],[this,"opacity"]))}get pickFeaturesEvent(){return this._pickFeaturesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"accessToken"],"令牌",Tn.defaults.accessToken),new c.Number4Property([this,"rectangle"],"矩形范围",Tn.defaults.rectangle),new c.JsonProperty([this,"url"],"服务地址",Tn.defaults.url),new c.JsonProperty([this,"style"],"样式配置",Tn.defaults.style),new c.NumberProperty([this,"zIndex"],"层级序号",Tn.defaults.zIndex),new c.EnumProperty([this,"tileSize"],ZU,"瓦片大小",256),new c.NumberSliderProperty([this,"maximumLevel"],1,[1,24],"最大层级",Tn.defaults.maximumLevel),new c.NumberSliderProperty([this,"minimumLevel"],1,[0,24],"最小层级",Tn.defaults.minimumLevel),new c.EnumProperty([this,"scheme"],[["tms","tms"],["xyz","xyz"]],"影像类型",Tn.defaults.scheme)],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EnumProperty([this,"splitDirection"],$U,"splitDirection","NONE"),new c.GroupProperty([],"czm","czm"),new c.NumberProperty([this,"czmAlpha"],"透明度"),new c.NumberProperty([this,"czmBrightness"],"亮度"),new c.NumberProperty([this,"czmContrast"],"对比度"),new c.NumberProperty([this,"czmHue"],"色相"),new c.NumberProperty([this,"czmSaturation"],"饱和度"),new c.NumberProperty([this,"czmGamma"],"伽马值")]}}};L(Tn,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),rectangle:c.reactJsonWithUndefined([-180,-90,180,90]),url:c.reactJson(""),zIndex:0,accessToken:"",tileSize:256,maximumLevel:18,minimumLevel:0,style:c.reactArrayWithUndefined([]),scheme:c.react("tms"),czmSplitDirection:"NONE",czmAlpha:1,opacity:1,splitDirection:"NONE",czmBrightness:1,czmContrast:1,czmHue:0,czmSaturation:1,czmGamma:1})),L(Tn,"type",Tn.register("ESMVTLayer",Tn,{chsName:"矢量瓦片图层",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"用于加载矢量瓦片图层。"}));let ff=Tn;const XU=t=>{const n=[{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:i}of n)if(t>=e)return i;return 20},YU=async(t,n,e)=>(await fetch(`http://tileser.giiiis.com/xyzinfo/${e}/${t}/${n}`)).json(),JU=async t=>{var u;const n=(u=t.getCurrentCameraInfo())==null?void 0:u.position;if(!n)return;const e=n[0],i=n[1],o=n[2],r=XU(o);let a=Math.floor((e+180)/360*Math.pow(2,r+1)),s=Math.floor((90-i)/180*Math.pow(2,r));return await YU(a,s,r)};class eO extends c.Destroyable{constructor(n,e,i){super();const o=async()=>{const a=await JU(n);e.datesEvent.emit(a,n)};o();let r;r=setInterval(()=>{o()},3e3),this.d(()=>r&&clearInterval(r));{const a=()=>{const s=e.currentDate?e.currentDate:0;i.url=`http://tileser.giiiis.com/timetile/tms/${s}/tilemapresource.xml`};a(),this.d(e.currentDateChanged.don(a))}}}const Wa=class Wa extends c.ESVisualObject{constructor(e){super(e);L(this,"_esImageryLayer",this.dv(new c.ESImageryLayer));L(this,"_datesEvent",this.dv(new c.Event));const i=this._esImageryLayer;this.d(this.components.disposableAdd(i)),i.zIndex=1,i.minimumLevel=1,i.maximumLevel=18,this.d(c.track([i,"show"],[this,"show"])),this.d(c.track([i,"zIndex"],[this,"zIndex"])),this.d(c.track([i,"rectangle"],[this,"rectangle"])),this.d(c.bind([i,"flyInParam"],[this,"flyInParam"])),this.d(c.bind([i,"flyToParam"],[this,"flyToParam"])),this.registerAttachedObjectForContainer(o=>new eO(o,this,i)),this.d(this.flyInEvent.don(o=>{i.flyIn(o)})),this.d(this.flyToEvent.don(o=>{i.flyTo(o)})),this.d(this.calcFlyToParamEvent.don(()=>{i.calcFlyToParam()})),this.d(this.calcFlyInParamEvent.don(()=>{i.calcFlyInParam()}))}get esImageryLayer(){return this._esImageryLayer}get datesEvent(){return this._datesEvent}getESProperties(){const e={...super.getESProperties()};return{...e,basic:[...e.basic,new c.StringProperty([this,"currentDate"],"时间","0"),new c.NumberProperty([this,"zIndex"],"层级",0),new c.Number4Property([this,"rectangle"],"矩形范围",[-180,-90,180,90])]}}};L(Wa,"createDefaultProps",()=>({...c.ESVisualObject.createDefaultProps(),currentDate:"",zIndex:0,rectangle:c.reactArray([-180,-90,180,90])})),L(Wa,"type",Wa.register("ESGeHistoryImagery",Wa,{chsName:"谷歌历史影像",tags:["ESObjects","_ES_Impl_UE"],description:"ESGeHistoryImagery"}));let pf=Wa;const Tx=`async (dataSource, viewer) => {
2594
2594
  viewer.clock.shouldAnimate = false;
2595
2595
  const rider = dataSource.entities.getById("tour");
2596
2596
  await viewer.flyTo(rider)
@@ -2600,7 +2600,7 @@ ${Px}
2600
2600
  viewer.clock.multiplier = 30;
2601
2601
  viewer.clock.shouldAnimate = true;
2602
2602
  }
2603
- `,eO=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
2603
+ `,tO=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
2604
2604
 
2605
2605
  该路径可以使用下面回调函数
2606
2606
  \`\`\`
@@ -2650,7 +2650,7 @@ ${Tx}
2650
2650
  }
2651
2651
 
2652
2652
  \`\`\`
2653
- `,rg=Date.now(),pn=class pn extends c.ESSceneObject{constructor(e){super(e);L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_resetClockEvent",this.disposeVar(new c.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 c.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new c.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new c.BooleanProperty([this,"autoResetClock"],"自动设置时钟",pn.defaults.autoResetClock),new c.BooleanProperty([this,"clockEnabled"],"启用",pn.defaults.clockEnabled),new c.BooleanProperty([this,"shouldAnimate"],"是否启用动画",pn.defaults.shouldAnimate),new c.DateProperty([this,"startTime"],"开始时间",pn.defaults.startTime,!0),new c.DateProperty([this,"stopTime"],"结束时间",pn.defaults.stopTime),new c.DateProperty([this,"currentTime"],"当前时间",pn.defaults.currentTime,!0),new c.NumberProperty([this,"multiplier"],"倍速",pn.defaults.multiplier),new c.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",pn.defaults.clockStep),new c.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",pn.defaults.clockRange)],general:[...e.general,new c.BooleanProperty([this,"show"],"是否显示",!0),new c.BooleanProperty([this,"collision"],"开启碰撞",!1),new c.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.FunctionProperty(["number"],i=>this.flyTo(i),[1e3],"飞入"),new c.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",Tx,eO,!0),new c.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};L(pn,"createDefaultProps",()=>({...c.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:rg,stopTime:rg+864e5,currentTime:rg,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1})),L(pn,"type",pn.register("ESKml",pn,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"}));let df=pn;const ja=class ja extends c.ESLocalVector2D{constructor(n){super(n)}getESProperties(){const n={...super.getESProperties()};return{...n,more:[...n.more,new c.GroupProperty([],"折线","折线"),new c.Number2sProperty([this,"points"],"本地位置数组",void 0,!0),new c.GroupProperty([],"czm","czm"),new c.BooleanProperty([this,"loop"],"首尾相连",!0),new c.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new c.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new c.NumberProperty([this,"dashLength"],"虚线长度",16),new c.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new c.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new c.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};L(ja,"createDefaultProps",()=>({...c.ESLocalVector2D.createDefaultProps(),points:c.reactPosition2Ds(void 0),loop:!0,hasDash:!0,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),L(ja,"type",ja.register("ESLocalLineString",ja,{chsName:"局部2D坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineString"}));let mf=ja;const qa=class qa extends c.ESLocalVector{constructor(n){super(n)}getESProperties(){const n={...super.getESProperties()};return{...n,more:[...n.more,new c.GroupProperty([],"通用","通用"),new c.Number3sProperty([this,"points"],"本地位置数组",void 0,!0),new c.GroupProperty([],"czm","czm"),new c.BooleanProperty([this,"loop"],"首尾相连",!0),new c.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new c.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new c.NumberProperty([this,"dashLength"],"虚线长度",16),new c.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new c.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new c.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};L(qa,"createDefaultProps",()=>({...c.ESLocalVector.createDefaultProps(),points:c.reactPositions(void 0),loop:!0,width:void 0,color:c.reactArrayWithUndefined(void 0),hasDash:!0,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),L(qa,"type",qa.register("ESLocalLineStringZ",qa,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineStringZ"}));let ql=qa;const Ix=`in vec3 position;
2653
+ `,rg=Date.now(),pn=class pn extends c.ESSceneObject{constructor(e){super(e);L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_resetClockEvent",this.disposeVar(new c.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 c.LongStringProperty([this,"data"],"数据",void 0,void 0,!0),new c.JsonProperty([this,"uri"],"路径","${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",void 0,!0),new c.BooleanProperty([this,"autoResetClock"],"自动设置时钟",pn.defaults.autoResetClock),new c.BooleanProperty([this,"clockEnabled"],"启用",pn.defaults.clockEnabled),new c.BooleanProperty([this,"shouldAnimate"],"是否启用动画",pn.defaults.shouldAnimate),new c.DateProperty([this,"startTime"],"开始时间",pn.defaults.startTime,!0),new c.DateProperty([this,"stopTime"],"结束时间",pn.defaults.stopTime),new c.DateProperty([this,"currentTime"],"当前时间",pn.defaults.currentTime,!0),new c.NumberProperty([this,"multiplier"],"倍速",pn.defaults.multiplier),new c.EnumProperty([this,"clockStep"],[["TICK_DEPENDENT","TICK_DEPENDENT"],["SYSTEM_CLOCK_MULTIPLIER","SYSTEM_CLOCK_MULTIPLIER"],["SYSTEM_CLOCK","SYSTEM_CLOCK"]],"clockStep",pn.defaults.clockStep),new c.EnumProperty([this,"clockRange"],[["UNBOUNDED","UNBOUNDED"],["CLAMPED","CLAMPED"],["LOOP_STOP","LOOP_STOP"]],"clockRange",pn.defaults.clockRange)],general:[...e.general,new c.BooleanProperty([this,"show"],"是否显示",!0),new c.BooleanProperty([this,"collision"],"开启碰撞",!1),new c.BooleanProperty([this,"allowPicking"],"允许拾取",!1)],more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.FunctionProperty(["number"],i=>this.flyTo(i),[1e3],"飞入"),new c.EvalStringProperty([this,"loadFuncStr"],"loadFnStr",Tx,tO,!0),new c.FunctionProperty([],()=>this.resetClock(),[],"根据当前加载的数据重设时钟")]}}};L(pn,"createDefaultProps",()=>({...c.ESSceneObject.createDefaultProps(),show:!0,uri:void 0,allowPicking:!1,loadFuncStr:void 0,data:void 0,autoResetClock:!0,clockEnabled:!1,startTime:rg,stopTime:rg+864e5,currentTime:rg,multiplier:1,clockStep:"SYSTEM_CLOCK_MULTIPLIER",clockRange:"UNBOUNDED",shouldAnimate:!1,clampToGround:!1})),L(pn,"type",pn.register("ESKml",pn,{chsName:"ESKml",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"Kml数据加载"}));let df=pn;const ja=class ja extends c.ESLocalVector2D{constructor(n){super(n)}getESProperties(){const n={...super.getESProperties()};return{...n,more:[...n.more,new c.GroupProperty([],"折线","折线"),new c.Number2sProperty([this,"points"],"本地位置数组",void 0,!0),new c.GroupProperty([],"czm","czm"),new c.BooleanProperty([this,"loop"],"首尾相连",!0),new c.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new c.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new c.NumberProperty([this,"dashLength"],"虚线长度",16),new c.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new c.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new c.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};L(ja,"createDefaultProps",()=>({...c.ESLocalVector2D.createDefaultProps(),points:c.reactPosition2Ds(void 0),loop:!0,hasDash:!0,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),L(ja,"type",ja.register("ESLocalLineString",ja,{chsName:"局部2D坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineString"}));let mf=ja;const qa=class qa extends c.ESLocalVector{constructor(n){super(n)}getESProperties(){const n={...super.getESProperties()};return{...n,more:[...n.more,new c.GroupProperty([],"通用","通用"),new c.Number3sProperty([this,"points"],"本地位置数组",void 0,!0),new c.GroupProperty([],"czm","czm"),new c.BooleanProperty([this,"loop"],"首尾相连",!0),new c.BooleanProperty([this,"hasDash"],"是否为虚线",!0),new c.ColorProperty([this,"gapColor"],"间隔颜色",[0,0,0,0]),new c.NumberProperty([this,"dashLength"],"虚线长度",16),new c.DashPatternProperty([this,"dashPattern"],"虚线图案",255),new c.BooleanProperty([this,"hasArrow"],"是否带箭头",!0),new c.BooleanProperty([this,"depthTest"],"是否开启深度检测",!1)]}}};L(qa,"createDefaultProps",()=>({...c.ESLocalVector.createDefaultProps(),points:c.reactPositions(void 0),loop:!0,width:void 0,color:c.reactArrayWithUndefined(void 0),hasDash:!0,gapColor:c.reactArray([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!0,depthTest:!1,stroked:!0})),L(qa,"type",qa.register("ESLocalLineStringZ",qa,{chsName:"局部坐标折线",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ESLocalLineStringZ"}));let ql=qa;const Ix=`in vec3 position;
2654
2654
  in vec3 normal;
2655
2655
  in vec2 st;
2656
2656
  out vec3 v_normalEC;
@@ -2670,7 +2670,7 @@ void main()
2670
2670
  vec4 imageColor = texture(u_image, v_st);
2671
2671
  out_FragColor = imageColor * u_color;
2672
2672
  }
2673
- `,Mx={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},Dx={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}},Rx={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},Ux={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}},Ox=new Uint16Array([0,1,2,3,4,5]);function Lx(t){const n={};for(let e of Object.keys(t)){const{typedArray:i,componentsPerAttribute:o,usage:r,normalize:a}=t[e];n[e]={typedArray:{type:i.constructor.name,array:[...i.values()]},componentsPerAttribute:o,usage:r,normalize:a}}return n}function tO(t){const n={};for(let e of Object.keys(t)){const{typedArray:{type:i,array:o},componentsPerAttribute:r,usage:a,normalize:s}=t[e];n[e]={typedArray:new globalThis[i](o),componentsPerAttribute:r,usage:a,normalize:s}}return n}function zx(t){return{type:t.constructor.name,array:[...t.values()]}}function nO(t){const{type:n,array:e}=t;return new globalThis[n](e)}const iO=[["POINTS","POINTS"],["LINES","LINES"],["LINE_LOOP","LINE_LOOP"],["LINE_STRIP","LINE_STRIP"],["TRIANGLES","TRIANGLES"],["TRIANGLE_STRIP","TRIANGLE_STRIP"],["TRIANGLE_FAN","TRIANGLE_FAN"]],rO=[["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"]],oO=`### 默认使用的渲染状态
2673
+ `,Mx={type:"LocalAxisedBoundingBox",data:{min:[0,-1,0],max:[1,0,0]}},Dx={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}},Rx={u_image:{type:"image",uri:""},u_color:[1,1,0,1]},Ux={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}},Ox=new Uint16Array([0,1,2,3,4,5]);function Lx(t){const n={};for(let e of Object.keys(t)){const{typedArray:i,componentsPerAttribute:o,usage:r,normalize:a}=t[e];n[e]={typedArray:{type:i.constructor.name,array:[...i.values()]},componentsPerAttribute:o,usage:r,normalize:a}}return n}function nO(t){const n={};for(let e of Object.keys(t)){const{typedArray:{type:i,array:o},componentsPerAttribute:r,usage:a,normalize:s}=t[e];n[e]={typedArray:new globalThis[i](o),componentsPerAttribute:r,usage:a,normalize:s}}return n}function zx(t){return{type:t.constructor.name,array:[...t.values()]}}function iO(t){const{type:n,array:e}=t;return new globalThis[n](e)}const rO=[["POINTS","POINTS"],["LINES","LINES"],["LINE_LOOP","LINE_LOOP"],["LINE_STRIP","LINE_STRIP"],["TRIANGLES","TRIANGLES"],["TRIANGLE_STRIP","TRIANGLE_STRIP"],["TRIANGLE_FAN","TRIANGLE_FAN"]],oO=[["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"]],sO=`### 默认使用的渲染状态
2674
2674
  \`\`\`
2675
2675
  {
2676
2676
  depthTest: {
@@ -2797,7 +2797,7 @@ interface RenderStateOptions {
2797
2797
  }
2798
2798
  }
2799
2799
  \`\`\`
2800
- `,sO=`### 默认的BoundingVolume
2800
+ `,aO=`### 默认的BoundingVolume
2801
2801
  \`\`\`
2802
2802
  type: 'LocalAxisedBoundingBox',
2803
2803
  data: {
@@ -2825,7 +2825,7 @@ export type BoundingVolumeJsonType = {
2825
2825
  };
2826
2826
  };
2827
2827
  \`\`\`
2828
- `,aO=`### 默认顶点Shader示例
2828
+ `,lO=`### 默认顶点Shader示例
2829
2829
  \`\`\`
2830
2830
  in vec3 position;
2831
2831
  in vec3 normal;
@@ -2867,7 +2867,7 @@ void main()
2867
2867
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
2868
2868
  }
2869
2869
  \`\`\`
2870
- `,lO=`### 默认片元Shader示例
2870
+ `,uO=`### 默认片元Shader示例
2871
2871
  \`\`\`
2872
2872
  in vec2 v_st;
2873
2873
  uniform sampler2D u_image;
@@ -2922,7 +2922,7 @@ void main()
2922
2922
  // #endif
2923
2923
  }
2924
2924
  \`\`\`
2925
- `,uO=`### 默认使用的UniformMap
2925
+ `,cO=`### 默认使用的UniformMap
2926
2926
  \`\`\`
2927
2927
  {
2928
2928
  "myImage": {
@@ -2967,7 +2967,7 @@ void main()
2967
2967
  export type CzmCustomPrimitiveUniformType = number | [number, number] | [number, number, number] | [number, number, number, number] | { type: 'image', uri: string };
2968
2968
  export type CzmCustomPrimitiveUniformMapType = { [k: string]: CzmCustomPrimitiveUniformType };
2969
2969
  \`\`\`
2970
- `,cO=`### 默认的顶点属性
2970
+ `,hO=`### 默认的顶点属性
2971
2971
  \`\`\`
2972
2972
  {
2973
2973
  position: {
@@ -3001,7 +3001,7 @@ export type AttributesJsonType = {
3001
3001
  [k: string]: AttributeJsonType;
3002
3002
  }
3003
3003
  \`\`\`
3004
- `,hO=`### 默认的索引数组
3004
+ `,AO=`### 默认的索引数组
3005
3005
  \`\`\`
3006
3006
  {
3007
3007
  "type": "Uint16Array",
@@ -3016,7 +3016,7 @@ export type IndexJsonType = {
3016
3016
  array: number[];
3017
3017
  }
3018
3018
  \`\`\`
3019
- `,dn=class dn extends c.ESObjectWithLocation{constructor(e){super(e);L(this,"_attributes",this.disposeVar(c.react(void 0)));L(this,"_indexTypedArray",this.disposeVar(c.react(void 0)))}get attributesJson(){return this.attributes&&Lx(this.attributes)}set attributesJson(e){const i=JSON.stringify(this.attributesJson),o=JSON.stringify(e);i!==o&&(this.attributes=e&&tO(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&zx(this.indexTypedArray)}set indexTypedArrayJson(e){const i=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);i!==o&&(this.indexTypedArray=e&&nO(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,r])=>(console.warn(`setUniformMap error: key: ${o} value: ${r}`),r===null)))return;const i={...this.uniformMap??{},...e};this.uniformMap=i}setLocalBoundingSphere(e,i=[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:i,radius:e}}}setLocalAxisedBoundingBox(e,i){if(e.some(o=>!Number.isFinite(o))||i.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${i.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:i}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const i=this.attributes[e];if(!("typedArray"in i)||!(i.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in i)||i.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:r}=dn.getMinMaxPosition(i.typedArray);if(!o.some(a=>!Number.isFinite(a)||r.some(s=>!Number.isFinite(s))))return{min:o,max:r}}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.Number4Property([this,"viewDistanceRange"],"可视范围控制",void 0,!0),new c.BooleanProperty([this,"viewDistanceDebug"],"可视距离调试"),new c.GroupProperty([],"屏幕像素","屏幕像素"),new c.NumberProperty([this,"maximumScale"],"最大缩放值",3,!0),new c.NumberProperty([this,"minimumScale"],"最小缩放值",1,!0),new c.NumberProperty([this,"pixelSize"],"屏幕像素",5,!0),new c.BooleanProperty([this,"showSceneScale"],"显示缩放值",!1,!0),new c.GroupProperty([],"图元属性","图元属性"),new c.JsonProperty([this,"modelMatrix"],"模型矩阵",void 0,void 0,!0),new c.BooleanProperty([this,"cull"],"是否拣选",void 0,!0),new c.JsonProperty([this,"boundingVolume"],"包围体",Mx,sO,!0),new c.EnumProperty([this,"pass"],rO,"渲染顺序","TRANSLUCENT",!0),new c.EnumProperty([this,"primitiveType"],iO,"图元类型","TRIANGLES",!0),new c.JsonProperty([this,"renderState"],"渲染状态",Dx,oO,!0),new c.EvalStringProperty([this,"vertexShaderSource"],"顶点着色器",Ix,aO,!0),new c.EvalStringProperty([this,"fragmentShaderSource"],"片元着色器",Fx,lO,!0),new c.JsonProperty([this,"uniformMap"],"一致性变量(uniform)",Rx,uO,!0),new c.JsonProperty([this,"attributesJson"],"顶点属性(attributes)",Lx(Ux),cO,!0),new c.JsonProperty([this,"indexTypedArrayJson"],"索引(index)",zx(Ox),hO,!0),new c.NumberProperty([this,"count"],"count",0,!0),new c.NumberProperty([this,"offset"],"offset",0,!0),new c.NumberProperty([this,"instanceCount"],"instanceCount",0,!0),new c.FunctionProperty(["string"],i=>{const o=this.computeLocalAxisedBoundingBoxFromAttribute(i);if(!o)return;const{min:r,max:a}=o;this.setLocalAxisedBoundingBox(r,a)},["position"],"自动计算包围盒"),new c.GroupProperty([],"本地变换","本地变换"),new c.PositionProperty([this,"localPosition"],"本地偏移",void 0,!0),new c.RotationProperty([this,"localRotation"],"本地姿态",void 0,!0),new c.Number3Property([this,"localScale"],"本地缩放",[1,1,1],!0),new c.JsonProperty([this,"localModelMatrix"],"本地模型矩阵",void 0,void 0,!0),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"debugShowBoundingVolume"],"debugShowBoundingVolume",!1,!0),new c.NumberProperty([this,"debugOverlappingFrustums"],"debugOverlappingFrustums",0,!0),new c.GroupProperty([],"Czm特有","Czm特有"),new c.BooleanProperty([this,"occlude"],"occlude",!0,!0),new c.BooleanProperty([this,"castShadows"],"castShadows",!1,!0),new c.BooleanProperty([this,"receiveShadows"],"receiveShadows",!1,!0),new c.BooleanProperty([this,"executeInClosestFrustum"],"executeInClosestFrustum",!1,!0),new c.BooleanProperty([this,"pickOnly"],"pickOnly",!1,!0),new c.BooleanProperty([this,"depthForTranslucentClassification"],"depthForTranslucentClassification",!1,!0)]}}};L(dn,"createDefaultProps",()=>({...c.ESObjectWithLocation.createDefaultProps(),maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:c.reactArrayWithUndefined(void 0),cull:c.react(void 0),boundingVolume:c.reactJson(void 0),renderState:c.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:c.reactJson(void 0),localPosition:c.reactArrayWithUndefined(void 0),localRotation:c.reactArrayWithUndefined(void 0),localScale:c.reactArrayWithUndefined(void 0),localModelMatrix:c.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:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})),L(dn,"type",dn.register("ESCustomPrimitive",dn,{chsName:"ES自定义图元",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES自定义图元"})),L(dn,"defaultRenderState",Dx),L(dn,"defaultVertexShaderSource",Ix),L(dn,"defaultFragmentShaderSource",Fx),L(dn,"defaultUniformMap",Rx),L(dn,"defaultBoundingVolume",Mx),L(dn,"defaultAttribute",Ux),L(dn,"defaultIndexTypedArray",Ox),L(dn,"getMinMaxPosition",c.getMinMaxPosition);let gf=dn;const pr=class pr extends c.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString");L(this,"_player");this._player=this.disposeVar(new c.Player);{const i=pr.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],o=>o??i.loop,o=>o??i.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],o=>o??i.currentTime,o=>o??i.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],o=>o??i.duration,o=>o??i.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],o=>o??i.playing,o=>o??i.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],o=>o??i.speed,o=>o??i.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 c.GroupProperty([],"通用","通用"),new c.NumberProperty([this,"startTime"],"起始时间"),new c.NumberProperty([this,"transmissionTime"],"传输时间"),new c.NumberProperty([this,"heightRatio"],"高度比率"),new c.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new c.BooleanProperty([this,"brightening"],"变亮"),new c.BooleanProperty([this,"depthTest"],"深度监测"),new c.UriProperty([this,"imageUrl"],"图片路径",pr.defaults.imageUrl,!0),new c.NumberProperty([this,"repeat"],"图像重复次数"),new c.EnumProperty([this,"bidirectional"],[["正向",0],["反向",1],["双向",2],["无",3]],"运动方向",0),new c.GroupProperty([],"播放器","播放器"),new c.PlayerProperty([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new c.BooleanProperty([this,"loop"],"是否循环"),new c.NumberProperty([this.player,"currentTime"],"当前时间"),new c.NumberProperty([this,"duration"],"过渡时间"),new c.BooleanProperty([this,"playing"],"是否播放"),new c.NumberProperty([this,"speed"],"播放速度")]}}};L(pr,"createDefaultProps",()=>({...c.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})),L(pr,"type",pr.register("ESSignalTransmission",pr,{chsName:"信号传输器",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"})),L(pr,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.LineStringAppend,c.ESJEditingMode.LineStringInsert]);let yf=pr;const us=class us extends c.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.NumberProperty([this,"width"],"线宽"),new c.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new c.StringProperty([this,"imageUrl"],"道路图片"),new c.Number2Property([this,"repeat"],"重复次数")]}}};L(us,"createDefaultProps",()=>({...c.ESGeoVector.createDefaultProps(),width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],stroked:!0})),L(us,"type",us.register("ESRoad",us,{chsName:"贴地道路",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"最大宽度到1000米"})),L(us,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.LineStringAppend,c.ESJEditingMode.LineStringInsert]);let vf=us;const cs=class cs extends c.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.BooleanProperty([this,"ground"],"是否贴地",!1,!0),new c.NumberProperty([this,"depth"],"厚度",16,!0)]}}};L(cs,"createDefaultProps",()=>({...c.ESGeoVector.createDefaultProps(),ground:!1,depth:0,stroked:!0,filled:!0,fillStyle:c.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),L(cs,"type",cs.register("ESGeoSmoothPolygon",cs,{chsName:"平滑多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平滑多边形"})),L(cs,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.CircularAppend,c.ESJEditingMode.CircularInsert]);let Kl=cs;const ao=class ao extends c.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"_geoPolylinePath");L(this,"_currentDistance",this.disposeVar(c.react(0)))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[c.ESJEditingMode.LineStringAppend,c.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 c.GroupProperty([],"通用","通用"),new c.BooleanProperty([this,"currentPoiShow"],"是否显示当前",!0),new c.NumberProperty([this,"currentDistance"],"当前距离",0),new c.NumberProperty([this,"resolution"],"分辨率",1e3),new c.NumberProperty([this,"sharpness"],"锐化程度",.85),new c.GroupProperty([],"折线","折线"),new c.JsonProperty([this,"timePosRots"],"timePosRots",[],void 0,!1,!0),new c.NumberProperty([this,"leadTime"],"折线超前显示时长",0),new c.NumberProperty([this,"trailTime"],"折线滞后显示时长",0),new c.GroupProperty([],"播放器","播放器"),new c.PlayerProperty([this,"playing"],[this._geoPolylinePath,"ratio"],[this,"loop"],"播放器"),new c.BooleanProperty([this,"loop"],"是否循环"),new c.NumberProperty([this,"currentTime"],"当前时间"),new c.NumberProperty([this,"duration"],"过渡时间"),new c.BooleanProperty([this,"playing"],"是否播放"),new c.NumberProperty([this,"speed"],"播放速度"),new c.GroupProperty([],"折线","折线"),new c.BooleanProperty([this,"ground"],"是否贴地"),new c.BooleanProperty([this,"depthTest"],"是否开启深度检测"),new c.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型",ao.defaults.arcType)]}}};L(ao,"createDefaultProps",()=>({...c.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})),L(ao,"type",ao.register("ESGeoBezierPath",ao,{chsName:"贝塞尔曲线路径",tags:["GeoObjects"],description:"贝塞尔曲线路径"})),L(ao,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.LineStringAppend,c.ESJEditingMode.LineStringInsert]);let wf=ao;const $u=class $u extends Nn{constructor(e,i){super(e,i);L(this,"_czmBezierPath");if(this._czmBezierPath=this.disposeVar(new jl(i,e.id)),e.geoPolylinePath=this._czmBezierPath.geoPolylinePath,!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmBezierPath;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"currentPoiShow"],[e,"currentPoiShow"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"currentDistance"],[e,"currentDistance"])),this.dispose(c.track([r,"resolution"],[e,"resolution"])),this.dispose(c.track([r,"sharpness"],[e,"sharpness"])),this.dispose(c.track([r.geoPath,"timePosRots"],[e.geoPath,"timePosRots"])),this.dispose(c.track([r,"leadTime"],[e,"leadTime"])),this.dispose(c.track([r,"trailTime"],[e,"trailTime"])),this.dispose(c.track([r.geoPolylinePath,"ratio"],[e.geoPolylinePath,"ratio"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"polylineShow"],[e,"stroked"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"]));{const a=()=>{r.ground=e.ground||e.strokeGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.strokeGroundChanged));this.d(s.don(a))}{const a=()=>{if(!e.stroked){r.hasDash=!1,r.hasArrow=!1;return}const u=e.strokeStyle;if(u.material==="hasDash"&&u.materialParams)try{const h=u.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashLength=0;const A=e.strokeMaterial??"normal";A==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):A==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get czmBezierPath(){return this._czmBezierPath}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L($u,"type",$u.register("ESCesiumViewer",wf.type,$u));let og=$u;const Xu=class Xu extends He{constructor(e,i){super(e,i);L(this,"_czmGeoCustomDivPoi");L(this,"_divContainer");L(this,"_hasClassDivAndPos",{});if(this._czmGeoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCustomDivPoi;r.cssAllInitial=!0,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"opacity"],[e,"opacity"])),this.d(c.track([r,"zOrder"],[e,"zOrder"]));{const a=()=>{r.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}%`)};a(),this.dispose(e.anchorChanged.don(a))}{const a=()=>{const l=this;return class extends c.Destroyable{constructor(A,h,f){if(super(),this._subContainer=A,!f||!(f instanceof ot))return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");l._divContainer=this.disposeVar(new e.instanceClass(A,e,f))._container;{const g=()=>{l._divContainer.style.pointerEvents=l.sceneObject.editing?"none":"all"};g(),this.d(l.sceneObject.editingChanged.don(g))}{const g=()=>{l._divContainer.children[0]&&(l._divContainer.children[0].style.transform=`scale(${e.scale[1]},${e.scale[2]})`,l._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};g(),this.d(e.scaleChanged.don(g))}let d=l._divContainer?l._divContainer.querySelectorAll("*[class]"):[];for(let g=0;g<d.length;g++){const v=d[g];var p=v.getBoundingClientRect();l._hasClassDivAndPos[v.className]=[v.offsetLeft,v.offsetTop,v.offsetLeft+p.width,v.offsetTop+p.height]}}}},s=()=>{try{e.instanceClass?r.instanceClass=a():r.instanceClass=void 0}catch(l){console.error(l)}};s(),this.dispose(e.instanceClassChanged.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(a=>{var u;a.assign({sceneObject:e});const s=(u=_o(a,"pickResult"))==null?void 0:u.pointerEvent;if(!s)return;const l={type:s.buttons!=0&&s.button==0?"leftClick":s.button==2?"rightClick":void 0,add:{mousePos:[s.offsetX,s.offsetY]}};if(l.type==null&&(l.type=s.type),l.type==="leftClick"){const A=Object.keys(this._hasClassDivAndPos);for(let h=0;h<A.length;h++){const f=A[h];let d=this._hasClassDivAndPos[f],p=this._divContainer.getBoundingClientRect();const g=s.clientX-p.left,v=s.clientY-p.top;if(g>=d[0]&&g<=d[2]&&v>=d[1]&&v<=d[3]){l.add.className=f;break}}}e.widgetEvent.emit(l),l.type==="leftClick"&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.position&&Fe(r.viewer,a.position,1e3,Hn,e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Xu,"type",Xu.register("ESCesiumViewer",c.ESGeoDiv.type,Xu));let sg=Xu;const Yu=class Yu extends He{constructor(e,i){super(e,i);L(this,"_czmDivTextPoi");if(this._czmDivTextPoi=this.disposeVar(new vi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDivTextPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(c.bind([r,"textEditing"],[e,"textEditing"])),this.dispose(c.bind([r,"width"],[e,"width"])),this.dispose(c.bind([r,"text"],[e,"text"])),this.dispose(c.track([r,"originRatioAndOffset"],[e,"originRatioAndOffset"])),this.dispose(c.track([r,"opacity"],[e,"opacity"])),this.dispose(c.bind([r,"fontSize"],[e,"fontSize"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.track([r,"backgroundColor"],[e,"backgroundColor"])),this.dispose(c.track([r,"borderRadius"],[e,"borderRadius"])),this.dispose(c.track([r,"borderColor"],[e,"borderColor"])),this.dispose(c.track([r,"borderWidth"],[e,"borderWidth"])),this.dispose(c.track([r,"textAlign"],[e,"textAlign"])),this.dispose(c.track([r,"borderStyle"],[e,"borderStyle"]))}get czmDivTextPoi(){return this._czmDivTextPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDivTextPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Yu,"type",Yu.register("ESCesiumViewer",c.ESGeoDivTextPoi.type,Yu));let ag=Yu;const AO={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"}}]},fO=`properties是一个包含三个属性的对象,title表示标题,marker-symbol表示点位的文字内容,marker-color表示点位颜色,properties可以删除,然后使用场景对象属性设置。
3019
+ `,dn=class dn extends c.ESObjectWithLocation{constructor(e){super(e);L(this,"_attributes",this.disposeVar(c.react(void 0)));L(this,"_indexTypedArray",this.disposeVar(c.react(void 0)))}get attributesJson(){return this.attributes&&Lx(this.attributes)}set attributesJson(e){const i=JSON.stringify(this.attributesJson),o=JSON.stringify(e);i!==o&&(this.attributes=e&&nO(e))}get attributesJsonChanged(){return this.attributesChanged}get indexTypedArrayJson(){return this.indexTypedArray&&zx(this.indexTypedArray)}set indexTypedArrayJson(e){const i=JSON.stringify(this.indexTypedArrayJson),o=JSON.stringify(e);i!==o&&(this.indexTypedArray=e&&iO(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,r])=>(console.warn(`setUniformMap error: key: ${o} value: ${r}`),r===null)))return;const i={...this.uniformMap??{},...e};this.uniformMap=i}setLocalBoundingSphere(e,i=[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:i,radius:e}}}setLocalAxisedBoundingBox(e,i){if(e.some(o=>!Number.isFinite(o))||i.some(o=>!Number.isFinite(o))){console.warn(`setLocalAxisedBoundingBox error, min: ${e.toString()}, max: ${i.toString()}`);return}this.boundingVolume={type:"LocalAxisedBoundingBox",data:{min:e,max:i}}}computeLocalAxisedBoundingBoxFromAttribute(e="a_position"){if(!this.attributes||!this.attributes[e]){console.warn(`attributes[${e}]不存在!无法获取!`);return}const i=this.attributes[e];if(!("typedArray"in i)||!(i.typedArray instanceof Float32Array)){console.warn(`!('typedArray' in posAttribute) || !(posAttribute.typedArray instanceof Float32Array) attributeName: ${e}`);return}if(!("componentsPerAttribute"in i)||i.componentsPerAttribute!==3){console.warn(`!('componentsPerAttribute' in posAttribute) || posAttribute.componentsPerAttribute !== 3 attributeName: ${e}`);return}const{min:o,max:r}=dn.getMinMaxPosition(i.typedArray);if(!o.some(a=>!Number.isFinite(a)||r.some(s=>!Number.isFinite(s))))return{min:o,max:r}}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.Number4Property([this,"viewDistanceRange"],"可视范围控制",void 0,!0),new c.BooleanProperty([this,"viewDistanceDebug"],"可视距离调试"),new c.GroupProperty([],"屏幕像素","屏幕像素"),new c.NumberProperty([this,"maximumScale"],"最大缩放值",3,!0),new c.NumberProperty([this,"minimumScale"],"最小缩放值",1,!0),new c.NumberProperty([this,"pixelSize"],"屏幕像素",5,!0),new c.BooleanProperty([this,"showSceneScale"],"显示缩放值",!1,!0),new c.GroupProperty([],"图元属性","图元属性"),new c.JsonProperty([this,"modelMatrix"],"模型矩阵",void 0,void 0,!0),new c.BooleanProperty([this,"cull"],"是否拣选",void 0,!0),new c.JsonProperty([this,"boundingVolume"],"包围体",Mx,aO,!0),new c.EnumProperty([this,"pass"],oO,"渲染顺序","TRANSLUCENT",!0),new c.EnumProperty([this,"primitiveType"],rO,"图元类型","TRIANGLES",!0),new c.JsonProperty([this,"renderState"],"渲染状态",Dx,sO,!0),new c.EvalStringProperty([this,"vertexShaderSource"],"顶点着色器",Ix,lO,!0),new c.EvalStringProperty([this,"fragmentShaderSource"],"片元着色器",Fx,uO,!0),new c.JsonProperty([this,"uniformMap"],"一致性变量(uniform)",Rx,cO,!0),new c.JsonProperty([this,"attributesJson"],"顶点属性(attributes)",Lx(Ux),hO,!0),new c.JsonProperty([this,"indexTypedArrayJson"],"索引(index)",zx(Ox),AO,!0),new c.NumberProperty([this,"count"],"count",0,!0),new c.NumberProperty([this,"offset"],"offset",0,!0),new c.NumberProperty([this,"instanceCount"],"instanceCount",0,!0),new c.FunctionProperty(["string"],i=>{const o=this.computeLocalAxisedBoundingBoxFromAttribute(i);if(!o)return;const{min:r,max:a}=o;this.setLocalAxisedBoundingBox(r,a)},["position"],"自动计算包围盒"),new c.GroupProperty([],"本地变换","本地变换"),new c.PositionProperty([this,"localPosition"],"本地偏移",void 0,!0),new c.RotationProperty([this,"localRotation"],"本地姿态",void 0,!0),new c.Number3Property([this,"localScale"],"本地缩放",[1,1,1],!0),new c.JsonProperty([this,"localModelMatrix"],"本地模型矩阵",void 0,void 0,!0),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"debugShowBoundingVolume"],"debugShowBoundingVolume",!1,!0),new c.NumberProperty([this,"debugOverlappingFrustums"],"debugOverlappingFrustums",0,!0),new c.GroupProperty([],"Czm特有","Czm特有"),new c.BooleanProperty([this,"occlude"],"occlude",!0,!0),new c.BooleanProperty([this,"castShadows"],"castShadows",!1,!0),new c.BooleanProperty([this,"receiveShadows"],"receiveShadows",!1,!0),new c.BooleanProperty([this,"executeInClosestFrustum"],"executeInClosestFrustum",!1,!0),new c.BooleanProperty([this,"pickOnly"],"pickOnly",!1,!0),new c.BooleanProperty([this,"depthForTranslucentClassification"],"depthForTranslucentClassification",!1,!0)]}}};L(dn,"createDefaultProps",()=>({...c.ESObjectWithLocation.createDefaultProps(),maximumScale:void 0,minimumScale:void 0,pixelSize:void 0,showSceneScale:void 0,modelMatrix:c.reactArrayWithUndefined(void 0),cull:c.react(void 0),boundingVolume:c.reactJson(void 0),renderState:c.reactJson(void 0),primitiveType:void 0,pass:void 0,vertexShaderSource:void 0,fragmentShaderSource:void 0,uniformMap:c.reactJson(void 0),localPosition:c.reactArrayWithUndefined(void 0),localRotation:c.reactArrayWithUndefined(void 0),localScale:c.reactArrayWithUndefined(void 0),localModelMatrix:c.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:c.reactArrayWithUndefined(void 0),viewDistanceDebug:!1})),L(dn,"type",dn.register("ESCustomPrimitive",dn,{chsName:"ES自定义图元",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"ES自定义图元"})),L(dn,"defaultRenderState",Dx),L(dn,"defaultVertexShaderSource",Ix),L(dn,"defaultFragmentShaderSource",Fx),L(dn,"defaultUniformMap",Rx),L(dn,"defaultBoundingVolume",Mx),L(dn,"defaultAttribute",Ux),L(dn,"defaultIndexTypedArray",Ox),L(dn,"getMinMaxPosition",c.getMinMaxPosition);let gf=dn;const pr=class pr extends c.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString");L(this,"_player");this._player=this.disposeVar(new c.Player);{const i=pr.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],o=>o??i.loop,o=>o??i.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],o=>o??i.currentTime,o=>o??i.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],o=>o??i.duration,o=>o??i.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],o=>o??i.playing,o=>o??i.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],o=>o??i.speed,o=>o??i.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 c.GroupProperty([],"通用","通用"),new c.NumberProperty([this,"startTime"],"起始时间"),new c.NumberProperty([this,"transmissionTime"],"传输时间"),new c.NumberProperty([this,"heightRatio"],"高度比率"),new c.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new c.BooleanProperty([this,"brightening"],"变亮"),new c.BooleanProperty([this,"depthTest"],"深度监测"),new c.UriProperty([this,"imageUrl"],"图片路径",pr.defaults.imageUrl,!0),new c.NumberProperty([this,"repeat"],"图像重复次数"),new c.EnumProperty([this,"bidirectional"],[["正向",0],["反向",1],["双向",2],["无",3]],"运动方向",0),new c.GroupProperty([],"播放器","播放器"),new c.PlayerProperty([this,"playing"],[this,"ratio"],[this,"loop"],"播放器"),new c.BooleanProperty([this,"loop"],"是否循环"),new c.NumberProperty([this.player,"currentTime"],"当前时间"),new c.NumberProperty([this,"duration"],"过渡时间"),new c.BooleanProperty([this,"playing"],"是否播放"),new c.NumberProperty([this,"speed"],"播放速度")]}}};L(pr,"createDefaultProps",()=>({...c.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})),L(pr,"type",pr.register("ESSignalTransmission",pr,{chsName:"信号传输器",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"信号传输器"})),L(pr,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.LineStringAppend,c.ESJEditingMode.LineStringInsert]);let yf=pr;const us=class us extends c.ESGeoVector{constructor(e){super(e);L(this,"editingBindMode","lineString")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.NumberProperty([this,"width"],"线宽"),new c.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型","GEODESIC"),new c.StringProperty([this,"imageUrl"],"道路图片"),new c.Number2Property([this,"repeat"],"重复次数")]}}};L(us,"createDefaultProps",()=>({...c.ESGeoVector.createDefaultProps(),width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],stroked:!0})),L(us,"type",us.register("ESRoad",us,{chsName:"贴地道路",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"最大宽度到1000米"})),L(us,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.LineStringAppend,c.ESJEditingMode.LineStringInsert]);let vf=us;const cs=class cs extends c.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"editingBindMode","circular")}getESProperties(){const e={...super.getESProperties()};return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.BooleanProperty([this,"ground"],"是否贴地",!1,!0),new c.NumberProperty([this,"depth"],"厚度",16,!0)]}}};L(cs,"createDefaultProps",()=>({...c.ESGeoVector.createDefaultProps(),ground:!1,depth:0,stroked:!0,filled:!0,fillStyle:c.reactJson({color:[1,1,1,1],material:"",materialParams:{},ground:!1})})),L(cs,"type",cs.register("ESGeoSmoothPolygon",cs,{chsName:"平滑多边形",tags:["ESObjects","_ES_Impl_Cesium","_ES_Impl_UE"],description:"平滑多边形"})),L(cs,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.CircularAppend,c.ESJEditingMode.CircularInsert]);let Kl=cs;const ao=class ao extends c.ESGeoVector{constructor(e){super(e);L(this,"_deprecated",["ground"]);L(this,"_deprecatedWarningFunc",(()=>{this._deprecatedWarning()})());L(this,"_geoPolylinePath");L(this,"_currentDistance",this.disposeVar(c.react(0)))}updateEditing(){var e;(e=this.activeViewer)==null||e.startEditing(this,[c.ESJEditingMode.LineStringAppend,c.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 c.GroupProperty([],"通用","通用"),new c.BooleanProperty([this,"currentPoiShow"],"是否显示当前",!0),new c.NumberProperty([this,"currentDistance"],"当前距离",0),new c.NumberProperty([this,"resolution"],"分辨率",1e3),new c.NumberProperty([this,"sharpness"],"锐化程度",.85),new c.GroupProperty([],"折线","折线"),new c.JsonProperty([this,"timePosRots"],"timePosRots",[],void 0,!1,!0),new c.NumberProperty([this,"leadTime"],"折线超前显示时长",0),new c.NumberProperty([this,"trailTime"],"折线滞后显示时长",0),new c.GroupProperty([],"播放器","播放器"),new c.PlayerProperty([this,"playing"],[this._geoPolylinePath,"ratio"],[this,"loop"],"播放器"),new c.BooleanProperty([this,"loop"],"是否循环"),new c.NumberProperty([this,"currentTime"],"当前时间"),new c.NumberProperty([this,"duration"],"过渡时间"),new c.BooleanProperty([this,"playing"],"是否播放"),new c.NumberProperty([this,"speed"],"播放速度"),new c.GroupProperty([],"折线","折线"),new c.BooleanProperty([this,"ground"],"是否贴地"),new c.BooleanProperty([this,"depthTest"],"是否开启深度检测"),new c.EnumProperty([this,"arcType"],[["直线","NONE"],["地理直线","GEODESIC"],["地理恒向线","RHUMB"]],"弧线类型",ao.defaults.arcType)]}}};L(ao,"createDefaultProps",()=>({...c.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})),L(ao,"type",ao.register("ESGeoBezierPath",ao,{chsName:"贝塞尔曲线路径",tags:["GeoObjects"],description:"贝塞尔曲线路径"})),L(ao,"supportEditingModes",[...c.ESGeoVector.supportEditingModes,c.ESJEditingMode.LineStringAppend,c.ESJEditingMode.LineStringInsert]);let wf=ao;const $u=class $u extends Nn{constructor(e,i){super(e,i);L(this,"_czmBezierPath");if(this._czmBezierPath=this.disposeVar(new jl(i,e.id)),e.geoPolylinePath=this._czmBezierPath.geoPolylinePath,!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmBezierPath;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"currentPoiShow"],[e,"currentPoiShow"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.bind([r,"currentDistance"],[e,"currentDistance"])),this.dispose(c.track([r,"resolution"],[e,"resolution"])),this.dispose(c.track([r,"sharpness"],[e,"sharpness"])),this.dispose(c.track([r.geoPath,"timePosRots"],[e.geoPath,"timePosRots"])),this.dispose(c.track([r,"leadTime"],[e,"leadTime"])),this.dispose(c.track([r,"trailTime"],[e,"trailTime"])),this.dispose(c.track([r.geoPolylinePath,"ratio"],[e.geoPolylinePath,"ratio"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"polylineShow"],[e,"stroked"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"]));{const a=()=>{r.ground=e.ground||e.strokeGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.strokeGroundChanged));this.d(s.don(a))}{const a=()=>{if(!e.stroked){r.hasDash=!1,r.hasArrow=!1;return}const u=e.strokeStyle;if(u.material==="hasDash"&&u.materialParams)try{const h=u.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashLength=0;const A=e.strokeMaterial??"normal";A==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):A==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}}get czmBezierPath(){return this._czmBezierPath}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmBezierPath:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L($u,"type",$u.register("ESCesiumViewer",wf.type,$u));let og=$u;const Xu=class Xu extends He{constructor(e,i){super(e,i);L(this,"_czmGeoCustomDivPoi");L(this,"_divContainer");L(this,"_hasClassDivAndPos",{});if(this._czmGeoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCustomDivPoi;r.cssAllInitial=!0,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"opacity"],[e,"opacity"])),this.d(c.track([r,"zOrder"],[e,"zOrder"]));{const a=()=>{r.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}%`)};a(),this.dispose(e.anchorChanged.don(a))}{const a=()=>{const l=this;return class extends c.Destroyable{constructor(A,h,f){if(super(),this._subContainer=A,!f||!(f instanceof ot))return;if(!e.instanceClass)throw new Error("!sceneObject.instanceClass");l._divContainer=this.disposeVar(new e.instanceClass(A,e,f))._container;{const g=()=>{l._divContainer.style.pointerEvents=l.sceneObject.editing?"none":"all"};g(),this.d(l.sceneObject.editingChanged.don(g))}{const g=()=>{l._divContainer.children[0]&&(l._divContainer.children[0].style.transform=`scale(${e.scale[1]},${e.scale[2]})`,l._divContainer.children[0].style.transformOrigin=`${e.anchor[0]*100}% ${e.anchor[1]*100}%`)};g(),this.d(e.scaleChanged.don(g))}let d=l._divContainer?l._divContainer.querySelectorAll("*[class]"):[];for(let g=0;g<d.length;g++){const v=d[g];var p=v.getBoundingClientRect();l._hasClassDivAndPos[v.className]=[v.offsetLeft,v.offsetTop,v.offsetLeft+p.width,v.offsetTop+p.height]}}}},s=()=>{try{e.instanceClass?r.instanceClass=a():r.instanceClass=void 0}catch(l){console.error(l)}};s(),this.dispose(e.instanceClassChanged.disposableOn(s))}this.dispose(r.pickedEvent.disposableOn(a=>{var u;a.assign({sceneObject:e});const s=(u=_o(a,"pickResult"))==null?void 0:u.pointerEvent;if(!s)return;const l={type:s.buttons!=0&&s.button==0?"leftClick":s.button==2?"rightClick":void 0,add:{mousePos:[s.offsetX,s.offsetY]}};if(l.type==null&&(l.type=s.type),l.type==="leftClick"){const A=Object.keys(this._hasClassDivAndPos);for(let h=0;h<A.length;h++){const f=A[h];let d=this._hasClassDivAndPos[f],p=this._divContainer.getBoundingClientRect();const g=s.clientX-p.left,v=s.clientY-p.top;if(g>=d[0]&&g<=d[2]&&v>=d[1]&&v<=d[3]){l.add.className=f;break}}}e.widgetEvent.emit(l),l.type==="leftClick"&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmGeoCustomDivPoi(){return this._czmGeoCustomDivPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.position&&Fe(r.viewer,a.position,1e3,Hn,e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Xu,"type",Xu.register("ESCesiumViewer",c.ESGeoDiv.type,Xu));let sg=Xu;const Yu=class Yu extends He{constructor(e,i){super(e,i);L(this,"_czmDivTextPoi");if(this._czmDivTextPoi=this.disposeVar(new vi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmDivTextPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(c.bind([r,"textEditing"],[e,"textEditing"])),this.dispose(c.bind([r,"width"],[e,"width"])),this.dispose(c.bind([r,"text"],[e,"text"])),this.dispose(c.track([r,"originRatioAndOffset"],[e,"originRatioAndOffset"])),this.dispose(c.track([r,"opacity"],[e,"opacity"])),this.dispose(c.bind([r,"fontSize"],[e,"fontSize"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.track([r,"backgroundColor"],[e,"backgroundColor"])),this.dispose(c.track([r,"borderRadius"],[e,"borderRadius"])),this.dispose(c.track([r,"borderColor"],[e,"borderColor"])),this.dispose(c.track([r,"borderWidth"],[e,"borderWidth"])),this.dispose(c.track([r,"textAlign"],[e,"textAlign"])),this.dispose(c.track([r,"borderStyle"],[e,"borderStyle"]))}get czmDivTextPoi(){return this._czmDivTextPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmDivTextPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Yu,"type",Yu.register("ESCesiumViewer",c.ESGeoDivTextPoi.type,Yu));let ag=Yu;const fO={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"}}]},pO=`properties是一个包含三个属性的对象,title表示标题,marker-symbol表示点位的文字内容,marker-color表示点位颜色,properties可以删除,然后使用场景对象属性设置。
3020
3020
  \`\`\`
3021
3021
  {
3022
3022
  "type": "FeatureCollection",
@@ -3095,19 +3095,19 @@ export type IndexJsonType = {
3095
3095
  }
3096
3096
  }
3097
3097
  }
3098
- `,Qx="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",pO=`${Qx}
3098
+ `,Qx="${earthsdk3-assets-script-dir}/assets/misc/2.geojson",dO=`${Qx}
3099
3099
 
3100
3100
  该路径可以使用下面回调函数
3101
3101
  \`\`\`
3102
3102
  ${kx}
3103
3103
  \`\`\`
3104
- `,xt=class xt extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"_defaultBoundingSphere",new _.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const a=this.dv(c.createProcessingFromAsyncFunc(async u=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:c.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(c.ESSceneObject.context.getStrFromEnv(this.url)).then(A=>A.json()).then(A=>{this._data=A}).catch(A=>{console.warn("ESGeoJson数据加载失败",A)}),this.dataSource=await _.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(A=>{var f,d;const h=[];for(const p of A.entities.values)if(_.Entity.prototype&&(p.ESSceneObjectID=i),this._isEntityShow(p,e),p.polygon&&h.push(...(f=p.polygon.hierarchy)==null?void 0:f.getValue(_.JulianDate.now()).positions),p.polyline&&h.push(...(d=p.polyline.positions)==null?void 0:d.getValue(_.JulianDate.now())),p.position){const g=p.position.getValue(_.JulianDate.now());g&&h.push(g)}this._defaultBoundingSphere=_.BoundingSphere.fromPoints(h)}))})),s=()=>{a.isRunning&&a.cancel(),a.restart()};s();const l=this.dv(c.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(s))}{const a=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(A){console.error(A)}else{const A=this.dataSource.entities.values;for(let h=0;h<A.length;h++){const f=A[h];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(_.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new _.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new _.ConstantProperty(!this.fillGround),f.polygon.heightReference=new _.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?_.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new _.ConstantProperty(this.filled??xt.defaults.filled),f.polygon.material=new _.ColorMaterialProperty(new _.Color(...this.fillColor??xt.defaults.fillColor)),f.polygon.outline=new _.ConstantProperty(!1),f.polygon.classificationType=_.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new _.PolylineGraphics;const d=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(_.JulianDate.now()).positions));_.Cartesian3.equals(d[0],d[d.length-1])||d.push(d[0]),f.polyline.positions=d,f.polyline.classificationType=_.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=_.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new _.ConstantProperty(this.stroked??xt.defaults.stroked),f.polyline.width=new _.ConstantProperty(this.strokeWidth??xt.defaults.strokeWidth),f.polyline.material=new _.ColorMaterialProperty(new _.Color(...this.strokeColor??xt.defaults.strokeColor)),f.polyline.clampToGround=new _.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new _.ConstantProperty(this.imageShow??xt.defaults.imageShow),f.billboard.width=new _.ConstantProperty(this.imageSize?this.imageSize[0]:xt.defaults.imageSize[0]),f.billboard.height=new _.ConstantProperty(this.imageSize?this.imageSize[1]:xt.defaults.imageSize[1]);const d=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:xt.defaults.imageUrl;f.billboard.image=new _.ConstantProperty(c.ESSceneObject.context.getStrFromEnv(d)),f.billboard.horizontalOrigin=new _.ConstantProperty(_.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new _.ConstantProperty(_.VerticalOrigin.TOP),f.billboard.heightReference=new _.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?_.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.RELATIVE_TO_GROUND);const p=this.imageAnchor??xt.defaults.imageAnchor,g=this.imageOffset??xt.defaults.imageOffset;if(f.billboard.pixelOffset=new _.ConstantProperty(_.Cartesian2.fromArray([-p[0]*f.billboard.width.getValue(_.JulianDate.now())+g[0],-p[1]*f.billboard.height.getValue(_.JulianDate.now())+g[1]])),f.label=new _.LabelGraphics,!f.label)return;f.label.show=new _.ConstantProperty(this.textShow??xt.defaults.textShow),f.label.heightReference=new _.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?_.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.RELATIVE_TO_GROUND),f.label.text=new _.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??xt.defaults.textDefaultText),f.label.fillColor=new _.ConstantProperty(new _.Color(...this.textColor??xt.defaults.textColor)),f.label.showBackground=new _.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:xt.defaults.textFontSize,y=this.textOffset??xt.defaults.textOffset;f.label.backgroundColor=new _.ConstantProperty(new _.Color(...this.textBackgroundColor??xt.defaults.textBackgroundColor)),f.label.font=new _.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??xt.defaults.textFontFamily}`),f.label.horizontalOrigin=new _.ConstantProperty(_.HorizontalOrigin.LEFT),f.label.verticalOrigin=new _.ConstantProperty(_.VerticalOrigin.TOP),f.label.eyeOffset=new _.ConstantProperty(_.Cartesian3.fromArray([0,0,-1]));const m=this.textAnchor??xt.defaults.textAnchor;f.label.pixelOffset=new _.ConstantProperty(_.Cartesian2.fromArray([-m[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(_.JulianDate.now()),f.label.font.getValue(_.JulianDate.now())))+y[0],-m[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};a();const s=this.dv(c.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(s.don(a))}{const a=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const A=l[u];this._isEntityShow(A,e)}};a();const s=this.ad(c.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(s.don(a))}{const a=()=>{if(this.loadFuncStr)try{const s=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=s}catch(s){console.error(s),this.loadFun=void 0}else this.loadFun=void 0};a(),this.dispose(this.loadFuncStrChanged.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&this.dataSource&&(a!==void 0?o.flyTo(this.dataSource,{duration:a/1e3}).then(s=>{s||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:a/1e3})}):o.flyTo(this.dataSource).then(s=>{s||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,i="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=i,r.measureText(e).width}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=i.viewer)!=null&&o.camera&&this.show){let r;if(e.polygon&&e.polygon.hierarchy)r=c.getMinMaxCorner(e.polygon.hierarchy.getValue(_.JulianDate.now()).positions.map(l=>Ue(l))).center;else if(e.polyline&&e.polyline.positions)r=c.getMinMaxCorner(e.polyline.positions.getValue(_.JulianDate.now()).map(l=>Ue(l))).center;else if(e.position){const l=e.position.getValue(_.JulianDate.now());l&&(r=Ue(l))}if(!r||isNaN(r[0]))return;const a=c.getDistancesFromPositions([r,Fn(i.viewer.camera)],"NONE")[0];let s=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?s=this.minFeatureVisibleDistance<a&&a<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?s=a>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(s=a<this.maxFeatureVisibleDistance),e.show=this.show&&s}}};L(xt,"defaults",{show:!0,allowPicking:!0,url:Qx,defaultLoadFuncStr:kx,defaultLoadFuncDocStr:pO,data:AO,dataMd:fO,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 qo=xt;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:c.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:c.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:c.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:c.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:c.reactArrayWithUndefined(void 0),imageAnchor:c.reactArrayWithUndefined(void 0),imageOffset:c.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:c.reactArrayWithUndefined(void 0),textBackgroundColor:c.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:c.reactArrayWithUndefined(void 0),textOffset:c.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(qo||(qo={})),c.extendClassProps(qo.prototype,qo.createDefaultProps);const Ju=class Ju extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.ad(new qo(e,n.id));this.ad(c.track([o,"show"],[n,"show"])),this.ad(c.track([o,"allowPicking"],[n,"allowPicking"])),this.ad(c.track([o,"loadFuncStr"],[n,"loadFuncStr"])),this.ad(c.track([o,"url"],[n,"features"])),this.ad(c.track([o,"stroked"],[n,"stroked"])),this.ad(c.track([o,"strokeWidth"],[n,"strokeWidth"])),this.ad(c.track([o,"strokeWidthType"],[n,"strokeWidthType"])),this.ad(c.track([o,"strokeColor"],[n,"strokeColor"])),this.ad(c.track([o,"strokeMaterial"],[n,"strokeMaterial"])),this.ad(c.track([o,"strokeMaterialParams"],[n,"strokeMaterialParams"])),this.ad(c.track([o,"strokeGround"],[n,"strokeGround"])),this.ad(c.track([o,"filled"],[n,"filled"])),this.ad(c.track([o,"fillColor"],[n,"fillColor"])),this.ad(c.track([o,"fillMaterial"],[n,"fillMaterial"])),this.ad(c.track([o,"fillMaterialParams"],[n,"fillMaterialParams"])),this.ad(c.track([o,"fillGround"],[n,"fillGround"])),this.ad(c.track([o,"imageShow"],[n,"imageShow"])),this.ad(c.track([o,"imageUrl"],[n,"imageUrl"])),this.ad(c.track([o,"imageSize"],[n,"imageSize"])),this.ad(c.track([o,"imageAnchor"],[n,"imageAnchor"])),this.ad(c.track([o,"imageOffset"],[n,"imageOffset"])),this.ad(c.track([o,"textShow"],[n,"textShow"])),this.ad(c.track([o,"textProperty"],[n,"textProperty"])),this.ad(c.track([o,"textDefaultText"],[n,"textDefaultText"])),this.ad(c.track([o,"textColor"],[n,"textColor"])),this.ad(c.track([o,"textBackgroundColor"],[n,"textBackgroundColor"])),this.ad(c.track([o,"textFontFamily"],[n,"textFontFamily"])),this.ad(c.track([o,"textFontSize"],[n,"textFontSize"])),this.ad(c.track([o,"textFontStyle"],[n,"textFontStyle"])),this.ad(c.track([o,"textFontWeight"],[n,"textFontWeight"])),this.ad(c.track([o,"textAnchor"],[n,"textAnchor"])),this.ad(c.track([o,"textOffset"],[n,"textOffset"])),this.ad(c.track([o,"minFeatureVisibleDistance"],[n,"minFeatureVisibleDistance"])),this.ad(c.track([o,"maxFeatureVisibleDistance"],[n,"maxFeatureVisibleDistance"])),this.ad(c.track([o,"heightReference"],[n,"heightReference"])),this.ad(c.track([o,"classificationType"],[n,"classificationType"])),this.ad(n.flyToEvent.disposableOn(r=>{if(e.actived){if(n.flyInParam){const{position:a,rotation:s,flyDuration:l}=n.flyInParam;return Fe(e.viewer,a,void 0,s,l),!0}o.flyTo(r&&r*1e3)}}));{const r=async(a,s,l)=>{if(!e.actived)return;const u=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(a,s)));if(!(!u||!(u!=null&&u.positions)))if(u.type=="Point"||u.type=="MultiPoint")Gn(e,n,this.id,await this._calculateFeatureHeight(u.type=="MultiPoint"?u.positions.flat():u.positions,n.heightReference,e),1e3,l);else{const A=u.type=="Polygon"||u.type=="MultiPolygon"||u.type=="MultiLineString";let h=[];A?h=u.positions.flat(u.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,n.fillGround?"CLAMP_TO_GROUND":"NONE",e)):h=u.positions.map(g=>this._calculateFeatureHeight(g,n.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:d,center:p}=c.getMinMaxCorner(h);Gn(e,n,this.id,p,c.getDistancesFromPositions([f,d],"NONE")[0],l)}};this.d(n.flyToFeatureEvent.don((a,s,l)=>r(a,s,l))),this.d(n.flyToFeatureIndexEvent.don((a,s)=>r(a,void 0,s)))}}_getFeatureByIndexOrProperties(n,e){var a,s,l,u,A,h,f,d;const{sceneObject:i}=this,o=i.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let p=r.find(g=>(g==null?void 0:g.properties[n])==e);return{type:p!=null&&p.coordinates?p.type:(a=p==null?void 0:p.geometry)==null?void 0:a.type,positions:(p==null?void 0:p.coordinates)||((s=p==null?void 0:p.geometry)==null?void 0:s.coordinates)}}else if(typeof n=="number")return{type:(l=r[n])!=null&&l.coordinates?r[n].type:(A=(u=r[n])==null?void 0:u.geometry)==null?void 0:A.type,positions:((h=r[n])==null?void 0:h.coordinates)||((d=(f=r[n])==null?void 0:f.geometry)==null?void 0:d.coordinates)}}}async _calculateFeatureHeight(n,e,i){const o=[...n];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await i.getTerrainHeight(o)??0:o[2]+=await i.getTerrainHeight(o)??0,o}};L(Ju,"type",Ju.register("ESCesiumViewer",c.ESGeoJson.type,Ju));let lg=Ju;const ec=class ec extends on{constructor(e,i){super(e,i);L(this,"_czmGeoESRectangle");L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,a=this._geoPolyline;a.arcType="RHUMB",this.dispose(c.track([a,"color"],[e,"strokeColor"])),this.dispose(c.track([a,"width"],[e,"strokeWidth"])),this.dispose(c.track([a,"ground"],[e,"strokeGround"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.show=e.show&&e.stroked,r.show=e.show&&e.filled};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:A}=c.getMinMaxCorner(l);r.rectangle=[u[0],u[1],A[0],A[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const h=l.map(g=>(l&&(g[2]=l[0][2]),g)),f=h[0],d=h[1],p=[f,[f[0],d[1],f[2]],d,[d[0],f[1],d[2]]];a.positions=[...p,f]}else r.rectangle=void 0,a.positions=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(ec,"type",ec.register("ESCesiumViewer",c.ESGeoRectangle.type,ec));let ug=ec;class Zl extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new zr(e,i));const{geoPolygon:o}=this;this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(a=>{o.flyTo(a)})),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"fill"],[this,"filled"])),this.dispose(c.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(c.bind([o,"ground"],[this,"ground"])),this.dispose(c.bind([o,"outline"],[this,"outline"])),this.dispose(c.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const a=Tp([...this.positions,this.positions[0]]);o.positions=a}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}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:c.reactArray([1,1,1,1]),outlineWidth:1,color:c.reactArrayWithUndefined([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0})})(Zl||(Zl={})),c.extendClassProps(Zl.prototype,Zl.createDefaultProps);const tc=class tc extends on{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"ground"],[e,"ground"]));{const a=()=>{r.ground=e.ground||e.fillGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(s.don(a))}{const a=()=>{r.color=e.filled?e.fillColor:Kl.defaults.fillStyle.color};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}this.dispose(c.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(tc,"type",tc.register("ESCesiumViewer",Kl.type,tc));let cg=tc;const nc=class nc extends He{constructor(e,i){super(e,i);L(this,"_czmModel");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Ht(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(s=>{r.gltf.animations&&(r.activeAnimationsJson=r.gltf.animations.map((l,u)=>({index:u,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),e.czmModelReadyEvent.emit(s),e.readyEvent.emit(s)})),this.ad(new Bh(o,this._czmModel)),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"color"],[e,"czmColor"])),this.d(c.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(c.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(c.track([r,"scale"],[e,"scale"])),this.ad(c.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const s=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};s(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>s(l)))}{const s=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};s(),this.ad(e.czmEnvironmentMapManagerChanged.don(s))}{const s=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,r.rotation=l};s(),this.d(e.rotationChanged.don(s));{const l=()=>{if(s(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(u=>{const A=JSON.parse(JSON.stringify(u));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(s=>{r.setMaterial(s)}));{const s=()=>{const l=[...r.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};s(),this.d(r.rotationChanged.don(s))}{const s=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(s.don(l))}const a=()=>{r.url=c.ESSceneObject.context.getStrFromEnv(Th(typeof e.url=="string"?e.url:e.url.url))};a(),this.d(e.urlChanged.don(a)),this.d(e.setNodePositionEvent.don((s,l)=>{r.setNodeTranslation(s,l)})),this.d(e.setNodeRotationEvent.don((s,l)=>{r.setNodeRotation(s,l)})),this.d(e.setNodeScaleEvent.don((s,l)=>{r.setNodeScale(s,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a):!1}};L(nc,"type",nc.register("ESCesiumViewer",c.ESGltfModel.type,nc));let hg=nc;function Vx(t,n){const e=t[0]-n[0],i=t[1]-n[1],o=t[2]-n[2];return Math.sqrt(e*e+i*i+o*o)}class $l extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distance",this.disposeVar(c.react(0)));L(this,"_surfaceDistance",this.disposeVar(c.react(0)));L(this,"_height",this.disposeVar(c.react(0)));L(this,"_middlePosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(c.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 a=this._surfaceDistance.value=c.geoDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="RHUMB"){const a=this._surfaceDistance.value=c.geoRhumbDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="NONE"){const a=c.lbhToXyz(this.positions[0]),s=c.lbhToXyz(this.positions[1]);this._distance.value=Vx(a,s),this._surfaceDistance.value=Vx(c.lbhToXyz(this._middlePosition.value),s),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 r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const a=this.disposeVar(new Ye(e,i));a.ground=!1,a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"]));{a.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,A]=this.positions;a.positions=[u,A,[u[0],u[1],A[2]]]}else a.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&a.flyTo(l)}));const s=this.disposeVar(new wt(e,i));this.dispose(c.track([s,"shadowDom"],[this,"shadowDom"])),this.dispose(c.track([s,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(c.track([s,"show"],[this,"show"]));{const l=()=>{s.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{s.innerHTML=xo(`高度: ${Ih(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(s.pickedEvent.don(l=>{Gi(l)===0&&this.pickedEvent.emit(l)}))}}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:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})($l||($l={})),c.extendClassProps($l.prototype,$l.createDefaultProps);const ic=class ic extends on{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new $l(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(ic,"type",ic.register("ESCesiumViewer",c.ESHeightMeasurement.type,ic));let Ag=ic;const fg={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"}]},rc=class rc extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"])),this.d(r.readyEvent.don(g=>{e.readyEvent.emit(g)}));{const g=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(g.don(v))}const a=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),A=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),h=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=a;break;case"police":r.url=s;break;case"pedestrian":r.url=l;break;case"stranger":r.url=u;break;case"suitMan":r.url=A;break;case"suitWoman":r.url=h;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const d=()=>{const g=e.animation??c.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}g==="walking"?r.activeAnimationsJson=fg.czmAnimationsWalk:g==="standing"?r.activeAnimationsJson=fg.czmAnimationsStand:g==="running"&&(r.activeAnimationsJson=fg.czmAnimationsRun)};d();const p=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(p.disposableOn(()=>d())),this.ad(new Bh(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a)}};L(rc,"type",rc.register("ESCesiumViewer",c.ESHuman.type,rc));let pg=rc;class Nx extends c.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Fe(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Hn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new yi(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=A=>{let h=A;return A.includes("inner://")&&(h="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(h))},a=()=>{const A=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=A,e.sizeByContent){const f=new Image;f.src=A,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},s=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(s.disposableOn(()=>a())),a(),this.d(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.ad(c.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const A=()=>{o.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,h=e.offset;A?o.originRatioAndOffset=[...A,-h[0],-h[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(A=>{const{offsetX:h,offsetY:f}=A,p={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[h,f]}};e.widgetEvent.emit(p)})),this.dispose(o.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const h={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(h)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Hx extends c.Destroyable{constructor(e,i,o){super();L(this,"_czmGeoImageModel");L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmGeoImageModel.position)return Gn(this.czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoImageModel=this.disposeVar(new $i(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(f=>{const d=f==null?void 0:f.pointerEvent;d&&(this._isPointEvent=!0,this._eventInfo={type:d.button==0?"leftClick":d.button==2?"rightClick":"leftClick",add:{mousePos:[d.offsetX,d.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var d,p,g;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((d=this._eventInfo.add)!=null&&d.mousePos)&&Math.abs(f.screenPosition[0]-((p=this._eventInfo.add)==null?void 0:p.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((g=this._eventInfo.add)==null?void 0:g.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const f=i.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((d,p)=>{(d==null?void 0:d.sceneObject)==(p==null?void 0:p.sceneObject)||(d==null?void 0:d.sceneObject)!=e&&(p==null?void 0:p.sceneObject)!=e||(d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:d==null?void 0:d.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&d.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),p!=null&&p.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:d==null?void 0:d.screenPosition}},p.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&p.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const a=e.sizeByContent,l=(f=>{let d=f;return f.includes("inner://")&&(d="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(d))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(a)r.size=[u.width/100,u.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=l,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const f=()=>{r.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(Mt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const A=()=>{const f=e.anchor,d=e.offset;f?r.originRatioAndOffset=[...f,-d[0]/100,-d[1]/100]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(h.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const oc=class oc extends Gl{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new c.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new Nx(this.sceneObject,this.czmViewer):new Hx(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(oc,"type",oc.register("ESCesiumViewer",c.ESImageLabel.type,oc));let dg=oc;function dO(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const sc=class sc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const a=this.ad(c.reactJson(""));{const u=()=>{if(typeof e.url=="string")a.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const A=e.url;A.url=c.ESSceneObject.context.getStrFromEnv(A.url),a.value=A}};u(),this.ad(e.urlChanged.don(u))}const s=()=>{var p;if(!a.value)return;const u=(((p=e.options)==null?void 0:p.type)??"auto").toLowerCase(),A=e.options??{};let h={type:"UrlTemplateImageryProvider",url:a.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...A},f=a.value,d=typeof f=="string"?f:f.url;if(u==="auto"){const g=d.toLowerCase();if(g.startsWith("ion://")){const y=+g.substring(6);h={...A,assetId:y,type:"IonImageryProvider"}}else if(g.includes("{x}")||g.includes("{y}")||g.includes("{z}"))h.type="UrlTemplateImageryProvider";else if(g.includes("wmts"))h.type="WebMapTileServiceImageryProvider";else if(g.includes("wms"))h.type="WebMapServiceImageryProvider";else{if(d.includes("/tilemapresource.xml")){const v=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,h.url=f}h.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&d.includes("/tilemapresource.xml")){const g=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=g:f.url=g,h.url=f}else if(u==="ion"&&d.startsWith("ion://")){const v=+d.substring(6);h={...A,assetId:v,type:"IonImageryProvider"}}h.type=dO(u)}console.log("imageryProvider",h),r.imageryProvider=h};s();const l=this.dv(c.createNextAnimateFrameEvent(a.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(s))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"alpha"],[e,"opacity"])),this.d(c.bind([r,"alpha"],[e,"czmAlpha"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.ad(c.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(sc,"type",sc.register("ESCesiumViewer",c.ESImageryLayer.type,sc));let mg=sc;class mO extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(c.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new at(i,this._sceneObject.id)),this._czmTexture=this.dv(new ht(i));const a=e,s=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(c.track([s,"show"],[this,"show"])),this.dispose(c.track([s,"show"],[a,"show"])),this.dispose(c.track([s,"allowPicking"],[a,"allowPicking"])),this.dispose(c.track([s,"rotation"],[a,"rotation"])),this.dispose(c.track([s,"position"],[a,"position"])),this.dispose(c.track([s,"scale"],[a,"scale"])),this.ad(a.allowPickingChanged.don(()=>{s.allowPicking=a.allowPicking,s.pass=a.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const h=a.size/2,f=r[0].map(S=>S*h),d=r[1].map(S=>S*h),p=r[2].map(S=>S*h),g=r[3].map(S=>S*h),v=[...f,...d,...p,...g];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const m=[0,0],b=[1,0],x=[1,1],E=[0,1];let B=[];o=="east"||o=="south"?B=[...b,...m,...E,...x]:o=="west"?B=[...b,...x,...E,...m]:o=="top"?B=[...E,...x,...b,...m]:B=[...m,...b,...x,...E],s.indexTypedArray=new Uint16Array(y),s.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(B),componentsPerAttribute:2}},l.uri=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${a.mode}/${o}.${a.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const T=c.getDistancesFromPositions([a.position,P.position],"NONE")[0]/(a.size/2*a.autoOpacityFactor);this.changeOpacity(a.autoFollow?1:T)}const I=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:M,max:F}=I;s.setLocalAxisedBoundingBox(M,F)};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(a.sizeChanged,a.modeChanged));this.dispose(A.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 gO extends c.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{a()}));function a(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const s=e.getCameraInfo();if(s!=null&&(r==null||r.position[0]!=s.position[0]||r.position[1]!=s.position[1]||r.position[2]!=s.position[2]||r.rotation[0]!=s.rotation[0]||r.rotation[1]!=s.rotation[1]||r.rotation[2]!=s.rotation[2])){r=s;const A=c.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(h=>{h.changeOpacity(1)}))):i.forEach(h=>{h.changeOpacity(A)})}}a()}}const Pt=class Pt extends He{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Pt._defaultLocalBox&&Pt._firstLoad&&(Pt._firstLoad=!1,Pt._defaultLocalBox=i.xbsjLocalBoxSources),Pt._eSLocalSkyBoxArr.push(e),this.d(()=>{Pt._eSLocalSkyBoxArr.includes(e)&&Pt._eSLocalSkyBoxArr.splice(Pt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={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 a in r)if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];this._czmSkyBoxComponents.push(this.dv(new mO(e,i,a,s)))}{const a=this.disposeVar(c.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new c.ObjResettingWithEvent(a,()=>(this.ChangeAutoFollow(),new gO(e,i,this._czmSkyBoxComponents))))}{const a=()=>{this.ChangeAutoFollow()},s=this.disposeVar(c.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(s.disposableOn(a))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Pt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Pt._eSLocalSkyBoxArr[i];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}i==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}Pt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.size??c.ESLocalSkyBox.defaults.size;return o.position?(Gn(r,o,i,o.position,a,e,!0),!0):!1}}};L(Pt,"type",Pt.register("ESCesiumViewer",c.ESLocalSkyBox.type,Pt)),L(Pt,"_defaultLocalBox"),L(Pt,"_firstLoad",!0),L(Pt,"_eSLocalSkyBoxArr",[]);let gg=Pt;const ni=class ni extends He{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(c.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(a=>{(e.allowPicking??c.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(a)})),this.dispose(r.innerHtmlMounted.disposableOn(a=>{const s=a.firstElementChild;s&&(s.style.pointerEvents="auto",s.style.cursor="default",s.onclick=l=>r.pickFromDiv(s,{type:"viewerPicking",pointerEvent:l}))}));{const a=()=>{if(!e.position)return;const l=(this.textFunc??ni.defaultTextFunc_度格式)(e.position);r.innerHTML=xo(l)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(s.disposableOn(a))}{const a=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?ni.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ni.defaultTextFunc_度分格式:ni.defaultTextFunc_度分秒格式};a(),this.d(i.lonLatFormatChanged.don(()=>{a()}))}}}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,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ni,"type",ni.register("ESCesiumViewer",c.ESLocationMeasurement.type,ni)),L(ni,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
3104
+ `,xt=class xt extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_dataSource",this.disposeVar(c.react(void 0)));L(this,"_data");L(this,"_defaultHeight",{});L(this,"_defaultBoundingSphere",new _.BoundingSphere);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r=()=>{this.dataSource&&o.dataSources.remove(this.dataSource,!0),this.dataSource=void 0,this._data=void 0};this.dispose(()=>{r()});{const a=this.dv(c.createProcessingFromAsyncFunc(async u=>{this.dataSource&&r(),this.url&&(typeof this.url=="object"?this._data=this.url:c.isJSON(this.url)?this._data=JSON.parse(this.url):await fetch(c.ESSceneObject.context.getStrFromEnv(this.url)).then(A=>A.json()).then(A=>{this._data=A}).catch(A=>{console.warn("ESGeoJson数据加载失败",A)}),this.dataSource=await _.GeoJsonDataSource.load(this._data),o.dataSources.add(this.dataSource).then(A=>{var f,d;const h=[];for(const p of A.entities.values)if(_.Entity.prototype&&(p.ESSceneObjectID=i),this._isEntityShow(p,e),p.polygon&&h.push(...(f=p.polygon.hierarchy)==null?void 0:f.getValue(_.JulianDate.now()).positions),p.polyline&&h.push(...(d=p.polyline.positions)==null?void 0:d.getValue(_.JulianDate.now())),p.position){const g=p.position.getValue(_.JulianDate.now());g&&h.push(g)}this._defaultBoundingSphere=_.BoundingSphere.fromPoints(h)}))})),s=()=>{a.isRunning&&a.cancel(),a.restart()};s();const l=this.dv(c.createNextAnimateFrameEvent(this.loadFunChanged,this.urlChanged));this.dispose(l.don(s))}{const a=()=>{var l,u;if(this.dataSource)if(this.dataSource.show=this.show,this.loadFun)try{this.loadFun(this.dataSource)}catch(A){console.error(A)}else{const A=this.dataSource.entities.values;for(let h=0;h<A.length;h++){const f=A[h];if(f.polygon){this._defaultHeight[f.id]||(this._defaultHeight[f.id]=(l=f.polygon.height)==null?void 0:l.getValue(_.JulianDate.now())),f.polygon.height=this.fillGround?void 0:new _.ConstantProperty(this._defaultHeight[f.id]),f.polygon.perPositionHeight=new _.ConstantProperty(!this.fillGround),f.polygon.heightReference=new _.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?_.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.RELATIVE_TO_GROUND),f.polygon.show=new _.ConstantProperty(this.filled??xt.defaults.filled),f.polygon.material=new _.ColorMaterialProperty(new _.Color(...this.fillColor??xt.defaults.fillColor)),f.polygon.outline=new _.ConstantProperty(!1),f.polygon.classificationType=_.ClassificationType[this.classificationType.toUpperCase()],f.polyline=new _.PolylineGraphics;const d=JSON.parse(JSON.stringify((u=f.polygon.hierarchy)==null?void 0:u.getValue(_.JulianDate.now()).positions));_.Cartesian3.equals(d[0],d[d.length-1])||d.push(d[0]),f.polyline.positions=d,f.polyline.classificationType=_.ClassificationType[this.classificationType.toUpperCase()]}if(f.polyline&&(f.polyline.classificationType=_.ClassificationType[this.classificationType.toUpperCase()],f.polyline.show=new _.ConstantProperty(this.stroked??xt.defaults.stroked),f.polyline.width=new _.ConstantProperty(this.strokeWidth??xt.defaults.strokeWidth),f.polyline.material=new _.ColorMaterialProperty(new _.Color(...this.strokeColor??xt.defaults.strokeColor)),f.polyline.clampToGround=new _.ConstantProperty(this.strokeGround)),f.billboard){f.billboard.show=new _.ConstantProperty(this.imageShow??xt.defaults.imageShow),f.billboard.width=new _.ConstantProperty(this.imageSize?this.imageSize[0]:xt.defaults.imageSize[0]),f.billboard.height=new _.ConstantProperty(this.imageSize?this.imageSize[1]:xt.defaults.imageSize[1]);const d=this.imageUrl?typeof this.imageUrl=="string"?this.imageUrl:this.imageUrl.url:xt.defaults.imageUrl;f.billboard.image=new _.ConstantProperty(c.ESSceneObject.context.getStrFromEnv(d)),f.billboard.horizontalOrigin=new _.ConstantProperty(_.HorizontalOrigin.LEFT),f.billboard.verticalOrigin=new _.ConstantProperty(_.VerticalOrigin.TOP),f.billboard.heightReference=new _.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?_.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.RELATIVE_TO_GROUND);const p=this.imageAnchor??xt.defaults.imageAnchor,g=this.imageOffset??xt.defaults.imageOffset;if(f.billboard.pixelOffset=new _.ConstantProperty(_.Cartesian2.fromArray([-p[0]*f.billboard.width.getValue(_.JulianDate.now())+g[0],-p[1]*f.billboard.height.getValue(_.JulianDate.now())+g[1]])),f.label=new _.LabelGraphics,!f.label)return;f.label.show=new _.ConstantProperty(this.textShow??xt.defaults.textShow),f.label.heightReference=new _.ConstantProperty(this.heightReference.toUpperCase()=="NONE"?_.HeightReference.NONE:this.heightReference.toUpperCase()=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.RELATIVE_TO_GROUND),f.label.text=new _.ConstantProperty(this.textProperty&&this.textProperty!==""&&f.properties&&f.properties[this.textProperty]?f.properties[this.textProperty].getValue():this.textDefaultText??xt.defaults.textDefaultText),f.label.fillColor=new _.ConstantProperty(new _.Color(...this.textColor??xt.defaults.textColor)),f.label.showBackground=new _.ConstantProperty(this.textBackgroundColor!=null);const v=this.textFontSize&&this.textFontSize!=0?this.textFontSize:xt.defaults.textFontSize,y=this.textOffset??xt.defaults.textOffset;f.label.backgroundColor=new _.ConstantProperty(new _.Color(...this.textBackgroundColor??xt.defaults.textBackgroundColor)),f.label.font=new _.ConstantProperty(`${this.textFontStyle} ${this.textFontWeight} ${v}px ${this.textFontFamily??xt.defaults.textFontFamily}`),f.label.horizontalOrigin=new _.ConstantProperty(_.HorizontalOrigin.LEFT),f.label.verticalOrigin=new _.ConstantProperty(_.VerticalOrigin.TOP),f.label.eyeOffset=new _.ConstantProperty(_.Cartesian3.fromArray([0,0,-1]));const m=this.textAnchor??xt.defaults.textAnchor;f.label.pixelOffset=new _.ConstantProperty(_.Cartesian2.fromArray([-m[0]*((this.textBackgroundColor?-14:0)+this._getTextPixelWidth(f.label.text.getValue(_.JulianDate.now()),f.label.font.getValue(_.JulianDate.now())))+y[0],-m[1]*((this.textBackgroundColor?10:0)+v)+y[1]]))}}}};a();const s=this.dv(c.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(s.don(a))}{const a=()=>{if(!this.dataSource)return;const l=this.dataSource.entities.values;for(let u=0;u<l.length;u++){const A=l[u];this._isEntityShow(A,e)}};a();const s=this.ad(c.createNextAnimateFrameEvent(this.minFeatureVisibleDistanceChanged,this.maxFeatureVisibleDistanceChanged,e.cameraChanged,this.showChanged));this.ad(s.don(a))}{const a=()=>{if(this.loadFuncStr)try{const s=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=s}catch(s){console.error(s),this.loadFun=void 0}else this.loadFun=void 0};a(),this.dispose(this.loadFuncStrChanged.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{e.actived&&this.dataSource&&(a!==void 0?o.flyTo(this.dataSource,{duration:a/1e3}).then(s=>{s||o.camera.flyToBoundingSphere(this._defaultBoundingSphere,{duration:a/1e3})}):o.flyTo(this.dataSource).then(s=>{s||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,i="16px sans-serif"){const r=document.createElement("canvas").getContext("2d");return r.font=i,r.measureText(e).width}_isEntityShow(e,i){var o;if(this.minFeatureVisibleDistance==0&&this.maxFeatureVisibleDistance==0){e.show=this.show;return}if((o=i.viewer)!=null&&o.camera&&this.show){let r;if(e.polygon&&e.polygon.hierarchy)r=c.getMinMaxCorner(e.polygon.hierarchy.getValue(_.JulianDate.now()).positions.map(l=>Ue(l))).center;else if(e.polyline&&e.polyline.positions)r=c.getMinMaxCorner(e.polyline.positions.getValue(_.JulianDate.now()).map(l=>Ue(l))).center;else if(e.position){const l=e.position.getValue(_.JulianDate.now());l&&(r=Ue(l))}if(!r||isNaN(r[0]))return;const a=c.getDistancesFromPositions([r,Fn(i.viewer.camera)],"NONE")[0];let s=!1;this.minFeatureVisibleDistance<this.maxFeatureVisibleDistance?s=this.minFeatureVisibleDistance<a&&a<this.maxFeatureVisibleDistance:this.maxFeatureVisibleDistance==0?s=a>this.minFeatureVisibleDistance:this.minFeatureVisibleDistance==0&&(s=a<this.maxFeatureVisibleDistance),e.show=this.show&&s}}};L(xt,"defaults",{show:!0,allowPicking:!0,url:Qx,defaultLoadFuncStr:kx,defaultLoadFuncDocStr:dO,data:fO,dataMd:pO,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 qo=xt;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:void 0,loadFuncStr:void 0,url:void 0,stroked:void 0,strokeWidth:void 0,strokeWidthType:"world",strokeColor:c.reactArrayWithUndefined(void 0),strokeMaterial:void 0,strokeMaterialParams:c.reactJsonWithUndefined(void 0),strokeGround:void 0,filled:void 0,fillColor:c.reactArrayWithUndefined(void 0),fillMaterial:void 0,fillMaterialParams:c.reactJsonWithUndefined(void 0),fillGround:void 0,imageShow:void 0,imageUrl:void 0,imageSize:c.reactArrayWithUndefined(void 0),imageAnchor:c.reactArrayWithUndefined(void 0),imageOffset:c.reactArrayWithUndefined(void 0),textShow:void 0,textProperty:void 0,textDefaultText:void 0,textColor:c.reactArrayWithUndefined(void 0),textBackgroundColor:c.reactArrayWithUndefined(void 0),textFontFamily:void 0,textFontSize:void 0,textFontStyle:void 0,textFontWeight:void 0,textAnchor:c.reactArrayWithUndefined(void 0),textOffset:c.reactArrayWithUndefined(void 0),minFeatureVisibleDistance:0,maxFeatureVisibleDistance:0,heightReference:"NONE",classificationType:"TERRAIN"})})(qo||(qo={})),c.extendClassProps(qo.prototype,qo.createDefaultProps);const Ju=class Ju extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.ad(new qo(e,n.id));this.ad(c.track([o,"show"],[n,"show"])),this.ad(c.track([o,"allowPicking"],[n,"allowPicking"])),this.ad(c.track([o,"loadFuncStr"],[n,"loadFuncStr"])),this.ad(c.track([o,"url"],[n,"features"])),this.ad(c.track([o,"stroked"],[n,"stroked"])),this.ad(c.track([o,"strokeWidth"],[n,"strokeWidth"])),this.ad(c.track([o,"strokeWidthType"],[n,"strokeWidthType"])),this.ad(c.track([o,"strokeColor"],[n,"strokeColor"])),this.ad(c.track([o,"strokeMaterial"],[n,"strokeMaterial"])),this.ad(c.track([o,"strokeMaterialParams"],[n,"strokeMaterialParams"])),this.ad(c.track([o,"strokeGround"],[n,"strokeGround"])),this.ad(c.track([o,"filled"],[n,"filled"])),this.ad(c.track([o,"fillColor"],[n,"fillColor"])),this.ad(c.track([o,"fillMaterial"],[n,"fillMaterial"])),this.ad(c.track([o,"fillMaterialParams"],[n,"fillMaterialParams"])),this.ad(c.track([o,"fillGround"],[n,"fillGround"])),this.ad(c.track([o,"imageShow"],[n,"imageShow"])),this.ad(c.track([o,"imageUrl"],[n,"imageUrl"])),this.ad(c.track([o,"imageSize"],[n,"imageSize"])),this.ad(c.track([o,"imageAnchor"],[n,"imageAnchor"])),this.ad(c.track([o,"imageOffset"],[n,"imageOffset"])),this.ad(c.track([o,"textShow"],[n,"textShow"])),this.ad(c.track([o,"textProperty"],[n,"textProperty"])),this.ad(c.track([o,"textDefaultText"],[n,"textDefaultText"])),this.ad(c.track([o,"textColor"],[n,"textColor"])),this.ad(c.track([o,"textBackgroundColor"],[n,"textBackgroundColor"])),this.ad(c.track([o,"textFontFamily"],[n,"textFontFamily"])),this.ad(c.track([o,"textFontSize"],[n,"textFontSize"])),this.ad(c.track([o,"textFontStyle"],[n,"textFontStyle"])),this.ad(c.track([o,"textFontWeight"],[n,"textFontWeight"])),this.ad(c.track([o,"textAnchor"],[n,"textAnchor"])),this.ad(c.track([o,"textOffset"],[n,"textOffset"])),this.ad(c.track([o,"minFeatureVisibleDistance"],[n,"minFeatureVisibleDistance"])),this.ad(c.track([o,"maxFeatureVisibleDistance"],[n,"maxFeatureVisibleDistance"])),this.ad(c.track([o,"heightReference"],[n,"heightReference"])),this.ad(c.track([o,"classificationType"],[n,"classificationType"])),this.ad(n.flyToEvent.disposableOn(r=>{if(e.actived){if(n.flyInParam){const{position:a,rotation:s,flyDuration:l}=n.flyInParam;return Fe(e.viewer,a,void 0,s,l),!0}o.flyTo(r&&r*1e3)}}));{const r=async(a,s,l)=>{if(!e.actived)return;const u=JSON.parse(JSON.stringify(this._getFeatureByIndexOrProperties(a,s)));if(!(!u||!(u!=null&&u.positions)))if(u.type=="Point"||u.type=="MultiPoint")Gn(e,n,this.id,await this._calculateFeatureHeight(u.type=="MultiPoint"?u.positions.flat():u.positions,n.heightReference,e),1e3,l);else{const A=u.type=="Polygon"||u.type=="MultiPolygon"||u.type=="MultiLineString";let h=[];A?h=u.positions.flat(u.type=="MultiPolygon"?2:1).map(g=>this._calculateFeatureHeight(g,n.fillGround?"CLAMP_TO_GROUND":"NONE",e)):h=u.positions.map(g=>this._calculateFeatureHeight(g,n.strokeGround?"CLAMP_TO_GROUND":"NONE",e));const{minPos:f,maxPos:d,center:p}=c.getMinMaxCorner(h);Gn(e,n,this.id,p,c.getDistancesFromPositions([f,d],"NONE")[0],l)}};this.d(n.flyToFeatureEvent.don((a,s,l)=>r(a,s,l))),this.d(n.flyToFeatureIndexEvent.don((a,s)=>r(a,void 0,s)))}}_getFeatureByIndexOrProperties(n,e){var a,s,l,u,A,h,f,d;const{sceneObject:i}=this,o=i.features;if(!o)return;const r=Reflect.get(o,"features")||Reflect.get(o,"geometries");if(r){if(e){let p=r.find(g=>(g==null?void 0:g.properties[n])==e);return{type:p!=null&&p.coordinates?p.type:(a=p==null?void 0:p.geometry)==null?void 0:a.type,positions:(p==null?void 0:p.coordinates)||((s=p==null?void 0:p.geometry)==null?void 0:s.coordinates)}}else if(typeof n=="number")return{type:(l=r[n])!=null&&l.coordinates?r[n].type:(A=(u=r[n])==null?void 0:u.geometry)==null?void 0:A.type,positions:((h=r[n])==null?void 0:h.coordinates)||((d=(f=r[n])==null?void 0:f.geometry)==null?void 0:d.coordinates)}}}async _calculateFeatureHeight(n,e,i){const o=[...n];return e=="NONE"?o[2]=o[2]??0:e=="CLAMP_TO_GROUND"||!o[2]?o[2]=await i.getTerrainHeight(o)??0:o[2]+=await i.getTerrainHeight(o)??0,o}};L(Ju,"type",Ju.register("ESCesiumViewer",c.ESGeoJson.type,Ju));let lg=Ju;const ec=class ec extends on{constructor(e,i){super(e,i);L(this,"_czmGeoESRectangle");L(this,"_geoPolyline");if(this._geoPolyline=this.disposeVar(new Ye(i,e.id)),this._czmGeoESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoESRectangle,a=this._geoPolyline;a.arcType="RHUMB",this.dispose(c.track([a,"color"],[e,"strokeColor"])),this.dispose(c.track([a,"width"],[e,"strokeWidth"])),this.dispose(c.track([a,"ground"],[e,"strokeGround"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{const s=()=>{a.show=e.show&&e.stroked,r.show=e.show&&e.filled};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material=void 0};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}{const s=()=>{const l=e.points;if(l&&l.length>=2){const{minPos:u,maxPos:A}=c.getMinMaxCorner(l);r.rectangle=[u[0],u[1],A[0],A[1]],r.height=l[0][2],r.extrudedHeight=l[0][2];const h=l.map(g=>(l&&(g[2]=l[0][2]),g)),f=h[0],d=h[1],p=[f,[f[0],d[1],f[2]],d,[d[0],f[1],d[2]]];a.positions=[...p,f]}else r.rectangle=void 0,a.positions=void 0,r.height=0,r.extrudedHeight=0};s(),this.dispose(e.pointsChanged.disposableOn(()=>s()))}}get czmGeoESRectangle(){return this._czmGeoESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmGeoESRectangle:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(ec,"type",ec.register("ESCesiumViewer",c.ESGeoRectangle.type,ec));let ug=ec;class Zl extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolygon");this._geoPolygon=this.disposeVar(new zr(e,i));const{geoPolygon:o}=this;this.dispose(c.bind([o,"allowPicking"],[this,"allowPicking"])),this.dispose(this.flyToEvent.disposableOn(a=>{o.flyTo(a)})),this.dispose(c.bind([o,"show"],[this,"show"])),this.dispose(c.bind([o,"fill"],[this,"filled"])),this.dispose(c.bind([o,"strokeGround"],[this,"strokeGround"])),this.dispose(c.bind([o,"ground"],[this,"ground"])),this.dispose(c.bind([o,"outline"],[this,"outline"])),this.dispose(c.bind([o,"outlineColor"],[this,"outlineColor"])),this.dispose(c.bind([o,"outlineWidth"],[this,"outlineWidth"])),this.dispose(c.bind([o,"color"],[this,"color"])),this.dispose(c.bind([o,"depth"],[this,"depth"]));const r=()=>{if(this.positions&&this.positions.length>=2){const a=Tp([...this.positions,this.positions[0]]);o.positions=a}else o.positions=void 0};r(),this.dispose(this.positionsChanged.disposableOn(r))}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:c.reactArray([1,1,1,1]),outlineWidth:1,color:c.reactArrayWithUndefined([1,1,1,.5]),positions:c.reactPositions(void 0),depth:0})})(Zl||(Zl={})),c.extendClassProps(Zl.prototype,Zl.createDefaultProps);const tc=class tc extends on{constructor(e,i){super(e,i);L(this,"_geoSmoothPolygon");if(this._geoSmoothPolygon=this.disposeVar(new Zl(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoSmoothPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"ground"],[e,"ground"]));{const a=()=>{r.ground=e.ground||e.fillGround};a();const s=this.dv(c.createNextAnimateFrameEvent(e.groundChanged,e.fillGroundChanged));this.d(s.don(a))}{const a=()=>{r.color=e.filled?e.fillColor:Kl.defaults.fillStyle.color};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}this.dispose(c.track([r,"depth"],[e,"depth"]))}get geoSmoothPolygon(){return this._geoSmoothPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoSmoothPolygon:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(tc,"type",tc.register("ESCesiumViewer",Kl.type,tc));let cg=tc;const nc=class nc extends He{constructor(e,i){super(e,i);L(this,"_czmModel");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModel=this.dv(new Ht(i,e.id));const r=this._czmModel;this.d(r.readyEvent.don(s=>{r.gltf.animations&&(r.activeAnimationsJson=r.gltf.animations.map((l,u)=>({index:u,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),e.czmModelReadyEvent.emit(s),e.readyEvent.emit(s)})),this.ad(new Bh(o,this._czmModel)),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"color"],[e,"czmColor"])),this.d(c.track([r,"nativeMaximumScale"],[e,"czmMaximumScale"])),this.d(c.track([r,"nativeMinimumPixelSize"],[e,"czmMinimumPixelSize"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.track([r,"nativeScale"],[e,"czmNativeScale"])),this.d(c.track([r,"scale"],[e,"scale"])),this.ad(c.track([r,"imageBasedLightingFactor"],[e,"czmImageBasedLightingFactor"])),this.d(c.track([r,"environmentMapManager"],[e,"czmEnvironmentMapManager"]));{const s=l=>{e.czmEnvironmentMapManager=e.czmEnvironmentMapManager?{...e.czmEnvironmentMapManager,atmosphereScatteringIntensity:l}:{atmosphereScatteringIntensity:l}};s(e.czmAtmosphereScatteringIntensity),this.ad(e.czmAtmosphereScatteringIntensityChanged.don(l=>s(l)))}{const s=()=>{var l,u;(l=e.czmEnvironmentMapManager)!=null&&l.atmosphereScatteringIntensity&&(e.czmAtmosphereScatteringIntensity=(u=e.czmEnvironmentMapManager)==null?void 0:u.atmosphereScatteringIntensity)};s(),this.ad(e.czmEnvironmentMapManagerChanged.don(s))}{const s=()=>{const l=[...e.rotation??[0,0,0]];l[0]+=e.instances&&e.instances.length!=0?0:90,r.rotation=l};s(),this.d(e.rotationChanged.don(s));{const l=()=>{if(s(),!e.instances){r.instances=e.instances;return}r.instances=e.instances.map(u=>{const A=JSON.parse(JSON.stringify(u));return!A.rotation&&(A.rotation=[0,0,0]),A.rotation[0]+=90,A})};l(),this.ad(e.instancesChanged.don(l))}}this.ad(e.setMaterialEvent.don(s=>{r.setMaterial(s)}));{const s=()=>{const l=[...r.rotation];l[0]-=e.instances&&e.instances.length!=0?0:90,e.rotation=l};s(),this.d(r.rotationChanged.don(s))}{const s=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),l=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};l(),this.d(s.don(l))}const a=()=>{r.url=c.ESSceneObject.context.getStrFromEnv(Th(typeof e.url=="string"?e.url:e.url.url))};a(),this.d(e.urlChanged.don(a)),this.d(e.setNodePositionEvent.don((s,l)=>{r.setNodeTranslation(s,l)})),this.d(e.setNodeRotationEvent.don((s,l)=>{r.setNodeRotation(s,l)})),this.d(e.setNodeScaleEvent.don((s,l)=>{r.setNodeScale(s,l)})),this.d(e.printDebugInfoEvent.don(()=>{r.printDebugInfo()}))}get model(){return this._czmModel}flyTo(e,i){const{sceneObject:o,czmViewer:r,model:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a):!1}};L(nc,"type",nc.register("ESCesiumViewer",c.ESGltfModel.type,nc));let hg=nc;function Vx(t,n){const e=t[0]-n[0],i=t[1]-n[1],o=t[2]-n[2];return Math.sqrt(e*e+i*i+o*o)}class $l extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_distance",this.disposeVar(c.react(0)));L(this,"_surfaceDistance",this.disposeVar(c.react(0)));L(this,"_height",this.disposeVar(c.react(0)));L(this,"_middlePosition",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_heightPosition",this.disposeVar(c.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 a=this._surfaceDistance.value=c.geoDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="RHUMB"){const a=this._surfaceDistance.value=c.geoRhumbDistance(this.positions[0],this.positions[1]),s=this._height.value=this.positions[1][2]-this.positions[0][2];this._distance.value=Math.sqrt(a*a+s*s)}else if(this.arcType==="NONE"){const a=c.lbhToXyz(this.positions[0]),s=c.lbhToXyz(this.positions[1]);this._distance.value=Vx(a,s),this._surfaceDistance.value=Vx(c.lbhToXyz(this._middlePosition.value),s),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 r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.arcTypeChanged));this.dispose(r.disposableOn(o));{const a=this.disposeVar(new Ye(e,i));a.ground=!1,a.loop=!1,this.dispose(c.track([a,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([a,"arcType"],[this,"arcType"])),this.dispose(c.bind([a,"color"],[this,"color"])),this.dispose(c.bind([a,"dashLength"],[this,"dashLength"])),this.dispose(c.bind([a,"dashPattern"],[this,"dashPattern"])),this.dispose(c.bind([a,"gapColor"],[this,"gapColor"])),this.dispose(c.bind([a,"hasArrow"],[this,"hasArrow"])),this.dispose(c.bind([a,"hasDash"],[this,"hasDash"])),this.dispose(c.bind([a,"show"],[this,"show"])),this.dispose(c.bind([a,"width"],[this,"width"])),this.dispose(c.bind([a,"depthTest"],[this,"depthTest"]));{a.loop=!0;const l=()=>{if(this.positions&&this.positions.length===2){const[u,A]=this.positions;a.positions=[u,A,[u[0],u[1],A[2]]]}else a.positions=void 0};l(),this.dispose(this.positionsChanged.disposableOn(l))}this.dispose(this.flyToEvent.disposableOn(l=>{e.actived&&a.flyTo(l)}));const s=this.disposeVar(new wt(e,i));this.dispose(c.track([s,"shadowDom"],[this,"shadowDom"])),this.dispose(c.track([s,"cssAllInitial"],[this,"cssAllInitial"])),this.dispose(c.track([s,"show"],[this,"show"]));{const l=()=>{s.position=this.heightPosition};l(),this.dispose(this.heightPositionChanged.disposableOn(l))}{const l=()=>{s.innerHTML=xo(`高度: ${Ih(this.height)}`,0)};l(),this.dispose(this.heightChanged.disposableOn(l))}this.ad(s.pickedEvent.don(l=>{Gi(l)===0&&this.pickedEvent.emit(l)}))}}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:c.reactPositions(void 0),width:1,color:c.reactArray([1,1,1,1]),hasDash:!1,gapColor:c.reactArrayWithUndefined([0,0,0,0]),dashLength:16,dashPattern:255,hasArrow:!1,arcType:"GEODESIC",depthTest:!1,shadowDom:!1,cssAllInitial:!1})})($l||($l={})),c.extendClassProps($l.prototype,$l.createDefaultProps);const ic=class ic extends on{constructor(e,i){super(e,i);L(this,"_geoHeightMeasurement");if(this._geoHeightMeasurement=this.disposeVar(new $l(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmHeightMeasurement:r}=this;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"]));{const a=()=>{if(e.stroked)r.width=e.strokeWidth;else{r.width=0;return}r.width=e.strokeWidth,r.color=e.strokeColor;const u=e.strokeMaterial??"normal";u==="hasDash"?(r.hasDash=!0,r.hasArrow=!1):u==="hasArrow"?(r.hasDash=!1,r.hasArrow=!0):(r.hasDash=!1,r.hasArrow=!1);const A=e.strokeStyle;if(A.material==="hasDash"&&A.materialParams)try{const h=A.materialParams;Reflect.has(h,"gapColor")&&(r.gapColor=h.gapColor??[0,0,0,0]),Reflect.has(h,"dashLength")&&(r.dashLength=h.dashLength),Reflect.has(h,"dashPattern")&&(r.dashPattern=h.dashPattern)}catch(h){console.error(h)}else r.gapColor=[0,0,0,0],r.dashLength=0,r.dashPattern=0};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.dispose(s.disposableOn(a))}this.dispose(r.pickedEvent.disposableOn(a=>{Gi(a)===0&&(e.allowPicking??!1)&&e.pickedEvent.emit(a)}))}get czmHeightMeasurement(){return this._geoHeightMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmHeightMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(ic,"type",ic.register("ESCesiumViewer",c.ESHeightMeasurement.type,ic));let Ag=ic;const fg={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"}]},rc=class rc extends He{constructor(e,i){super(e,i);L(this,"_czmModelPrimitive");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmModelPrimitive=this.disposeVar(new Ht(i,this.sceneObject.id));const r=this._czmModelPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"])),this.d(r.readyEvent.don(g=>{e.readyEvent.emit(g)}));{const g=this.dv(c.createNextAnimateFrameEvent(e.allowPickingChanged,e.editingChanged)),v=()=>{e.allowPicking&&!e.editing?r.allowPicking=!0:r.allowPicking=!1};v(),this.d(g.don(v))}const a=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/worker.glb"),s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/police.glb"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/pedestrian.glb"),u=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/Stranger.glb"),A=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsMan.glb"),h=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/glb/human/SuitsWoman.glb"),f=()=>{switch(e.mode){case"worker":r.url=a;break;case"police":r.url=s;break;case"pedestrian":r.url=l;break;case"stranger":r.url=u;break;case"suitMan":r.url=A;break;case"suitWoman":r.url=h;break;default:r.url=a;break}};this.dispose(e.modeChanged.disposableOn(()=>{f()})),f();const d=()=>{const g=e.animation??c.ESHuman.defaults.animation;if(!e.show){r.activeAnimationsJson=void 0;return}g==="walking"?r.activeAnimationsJson=fg.czmAnimationsWalk:g==="standing"?r.activeAnimationsJson=fg.czmAnimationsStand:g==="running"&&(r.activeAnimationsJson=fg.czmAnimationsRun)};d();const p=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.animationChanged));this.dispose(p.disposableOn(()=>d())),this.ad(new Bh(o,r))}get czmModelPrimitive(){return this._czmModelPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmModelPrimitive:a}=this;return!r.actived||!r.viewer?!1:o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):(a&&wn(r,o,i,e,a,!0),!!a)}};L(rc,"type",rc.register("ESCesiumViewer",c.ESHuman.type,rc));let pg=rc;class Nx extends c.Destroyable{constructor(e,i){super();L(this,"_czmGeoCanvasImagePoi");L(this,"flyTo",(e,i)=>{if(this.czmGeoCanvasImagePoi.position){Fe(this.czmViewer.viewer,this.czmGeoCanvasImagePoi.position,1e3,Hn,e);return}this.czmGeoCanvasImagePoi.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoCanvasImagePoi=this.disposeVar(new yi(i));const o=this._czmGeoCanvasImagePoi;o.pickOnClick=!0,this.d(o.pickedEvent.don(r=>{(e.allowPicking??!1)&&e.pickedEvent.emit(r)}));{const r=A=>{let h=A;return A.includes("inner://")&&(h="${earthsdk3-assets-script-dir}/assets/img/points/"+A.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(h))},a=()=>{const A=r(typeof e.url=="string"?e.url:e.url.url);if(o.imageUri=A,e.sizeByContent){const f=new Image;f.src=A,f.onload=()=>{o.size=[f.width,f.height]}}else{const f=e.size;o.size=[...f]}},s=this.disposeVar(c.createNextAnimateFrameEvent(e.urlChanged,e.sizeByContentChanged,e.sizeChanged));this.dispose(s.disposableOn(()=>a())),a(),this.d(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.ad(c.bind([o,"isHoverZoom"],[e,"isHoverZoom"]));{const A=()=>{o.scale=[e.scale[1],e.scale[2]]};A(),this.dispose(e.scaleChanged.don(A))}const l=()=>{const A=e.anchor,h=e.offset;A?o.originRatioAndOffset=[...A,-h[0],-h[1]]:o.originRatioAndOffset=[0,0,0,0]},u=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(u.disposableOn(()=>l())),l(),this.dispose(o.clickEvent.disposableOn(A=>{const{offsetX:h,offsetY:f}=A,p={type:A.button===0?"leftClick":A.button===2?"rightClick":void 0,add:{mousePos:[h,f]}};e.widgetEvent.emit(p)})),this.dispose(o.hoveredChanged.disposableOn(A=>{if(A===void 0)return;const h={type:A?"mouseEnter":"mouseLeave"};e.widgetEvent.emit(h)}))}}get czmGeoCanvasImagePoi(){return this._czmGeoCanvasImagePoi}}class Hx extends c.Destroyable{constructor(e,i,o){super();L(this,"_czmGeoImageModel");L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmGeoImageModel.position)return Gn(this.czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmGeoImageModel.size),e,!0);this.czmGeoImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this.czmViewer=i,this._czmGeoImageModel=this.disposeVar(new $i(i,e.id));const r=this._czmGeoImageModel;this.ad(i.clickEvent.don(f=>{const d=f==null?void 0:f.pointerEvent;d&&(this._isPointEvent=!0,this._eventInfo={type:d.button==0?"leftClick":d.button==2?"rightClick":"leftClick",add:{mousePos:[d.offsetX,d.offsetY]}})})),this.d(e.pickedEvent.don(f=>{var d,p,g;f.screenPosition&&this._isPointEvent&&f.attachedInfo!="innerHoverEvent"&&((d=this._eventInfo.add)!=null&&d.mousePos)&&Math.abs(f.screenPosition[0]-((p=this._eventInfo.add)==null?void 0:p.mousePos[0]))<1&&Math.abs(f.screenPosition[1]-((g=this._eventInfo.add)==null?void 0:g.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const f=i.getEngineObject(e);this.ad(f.lastHoverResultChanged.don((d,p)=>{(d==null?void 0:d.sceneObject)==(p==null?void 0:p.sceneObject)||(d==null?void 0:d.sceneObject)!=e&&(p==null?void 0:p.sceneObject)!=e||(d!=null&&d.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:d==null?void 0:d.screenPosition}},d.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&d.sceneObject.id==e.id&&(r.scale=[r.scale[0]*1.5,r.scale[1]*1.5])),p!=null&&p.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:d==null?void 0:d.screenPosition}},p.sceneObject.widgetEvent.emit(this._eventInfo),e.isHoverZoom&&p.sceneObject.id==e.id&&(r.scale=[r.scale[0]/1.5,r.scale[1]/1.5])))}))});const a=e.sizeByContent,l=(f=>{let d=f;return f.includes("inner://")&&(d="${earthsdk3-assets-script-dir}/assets/img/points/"+f.split("inner://")[1]),c.ESSceneObject.context.getStrFromEnv(Th(d))})(typeof o.sceneObject.url=="string"?o.sceneObject.url:o.sceneObject.url.url),u=new Image;u.src=l,u.onload=()=>{if(a)r.size=[u.width/100,u.height/100];else{const f=e.size;r.size=[f[0]/100,f[1]/100]}},r.uri=l,this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),r.pixelSize=void 0,r.useAxis="XZ";{const f=()=>{r.scale=[e.scale[1],e.scale[2]]};f(),this.d(e.scaleChanged.don(f))}{const f=()=>{e.rotationType===0&&(r.rotationMode="WithProp",this.d(Mt([r,"rotation"],[e,"rotation"]))),e.rotationType===1&&(r.rotationMode="WithCamera"),e.rotationType===2&&(r.rotationMode="WithCameraOnlyZ")};f(),this.dispose(e.rotationTypeChanged.disposableOn(f))}const A=()=>{const f=e.anchor,d=e.offset;f?r.originRatioAndOffset=[...f,-d[0]/100,-d[1]/100]:r.originRatioAndOffset=[0,0,0,0]},h=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(h.disposableOn(()=>A())),A()}get czmGeoImageModel(){return this._czmGeoImageModel}}const oc=class oc extends Gl{constructor(e,i){super(e,i);L(this,"_resetting");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.urlChanged,this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged));this._resetting=this.disposeVar(new c.ObjResettingWithEvent(r,()=>this.sceneObject.screenRender?new Nx(this.sceneObject,this.czmViewer):new Hx(this.sceneObject,this.czmViewer,this)))}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(oc,"type",oc.register("ESCesiumViewer",c.ESImageLabel.type,oc));let dg=oc;function mO(t){switch(t){case"wms":return"WebMapServiceImageryProvider";case"tms":return"TileMapServiceImageryProvider";case"wmts":return"WebMapTileServiceImageryProvider";case"xyz":return"UrlTemplateImageryProvider";case"ion":return"IonImageryProvider"}}const sc=class sc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;{const a=this.ad(c.reactJson(""));{const u=()=>{if(typeof e.url=="string")a.value=c.ESSceneObject.context.getStrFromEnv(e.url);else{const A=e.url;A.url=c.ESSceneObject.context.getStrFromEnv(A.url),a.value=A}};u(),this.ad(e.urlChanged.don(u))}const s=()=>{var p;if(!a.value)return;const u=(((p=e.options)==null?void 0:p.type)??"auto").toLowerCase(),A=e.options??{};let h={type:"UrlTemplateImageryProvider",url:a.value,rectangle:e.rectangle,maximumLevel:e.maximumLevel,minimumLevel:e.minimumLevel,...A},f=a.value,d=typeof f=="string"?f:f.url;if(u==="auto"){const g=d.toLowerCase();if(g.startsWith("ion://")){const y=+g.substring(6);h={...A,assetId:y,type:"IonImageryProvider"}}else if(g.includes("{x}")||g.includes("{y}")||g.includes("{z}"))h.type="UrlTemplateImageryProvider";else if(g.includes("wmts"))h.type="WebMapTileServiceImageryProvider";else if(g.includes("wms"))h.type="WebMapServiceImageryProvider";else{if(d.includes("/tilemapresource.xml")){const v=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=v:f.url=v,h.url=f}h.type="TileMapServiceImageryProvider"}}else{if(u==="tms"&&d.includes("/tilemapresource.xml")){const g=d.split("/tilemapresource.xml").join("");typeof f=="string"?f=g:f.url=g,h.url=f}else if(u==="ion"&&d.startsWith("ion://")){const v=+d.substring(6);h={...A,assetId:v,type:"IonImageryProvider"}}h.type=mO(u)}console.log("imageryProvider",h),r.imageryProvider=h};s();const l=this.dv(c.createNextAnimateFrameEvent(a.changed,e.maximumLevelChanged,e.minimumLevelChanged,e.optionsChanged,e.rectangleChanged));this.d(l.don(s))}this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"alpha"],[e,"opacity"])),this.d(c.bind([r,"alpha"],[e,"czmAlpha"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.ad(c.track([r,"targetID"],[e,"targetID"]))}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(sc,"type",sc.register("ESCesiumViewer",c.ESImageryLayer.type,sc));let mg=sc;class gO extends c.Destroyable{constructor(e,i,o,r){super();L(this,"_show");L(this,"_czmESCustomPrimitive");L(this,"_czmTexture");this._sceneObject=e,this._show=this.disposeVar(c.react(this._sceneObject.show)),this._czmESCustomPrimitive=this.dv(new at(i,this._sceneObject.id)),this._czmTexture=this.dv(new ht(i));const a=e,s=this._czmESCustomPrimitive,l=this._czmTexture;this.dispose(c.track([s,"show"],[this,"show"])),this.dispose(c.track([s,"show"],[a,"show"])),this.dispose(c.track([s,"allowPicking"],[a,"allowPicking"])),this.dispose(c.track([s,"rotation"],[a,"rotation"])),this.dispose(c.track([s,"position"],[a,"position"])),this.dispose(c.track([s,"scale"],[a,"scale"])),this.ad(a.allowPickingChanged.don(()=>{s.allowPicking=a.allowPicking,s.pass=a.allowPicking?"TRANSLUCENT":"OVERLAY"}));{const u=()=>{const h=a.size/2,f=r[0].map(S=>S*h),d=r[1].map(S=>S*h),p=r[2].map(S=>S*h),g=r[3].map(S=>S*h),v=[...f,...d,...p,...g];let y=[0,3,2,0,2,1];(o=="north"||o=="west"||o=="bottom")&&(y=y.reverse());const m=[0,0],b=[1,0],x=[1,1],E=[0,1];let B=[];o=="east"||o=="south"?B=[...b,...m,...E,...x]:o=="west"?B=[...b,...x,...E,...m]:o=="top"?B=[...E,...x,...b,...m]:B=[...m,...b,...x,...E],s.indexTypedArray=new Uint16Array(y),s.attributes={position:{typedArray:new Float32Array(v),componentsPerAttribute:3},st:{typedArray:new Float32Array(B),componentsPerAttribute:2}},l.uri=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/img/skybox/${a.mode}/${o}.${a.mode!="blueSky"?"png":"jpg"}`);const P=i.getCameraInfo();if(P!=null){const T=c.getDistancesFromPositions([a.position,P.position],"NONE")[0]/(a.size/2*a.autoOpacityFactor);this.changeOpacity(a.autoFollow?1:T)}const I=s.computeLocalAxisedBoundingBoxFromAttribute("position");if(!I)return;const{min:M,max:F}=I;s.setLocalAxisedBoundingBox(M,F)};u();const A=this.disposeVar(c.createNextAnimateFrameEvent(a.sizeChanged,a.modeChanged));this.dispose(A.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 yO extends c.Destroyable{constructor(n,e,i){if(super(),!e.viewer)return;let o=!0,r;this.dispose(e.viewer.scene.preUpdate.addEventListener(()=>{a()}));function a(){var l;if(!((l=e.viewer)!=null&&l.camera))return;const s=e.getCameraInfo();if(s!=null&&(r==null||r.position[0]!=s.position[0]||r.position[1]!=s.position[1]||r.position[2]!=s.position[2]||r.rotation[0]!=s.rotation[0]||r.rotation[1]!=s.rotation[1]||r.rotation[2]!=s.rotation[2])){r=s;const A=c.getDistancesFromPositions([n.position,r.position],"NONE")[0]/(n.size/2*n.autoOpacityFactor);n.autoFollow?(n.position=r.position,o&&(o=!1,i.forEach(h=>{h.changeOpacity(1)}))):i.forEach(h=>{h.changeOpacity(A)})}}a()}}const Pt=class Pt extends He{constructor(e,i){super(e,i);L(this,"_czmSkyBoxComponents",[]);if(!i.viewer){console.warn("viewer is undefined!");return}!Pt._defaultLocalBox&&Pt._firstLoad&&(Pt._firstLoad=!1,Pt._defaultLocalBox=i.xbsjLocalBoxSources),Pt._eSLocalSkyBoxArr.push(e),this.d(()=>{Pt._eSLocalSkyBoxArr.includes(e)&&Pt._eSLocalSkyBoxArr.splice(Pt._eSLocalSkyBoxArr.indexOf(e),1),this.ChangeAutoFollow()});const r={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 a in r)if(Object.prototype.hasOwnProperty.call(r,a)){const s=r[a];this._czmSkyBoxComponents.push(this.dv(new gO(e,i,a,s)))}{const a=this.disposeVar(c.createNextAnimateFrameEvent(e.autoFollowChanged,e.autoOpacityFactorChanged));this.disposeVar(new c.ObjResettingWithEvent(a,()=>(this.ChangeAutoFollow(),new yO(e,i,this._czmSkyBoxComponents))))}{const a=()=>{this.ChangeAutoFollow()},s=this.disposeVar(c.createNextAnimateFrameEvent(e.sizeChanged,e.modeChanged,e.showChanged));this.dispose(s.disposableOn(a))}}ChangeAutoFollow(){const{czmViewer:e}=this;for(let i=Pt._eSLocalSkyBoxArr.length-1;i>=0;i--){const o=Pt._eSLocalSkyBoxArr[i];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}i==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}Pt._eSLocalSkyBoxArr.length==0&&(e.xbsjLocalBoxSources=Pt._defaultLocalBox)}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.size??c.ESLocalSkyBox.defaults.size;return o.position?(Gn(r,o,i,o.position,a,e,!0),!0):!1}}};L(Pt,"type",Pt.register("ESCesiumViewer",c.ESLocalSkyBox.type,Pt)),L(Pt,"_defaultLocalBox"),L(Pt,"_firstLoad",!0),L(Pt,"_eSLocalSkyBoxArr",[]);let gg=Pt;const ni=class ni extends He{constructor(e,i){super(e,i);L(this,"_geoCustomDivPoi");L(this,"_textFunc",this.disposeVar(c.react(void 0)));if(this._geoCustomDivPoi=this.disposeVar(new wt(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.geoCustomDivPoi;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]));{this.dispose(r.pickedEvent.disposableOn(a=>{(e.allowPicking??c.ESLocationMeasurement.defaults.allowPicking)&&e.pickedEvent.emit(a)})),this.dispose(r.innerHtmlMounted.disposableOn(a=>{const s=a.firstElementChild;s&&(s.style.pointerEvents="auto",s.style.cursor="default",s.onclick=l=>r.pickFromDiv(s,{type:"viewerPicking",pointerEvent:l}))}));{const a=()=>{if(!e.position)return;const l=(this.textFunc??ni.defaultTextFunc_度格式)(e.position);r.innerHTML=xo(l)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,this.textFuncChanged));this.dispose(s.disposableOn(a))}{const a=()=>{i.lonLatFormat??(i.lonLatFormat="DECIMAL_DEGREE"),this.textFunc=i.lonLatFormat=="DECIMAL_DEGREE"?ni.defaultTextFunc_度格式:i.lonLatFormat=="DEGREES_DECIMAL_MINUTES"?ni.defaultTextFunc_度分格式:ni.defaultTextFunc_度分秒格式};a(),this.d(i.lonLatFormatChanged.don(()=>{a()}))}}}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,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoCustomDivPoi:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(ni,"type",ni.register("ESCesiumViewer",c.ESLocationMeasurement.type,ni)),L(ni,"defaultTextFunc_度格式",e=>{if(!e)return"";const[i=0,o=0,r=0]=e;return`经度: ${i.toFixed(5)}°
3105
3105
  纬度: ${o.toFixed(5)}°
3106
3106
  高度: ${r.toFixed(2)}m`}),L(ni,"defaultTextFunc_度分格式",e=>{if(!e)return"";const[i,o,r]=Ep(e,!0);return`经度: ${i}
3107
3107
  纬度: ${o}
3108
3108
  高度: ${r}`}),L(ni,"defaultTextFunc_度分秒格式",e=>{if(!e)return"";const[i,o,r]=Ep(e);return`经度: ${i}
3109
3109
  纬度: ${o}
3110
- 高度: ${r}`});let yg=ni;const ac=class ac extends He{constructor(e,i){super(e,i);L(this,"_czmESParticleSystemPrimitive");if(this._czmESParticleSystemPrimitive=this.disposeVar(new wi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESParticleSystemPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"updateCallback"],[e,"updateCallback"])),this.dispose(c.track([r,"emissionRate"],[e,"emissionRate"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"scale"],[e,"particleScale"])),this.dispose(c.track([r,"startScale"],[e,"startScale"])),this.dispose(c.track([r,"endScale"],[e,"endScale"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.track([r,"startColor"],[e,"startColor"])),this.dispose(c.track([r,"endColor"],[e,"endColor"])),this.dispose(c.track([r,"sizeInMeters"],[e,"sizeInMeters"])),this.dispose(c.track([r,"speed"],[e,"speed"])),this.dispose(c.track([r,"minimumSpeed"],[e,"minimumSpeed"])),this.dispose(c.track([r,"maximumSpeed"],[e,"maximumSpeed"])),this.dispose(c.track([r,"lifetime"],[e,"lifetime"])),this.dispose(c.track([r,"particleLife"],[e,"particleLife"])),this.dispose(c.track([r,"minimumParticleLife"],[e,"minimumParticleLife"])),this.dispose(c.track([r,"maximumParticleLife"],[e,"maximumParticleLife"])),this.dispose(c.track([r,"mass"],[e,"mass"])),this.dispose(c.track([r,"minimumMass"],[e,"minimumMass"])),this.dispose(c.track([r,"maximumMass"],[e,"maximumMass"])),this.dispose(c.track([r,"imageSize"],[e,"imageSize"])),this.dispose(c.track([r,"minimumImageSize"],[e,"minimumImageSize"])),this.dispose(c.track([r,"maximumImageSize"],[e,"maximumImageSize"])),this.dispose(c.track([r,"image"],[e,"image"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"translation"],[e,"translation"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"bursts"],[e,"bursts"])),this.dispose(c.track([r,"emitter"],[e,"emitter"])),this.dispose(c.track([r,"ratio"],[e,"ratio"])),this.dispose(c.track([r,"playingLoop"],[e,"playingLoop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"playingSpeed"],[e,"playingSpeed"]))}get czmESParticleSystemPrimitive(){return this._czmESParticleSystemPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESParticleSystemPrimitive:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Hn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(ac,"type",ac.register("ESCesiumViewer",c.ESParticleSystemPrimitive.type,ac));let vg=ac;async function yO(t){const n=["Flag01","Flag02","Linear02","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"],e=["CircularV05","Diamond01"],i=["Flag01","Flag02","Linear02","Linear03","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"];let o=[];const r="${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/",a=n.includes(t)?void 0:await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/icon.png`)),s=e.includes(t)?void 0:await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/anchor.png`));for(let A=1;A<=(EO[t]??3);A++)o.push(await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/textBox_0${A}.png`)));const l=i.includes(t)?void 0:await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/iconBox.png`)),u=o.filter(A=>A!=null);return{icon:a,anchor:s,iconBox:l,textBox:u}}function vO(t,n,e,i,o,r){var p,g,v;const a={iconBox:i,icon:o,anchor:r},s=document.createElement("div");s.classList.add("czmPoi2dDiv"),["SquareH","CircularH","Flag","Linear01"].some(y=>t.includes(y))?s.innerHTML=xO(t,a,n):s.innerHTML=_O(t,a,n);const{textDiv:u,height:A}=CO(e);let h;t=="Linear03"&&o&&(h=document.createElement("img"),h.classList.add(`${t}-icon`),h.src=o.url,h.style.width=`${o.width}px`,h.style.height=`${o.height}px`,h.style.position="absolute",h.style.top="2px");const f=s.querySelector(".textDiv");if(f&&f.nextElementSibling){const y=(p=f.nextElementSibling.lastElementChild)==null?void 0:p.getAttribute("style");h?(f.nextElementSibling.insertAdjacentElement("afterbegin",h),(g=f.nextElementSibling.lastElementChild)==null||g.setAttribute("style",y+`;margin-left: ${o==null?void 0:o.width}px;`)):["Stranger","Man","Woman"].some(m=>t.includes(m))&&((v=f.nextElementSibling.lastElementChild)==null||v.setAttribute("style",y+";margin-left: 50px;"))}f&&(f.innerHTML=u);const{poi2DCssObj:d}=wO(t,r,i,A);return{div:s,styleObj:d}}function wO(t,n,e,i){const o=bO(t,n,e),r={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:(n==null?void 0:n.height)??0):0}px !important;
3110
+ 高度: ${r}`});let yg=ni;const ac=class ac extends He{constructor(e,i){super(e,i);L(this,"_czmESParticleSystemPrimitive");if(this._czmESParticleSystemPrimitive=this.disposeVar(new wi(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESParticleSystemPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"updateCallback"],[e,"updateCallback"])),this.dispose(c.track([r,"emissionRate"],[e,"emissionRate"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"scale"],[e,"particleScale"])),this.dispose(c.track([r,"startScale"],[e,"startScale"])),this.dispose(c.track([r,"endScale"],[e,"endScale"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.track([r,"startColor"],[e,"startColor"])),this.dispose(c.track([r,"endColor"],[e,"endColor"])),this.dispose(c.track([r,"sizeInMeters"],[e,"sizeInMeters"])),this.dispose(c.track([r,"speed"],[e,"speed"])),this.dispose(c.track([r,"minimumSpeed"],[e,"minimumSpeed"])),this.dispose(c.track([r,"maximumSpeed"],[e,"maximumSpeed"])),this.dispose(c.track([r,"lifetime"],[e,"lifetime"])),this.dispose(c.track([r,"particleLife"],[e,"particleLife"])),this.dispose(c.track([r,"minimumParticleLife"],[e,"minimumParticleLife"])),this.dispose(c.track([r,"maximumParticleLife"],[e,"maximumParticleLife"])),this.dispose(c.track([r,"mass"],[e,"mass"])),this.dispose(c.track([r,"minimumMass"],[e,"minimumMass"])),this.dispose(c.track([r,"maximumMass"],[e,"maximumMass"])),this.dispose(c.track([r,"imageSize"],[e,"imageSize"])),this.dispose(c.track([r,"minimumImageSize"],[e,"minimumImageSize"])),this.dispose(c.track([r,"maximumImageSize"],[e,"maximumImageSize"])),this.dispose(c.track([r,"image"],[e,"image"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"translation"],[e,"translation"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"bursts"],[e,"bursts"])),this.dispose(c.track([r,"emitter"],[e,"emitter"])),this.dispose(c.track([r,"ratio"],[e,"ratio"])),this.dispose(c.track([r,"playingLoop"],[e,"playingLoop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"playingSpeed"],[e,"playingSpeed"]))}get czmESParticleSystemPrimitive(){return this._czmESParticleSystemPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESParticleSystemPrimitive:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const s=a.position;return Fe(r.viewer,s,100,Hn,e),o.flyOverEvent.emit(i,"over",r),!0}}};L(ac,"type",ac.register("ESCesiumViewer",c.ESParticleSystemPrimitive.type,ac));let vg=ac;async function vO(t){const n=["Flag01","Flag02","Linear02","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"],e=["CircularV05","Diamond01"],i=["Flag01","Flag02","Linear02","Linear03","ManAbnormal","ManNormal","P3D02","P3D03","P3D04","P3D05","P3D06","P3D07","Stranger","WomanAbnormal","WomanNormal"];let o=[];const r="${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/",a=n.includes(t)?void 0:await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/icon.png`)),s=e.includes(t)?void 0:await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/anchor.png`));for(let A=1;A<=(PO[t]??3);A++)o.push(await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/textBox_0${A}.png`)));const l=i.includes(t)?void 0:await Co(c.ESSceneObject.context.getStrFromEnv(r+`/${t}/iconBox.png`)),u=o.filter(A=>A!=null);return{icon:a,anchor:s,iconBox:l,textBox:u}}function wO(t,n,e,i,o,r){var p,g,v;const a={iconBox:i,icon:o,anchor:r},s=document.createElement("div");s.classList.add("czmPoi2dDiv"),["SquareH","CircularH","Flag","Linear01"].some(y=>t.includes(y))?s.innerHTML=_O(t,a,n):s.innerHTML=CO(t,a,n);const{textDiv:u,height:A}=SO(e);let h;t=="Linear03"&&o&&(h=document.createElement("img"),h.classList.add(`${t}-icon`),h.src=o.url,h.style.width=`${o.width}px`,h.style.height=`${o.height}px`,h.style.position="absolute",h.style.top="2px");const f=s.querySelector(".textDiv");if(f&&f.nextElementSibling){const y=(p=f.nextElementSibling.lastElementChild)==null?void 0:p.getAttribute("style");h?(f.nextElementSibling.insertAdjacentElement("afterbegin",h),(g=f.nextElementSibling.lastElementChild)==null||g.setAttribute("style",y+`;margin-left: ${o==null?void 0:o.width}px;`)):["Stranger","Man","Woman"].some(m=>t.includes(m))&&((v=f.nextElementSibling.lastElementChild)==null||v.setAttribute("style",y+";margin-left: 50px;"))}f&&(f.innerHTML=u);const{poi2DCssObj:d}=bO(t,r,i,A);return{div:s,styleObj:d}}function bO(t,n,e,i){const o=xO(t,n,e),r={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:(n==null?void 0:n.height)??0):0}px !important;
3111
3111
  left: calc(50% - ${((n==null?void 0:n.width)??0)/2}px)!important;`,textBoxTransverseParent:`height:${o}px !important;`,textBoxTransverse:`
3112
3112
  margin-left:${n&&!["Flag02","Linear01","CircularH02","CircularH01"].includes(t)?t.includes("Flag01")?-n.width/2+2:n.height:t=="CircularH01"?15:t=="CircularH02"?-2:2}px !important;
3113
3113
  line-height: ${t=="CircularH01"?i+5:t=="Linear01"?e==null?void 0:e.height:i}px !important;
@@ -3121,7 +3121,7 @@ ${kx}
3121
3121
  .czmPoi2dDiv .${t}-textBoxTransverse {${r.textBoxTransverse}}
3122
3122
  .czmPoi2dDiv .${t}-textBoxVertical {${r.textBoxVertical}}
3123
3123
  .czmPoi2dDiv .${t}-textBoxVertical+div {${r.textBoxVerticalBrother}}
3124
- `,poi2DCssObj:r}}function bO(t,n,e){return e==null?n==null?void 0:n.height:n==null?e.height:e.height+n.height*(["Diamond02","Linear01","Linear02","Linear03"].includes(t)?1:2)}function xO(t,n,e){const{iconBox:i,icon:o,anchor:r}=n;let a="";return i&&o&&(a+=`<img src="${i.url}" class="${t}-iconBox" style="text-align:center !important"/>
3124
+ `,poi2DCssObj:r}}function xO(t,n,e){return e==null?n==null?void 0:n.height:n==null?e.height:e.height+n.height*(["Diamond02","Linear01","Linear02","Linear03"].includes(t)?1:2)}function _O(t,n,e){const{iconBox:i,icon:o,anchor:r}=n;let a="";return i&&o&&(a+=`<img src="${i.url}" class="${t}-iconBox" style="text-align:center !important"/>
3125
3125
  <img src="${o.url}" class="${t}-icon"
3126
3126
  style="{{icon}} position:absolute !important;
3127
3127
  top: ${i.height*.5}px !important;
@@ -3151,7 +3151,7 @@ ${kx}
3151
3151
  </span>
3152
3152
  </div>
3153
3153
  </div>
3154
- </div>`}function _O(t,n,e){const{iconBox:i,icon:o,anchor:r}=n;let a="";return i!=null&&o!=null&&(a+=`<img src="${i.url}" class="${t}-iconBox" style="width:${i.width}px !important;height:${i.height}px !important;text-align:center !important"/>
3154
+ </div>`}function CO(t,n,e){const{iconBox:i,icon:o,anchor:r}=n;let a="";return i!=null&&o!=null&&(a+=`<img src="${i.url}" class="${t}-iconBox" style="width:${i.width}px !important;height:${i.height}px !important;text-align:center !important"/>
3155
3155
  <img class="${t}-icon" src="${o.url}"
3156
3156
  style="{{icon}} width:${o.width}px !important;
3157
3157
  height:${o.height}px !important;
@@ -3181,11 +3181,11 @@ ${kx}
3181
3181
  <div style="{{textBoxVerticalBrother}} position: relative !important;">
3182
3182
  ${a}
3183
3183
  </div>
3184
- </div>`}function CO(t){let n="",e=0,i=0;for(let o=0;o<t.length;o+=2)i+=t[o].width;for(let o=0;o<t.length;o++)t.length==1?n+=`<img src="${t[o].url}" style="{{img}} width: 100% !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`:o%2==1?n+=`<img src="${t[o].url}" style="{{img}}
3184
+ </div>`}function SO(t){let n="",e=0,i=0;for(let o=0;o<t.length;o+=2)i+=t[o].width;for(let o=0;o<t.length;o++)t.length==1?n+=`<img src="${t[o].url}" style="{{img}} width: 100% !important;height: ${t[o].height}px !important;vertical-align: top !important"/>`:o%2==1?n+=`<img src="${t[o].url}" style="{{img}}
3185
3185
  width: calc(${100/Math.floor(t.length/2)}% - ${i/Math.floor(t.length/2)}px) !important;
3186
3186
  height: ${t[o].height}px !important;
3187
3187
  vertical-align: top !important"
3188
- />`:n+=`<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:n,height:e}}function SO(t,n){for(let e in n){const i=new RegExp("\\{\\{"+e+"\\}\\}","g");t=t.replace(i,n[e])}return t}const EO={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},PO=`
3188
+ />`:n+=`<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:n,height:e}}function EO(t,n){for(let e in n){const i=new RegExp("\\{\\{"+e+"\\}\\}","g");t=t.replace(i,n[e])}return t}const PO={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},BO=`
3189
3189
  <div class="{{CustomContainer}}" style="position: relative !important;">
3190
3190
  <div style="position:relative !important; width: {{IMAGE_WIDTH}}; height: {{IMAGE_HEIGHT}};">
3191
3191
  <img src="{{IMAGE_SRC}}" alt="图片icon" class="{{CustomImage}} Custom-anchor" style="position: absolute !important; width: {{IMAGE_WIDTH}}; height: {{IMAGE_HEIGHT}};">
@@ -3197,7 +3197,7 @@ ${kx}
3197
3197
  </div>
3198
3198
  </div>
3199
3199
  </div>
3200
- `,BO=async(t,n)=>{const e=(n==null?void 0:n.fontSize)??c.ESPoi2D.defaults.style.fontSize,i=(n==null?void 0:n.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(n==null?void 0:n.imageSize)??c.ESPoi2D.defaults.style.imageSize,r=(n==null?void 0:n.text)??c.ESPoi2D.defaults.style.text,a=(n==null?void 0:n.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",s=(n==null?void 0:n.textBackgroundColor)??c.ESPoi2D.defaults.style.textBackgroundColor,l=(n==null?void 0:n.textBackgroundSize)??c.ESPoi2D.defaults.style.textBackgroundSize,u=(n==null?void 0:n.textColor)??c.ESPoi2D.defaults.style.textColor,A=(n==null?void 0:n.textOffset)??c.ESPoi2D.defaults.style.textOffset;let h=PO;h=h.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),h=h.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),h=h.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),h=h.replace(/{{FONT_SIZE}}/g,e+"px"),h=h.replace(/{{IMAGE_SRC}}/g,c.ESSceneObject.context.getStrFromEnv(i)),h=h.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),h=h.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),h=h.replace(/{{TEXT}}/g,r),h=h.replace(/{{TEXT_BACKGROUND}}/g,c.ESSceneObject.context.getStrFromEnv(a)),h=h.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${s.map(d=>d*255).join(",")})`),h=h.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,l[0]+"px"),h=h.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,l[1]+"px"),h=h.replace(/{{TEXT_COLOR}}/g,`rgb(${u.map(d=>d*255).join(",")})`),h=h.replace(/{{TEXT_OFFSET_X}}/g,A[0]+"px"),h=h.replace(/{{TEXT_OFFSET_Y}}/g,A[1]+"px");const f=document.createElement("div");return f.innerHTML=h,[f.children[0].children[0],f.children[0].children[1]]},_t=class _t extends Gl{constructor(e,i){super(e,i);L(this,"_widgetComponent");L(this,"_customWidgetComponent");L(this,"_textBox",[]);L(this,"_iconBox");L(this,"_icon");L(this,"_anchor");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.ad(new c.Event),a=this.ad(new c.Event);{let l;const u=this.ad(c.createNextAnimateFrameEvent(e.screenRenderChanged,a));this.customWidgetComponent=this.disposeVar(new c.ObjResettingWithEvent(u,()=>{if(!(!l||e.mode!="Custom"))return e.screenRender?new Pr(e,i,l[1],!0,!1):new BA(e,i,l[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new c.ObjResettingWithEvent(u,()=>{if(l)return e.screenRender?new Pr(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1):new BA(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const A=this.dv(c.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,r));this.ad(A.don(async()=>{var h;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const f=e.style[Object.keys(e.style).filter(g=>g.toUpperCase()=="TEXT")[0]]??e.name,{div:d,styleObj:p}=vO(e.mode,f,this._textBox,this._iconBox,this._icon,this._anchor);l=d,l.innerHTML=SO(l.innerHTML,p)}else{const f=await BO(e.id,{...e.style,text:((h=e.style)==null?void 0:h.text)??e.name});l=[f[0],f[1]]}a.emit()}))}{const l=this.ad(c.createProcessingFromAsyncFunc(async f=>{const d=e.mode;_t.modeCache.value={..._t.modeCache.value,[d]:void 0},await f.promise(yO(d)).then(p=>{_t.modeCache.value={..._t.modeCache.value,[d]:p},this._icon=p.icon,this._anchor=p.anchor,this._iconBox=p.iconBox,this._textBox=p.textBox,r.emit()})}));let u=null,A=null;const h=()=>{var f,d,p,g;if(e.mode=="Custom"){r.emit();return}if(Reflect.has(_t.modeCache.value,e.mode))if(_t.modeCache.value[e.mode])this._icon=(f=_t.modeCache.value[e.mode])==null?void 0:f.icon,this._anchor=(d=_t.modeCache.value[e.mode])==null?void 0:d.anchor,this._iconBox=(p=_t.modeCache.value[e.mode])==null?void 0:p.iconBox,this._textBox=((g=_t.modeCache.value[e.mode])==null?void 0:g.textBox)??[],r.emit();else{if(u)return;u=_t.modeCache.changed.don(()=>{var v,y,m,b;_t.modeCache.value[e.mode]&&(this._icon=(v=_t.modeCache.value[e.mode])==null?void 0:v.icon,this._anchor=(y=_t.modeCache.value[e.mode])==null?void 0:y.anchor,this._iconBox=(m=_t.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((b=_t.modeCache.value[e.mode])==null?void 0:b.textBox)??[],r.emit(),u&&u(),u=null)})}else if(!l.isRunning)l.restart();else{if(A)return;A=l.completeEvent.donce(()=>{A&&A(),A=null,l.restart()})}};h(),this.d(e.modeChanged.don(h))}const s=this.ad(new c.Event);{const l=this.dv(c.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),u=()=>{const A=this.widgetComponent.obj,h=e.autoAnchor?A.defaultAnchor:e.anchor,f=e.offset;if(A instanceof Pr)h?(A.czmGeoCustomDivPoi.originRatioAndOffset=[...h,-f[0],-f[1]],A.widgetInfo.style.transformOrigin=`${h[0]*100}% ${h[1]*100}%`):A.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let d=100,p=100;e.sizeByContent&&A.domSize?(d=A.domSize.width/100,p=A.domSize.height/100):(d=e.size[0]/100,p=e.size[1]/100),h?A.czmCustomPrimitive.localPosition=[h[0]*d-f[0]/100,0,h[1]*p-f[1]/100]:A.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&s.emit()};this.d(l.don(u)),this.ad(new c.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const A=new c.Destroyable;return u(),A.d(this.widgetComponent.obj.defaultAnchorChanged.don(u)),A}))}{const l=this.dv(c.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,s)),u=()=>{var y,m,b;if(e.mode!="Custom")return;const A=this.customWidgetComponent.obj;if(!A)return;const h=((y=e.style)==null?void 0:y.imageSize)??c.ESPoi2D.defaults.style.imageSize,f=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,d=((m=e.style)==null?void 0:m.textBoxAlign)??c.ESPoi2D.defaults.style.textBoxAlign,p=d=="start"?0:d=="center"?.5:1,g=((b=e.style)==null?void 0:b.textBoxOffset)??c.ESPoi2D.defaults.style.textBoxOffset,v=e.offset;if(A instanceof Pr)f?(A.czmGeoCustomDivPoi.originRatioAndOffset=[p,.5,-v[0]-g[0]+h[0]*(f[0]-.5),-v[1]-g[1]+h[1]*(f[1]-.5)],A.widgetInfo.style.transformOrigin=`${p*100}% ${.5*100}%`):A.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let x=100,E=100;e.sizeByContent&&A.domSize?(x=A.domSize.width/100,E=A.domSize.height/100):(x=e.size[0]/100,E=e.size[1]/100),f?A.czmCustomPrimitive.localPosition=[p*x+(-v[0]-g[0]+h[0]*(f[0]-.5))/100,0,.5*E+(-v[1]-g[1]+h[1]*(f[1]-.5))/100]:A.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(l.don(u));{const A=this.ad(c.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new c.ObjResettingWithEvent(A,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const h=new c.Destroyable,f=this.customWidgetComponent.obj,d=()=>{var p,g,v,y;f&&(f instanceof Pr?(((p=e.style)==null?void 0:p.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(m=>{var x,E;const b=(x=_o(m,"pickResult"))==null?void 0:x.pointerEvent;b&&(f.czmGeoCustomDivPoi.show=e.show&&(((E=e.style)==null?void 0:E.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow)&&b.type=="mouseenter")}))):f.czmGeoCustomDivPoi.show=e.show&&(((g=e.style)==null?void 0:g.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow):(((v=e.style)==null?void 0:v.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(m=>{var b;m&&(f.czmCustomPrimitive.show=e.show&&(((b=e.style)==null?void 0:b.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow)&&m.type=="mouseEnter")}))):f.czmCustomPrimitive.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow))};return d(),h.ad(e.styleChanged.don(d)),h}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetComponent:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.obj)a.obj.flyTo(e,i);else{const s=setTimeout(()=>{clearTimeout(s),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}visibleDistance(e,i){var o,r,a,s,l;if((o=i.viewer)!=null&&o.camera&&e.show){const u=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let A=!1;e.minVisibleDistance<e.maxVisibleDistance?A=e.minVisibleDistance<u&&u<e.maxVisibleDistance:e.maxVisibleDistance==0&&(A=u>e.minVisibleDistance);const h=this.widgetComponent.obj,f=this.customWidgetComponent.obj;if(!h)return;h instanceof Pr?(h.czmGeoCustomDivPoi.show=e.show&&A,(((r=e.style)==null?void 0:r.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmGeoCustomDivPoi.show=e.show&&A&&(((a=e.style)==null?void 0:a.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow))):(h.czmCustomPrimitive.show=e.show&&A,(((s=e.style)==null?void 0:s.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmCustomPrimitive.show=e.show&&A&&(((l=e.style)==null?void 0:l.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow)))}}};L(_t,"type",_t.register("ESCesiumViewer",c.ESPoi2D.type,_t)),L(_t,"modeCache",c.react({}));let wg=_t;const lc=class lc extends He{constructor(e,i){super(e,i);L(this,"_czmModelPoi3D");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(c.createNextAnimateFrameEvent(e.modeChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{let{mode:a}=e;const s=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${a.charAt(0).toLocaleLowerCase()+a.slice(1)}/SM_${["triangle","diamond"].includes(a)?"POI":"3dPoi"}_${a.charAt(0).toUpperCase()+a.slice(1)}.glb`);return this._czmModelPoi3D=new TO(e,i,s)}))}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;if(e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,i),!0):!1:!1}};L(lc,"type",lc.register("ESCesiumViewer",c.ESPoi3D.type,lc));let bg=lc;class TO extends c.Destroyable{constructor(e,i,o){super();L(this,"czmModel");this._sceneObject=e,this._czmViewer=i,this._modelUrl=o,this.czmModel=this.ad(new Ht(this._czmViewer,this._sceneObject.id)),this.d(this.czmModel.readyEvent.don(l=>{this.czmModel.gltf.animations&&(this.czmModel.activeAnimationsJson=this.czmModel.gltf.animations.map((u,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),this._updateMaterial(this._sceneObject,this.czmModel)})),this.ad(new Bh(i.viewer,this.czmModel));const r=this._sceneObject,a=this.czmModel;a.url=this._modelUrl,this.d(c.bind([a,"position"],[r,"position"])),this.d(Mt([a,"rotation"],[r,"rotation"])),this.d(c.track([a,"scale"],[r,"scale"])),this.d(c.track([a,"show"],[r,"show"]));{const l=this.dv(c.createNextAnimateFrameEvent(r.allowPickingChanged,r.editingChanged)),u=()=>{r.allowPicking&&!r.editing?a.allowPicking=!0:a.allowPicking=!1};u(),this.d(l.don(u))}const s=this.dv(c.createNextAnimateFrameEvent(r.nameChanged,r.styleChanged));this.d(s.don(()=>this._updateMaterial(r,a)))}async _updateMaterial(e,i){var a,s;const o=document.createElement("div");o.style.position="absolute",o.style.zIndex="-1",o.style.bottom="108px",o.style.right="0px";const r=e.style[Object.keys(e.style).filter(l=>l.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;">
3200
+ `,TO=async(t,n)=>{const e=(n==null?void 0:n.fontSize)??c.ESPoi2D.defaults.style.fontSize,i=(n==null?void 0:n.image)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/anchor.png",o=(n==null?void 0:n.imageSize)??c.ESPoi2D.defaults.style.imageSize,r=(n==null?void 0:n.text)??c.ESPoi2D.defaults.style.text,a=(n==null?void 0:n.textBackground)??"${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/Custom/textBox_01.png",s=(n==null?void 0:n.textBackgroundColor)??c.ESPoi2D.defaults.style.textBackgroundColor,l=(n==null?void 0:n.textBackgroundSize)??c.ESPoi2D.defaults.style.textBackgroundSize,u=(n==null?void 0:n.textColor)??c.ESPoi2D.defaults.style.textColor,A=(n==null?void 0:n.textOffset)??c.ESPoi2D.defaults.style.textOffset;let h=BO;h=h.replace(/{{CustomContainer}}/g,`ESPoi2DCustomContainer${t}`),h=h.replace(/{{CustomImage}}/g,`ESPoi2DCustomImage${t}`),h=h.replace(/{{CustomTextContainer}}/g,`ESPoi2DCustomTextContainer${t}`),h=h.replace(/{{FONT_SIZE}}/g,e+"px"),h=h.replace(/{{IMAGE_SRC}}/g,c.ESSceneObject.context.getStrFromEnv(i)),h=h.replace(/{{IMAGE_WIDTH}}/g,o[0]+"px"),h=h.replace(/{{IMAGE_HEIGHT}}/g,o[1]+"px"),h=h.replace(/{{TEXT}}/g,r),h=h.replace(/{{TEXT_BACKGROUND}}/g,c.ESSceneObject.context.getStrFromEnv(a)),h=h.replace(/{{TEXT_BACKGROUND_COLOR}}/g,`rgb(${s.map(d=>d*255).join(",")})`),h=h.replace(/{{TEXT_BACKGROUND_WIDTH}}/g,l[0]+"px"),h=h.replace(/{{TEXT_BACKGROUND_HEIGHT}}/g,l[1]+"px"),h=h.replace(/{{TEXT_COLOR}}/g,`rgb(${u.map(d=>d*255).join(",")})`),h=h.replace(/{{TEXT_OFFSET_X}}/g,A[0]+"px"),h=h.replace(/{{TEXT_OFFSET_Y}}/g,A[1]+"px");const f=document.createElement("div");return f.innerHTML=h,[f.children[0].children[0],f.children[0].children[1]]},_t=class _t extends Gl{constructor(e,i){super(e,i);L(this,"_widgetComponent");L(this,"_customWidgetComponent");L(this,"_textBox",[]);L(this,"_iconBox");L(this,"_icon");L(this,"_anchor");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.ad(new c.Event),a=this.ad(new c.Event);{let l;const u=this.ad(c.createNextAnimateFrameEvent(e.screenRenderChanged,a));this.customWidgetComponent=this.disposeVar(new c.ObjResettingWithEvent(u,()=>{if(!(!l||e.mode!="Custom"))return e.screenRender?new Pr(e,i,l[1],!0,!1):new BA(e,i,l[1],!0,!1)},!1)),this.widgetComponent=this.disposeVar(new c.ObjResettingWithEvent(u,()=>{if(l)return e.screenRender?new Pr(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1):new BA(e,i,l instanceof HTMLDivElement?l:l[0],!0,!1)},!1)),this.widgetComponent.objChanged.don(()=>{e.minVisibleDistanceChanged.emit()});const A=this.dv(c.createNextAnimateFrameEvent(e.nameChanged,e.styleChanged,r));this.ad(A.don(async()=>{var h;if(e.mode!="Custom"){if(this._textBox.length==0&&e.mode!="Linear01")return;const f=e.style[Object.keys(e.style).filter(g=>g.toUpperCase()=="TEXT")[0]]??e.name,{div:d,styleObj:p}=wO(e.mode,f,this._textBox,this._iconBox,this._icon,this._anchor);l=d,l.innerHTML=EO(l.innerHTML,p)}else{const f=await TO(e.id,{...e.style,text:((h=e.style)==null?void 0:h.text)??e.name});l=[f[0],f[1]]}a.emit()}))}{const l=this.ad(c.createProcessingFromAsyncFunc(async f=>{const d=e.mode;_t.modeCache.value={..._t.modeCache.value,[d]:void 0},await f.promise(vO(d)).then(p=>{_t.modeCache.value={..._t.modeCache.value,[d]:p},this._icon=p.icon,this._anchor=p.anchor,this._iconBox=p.iconBox,this._textBox=p.textBox,r.emit()})}));let u=null,A=null;const h=()=>{var f,d,p,g;if(e.mode=="Custom"){r.emit();return}if(Reflect.has(_t.modeCache.value,e.mode))if(_t.modeCache.value[e.mode])this._icon=(f=_t.modeCache.value[e.mode])==null?void 0:f.icon,this._anchor=(d=_t.modeCache.value[e.mode])==null?void 0:d.anchor,this._iconBox=(p=_t.modeCache.value[e.mode])==null?void 0:p.iconBox,this._textBox=((g=_t.modeCache.value[e.mode])==null?void 0:g.textBox)??[],r.emit();else{if(u)return;u=_t.modeCache.changed.don(()=>{var v,y,m,b;_t.modeCache.value[e.mode]&&(this._icon=(v=_t.modeCache.value[e.mode])==null?void 0:v.icon,this._anchor=(y=_t.modeCache.value[e.mode])==null?void 0:y.anchor,this._iconBox=(m=_t.modeCache.value[e.mode])==null?void 0:m.iconBox,this._textBox=((b=_t.modeCache.value[e.mode])==null?void 0:b.textBox)??[],r.emit(),u&&u(),u=null)})}else if(!l.isRunning)l.restart();else{if(A)return;A=l.completeEvent.donce(()=>{A&&A(),A=null,l.restart()})}};h(),this.d(e.modeChanged.don(h))}const s=this.ad(new c.Event);{const l=this.dv(c.createNextAnimateFrameEvent(e.anchorChanged,e.autoAnchorChanged,e.offsetChanged)),u=()=>{const A=this.widgetComponent.obj,h=e.autoAnchor?A.defaultAnchor:e.anchor,f=e.offset;if(A instanceof Pr)h?(A.czmGeoCustomDivPoi.originRatioAndOffset=[...h,-f[0],-f[1]],A.widgetInfo.style.transformOrigin=`${h[0]*100}% ${h[1]*100}%`):A.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let d=100,p=100;e.sizeByContent&&A.domSize?(d=A.domSize.width/100,p=A.domSize.height/100):(d=e.size[0]/100,p=e.size[1]/100),h?A.czmCustomPrimitive.localPosition=[h[0]*d-f[0]/100,0,h[1]*p-f[1]/100]:A.czmCustomPrimitive.localPosition=[0,0,0]}e.mode=="Custom"&&s.emit()};this.d(l.don(u)),this.ad(new c.ObjResettingWithEvent(this.widgetComponent.objChanged,()=>{if(this.widgetComponent.obj==null)return;const A=new c.Destroyable;return u(),A.d(this.widgetComponent.obj.defaultAnchorChanged.don(u)),A}))}{const l=this.dv(c.createNextAnimateFrameEvent(e.styleChanged,e.showChanged,s)),u=()=>{var y,m,b;if(e.mode!="Custom")return;const A=this.customWidgetComponent.obj;if(!A)return;const h=((y=e.style)==null?void 0:y.imageSize)??c.ESPoi2D.defaults.style.imageSize,f=e.autoAnchor?this.widgetComponent.obj.defaultAnchor:e.anchor,d=((m=e.style)==null?void 0:m.textBoxAlign)??c.ESPoi2D.defaults.style.textBoxAlign,p=d=="start"?0:d=="center"?.5:1,g=((b=e.style)==null?void 0:b.textBoxOffset)??c.ESPoi2D.defaults.style.textBoxOffset,v=e.offset;if(A instanceof Pr)f?(A.czmGeoCustomDivPoi.originRatioAndOffset=[p,.5,-v[0]-g[0]+h[0]*(f[0]-.5),-v[1]-g[1]+h[1]*(f[1]-.5)],A.widgetInfo.style.transformOrigin=`${p*100}% ${.5*100}%`):A.czmGeoCustomDivPoi.originRatioAndOffset=[0,0,0,0];else{let x=100,E=100;e.sizeByContent&&A.domSize?(x=A.domSize.width/100,E=A.domSize.height/100):(x=e.size[0]/100,E=e.size[1]/100),f?A.czmCustomPrimitive.localPosition=[p*x+(-v[0]-g[0]+h[0]*(f[0]-.5))/100,0,.5*E+(-v[1]-g[1]+h[1]*(f[1]-.5))/100]:A.czmCustomPrimitive.localPosition=[0,0,0]}};this.ad(l.don(u));{const A=this.ad(c.createNextAnimateFrameEvent(this.customWidgetComponent.objChanged,this.widgetComponent.objChanged));this.ad(new c.ObjResettingWithEvent(A,()=>{if(this.customWidgetComponent.obj==null||this.widgetComponent.obj==null)return;const h=new c.Destroyable,f=this.customWidgetComponent.obj,d=()=>{var p,g,v,y;f&&(f instanceof Pr?(((p=e.style)==null?void 0:p.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmGeoCustomDivPoi.show=!1,this.d(this.widgetComponent.obj.czmGeoCustomDivPoi.pickedEvent.don(m=>{var x,E;const b=(x=_o(m,"pickResult"))==null?void 0:x.pointerEvent;b&&(f.czmGeoCustomDivPoi.show=e.show&&(((E=e.style)==null?void 0:E.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow)&&b.type=="mouseenter")}))):f.czmGeoCustomDivPoi.show=e.show&&(((g=e.style)==null?void 0:g.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow):(((v=e.style)==null?void 0:v.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="hover"?(f.czmCustomPrimitive.show=!1,this.d(e.widgetEvent.don(m=>{var b;m&&(f.czmCustomPrimitive.show=e.show&&(((b=e.style)==null?void 0:b.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow)&&m.type=="mouseEnter")}))):f.czmCustomPrimitive.show=e.show&&(((y=e.style)==null?void 0:y.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow))};return d(),h.ad(e.styleChanged.don(d)),h}))}}}get widgetComponent(){return this._widgetComponent}set widgetComponent(e){this._widgetComponent=e}get customWidgetComponent(){return this._customWidgetComponent}set customWidgetComponent(e){this._customWidgetComponent=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetComponent:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.obj)a.obj.flyTo(e,i);else{const s=setTimeout(()=>{clearTimeout(s),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}visibleDistance(e,i){var o,r,a,s,l;if((o=i.viewer)!=null&&o.camera&&e.show){const u=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let A=!1;e.minVisibleDistance<e.maxVisibleDistance?A=e.minVisibleDistance<u&&u<e.maxVisibleDistance:e.maxVisibleDistance==0&&(A=u>e.minVisibleDistance);const h=this.widgetComponent.obj,f=this.customWidgetComponent.obj;if(!h)return;h instanceof Pr?(h.czmGeoCustomDivPoi.show=e.show&&A,(((r=e.style)==null?void 0:r.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmGeoCustomDivPoi.show=e.show&&A&&(((a=e.style)==null?void 0:a.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow))):(h.czmCustomPrimitive.show=e.show&&A,(((s=e.style)==null?void 0:s.textBoxMode)??c.ESPoi2D.defaults.style.textBoxMode)=="default"&&f&&(f.czmCustomPrimitive.show=e.show&&A&&(((l=e.style)==null?void 0:l.textBoxShow)??c.ESPoi2D.defaults.style.textBoxShow)))}}};L(_t,"type",_t.register("ESCesiumViewer",c.ESPoi2D.type,_t)),L(_t,"modeCache",c.react({}));let wg=_t;const lc=class lc extends He{constructor(e,i){super(e,i);L(this,"_czmModelPoi3D");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(c.createNextAnimateFrameEvent(e.modeChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{let{mode:a}=e;const s=c.ESSceneObject.context.getStrFromEnv(`\${earthsdk3-assets-script-dir}/assets/glb/poi3d/${a.charAt(0).toLocaleLowerCase()+a.slice(1)}/SM_${["triangle","diamond"].includes(a)?"POI":"3dPoi"}_${a.charAt(0).toUpperCase()+a.slice(1)}.glb`);return this._czmModelPoi3D=new IO(e,i,s)}))}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;if(e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),!this._czmModelPoi3D)return;this._czmModelPoi3D.czmModel&&(this._czmModelPoi3D.czmModel.show=e.show&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this._czmModelPoi3D?(this._czmModelPoi3D.flyTo(e,i),!0):!1:!1}};L(lc,"type",lc.register("ESCesiumViewer",c.ESPoi3D.type,lc));let bg=lc;class IO extends c.Destroyable{constructor(e,i,o){super();L(this,"czmModel");this._sceneObject=e,this._czmViewer=i,this._modelUrl=o,this.czmModel=this.ad(new Ht(this._czmViewer,this._sceneObject.id)),this.d(this.czmModel.readyEvent.don(l=>{this.czmModel.gltf.animations&&(this.czmModel.activeAnimationsJson=this.czmModel.gltf.animations.map((u,A)=>({index:A,loop:"REPEAT",animationTime:"(duration) => Date.now() / 1000 / duration * 2"}))),this._updateMaterial(this._sceneObject,this.czmModel)})),this.ad(new Bh(i.viewer,this.czmModel));const r=this._sceneObject,a=this.czmModel;a.url=this._modelUrl,this.d(c.bind([a,"position"],[r,"position"])),this.d(Mt([a,"rotation"],[r,"rotation"])),this.d(c.track([a,"scale"],[r,"scale"])),this.d(c.track([a,"show"],[r,"show"]));{const l=this.dv(c.createNextAnimateFrameEvent(r.allowPickingChanged,r.editingChanged)),u=()=>{r.allowPicking&&!r.editing?a.allowPicking=!0:a.allowPicking=!1};u(),this.d(l.don(u))}const s=this.dv(c.createNextAnimateFrameEvent(r.nameChanged,r.styleChanged));this.d(s.don(()=>this._updateMaterial(r,a)))}async _updateMaterial(e,i){var a,s;const o=document.createElement("div");o.style.position="absolute",o.style.zIndex="-1",o.style.bottom="108px",o.style.right="0px";const r=e.style[Object.keys(e.style).filter(l=>l.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;">
3201
3201
  <span style="display: inline-block;white-space: nowrap;text-overflow: ellipsis;overflow: hidden;width: 512px;">${r}</span>
3202
3202
  </div>`,document.body.contains(o)||document.body.appendChild(o);try{const l=await Od(o,{backgroundColor:null,allowTaint:!1,useCORS:!0});document.body.contains(o)&&document.body.removeChild(o),i.setMaterial({Text:{baseColorTexture:{value:l.toDataURL("image/png",1)}},lambert5:{baseColorFactor:((a=e.style)==null?void 0:a.UI_Color)??[1,1,1,1]},default:{baseColorFactor:((s=e.style)==null?void 0:s.FX_Color)??[1,1,1,1]}})}catch(l){console.error(l),document.body.contains(o)&&document.body.removeChild(o)}}flyTo(e,i){const{_czmViewer:o,_sceneObject:r,czmModel:a}=this;wn(o,r,i,e,a,!0)}}const uc=class uc extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");L(this,"_causticsTexture");L(this,"_foamTexture");L(this,"_heightMapTexture");L(this,"_normalMapTexture");L(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});L(this,"getClosestTimestampIndex",(e,i)=>{for(var o=0,r=1/0,a=0;a<i.length;a++){var s=Math.abs(e-i[a]);s<r&&(r=s,o=a)}return o});if(this._czmCustomPrimitive=this.dv(new at(i,e.id)),this._causticsTexture=this.dv(new ht(i)),this._foamTexture=this.dv(new ht(i)),this._heightMapTexture=this.dv(new ht(i)),this._normalMapTexture=this.dv(new ht(i)),!i.viewer){console.warn("viewer is undefined!");return}const r=this.czmCustomPrimitive,a=this.causticsTexture,s=this.foamTexture,l=this.heightMapTexture,u=this.normalMapTexture;a.uri=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/caustics.jpg"),s.uri=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/foam.jpg"),l.uri=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/heightmap.jpg"),u.uri=c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/water/water_normalmap.png"),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"allowPicking"],[e,"allowPicking"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(c.bind([r,"rotation"],[e,"rotation"])),this.d(c.bind([r,"scale"],[e,"scale"])),r.pass="TRANSLUCENT",r.primitiveType="TRIANGLES",r.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}},r.vertexShaderSource=`
3203
3203
  in vec3 position;
@@ -3270,7 +3270,7 @@ ${kx}
3270
3270
  out_FragColor.rgb *= vec3(clamp((distance - realDistance)*.5, 0.5, 1.0));
3271
3271
  out_FragColor.a = 0.9;
3272
3272
  }
3273
- `;{const A=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),h=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??c.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??c.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},Mp[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};h(),this.d(A.don(h))}{const A=f=>{if(f==0||!this.isTimestamp(f))return;const d=e.getAllMoments(),p=e.getSubmergingData;if(d.length==0||!p)return;const g=this.getClosestTimestampIndex(f,d);r.attributes={position:{typedArray:p[g].posBuffer,componentsPerAttribute:3}},r.indexTypedArray=p[g].indicesBuffer;const v=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!v)return;const{min:y,max:m}=v;r.setLocalAxisedBoundingBox(y,m)},h=this.dv(c.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(h.don(()=>{A(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,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:i,sceneObject:o,heightMapTexture:r,normalMapTexture:a,foamTexture:s,causticsTexture:l}=this,u=o.materialParams[Object.keys(o.materialParams).filter(A=>A.toUpperCase().includes("BASECOLOR"))[0]];i.uniformMap={u_image:{type:"texture",id:r.id},u_heightmap_image:{type:"texture",id:r.id},u_normalmap_image:{type:"texture",id:a.id},u_foam_image:{type:"texture",id:s.id},u_caustics_image:{type:"texture",id:l.id},u_color:e.waterColor??u??c.ESSubmergingAnalysis.defaults.waterColor}}};L(uc,"type",uc.register("ESCesiumViewer",c.ESSubmergingAnalysis.type,uc));let xg=uc;const{getStrFromEnv:Gx}=c.ESSceneObject.context;function IO(t){let n;if(t.startsWith("ion://")){const i=+t.substring(6);Number.isFinite(i)&&(n=_.IonResource.fromAssetId(i))}else n=Gx(t);return n}async function FO(t,n){if(t.type==="EllipsoidTerrainProvider")return new _.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),tilingScheme:t.tilingScheme&&mi(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=IO(typeof t.url=="string"?t.url:t.url.url);return e?await _.CesiumTerrainProvider.fromUrl(typeof e=="string"?Mn(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await _.GoogleEarthEnterpriseMetadata.fromUrl(Gx(t.url));return await _.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await _.ArcGISTiledElevationTerrainProvider.fromUrl(Mn(t.url),{token:t.token,ellipsoid:t.ellipsoid&&qe(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new _.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&mi(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await _.VRTheWorldTerrainProvider.fromUrl(Mn(t.url),{ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit})}}const cc=class cc extends Nn{constructor(e,i){super(e,i);L(this,"_provider",this.disposeVar(c.react(void 0)));L(this,"_czmProvider",this.dv(c.react(void 0)));const o=i.viewer;if(!o)return;const r=Qn(o);if(!r)return;const{terrainManager:a}=r,s=()=>{a.delete(this),this.provider=void 0};this.dispose(s);let l=!1;const u=this.disposeVar(c.createProcessingFromAsyncFunc(async(h,f)=>{if(f){if(l=!0,s(),!this.czmProvider)return;this.provider=await h.promise(FO(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),a.add(this),l=!1}}));u.restart(void 0,!0);const A=this.disposeVar(new c.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{A.emit()})),this.dispose(c.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{A.emit()})),this.dispose(A.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{l||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((h,f)=>this.flyTo(h,f)));{const h=this.ad(c.reactJson(""));{const d=()=>{if(typeof e.url=="string")h.value=c.ESSceneObject.context.getStrFromEnv(e.url??c.ESTerrainLayer.defaults.url);else{const p=e.url;p.url=c.ESSceneObject.context.getStrFromEnv(p.url??c.ESTerrainLayer.defaults.url),h.value=p}};d(),this.ad(e.urlChanged.don(d))}const f=()=>{if(!h.value)return;let d=h.value,p=typeof d=="string"?d:d.url;if(p.includes(c.ESTerrainLayer.defaults.url)){const g=MO(p);if(g&&g.h){const v=Number(g.h),y={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[y.x+v,y.y+v,y.z+v]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else p.includes("/layer.json")&&(typeof d=="string"?d=p.split("/layer.json").join(""):d.url=p.split("/layer.json").join("")),this._czmProvider.value={type:"CesiumTerrainProvider",url:d,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(h.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,i){const{czmViewer:o,sceneObject:r}=this;if(!o.actived)return!1;const{viewer:a}=o;return a?(a.camera.flyTo({destination:r.rectangle&&!_p(r.rectangle)?mt(r.rectangle):_.Camera.DEFAULT_VIEW_RECTANGLE,duration:e}),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?super.flyIn(e,i):this.flyTo(e,i):!1}};L(cc,"type",cc.register("ESCesiumViewer",c.ESTerrainLayer.type,cc));let _g=cc;function MO(t){const n=t.indexOf("?"),i=t.slice(n+1).split("&"),o={};for(var r=0;r<i.length;r++){var a=i[r].split("=");o[a[0]]=a[1]}return o}class Wx extends c.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"flyTo",(e,i)=>{if(this.czmTextLabel.position){Fe(this.czmViewer.viewer,this.czmTextLabel.position,1e3,Hn,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=i,this._czmTextLabel=this.disposeVar(new vi(i,e.id));const o=this._czmTextLabel,r=()=>{const s=e.anchor,l=e.offset;s?o.originRatioAndOffset=[...s,-l[0],-l[1]]:o.originRatioAndOffset=[0,0,0,0]},a=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(a.disposableOn(()=>r())),r(),this.dispose(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"text"],[e,"text"])),this.dispose(c.track([o,"color"],[e,"color"])),this.dispose(c.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(c.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(c.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.dispose(c.track([o,"width"],[e,"width"])),this.dispose(c.track([o,"opacity"],[e,"opacity"])),this.dispose(c.track([o,"padding"],[e,"padding"])),this.dispose(c.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(c.track([o,"borderColor"],[e,"borderColor"])),this.dispose(c.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(c.track([o,"textAlign"],[e,"textAlign"])),this.dispose(c.track([o,"fontSize"],[e,"fontSize"])),this.dispose(c.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(c.track([o,"pickOnClick"],[e,"allowPicking"]));{const s=()=>{o.scale=[e.scale[1],e.scale[2]]};s(),this.dispose(e.scaleChanged.don(s))}{const s=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};s(),this.dispose(e.sizeByContentChanged.don(s)),this.dispose(e.sizeChanged.don(s))}this.d(o.pickedEvent.don(s=>{var A;const l=(A=_o(s,"pickResult"))==null?void 0:A.pointerEvent;if(!l)return;const u={type:l.buttons!=0&&l.button==0?"leftClick":l.button==2?"rightClick":void 0,add:{mousePos:[l.offsetX,l.offsetY]}};u.type==null&&(u.type=l.type),e.widgetEvent.emit(u)}));{let s;const l=u=>{u&&(s=u),s&&(s.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>l(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>l(u)))}}get czmTextLabel(){return this._czmTextLabel}}class jx extends c.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"_czmImageModel");L(this,"_url",this.disposeVar(c.react("")));L(this,"_defaultSize",this.disposeVar(c.react([1,1])));L(this,"_size",this.disposeVar(c.react([1,1])));L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmImageModel.position)return Gn(this._czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=i,this._czmTextLabel=this.disposeVar(new vi(i,e.id)),this._czmImageModel=this.disposeVar(new $i(i,e.id));const o=this._czmViewer,r=this._czmTextLabel;r.originRatioAndOffset=[1e3,0,0,0],this.dispose(r.divCreatedEvent.disposableOn(l=>{const u=setTimeout(()=>{Od(l,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:l.offsetWidth,height:l.offsetHeight,scale:1}).then(A=>{if(clearTimeout(u),this.isDestroyed())return;const h=new Image;h.onload=()=>{e.sizeByContent?this._size.value=[h.width/100,h.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},h.src=A.toDataURL("image/png"),this._url.value=A.toDataURL("image/png")}).catch(A=>{clearTimeout(u),console.error(A)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"text"],[e,"text"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.track([r,"fontSize"],[e,"fontSize"]));const a=()=>{const l=e.anchor,u=e.offset;l?this.czmImageModel.originRatioAndOffset=[...l,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},s=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(s.disposableOn(()=>a())),a();{const l=()=>{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(c.track([u,"show"],[e,"show"])),this.dispose(c.bind([u,"position"],[e,"position"])),this.dispose(c.track([u,"allowPicking"],[e,"allowPicking"]));{const A=()=>{u.scale=[e.scale[1],e.scale[2]]};A(),this.d(e.scaleChanged.don(A))}{const A=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(Mt([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};A(),this.dispose(e.rotationTypeChanged.disposableOn(A))}};this.dispose(this._url.changed.disposableOn(l))}this.ad(o.clickEvent.don(l=>{const u=l==null?void 0:l.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(l=>{var u,A,h;l.screenPosition&&this._isPointEvent&&l.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(l.screenPosition[0]-((A=this._eventInfo.add)==null?void 0:A.mousePos[0]))<1&&Math.abs(l.screenPosition[1]-((h=this._eventInfo.add)==null?void 0:h.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const l=o.getEngineObject(e);this.ad(l.lastHoverResultChanged.don((u,A)=>{(u==null?void 0:u.sceneObject)==(A==null?void 0:A.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(A==null?void 0:A.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),A!=null&&A.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},A.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 hc=class hc extends Gl{constructor(e,i){super(e,i);L(this,"_event",this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));L(this,"_resetting",this.disposeVar(new c.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new Wx(this.sceneObject,this.czmViewer):new jx(this.sceneObject,this.czmViewer))));if(!i.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(hc,"type",hc.register("ESCesiumViewer",c.ESTextLabel.type,hc));let Cg=hc;const Ac=class Ac extends He{constructor(e,i){super(e,i);L(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new So(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoDivSwitchPoi;r.showIcon=!1,this.d(c.track([r,"zOrder"],[e,"zOrder"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"text"],[e,"info"],l=>Object.values(l??{title:"请输入内容"}).join())),this.dispose(c.bind([r,"position"],[e,"position"]));const a=()=>{const l=e.anchor,u=e.offset;l?r.originRatioAndOffset=[...l,-u[0],-u[1]]:r.originRatioAndOffset=[0,0,0,0]},s=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(s.disposableOn(()=>a())),a()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoDivSwitchPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.position?(Fe(this.czmViewer.viewer,a.position,1e3,Hn,e),!0):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Ac,"type",Ac.register("ESCesiumViewer",c.ESUEWidget.type,Ac));let Sg=Ac;const fc=class fc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Wn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(fc,"type",fc.register("ESCesiumViewer",c.ESUnrealActor.type,fc));let Eg=fc;var DO=_.Primitive._modifyShaderPosition;_.Primitive._modifyShaderPosition=function(t,i,e){var i=DO(t,i,e);return t.isCameraVideo&&i.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(i=i.replace("void main()",`
3273
+ `;{const A=this.dv(c.createNextAnimateFrameEvent(e.waterColorChanged,e.frequencyChanged,e.waveVelocityChanged,e.amplitudeChanged,e.specularIntensityChanged,e.waterTypeChanged,e.flowSpeedChanged,e.materialParamsChanged)),h=()=>{if(e.waterType==="custom")this.updateWater({waterColor:e.waterColor,frequency:(e.frequency??c.ESSubmergingAnalysis.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESSubmergingAnalysis.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESSubmergingAnalysis.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESSubmergingAnalysis.defaults.specularIntensity,flowSpeed:e.flowSpeed??c.ESSubmergingAnalysis.defaults.flowSpeed});else{const f=Object.assign({},Mp[e.waterType]);f.frequency&&(f.frequency/=10),f.waveVelocity&&(f.waveVelocity/=100),f.amplitude&&(f.amplitude*=10),this.updateWater(f)}};h(),this.d(A.don(h))}{const A=f=>{if(f==0||!this.isTimestamp(f))return;const d=e.getAllMoments(),p=e.getSubmergingData;if(d.length==0||!p)return;const g=this.getClosestTimestampIndex(f,d);r.attributes={position:{typedArray:p[g].posBuffer,componentsPerAttribute:3}},r.indexTypedArray=p[g].indicesBuffer;const v=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!v)return;const{min:y,max:m}=v;r.setLocalAxisedBoundingBox(y,m)},h=this.dv(c.createNextAnimateFrameEvent(e.currentTimeChanged,e.readyEvent));this.d(h.don(()=>{A(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,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,this.czmCustomPrimitive,!0),!0):!1}updateWater(e){const{czmCustomPrimitive:i,sceneObject:o,heightMapTexture:r,normalMapTexture:a,foamTexture:s,causticsTexture:l}=this,u=o.materialParams[Object.keys(o.materialParams).filter(A=>A.toUpperCase().includes("BASECOLOR"))[0]];i.uniformMap={u_image:{type:"texture",id:r.id},u_heightmap_image:{type:"texture",id:r.id},u_normalmap_image:{type:"texture",id:a.id},u_foam_image:{type:"texture",id:s.id},u_caustics_image:{type:"texture",id:l.id},u_color:e.waterColor??u??c.ESSubmergingAnalysis.defaults.waterColor}}};L(uc,"type",uc.register("ESCesiumViewer",c.ESSubmergingAnalysis.type,uc));let xg=uc;const{getStrFromEnv:Gx}=c.ESSceneObject.context;function FO(t){let n;if(t.startsWith("ion://")){const i=+t.substring(6);Number.isFinite(i)&&(n=_.IonResource.fromAssetId(i))}else n=Gx(t);return n}async function MO(t,n){if(t.type==="EllipsoidTerrainProvider")return new _.EllipsoidTerrainProvider({ellipsoid:t.ellipsoid&&qe(t.ellipsoid),tilingScheme:t.tilingScheme&&mi(t.tilingScheme)});if(t.type==="CesiumTerrainProvider"){const e=FO(typeof t.url=="string"?t.url:t.url.url);return e?await _.CesiumTerrainProvider.fromUrl(typeof e=="string"?Mn(t.url):e,{requestVertexNormals:t.requestVertexNormals,requestWaterMask:t.requestWaterMask,requestMetadata:t.requestMetadata,ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit}):void 0}else if(t.type==="GoogleEarthEnterpriseTerrainProvider"){const e=await _.GoogleEarthEnterpriseMetadata.fromUrl(Gx(t.url));return await _.GoogleEarthEnterpriseTerrainProvider.fromMetadata(e,{ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit})}else{if(t.type==="ArcGISTiledElevationTerrainProvider")return await _.ArcGISTiledElevationTerrainProvider.fromUrl(Mn(t.url),{token:t.token,ellipsoid:t.ellipsoid&&qe(t.ellipsoid)});if(t.type==="CustomHeightmapTerrainProvider")return new _.CustomHeightmapTerrainProvider({tilingScheme:t.tilingScheme&&mi(t.tilingScheme),width:t.width,height:t.height,ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit,callback:t.callback&&Function('"use strict";return ('+t.callback+")")()});if(t.type==="VRTheWorldTerrainProvider")return await _.VRTheWorldTerrainProvider.fromUrl(Mn(t.url),{ellipsoid:t.ellipsoid&&qe(t.ellipsoid),credit:t.credit})}}const cc=class cc extends Nn{constructor(e,i){super(e,i);L(this,"_provider",this.disposeVar(c.react(void 0)));L(this,"_czmProvider",this.dv(c.react(void 0)));const o=i.viewer;if(!o)return;const r=Qn(o);if(!r)return;const{terrainManager:a}=r,s=()=>{a.delete(this),this.provider=void 0};this.dispose(s);let l=!1;const u=this.disposeVar(c.createProcessingFromAsyncFunc(async(h,f)=>{if(f){if(l=!0,s(),!this.czmProvider)return;this.provider=await h.promise(MO(this.czmProvider)),this.provider&&(this.provider.ESSceneObjectID=e.id),a.add(this),l=!1}}));u.restart(void 0,!0);const A=this.disposeVar(new c.Event);this.dispose(this.czmProviderChanged.disposableOn(()=>{A.emit()})),this.dispose(c.ESSceneObject.context.environmentVariablesChanged.disposableOn(()=>{A.emit()})),this.dispose(A.disposableOn(()=>{u.restart(void 0,!0)})),this.dispose(e.showChanged.disposableOn(()=>{l||u.restart(void 0,!1)})),this.dispose(e.flyToEvent.disposableOn((h,f)=>this.flyTo(h,f)));{const h=this.ad(c.reactJson(""));{const d=()=>{if(typeof e.url=="string")h.value=c.ESSceneObject.context.getStrFromEnv(e.url??c.ESTerrainLayer.defaults.url);else{const p=e.url;p.url=c.ESSceneObject.context.getStrFromEnv(p.url??c.ESTerrainLayer.defaults.url),h.value=p}};d(),this.ad(e.urlChanged.don(d))}const f=()=>{if(!h.value)return;let d=h.value,p=typeof d=="string"?d:d.url;if(p.includes(c.ESTerrainLayer.defaults.url)){const g=DO(p);if(g&&g.h){const v=Number(g.h),y={x:6378137,y:6378137,z:6356752314245179e-9};this._czmProvider.value={type:"EllipsoidTerrainProvider",ellipsoid:[y.x+v,y.y+v,y.z+v]}}else this._czmProvider.value={type:"CesiumTerrainProvider",url:"",requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}}else p.includes("/layer.json")&&(typeof d=="string"?d=p.split("/layer.json").join(""):d.url=p.split("/layer.json").join("")),this._czmProvider.value={type:"CesiumTerrainProvider",url:d,requestMetadata:!0,requestWaterMask:!0,requestVertexNormals:!0}};f(),this.dispose(h.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,i){const{czmViewer:o,sceneObject:r}=this;if(!o.actived)return!1;const{viewer:a}=o;return a?(a.camera.flyTo({destination:r.rectangle&&!_p(r.rectangle)?mt(r.rectangle):_.Camera.DEFAULT_VIEW_RECTANGLE,duration:e}),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?super.flyIn(e,i):this.flyTo(e,i):!1}};L(cc,"type",cc.register("ESCesiumViewer",c.ESTerrainLayer.type,cc));let _g=cc;function DO(t){const n=t.indexOf("?"),i=t.slice(n+1).split("&"),o={};for(var r=0;r<i.length;r++){var a=i[r].split("=");o[a[0]]=a[1]}return o}class Wx extends c.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"flyTo",(e,i)=>{if(this.czmTextLabel.position){Fe(this.czmViewer.viewer,this.czmTextLabel.position,1e3,Hn,e);return}this.czmTextLabel.flyTo(e&&e*1e3)});this.czmViewer=i,this._czmTextLabel=this.disposeVar(new vi(i,e.id));const o=this._czmTextLabel,r=()=>{const s=e.anchor,l=e.offset;s?o.originRatioAndOffset=[...s,-l[0],-l[1]]:o.originRatioAndOffset=[0,0,0,0]},a=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(a.disposableOn(()=>r())),r(),this.dispose(c.track([o,"zOrder"],[e,"zOrder"])),this.dispose(c.track([o,"show"],[e,"show"])),this.dispose(c.bind([o,"text"],[e,"text"])),this.dispose(c.track([o,"color"],[e,"color"])),this.dispose(c.track([o,"backgroundColor"],[e,"backgroundColor"])),this.dispose(c.bind([o,"textEditingInteraction"],[e,"textEditingInteraction"])),this.dispose(c.bind([o,"textEditing"],[e,"textEditing"])),this.dispose(c.bind([o,"position"],[e,"position"])),this.dispose(c.track([o,"width"],[e,"width"])),this.dispose(c.track([o,"opacity"],[e,"opacity"])),this.dispose(c.track([o,"padding"],[e,"padding"])),this.dispose(c.track([o,"borderRadius"],[e,"borderRadius"])),this.dispose(c.track([o,"borderColor"],[e,"borderColor"])),this.dispose(c.track([o,"borderWidth"],[e,"borderWidth"])),this.dispose(c.track([o,"textAlign"],[e,"textAlign"])),this.dispose(c.track([o,"fontSize"],[e,"fontSize"])),this.dispose(c.track([o,"borderStyle"],[e,"borderStyle"])),this.dispose(c.track([o,"pickOnClick"],[e,"allowPicking"]));{const s=()=>{o.scale=[e.scale[1],e.scale[2]]};s(),this.dispose(e.scaleChanged.don(s))}{const s=()=>{e.sizeByContent?(o.width=void 0,o.height=void 0):(o.width=e.size[0],o.height=e.size[1])};s(),this.dispose(e.sizeByContentChanged.don(s)),this.dispose(e.sizeChanged.don(s))}this.d(o.pickedEvent.don(s=>{var A;const l=(A=_o(s,"pickResult"))==null?void 0:A.pointerEvent;if(!l)return;const u={type:l.buttons!=0&&l.button==0?"leftClick":l.button==2?"rightClick":void 0,add:{mousePos:[l.offsetX,l.offsetY]}};u.type==null&&(u.type=l.type),e.widgetEvent.emit(u)}));{let s;const l=u=>{u&&(s=u),s&&(s.style.pointerEvents=e.editing?"none":"all")};this.d(e.editingChanged.don(()=>l(void 0))),this.ad(this._czmTextLabel.divCreatedEvent.don(u=>l(u)))}}get czmTextLabel(){return this._czmTextLabel}}class jx extends c.Destroyable{constructor(e,i){super();L(this,"_czmTextLabel");L(this,"_czmImageModel");L(this,"_url",this.disposeVar(c.react("")));L(this,"_defaultSize",this.disposeVar(c.react([1,1])));L(this,"_size",this.disposeVar(c.react([1,1])));L(this,"_eventInfo",{type:"leftClick",add:{mousePos:[0,0]}});L(this,"_isPointEvent",!1);L(this,"flyTo",(e,i)=>{if(this.czmImageModel.position)return Gn(this._czmViewer,this.sceneObject,i,this.sceneObject.position,Math.max(...this.czmImageModel.size),e,!0);this.czmImageModel.flyTo(e&&e*1e3)});this.sceneObject=e,this._czmViewer=i,this._czmTextLabel=this.disposeVar(new vi(i,e.id)),this._czmImageModel=this.disposeVar(new $i(i,e.id));const o=this._czmViewer,r=this._czmTextLabel;r.originRatioAndOffset=[1e3,0,0,0],this.dispose(r.divCreatedEvent.disposableOn(l=>{const u=setTimeout(()=>{Od(l,{backgroundColor:null,allowTaint:!1,useCORS:!0,width:l.offsetWidth,height:l.offsetHeight,scale:1}).then(A=>{if(clearTimeout(u),this.isDestroyed())return;const h=new Image;h.onload=()=>{e.sizeByContent?this._size.value=[h.width/100,h.height/100]:this._size.value=[e.size[0]/100,e.size[1]/100]},h.src=A.toDataURL("image/png"),this._url.value=A.toDataURL("image/png")}).catch(A=>{clearTimeout(u),console.error(A)})},50);this.dispose(()=>clearTimeout(u))})),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"text"],[e,"text"])),this.dispose(c.track([r,"color"],[e,"color"])),this.dispose(c.track([r,"fontSize"],[e,"fontSize"]));const a=()=>{const l=e.anchor,u=e.offset;l?this.czmImageModel.originRatioAndOffset=[...l,-u[0]/100,-u[1]/100]:this.czmImageModel.originRatioAndOffset=[0,0,0,0]},s=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(s.disposableOn(()=>a())),a();{const l=()=>{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(c.track([u,"show"],[e,"show"])),this.dispose(c.bind([u,"position"],[e,"position"])),this.dispose(c.track([u,"allowPicking"],[e,"allowPicking"]));{const A=()=>{u.scale=[e.scale[1],e.scale[2]]};A(),this.d(e.scaleChanged.don(A))}{const A=()=>{e.rotationType===0&&(u.rotationMode="WithProp",this.d(Mt([u,"rotation"],[e,"rotation"]))),e.rotationType===1&&(u.rotationMode="WithCamera"),e.rotationType===2&&(u.rotationMode="WithCameraOnlyZ")};A(),this.dispose(e.rotationTypeChanged.disposableOn(A))}};this.dispose(this._url.changed.disposableOn(l))}this.ad(o.clickEvent.don(l=>{const u=l==null?void 0:l.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(l=>{var u,A,h;l.screenPosition&&this._isPointEvent&&l.attachedInfo!="innerHoverEvent"&&((u=this._eventInfo.add)!=null&&u.mousePos)&&Math.abs(l.screenPosition[0]-((A=this._eventInfo.add)==null?void 0:A.mousePos[0]))<1&&Math.abs(l.screenPosition[1]-((h=this._eventInfo.add)==null?void 0:h.mousePos[1]))<1&&(e.widgetEvent.emit(this._eventInfo),this._isPointEvent=!1)})),c.registerCreatedEventUpdate(this,e,()=>{const l=o.getEngineObject(e);this.ad(l.lastHoverResultChanged.don((u,A)=>{(u==null?void 0:u.sceneObject)==(A==null?void 0:A.sceneObject)||(u==null?void 0:u.sceneObject)!=e&&(A==null?void 0:A.sceneObject)!=e||(u!=null&&u.sceneObject&&(this._eventInfo={type:"mouseEnter",add:{mousePos:u==null?void 0:u.screenPosition}},u.sceneObject.widgetEvent.emit(this._eventInfo)),A!=null&&A.sceneObject&&(this._eventInfo={type:"mouseLeave",add:{mousePos:u==null?void 0:u.screenPosition}},A.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 hc=class hc extends Gl{constructor(e,i){super(e,i);L(this,"_event",this.disposeVar(c.createNextAnimateFrameEvent(this.sceneObject.screenRenderChanged,this.sceneObject.sizeByContentChanged,this.sceneObject.sizeChanged)));L(this,"_resetting",this.disposeVar(new c.ObjResettingWithEvent(this._event,()=>this.sceneObject.screenRender?new Wx(this.sceneObject,this.czmViewer):new jx(this.sceneObject,this.czmViewer))));if(!i.viewer){console.warn("viewer is undefined!");return}}get event(){return this._event}get resetting(){return this._resetting}flyTo(e,i){const{sceneObject:o,czmViewer:r,resetting:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a&&a.obj&&a.obj.flyTo(e,i),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(hc,"type",hc.register("ESCesiumViewer",c.ESTextLabel.type,hc));let Cg=hc;const Ac=class Ac extends He{constructor(e,i){super(e,i);L(this,"_czmGeoDivSwitchPoi");if(this._czmGeoDivSwitchPoi=this.disposeVar(new So(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoDivSwitchPoi;r.showIcon=!1,this.d(c.track([r,"zOrder"],[e,"zOrder"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"text"],[e,"info"],l=>Object.values(l??{title:"请输入内容"}).join())),this.dispose(c.bind([r,"position"],[e,"position"]));const a=()=>{const l=e.anchor,u=e.offset;l?r.originRatioAndOffset=[...l,-u[0],-u[1]]:r.originRatioAndOffset=[0,0,0,0]},s=this.ad(c.createNextAnimateFrameEvent(e.anchorChanged,e.offsetChanged));this.dispose(s.disposableOn(()=>a())),a()}get czmGeoDivSwitchPoi(){return this._czmGeoDivSwitchPoi}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoDivSwitchPoi:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.position?(Fe(this.czmViewer.viewer,a.position,1e3,Hn,e),!0):(a.flyTo(e&&e*1e3),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Ac,"type",Ac.register("ESCesiumViewer",c.ESUEWidget.type,Ac));let Sg=Ac;const fc=class fc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Wn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(fc,"type",fc.register("ESCesiumViewer",c.ESUnrealActor.type,fc));let Eg=fc;var RO=_.Primitive._modifyShaderPosition;_.Primitive._modifyShaderPosition=function(t,i,e){var i=RO(t,i,e);return t.isCameraVideo&&i.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(i=i.replace("void main()",`
3274
3274
  #ifdef XBSJ_CAMERA_VIDEO
3275
3275
  uniform mat4 u_boxMV;
3276
3276
  #endif
@@ -3295,7 +3295,7 @@ ${kx}
3295
3295
  #ifdef XBSJ_CAMERA_VIDEO
3296
3296
  position = vec4(position3DLow + position3DHigh, 1.0);
3297
3297
  #endif
3298
- `)),i};var RO=_.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes;_.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes=function(t){return _.defined(t.isCameraVideo)?!0:RO(t)};var UO=_.ShadowVolumeAppearance.prototype.createFragmentShader;_.ShadowVolumeAppearance.prototype.createFragmentShader=function(t){var n=UO.bind(this)(t);if(this._appearance.isCameraVideo){var e=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];e.forEach(function(i){var o=n.defines.indexOf(i);o!==-1&&n.defines.splice(o,1)}),n.defines.push("XBSJ_CAMERA_VIDEO"),n.sources.forEach(function(i,o){i.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n.sources[o]=i.replace("void main(void)",`
3298
+ `)),i};var UO=_.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes;_.ShadowVolumeAppearance.hasAttributesForTextureCoordinatePlanes=function(t){return _.defined(t.isCameraVideo)?!0:UO(t)};var OO=_.ShadowVolumeAppearance.prototype.createFragmentShader;_.ShadowVolumeAppearance.prototype.createFragmentShader=function(t){var n=OO.bind(this)(t);if(this._appearance.isCameraVideo){var e=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];e.forEach(function(i){var o=n.defines.indexOf(i);o!==-1&&n.defines.splice(o,1)}),n.defines.push("XBSJ_CAMERA_VIDEO"),n.sources.forEach(function(i,o){i.indexOf("XBSJ_CAMERA_VIDEO")===-1&&(n.sources[o]=i.replace("void main(void)",`
3299
3299
  #ifdef XBSJ_CAMERA_VIDEO
3300
3300
  uniform mat4 u_inverseBoxMV;
3301
3301
  #endif
@@ -3310,7 +3310,7 @@ ${kx}
3310
3310
  #endif
3311
3311
 
3312
3312
  czm_material material = czm_getMaterial(materialInput);
3313
- `))})}return n};var OO=_.ShadowVolumeAppearance.prototype.createVertexShader;_.ShadowVolumeAppearance.prototype.createVertexShader=function(t,n,e,i){var o=OO.bind(this)(t,n,e,i);if(this._appearance.isCameraVideo){var r=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];r.forEach(function(a){var s=o.defines.indexOf(a);s!==-1&&o.defines.splice(s,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var LO=new _.Cartesian3;function qx(t){var n=new _.Cartesian3(-1,-1,-1),e=new _.Cartesian3(1,1,1);n.y+=1.001,e.y+=1.001;var i=new Float64Array(8*3);i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z;var o=new _.GeometryAttributes;o.position=new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:i});var r=new Uint16Array(6*2*3);r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;for(var a=0;a<36;a+=3)r[a]=r[a]^r[a+2],r[a+2]=r[a]^r[a+2],r[a]=r[a]^r[a+2];var s;t&&(s=new Uint16Array(24),s[0]=0,s[1]=1,s[2]=1,s[3]=2,s[4]=2,s[5]=3,s[6]=3,s[7]=0,s[8]=4,s[9]=5,s[10]=5,s[11]=6,s[12]=6,s[13]=7,s[14]=7,s[15]=4,s[16]=0,s[17]=4,s[18]=1,s[19]=5,s[20]=2,s[21]=6,s[22]=3,s[23]=7);var l=_.Cartesian3.subtract(e,n,LO),u=_.Cartesian3.magnitude(l)*.5;return new _.Geometry({attributes:o,indices:t?s:r,primitiveType:t?_.PrimitiveType.LINES:_.PrimitiveType.TRIANGLES,boundingSphere:new _.BoundingSphere(_.Cartesian3.ZERO,u)})}var zO=`
3313
+ `))})}return n};var LO=_.ShadowVolumeAppearance.prototype.createVertexShader;_.ShadowVolumeAppearance.prototype.createVertexShader=function(t,n,e,i){var o=LO.bind(this)(t,n,e,i);if(this._appearance.isCameraVideo){var r=["TEXTURE_COORDINATES","CULL_FRAGMENTS","USES_ST"];r.forEach(function(a){var s=o.defines.indexOf(a);s!==-1&&o.defines.splice(s,1)}),o.defines.push("XBSJ_CAMERA_VIDEO")}return o};var zO=new _.Cartesian3;function qx(t){var n=new _.Cartesian3(-1,-1,-1),e=new _.Cartesian3(1,1,1);n.y+=1.001,e.y+=1.001;var i=new Float64Array(8*3);i[0]=n.x,i[1]=n.y,i[2]=n.z,i[3]=e.x,i[4]=n.y,i[5]=n.z,i[6]=e.x,i[7]=e.y,i[8]=n.z,i[9]=n.x,i[10]=e.y,i[11]=n.z,i[12]=n.x,i[13]=n.y,i[14]=e.z,i[15]=e.x,i[16]=n.y,i[17]=e.z,i[18]=e.x,i[19]=e.y,i[20]=e.z,i[21]=n.x,i[22]=e.y,i[23]=e.z;var o=new _.GeometryAttributes;o.position=new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:i});var r=new Uint16Array(6*2*3);r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;for(var a=0;a<36;a+=3)r[a]=r[a]^r[a+2],r[a+2]=r[a]^r[a+2],r[a]=r[a]^r[a+2];var s;t&&(s=new Uint16Array(24),s[0]=0,s[1]=1,s[2]=1,s[3]=2,s[4]=2,s[5]=3,s[6]=3,s[7]=0,s[8]=4,s[9]=5,s[10]=5,s[11]=6,s[12]=6,s[13]=7,s[14]=7,s[15]=4,s[16]=0,s[17]=4,s[18]=1,s[19]=5,s[20]=2,s[21]=6,s[22]=3,s[23]=7);var l=_.Cartesian3.subtract(e,n,zO),u=_.Cartesian3.magnitude(l)*.5;return new _.Geometry({attributes:o,indices:t?s:r,primitiveType:t?_.PrimitiveType.LINES:_.PrimitiveType.TRIANGLES,boundingSphere:new _.BoundingSphere(_.Cartesian3.ZERO,u)})}var kO=`
3314
3314
  in vec3 position3DHigh;
3315
3315
  in vec3 position3DLow;
3316
3316
  in vec4 color;
@@ -3331,7 +3331,7 @@ void main()
3331
3331
  p.w = 1.0;
3332
3332
  gl_Position = czm_projection * p;
3333
3333
  }
3334
- `;function Xl(t){if(!_.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var n=t.showHelperPrimitive??!1;this.inverseViewMatrix=_.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new _.Matrix4,_.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new _.PerspectiveFrustum({fov:_.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new _.Matrix4,this._primitiveModelMatrix=new _.Matrix4,this._inverseBoxMV=new _.Matrix4;var e=this,i={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new _.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:_.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 A=this.videoTextureFunc&&this.videoTextureFunc();return A||u()}}{const u=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const A=this.alphaTextureFunc&&this.alphaTextureFunc();return A||u()}}var r=new _.MaterialAppearance({material:o,closed:!1});r._vertexFormat=_.VertexFormat.POSITION_ONLY,r.isCameraVideo=!0;var a=new _.ClassificationPrimitive({geometryInstances:new _.GeometryInstance({geometry:qx(),attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(new _.Color(1,0,0,1)),show:new _.ShowGeometryInstanceAttribute(!0),isCameraVideo:new _.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:_.ClassificationType.CESIUM_3D_TILE,_uniformMap:i,appearance:r,asynchronous:!1,compressVertices:!1,allowPicking:!1});a.isCameraVideo=!0,Object.defineProperties(a,{_sp:{set:function(u){if(this.__sp!==u){if(u){var A=u,h=A.vertexShaderSource;h.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&h.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=A}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=a;var s=new _.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:zO});s.uniforms={u_boxMV:this._boxMV};var l=new _.Primitive({geometryInstances:new _.GeometryInstance({geometry:qx(!0),attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(new _.Color(1,0,0,1)),show:new _.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:s,asynchronous:!1,compressVertices:!1,cull:!1,show:n});this._helperPrimitive=l,this._projectionMatrix=new _.Matrix4,this._inverseViewProjectionMatrix=new _.Matrix4,this._viewProjectionMatrix=new _.Matrix4,this.show=!0}Xl.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new _.Cartesian3,this._scratchBS=this._scratchBS||new _.BoundingSphere;const a=_.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),s=this.frustum.far,l=this._scratchBS;if(_.Cartesian3.clone(a,l.center),l.radius=s,t.cullingVolume.computeVisibility(l)===_.Intersect.OUTSIDE)return;const u=t.camera;if(u&&u.getPixelSize&&Ni(u._scene,l.center,20)>l.radius)return}var n=_.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=_.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(n||_.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||_.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!n||!e){var i=this._inverseViewProjectionMatrix;_.Matrix4.inverse(this._projectionMatrix,i),_.Matrix4.multiply(this._inverseViewMatrix,i,i);var o=this._viewProjectionMatrix;_.Matrix4.inverse(i,o);var r=this._primitiveModelMatrix;_.Matrix4.fromUniformScale(this.frustum.far,r),_.Matrix4.multiply(this._inverseViewMatrix,r,r),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),_.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),_.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Xl.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Xl.prototype.isDestroyed=function(){return!1},Xl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),_.destroyObject(this)};class ma extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_resetWithCameraInfoEvent",this.disposeVar(new c.Event));L(this,"_sharedCzmTexture");L(this,"_fovy",this.disposeVar(c.react(0)));L(this,"_fovyUpdate",(()=>{const e=_.Math.toRadians,i=_.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(r-this.fovy)<1e-5||(this.fovy=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());L(this,"_fovx",this.disposeVar(c.react(0)));L(this,"_fovxUpdate",(()=>{const e=_.Math.toRadians,i=_.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(r-this.fovx)<1e-5||(this.fovx=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());L(this,"_xbsjCameraVideoResettingEvent");L(this,"_xbsjCameraVideoResetting");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i);{const r=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};r(),this.ad(this.czmTextureIdChanged.don(r))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new c.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new QO(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const r=e.getCameraInfo();r&&(this.position=r.position,this.rotation=r.rotation)})),this.dispose(this.flyToEvent.disposableOn(r=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}Fe(e.viewer,this.position,0,this.rotation,r)}}))}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}}L(ma,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(ma||(ma={})),c.extendClassProps(ma.prototype,ma.createDefaultProps);var bf=new _.Matrix3;function kO(t,n){const{position:e,heading:i,pitch:o,roll:r}=t,a=_.Transforms.eastNorthUpToFixedFrame(e,void 0,n);var s=_.Matrix3.fromRotationX(_.Math.PI_OVER_TWO,bf);return _.Matrix4.multiplyByMatrix3(a,s,a),s=_.Matrix3.fromRotationY(-i,bf),_.Matrix4.multiplyByMatrix3(a,s,a),s=_.Matrix3.fromRotationX(o,bf),_.Matrix4.multiplyByMatrix3(a,s,a),s=_.Matrix3.fromRotationZ(-r,bf),_.Matrix4.multiplyByMatrix3(a,s,a),a}class QO extends c.Destroyable{constructor(e,i){super();L(this,"_xbsjCameraVideo");const{viewer:o}=i;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:r}=e;if(!r)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[a,s,l]}=e,u=_.Math.toRadians,A=_.Cartesian3.fromDegrees(...r),h=kO({position:A,heading:u(a),pitch:u(s),roll:u(l)}),{fov:f,aspectRatio:d,near:p,far:g}=e,v=new _.PerspectiveFrustum({fov:u(f),aspectRatio:d,near:p,far:g}),y=new Xl({inverseViewMatrix:h,frustum:v,showHelperPrimitive:!0});this._xbsjCameraVideo=y,this.dispose(()=>y.destroy()),y.ESSceneObjectID=e.id,o.scene.primitives.add(y),this.dispose(()=>o.scene.primitives.remove(y));{const m=()=>{const b=e.getCurrentCzmTexture();if(b&&b instanceof ht)return b.texture};this.xbsjCameraVideo.videoTextureFunc=m}{const m=()=>{y.showHelperPrimitive=e.showHelperPrimitive};m(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(m))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const pc=class pc extends He{constructor(e,i){super(e,i);L(this,"_czmCameraVideo");L(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new ma(i,e.id)),this._czmTexture=this.dv(new ht(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:r}=this,{czmTexture:a}=this;r.czmTextureId=a.id,this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(Mt([r,"rotation"],[e,"rotation"])),this.d(c.track([r,"showHelperPrimitive"],[e,"showFrustum"])),this.d(c.track([a,"uriType"],[e,"videoStreamType"]));{const s=()=>{const u=e.fov??c.ESVideoFusion.defaults.fov,A=e.aspectRatio??c.ESVideoFusion.defaults.aspectRatio;r.fovx=_.Math.clamp(u,.001,179.9),r.aspectRatio=_.Math.clamp(A,.001,Number.MAX_SAFE_INTEGER)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(l.disposableOn(s))}{const s=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};s(),this.ad(e.farChanged.don(s)),this.d(c.track([e,"far"],[r,"far"]))}{const s=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};s(),this.ad(e.nearChanged.don(s))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{r.fovx=e.fov}));{const s=()=>{e.videoStreamUrl&&(a.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};s(),this.d(e.videoStreamUrlChanged.disposableOn(s))}{const s=()=>{a.loop=e.looping};s(),this.d(e.loopingChanged.don(s))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{r.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.far??c.ESVideoFusion.defaults.far;return o.position?(Gn(r,o,i,o.position,a,e),!0):!1}}};L(pc,"type",pc.register("ESCesiumViewer",c.ESVideoFusion.type,pc));let Pg=pc;function VO(t,n){const e=t,i=n,o=Math.cos,r=Math.sin;var a=[o(-e)*o(-i),r(-e)*o(-i),r(-i)];return a}function Kx(t,n,e){return t*(-.5+e/n)}function Zx(t,n,e,i){const o=new Float32Array((e+1)*(i+1)*3+3);for(let r=0;r<e+1;++r)for(let a=0;a<i+1;++a){const s=VO(Kx(t,e,r),Kx(n,i,a));o[(a*(e+1)+r)*3+0]=s[0],o[(a*(e+1)+r)*3+1]=s[1],o[(a*(e+1)+r)*3+2]=s[2]}return o[(e+1)*(i+1)*3+0]=0,o[(e+1)*(i+1)*3+1]=0,o[(e+1)*(i+1)*3+2]=0,o}function NO(t,n){var e=new Uint16Array(t*n*6);for(let i=0;i<t;++i)for(let o=0;o<n;++o){const r=o*(t+1)+i,a=o*(t+1)+i+1,s=(o+1)*(t+1)+i,l=(o+1)*(t+1)+i+1,u=(o*t+i)*6;e[u+0]=r,e[u+1]=a,e[u+2]=l,e[u+3]=r,e[u+4]=l,e[u+5]=s}return e}function HO(t,n,e,i){const o=t*e,r=n*i,a=new Uint16Array((t+1)*(r*2)+(n+1)*(o*2)+4*2);for(let d=0;d<t+1;++d)for(let p=0;p<r;++p){const g=d*e;a[(d*r+p)*2+0]=p*(o+1)+g,a[(d*r+p)*2+1]=(p+1)*(o+1)+g}const s=(t+1)*(r*2);for(let d=0;d<n+1;++d)for(let p=0;p<o;++p){const g=d*i;a[s+(p+d*o)*2+0]=g*(o+1)+p,a[s+(p+d*o)*2+1]=g*(o+1)+p+1}const l=(t+1)*(r*2)+(n+1)*(o*2),u=0,A=o,h=(o+1)*r,f=(o+1)*(r+1)-1;return a[l+0]=u,a[l+1]=(o+1)*(r+1),a[l+2]=A,a[l+3]=(o+1)*(r+1),a[l+4]=h,a[l+5]=(o+1)*(r+1),a[l+6]=f,a[l+7]=(o+1)*(r+1),a}var GO=`
3334
+ `;function Xl(t){if(!_.defined(t.inverseViewMatrix))throw new Error("XbsjCameraVideo error!");this.videoTextureFunc=t.videoTextureFunc,this.alphaTextureFunc=t.alphaTextureFunc;var n=t.showHelperPrimitive??!1;this.inverseViewMatrix=_.Matrix4.clone(t.inverseViewMatrix),this._inverseViewMatrix=new _.Matrix4,_.defined(t.frustum)?this.frustum=t.frustum.clone():this.frustum=new _.PerspectiveFrustum({fov:_.Math.toRadians(30),aspectRatio:1.333,near:10,far:100}),this._boxMV=new _.Matrix4,this._primitiveModelMatrix=new _.Matrix4,this._inverseBoxMV=new _.Matrix4;var e=this,i={u_inverseBoxMV:function(){return e._inverseBoxMV},u_boxMV:function(){return e._boxMV}},o=new _.Material({fabric:{type:"XbsjCameraVideo",uniforms:{image:"",alphaImage:_.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 A=this.videoTextureFunc&&this.videoTextureFunc();return A||u()}}{const u=o._uniforms.alphaImage_1;o._uniforms.alphaImage_1=()=>{const A=this.alphaTextureFunc&&this.alphaTextureFunc();return A||u()}}var r=new _.MaterialAppearance({material:o,closed:!1});r._vertexFormat=_.VertexFormat.POSITION_ONLY,r.isCameraVideo=!0;var a=new _.ClassificationPrimitive({geometryInstances:new _.GeometryInstance({geometry:qx(),attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(new _.Color(1,0,0,1)),show:new _.ShowGeometryInstanceAttribute(!0),isCameraVideo:new _.ShowGeometryInstanceAttribute(!0)},id:"volume"}),classificationType:_.ClassificationType.CESIUM_3D_TILE,_uniformMap:i,appearance:r,asynchronous:!1,compressVertices:!1,allowPicking:!1});a.isCameraVideo=!0,Object.defineProperties(a,{_sp:{set:function(u){if(this.__sp!==u){if(u){var A=u,h=A.vertexShaderSource;h.defines.indexOf("XBSJ_CAMERA_VIDEO")===-1&&h.defines.push("XBSJ_CAMERA_VIDEO")}this.__sp=A}},get:function(){return this.__sp}},cameraInfo:{get:function(){return this._cameraInfo}}}),this._primitive=a;var s=new _.PerInstanceColorAppearance({closed:!1,flat:!0,translucent:!1,vertexShaderSource:kO});s.uniforms={u_boxMV:this._boxMV};var l=new _.Primitive({geometryInstances:new _.GeometryInstance({geometry:qx(!0),attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(new _.Color(1,0,0,1)),show:new _.ShowGeometryInstanceAttribute(!0)},id:"cameraVideoHelper"}),appearance:s,asynchronous:!1,compressVertices:!1,cull:!1,show:n});this._helperPrimitive=l,this._projectionMatrix=new _.Matrix4,this._inverseViewProjectionMatrix=new _.Matrix4,this._viewProjectionMatrix=new _.Matrix4,this.show=!0}Xl.prototype.update=function(t){if(this.show){{this._scratchCartesian=this._scratchCartesian||new _.Cartesian3,this._scratchBS=this._scratchBS||new _.BoundingSphere;const a=_.Matrix4.getTranslation(this.inverseViewMatrix,this._scratchCartesian),s=this.frustum.far,l=this._scratchBS;if(_.Cartesian3.clone(a,l.center),l.radius=s,t.cullingVolume.computeVisibility(l)===_.Intersect.OUTSIDE)return;const u=t.camera;if(u&&u.getPixelSize&&Ni(u._scene,l.center,20)>l.radius)return}var n=_.Matrix4.equals(this.frustum.projectionMatrix,this._projectionMatrix),e=_.Matrix4.equals(this.inverseViewMatrix,this._inverseViewMatrix);if(n||_.Matrix4.clone(this.frustum.projectionMatrix,this._projectionMatrix),e||_.Matrix4.clone(this.inverseViewMatrix,this._inverseViewMatrix),!n||!e){var i=this._inverseViewProjectionMatrix;_.Matrix4.inverse(this._projectionMatrix,i),_.Matrix4.multiply(this._inverseViewMatrix,i,i);var o=this._viewProjectionMatrix;_.Matrix4.inverse(i,o);var r=this._primitiveModelMatrix;_.Matrix4.fromUniformScale(this.frustum.far,r),_.Matrix4.multiply(this._inverseViewMatrix,r,r),this._helperPrimitive.modelMatrix=this._primitiveModelMatrix}this._primitive._primitive&&(this._primitive._primitive.modelMatrix=this._primitiveModelMatrix),_.Matrix4.multiply(t.camera.viewMatrix,this._inverseViewProjectionMatrix,this._boxMV),_.Matrix4.multiply(this._viewProjectionMatrix,t.camera.inverseViewMatrix,this._inverseBoxMV),this._primitive.update(t),this._helperPrimitive.update(t)}},Object.defineProperties(Xl.prototype,{showHelperPrimitive:{set:function(t){this._helperPrimitive.show=t},get:function(){return this._helperPrimitive.show}}}),Xl.prototype.isDestroyed=function(){return!1},Xl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._helperPrimitive=this._helperPrimitive&&this._helperPrimitive.destroy(),_.destroyObject(this)};class ma extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_resetWithCameraInfoEvent",this.disposeVar(new c.Event));L(this,"_sharedCzmTexture");L(this,"_fovy",this.disposeVar(c.react(0)));L(this,"_fovyUpdate",(()=>{const e=_.Math.toRadians,i=_.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)/this.aspectRatio)*2);Math.abs(r-this.fovy)<1e-5||(this.fovy=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio<=1?e(this.fovy):Math.atan(Math.tan(e(this.fovy)*.5)*this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovyChanged.disposableOn(o))}})());L(this,"_fovx",this.disposeVar(c.react(0)));L(this,"_fovxUpdate",(()=>{const e=_.Math.toRadians,i=_.Math.toDegrees;{const o=()=>{const r=i(this.aspectRatio>1?e(this.fov):Math.atan(Math.tan(e(this.fov)*.5)*this.aspectRatio)*2);Math.abs(r-this.fovx)<1e-5||(this.fovx=r)};o(),this.dispose(this.fovChanged.disposableOn(o)),this.dispose(this.aspectRatioChanged.disposableOn(o))}{const o=()=>{const r=i(this.aspectRatio>1?e(this.fovx):Math.atan(Math.tan(e(this.fovx)*.5)/this.aspectRatio)*2);Math.abs(r-this.fov)<1e-5||(this.fov=r)};o(),this.dispose(this.fovxChanged.disposableOn(o))}})());L(this,"_xbsjCameraVideoResettingEvent");L(this,"_xbsjCameraVideoResetting");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this.id=i);{const r=()=>{this.czmTextureId&&(this._sharedCzmTexture=window.czmTexture[this.czmTextureId])};r(),this.ad(this.czmTextureIdChanged.don(r))}if(this._xbsjCameraVideoResettingEvent=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged,this.positionChanged,this.rotationChanged,this.fovChanged,this.aspectRatioChanged,this.nearChanged,this.farChanged)),this._xbsjCameraVideoResetting=this.disposeVar(new c.ObjResettingWithEvent(this._xbsjCameraVideoResettingEvent,()=>{if(!(!this.show||!this.position))return new VO(this,e)})),!e.viewer){console.warn("viewer is undefined!");return}this.dispose(this.resetWithCameraInfoEvent.disposableOn(()=>{if(!e.actived)return;const r=e.getCameraInfo();r&&(this.position=r.position,this.rotation=r.rotation)})),this.dispose(this.flyToEvent.disposableOn(r=>{if(e.actived){if(!this.position){console.warn("CzmCameraVideo无法飞入,因为没有位置:!sceneObject.position");return}Fe(e.viewer,this.position,0,this.rotation,r)}}))}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}}L(ma,"defaults",{position:[116.39,39.9,100],czmTextureId:""}),(t=>{t.createDefaultProps=()=>({show:!0,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),fov:30,aspectRatio:1.333,near:3,far:100,showHelperPrimitive:!0,czmTextureId:void 0})})(ma||(ma={})),c.extendClassProps(ma.prototype,ma.createDefaultProps);var bf=new _.Matrix3;function QO(t,n){const{position:e,heading:i,pitch:o,roll:r}=t,a=_.Transforms.eastNorthUpToFixedFrame(e,void 0,n);var s=_.Matrix3.fromRotationX(_.Math.PI_OVER_TWO,bf);return _.Matrix4.multiplyByMatrix3(a,s,a),s=_.Matrix3.fromRotationY(-i,bf),_.Matrix4.multiplyByMatrix3(a,s,a),s=_.Matrix3.fromRotationX(o,bf),_.Matrix4.multiplyByMatrix3(a,s,a),s=_.Matrix3.fromRotationZ(-r,bf),_.Matrix4.multiplyByMatrix3(a,s,a),a}class VO extends c.Destroyable{constructor(e,i){super();L(this,"_xbsjCameraVideo");const{viewer:o}=i;if(!o)throw new Error("XbsjCameraVideoResetting error: !viewer");const{position:r}=e;if(!r)throw new Error("XbsjCameraVideoResetting error: !position");const{rotation:[a,s,l]}=e,u=_.Math.toRadians,A=_.Cartesian3.fromDegrees(...r),h=QO({position:A,heading:u(a),pitch:u(s),roll:u(l)}),{fov:f,aspectRatio:d,near:p,far:g}=e,v=new _.PerspectiveFrustum({fov:u(f),aspectRatio:d,near:p,far:g}),y=new Xl({inverseViewMatrix:h,frustum:v,showHelperPrimitive:!0});this._xbsjCameraVideo=y,this.dispose(()=>y.destroy()),y.ESSceneObjectID=e.id,o.scene.primitives.add(y),this.dispose(()=>o.scene.primitives.remove(y));{const m=()=>{const b=e.getCurrentCzmTexture();if(b&&b instanceof ht)return b.texture};this.xbsjCameraVideo.videoTextureFunc=m}{const m=()=>{y.showHelperPrimitive=e.showHelperPrimitive};m(),this.dispose(e.showHelperPrimitiveChanged.disposableOn(m))}}get xbsjCameraVideo(){return this._xbsjCameraVideo}}const pc=class pc extends He{constructor(e,i){super(e,i);L(this,"_czmCameraVideo");L(this,"_czmTexture");if(this._czmCameraVideo=this.dv(new ma(i,e.id)),this._czmTexture=this.dv(new ht(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const{czmCameraVideo:r}=this,{czmTexture:a}=this;r.czmTextureId=a.id,this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"position"],[e,"position"])),this.d(Mt([r,"rotation"],[e,"rotation"])),this.d(c.track([r,"showHelperPrimitive"],[e,"showFrustum"])),this.d(c.track([a,"uriType"],[e,"videoStreamType"]));{const s=()=>{const u=e.fov??c.ESVideoFusion.defaults.fov,A=e.aspectRatio??c.ESVideoFusion.defaults.aspectRatio;r.fovx=_.Math.clamp(u,.001,179.9),r.aspectRatio=_.Math.clamp(A,.001,Number.MAX_SAFE_INTEGER)};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(l.disposableOn(s))}{const s=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};s(),this.ad(e.farChanged.don(s)),this.d(c.track([e,"far"],[r,"far"]))}{const s=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};s(),this.ad(e.nearChanged.don(s))}this.dispose(e.aspectRatioChanged.disposableOn(()=>{r.fovx=e.fov}));{const s=()=>{e.videoStreamUrl&&(a.uri=typeof e.videoStreamUrl=="string"?e.videoStreamUrl:e.videoStreamUrl.url)};s(),this.d(e.videoStreamUrlChanged.disposableOn(s))}{const s=()=>{a.loop=e.looping};s(),this.d(e.loopingChanged.don(s))}this.d(e.resetWithCameraInfoEvent.disposableOn(()=>{r.resetWithCameraInfo()}))}get czmCameraVideo(){return this._czmCameraVideo}get czmTexture(){return this._czmTexture}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.far??c.ESVideoFusion.defaults.far;return o.position?(Gn(r,o,i,o.position,a,e),!0):!1}}};L(pc,"type",pc.register("ESCesiumViewer",c.ESVideoFusion.type,pc));let Pg=pc;function NO(t,n){const e=t,i=n,o=Math.cos,r=Math.sin;var a=[o(-e)*o(-i),r(-e)*o(-i),r(-i)];return a}function Kx(t,n,e){return t*(-.5+e/n)}function Zx(t,n,e,i){const o=new Float32Array((e+1)*(i+1)*3+3);for(let r=0;r<e+1;++r)for(let a=0;a<i+1;++a){const s=NO(Kx(t,e,r),Kx(n,i,a));o[(a*(e+1)+r)*3+0]=s[0],o[(a*(e+1)+r)*3+1]=s[1],o[(a*(e+1)+r)*3+2]=s[2]}return o[(e+1)*(i+1)*3+0]=0,o[(e+1)*(i+1)*3+1]=0,o[(e+1)*(i+1)*3+2]=0,o}function HO(t,n){var e=new Uint16Array(t*n*6);for(let i=0;i<t;++i)for(let o=0;o<n;++o){const r=o*(t+1)+i,a=o*(t+1)+i+1,s=(o+1)*(t+1)+i,l=(o+1)*(t+1)+i+1,u=(o*t+i)*6;e[u+0]=r,e[u+1]=a,e[u+2]=l,e[u+3]=r,e[u+4]=l,e[u+5]=s}return e}function GO(t,n,e,i){const o=t*e,r=n*i,a=new Uint16Array((t+1)*(r*2)+(n+1)*(o*2)+4*2);for(let d=0;d<t+1;++d)for(let p=0;p<r;++p){const g=d*e;a[(d*r+p)*2+0]=p*(o+1)+g,a[(d*r+p)*2+1]=(p+1)*(o+1)+g}const s=(t+1)*(r*2);for(let d=0;d<n+1;++d)for(let p=0;p<o;++p){const g=d*i;a[s+(p+d*o)*2+0]=g*(o+1)+p,a[s+(p+d*o)*2+1]=g*(o+1)+p+1}const l=(t+1)*(r*2)+(n+1)*(o*2),u=0,A=o,h=(o+1)*r,f=(o+1)*(r+1)-1;return a[l+0]=u,a[l+1]=(o+1)*(r+1),a[l+2]=A,a[l+3]=(o+1)*(r+1),a[l+4]=h,a[l+5]=(o+1)*(r+1),a[l+6]=f,a[l+7]=(o+1)*(r+1),a}var WO=`
3335
3335
  // vtxf 使用double类型的position进行计算
3336
3336
  // in vec3 position3DHigh;
3337
3337
  // in vec3 position3DLow;
@@ -3358,7 +3358,7 @@ void main()
3358
3358
  // v_st = st;
3359
3359
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
3360
3360
  }
3361
- `,WO=`
3361
+ `,jO=`
3362
3362
  in vec3 v_positionEC;
3363
3363
  in vec3 v_normalEC;
3364
3364
  // vec2 v_st;
@@ -3393,7 +3393,7 @@ void main()
3393
3393
  out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
3394
3394
  #endif
3395
3395
  }
3396
- `,jO={position:0,normal:1};class qO{constructor(n){this.modelMatrix=n.modelMatrix??new _.Matrix4,this.fovH=n.fovH??_.Math.toRadians(60),this.fovV=n.fovV??_.Math.toRadians(30),this.segmentH=n.segmentH??6,this.segmentV=n.segmentV??3,this.subSegmentH=n.subSegmentH??3,this.subSegmentV=n.subSegmentV??3,this._faceColor=n.faceColor??new _.Color(1,1,0,.5),this._lineColor=n.lineColor??new _.Color(1,0,0),this.show=n.lineColor??!0,this._modelMatrix=_.Matrix4.clone(_.Matrix4.IDENTITY),this._fovH=0,this._fovV=0,this._segmentH=1,this._segmentV=1,this._subSegmentH=1,this._subSegmentV=1,this._boundingSphere=new _.BoundingSphere,this._initBoundingSphere=void 0,this._command=void 0}_createCommand(n){const e=this._subSegmentH*this._segmentH,i=this._subSegmentV*this._segmentV;var o=Zx(this._fovH,this._fovV,e,i),r=Zx(this._fovH,this._fovV,e,i),a=NO(e,i),s=HO(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV),l=!0,u=!1,A=_.Appearance.getDefaultRenderState(l,u,void 0),h=_.RenderState.fromCache(A),f=new _.ShaderSource({sources:[GO]}),d=new _.ShaderSource({sources:[WO]}),p={xbsjColor:()=>this._faceColor},g={xbsjColor:()=>this._lineColor},v=_.ShaderProgram.fromCache({context:n,vertexShaderSource:f,fragmentShaderSource:d,attributeLocations:jO});this._shaderprogram=v;var y=_.Buffer.createVertexBuffer({context:n,typedArray:o,usage:_.BufferUsage.STATIC_DRAW}),m=_.Buffer.createVertexBuffer({context:n,typedArray:r,usage:_.BufferUsage.STATIC_DRAW}),b=_.Buffer.createIndexBuffer({context:n,typedArray:a,usage:_.BufferUsage.STATIC_DRAW,indexDatatype:_.IndexDatatype.UNSIGNED_SHORT}),x=_.Buffer.createIndexBuffer({context:n,typedArray:s,usage:_.BufferUsage.STATIC_DRAW,indexDatatype:_.IndexDatatype.UNSIGNED_SHORT});const E=new _.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT}],indexBuffer:b}),B=new _.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT}],indexBuffer:x});this._initBoundingSphere=_.BoundingSphere.fromVertices(o),this._command=new _.DrawCommand({vertexArray:E,primitiveType:_.PrimitiveType.TRIANGLES,renderState:h,shaderProgram:v,uniformMap:p,owner:this,pass:_.Pass.TRANSLUCENT,modelMatrix:new _.Matrix4,boundingVolume:new _.BoundingSphere,cull:!0}),this._lineCommand=new _.DrawCommand({vertexArray:B,primitiveType:_.PrimitiveType.LINES,renderState:h,shaderProgram:v,uniformMap:g,owner:this,pass:_.Pass.TRANSLUCENT,modelMatrix:new _.Matrix4,boundingVolume:new _.BoundingSphere,cull:!0})}update(n){if(!this.show||!n.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=_.clone(_.Matrix4.IDENTITY),this._destroyVideoMemory()),_.defined(this._command)||this._createCommand(n.context),_.Matrix4.equals(this.modelMatrix,this._modelMatrix)||(_.Matrix4.clone(this.modelMatrix,this._modelMatrix),this._command.modelMatrix=_.Matrix4.IDENTITY,this._command.modelMatrix=this._modelMatrix,this._command.boundingVolume=_.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere),this._lineCommand.modelMatrix=_.Matrix4.IDENTITY,this._lineCommand.modelMatrix=this._modelMatrix,this._lineCommand.boundingVolume=_.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere)),this._command&&n.commandList.push(this._command),this._lineCommand&&n.commandList.push(this._lineCommand)}isDestroyed(){return!1}_destroyVideoMemory(){this._shaderprogram=this._shaderprogram&&this._shaderprogram.destroy(),_.defined(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command=void 0),_.defined(this._lineCommand)&&(this._lineCommand.vertexArray=this._lineCommand.vertexArray&&this._lineCommand.vertexArray.destroy(),this._lineCommand=void 0)}destroy(){return this._destroyVideoMemory(),_.destroyObject(this)}}var KO=_.ShadowMapShader.createShadowReceiveFragmentShader;_.ShadowMapShader.createShadowReceiveFragmentShader=function(t,n,e,i,o){var r=n._isSpotLight,a=KO.bind(this)(t,n,e,i,o);if(r){var s="out_FragColor.rgb *= visibility;",l="out_FragColor.rgb *= (visibility < 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0));";a.sources[a.sources.length-1]=a.sources[a.sources.length-1].replace(s,l);{var s="vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);",l=s+"if (distance(positionEC.xyz, shadowMap_lightPositionEC.xyz) > shadowMap_lightPositionEC.w) { return; }";a.sources[a.sources.length-1]=a.sources[a.sources.length-1].replace(s,l)}}return a};function ZO(){var t=_.Matrix3.fromRotationZ(_.Math.PI*.5),n=_.Matrix3.fromRotationY(_.Math.PI*.5),e=new _.Matrix3;return _.Matrix3.multiply(t,n,e),e}const $O=ZO();class $x{_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(n){this._fovH=_.Math.PI/3,this._fovV=_.Math.PI/6,_.defined(n)||console.error("scene is not defined!"),this._scene=n,this._frustum=new _.PerspectiveFrustum,this._updateFov(),this._frustum.near=1,this._frustum.far=400,this._spotLightCamera=new _.Camera(n),this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap=new _.ShadowMap({context:n.context,lightCamera:this._spotLightCamera,cascadesEnabled:!1}),this._debugCameraPrimitive=new qO({}),this._enabledChangedEvent=new _.Event}update(n){if(this._viewshedShadowMap.enabled){if(n.shadowMaps.unshift(this._viewshedShadowMap),!this._frustum.equals(this._spotLightCamera.frustum)){this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap._pointLightRadius=this._frustum.far;const i=this.shadowMap._boundingSphere;i.radius=Math.random()}if(this._debugCameraPrimitive.show){var e=this._debugCameraPrimitive.modelMatrix;_.Matrix4.clone(this._spotLightCamera.inverseViewMatrix,e),_.Matrix4.multiplyByMatrix3(e,$O,e),_.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(n)}}}setView(n){this._spotLightCamera.setView(n)}get enabledChangedEvent(){return this._enabledChangedEvent}isDestroyed(){return!1}destroy(){return this._debugCameraPrimitive=this._debugCameraPrimitive&&this._debugCameraPrimitive.destroy(),this._viewshedShadowMap=this._viewshedShadowMap&&this._viewshedShadowMap.destroy(),_.destroyObject(this)}}Object.defineProperties($x.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 dc=class dc extends He{constructor(e,i){super(e,i);L(this,"_czmViewShed");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmViewShed=this.disposeVar(new $x(o.scene));const r=this._czmViewShed;r.ESSceneObjectID=e.id,o.scene.primitives.add(r),this.dispose(()=>o.scene.primitives.remove(r));{const a=()=>{if(e.fov==0||e.aspectRatio==0)return;const l=_.Math.toRadians(e.fov),u=_.Math.toRadians(e.fov/e.aspectRatio),A=_.Math.PI-1e-5;r.fovH=_.Math.clamp(l,-A,A),r.fovV=_.Math.clamp(u,-A,A)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(s.disposableOn(a))}{const a=()=>{r.enabled=!!e.position&&e.show,r.position&&(r.position=ft(e.position))};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,e.showChanged));this.dispose(s.disposableOn(a))}{const a=()=>{r.heading=_.Math.toRadians(e.rotation[0]+90),r.pitch=_.Math.toRadians(e.rotation[1]),r.roll=_.Math.toRadians(e.rotation[2])};a(),this.ad(e.rotationChanged.don(a))}{const a=()=>{r.showHelper=e.showFrustum??c.ESViewShed.defaults.showFrustum};a(),this.ad(e.showFrustumChanged.don(a))}{const a=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};a(),this.ad(e.farChanged.don(a))}{const a=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};a(),this.ad(e.nearChanged.don(a))}}get czmViewShed(){return this._czmViewShed}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.far??c.ESViewShed.defaults.far;return o.position?(Gn(r,o,i,o.position,a,e),!0):!1}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmViewShed&&(this.czmViewShed.showHelper=a&&(e.showFrustum??c.ESViewShed.defaults.showFrustum),this.czmViewShed.enabled=a&&e.show&&!!e.position)}}};L(dc,"type",dc.register("ESCesiumViewer",c.ESViewShed.type,dc));let Bg=dc;function XO(t,n,e){const i=document.createElement("div");let o,r="";const a=Object.keys(t.info);for(let l=0;l<a.length;l++){if(a[l].toLowerCase()=="title"){o=t.info[a[l]];continue}r+=`<div style="
3396
+ `,qO={position:0,normal:1};class KO{constructor(n){this.modelMatrix=n.modelMatrix??new _.Matrix4,this.fovH=n.fovH??_.Math.toRadians(60),this.fovV=n.fovV??_.Math.toRadians(30),this.segmentH=n.segmentH??6,this.segmentV=n.segmentV??3,this.subSegmentH=n.subSegmentH??3,this.subSegmentV=n.subSegmentV??3,this._faceColor=n.faceColor??new _.Color(1,1,0,.5),this._lineColor=n.lineColor??new _.Color(1,0,0),this.show=n.lineColor??!0,this._modelMatrix=_.Matrix4.clone(_.Matrix4.IDENTITY),this._fovH=0,this._fovV=0,this._segmentH=1,this._segmentV=1,this._subSegmentH=1,this._subSegmentV=1,this._boundingSphere=new _.BoundingSphere,this._initBoundingSphere=void 0,this._command=void 0}_createCommand(n){const e=this._subSegmentH*this._segmentH,i=this._subSegmentV*this._segmentV;var o=Zx(this._fovH,this._fovV,e,i),r=Zx(this._fovH,this._fovV,e,i),a=HO(e,i),s=GO(this._segmentH,this._segmentV,this._subSegmentH,this._subSegmentV),l=!0,u=!1,A=_.Appearance.getDefaultRenderState(l,u,void 0),h=_.RenderState.fromCache(A),f=new _.ShaderSource({sources:[WO]}),d=new _.ShaderSource({sources:[jO]}),p={xbsjColor:()=>this._faceColor},g={xbsjColor:()=>this._lineColor},v=_.ShaderProgram.fromCache({context:n,vertexShaderSource:f,fragmentShaderSource:d,attributeLocations:qO});this._shaderprogram=v;var y=_.Buffer.createVertexBuffer({context:n,typedArray:o,usage:_.BufferUsage.STATIC_DRAW}),m=_.Buffer.createVertexBuffer({context:n,typedArray:r,usage:_.BufferUsage.STATIC_DRAW}),b=_.Buffer.createIndexBuffer({context:n,typedArray:a,usage:_.BufferUsage.STATIC_DRAW,indexDatatype:_.IndexDatatype.UNSIGNED_SHORT}),x=_.Buffer.createIndexBuffer({context:n,typedArray:s,usage:_.BufferUsage.STATIC_DRAW,indexDatatype:_.IndexDatatype.UNSIGNED_SHORT});const E=new _.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT}],indexBuffer:b}),B=new _.VertexArray({context:n,attributes:[{index:0,vertexBuffer:y,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT},{index:1,vertexBuffer:m,componentsPerAttribute:3,componentDatatype:_.ComponentDatatype.FLOAT}],indexBuffer:x});this._initBoundingSphere=_.BoundingSphere.fromVertices(o),this._command=new _.DrawCommand({vertexArray:E,primitiveType:_.PrimitiveType.TRIANGLES,renderState:h,shaderProgram:v,uniformMap:p,owner:this,pass:_.Pass.TRANSLUCENT,modelMatrix:new _.Matrix4,boundingVolume:new _.BoundingSphere,cull:!0}),this._lineCommand=new _.DrawCommand({vertexArray:B,primitiveType:_.PrimitiveType.LINES,renderState:h,shaderProgram:v,uniformMap:g,owner:this,pass:_.Pass.TRANSLUCENT,modelMatrix:new _.Matrix4,boundingVolume:new _.BoundingSphere,cull:!0})}update(n){if(!this.show||!n.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=_.clone(_.Matrix4.IDENTITY),this._destroyVideoMemory()),_.defined(this._command)||this._createCommand(n.context),_.Matrix4.equals(this.modelMatrix,this._modelMatrix)||(_.Matrix4.clone(this.modelMatrix,this._modelMatrix),this._command.modelMatrix=_.Matrix4.IDENTITY,this._command.modelMatrix=this._modelMatrix,this._command.boundingVolume=_.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere),this._lineCommand.modelMatrix=_.Matrix4.IDENTITY,this._lineCommand.modelMatrix=this._modelMatrix,this._lineCommand.boundingVolume=_.BoundingSphere.transform(this._initBoundingSphere,this._modelMatrix,this._boundingSphere)),this._command&&n.commandList.push(this._command),this._lineCommand&&n.commandList.push(this._lineCommand)}isDestroyed(){return!1}_destroyVideoMemory(){this._shaderprogram=this._shaderprogram&&this._shaderprogram.destroy(),_.defined(this._command)&&(this._command.vertexArray=this._command.vertexArray&&this._command.vertexArray.destroy(),this._command=void 0),_.defined(this._lineCommand)&&(this._lineCommand.vertexArray=this._lineCommand.vertexArray&&this._lineCommand.vertexArray.destroy(),this._lineCommand=void 0)}destroy(){return this._destroyVideoMemory(),_.destroyObject(this)}}var ZO=_.ShadowMapShader.createShadowReceiveFragmentShader;_.ShadowMapShader.createShadowReceiveFragmentShader=function(t,n,e,i,o){var r=n._isSpotLight,a=ZO.bind(this)(t,n,e,i,o);if(r){var s="out_FragColor.rgb *= visibility;",l="out_FragColor.rgb *= (visibility < 0.99 ? vec3(1.0, 0.0, 0.0) : vec3(0.0, 1.0, 0.0));";a.sources[a.sources.length-1]=a.sources[a.sources.length-1].replace(s,l);{var s="vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);",l=s+"if (distance(positionEC.xyz, shadowMap_lightPositionEC.xyz) > shadowMap_lightPositionEC.w) { return; }";a.sources[a.sources.length-1]=a.sources[a.sources.length-1].replace(s,l)}}return a};function $O(){var t=_.Matrix3.fromRotationZ(_.Math.PI*.5),n=_.Matrix3.fromRotationY(_.Math.PI*.5),e=new _.Matrix3;return _.Matrix3.multiply(t,n,e),e}const XO=$O();class $x{_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(n){this._fovH=_.Math.PI/3,this._fovV=_.Math.PI/6,_.defined(n)||console.error("scene is not defined!"),this._scene=n,this._frustum=new _.PerspectiveFrustum,this._updateFov(),this._frustum.near=1,this._frustum.far=400,this._spotLightCamera=new _.Camera(n),this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap=new _.ShadowMap({context:n.context,lightCamera:this._spotLightCamera,cascadesEnabled:!1}),this._debugCameraPrimitive=new KO({}),this._enabledChangedEvent=new _.Event}update(n){if(this._viewshedShadowMap.enabled){if(n.shadowMaps.unshift(this._viewshedShadowMap),!this._frustum.equals(this._spotLightCamera.frustum)){this._frustum.clone(this._spotLightCamera.frustum),this._viewshedShadowMap._pointLightRadius=this._frustum.far;const i=this.shadowMap._boundingSphere;i.radius=Math.random()}if(this._debugCameraPrimitive.show){var e=this._debugCameraPrimitive.modelMatrix;_.Matrix4.clone(this._spotLightCamera.inverseViewMatrix,e),_.Matrix4.multiplyByMatrix3(e,XO,e),_.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(n)}}}setView(n){this._spotLightCamera.setView(n)}get enabledChangedEvent(){return this._enabledChangedEvent}isDestroyed(){return!1}destroy(){return this._debugCameraPrimitive=this._debugCameraPrimitive&&this._debugCameraPrimitive.destroy(),this._viewshedShadowMap=this._viewshedShadowMap&&this._viewshedShadowMap.destroy(),_.destroyObject(this)}}Object.defineProperties($x.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 dc=class dc extends He{constructor(e,i){super(e,i);L(this,"_czmViewShed");const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}this._czmViewShed=this.disposeVar(new $x(o.scene));const r=this._czmViewShed;r.ESSceneObjectID=e.id,o.scene.primitives.add(r),this.dispose(()=>o.scene.primitives.remove(r));{const a=()=>{if(e.fov==0||e.aspectRatio==0)return;const l=_.Math.toRadians(e.fov),u=_.Math.toRadians(e.fov/e.aspectRatio),A=_.Math.PI-1e-5;r.fovH=_.Math.clamp(l,-A,A),r.fovV=_.Math.clamp(u,-A,A)};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fovChanged,e.aspectRatioChanged));this.dispose(s.disposableOn(a))}{const a=()=>{r.enabled=!!e.position&&e.show,r.position&&(r.position=ft(e.position))};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.positionChanged,e.showChanged));this.dispose(s.disposableOn(a))}{const a=()=>{r.heading=_.Math.toRadians(e.rotation[0]+90),r.pitch=_.Math.toRadians(e.rotation[1]),r.roll=_.Math.toRadians(e.rotation[2])};a(),this.ad(e.rotationChanged.don(a))}{const a=()=>{r.showHelper=e.showFrustum??c.ESViewShed.defaults.showFrustum};a(),this.ad(e.showFrustumChanged.don(a))}{const a=()=>{if(e.far<e.near){e.far=e.near;return}r.far=e.far};a(),this.ad(e.farChanged.don(a))}{const a=()=>{e.near>e.far||e.near<=0||(r.near=e.near)};a(),this.ad(e.nearChanged.don(a))}}get czmViewShed(){return this._czmViewShed}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{const a=o.far??c.ESViewShed.defaults.far;return o.position?(Gn(r,o,i,o.position,a,e),!0):!1}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmViewShed&&(this.czmViewShed.showHelper=a&&(e.showFrustum??c.ESViewShed.defaults.showFrustum),this.czmViewShed.enabled=a&&e.show&&!!e.position)}}};L(dc,"type",dc.register("ESCesiumViewer",c.ESViewShed.type,dc));let Bg=dc;function YO(t,n,e){const i=document.createElement("div");let o,r="";const a=Object.keys(t.info);for(let l=0;l<a.length;l++){if(a[l].toLowerCase()=="title"){o=t.info[a[l]];continue}r+=`<div style="
3397
3397
  display: flex;
3398
3398
  font-size: 10px;
3399
3399
  width: 100%;">
@@ -3437,7 +3437,7 @@ void main()
3437
3437
  ${r}
3438
3438
  </div>
3439
3439
  </div>
3440
- </div>`;let s=document.createElement("style");return s.setAttribute("type","text/css"),s.innerHTML=YO,i.appendChild(s),i}const YO=`
3440
+ </div>`;let s=document.createElement("style");return s.setAttribute("type","text/css"),s.innerHTML=JO,i.appendChild(s),i}const JO=`
3441
3441
  /*定义滚动条高宽及背景
3442
3442
  高宽分别对应横竖滚动条的尺寸*/
3443
3443
  .info ::-webkit-scrollbar,.body ::-webkit-scrollbar {
@@ -3461,7 +3461,7 @@ void main()
3461
3461
  border-radius: 8px;
3462
3462
  -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, .3);
3463
3463
  background-color: green;
3464
- }`,mc=class mc extends Gl{constructor(e,i){super(e,i);L(this,"_widgetTemp");if(!i.viewer){console.warn("viewer is undefined!");return}(async()=>{const r="${earthsdk3-assets-script-dir}/assets/img/Info/",a=await Co(c.ESSceneObject.context.getStrFromEnv(r+"/InfoBackGround.png")),s=await Co(c.ESSceneObject.context.getStrFromEnv(r+"/InfoItemRowBackGround.png"));{const l=this.dv(c.createNextAnimateFrameEvent(e.screenRenderChanged,e.infoChanged));this.widgetTemp=this.disposeVar(new c.ObjResettingWithEvent(l,()=>{const u=XO(e,s,a);return e.screenRender?new Pr(e,i,u,Object.keys(e.info).length!=0):new BA(e,i,u,Object.keys(e.info).length!=0)}))}})()}get widgetTemp(){return this._widgetTemp}set widgetTemp(e){this._widgetTemp=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetTemp:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a)a.obj.flyTo(e,i);else{const s=setTimeout(()=>{clearTimeout(s),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}};L(mc,"type",mc.register("ESCesiumViewer",c.ESWidget.type,mc));let Tg=mc;const JO=`<?xml version="1.0" encoding="utf-8" ?>
3464
+ }`,mc=class mc extends Gl{constructor(e,i){super(e,i);L(this,"_widgetTemp");if(!i.viewer){console.warn("viewer is undefined!");return}(async()=>{const r="${earthsdk3-assets-script-dir}/assets/img/Info/",a=await Co(c.ESSceneObject.context.getStrFromEnv(r+"/InfoBackGround.png")),s=await Co(c.ESSceneObject.context.getStrFromEnv(r+"/InfoItemRowBackGround.png"));{const l=this.dv(c.createNextAnimateFrameEvent(e.screenRenderChanged,e.infoChanged));this.widgetTemp=this.disposeVar(new c.ObjResettingWithEvent(l,()=>{const u=YO(e,s,a);return e.screenRender?new Pr(e,i,u,Object.keys(e.info).length!=0):new BA(e,i,u,Object.keys(e.info).length!=0)}))}})()}get widgetTemp(){return this._widgetTemp}set widgetTemp(e){this._widgetTemp=e}flyTo(e,i){const{sceneObject:o,czmViewer:r,widgetTemp:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a)a.obj.flyTo(e,i);else{const s=setTimeout(()=>{clearTimeout(s),this.flyTo(e,i)},200)}return o.flyOverEvent.emit(i,"over",r),!0}};L(mc,"type",mc.register("ESCesiumViewer",c.ESWidget.type,mc));let Tg=mc;const eL=`<?xml version="1.0" encoding="utf-8" ?>
3465
3465
  <kml xmlns="http://www.opengis.net/kml/2.2">
3466
3466
  <Document id="root_doc">
3467
3467
  <Folder><name>高速公路</name>
@@ -3486,7 +3486,7 @@ void main()
3486
3486
  <Point><coordinates>118.49952,31.69933</coordinates></Point>
3487
3487
  </Placemark>
3488
3488
  </Folder>
3489
- `,eL=`KML文件本质上是一个XML文件,完全遵循XML文件格式。但是,KML文件定义了几个特殊的元素标签,常用标签为:Placemark:标记或路径 Linestring:路劲的坐标点 Point:标记位置的坐标 Coordinates:经纬度坐标
3489
+ `,tL=`KML文件本质上是一个XML文件,完全遵循XML文件格式。但是,KML文件定义了几个特殊的元素标签,常用标签为:Placemark:标记或路径 Linestring:路劲的坐标点 Point:标记位置的坐标 Coordinates:经纬度坐标
3490
3490
  \`\`\`
3491
3491
  <?xml version="1.0" encoding="utf-8" ?>
3492
3492
  <kml xmlns="http://www.opengis.net/kml/2.2">
@@ -3524,7 +3524,7 @@ void main()
3524
3524
  viewer.clock.multiplier = 30;
3525
3525
  viewer.clock.shouldAnimate = true;
3526
3526
  }
3527
- `,tL=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
3527
+ `,nL=`\${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml
3528
3528
 
3529
3529
  该路径可以使用下面回调函数
3530
3530
  \`\`\`
@@ -3574,7 +3574,7 @@ ${Xx}
3574
3574
  }
3575
3575
 
3576
3576
  \`\`\`
3577
- `;function nL(t){return new DOMParser().parseFromString(t,"application/xml")}const Ka=class Ka extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new c.Event));L(this,"_dataSource",this.dv(c.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(c.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(c.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(c.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(c.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(c.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(c.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(c.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r;r=document.createElement("div"),o.container.appendChild(r),r.style.pointerEvents="none",r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",this.d(()=>{o.container.removeChild(r)}),this.d(this.flyToEvent.don(A=>{e.actived&&this.dataSource&&(A!==void 0?o.flyTo(this.dataSource,{duration:A/1e3}):o.flyTo(this.dataSource))}));const a=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource),this._dataSource.value=void 0)};this.d(()=>a());const s=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:A}=this;A.clock&&(this.startTime=_.JulianDate.toDate(A.clock.startTime).getTime(),this.stopTime=_.JulianDate.toDate(A.clock.stopTime).getTime(),this.currentTime=_.JulianDate.toDate(A.clock.currentTime).getTime(),this.multiplier=A.clock.multiplier,this.clockStep=ze.getClockStep(A.clock.clockStep),this.clockRange=ze.getClockRange(A.clock.clockRange))};this.d(this.resetClockEvent.don(s));const l=()=>{this.dataSource&&(this.dataSource.show=this.show??Ka.defaults.show,r.style.display=this.show??Ka.defaults.show?"block":"none")};l(),this.d(this.showChanged.don(l));const u=this.dv(c.react(void 0));{const A=()=>{var d;if(this.uri)if(this.uri&&typeof this.uri!="string")(d=_.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||d.then(p=>p);else return c.ESSceneObject.context.getStrFromEnv(this.uri)},h=()=>{u.value=(this.data&&nL(this.data))??A()};h();const f=this.dv(c.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.d(f.don(h))}{const A=this.dv(c.createProcessingFromAsyncFunc(async d=>{if(a(),!u.value)return;let p;try{p=await _.KmlDataSource.load(u.value,{camera:o.scene.camera,canvas:o.scene.canvas,screenOverlayContainer:r,clampToGround:this.clampToGround})}catch(g){p=void 0,console.error(`kml加载报错:${g}`),console.error(g)}if(p&&(p.entities.values.forEach(g=>{_.Entity.prototype&&(p.ESSceneObjectID=i)}),d.check(),o.dataSources.add(p),this._dataSource.value=p,l(),(this.autoResetClock??Ka.defaults.autoResetClock)&&s(),!!this.loadFun))try{this.loadFun(p,o)}catch(g){console.error(g)}})),h=()=>{A.isRunning&&A.cancel(),A.restart()};h();const f=this.dv(c.createNextAnimateFrameEvent(u.changed,this.loadFunChanged,this.clampToGroundChanged));this.d(f.don(h))}{const A=()=>{if(this.loadFuncStr)try{const h=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=h}catch(h){console.error(h),this.loadFun=void 0}else this.loadFun=void 0};A(),this.d(this.loadFuncStrChanged.don(A))}}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}};L(Ka,"defaults",{show:!0,allowPicking:!0,defaultLoadFuncStr:Xx,defaultLoadFuncDocStr:tL,data:JO,dataMd:eL,autoResetClock:!0,clockEnabled:!1,startTime:ze.defaults.startTime,stopTime:ze.defaults.stopTime,currentTime:ze.defaults.currentTime,multiplier:ze.defaults.multiplier,clockStep:ze.defaults.clockStep,clockRange:ze.defaults.clockRange,shouldAnimate:ze.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",clampToGround:!1});let Ko=Ka;(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})})(Ko||(Ko={})),c.extendClassProps(Ko.prototype,Ko.createDefaultProps);const gc=class gc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Ko(e,n.id));this.dispose(c.track([o,"show"],[n,"show"])),this.dispose(c.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(c.bind([o,"data"],[n,"data"])),this.dispose(c.bind([o,"uri"],[n,"uri"])),this.dispose(c.bind([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(c.bind([o,"autoResetClock"],[n,"autoResetClock"])),this.dispose(c.bind([o,"clockEnabled"],[n,"clockEnabled"])),this.dispose(c.bind([o,"startTime"],[n,"startTime"])),this.dispose(c.bind([o,"stopTime"],[n,"stopTime"])),this.dispose(c.bind([o,"currentTime"],[n,"currentTime"])),this.dispose(c.bind([o,"multiplier"],[n,"multiplier"])),this.dispose(c.bind([o,"clockStep"],[n,"clockStep"])),this.dispose(c.bind([o,"clockRange"],[n,"clockRange"])),this.dispose(c.bind([o,"shouldAnimate"],[n,"shouldAnimate"])),this.dispose(c.bind([o,"clampToGround"],[n,"clampToGround"])),this.dispose(n.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r&&r*1e3)}))}};L(gc,"type",gc.register("ESCesiumViewer",df.type,gc));let Ig=gc;const yc=class yc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoCircle");L(this,"_geoPolyline");if(this._czmGeoCircle=this.disposeVar(new Mo(i,e.id)),this._geoPolyline=this.dv(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCircle,a=this._geoPolyline;{const s=()=>{a.positions=iL(e.position,e.rotation,e.radius)};s();const l=this.dv(c.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.radiusChanged));this.dispose(l.don(s))}{const s=()=>{r.show=e.show&&e.filled,a.show=e.show&&e.stroked};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.strokedChanged,e.strokeGroundChanged));this.dispose(l.don(s))}a.loop=!0,this.d(c.track([a,"ground"],[e,"strokeGround"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.bind([a,"width"],[e,"strokeWidth"]));{r.outline=!1,this.dispose(c.track([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.bind([r,"radius"],[e,"radius"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"ground"],[e,"fillGround"]));{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:c.ESLocalCircle.defaults.fillStyle.color}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}}}get czmGeoCircle(){return this._czmGeoCircle}get geoPolyline(){return this._geoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this._czmGeoCircle.show=e.show&&e.filled&&a,this._geoPolyline.show=e.show&&e.stroked&&a}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCircle:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Gn(r,o,i,o.position,o.radius,e,!0),!0):!1:!1}};L(yc,"type",yc.register("ESCesiumViewer",c.ESLocalCircle.type,yc));let Fg=yc;function iL(t,n,e){const o=2*Math.PI/36,r=[];_.Cartesian3.fromDegrees(...t);let a=function(l){let u=new _.Cartesian3(l.x,l.y,l.z),A=_.Cartographic.fromCartesian(u),h=_.Math.toDegrees(A.latitude),f=_.Math.toDegrees(A.longitude),d=A.height;return[f,h,d]};const s=st({initialRotation:"yForwardzUp",rotation:[n[0],n[2],-n[1]],position:t});if(!s)return r;for(let l=0;l<36;l++){let u=new _.Cartesian3(e*Math.cos(o*l),e*Math.sin(o*l),0),A=_.Matrix4.multiplyByPoint(s,u,new _.Cartesian3);r.push(a(A))}return r}const vc=class vc extends He{constructor(e,i){super(e,i);L(this,"_czmESLocalLineStringZ");if(this._czmESLocalLineStringZ=this.disposeVar(new ql(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalLineStringZ;i.add(r),this.dispose(()=>i.delete(r));{this.dispose(c.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeColor"],[e,"strokeColor"]));const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"hasDash"],[e,"hasDash"])),this.dispose(c.track([r,"gapColor"],[e,"gapColor"])),this.dispose(c.track([r,"dashLength"],[e,"dashLength"])),this.dispose(c.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(c.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(s=>[s[0],s[1],0])};a(),this.dispose(e.pointsChanged.disposableOn(a))}}get czmESLocalLineStringZ(){return this._czmESLocalLineStringZ}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this._czmESLocalLineStringZ.show=e.show&&e.stroked&&a}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalLineStringZ:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.points&&a.flyTo(e),!0):!1}};L(vc,"type",vc.register("ESCesiumViewer",mf.type,vc));let Mg=vc;const wc=class wc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPolyline");if(this._czmGeoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolyline;r.arcType="NONE";{this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"]));const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"hasDash"],[e,"hasDash"])),this.dispose(c.track([r,"gapColor"],[e,"gapColor"])),this.dispose(c.track([r,"dashLength"],[e,"dashLength"])),this.dispose(c.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(c.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale},e.points);r.positions=l};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(s.disposableOn(a))}}get czmGeoPolyline(){return this._czmGeoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this._czmGeoPolyline.show=e.show&&e.stroked&&a}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(wc,"type",wc.register("ESCesiumViewer",ql.type,wc));let Dg=wc;const bc=class bc extends hf{constructor(e,i){super(e,i);L(this,"_czmESLocalPolygon");if(this._czmESLocalPolygon=this.disposeVar(new c.ESLocalPolygonZ(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalPolygon;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(c.track([r,"stroked"],[e,"stroked"])),this.dispose(c.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(c.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"fillColor"],[e,"fillColor"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"fillGround"],[e,"fillGround"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"]));{const a=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(s=>[s[0],s[1],0])};a(),this.dispose(e.pointsChanged.disposableOn(a))}}get czmESLocalPolygon(){return this._czmESLocalPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(bc,"type",bc.register("ESCesiumViewer",c.ESLocalPolygon.type,bc));let Rg=bc;const xc=class xc extends hf{constructor(e,i){super(e,i);L(this,"_czmGeoPolygon");if(this._czmGeoPolygon=this.disposeVar(new Ti(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"fill"],[e,"filled"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},e.points);r.positions=l};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(s.disposableOn(a))}}get czmGeoPolygon(){return this._czmGeoPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(xc,"type",xc.register("ESCesiumViewer",c.ESLocalPolygonZ.type,xc));let Ug=xc;const _c=class _c extends He{constructor(e,i){super(e,i);L(this,"_czmLocalRectangle");if(this._czmLocalRectangle=this.disposeVar(new c.ESLocalPolygon(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmLocalRectangle;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(c.track([r,"stroked"],[e,"stroked"])),this.dispose(c.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(c.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"fillColor"],[e,"fillColor"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"fillGround"],[e,"fillGround"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"]));{const a=()=>{const s=e.width??0,l=e.height??0;r.points=[[-s,-l],[-s,l],[s,l],[s,-l]]};this.dispose(e.widthChanged.disposableOn(a)),this.dispose(e.heightChanged.disposableOn(a)),a()}}get czmLocalRectangle(){return this._czmLocalRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmLocalRectangle:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(_c,"type",_c.register("ESCesiumViewer",c.ESLocalRectangle.type,_c));let Og=_c;const Cc=class Cc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const p=()=>{const g=i.getCameraInfo(),v=g==null?void 0:g.position,m=[...g==null?void 0:g.rotation];m[0]=360,Fe(i.viewer,v,void 0,m)};A.addEventListener("click",p),A.style.cursor="pointer",this.dispose(()=>A.removeEventListener("click",p))}{const p=()=>{A.style.display=e.show??c.ESNavigator.defaults.show?"block":"none"};p(),e.dispose(e.showChanged.disposableOn(p))}{const p=()=>{A.style.width=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`,A.style.height=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`};p(),e.dispose(e.cssSizeChanged.disposableOn(p))}A.style.position="fixed";{const p=()=>{A.style.top=`${e.cssPosition?e.cssPosition[0]:c.ESNavigator.defaults.cssPosition[0]}px`,A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESNavigator.defaults.cssPosition[1]}px`};p(),e.dispose(e.cssPositionChanged.disposableOn(p))}A.style.transition=" right 0.4s linear",A.style.transition=" right 0.4s linear",A.style.cursor="pointer";const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="100%",h.style.height="100%",h.style.position="relative";const f=document.createElement("img");h.appendChild(f),this.dispose(()=>h.removeChild(f)),f.style.width="100%",f.style.height="100%",f.style.border="none";{const p=()=>f.src=e.imgUrl;p(),e.dispose(e.imgUrlChanged.disposableOn(p))}const d=c.createAnimateFrameWithStartValues(()=>{const p=i.getCameraInfo(),g=p==null?void 0:p.rotation[0];f.style.transform=`rotate(-${g}deg)`});d.start(),this.dispose(()=>d.destroy()),f.style.transformOrigin="50% 50%"}}}get customDiv(){return this._customDiv}};L(Cc,"type",Cc.register("ESCesiumViewer",c.ESNavigator.type,Cc));let Lg=Cc;const rL="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",oL="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==",Sc=class Sc extends fa{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.ad(c.createEventsCallFunc([n.strokeColorChanged,n.strokeWidthChanged,n.materialModeChanged,n.speedChanged],()=>{this.geoPolyline.customArrow=n.materialMode!=="pureColor",this.geoPolyline.customArrowParams={color:n.strokeColor,repeat:n.strokeWidth*6,speed:n.speed,image:n.materialMode=="singleArrow"?rL:oL,lineLength:c.getDistancesFromPositions(n.points??[],"GEODESIC").pop()??0}},{immediate:!0}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(Sc,"type",Sc.register("ESCesiumViewer",c.ESPath.type,Sc));let zg=Sc;const dr=class dr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_czmCustomPrimitive");L(this,"_geoBoundingSphere");this._czmCustomPrimitive=this.disposeVar(new at(e,i)),this._geoBoundingSphere=this.disposeVar(E0([this,"positions"]));const{czmCustomPrimitive:o}=this;this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"]));const r=this.disposeVar(c.react(0));{const a=()=>{if(!this.positions||this.positions.length<3){o.show=!1;return}o.show=!0;const[l,u,A]=vn({originPosition:this.positions[0]},this.positions);o.modelMatrix=u,o.cull=!1,l.push(l[0]);const h=l.length,f=[...l,...l.map(m=>[m[0],m[1],m[2]+(this.height??dr.defaults.height)])],d=l.reduce((m,b,x,E)=>{if(x===0)return m.push(0),m;const B=x-1,P=E[B],I=Math.sqrt((P[0]-b[0])*(P[0]-b[0])+(P[1]-b[1])*(P[1]-b[1]));return m.push(m[B]+I),m},[]);r.value=d[h-1];const p=d.map(m=>m/r.value),g=[...p.map(m=>[m,0]),...p.map(m=>[m,1])];o.attributes={a_position:{typedArray:new Float32Array(f.flat(1)),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(g.flat(1)),componentsPerAttribute:2}};const v=o.computeLocalAxisedBoundingBoxFromAttribute("a_position");if(!v){console.warn("包围盒计算存在问题!");return}o.setLocalAxisedBoundingBox(v.min,v.max);const y=[...new Array(h-1).keys()].map(m=>[[m,m+1,m+h+1],[m,m+h+1,m+h],[m+h+1,m+1,m],[m+h,m+h+1,m]]).flat(2);o.indexTypedArray=new Uint16Array(y),o.vertexShaderSource=` in vec3 a_position;
3577
+ `;function iL(t){return new DOMParser().parseFromString(t,"application/xml")}const Ka=class Ka extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_loadFuncReact",this.disposeVar(c.react(void 0)));L(this,"_clock");L(this,"_resetClockEvent",this.disposeVar(new c.Event));L(this,"_dataSource",this.dv(c.react(void 0)));this._clock=this.disposeVar(new ze(e)),this.dispose(c.bind([this.clock,"startTime"],[this,"startTime"])),this.dispose(c.bind([this.clock,"stopTime"],[this,"stopTime"])),this.dispose(c.bind([this.clock,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this.clock,"multiplier"],[this,"multiplier"])),this.dispose(c.bind([this.clock,"clockStep"],[this,"clockStep"])),this.dispose(c.bind([this.clock,"clockRange"],[this,"clockRange"])),this.dispose(c.bind([this.clock,"shouldAnimate"],[this,"shouldAnimate"])),this.dispose(c.bind([this.clock,"enabled"],[this,"clockEnabled"]));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}let r;r=document.createElement("div"),o.container.appendChild(r),r.style.pointerEvents="none",r.style.position="absolute",r.style.top="0",r.style.left="0",r.style.width="100%",r.style.height="100%",this.d(()=>{o.container.removeChild(r)}),this.d(this.flyToEvent.don(A=>{e.actived&&this.dataSource&&(A!==void 0?o.flyTo(this.dataSource,{duration:A/1e3}):o.flyTo(this.dataSource))}));const a=()=>{this.dataSource&&(o.dataSources.remove(this.dataSource),this._dataSource.value=void 0)};this.d(()=>a());const s=()=>{if(!this.dataSource){console.warn("resetClock warn: dataSource is undefined!");return}const{dataSource:A}=this;A.clock&&(this.startTime=_.JulianDate.toDate(A.clock.startTime).getTime(),this.stopTime=_.JulianDate.toDate(A.clock.stopTime).getTime(),this.currentTime=_.JulianDate.toDate(A.clock.currentTime).getTime(),this.multiplier=A.clock.multiplier,this.clockStep=ze.getClockStep(A.clock.clockStep),this.clockRange=ze.getClockRange(A.clock.clockRange))};this.d(this.resetClockEvent.don(s));const l=()=>{this.dataSource&&(this.dataSource.show=this.show??Ka.defaults.show,r.style.display=this.show??Ka.defaults.show?"block":"none")};l(),this.d(this.showChanged.don(l));const u=this.dv(c.react(void 0));{const A=()=>{var d;if(this.uri)if(this.uri&&typeof this.uri!="string")(d=_.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||d.then(p=>p);else return c.ESSceneObject.context.getStrFromEnv(this.uri)},h=()=>{u.value=(this.data&&iL(this.data))??A()};h();const f=this.dv(c.createNextAnimateFrameEvent(this.uriChanged,this.dataChanged));this.d(f.don(h))}{const A=this.dv(c.createProcessingFromAsyncFunc(async d=>{if(a(),!u.value)return;let p;try{p=await _.KmlDataSource.load(u.value,{camera:o.scene.camera,canvas:o.scene.canvas,screenOverlayContainer:r,clampToGround:this.clampToGround})}catch(g){p=void 0,console.error(`kml加载报错:${g}`),console.error(g)}if(p&&(p.entities.values.forEach(g=>{_.Entity.prototype&&(p.ESSceneObjectID=i)}),d.check(),o.dataSources.add(p),this._dataSource.value=p,l(),(this.autoResetClock??Ka.defaults.autoResetClock)&&s(),!!this.loadFun))try{this.loadFun(p,o)}catch(g){console.error(g)}})),h=()=>{A.isRunning&&A.cancel(),A.restart()};h();const f=this.dv(c.createNextAnimateFrameEvent(u.changed,this.loadFunChanged,this.clampToGroundChanged));this.d(f.don(h))}{const A=()=>{if(this.loadFuncStr)try{const h=Function(`"use strict";return (${this.loadFuncStr})`)();this.loadFun=h}catch(h){console.error(h),this.loadFun=void 0}else this.loadFun=void 0};A(),this.d(this.loadFuncStrChanged.don(A))}}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}};L(Ka,"defaults",{show:!0,allowPicking:!0,defaultLoadFuncStr:Xx,defaultLoadFuncDocStr:nL,data:eL,dataMd:tL,autoResetClock:!0,clockEnabled:!1,startTime:ze.defaults.startTime,stopTime:ze.defaults.stopTime,currentTime:ze.defaults.currentTime,multiplier:ze.defaults.multiplier,clockStep:ze.defaults.clockStep,clockRange:ze.defaults.clockRange,shouldAnimate:ze.defaults.shouldAnimate,uri:"${earthsdk3-assets-script-dir}/assets/misc/bikeRide.kml",clampToGround:!1});let Ko=Ka;(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})})(Ko||(Ko={})),c.extendClassProps(Ko.prototype,Ko.createDefaultProps);const gc=class gc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const o=this.disposeVar(new Ko(e,n.id));this.dispose(c.track([o,"show"],[n,"show"])),this.dispose(c.track([o,"allowPicking"],[n,"allowPicking"])),this.dispose(c.bind([o,"data"],[n,"data"])),this.dispose(c.bind([o,"uri"],[n,"uri"])),this.dispose(c.bind([o,"loadFuncStr"],[n,"loadFuncStr"])),this.dispose(c.bind([o,"autoResetClock"],[n,"autoResetClock"])),this.dispose(c.bind([o,"clockEnabled"],[n,"clockEnabled"])),this.dispose(c.bind([o,"startTime"],[n,"startTime"])),this.dispose(c.bind([o,"stopTime"],[n,"stopTime"])),this.dispose(c.bind([o,"currentTime"],[n,"currentTime"])),this.dispose(c.bind([o,"multiplier"],[n,"multiplier"])),this.dispose(c.bind([o,"clockStep"],[n,"clockStep"])),this.dispose(c.bind([o,"clockRange"],[n,"clockRange"])),this.dispose(c.bind([o,"shouldAnimate"],[n,"shouldAnimate"])),this.dispose(c.bind([o,"clampToGround"],[n,"clampToGround"])),this.dispose(n.flyToEvent.disposableOn(r=>{e.actived&&o.flyTo(r&&r*1e3)}))}};L(gc,"type",gc.register("ESCesiumViewer",df.type,gc));let Ig=gc;const yc=class yc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoCircle");L(this,"_geoPolyline");if(this._czmGeoCircle=this.disposeVar(new Mo(i,e.id)),this._geoPolyline=this.dv(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoCircle,a=this._geoPolyline;{const s=()=>{a.positions=rL(e.position,e.rotation,e.radius)};s();const l=this.dv(c.createNextAnimateFrameEvent(e.positionChanged,e.rotationChanged,e.radiusChanged));this.dispose(l.don(s))}{const s=()=>{r.show=e.show&&e.filled,a.show=e.show&&e.stroked};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.strokedChanged,e.strokeGroundChanged));this.dispose(l.don(s))}a.loop=!0,this.d(c.track([a,"ground"],[e,"strokeGround"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.bind([a,"width"],[e,"strokeWidth"]));{r.outline=!1,this.dispose(c.track([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.bind([r,"radius"],[e,"radius"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"ground"],[e,"fillGround"]));{const s=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:c.ESLocalCircle.defaults.fillStyle.color}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(l.disposableOn(s))}}}get czmGeoCircle(){return this._czmGeoCircle}get geoPolyline(){return this._geoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this._czmGeoCircle.show=e.show&&e.filled&&a,this._geoPolyline.show=e.show&&e.stroked&&a}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoCircle:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.position?(Gn(r,o,i,o.position,o.radius,e,!0),!0):!1:!1}};L(yc,"type",yc.register("ESCesiumViewer",c.ESLocalCircle.type,yc));let Fg=yc;function rL(t,n,e){const o=2*Math.PI/36,r=[];_.Cartesian3.fromDegrees(...t);let a=function(l){let u=new _.Cartesian3(l.x,l.y,l.z),A=_.Cartographic.fromCartesian(u),h=_.Math.toDegrees(A.latitude),f=_.Math.toDegrees(A.longitude),d=A.height;return[f,h,d]};const s=st({initialRotation:"yForwardzUp",rotation:[n[0],n[2],-n[1]],position:t});if(!s)return r;for(let l=0;l<36;l++){let u=new _.Cartesian3(e*Math.cos(o*l),e*Math.sin(o*l),0),A=_.Matrix4.multiplyByPoint(s,u,new _.Cartesian3);r.push(a(A))}return r}const vc=class vc extends He{constructor(e,i){super(e,i);L(this,"_czmESLocalLineStringZ");if(this._czmESLocalLineStringZ=this.disposeVar(new ql(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalLineStringZ;i.add(r),this.dispose(()=>i.delete(r));{this.dispose(c.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"strokeColor"],[e,"strokeColor"]));const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"hasDash"],[e,"hasDash"])),this.dispose(c.track([r,"gapColor"],[e,"gapColor"])),this.dispose(c.track([r,"dashLength"],[e,"dashLength"])),this.dispose(c.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(c.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(s=>[s[0],s[1],0])};a(),this.dispose(e.pointsChanged.disposableOn(a))}}get czmESLocalLineStringZ(){return this._czmESLocalLineStringZ}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this._czmESLocalLineStringZ.show=e.show&&e.stroked&&a}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalLineStringZ:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.points&&a.flyTo(e),!0):!1}};L(vc,"type",vc.register("ESCesiumViewer",mf.type,vc));let Mg=vc;const wc=class wc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPolyline");if(this._czmGeoPolyline=this.disposeVar(new Ye(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolyline;r.arcType="NONE";{this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"strokeColor"]));const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"hasDash"],[e,"hasDash"])),this.dispose(c.track([r,"gapColor"],[e,"gapColor"])),this.dispose(c.track([r,"dashLength"],[e,"dashLength"])),this.dispose(c.track([r,"dashPattern"],[e,"dashPattern"])),this.dispose(c.track([r,"hasArrow"],[e,"hasArrow"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"strokeGround"]));{const a=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale},e.points);r.positions=l};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(s.disposableOn(a))}}get czmGeoPolyline(){return this._czmGeoPolyline}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this._czmGeoPolyline.show=e.show&&e.stroked&&a}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolyline:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(wc,"type",wc.register("ESCesiumViewer",ql.type,wc));let Dg=wc;const bc=class bc extends hf{constructor(e,i){super(e,i);L(this,"_czmESLocalPolygon");if(this._czmESLocalPolygon=this.disposeVar(new c.ESLocalPolygonZ(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESLocalPolygon;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(c.track([r,"stroked"],[e,"stroked"])),this.dispose(c.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(c.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"fillColor"],[e,"fillColor"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"fillGround"],[e,"fillGround"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"]));{const a=()=>{if(!e.points){r.points=void 0;return}r.points=e.points.map(s=>[s[0],s[1],0])};a(),this.dispose(e.pointsChanged.disposableOn(a))}}get czmESLocalPolygon(){return this._czmESLocalPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESLocalPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(bc,"type",bc.register("ESCesiumViewer",c.ESLocalPolygon.type,bc));let Rg=bc;const xc=class xc extends hf{constructor(e,i){super(e,i);L(this,"_czmGeoPolygon");if(this._czmGeoPolygon=this.disposeVar(new Ti(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPolygon;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"])),this.dispose(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"color"],[e,"fillColor"])),this.dispose(c.track([r,"fill"],[e,"filled"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"]));{const a=()=>{if(!e.points)return;if(e.scale&&e.scale.some(u=>u===0)){console.warn("缩放属性(scale)不能设置值为0!");return}const[l]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},e.points);r.positions=l};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.dispose(s.disposableOn(a))}}get czmGeoPolygon(){return this._czmGeoPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPolygon:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(xc,"type",xc.register("ESCesiumViewer",c.ESLocalPolygonZ.type,xc));let Ug=xc;const _c=class _c extends He{constructor(e,i){super(e,i);L(this,"_czmLocalRectangle");if(this._czmLocalRectangle=this.disposeVar(new c.ESLocalPolygon(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmLocalRectangle;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(c.track([r,"stroked"],[e,"stroked"])),this.dispose(c.track([r,"strokeColor"],[e,"strokeColor"])),this.dispose(c.track([r,"strokeWidth"],[e,"strokeWidth"])),this.dispose(c.track([r,"fillColor"],[e,"fillColor"])),this.dispose(c.track([r,"filled"],[e,"filled"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"fillGround"],[e,"fillGround"])),this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"position"],[e,"position"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.bind([r,"scale"],[e,"scale"]));{const a=()=>{const s=e.width??0,l=e.height??0;r.points=[[-s,-l],[-s,l],[s,l],[s,-l]]};this.dispose(e.widthChanged.disposableOn(a)),this.dispose(e.heightChanged.disposableOn(a)),a()}}get czmLocalRectangle(){return this._czmLocalRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmLocalRectangle:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(_c,"type",_c.register("ESCesiumViewer",c.ESLocalRectangle.type,_c));let Og=_c;const Cc=class Cc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const p=()=>{const g=i.getCameraInfo(),v=g==null?void 0:g.position,m=[...g==null?void 0:g.rotation];m[0]=360,Fe(i.viewer,v,void 0,m)};A.addEventListener("click",p),A.style.cursor="pointer",this.dispose(()=>A.removeEventListener("click",p))}{const p=()=>{A.style.display=e.show??c.ESNavigator.defaults.show?"block":"none"};p(),e.dispose(e.showChanged.disposableOn(p))}{const p=()=>{A.style.width=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`,A.style.height=`${e.cssSize?e.cssSize:c.ESNavigator.defaults.cssSize}px`};p(),e.dispose(e.cssSizeChanged.disposableOn(p))}A.style.position="fixed";{const p=()=>{A.style.top=`${e.cssPosition?e.cssPosition[0]:c.ESNavigator.defaults.cssPosition[0]}px`,A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESNavigator.defaults.cssPosition[1]}px`};p(),e.dispose(e.cssPositionChanged.disposableOn(p))}A.style.transition=" right 0.4s linear",A.style.transition=" right 0.4s linear",A.style.cursor="pointer";const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="100%",h.style.height="100%",h.style.position="relative";const f=document.createElement("img");h.appendChild(f),this.dispose(()=>h.removeChild(f)),f.style.width="100%",f.style.height="100%",f.style.border="none";{const p=()=>f.src=e.imgUrl;p(),e.dispose(e.imgUrlChanged.disposableOn(p))}const d=c.createAnimateFrameWithStartValues(()=>{const p=i.getCameraInfo(),g=p==null?void 0:p.rotation[0];f.style.transform=`rotate(-${g}deg)`});d.start(),this.dispose(()=>d.destroy()),f.style.transformOrigin="50% 50%"}}}get customDiv(){return this._customDiv}};L(Cc,"type",Cc.register("ESCesiumViewer",c.ESNavigator.type,Cc));let Lg=Cc;const oL="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",sL="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==",Sc=class Sc extends fa{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.ad(c.createEventsCallFunc([n.strokeColorChanged,n.strokeWidthChanged,n.materialModeChanged,n.speedChanged,n.strokeMaterialChanged],()=>{this.geoPolyline.customArrow=n.materialMode!=="pureColor",this.geoPolyline.customArrowParams={color:n.strokeColor,arrowColor:n.strokeMaterialParams.arrowColor,repeat:n.strokeWidth*6,speed:n.speed,image:n.materialMode=="singleArrow"?oL:sL,lineLength:c.getDistancesFromPositions(n.points??[],"GEODESIC").pop()??0}},{immediate:!0}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(Sc,"type",Sc.register("ESCesiumViewer",c.ESPath.type,Sc));let zg=Sc;const dr=class dr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_czmCustomPrimitive");L(this,"_geoBoundingSphere");this._czmCustomPrimitive=this.disposeVar(new at(e,i)),this._geoBoundingSphere=this.disposeVar(E0([this,"positions"]));const{czmCustomPrimitive:o}=this;this.dispose(c.track([o,"show"],[this,"show"])),this.dispose(c.track([o,"allowPicking"],[this,"allowPicking"]));const r=this.disposeVar(c.react(0));{const a=()=>{if(!this.positions||this.positions.length<3){o.show=!1;return}o.show=!0;const[l,u,A]=vn({originPosition:this.positions[0]},this.positions);o.modelMatrix=u,o.cull=!1,l.push(l[0]);const h=l.length,f=[...l,...l.map(m=>[m[0],m[1],m[2]+(this.height??dr.defaults.height)])],d=l.reduce((m,b,x,E)=>{if(x===0)return m.push(0),m;const B=x-1,P=E[B],I=Math.sqrt((P[0]-b[0])*(P[0]-b[0])+(P[1]-b[1])*(P[1]-b[1]));return m.push(m[B]+I),m},[]);r.value=d[h-1];const p=d.map(m=>m/r.value),g=[...p.map(m=>[m,0]),...p.map(m=>[m,1])];o.attributes={a_position:{typedArray:new Float32Array(f.flat(1)),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(g.flat(1)),componentsPerAttribute:2}};const v=o.computeLocalAxisedBoundingBoxFromAttribute("a_position");if(!v){console.warn("包围盒计算存在问题!");return}o.setLocalAxisedBoundingBox(v.min,v.max);const y=[...new Array(h-1).keys()].map(m=>[[m,m+1,m+h+1],[m,m+h+1,m+h],[m+h+1,m+1,m],[m+h,m+h+1,m]]).flat(2);o.indexTypedArray=new Uint16Array(y),o.vertexShaderSource=` in vec3 a_position;
3578
3578
  in vec2 a_st;
3579
3579
  out vec2 v_st;
3580
3580
  void main()
@@ -3593,7 +3593,7 @@ ${Xx}
3593
3593
  vec4 imageColor = texture(u_image, fract(v_st * u_stScale - addst));
3594
3594
  out_FragColor = imageColor * u_color;
3595
3595
  }
3596
- `};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??dr.defaults.height,{textureSizeInMeters:A=dr.defaults.textureSizeInMeters}=this,{textureUri:h=dr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??dr.defaults.textureMoveSpeed,u_color:this.textureColor??dr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}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}};L(dr,"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 Zo=dr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})(Zo||(Zo={})),c.extendClassProps(Zo.prototype,Zo.createDefaultProps);const Ec=class Ec extends on{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Zo(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={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"}},l=(f,d)=>{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:[d,d]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[d*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,d=s[f];if(!d)return;r.textureUri=u+d.image,r.textureColor=f!=="gradientColor"?d.color:e.fillColor;const{textureMoveSpeed:p,textureSizeInMeters:g}=l(f,e.height);r.textureMoveSpeed=p,r.textureSizeInMeters=g};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Ec,"type",Ec.register("ESCesiumViewer",c.ESPolygonFence.type,Ec));let kg=Ec;const Pc=class Pc extends on{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Pc,"type",Pc.register("ESCesiumViewer",c.ESRectangle.type,Pc));let Qg=Pc;const lo=class lo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],lo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const m=_.Material.fromType(_.Material.ImageType);m.uniforms.image=r.value,m.uniforms.repeat=Ze(this.repeat??lo.defaults.repeat),a.value=m};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(m,b)=>{const x=new _.PolylineMaterialAppearance({material:b,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(m.length<2)return;E.push(new _.GeometryInstance({geometry:new _.GroundPolylineGeometry({positions:m,width:this.width??lo.defaults.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:_.ArcType[this.arcType??lo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??lo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new _.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const d=()=>{if(f(),!this.positions)return;const m=$t(this.positions);if(m.length<2||!a.value){h.radius=-1;return}_.BoundingSphere.fromPoints(m,h),A=u(m,a.value),A&&o.scene.primitives.add(A)},p=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&h.radius>0){const b=Ue(h.center);b&&Fe(o,b,h.radius*4,void 0,m)}})),d(),p();const g=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(g.disposableOn(()=>{d(),p()}));const v=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{p()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(lo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let $o=lo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Bc=class Bc extends on{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new $o(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Bc,"type",Bc.register("ESCesiumViewer",vf.type,Bc));let Vg=Bc;const Tc=class Tc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const g=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};g(),e.dispose(e.showChanged.disposableOn(g))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const g=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));g(),this.dispose(v.disposableOn(()=>g()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.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="30px";const d=()=>{const g=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||g&&g>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const m=(135-y)/2;f.style.left=`${m}px`}}};d();const p=setInterval(()=>{d()},200);this.dispose(()=>clearInterval(p))}}}get customDiv(){return this._customDiv}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESScale.type,Tc));let Ng=Tc;const Ic=class Ic extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new at(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a,!0),!0):!1}};L(Ic,"type",Ic.register("ESCesiumViewer",gf.type,Ic));let Hg=Ic;const Fc=class Fc extends hf{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Do(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.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??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(Fc,"type",Fc.register("ESCesiumViewer",c.ESDynamicWater.type,Fc));let Gg=Fc;const Mc=class Mc extends Nn{constructor(e,i){super(e,i);L(this,"_scaleFactor",.6);L(this,"_urlData",this.dv(c.react(void 0)));L(this,"_dataSource",new _.CustomDataSource);L(this,"_clusterImages",{});L(this,"_clusterImageAttribute",{});L(this,"_clusterImageUrl","");if(!i.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var s;const r=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(r).then(l=>l.json()).then(l=>{this._clusterImageAttribute=l}).catch(l=>{console.error(l)});for(const l in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,l)){const u=this._clusterImageAttribute[l];this._clusterImages[l]=new _.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new _.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new _.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const a=this._dataSource;(s=i.viewer)==null||s.dataSources.add(a),this.d(()=>{var l;(l=i.viewer)==null||l.dataSources.remove(a)}),a.clustering.enabled=a.clustering.clusterBillboards=a.clustering.clusterLabels=a.clustering.clusterPoints=!0,this.d(c.track([a.clustering,"pixelRange"],[e,"pixelRange"])),this.d(c.track([a.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(c.track([a.clustering,"show"],[e,"show"]));{const l=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(c.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:c.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(c.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};l(),this.d(e.urlChanged.don(l))}{const l=this.dv(c.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(l.don(()=>{this.updateEntityCluster(u)}))}{const l=(u,A)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(A==null?void 0:A.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(A==null?void 0:A.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,A)=>l(u,A)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var d,p,g,v,y,m,b,x,E,B,P,I;const{czmViewer:i,_dataSource:o,sceneObject:r}=e;if(!((d=i.viewer)==null?void 0:d.scene))return;const s=o.entities,l=new _.NearFarScalar(100,1,1e3,1),u=r.heightReference=="None"?_.HeightReference.NONE:r.heightReference=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.CLAMP_TO_TERRAIN;s.removeAll();const A=(p=this.czmViewer.viewer)==null?void 0:p.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(M=>{M.id.billboard.imageSubRegion=void 0}),A&&A())}),h=r.style??c.ESEntityCluster.defaults.style;this._clusterImages[((g=h.nonCluster)==null?void 0:g.mode)??"SquareH01"].heightReference=u,this._clusterImages[((v=h.nonCluster)==null?void 0:v.mode)??"SquareH01"].scaleByDistance=l;const f=[-this._clusterImageAttribute[((y=h.nonCluster)==null?void 0:y.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((m=h.nonCluster)==null?void 0:m.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((b=h.nonCluster)==null?void 0:b.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=h.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let M=0;M<this.urlData.features.length;M++){const F=this.urlData.features[M];if(F.geometry.type=="Point")this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates,f,u,l,(E=h.nonCluster)==null?void 0:E.mode,F.properties);else if(F.geometry.type=="MultiPoint")for(let S=0;S<F.geometry.coordinates.length;S++)this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates[S],f,u,l,(B=h.nonCluster)==null?void 0:B.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let M=0;M<this.urlData.geometries.length;M++){const F=this.urlData.geometries[M];if(F.type=="Point")this._addEntities(s,F.name??(M+1).toString(),F.coordinates,f,u,l,(P=h.nonCluster)==null?void 0:P.mode,F.properties);else if(F.type=="MultiPoint")for(let S=0;S<F.coordinates.length;S++)this._addEntities(s,F.name??(M+1).toString(),F.coordinates[S],f,u,l,(I=h.nonCluster)==null?void 0:I.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.type)}this.updateStyle(u,l)}async updateStyle(e,i){var l,u;const o=this,{_dataSource:r,sceneObject:a}=this,s=((l=a.style)==null?void 0:l.cluster)??c.ESEntityCluster.defaults.style.cluster;r.entities.values.forEach(A=>{_.Entity.prototype&&(A.ESSceneObjectID=a.id)}),r.clustering.clusterEvent.addEventListener(async function(A,h){if(h.label.ESSceneObjectID=h.billboard.ESSceneObjectID=h.point.ESSceneObjectID=a.id,h.label.show=!0,h.label.font="16px sans-serif",h.label.scale=1*o._scaleFactor,h.label.verticalOrigin=_.VerticalOrigin.BOTTOM,h.label.horizontalOrigin=_.HorizontalOrigin.CENTER,h.label.eyeOffset=new _.Cartesian3(0,0,-10),e&&(h.label.heightReference=e),i&&(h.label.scaleByDistance=i),h.billboard.id=h.label.id,h.billboard.show=!0,h.billboard.scale=1*o._scaleFactor,h.billboard.verticalOrigin=_.VerticalOrigin.BOTTOM,h.billboard.horizontalOrigin=_.HorizontalOrigin.CENTER,e&&(h.billboard.heightReference=e),i&&(h.billboard.scaleByDistance=i),s){const f=o.getClusterStyle(s,A.length).mode,d=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];h.label.pixelOffset=new _.Cartesian2(d[0]*o._scaleFactor,d[1]*o._scaleFactor),h.billboard.width=o._clusterImageAttribute[f].imageSize[0],h.billboard.height=o._clusterImageAttribute[f].imageSize[1],h.billboard.pixelOffset=new _.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),h.billboard.setImage(f,o._clusterImageUrl),h.billboard.setImageSubRegion(f,new _.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const A=()=>{const f=r.clustering.pixelRange;r.clustering.pixelRange=0,r.clustering.pixelRange=f};A();let h=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{A()});this.d(()=>{var f;h&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(h))})}}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}_addEntities(e,i,o,r,a,s,l,u){const A=_.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:A,label:{text:i,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,pixelOffset:new _.Cartesian2(r[0]*this._scaleFactor,r[1]*this._scaleFactor),heightReference:a,scaleByDistance:s,eyeOffset:new _.Cartesian3(0,0,-10)},billboard:this._clusterImages[l??"SquareH01"].clone(new _.BillboardGraphics),properties:u})}_getPositionLLH(e){const i=_.Cartographic.fromCartesian(e);return[_.Math.toDegrees(i.longitude),_.Math.toDegrees(i.latitude),i.height]}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESEntityCluster.type,Mc));let Wg=Mc;const Dc=class Dc extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",pf.type,Dc));let jg=Dc;const Rc=class Rc extends Un{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Do(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.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??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.updateBoundingSphere(l)}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(Rc,"type",Rc.register("ESCesiumViewer",c.ESGeoWater.type,Rc));let qg=Rc;const Uc=class Uc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const a=this.dv(c.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),s=()=>{r.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}};s(),this.d(a.don(s))}}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Uc,"type",Uc.register("ESCesiumViewer",ff.type,Uc));let Kg=Uc;class sL extends c.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:m,customPrimitivePoints:b}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(...b),h.push(...m),u.push(...this.setIndexs(y))}const[f,d,p]=vn({originPosition:A[0]},A),g=this.setFaces(f);s.push(...g.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,d,s,u,l)}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],d=[s[0],s[1],s[2]-this._sceneObject.height/2],p=[a[0],a[1],a[2]+this._sceneObject.height/2],g=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,d]],y=[[u,h],[A,p],[A,h],[h,g]],m=[[f,d],[f,p],[d,g],[p,g]];return{outlinePionts:[...v,...y,...m],customPrimitivePoints:[u,l,A,h,d,f,p,g]}}setIndexs(n){const e=n*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(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const a=n.slice(8*r,8*(r+1));e.push(a)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=vn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,d=h[f],p=Math.sqrt((d[0]-u[0])*(d[0]-u[0])+(d[1]-u[1])*(d[1]-u[1]));return l.push(l[f]+p),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const Oc=class Oc extends on{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ht(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new at(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new sL(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
3596
+ `};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.heightChanged,this.positionsChanged));this.dispose(s.disposableOn(a))}this.dispose(this.flyToEvent.disposableOn(a=>{this.czmCustomPrimitive.flyTo(a)}));{const a=()=>{const l=r.value?r.value:1,u=this.height??dr.defaults.height,{textureSizeInMeters:A=dr.defaults.textureSizeInMeters}=this,{textureUri:h=dr.defaults.textureUri}=this;o.uniformMap={u_image:{type:"image",uri:h},u_stScale:[l/A[0],u/A[1]],u_speed:this.textureMoveSpeed??dr.defaults.textureMoveSpeed,u_color:this.textureColor??dr.defaults.textureColor}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(this.textureColorChanged,this.textureMoveSpeedChanged,this.textureSizeInMetersChanged,this.heightChanged,this.textureSizeInMetersChanged,this.textureUriChanged,r.changed));this.dispose(s.disposableOn(a))}}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}};L(dr,"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 Zo=dr;(t=>{t.createDefaultProps=()=>({show:void 0,allowPicking:void 0,positions:c.reactPositions(void 0),height:void 0,textureSizeInMeters:c.reactArrayWithUndefined(void 0),textureUri:void 0,textureMoveSpeed:c.reactArrayWithUndefined(void 0),textureColor:c.reactArrayWithUndefined(void 0)})})(Zo||(Zo={})),c.extendClassProps(Zo.prototype,Zo.createDefaultProps);const Ec=class Ec extends on{constructor(e,i){super(e,i);L(this,"_czmPolygonFence");L(this,"_czmPolygon");if(this._czmPolygonFence=this.disposeVar(new Zo(i,e.id)),this._czmPolygon=this.dv(new c.ESGeoPolygon),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmPolygonFence,a=this._czmPolygon;i.add(a),this.dispose(()=>i.delete(a)),a.filled=!1,this.d(c.track([a,"points"],[e,"points"])),this.d(c.track([a,"stroked"],[e,"stroked"])),this.d(c.track([a,"strokeColor"],[e,"strokeColor"])),this.d(c.track([a,"strokeWidth"],[e,"strokeWidth"])),this.d(c.track([a,"strokeGround"],[e,"strokeGround"]));{const s={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"}},l=(f,d)=>{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:[d,d]};case"honeycomb":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};case"gradientColor":return{textureMoveSpeed:[0,0],textureSizeInMeters:[d,d]};default:return{textureMoveSpeed:[0,0],textureSizeInMeters:[d*.5,2]}}},u="${earthsdk3-assets-script-dir}/assets/img/fence/",A=()=>{const f=e.materialMode,d=s[f];if(!d)return;r.textureUri=u+d.image,r.textureColor=f!=="gradientColor"?d.color:e.fillColor;const{textureMoveSpeed:p,textureSizeInMeters:g}=l(f,e.height);r.textureMoveSpeed=p,r.textureSizeInMeters=g};A();const h=this.disposeVar(c.createNextAnimateFrameEvent(e.materialModeChanged,e.heightChanged,e.fillColorChanged));this.dispose(h.disposableOn(A))}{this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"height"],[e,"height"]));{const s=()=>{r.show=e.show&&e.filled};s();const l=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.dispose(l.don(s))}}}get czmPolygonFence(){return this._czmPolygonFence}get czmPolygon(){return this._czmPolygon}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonFence:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(wn(r,o,i,e,a.czmCustomPrimitive),!0):!1}};L(Ec,"type",Ec.register("ESCesiumViewer",c.ESPolygonFence.type,Ec));let kg=Ec;const Pc=class Pc extends on{constructor(e,i){super(e,i);L(this,"_czmESRectangle");if(this._czmESRectangle=this.disposeVar(new Ci(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRectangle;this.dispose(c.bind([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"ground"],[e,"fillGround"])),this.dispose(c.track([r,"strokeGround"],[e,"strokeGround"])),this.dispose(c.track([r,"outlineTranslucent"],[e,"outlineTranslucent"])),this.dispose(c.bind([r,"height"],[e,"height"])),this.dispose(c.bind([r,"extrudedHeight"],[e,"extrudedHeight"])),this.dispose(c.bind([r,"rectangle"],[e,"rectangle"])),this.dispose(c.bind([r,"stRotation"],[e,"stRotation"])),this.dispose(c.bind([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"outline"],[e,"stroked"])),this.dispose(c.track([r,"outlineColor"],[e,"strokeColor"]));{const a=()=>{const s=e.points;if(s&&s.length>=2){const{minPos:l,maxPos:u}=c.getMinMaxCorner(s);r.rectangle=[l[0],l[1],u[0],u[1]],r.height=s[1][2],r.extrudedHeight=s[0][2]}else r.rectangle=void 0,r.height=0,r.extrudedHeight=0};a(),this.dispose(e.pointsChanged.disposableOn(()=>a()))}{const a=()=>{e.filled?r.material={type:"Color",color:e.fillColor}:r.material={type:"Color",color:[1,1,1,0]}};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.fillStyleChanged,e.filledChanged));this.dispose(s.disposableOn(a))}}get czmESRectangle(){return this._czmESRectangle}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRectangle:a}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.rectangle){const s=[[a.rectangle[0],a.rectangle[1],a.height],[a.rectangle[2],a.rectangle[3],a.height],[a.rectangle[0],a.rectangle[1],a.extrudedHeight],[a.rectangle[2],a.rectangle[3],a.extrudedHeight]];return Me(r,o,i,s,e),!0}return!1}};L(Pc,"type",Pc.register("ESCesiumViewer",c.ESRectangle.type,Pc));let Qg=Pc;const lo=class lo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"],lo.defaults.imageUrl),a=this.disposeVar(c.react(void 0)),s=()=>{const m=_.Material.fromType(_.Material.ImageType);m.uniforms.image=r.value,m.uniforms.repeat=Ze(this.repeat??lo.defaults.repeat),a.value=m};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(r.changed,this.repeatChanged));this.dispose(l.disposableOn(s));const u=(m,b)=>{const x=new _.PolylineMaterialAppearance({material:b,renderState:{depthTest:{enabled:!1}}});x.renderState.depthMask=!1;const E=[];if(m.length<2)return;E.push(new _.GeometryInstance({geometry:new _.GroundPolylineGeometry({positions:m,width:this.width??lo.defaults.width,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:_.ArcType[this.arcType??lo.defaults.arcType]}),id:this}));const B=new Bi({geometryInstances:E,appearance:x,asynchronous:!1,allowPicking:this.allowPicking??lo.defaults.allowPicking,compressVertices:!1});return B.ESSceneObjectID=i,B};let A;const h=new _.BoundingSphere,f=()=>{A&&(o.scene.primitives.remove(A),A=void 0)};this.dispose(f);const d=()=>{if(f(),!this.positions)return;const m=$t(this.positions);if(m.length<2||!a.value){h.radius=-1;return}_.BoundingSphere.fromPoints(m,h),A=u(m,a.value),A&&o.scene.primitives.add(A)},p=()=>{A&&(A.show=this.show??!0)};this.dispose(this.flyToEvent.disposableOn(m=>{if(e.actived&&h.radius>0){const b=Ue(h.center);b&&Fe(o,b,h.radius*4,void 0,m)}})),d(),p();const g=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.widthChanged,a.changed,this.arcTypeChanged,this.allowPickingChanged));this.dispose(g.disposableOn(()=>{d(),p()}));const v=this.disposeVar(c.createNextAnimateFrameEvent(this.showChanged));this.dispose(v.disposableOn(()=>{p()}));const{extensions:y}=e;if(!y){console.warn("!extensions");return}}get flyToEvent(){return this._flyToEvent}flyTo(e){this._flyToEvent.emit(e)}};L(lo,"defaults",{show:!0,positions:[],width:50,arcType:"GEODESIC",imageUrl:"${earthsdk3-assets-script-dir}/assets/img/roads/4.jpg",repeat:[100,1],allowPicking:!1});let $o=lo;(t=>{t.createDefaultProps=()=>({show:void 0,positions:c.reactPositions(void 0),width:void 0,arcType:void 0,imageUrl:void 0,repeat:void 0,allowPicking:void 0})})($o||($o={})),c.extendClassProps($o.prototype,$o.createDefaultProps);const Bc=class Bc extends on{constructor(e,i){super(e,i);L(this,"_czmESRoad");if(this._czmESRoad=this.disposeVar(new $o(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmESRoad;{const a=()=>{r.show=e.show&&e.stroked};a();const s=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.dispose(s.don(a))}this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"width"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"]))}get czmESRoad(){return this._czmESRoad}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmESRoad:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Bc,"type",Bc.register("ESCesiumViewer",vf.type,Bc));let Vg=Bc;const Tc=class Tc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){super(),this._subContainer=s;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));{const g=()=>{A.style.display=e.show??c.ESScale.defaults.show?"block":"none"};g(),e.dispose(e.showChanged.disposableOn(g))}A.style.position="fixed",A.style.width="125px",A.style.height="30px",A.style.border="1px solid rgba(49,50,56,.8)",A.style.padding="0 5px",A.style.backgroundColor="rgba(37,38,42,.8)",A.style.borderRadius="15px",A.style.pointerEvents="auto",A.style.transition=" right 0.4s linear";{const g=()=>{A.style.bottom=`${e.cssPosition?e.cssPosition[0]:c.ESScale.defaults.cssPosition[0]}px`,e.screenPosition==="left"?(A.style.right="auto",A.style.left=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`):(A.style.left="auto",A.style.right=`${e.cssPosition?e.cssPosition[1]:c.ESScale.defaults.cssPosition[1]}px`)},v=this.disposeVar(c.createNextAnimateFrameEvent(e.cssPositionChanged,e.screenPositionChanged));g(),this.dispose(v.disposableOn(()=>g()))}const h=document.createElement("div");A.appendChild(h),this.dispose(()=>A.removeChild(h)),h.style.width="125px",h.style.display="inline-block",h.style.textAlign="center",h.style.fontSize="14px",h.style.fontWeight="lighter",h.style.lineHeight="30px",h.style.color="#fff",h.innerHTML="1000km";const f=document.createElement("div");A.appendChild(f),this.dispose(()=>A.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="30px";const d=()=>{const g=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||g&&g>1e6)A.style.display="none";else{A.style.display="block";const v=i.viewerLegend.legend.computedLengthInStr;v&&(h.innerHTML=v);const y=i.viewerLegend.legend.computedLengthInPixels;if(y){f.style.width=`${y}px`;const m=(135-y)/2;f.style.left=`${m}px`}}};d();const p=setInterval(()=>{d()},200);this.dispose(()=>clearInterval(p))}}}get customDiv(){return this._customDiv}};L(Tc,"type",Tc.register("ESCesiumViewer",c.ESScale.type,Tc));let Ng=Tc;const Ic=class Ic extends He{constructor(e,i){super(e,i);L(this,"_czmCustomPrimitive");if(this._czmCustomPrimitive=this.disposeVar(new at(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmCustomPrimitive;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(Mt([r,"rotation"],[e,"rotation"])),this.dispose(c.track([r,"position"],[e,"position"])),this.dispose(c.track([r,"scale"],[e,"scale"])),this.dispose(c.track([r,"viewDistanceRange"],[e,"viewDistanceRange"])),this.dispose(c.track([r,"viewDistanceDebug"],[e,"viewDistanceDebug"])),this.dispose(c.track([r,"maximumScale"],[e,"maximumScale"])),this.dispose(c.track([r,"minimumScale"],[e,"minimumScale"])),this.dispose(c.track([r,"pixelSize"],[e,"pixelSize"])),this.dispose(c.track([r,"showSceneScale"],[e,"showSceneScale"])),this.dispose(c.track([r,"modelMatrix"],[e,"modelMatrix"])),this.dispose(c.track([r,"cull"],[e,"cull"])),this.dispose(c.track([r,"boundingVolume"],[e,"boundingVolume"])),this.dispose(c.track([r,"pass"],[e,"pass"])),this.dispose(c.track([r,"primitiveType"],[e,"primitiveType"])),this.dispose(c.track([r,"renderState"],[e,"renderState"])),this.dispose(c.track([r,"vertexShaderSource"],[e,"vertexShaderSource"])),this.dispose(c.track([r,"fragmentShaderSource"],[e,"fragmentShaderSource"])),this.dispose(c.track([r,"uniformMap"],[e,"uniformMap"])),this.dispose(c.track([r,"attributes"],[e,"attributes"])),this.dispose(c.track([r,"indexTypedArray"],[e,"indexTypedArray"])),this.dispose(c.track([r,"attributesJson"],[e,"attributesJson"])),this.dispose(c.track([r,"indexTypedArrayJson"],[e,"indexTypedArrayJson"])),this.dispose(c.track([r,"count"],[e,"count"])),this.dispose(c.track([r,"offset"],[e,"offset"])),this.dispose(c.track([r,"instanceCount"],[e,"instanceCount"])),this.dispose(c.track([r,"localPosition"],[e,"localPosition"])),this.dispose(c.track([r,"localScale"],[e,"localScale"])),this.dispose(c.track([r,"localModelMatrix"],[e,"localModelMatrix"])),this.dispose(c.track([r,"debugShowBoundingVolume"],[e,"debugShowBoundingVolume"])),this.dispose(c.track([r,"debugOverlappingFrustums"],[e,"debugOverlappingFrustums"])),this.dispose(c.track([r,"occlude"],[e,"occlude"])),this.dispose(c.track([r,"castShadows"],[e,"castShadows"])),this.dispose(c.track([r,"receiveShadows"],[e,"receiveShadows"])),this.dispose(c.track([r,"executeInClosestFrustum"],[e,"executeInClosestFrustum"])),this.dispose(c.track([r,"pickOnly"],[e,"pickOnly"])),this.dispose(c.track([r,"depthForTranslucentClassification"],[e,"depthForTranslucentClassification"]));{const a=()=>{if(e.localRotation){const s=[...e.localRotation];s[0]-=90,r.localRotation=s}else r.localRotation=[-90,0,0]};a(),this.dispose(e.localRotationChanged.disposableOn(a))}}get czmCustomPrimitive(){return this._czmCustomPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmCustomPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(wn(r,o,i,e,a,!0),!0):!1}};L(Ic,"type",Ic.register("ESCesiumViewer",gf.type,Ic));let Hg=Ic;const Fc=class Fc extends hf{constructor(e,i){super(e,i);L(this,"czmGeoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.czmGeoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Do(i,e.id));const{czmGeoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.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??c.ESDynamicWater.defaults.waterColor,frequency:(e.frequency??c.ESDynamicWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESDynamicWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESDynamicWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESDynamicWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESDynamicWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESDynamicWater.defaults.flowSpeed});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=e.show&&e.stroked},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=!!(e.show&&e.filled)},u=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{if(!e.points||e.points&&e.points.length<=2){a.positions=[],s.points=[];return}if(e.scale&&e.scale.some(f=>f===0)){console.warn("缩放属性(scale)不能设置值为0");return}const A=e.points.map(f=>[f[0],f[1],0]),[h]=_r({originPosition:e.position,originRotation:e.rotation,originScale:e.scale,initialRotationMode:"XForwardZUp"},A);a.positions=[...h,h[0]],s.points=[...h]};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.positionChanged,e.rotationChanged,e.scaleChanged));this.d(u.don(l))}}visibleDistance(e,i){var o;if((o=i.viewer)!=null&&o.camera&&e.show){const r=c.getDistancesFromPositions([e.position,Fn(i.viewer.camera)],"NONE")[0];let a=!1;e.minVisibleDistance<e.maxVisibleDistance?a=e.minVisibleDistance<r&&r<e.maxVisibleDistance:e.maxVisibleDistance==0&&(a=r>e.minVisibleDistance),this.czmGeoPolyline&&(this.czmGeoPolyline.show=e.show&&e.stroked&&a),this.czmWater&&(this.czmWater.show=e.show&&e.filled&&a)}}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmWater:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a!=null&&a.points?(Me(r,o,i,a.points,e,!0),!0):!1:!1}updateWater(e){const{czmWater:i}=this;i&&(e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection)}};L(Fc,"type",Fc.register("ESCesiumViewer",c.ESDynamicWater.type,Fc));let Gg=Fc;const Mc=class Mc extends Nn{constructor(e,i){super(e,i);L(this,"_scaleFactor",.6);L(this,"_urlData",this.dv(c.react(void 0)));L(this,"_dataSource",new _.CustomDataSource);L(this,"_clusterImages",{});L(this,"_clusterImageAttribute",{});L(this,"_clusterImageUrl","");if(!i.viewer){console.warn("viewer is undefined!");return}this._clusterImageUrl=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterSpirit.png"),(async()=>{var s;const r=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/ESPoi2D/clusterJson.json");await fetch(r).then(l=>l.json()).then(l=>{this._clusterImageAttribute=l}).catch(l=>{console.error(l)});for(const l in this._clusterImageAttribute)if(Object.prototype.hasOwnProperty.call(this._clusterImageAttribute,l)){const u=this._clusterImageAttribute[l];this._clusterImages[l]=new _.BillboardGraphics({image:this._clusterImageUrl,verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,scale:1*this._scaleFactor,width:u.imageSize[0],height:u.imageSize[1],pixelOffset:new _.Cartesian2(-u.anchorPixelOffset[0]*this._scaleFactor,-u.anchorPixelOffset[1]*this._scaleFactor),imageSubRegion:new _.BoundingRectangle(...u.imagePixelOffset,...u.imageSize)})}const a=this._dataSource;(s=i.viewer)==null||s.dataSources.add(a),this.d(()=>{var l;(l=i.viewer)==null||l.dataSources.remove(a)}),a.clustering.enabled=a.clustering.clusterBillboards=a.clustering.clusterLabels=a.clustering.clusterPoints=!0,this.d(c.track([a.clustering,"pixelRange"],[e,"pixelRange"])),this.d(c.track([a.clustering,"minimumClusterSize"],[e,"minimumClusterSize"])),this.d(c.track([a.clustering,"show"],[e,"show"]));{const l=()=>{e.url&&(typeof e.url=="object"&&e.url.url?fetch(c.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:c.isJSON(e.url)?this.urlData=JSON.parse(e.url):fetch(c.ESSceneObject.getStrFromEnv(e.url)).then(u=>u.json()).then(u=>{this.urlData=u}).catch(u=>{console.warn("ESEntityCluster数据加载失败",u)}))};l(),this.d(e.urlChanged.don(l))}{const l=this.dv(c.createNextAnimateFrameEvent(this.urlDataChanged,e.heightReferenceChanged)),u=this;this.updateEntityCluster(u),this.d(l.don(()=>{this.updateEntityCluster(u)}))}{const l=(u,A)=>{u!=null&&((u==null?void 0:u.nonCluster.mode)!=(A==null?void 0:A.nonCluster.mode)||(u==null?void 0:u.nonCluster.style)!=(A==null?void 0:A.nonCluster.style))?this.updateEntityCluster(this):this.updateStyle()};this.d(e.styleChanged.don((u,A)=>l(u,A)))}})()}get urlData(){return this._urlData.value}set urlData(e){this._urlData.value=e}get urlDataChanged(){return this._urlData.changed}async updateEntityCluster(e){var d,p,g,v,y,m,b,x,E,B,P,I;const{czmViewer:i,_dataSource:o,sceneObject:r}=e;if(!((d=i.viewer)==null?void 0:d.scene))return;const s=o.entities,l=new _.NearFarScalar(100,1,1e3,1),u=r.heightReference=="None"?_.HeightReference.NONE:r.heightReference=="CLAMP_TO_GROUND"?_.HeightReference.CLAMP_TO_GROUND:_.HeightReference.CLAMP_TO_TERRAIN;s.removeAll();const A=(p=this.czmViewer.viewer)==null?void 0:p.scene.postUpdate.addEventListener(()=>{o._entityCluster._billboardCollection&&(o._entityCluster._billboardCollection._billboards.forEach(M=>{M.id.billboard.imageSubRegion=void 0}),A&&A())}),h=r.style??c.ESEntityCluster.defaults.style;this._clusterImages[((g=h.nonCluster)==null?void 0:g.mode)??"SquareH01"].heightReference=u,this._clusterImages[((v=h.nonCluster)==null?void 0:v.mode)??"SquareH01"].scaleByDistance=l;const f=[-this._clusterImageAttribute[((y=h.nonCluster)==null?void 0:y.mode)??"SquareH01"].anchorPixelOffset[0]+this._clusterImageAttribute[((m=h.nonCluster)==null?void 0:m.mode)??"SquareH01"].textPixelOffset[0],-this._clusterImageAttribute[((b=h.nonCluster)==null?void 0:b.mode)??"SquareH01"].anchorPixelOffset[1]-this._clusterImageAttribute[((x=h.nonCluster)==null?void 0:x.mode)??"SquareH01"].textPixelOffset[1]];if(this.urlData.type==="FeatureCollection")for(let M=0;M<this.urlData.features.length;M++){const F=this.urlData.features[M];if(F.geometry.type=="Point")this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates,f,u,l,(E=h.nonCluster)==null?void 0:E.mode,F.properties);else if(F.geometry.type=="MultiPoint")for(let S=0;S<F.geometry.coordinates.length;S++)this._addEntities(s,F.properties.name??(M+1).toString(),F.geometry.coordinates[S],f,u,l,(B=h.nonCluster)==null?void 0:B.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.geometry.type)}else if(this.urlData.type=="GeometryCollection")for(let M=0;M<this.urlData.geometries.length;M++){const F=this.urlData.geometries[M];if(F.type=="Point")this._addEntities(s,F.name??(M+1).toString(),F.coordinates,f,u,l,(P=h.nonCluster)==null?void 0:P.mode,F.properties);else if(F.type=="MultiPoint")for(let S=0;S<F.coordinates.length;S++)this._addEntities(s,F.name??(M+1).toString(),F.coordinates[S],f,u,l,(I=h.nonCluster)==null?void 0:I.mode,F.properties);else console.log("POI聚合只能加载Point和MultiPoint类型的数据,未加载数据类型为:",F.type)}this.updateStyle(u,l)}async updateStyle(e,i){var l,u;const o=this,{_dataSource:r,sceneObject:a}=this,s=((l=a.style)==null?void 0:l.cluster)??c.ESEntityCluster.defaults.style.cluster;r.entities.values.forEach(A=>{_.Entity.prototype&&(A.ESSceneObjectID=a.id)}),r.clustering.clusterEvent.addEventListener(async function(A,h){if(h.label.ESSceneObjectID=h.billboard.ESSceneObjectID=h.point.ESSceneObjectID=a.id,h.label.show=!0,h.label.font="16px sans-serif",h.label.scale=1*o._scaleFactor,h.label.verticalOrigin=_.VerticalOrigin.BOTTOM,h.label.horizontalOrigin=_.HorizontalOrigin.CENTER,h.label.eyeOffset=new _.Cartesian3(0,0,-10),e&&(h.label.heightReference=e),i&&(h.label.scaleByDistance=i),h.billboard.id=h.label.id,h.billboard.show=!0,h.billboard.scale=1*o._scaleFactor,h.billboard.verticalOrigin=_.VerticalOrigin.BOTTOM,h.billboard.horizontalOrigin=_.HorizontalOrigin.CENTER,e&&(h.billboard.heightReference=e),i&&(h.billboard.scaleByDistance=i),s){const f=o.getClusterStyle(s,A.length).mode,d=[-o._clusterImageAttribute[f].anchorPixelOffset[0]+o._clusterImageAttribute[f].textPixelOffset[0],-o._clusterImageAttribute[f].anchorPixelOffset[1]-o._clusterImageAttribute[f].textPixelOffset[1]];h.label.pixelOffset=new _.Cartesian2(d[0]*o._scaleFactor,d[1]*o._scaleFactor),h.billboard.width=o._clusterImageAttribute[f].imageSize[0],h.billboard.height=o._clusterImageAttribute[f].imageSize[1],h.billboard.pixelOffset=new _.Cartesian2(-o._clusterImageAttribute[f].anchorPixelOffset[0]*o._scaleFactor,-o._clusterImageAttribute[f].anchorPixelOffset[1]*o._scaleFactor),h.billboard.setImage(f,o._clusterImageUrl),h.billboard.setImageSubRegion(f,new _.BoundingRectangle(...o._clusterImageAttribute[f].imagePixelOffset,...o._clusterImageAttribute[f].imageSize))}});{const A=()=>{const f=r.clustering.pixelRange;r.clustering.pixelRange=0,r.clustering.pixelRange=f};A();let h=(u=this.czmViewer.viewer)==null?void 0:u.camera.moveEnd.addEventListener(()=>{A()});this.d(()=>{var f;h&&((f=this.czmViewer.viewer)==null||f.camera.moveEnd.removeEventListener(h))})}}getClusterStyle(e,i){return e.find(o=>{if(o.value!==void 0)return o.value===i;const r=o.minValue!==void 0?o.minValue<=i:!0,a=o.maxValue!==void 0?o.maxValue>=i:!0;return r&&a})}_addEntities(e,i,o,r,a,s,l,u){const A=_.Cartesian3.fromDegrees(o[0],o[1],o[2]??0);e.add({position:A,label:{text:i,scale:1*this._scaleFactor,font:"16px sans-serif",verticalOrigin:_.VerticalOrigin.BOTTOM,horizontalOrigin:_.HorizontalOrigin.CENTER,pixelOffset:new _.Cartesian2(r[0]*this._scaleFactor,r[1]*this._scaleFactor),heightReference:a,scaleByDistance:s,eyeOffset:new _.Cartesian3(0,0,-10)},billboard:this._clusterImages[l??"SquareH01"].clone(new _.BillboardGraphics),properties:u})}_getPositionLLH(e){const i=_.Cartographic.fromCartesian(e);return[_.Math.toDegrees(i.longitude),_.Math.toDegrees(i.latitude),i.height]}};L(Mc,"type",Mc.register("ESCesiumViewer",c.ESEntityCluster.type,Mc));let Wg=Mc;const Dc=class Dc extends Nn{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(i.esImageryLayer.flyTo(n&&n),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(Dc,"type",Dc.register("ESCesiumViewer",pf.type,Dc));let jg=Dc;const Rc=class Rc extends Un{constructor(e,i){super(e,i);L(this,"geoPolyline");L(this,"czmWater");if(!i.viewer){console.warn("viewer is undefined!");return}if(!Qn(i.viewer))return;this.geoPolyline=this.dv(new Ye(i,e.id)),this.czmWater=this.dv(new Do(i,e.id));const{geoPolyline:a,czmWater:s}=this;this.d(c.track([s,"allowPicking"],[e,"allowPicking"])),this.d(c.track([s,"ground"],[e,"fillGround"])),this.d(c.track([a,"allowPicking"],[e,"allowPicking"])),this.d(c.track([a,"color"],[e,"strokeColor"])),this.d(c.track([a,"width"],[e,"strokeWidth"])),this.d(c.track([a,"ground"],[e,"strokeGround"]));{const l=this.dv(c.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??c.ESGeoWater.defaults.waterColor,frequency:(e.frequency??c.ESGeoWater.defaults.frequency)/10,waveVelocity:(e.waveVelocity??c.ESGeoWater.defaults.waveVelocity)/100,amplitude:(e.amplitude??c.ESGeoWater.defaults.amplitude)*100,specularIntensity:e.specularIntensity??c.ESGeoWater.defaults.specularIntensity,flowDirection:e.flowDirection??c.ESGeoWater.defaults.flowDirection,flowSpeed:e.flowSpeed??c.ESGeoWater.defaults.flowSpeed,waterImage:e.waterImage??c.ESGeoWater.defaults.waterImage});else{const A=Object.assign({},Mp[e.waterType]);A.frequency&&(A.frequency/=10),A.waveVelocity&&(A.waveVelocity/=100),A.amplitude&&(A.amplitude*=100),this.updateWater(A)}};u(),this.d(l.don(u))}{const l=()=>{a.show=!!(e.show&&e.stroked)},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(u.don(l)),l()}{const l=()=>{s.show=e.show&&e.filled},u=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(u.don(l)),l()}{const l=()=>{e.points&&e.points.length>=3?(a.positions=[...e.points,e.points[0]],s.points=[...e.points]):(a.positions=e.points&&e.points.length>=2?[...e.points,e.points[0]]:[],s.points=[])};l();const u=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged));this.d(u.don(l))}this.ad(e.editingChanged.don(l=>{s.updateBoundingSphere(l)}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}updateWater(e){const{czmWater:i}=this;e.waterColor&&i.waterColor!=e.waterColor&&(i.waterColor=e.waterColor),e.specularIntensity!=null&&i.specularIntensity!=e.specularIntensity&&(i.specularIntensity=e.specularIntensity),e.frequency!=null&&i.frequency!=e.frequency&&(i.frequency=e.frequency),e.waveVelocity!=null&&i.animationSpeed!=e.waveVelocity&&(i.animationSpeed=e.waveVelocity),e.amplitude!=null&&i.amplitude!=e.amplitude&&(i.amplitude=e.amplitude),e.flowSpeed!=null&&i.flowSpeed!=e.flowSpeed&&(i.flowSpeed=e.flowSpeed),i.baseWaterImage=e.waterImage,i.stRotation=e.flowDirection}};L(Rc,"type",Rc.register("ESCesiumViewer",c.ESGeoWater.type,Rc));let qg=Rc;const Uc=class Uc extends Nn{constructor(e,i){super(e,i);L(this,"_czmImagery");if(this._czmImagery=this.dv(new Zr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmImagery;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"zIndex"],[e,"zIndex"])),this.d(c.track([r,"rectangle"],[e,"rectangle"])),this.d(c.track([r,"alpha"],[e,"opacity"])),this.d(c.track([r,"splitDirection"],[e,"splitDirection"])),this.d(c.track([r,"brightness"],[e,"czmBrightness"])),this.d(c.track([r,"contrast"],[e,"czmContrast"])),this.d(c.track([r,"hue"],[e,"czmHue"])),this.d(c.track([r,"saturation"],[e,"czmSaturation"])),this.d(c.track([r,"gamma"],[e,"czmGamma"]));{const a=this.dv(c.createNextAnimateFrameEvent(e.urlChanged,e.accessTokenChanged,e.maximumLevelChanged,e.minimumLevelChanged,e.tileSizeChanged,e.allowPickingChanged,e.rectangleChanged,e.styleChanged,e.schemeChanged)),s=()=>{r.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}};s(),this.d(a.don(s))}}get czmImagery(){return this._czmImagery}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmImagery:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.flyTo(e&&e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Uc,"type",Uc.register("ESCesiumViewer",ff.type,Uc));let Kg=Uc;class aL extends c.Destroyable{constructor(n,e){super(),this._czmESPipeFence=n,this._sceneObject=e;const i=this._sceneObject,o=this._czmESPipeFence,r=o.czmCustomPrimitive;if(!i.points||i.points.length<2){this.clear(r);return}const a=i.points.length;let s=[],l=[],u=[],A=[],h=[];for(let y=0;y<a-1;y++){const{outlinePionts:m,customPrimitivePoints:b}=this.divideFourPoints(i.points[y],i.points[y+1]);A.push(...b),h.push(...m),u.push(...this.setIndexs(y))}const[f,d,p]=vn({originPosition:A[0]},A),g=this.setFaces(f);s.push(...g.flat());const v=this.setTextureCoordinates(i,o);l.push(...v.flat()),o.computeBoundingBox(),this.updateCustomPrimitive(r,d,s,u,l)}divideFourPoints(n,e){const i=c.geoHeading(n,e),o=c.geoDestination(n,this._sceneObject.width/2,90+i),r=c.geoDestination(n,this._sceneObject.width/2,i-90),a=c.geoDestination(e,this._sceneObject.width/2,i-90),s=c.geoDestination(e,this._sceneObject.width/2,90+i),l=[o[0],o[1],o[2]+this._sceneObject.height/2],u=[o[0],o[1],o[2]-this._sceneObject.height/2],A=[r[0],r[1],r[2]+this._sceneObject.height/2],h=[r[0],r[1],r[2]-this._sceneObject.height/2],f=[s[0],s[1],s[2]+this._sceneObject.height/2],d=[s[0],s[1],s[2]-this._sceneObject.height/2],p=[a[0],a[1],a[2]+this._sceneObject.height/2],g=[a[0],a[1],a[2]-this._sceneObject.height/2],v=[[l,A],[l,f],[l,u],[u,d]],y=[[u,h],[A,p],[A,h],[h,g]],m=[[f,d],[f,p],[d,g],[p,g]];return{outlinePionts:[...v,...y,...m],customPrimitivePoints:[u,l,A,h,d,f,p,g]}}setIndexs(n){const e=n*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(n){const e=[],i=n.length/8;for(let r=0;r<i;r++){const a=n.slice(8*r,8*(r+1));e.push(a)}return[...e.map(r=>[r[4],r[5],r[1],r[0],r[5],r[6],r[2],r[1],r[6],r[7],r[3],r[2],r[7],r[4],r[0],r[3]]).flat()]}getDistances(n,e){const[i]=vn({originPosition:n[0]},n),o=i.length,r=i.reduce((l,u,A,h)=>{if(A===0)return l.push(0),l;const f=A-1,d=h[f],p=Math.sqrt((d[0]-u[0])*(d[0]-u[0])+(d[1]-u[1])*(d[1]-u[1]));return l.push(l[f]+p),l},[]),a=r[o-1];return e.distances=a,r.map(l=>l/a)}setTextureCoordinates(n,e){if(!n.points||n.points.length<2)return;const i=this.getDistances(n.points,e),o=[];for(let r=1;r<i.length;r++){let a=[];if(r===i.length-1){const s=[1,0,1,1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}else{const s=[i[r],0,i[r],1,i[r-1],1,i[r-1],0];a=[...s,...s,...s,...s]}o.push(a)}return o}updateCustomPrimitive(n,e,i,o,r){n.modelMatrix=e,n.indexTypedArray=new Uint16Array(o),n.attributes={position:{typedArray:new Float32Array(i),componentsPerAttribute:3},a_st:{typedArray:new Float32Array(r),componentsPerAttribute:2}}}clear(n){n.indexTypedArray=void 0,n.modelMatrix=void 0,n.attributes=void 0}}const Oc=class Oc extends on{constructor(e,i){super(e,i);L(this,"_line",this.dv(new Ye(this.czmViewer,this.sceneObject.id)));L(this,"_czmTexture",this.ad(new ht(this.czmViewer,this.sceneObject.id)));L(this,"_czmCustomPrimitive",this.dv(new at(this.czmViewer,this.sceneObject.id)));L(this,"_distances",this.dv(c.react(0)));if(!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmTexture,a=this._line;this.d(c.bind([a,"positions"],[e,"points"])),this.d(c.track([this.line,"allowPicking"],[e,"allowPicking"])),this.d(c.track([this.line,"color"],[e,"strokeColor"])),this.d(c.track([this.line,"width"],[e,"strokeWidth"])),this.d(c.track([this.line,"ground"],[e,"strokeGround"]));{const A=this.dv(c.createNextAnimateFrameEvent(this.sceneObject.pointsChanged,this.sceneObject.strokeWidthChanged,this.sceneObject.strokeColorChanged,this.sceneObject.heightChanged,this.sceneObject.widthChanged,this.sceneObject.fillColorChanged));this.dv(new c.ObjResettingWithEvent(A,()=>new aL(this,this.sceneObject)))}{const A=()=>{a.show=e.show&&e.stroked};A();const h=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged));this.d(h.don(A))}this.bindCustomPrimitive(e);let s="";const l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),u=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const A=()=>{e.materialMode==="multipleArrows"||e.materialMode==="blue"?s=u:e.materialMode==="color"?s="":s=l,r.uri=s,s==""?(this._czmCustomPrimitive.uniformMap={u_color:e.fillColor},this._czmCustomPrimitive.fragmentShaderSource=` uniform vec4 u_color;
3597
3597
  in vec2 v_st;
3598
3598
  void main()
3599
3599
  {
@@ -3632,7 +3632,7 @@ ${Xx}
3632
3632
  {
3633
3633
  v_st = a_st;
3634
3634
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
3635
- }`,i.castShadows=!0,i.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{i.show=e.show&&e.filled};o();const r=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(r.don(o))}return i}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.line.positions?(Me(r,o,i,this.line.positions,e),!0):!1:!1}};L(Oc,"type",Oc.register("ESCesiumViewer",c.ESPipeFence.type,Oc));let Zg=Oc;const Lc=class Lc extends fa{constructor(e,i){super(e,i);L(this,"czmCustomPrimitive");L(this,"czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(new at(i,e.id)),a=this.ad(new ht(i,e.id));this.czmCustomPrimitive=r,this.czmTexture=a,this.d(c.track([r,"allowPicking"],[e,"allowPicking"]));const s=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new c.ObjResettingWithEvent(s,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new aL(e,this);r.attributes=void 0}))}};L(Lc,"type",Lc.register("ESCesiumViewer",c.ESPipeline.type,Lc));let $g=Lc;class aL extends c.Destroyable{constructor(n,e){super(),this._sceneObject=n,this._czmESPipeline=e;const i=this._sceneObject,o=this._czmESPipeline,r=o.czmCustomPrimitive,a=o.czmTexture;if(!r||!a)return;{const u=()=>{r.show=i.show&&i.filled};u();const A=this.dv(c.createNextAnimateFrameEvent(i.showChanged,i.filledChanged));this.d(A.don(u))}const s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{i.materialImage.url!=""?a.uri=typeof i.materialImage.url=="string"?i.materialImage.url:i.materialImage.url.url:i.materialMode==="multipleArrows"||i.materialMode==="blue"?a.uri=l:a.uri=s;const h=c.getDistancesFromPositions(i.points,"GEODESIC"),d=h[h.length-1]/i.materialImage.uDis;r.uniformMap={u_image:{type:"texture",id:a.id},u_stScale:[d,2*Math.PI*i.radius/i.materialImage.vDis],u_speed:[i.speed/i.materialImage.uDis,0],u_color:i.fillColor}};u();const A=this.dv(c.createNextAnimateFrameEvent(i.speedChanged,i.materialImageChanged,i.materialModeChanged,i.fillColorChanged));this.d(A.don(u))}(()=>{if(!i.points||i.points.length>=2&&c.equalsN3(i.points[i.points.length-2],i.points[i.points.length-1]))return;const{position:A,modelMatrix:h,indexes:f,uvCoordinates:d}=this.coordinateTransformation(i.points,i.sides);r.modelMatrix=h,r.attributes={position:{typedArray:new Float32Array(A),componentsPerAttribute:3},st:{typedArray:new Float32Array([...d,...d.reverse()]),componentsPerAttribute:2}},r.indexTypedArray=new Uint16Array([...f,...f.reverse()]),r.fragmentShaderSource=`
3635
+ }`,i.castShadows=!0,i.receiveShadows=!0,this.computeBoundingBox();{const o=()=>{i.show=e.show&&e.filled};o();const r=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.d(r.don(o))}return i}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.line.positions?(Me(r,o,i,this.line.positions,e),!0):!1:!1}};L(Oc,"type",Oc.register("ESCesiumViewer",c.ESPipeFence.type,Oc));let Zg=Oc;const Lc=class Lc extends fa{constructor(e,i){super(e,i);L(this,"czmCustomPrimitive");L(this,"czmTexture");if(!i.viewer){console.warn("viewer is undefined!");return}const r=this.dv(new at(i,e.id)),a=this.ad(new ht(i,e.id));this.czmCustomPrimitive=r,this.czmTexture=a,this.d(c.track([r,"allowPicking"],[e,"allowPicking"]));const s=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.radiusChanged,e.sidesChanged));this.dv(new c.ObjResettingWithEvent(s,()=>{if(e.radius>0&&e.sides>=3&&e.points&&e.points.length>=2)return new lL(e,this);r.attributes=void 0}))}};L(Lc,"type",Lc.register("ESCesiumViewer",c.ESPipeline.type,Lc));let $g=Lc;class lL extends c.Destroyable{constructor(n,e){super(),this._sceneObject=n,this._czmESPipeline=e;const i=this._sceneObject,o=this._czmESPipeline,r=o.czmCustomPrimitive,a=o.czmTexture;if(!r||!a)return;{const u=()=>{r.show=i.show&&i.filled};u();const A=this.dv(c.createNextAnimateFrameEvent(i.showChanged,i.filledChanged));this.d(A.don(u))}const s=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/singleArrow.png"),l=c.ESSceneObject.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/path/multipleArrows.png");{const u=()=>{i.materialImage.url!=""?a.uri=typeof i.materialImage.url=="string"?i.materialImage.url:i.materialImage.url.url:i.materialMode==="multipleArrows"||i.materialMode==="blue"?a.uri=l:a.uri=s;const h=c.getDistancesFromPositions(i.points,"GEODESIC"),d=h[h.length-1]/i.materialImage.uDis;r.uniformMap={u_image:{type:"texture",id:a.id},u_stScale:[d,2*Math.PI*i.radius/i.materialImage.vDis],u_speed:[i.speed/i.materialImage.uDis,0],u_color:i.fillColor}};u();const A=this.dv(c.createNextAnimateFrameEvent(i.speedChanged,i.materialImageChanged,i.materialModeChanged,i.fillColorChanged));this.d(A.don(u))}(()=>{if(!i.points||i.points.length>=2&&c.equalsN3(i.points[i.points.length-2],i.points[i.points.length-1]))return;const{position:A,modelMatrix:h,indexes:f,uvCoordinates:d}=this.coordinateTransformation(i.points,i.sides);r.modelMatrix=h,r.attributes={position:{typedArray:new Float32Array(A),componentsPerAttribute:3},st:{typedArray:new Float32Array([...d,...d.reverse()]),componentsPerAttribute:2}},r.indexTypedArray=new Uint16Array([...f,...f.reverse()]),r.fragmentShaderSource=`
3636
3636
  in vec2 v_st;
3637
3637
  uniform sampler2D u_image;
3638
3638
  uniform vec4 u_color;
@@ -3654,7 +3654,7 @@ ${Xx}
3654
3654
  v_st = a_st;
3655
3655
  gl_Position = czm_modelViewProjection * vec4(position,1.0);
3656
3656
  }
3657
- `;const p=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!p)return;const{min:g,max:v}=p;r.setLocalAxisedBoundingBox(g,v)})()}coordinateTransformation(n,e){const i=c.getDistancesFromPositions(n,"GEODESIC"),o=i[i.length-1],{circlePoints:r,uvCoordinates:a}=this.getCircularCoordinates(n,o),[s,l,u]=vn({originPosition:r[0]},r),A=this.triangleIndices(e);return{modelMatrix:l,position:s.flat(),indexes:A,uvCoordinates:a}}getCircularCoordinates(n,e){const{_sceneObject:i}=this,o=i.radius,r=i.sides,a=[],s=[];let l=0,u=function(A){let h=new _.Cartesian3(A.x,A.y,A.z),f=_.Cartographic.fromCartesian(h),d=_.Math.toDegrees(f.latitude),p=_.Math.toDegrees(f.longitude),g=f.height;return[p,d,g]};for(let A=0;A<n.length-1;A++){const h=n[A],f=n[A+1],d=l;l+=c.getDistancesFromPositions([h,f],"GEODESIC")[0];const p=d/e,g=l/e,v=_.Cartesian3.fromDegrees(...h),y=_.Cartesian3.fromDegrees(...f),m=_.Cartesian3.subtract(y,v,new _.Cartesian3);if(m.equals(_.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}const b=_.Cartesian3.normalize(m,new _.Cartesian3),x=new _.Cartesian3(0,0,1),E=new _.Cartesian3(1,0,0),B=_.Cartesian3.cross(b,Math.abs(_.Cartesian3.dot(b,x))!=1?x:E,new _.Cartesian3);if(B.equals(_.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}_.Cartesian3.normalize(B,B),_.Cartesian3.multiplyByScalar(B,o,B);for(let P=0;P<=r;P++){let I=_.Quaternion.fromAxisAngle(b,P*2*Math.PI/r),M=_.Matrix3.fromQuaternion(I),F=_.Matrix4.fromRotationTranslation(M,_.Cartesian3.ZERO);_.Matrix4.multiplyByTranslation(F,B,F);const S=_.Matrix4.getTranslation(F,new _.Cartesian3);_.Cartesian3.add(v,S,S);const T=_.Cartesian3.add(S,m,new _.Cartesian3);a.push(u(S),u(T)),s.push(p,P/r,g,P/r)}}return{circlePoints:a,uvCoordinates:s}}triangleIndices(n){var a;const{_sceneObject:e}=this,o=(((a=e.points)==null?void 0:a.length)-1)*(n+1);let r=new Uint32Array(o*6);for(let s=0;s<o;s++)r[s*6+0]=s*2+0,r[s*6+1]=s*2+1,r[s*6+2]=(s+1)%(n+1)==0?(s-n)*2:s*2+2,r[s*6+3]=s*2+1,r[s*6+4]=(s+1)%(n+1)==0?(s-n)*2+1:s*2+3,r[s*6+5]=(s+1)%(n+1)==0?(s-n)*2:s*2+2;return r}}function Xg(t,n,e="children",i="dragType"){const o=[];return t.forEach(r=>{if(r[i]&&r[i]==="layer"){const a={id:r.id,visable:r.checked,color:r.config.color};n==="color"?delete a.visable:delete a.color,o.push(a)}if(r[e]&&r[e].length){const a=Xg(r[e],n,e,i);a.length&&o.push(...a)}}),o}const zc=class zc extends la{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.setLayerVisibleEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=Xg(a,"visable").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.visable.toString()]});this.setFeatureVisable(l)}catch(a){console.error(a)}})),this.d(n.setLayerColorEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=Xg(a,"color").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.color]});this.setFeatureColor(l)}catch(a){console.error(a)}}))}flyTo(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(zc,"type",zc.register("ESCesiumViewer",c.ESPipeserTileset.type,zc));let Yg=zc;var Jg={exports:{}};Jg.exports=xf,Jg.exports.default=xf;function xf(t,n,e){e=e||2;var i=n&&n.length,o=i?n[0]*e:t.length,r=Yx(t,0,o,e,!0),a=[];if(!r||r.next===r.prev)return a;var s,l,u,A,h,f,d;if(i&&(r=AL(t,n,r,e)),t.length>80*e){s=u=t[0],l=A=t[1];for(var p=e;p<o;p+=e)h=t[p],f=t[p+1],h<s&&(s=h),f<l&&(l=f),h>u&&(u=h),f>A&&(A=f);d=Math.max(u-s,A-l),d=d!==0?32767/d:0}return Yl(r,a,e,s,l,d,0),a}function Yx(t,n,e,i,o){var r,a;if(o===ny(t,n,e,i)>0)for(r=n;r<e;r+=i)a=t_(r,t[r],t[r+1],a);else for(r=e-i;r>=n;r-=i)a=t_(r,t[r],t[r+1],a);return a&&_f(a,a.next)&&(eu(a),a=a.next),a}function Xo(t,n){if(!t)return t;n||(n=t);var e=t,i;do if(i=!1,!e.steiner&&(_f(e,e.next)||yt(e.prev,e,e.next)===0)){if(eu(e),e=n=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==n);return n}function Yl(t,n,e,i,o,r,a){if(t){!a&&r&&gL(t,i,o,r);for(var s=t,l,u;t.prev!==t.next;){if(l=t.prev,u=t.next,r?uL(t,i,o,r):lL(t)){n.push(l.i/e|0),n.push(t.i/e|0),n.push(u.i/e|0),eu(t),t=u.next,s=u.next;continue}if(t=u,t===s){a?a===1?(t=cL(Xo(t),n,e),Yl(t,n,e,i,o,r,2)):a===2&&hL(t,n,e,i,o,r):Yl(Xo(t),n,e,i,o,r,1);break}}}}function lL(t){var n=t.prev,e=t,i=t.next;if(yt(n,e,i)>=0)return!1;for(var o=n.x,r=e.x,a=i.x,s=n.y,l=e.y,u=i.y,A=o<r?o<a?o:a:r<a?r:a,h=s<l?s<u?s:u:l<u?l:u,f=o>r?o>a?o:a:r>a?r:a,d=s>l?s>u?s:u:l>u?l:u,p=i.next;p!==n;){if(p.x>=A&&p.x<=f&&p.y>=h&&p.y<=d&&ga(o,s,r,l,a,u,p.x,p.y)&&yt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function uL(t,n,e,i){var o=t.prev,r=t,a=t.next;if(yt(o,r,a)>=0)return!1;for(var s=o.x,l=r.x,u=a.x,A=o.y,h=r.y,f=a.y,d=s<l?s<u?s:u:l<u?l:u,p=A<h?A<f?A:f:h<f?h:f,g=s>l?s>u?s:u:l>u?l:u,v=A>h?A>f?A:f:h>f?h:f,y=ey(d,p,n,e,i),m=ey(g,v,n,e,i),b=t.prevZ,x=t.nextZ;b&&b.z>=y&&x&&x.z<=m;){if(b.x>=d&&b.x<=g&&b.y>=p&&b.y<=v&&b!==o&&b!==a&&ga(s,A,l,h,u,f,b.x,b.y)&&yt(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==o&&x!==a&&ga(s,A,l,h,u,f,x.x,x.y)&&yt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=y;){if(b.x>=d&&b.x<=g&&b.y>=p&&b.y<=v&&b!==o&&b!==a&&ga(s,A,l,h,u,f,b.x,b.y)&&yt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=m;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==o&&x!==a&&ga(s,A,l,h,u,f,x.x,x.y)&&yt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function cL(t,n,e){var i=t;do{var o=i.prev,r=i.next.next;!_f(o,r)&&Jx(o,i,i.next,r)&&Jl(o,r)&&Jl(r,o)&&(n.push(o.i/e|0),n.push(i.i/e|0),n.push(r.i/e|0),eu(i),eu(i.next),i=t=r),i=i.next}while(i!==t);return Xo(i)}function hL(t,n,e,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&wL(a,s)){var l=e_(a,s);a=Xo(a,a.next),l=Xo(l,l.next),Yl(a,n,e,i,o,r,0),Yl(l,n,e,i,o,r,0);return}s=s.next}a=a.next}while(a!==t)}function AL(t,n,e,i){var o=[],r,a,s,l,u;for(r=0,a=n.length;r<a;r++)s=n[r]*i,l=r<a-1?n[r+1]*i:t.length,u=Yx(t,s,l,i,!1),u===u.next&&(u.steiner=!0),o.push(vL(u));for(o.sort(fL),r=0;r<o.length;r++)e=pL(o[r],e);return e}function fL(t,n){return t.x-n.x}function pL(t,n){var e=dL(t,n);if(!e)return n;var i=e_(e,t);return Xo(i,i.next),Xo(e,e.next)}function dL(t,n){var e=n,i=t.x,o=t.y,r=-1/0,a;do{if(o<=e.y&&o>=e.next.y&&e.next.y!==e.y){var s=e.x+(o-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=i&&s>r&&(r=s,a=e.x<e.next.x?e:e.next,s===i))return a}e=e.next}while(e!==n);if(!a)return null;var l=a,u=a.x,A=a.y,h=1/0,f;e=a;do i>=e.x&&e.x>=u&&i!==e.x&&ga(o<A?i:r,o,u,A,o<A?r:i,o,e.x,e.y)&&(f=Math.abs(o-e.y)/(i-e.x),Jl(e,t)&&(f<h||f===h&&(e.x>a.x||e.x===a.x&&mL(a,e)))&&(a=e,h=f)),e=e.next;while(e!==l);return a}function mL(t,n){return yt(t.prev,t,n.prev)<0&&yt(n.next,t,t.next)<0}function gL(t,n,e,i){var o=t;do o.z===0&&(o.z=ey(o.x,o.y,n,e,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,yL(o)}function yL(t){var n,e,i,o,r,a,s,l,u=1;do{for(e=t,t=null,r=null,a=0;e;){for(a++,i=e,s=0,n=0;n<u&&(s++,i=i.nextZ,!!i);n++);for(l=u;s>0||l>0&&i;)s!==0&&(l===0||!i||e.z<=i.z)?(o=e,e=e.nextZ,s--):(o=i,i=i.nextZ,l--),r?r.nextZ=o:t=o,o.prevZ=r,r=o;e=i}r.nextZ=null,u*=2}while(a>1);return t}function ey(t,n,e,i,o){return t=(t-e)*o|0,n=(n-i)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function vL(t){var n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function ga(t,n,e,i,o,r,a,s){return(o-a)*(n-s)>=(t-a)*(r-s)&&(t-a)*(i-s)>=(e-a)*(n-s)&&(e-a)*(r-s)>=(o-a)*(i-s)}function wL(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!bL(t,n)&&(Jl(t,n)&&Jl(n,t)&&xL(t,n)&&(yt(t.prev,t,n.prev)||yt(t,n.prev,n))||_f(t,n)&&yt(t.prev,t,t.next)>0&&yt(n.prev,n,n.next)>0)}function yt(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function _f(t,n){return t.x===n.x&&t.y===n.y}function Jx(t,n,e,i){var o=Sf(yt(t,n,e)),r=Sf(yt(t,n,i)),a=Sf(yt(e,i,t)),s=Sf(yt(e,i,n));return!!(o!==r&&a!==s||o===0&&Cf(t,e,n)||r===0&&Cf(t,i,n)||a===0&&Cf(e,t,i)||s===0&&Cf(e,n,i))}function Cf(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function Sf(t){return t>0?1:t<0?-1:0}function bL(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Jx(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function Jl(t,n){return yt(t.prev,t,t.next)<0?yt(t,n,t.next)>=0&&yt(t,t.prev,n)>=0:yt(t,n,t.prev)<0||yt(t,t.next,n)<0}function xL(t,n){var e=t,i=!1,o=(t.x+n.x)/2,r=(t.y+n.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&o<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==t);return i}function e_(t,n){var e=new ty(t.i,t.x,t.y),i=new ty(n.i,n.x,n.y),o=t.next,r=n.prev;return t.next=n,n.prev=t,e.next=o,o.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}function t_(t,n,e,i){var o=new ty(t,n,e);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function eu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ty(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}xf.deviation=function(t,n,e,i){var o=n&&n.length,r=o?n[0]*e:t.length,a=Math.abs(ny(t,0,r,e));if(o)for(var s=0,l=n.length;s<l;s++){var u=n[s]*e,A=s<l-1?n[s+1]*e:t.length;a-=Math.abs(ny(t,u,A,e))}var h=0;for(s=0;s<i.length;s+=3){var f=i[s]*e,d=i[s+1]*e,p=i[s+2]*e;h+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return a===0&&h===0?0:Math.abs((h-a)/a)};function ny(t,n,e,i){for(var o=0,r=n,a=e-i;r<e;r+=i)o+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return o}xf.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},i=0,o=0;o<t.length;o++){for(var r=0;r<t[o].length;r++)for(var a=0;a<n;a++)e.vertices.push(t[o][r][a]);o>0&&(i+=t[o-1].length,e.holes.push(i))}return e};var _L=Jg.exports;const CL=Il(_L),kc=class kc extends Un{constructor(e,i){super(e,i);L(this,"czmSideCustomPrimitive");L(this,"czmBottomCustomPrimitive");L(this,"czmSideTexture");L(this,"czmBottomTexture");L(this,"_width",0);L(this,"_height",0);if(!i.viewer){console.log("viewer is undefined!");return}{const u=()=>{this.geoPolygon&&(this.geoPolygon.fill=!1)};u(),this.d(e.filledChanged.don(u))}const r=this.czmSideCustomPrimitive=this.dv(new at(i,e.id)),a=this.czmSideTexture=this.ad(new ht(i)),s=this.czmBottomCustomPrimitive=this.dv(new at(i,e.id)),l=this.czmBottomTexture=this.ad(new ht(i));this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([s,"allowPicking"],[e,"allowPicking"]));{const u=()=>{r.show=e.show&&e.filled&&e.points&&e.points.length>2,s.show=e.show&&e.filled&&e.points&&e.points.length>2};u();const A=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.pointsChanged));this.dispose(A.don(u))}{const u=(f,d,p,g,v)=>{f.position=d;const y=p.flat();let m=g=="bottom"?CL(y,null,3):this._triangleIndices(p.length),b=[],x=-1/0,E=1/0,B=-1/0,P=1/0,I=0;if(g=="bottom"){for(let C=0;C<p.length;C++)B=B>p[C][0]?B:p[C][0],P=P<p[C][0]?P:p[C][0],x=x>p[C][1]?x:p[C][1],E=E<p[C][1]?E:p[C][1];this._width=B-P,this._height=x-E;for(let C=0;C<p.length;C++)b.push((p[C][0]-this._width/2)/this._width,(p[C][1]-this._height/2)/this._height)}else{for(let C=0;C<p.length;C++)this._width+=this._getDistance(p[C],p[C-1<0?0:C-1]),x=x>p[C][2]?x:p[C][2],E=E<p[C][2]?E:p[C][2];this._height=x-E;for(let C=0;C<p.length;C++)I+=this._getDistance(p[C],p[C-1<0?0:C-1]),b.push(I/this._width,(p[C][2]-E)/this._height)}f.indexTypedArray=new Uint16Array(v?m:m.reverse()),f.attributes={position:{typedArray:new Float32Array(y),componentsPerAttribute:3},st:{typedArray:new Float32Array(v?b:b.reverse()),componentsPerAttribute:2}};const M=g=="bottom"?e.bottomImage.uDis??50:e.sideImage.uDis??50,F=g=="bottom"?e.bottomImage.vDis??50:e.sideImage.vDis??50;f.fragmentShaderSource=`in vec2 v_st;
3657
+ `;const p=r.computeLocalAxisedBoundingBoxFromAttribute("position");if(!p)return;const{min:g,max:v}=p;r.setLocalAxisedBoundingBox(g,v)})()}coordinateTransformation(n,e){const i=c.getDistancesFromPositions(n,"GEODESIC"),o=i[i.length-1],{circlePoints:r,uvCoordinates:a}=this.getCircularCoordinates(n,o),[s,l,u]=vn({originPosition:r[0]},r),A=this.triangleIndices(e);return{modelMatrix:l,position:s.flat(),indexes:A,uvCoordinates:a}}getCircularCoordinates(n,e){const{_sceneObject:i}=this,o=i.radius,r=i.sides,a=[],s=[];let l=0,u=function(A){let h=new _.Cartesian3(A.x,A.y,A.z),f=_.Cartographic.fromCartesian(h),d=_.Math.toDegrees(f.latitude),p=_.Math.toDegrees(f.longitude),g=f.height;return[p,d,g]};for(let A=0;A<n.length-1;A++){const h=n[A],f=n[A+1],d=l;l+=c.getDistancesFromPositions([h,f],"GEODESIC")[0];const p=d/e,g=l/e,v=_.Cartesian3.fromDegrees(...h),y=_.Cartesian3.fromDegrees(...f),m=_.Cartesian3.subtract(y,v,new _.Cartesian3);if(m.equals(_.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}const b=_.Cartesian3.normalize(m,new _.Cartesian3),x=new _.Cartesian3(0,0,1),E=new _.Cartesian3(1,0,0),B=_.Cartesian3.cross(b,Math.abs(_.Cartesian3.dot(b,x))!=1?x:E,new _.Cartesian3);if(B.equals(_.Cartesian3.ZERO)){a.push(a[a.length-1]),s.push(s[s.length-3],s[s.length-2],s[s.length-1]);continue}_.Cartesian3.normalize(B,B),_.Cartesian3.multiplyByScalar(B,o,B);for(let P=0;P<=r;P++){let I=_.Quaternion.fromAxisAngle(b,P*2*Math.PI/r),M=_.Matrix3.fromQuaternion(I),F=_.Matrix4.fromRotationTranslation(M,_.Cartesian3.ZERO);_.Matrix4.multiplyByTranslation(F,B,F);const S=_.Matrix4.getTranslation(F,new _.Cartesian3);_.Cartesian3.add(v,S,S);const T=_.Cartesian3.add(S,m,new _.Cartesian3);a.push(u(S),u(T)),s.push(p,P/r,g,P/r)}}return{circlePoints:a,uvCoordinates:s}}triangleIndices(n){var a;const{_sceneObject:e}=this,o=(((a=e.points)==null?void 0:a.length)-1)*(n+1);let r=new Uint32Array(o*6);for(let s=0;s<o;s++)r[s*6+0]=s*2+0,r[s*6+1]=s*2+1,r[s*6+2]=(s+1)%(n+1)==0?(s-n)*2:s*2+2,r[s*6+3]=s*2+1,r[s*6+4]=(s+1)%(n+1)==0?(s-n)*2+1:s*2+3,r[s*6+5]=(s+1)%(n+1)==0?(s-n)*2:s*2+2;return r}}function Xg(t,n,e="children",i="dragType"){const o=[];return t.forEach(r=>{if(r[i]&&r[i]==="layer"){const a={id:r.id,visable:r.checked,color:r.config.color};n==="color"?delete a.visable:delete a.color,o.push(a)}if(r[e]&&r[e].length){const a=Xg(r[e],n,e,i);a.length&&o.push(...a)}}),o}const zc=class zc extends la{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.setLayerVisibleEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=Xg(a,"visable").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.visable.toString()]});this.setFeatureVisable(l)}catch(a){console.error(a)}})),this.d(n.setLayerColorEvent.don((o,r)=>{try{let a=[];typeof r=="string"?a=JSON.parse(r):a=r;const l=Xg(a,"color").map(u=>{const A=typeof u.id=="string"?`'${u.id}'`:`'${u.id.toString()}'`;return[`\${${o}} === `+A,u.color]});this.setFeatureColor(l)}catch(a){console.error(a)}}))}flyTo(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}flyIn(n,e){const{sceneObject:i,czmViewer:o,czm3DTiles:r}=this;return o.actived?i.flyInParam?super.flyIn(n,e):(r.flyTo(n&&n*1e3),i.flyOverEvent.emit(e,"over",o),!0):!1}};L(zc,"type",zc.register("ESCesiumViewer",c.ESPipeserTileset.type,zc));let Yg=zc;var Jg={exports:{}};Jg.exports=xf,Jg.exports.default=xf;function xf(t,n,e){e=e||2;var i=n&&n.length,o=i?n[0]*e:t.length,r=Yx(t,0,o,e,!0),a=[];if(!r||r.next===r.prev)return a;var s,l,u,A,h,f,d;if(i&&(r=fL(t,n,r,e)),t.length>80*e){s=u=t[0],l=A=t[1];for(var p=e;p<o;p+=e)h=t[p],f=t[p+1],h<s&&(s=h),f<l&&(l=f),h>u&&(u=h),f>A&&(A=f);d=Math.max(u-s,A-l),d=d!==0?32767/d:0}return Yl(r,a,e,s,l,d,0),a}function Yx(t,n,e,i,o){var r,a;if(o===ny(t,n,e,i)>0)for(r=n;r<e;r+=i)a=t_(r,t[r],t[r+1],a);else for(r=e-i;r>=n;r-=i)a=t_(r,t[r],t[r+1],a);return a&&_f(a,a.next)&&(eu(a),a=a.next),a}function Xo(t,n){if(!t)return t;n||(n=t);var e=t,i;do if(i=!1,!e.steiner&&(_f(e,e.next)||yt(e.prev,e,e.next)===0)){if(eu(e),e=n=e.prev,e===e.next)break;i=!0}else e=e.next;while(i||e!==n);return n}function Yl(t,n,e,i,o,r,a){if(t){!a&&r&&yL(t,i,o,r);for(var s=t,l,u;t.prev!==t.next;){if(l=t.prev,u=t.next,r?cL(t,i,o,r):uL(t)){n.push(l.i/e|0),n.push(t.i/e|0),n.push(u.i/e|0),eu(t),t=u.next,s=u.next;continue}if(t=u,t===s){a?a===1?(t=hL(Xo(t),n,e),Yl(t,n,e,i,o,r,2)):a===2&&AL(t,n,e,i,o,r):Yl(Xo(t),n,e,i,o,r,1);break}}}}function uL(t){var n=t.prev,e=t,i=t.next;if(yt(n,e,i)>=0)return!1;for(var o=n.x,r=e.x,a=i.x,s=n.y,l=e.y,u=i.y,A=o<r?o<a?o:a:r<a?r:a,h=s<l?s<u?s:u:l<u?l:u,f=o>r?o>a?o:a:r>a?r:a,d=s>l?s>u?s:u:l>u?l:u,p=i.next;p!==n;){if(p.x>=A&&p.x<=f&&p.y>=h&&p.y<=d&&ga(o,s,r,l,a,u,p.x,p.y)&&yt(p.prev,p,p.next)>=0)return!1;p=p.next}return!0}function cL(t,n,e,i){var o=t.prev,r=t,a=t.next;if(yt(o,r,a)>=0)return!1;for(var s=o.x,l=r.x,u=a.x,A=o.y,h=r.y,f=a.y,d=s<l?s<u?s:u:l<u?l:u,p=A<h?A<f?A:f:h<f?h:f,g=s>l?s>u?s:u:l>u?l:u,v=A>h?A>f?A:f:h>f?h:f,y=ey(d,p,n,e,i),m=ey(g,v,n,e,i),b=t.prevZ,x=t.nextZ;b&&b.z>=y&&x&&x.z<=m;){if(b.x>=d&&b.x<=g&&b.y>=p&&b.y<=v&&b!==o&&b!==a&&ga(s,A,l,h,u,f,b.x,b.y)&&yt(b.prev,b,b.next)>=0||(b=b.prevZ,x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==o&&x!==a&&ga(s,A,l,h,u,f,x.x,x.y)&&yt(x.prev,x,x.next)>=0))return!1;x=x.nextZ}for(;b&&b.z>=y;){if(b.x>=d&&b.x<=g&&b.y>=p&&b.y<=v&&b!==o&&b!==a&&ga(s,A,l,h,u,f,b.x,b.y)&&yt(b.prev,b,b.next)>=0)return!1;b=b.prevZ}for(;x&&x.z<=m;){if(x.x>=d&&x.x<=g&&x.y>=p&&x.y<=v&&x!==o&&x!==a&&ga(s,A,l,h,u,f,x.x,x.y)&&yt(x.prev,x,x.next)>=0)return!1;x=x.nextZ}return!0}function hL(t,n,e){var i=t;do{var o=i.prev,r=i.next.next;!_f(o,r)&&Jx(o,i,i.next,r)&&Jl(o,r)&&Jl(r,o)&&(n.push(o.i/e|0),n.push(i.i/e|0),n.push(r.i/e|0),eu(i),eu(i.next),i=t=r),i=i.next}while(i!==t);return Xo(i)}function AL(t,n,e,i,o,r){var a=t;do{for(var s=a.next.next;s!==a.prev;){if(a.i!==s.i&&bL(a,s)){var l=e_(a,s);a=Xo(a,a.next),l=Xo(l,l.next),Yl(a,n,e,i,o,r,0),Yl(l,n,e,i,o,r,0);return}s=s.next}a=a.next}while(a!==t)}function fL(t,n,e,i){var o=[],r,a,s,l,u;for(r=0,a=n.length;r<a;r++)s=n[r]*i,l=r<a-1?n[r+1]*i:t.length,u=Yx(t,s,l,i,!1),u===u.next&&(u.steiner=!0),o.push(wL(u));for(o.sort(pL),r=0;r<o.length;r++)e=dL(o[r],e);return e}function pL(t,n){return t.x-n.x}function dL(t,n){var e=mL(t,n);if(!e)return n;var i=e_(e,t);return Xo(i,i.next),Xo(e,e.next)}function mL(t,n){var e=n,i=t.x,o=t.y,r=-1/0,a;do{if(o<=e.y&&o>=e.next.y&&e.next.y!==e.y){var s=e.x+(o-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(s<=i&&s>r&&(r=s,a=e.x<e.next.x?e:e.next,s===i))return a}e=e.next}while(e!==n);if(!a)return null;var l=a,u=a.x,A=a.y,h=1/0,f;e=a;do i>=e.x&&e.x>=u&&i!==e.x&&ga(o<A?i:r,o,u,A,o<A?r:i,o,e.x,e.y)&&(f=Math.abs(o-e.y)/(i-e.x),Jl(e,t)&&(f<h||f===h&&(e.x>a.x||e.x===a.x&&gL(a,e)))&&(a=e,h=f)),e=e.next;while(e!==l);return a}function gL(t,n){return yt(t.prev,t,n.prev)<0&&yt(n.next,t,t.next)<0}function yL(t,n,e,i){var o=t;do o.z===0&&(o.z=ey(o.x,o.y,n,e,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==t);o.prevZ.nextZ=null,o.prevZ=null,vL(o)}function vL(t){var n,e,i,o,r,a,s,l,u=1;do{for(e=t,t=null,r=null,a=0;e;){for(a++,i=e,s=0,n=0;n<u&&(s++,i=i.nextZ,!!i);n++);for(l=u;s>0||l>0&&i;)s!==0&&(l===0||!i||e.z<=i.z)?(o=e,e=e.nextZ,s--):(o=i,i=i.nextZ,l--),r?r.nextZ=o:t=o,o.prevZ=r,r=o;e=i}r.nextZ=null,u*=2}while(a>1);return t}function ey(t,n,e,i,o){return t=(t-e)*o|0,n=(n-i)*o|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t|n<<1}function wL(t){var n=t,e=t;do(n.x<e.x||n.x===e.x&&n.y<e.y)&&(e=n),n=n.next;while(n!==t);return e}function ga(t,n,e,i,o,r,a,s){return(o-a)*(n-s)>=(t-a)*(r-s)&&(t-a)*(i-s)>=(e-a)*(n-s)&&(e-a)*(r-s)>=(o-a)*(i-s)}function bL(t,n){return t.next.i!==n.i&&t.prev.i!==n.i&&!xL(t,n)&&(Jl(t,n)&&Jl(n,t)&&_L(t,n)&&(yt(t.prev,t,n.prev)||yt(t,n.prev,n))||_f(t,n)&&yt(t.prev,t,t.next)>0&&yt(n.prev,n,n.next)>0)}function yt(t,n,e){return(n.y-t.y)*(e.x-n.x)-(n.x-t.x)*(e.y-n.y)}function _f(t,n){return t.x===n.x&&t.y===n.y}function Jx(t,n,e,i){var o=Sf(yt(t,n,e)),r=Sf(yt(t,n,i)),a=Sf(yt(e,i,t)),s=Sf(yt(e,i,n));return!!(o!==r&&a!==s||o===0&&Cf(t,e,n)||r===0&&Cf(t,i,n)||a===0&&Cf(e,t,i)||s===0&&Cf(e,n,i))}function Cf(t,n,e){return n.x<=Math.max(t.x,e.x)&&n.x>=Math.min(t.x,e.x)&&n.y<=Math.max(t.y,e.y)&&n.y>=Math.min(t.y,e.y)}function Sf(t){return t>0?1:t<0?-1:0}function xL(t,n){var e=t;do{if(e.i!==t.i&&e.next.i!==t.i&&e.i!==n.i&&e.next.i!==n.i&&Jx(e,e.next,t,n))return!0;e=e.next}while(e!==t);return!1}function Jl(t,n){return yt(t.prev,t,t.next)<0?yt(t,n,t.next)>=0&&yt(t,t.prev,n)>=0:yt(t,n,t.prev)<0||yt(t,t.next,n)<0}function _L(t,n){var e=t,i=!1,o=(t.x+n.x)/2,r=(t.y+n.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&o<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==t);return i}function e_(t,n){var e=new ty(t.i,t.x,t.y),i=new ty(n.i,n.x,n.y),o=t.next,r=n.prev;return t.next=n,n.prev=t,e.next=o,o.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}function t_(t,n,e,i){var o=new ty(t,n,e);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function eu(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function ty(t,n,e){this.i=t,this.x=n,this.y=e,this.prev=null,this.next=null,this.z=0,this.prevZ=null,this.nextZ=null,this.steiner=!1}xf.deviation=function(t,n,e,i){var o=n&&n.length,r=o?n[0]*e:t.length,a=Math.abs(ny(t,0,r,e));if(o)for(var s=0,l=n.length;s<l;s++){var u=n[s]*e,A=s<l-1?n[s+1]*e:t.length;a-=Math.abs(ny(t,u,A,e))}var h=0;for(s=0;s<i.length;s+=3){var f=i[s]*e,d=i[s+1]*e,p=i[s+2]*e;h+=Math.abs((t[f]-t[p])*(t[d+1]-t[f+1])-(t[f]-t[d])*(t[p+1]-t[f+1]))}return a===0&&h===0?0:Math.abs((h-a)/a)};function ny(t,n,e,i){for(var o=0,r=n,a=e-i;r<e;r+=i)o+=(t[a]-t[r])*(t[r+1]+t[a+1]),a=r;return o}xf.flatten=function(t){for(var n=t[0][0].length,e={vertices:[],holes:[],dimensions:n},i=0,o=0;o<t.length;o++){for(var r=0;r<t[o].length;r++)for(var a=0;a<n;a++)e.vertices.push(t[o][r][a]);o>0&&(i+=t[o-1].length,e.holes.push(i))}return e};var CL=Jg.exports;const SL=Il(CL),kc=class kc extends Un{constructor(e,i){super(e,i);L(this,"czmSideCustomPrimitive");L(this,"czmBottomCustomPrimitive");L(this,"czmSideTexture");L(this,"czmBottomTexture");L(this,"_width",0);L(this,"_height",0);if(!i.viewer){console.log("viewer is undefined!");return}{const u=()=>{this.geoPolygon&&(this.geoPolygon.fill=!1)};u(),this.d(e.filledChanged.don(u))}const r=this.czmSideCustomPrimitive=this.dv(new at(i,e.id)),a=this.czmSideTexture=this.ad(new ht(i)),s=this.czmBottomCustomPrimitive=this.dv(new at(i,e.id)),l=this.czmBottomTexture=this.ad(new ht(i));this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([s,"allowPicking"],[e,"allowPicking"]));{const u=()=>{r.show=e.show&&e.filled&&e.points&&e.points.length>2,s.show=e.show&&e.filled&&e.points&&e.points.length>2};u();const A=this.dv(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged,e.pointsChanged));this.dispose(A.don(u))}{const u=(f,d,p,g,v)=>{f.position=d;const y=p.flat();let m=g=="bottom"?SL(y,null,3):this._triangleIndices(p.length),b=[],x=-1/0,E=1/0,B=-1/0,P=1/0,I=0;if(g=="bottom"){for(let C=0;C<p.length;C++)B=B>p[C][0]?B:p[C][0],P=P<p[C][0]?P:p[C][0],x=x>p[C][1]?x:p[C][1],E=E<p[C][1]?E:p[C][1];this._width=B-P,this._height=x-E;for(let C=0;C<p.length;C++)b.push((p[C][0]-this._width/2)/this._width,(p[C][1]-this._height/2)/this._height)}else{for(let C=0;C<p.length;C++)this._width+=this._getDistance(p[C],p[C-1<0?0:C-1]),x=x>p[C][2]?x:p[C][2],E=E<p[C][2]?E:p[C][2];this._height=x-E;for(let C=0;C<p.length;C++)I+=this._getDistance(p[C],p[C-1<0?0:C-1]),b.push(I/this._width,(p[C][2]-E)/this._height)}f.indexTypedArray=new Uint16Array(v?m:m.reverse()),f.attributes={position:{typedArray:new Float32Array(y),componentsPerAttribute:3},st:{typedArray:new Float32Array(v?b:b.reverse()),componentsPerAttribute:2}};const M=g=="bottom"?e.bottomImage.uDis??50:e.sideImage.uDis??50,F=g=="bottom"?e.bottomImage.vDis??50:e.sideImage.vDis??50;f.fragmentShaderSource=`in vec2 v_st;
3658
3658
  uniform sampler2D u_image;
3659
3659
  uniform vec4 u_color;
3660
3660
  void main()
@@ -3665,7 +3665,7 @@ ${Xx}
3665
3665
  vec4 imageColor = texture(u_image, st);
3666
3666
  out_FragColor = imageColor * u_color;
3667
3667
  }
3668
- `;const S=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:T,max:w}=S;f.setLocalAxisedBoundingBox(T,w)},A=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:d}=c.getMinMaxCorner(e.points),p=f[2]-e.depth;if(!c.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=vn({originPosition:d},e.points.map((E,B)=>{let P=[...E];return P[2]=p,P}));u(s,d,x[0],"bottom",!0)}const g=this._interpolationAlongPolygon(e.points.map((x,E)=>_.Cartesian3.fromArray(c.lbhToXyz(x))),e.interpolation),v=await i.getHeightsByLonLats(g.map(x=>[x[0],x[1]]));let y=[];for(let x=0;x<g.length;x++){const E=g[x];y.push([E[0],E[1],v[x]??E[2]],[E[0],E[1],p])}const m=vn({originPosition:d},y);let b=this._isClockwise(e.points,i);u(r,d,m[0],"side",b)}else r.attributes=void 0,s.attributes=void 0};A();const h=this.dv(c.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(h.don(A))}{const u=()=>{a.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,e.opacity]},s.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(A.don(u))}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,i){var o=[];for(let l=0;l<e.length;++l){var r=e[l],a=e[(l+1)%e.length],s=this._interpolationAlongLine(r,a,i);o.push(...s)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],a=_.Cartesian3.distance(e,i),s=_.Cartesian3.subtract(i,e,new _.Cartesian3);s.equals(_.Cartesian3.ZERO)||_.Cartesian3.normalize(s,s);for(var l=0;l<a;){var u=new _.Cartesian3(s.x*l,s.y*l,s.z*l),A=_.Cartesian3.add(e,u,new _.Cartesian3);const h=Ue(A);h&&r.push(h),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=_.Cartesian3.fromDegrees(...e[o]),a=_.Cartesian3.fromDegrees(...e[(o+1)%e.length]),s=_.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=_.Cartesian3.subtract(a,r,new _.Cartesian3),u=_.Cartesian3.subtract(s,a,new _.Cartesian3);if(l.equals(_.Cartesian3.ZERO)||u.equals(_.Cartesian3.ZERO))return!0;if(_.Cartesian3.normalize(l,l),_.Cartesian3.normalize(u,u),Math.abs(_.Cartesian3.dot(l,u))==1){if(o==e.length-1)return!0;continue}let A=_.Cartesian3.cross(l,u,new _.Cartesian3);return _.Cartesian3.dot(A,i.viewer.camera.directionWC)>0}}_triangleIndices(e){let i=new Uint32Array(e*3);for(let o=0;o<e;++o)i[o*3+0]=o,i[o*3+1]=o%2?(o+2)%e:(o+1)%e,i[o*3+2]=o%2?(o+1)%e:(o+2)%e;return i}_getDistance(e,i){return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}};L(kc,"type",kc.register("ESCesiumViewer",c.ESPit.type,kc));let iy=kc;const Qc=class Qc extends Un{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Lr(i,e.id)),console.log(this.czmPolygonPrimitive),this._geoPolylines=this.disposeVar(new ai(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const s=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};s(),this.ad(this.sceneObject.showChanged.don(s))}const r=this._geoPolylines;r.arcType="RHUMB";const a=this._czmPolygonPrimitive;this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"]));{a.perPositionHeight=!0;const s=()=>{r.show=e.show&&e.stroked,a.show=e.show&&e.filled,a.material={type:"Color",color:e.fillColor}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(s))}{const s=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let A=0;A<e.innerRings.length;A++){const h=e.innerRings[A];u.holes.push({positions:h}),r.positions.push([...h,h[0]])}a.polygonHierarchy=u}else a.polygonHierarchy=u};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>s()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Qc,"type",Qc.register("ESCesiumViewer",c.ESPolygonWithHole.type,Qc));let ry=Qc;var sn=63710088e-1,oy={centimeters:sn*100,centimetres:sn*100,degrees:sn/111325,feet:sn*3.28084,inches:sn*39.37,kilometers:sn/1e3,kilometres:sn/1e3,meters:sn,metres:sn,miles:sn/1609.344,millimeters:sn*1e3,millimetres:sn*1e3,nauticalmiles:sn/1852,radians:1,yards:sn*1.0936},SL={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/sn,yards:1.0936133},sy={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 On(t,n,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=n||{},i.geometry=t,i}function EL(t,n,e){switch(t){case"Point":return Zt(n).geometry;case"LineString":return Yn(n).geometry;case"Polygon":return kt(n).geometry;case"MultiPoint":return n_(n).geometry;case"MultiLineString":return ay(n).geometry;case"MultiPolygon":return ly(n).geometry;default:throw new Error(t+" is invalid")}}function Zt(t,n,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(!Ef(t[0])||!Ef(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return On(i,n,e)}function PL(t,n,e){return e===void 0&&(e={}),En(t.map(function(i){return Zt(i,n)}),e)}function kt(t,n,e){e===void 0&&(e={});for(var i=0,o=t;i<o.length;i++){var r=o[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return On(s,n,e)}function BL(t,n,e){return e===void 0&&(e={}),En(t.map(function(i){return kt(i,n)}),e)}function Yn(t,n,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:t};return On(i,n,e)}function TL(t,n,e){return e===void 0&&(e={}),En(t.map(function(i){return Yn(i,n)}),e)}function En(t,n){n===void 0&&(n={});var e={type:"FeatureCollection"};return n.id&&(e.id=n.id),n.bbox&&(e.bbox=n.bbox),e.features=t,e}function ay(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return On(i,n,e)}function n_(t,n,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:t};return On(i,n,e)}function ly(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return On(i,n,e)}function IL(t,n,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:t};return On(i,n,e)}function FL(t,n){if(n===void 0&&(n=0),n&&!(n>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,n||0);return Math.round(t*e)/e}function uy(t,n){n===void 0&&(n="kilometers");var e=oy[n];if(!e)throw new Error(n+" units is invalid");return t*e}function cy(t,n){n===void 0&&(n="kilometers");var e=oy[n];if(!e)throw new Error(n+" units is invalid");return t/e}function ML(t,n){return i_(cy(t,n))}function DL(t){var n=t%360;return n<0&&(n+=360),n}function i_(t){var n=t%(2*Math.PI);return n*180/Math.PI}function tu(t){var n=t%360;return n*Math.PI/180}function RL(t,n,e){if(n===void 0&&(n="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return uy(cy(t,n),e)}function UL(t,n,e){if(n===void 0&&(n="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=sy[n];if(!i)throw new Error("invalid original units");var o=sy[e];if(!o)throw new Error("invalid final units");return t/i*o}function Ef(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function hy(t){return!!t&&t.constructor===Object}function OL(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(n){if(!Ef(n))throw new Error("bbox must only contain numbers")})}function LL(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 zL=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:sy,bearingToAzimuth:DL,convertArea:UL,convertLength:RL,degreesToRadians:tu,earthRadius:sn,factors:oy,feature:On,featureCollection:En,geometry:EL,geometryCollection:IL,isNumber:Ef,isObject:hy,lengthToDegrees:ML,lengthToRadians:cy,lineString:Yn,lineStrings:TL,multiLineString:ay,multiPoint:n_,multiPolygon:ly,point:Zt,points:PL,polygon:kt,polygons:BL,radiansToDegrees:i_,radiansToLength:uy,round:FL,unitsFactors:SL,validateBBox:OL,validateId:LL},Symbol.toStringTag,{value:"Module"}));function Pf(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 kL(t,n,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 i=0,o=t.features;i<o.length;i++){var r=o[i];if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+e+": must be a "+n+", given "+r.geometry.type)}}function Fi(t){return t.type==="Feature"?t.geometry:t}function QL(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Mi(t,n,e){e===void 0&&(e={});var i=Pf(t),o=Pf(n),r=tu(o[1]-i[1]),a=tu(o[0]-i[0]),s=tu(i[1]),l=tu(o[1]),u=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return uy(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Yo(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,d=t.type,p=d==="FeatureCollection",g=d==="Feature",v=p?t.features.length:1,y=0;y<v;y++){u=p?t.features[y].geometry:g?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var m=0;m<s;m++){var b=0,x=0;if(a=f?u.geometries[m]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,b,x)===!1)return!1;h++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,b,x)===!1)return!1;h++,E==="MultiPoint"&&b++}E==="LineString"&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,b,x)===!1)return!1;h++}E==="MultiLineString"&&b++,E==="Polygon"&&x++}E==="Polygon"&&b++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,b,x)===!1)return!1;h++}x++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Yo(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function VL(t,n,e,i){var o=e;return Yo(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function r_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function NL(t,n,e){var i=e;return r_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function ya(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function HL(t,n,e){var i=e;return ya(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function GL(t){var n=[];return Yo(t,function(e){n.push(e)}),n}function Ay(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,d=t.type==="FeatureCollection",p=t.type==="Feature",g=d?t.features.length:1;for(e=0;e<g;e++){for(s=d?t.features[e].geometry:p?t.geometry:t,u=d?t.features[e].properties:p?t.properties:{},A=d?t.features[e].bbox:p?t.bbox:void 0,h=d?t.features[e].id:p?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function WL(t,n,e){var i=e;return Ay(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function rr(t,n){Ay(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(On(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(On(h,o),i,u)===!1)return!1}})}function jL(t,n,e){var i=e;return rr(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function o_(t,n){rr(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(Yo(e,function(h,f,d,p,g){if(s===void 0||i>l||p>u||g>A){s=h,l=i,u=p,A=g,r=0;return}var v=Yn([s,h],e.properties);if(n(v,i,o,g,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function s_(t,n,e){var i=e,o=!1;return o_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function a_(t,n){if(!t)throw new Error("geojson is required");rr(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(Yn(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function qL(t,n,e){var i=e;return a_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function KL(t,n){if(n=n||{},!hy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),Yn([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),Yn([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),Yn([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),Yn([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function ZL(t,n){if(n=n||{},!hy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return Zt(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),Zt(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),Zt(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),Zt(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),Zt(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),Zt(l[i][o][r],a,n)}throw new Error("geojson is invalid")}const $L=Object.freeze(Object.defineProperty({__proto__:null,coordAll:GL,coordEach:Yo,coordReduce:VL,featureEach:ya,featureReduce:HL,findPoint:ZL,findSegment:KL,flattenEach:rr,flattenReduce:jL,geomEach:Ay,geomReduce:WL,lineEach:a_,lineReduce:qL,propEach:r_,propReduce:NL,segmentEach:o_,segmentReduce:s_},Symbol.toStringTag,{value:"Module"}));function XL(t,n){return n===void 0&&(n={}),s_(t,function(e,i){var o=i.geometry.coordinates;return e+Mi(o[0],o[1],n)},0)}function YL(t){var n=Yn(t),e=XL(n,{units:"meters"});return e}function*JL(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*ez(t){for(const[n,e]of JL(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function tz(t,n,e){return[...ez(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),s=YL(r)/e;return{positions:r,repeat:s,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const nu=_.ArcType,nz=_.arrayRemoveDuplicates,iz=_.BoundingSphere,It=_.Cartesian3,Pn=_.Color,va=_.ComponentDatatype,rz=_.Frozen,Ln=_.defined,wa=_.DeveloperError,Di=_.Ellipsoid,oz=_.Geometry,ba=_.GeometryAttribute,sz=_.GeometryAttributes,az=_.GeometryType,lz=_.IndexDatatype,l_=_.Math,iu=_.PolylinePipeline,uz=_.PrimitiveType,or=_.VertexFormat;var u_=[];function cz(t,n,e,i,o){var r=u_;r.length=o;var a,s=e.red,l=e.green,u=e.blue,A=e.alpha,h=i.red,f=i.green,d=i.blue,p=i.alpha;if(Pn.equals(e,i)){for(a=0;a<o;a++)r[a]=Pn.clone(e);return r}var g=(h-s)/o,v=(f-l)/o,y=(d-u)/o,m=(p-A)/o;for(a=0;a<o;a++)r[a]=new Pn(s+a*g,l+a*v,u+a*y,A+a*m);return r}function xa(t){t=t??rz.EMPTY_OBJECT;var n=t.positions,e=t.colors,i=t.width??1,o=t.colorsPerVertex??!1;if(!Ln(n)||n.length<2)throw new wa("At least two positions are required.");if(typeof i!="number")throw new wa("width must be a number");if(Ln(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new wa("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=or.clone(t.vertexFormat??or.DEFAULT),this._arcType=t.arcType??nu.GEODESIC,this._granularity=t.granularity??l_.RADIANS_PER_DEGREE,this._ellipsoid=Di.clone(t.ellipsoid??Di.WGS84),this._workerName="createPolylineGeometry";var r=1+n.length*It.packedLength;r+=Ln(e)?1+e.length*Pn.packedLength:1,this.packedLength=r+Di.packedLength+or.packedLength+4}xa.pack=function(t,n,e){if(!Ln(t))throw new wa("value is required");if(!Ln(n))throw new wa("array is required");e=e??0;var i,o=t._positions,r=o.length;for(n[e++]=r,i=0;i<r;++i,e+=It.packedLength)It.pack(o[i],n,e);var a=t._colors;for(r=Ln(a)?a.length:0,n[e++]=r,i=0;i<r;++i,e+=Pn.packedLength)Pn.pack(a[i],n,e);return Di.pack(t._ellipsoid,n,e),e+=Di.packedLength,or.pack(t._vertexFormat,n,e),e+=or.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var c_=Di.clone(Di.UNIT_SPHERE),h_=new or,Jo={positions:void 0,colors:void 0,ellipsoid:c_,vertexFormat:h_,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};xa.unpack=function(t,n,e){if(!Ln(t))throw new wa("array is required");n=n??0;var i,o=t[n++],r=new Array(o);for(i=0;i<o;++i,n+=It.packedLength)r[i]=It.unpack(t,n);o=t[n++];var a=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=Pn.packedLength)a[i]=Pn.unpack(t,n);var s=Di.unpack(t,n,c_);n+=Di.packedLength;var l=or.unpack(t,n,h_);n+=or.packedLength;var u=t[n++],A=t[n++]===1,h=t[n++],f=t[n];return Ln(e)?(e._positions=r,e._colors=a,e._ellipsoid=Di.clone(s,e._ellipsoid),e._vertexFormat=or.clone(l,e._vertexFormat),e._width=u,e._colorsPerVertex=A,e._arcType=h,e._granularity=f,e):(Jo.positions=r,Jo.colors=a,Jo.width=u,Jo.colorsPerVertex=A,Jo.arcType=h,Jo.granularity=f,new xa(Jo))};var A_=new It,f_=new It,p_=new It,d_=new It;xa.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,a=t._granularity,s=t._ellipsoid,l,u,A,h=nz(t._positions,It.equalsEpsilon),f=h.length;if(f<2||n<=0)return;if(r===nu.GEODESIC||r===nu.RHUMB){var d,p;r===nu.GEODESIC?(d=l_.chordLength(a,s.maximumRadius),p=iu.numberOfPoints):(d=a,p=iu.numberOfPointsRhumbLine);var g=iu.extractHeights(h,s);if(Ln(i)){var v=1;for(l=0;l<f-1;++l)v+=p(h[l],h[l+1],d);var y=new Array(v),m=0;for(l=0;l<f-1;++l){var b=h[l],x=h[l+1],E=i[l],B=p(b,x,d);if(o&&l<v){var P=i[l+1],I=cz(b,x,E,P,B),M=I.length;for(u=0;u<M;++u)y[m++]=I[u]}else for(u=0;u<B;++u)y[m++]=Pn.clone(E)}y[m]=Pn.clone(i[i.length-1]),i=y,u_.length=0}r===nu.GEODESIC?h=iu.generateCartesianArc({positions:h,minDistance:d,ellipsoid:s,height:g}):h=iu.generateCartesianRhumbArc({positions:h,granularity:d,ellipsoid:s,height:g})}f=h.length;var F=f*4-4,S=new Float64Array(F*3),T=new Float64Array(F*3),w=new Float64Array(F*3),C=new Float32Array(F*2),D=e.st?new Float32Array(F*2):void 0,R=Ln(i)?new Uint8Array(F*4):void 0,U=0,O=0,z=0,k=0,Q;let N=[0];{for(l=0;l<f-1;l++){const G=_.Cartesian3.distance(h[l],h[l+1]);N.push(N[N.length-1]+G)}N=N.map(G=>G/N[N.length-1])}for(u=0;u<f;++u){u===0?(Q=A_,It.subtract(h[0],h[1],Q),It.add(h[0],Q,Q)):Q=h[u-1],It.clone(Q,p_),It.clone(h[u],f_),u===f-1?(Q=A_,It.subtract(h[f-1],h[f-2],Q),It.add(h[f-1],Q,Q)):Q=h[u+1],It.clone(Q,d_);var j,J;Ln(R)&&(u!==0&&!o?j=i[u-1]:j=i[u],u!==f-1&&(J=i[u]));var ee=u===0?2:0,ie=u===f-1?2:4;for(A=ee;A<ie;++A){It.pack(f_,S,U),It.pack(p_,T,U),It.pack(d_,w,U),U+=3;var oe=A-2<0?-1:1;if(C[O++]=2*(A%2)-1,C[O++]=oe*n,e.st&&(D[z++]=N[u],D[z++]=Math.max(C[O-2],0)),Ln(R)){var ue=A<2?j:J;R[k++]=Pn.floatToByte(ue.red),R[k++]=Pn.floatToByte(ue.green),R[k++]=Pn.floatToByte(ue.blue),R[k++]=Pn.floatToByte(ue.alpha)}}}var le=new sz;le.position=new ba({componentDatatype:va.DOUBLE,componentsPerAttribute:3,values:S}),le.prevPosition=new ba({componentDatatype:va.DOUBLE,componentsPerAttribute:3,values:T}),le.nextPosition=new ba({componentDatatype:va.DOUBLE,componentsPerAttribute:3,values:w}),le.expandAndWidth=new ba({componentDatatype:va.FLOAT,componentsPerAttribute:2,values:C}),e.st&&(le.st=new ba({componentDatatype:va.FLOAT,componentsPerAttribute:2,values:D})),Ln(R)&&(le.color=new ba({componentDatatype:va.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));var ne=lz.createTypedArray(F,f*6-6),ce=0,$=0,q=f-1;for(u=0;u<q;++u)ne[$++]=ce,ne[$++]=ce+2,ne[$++]=ce+1,ne[$++]=ce+1,ne[$++]=ce+2,ne[$++]=ce+3,ce+=4;return new oz({attributes:le,indices:ne,primitiveType:uz.TRIANGLES,boundingSphere:iz.fromPoints(h),geometryType:az.POLYLINES})};var fy;function hz(){return typeof fy>"u"&&(fy=new _.EllipsoidGeodesic),fy}function Az(t,n){var e=n/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function fz(t,n,e,i=1){var o=hz(),r=_.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),a=[0,0];t.length>=3&&n.length>=3&&(a=[t[2],n[2]]);var s=_.Cartographic.fromDegrees(t[0],t[1]),l=_.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(s,l);var u=o.surfaceDistance,A=_.PolylinePipeline.generateCartesianArc({positions:r,height:a,minDistance:u/36}),h=A.length;return A.forEach(function(f,d){var p=d/(h-1),g=Az(p,u*i),v=_.Cartographic.fromCartesian(f);v.height+=g,_.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,_.Ellipsoid.WGS84,A[d])}),A}function pz(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new _.Color(...t)}}:{type:"Color",uniforms:{color:new _.Color(...t)}};n?(o=new _.PolylineMaterialAppearance({material:new _.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=_.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const A=_.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new _.PolylineMaterialAppearance({material:new _.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const A=_.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var a=_.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),s=`out vec4 v_twp;
3668
+ `;const S=f.computeLocalAxisedBoundingBoxFromAttribute("position");if(!S)return;const{min:T,max:w}=S;f.setLocalAxisedBoundingBox(T,w)},A=async()=>{if(e.points&&e.points.length>2){const{minPos:f,center:d}=c.getMinMaxCorner(e.points),p=f[2]-e.depth;if(!c.equalsN3(e.points[e.points.length-1],e.points[e.points.length-2])){const x=vn({originPosition:d},e.points.map((E,B)=>{let P=[...E];return P[2]=p,P}));u(s,d,x[0],"bottom",!0)}const g=this._interpolationAlongPolygon(e.points.map((x,E)=>_.Cartesian3.fromArray(c.lbhToXyz(x))),e.interpolation),v=await i.getHeightsByLonLats(g.map(x=>[x[0],x[1]]));let y=[];for(let x=0;x<g.length;x++){const E=g[x];y.push([E[0],E[1],v[x]??E[2]],[E[0],E[1],p])}const m=vn({originPosition:d},y);let b=this._isClockwise(e.points,i);u(r,d,m[0],"side",b)}else r.attributes=void 0,s.attributes=void 0};A();const h=this.dv(c.createNextAnimateFrameEvent(e.depthChanged,e.interpolationChanged,e.pointsChanged,e.bottomImageChanged,e.sideImageChanged));this.ad(h.don(A))}{const u=()=>{a.uri=e.sideImage.url,l.uri=e.bottomImage.url,r.uniformMap={u_image:{type:"texture",id:a.id},u_color:[1,1,1,e.opacity]},s.uniformMap={u_image:{type:"texture",id:l.id},u_color:[1,1,1,e.opacity]}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.opacityChanged,e.bottomImageChanged,e.sideImageChanged));this.d(A.don(u))}}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}_interpolationAlongPolygon(e,i){var o=[];for(let l=0;l<e.length;++l){var r=e[l],a=e[(l+1)%e.length],s=this._interpolationAlongLine(r,a,i);o.push(...s)}return o.push(o[0]),o}_interpolationAlongLine(e,i,o){var r=[],a=_.Cartesian3.distance(e,i),s=_.Cartesian3.subtract(i,e,new _.Cartesian3);s.equals(_.Cartesian3.ZERO)||_.Cartesian3.normalize(s,s);for(var l=0;l<a;){var u=new _.Cartesian3(s.x*l,s.y*l,s.z*l),A=_.Cartesian3.add(e,u,new _.Cartesian3);const h=Ue(A);h&&r.push(h),l+=o}return r}_isClockwise(e,i){if(i.viewer)for(let o=0;o<e.length;o++){let r=_.Cartesian3.fromDegrees(...e[o]),a=_.Cartesian3.fromDegrees(...e[(o+1)%e.length]),s=_.Cartesian3.fromDegrees(...e[(o+2)%e.length]),l=_.Cartesian3.subtract(a,r,new _.Cartesian3),u=_.Cartesian3.subtract(s,a,new _.Cartesian3);if(l.equals(_.Cartesian3.ZERO)||u.equals(_.Cartesian3.ZERO))return!0;if(_.Cartesian3.normalize(l,l),_.Cartesian3.normalize(u,u),Math.abs(_.Cartesian3.dot(l,u))==1){if(o==e.length-1)return!0;continue}let A=_.Cartesian3.cross(l,u,new _.Cartesian3);return _.Cartesian3.dot(A,i.viewer.camera.directionWC)>0}}_triangleIndices(e){let i=new Uint32Array(e*3);for(let o=0;o<e;++o)i[o*3+0]=o,i[o*3+1]=o%2?(o+2)%e:(o+1)%e,i[o*3+2]=o%2?(o+1)%e:(o+2)%e;return i}_getDistance(e,i){return Math.sqrt(Math.pow(e[0]-i[0],2)+Math.pow(e[1]-i[1],2))}};L(kc,"type",kc.register("ESCesiumViewer",c.ESPit.type,kc));let iy=kc;const Qc=class Qc extends Un{constructor(e,i){super(e,i);L(this,"_czmPolygonPrimitive");L(this,"_geoPolylines");if(this._czmPolygonPrimitive=this.disposeVar(new Lr(i,e.id)),this._geoPolylines=this.disposeVar(new ai(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}{const s=()=>{this.geoPolygon&&(this.geoPolygon.show=!1)};s(),this.ad(this.sceneObject.showChanged.don(s))}const r=this._geoPolylines;r.arcType="RHUMB";const a=this._czmPolygonPrimitive;this.dispose(c.track([a,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.track([r,"color"],[e,"strokeColor"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"]));{a.perPositionHeight=!0;const s=()=>{r.show=e.show&&e.stroked,a.show=e.show&&e.filled,a.material={type:"Color",color:e.fillColor}};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.showChanged,e.strokedChanged,e.filledChanged,e.fillColorChanged));this.dispose(l.don(s))}{const s=()=>{const u={positions:[],holes:[]};if(e.points&&e.points.length>=3){if(r.positions=[[...e.points,e.points[0]]],u.positions=e.points,e.innerRings&&e.innerRings.length>0)for(let A=0;A<e.innerRings.length;A++){const h=e.innerRings[A];u.holes.push({positions:h}),r.positions.push([...h,h[0]])}a.polygonHierarchy=u}else a.polygonHierarchy=u};s();const l=this.disposeVar(c.createNextAnimateFrameEvent(e.pointsChanged,e.innerRingsChanged));this.dispose(l.disposableOn(()=>s()))}}get czmPolygonPrimitive(){return this._czmPolygonPrimitive}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmPolygonPrimitive:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Qc,"type",Qc.register("ESCesiumViewer",c.ESPolygonWithHole.type,Qc));let ry=Qc;var sn=63710088e-1,oy={centimeters:sn*100,centimetres:sn*100,degrees:sn/111325,feet:sn*3.28084,inches:sn*39.37,kilometers:sn/1e3,kilometres:sn/1e3,meters:sn,metres:sn,miles:sn/1609.344,millimeters:sn*1e3,millimetres:sn*1e3,nauticalmiles:sn/1852,radians:1,yards:sn*1.0936},EL={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/sn,yards:1.0936133},sy={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 On(t,n,e){e===void 0&&(e={});var i={type:"Feature"};return(e.id===0||e.id)&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.properties=n||{},i.geometry=t,i}function PL(t,n,e){switch(t){case"Point":return Zt(n).geometry;case"LineString":return Yn(n).geometry;case"Polygon":return kt(n).geometry;case"MultiPoint":return n_(n).geometry;case"MultiLineString":return ay(n).geometry;case"MultiPolygon":return ly(n).geometry;default:throw new Error(t+" is invalid")}}function Zt(t,n,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(!Ef(t[0])||!Ef(t[1]))throw new Error("coordinates must contain numbers");var i={type:"Point",coordinates:t};return On(i,n,e)}function BL(t,n,e){return e===void 0&&(e={}),En(t.map(function(i){return Zt(i,n)}),e)}function kt(t,n,e){e===void 0&&(e={});for(var i=0,o=t;i<o.length;i++){var r=o[i];if(r.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var a=0;a<r[r.length-1].length;a++)if(r[r.length-1][a]!==r[0][a])throw new Error("First and last Position are not equivalent.")}var s={type:"Polygon",coordinates:t};return On(s,n,e)}function TL(t,n,e){return e===void 0&&(e={}),En(t.map(function(i){return kt(i,n)}),e)}function Yn(t,n,e){if(e===void 0&&(e={}),t.length<2)throw new Error("coordinates must be an array of two or more positions");var i={type:"LineString",coordinates:t};return On(i,n,e)}function IL(t,n,e){return e===void 0&&(e={}),En(t.map(function(i){return Yn(i,n)}),e)}function En(t,n){n===void 0&&(n={});var e={type:"FeatureCollection"};return n.id&&(e.id=n.id),n.bbox&&(e.bbox=n.bbox),e.features=t,e}function ay(t,n,e){e===void 0&&(e={});var i={type:"MultiLineString",coordinates:t};return On(i,n,e)}function n_(t,n,e){e===void 0&&(e={});var i={type:"MultiPoint",coordinates:t};return On(i,n,e)}function ly(t,n,e){e===void 0&&(e={});var i={type:"MultiPolygon",coordinates:t};return On(i,n,e)}function FL(t,n,e){e===void 0&&(e={});var i={type:"GeometryCollection",geometries:t};return On(i,n,e)}function ML(t,n){if(n===void 0&&(n=0),n&&!(n>=0))throw new Error("precision must be a positive number");var e=Math.pow(10,n||0);return Math.round(t*e)/e}function uy(t,n){n===void 0&&(n="kilometers");var e=oy[n];if(!e)throw new Error(n+" units is invalid");return t*e}function cy(t,n){n===void 0&&(n="kilometers");var e=oy[n];if(!e)throw new Error(n+" units is invalid");return t/e}function DL(t,n){return i_(cy(t,n))}function RL(t){var n=t%360;return n<0&&(n+=360),n}function i_(t){var n=t%(2*Math.PI);return n*180/Math.PI}function tu(t){var n=t%360;return n*Math.PI/180}function UL(t,n,e){if(n===void 0&&(n="kilometers"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("length must be a positive number");return uy(cy(t,n),e)}function OL(t,n,e){if(n===void 0&&(n="meters"),e===void 0&&(e="kilometers"),!(t>=0))throw new Error("area must be a positive number");var i=sy[n];if(!i)throw new Error("invalid original units");var o=sy[e];if(!o)throw new Error("invalid final units");return t/i*o}function Ef(t){return!isNaN(t)&&t!==null&&!Array.isArray(t)}function hy(t){return!!t&&t.constructor===Object}function LL(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(n){if(!Ef(n))throw new Error("bbox must only contain numbers")})}function zL(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 kL=Object.freeze(Object.defineProperty({__proto__:null,areaFactors:sy,bearingToAzimuth:RL,convertArea:OL,convertLength:UL,degreesToRadians:tu,earthRadius:sn,factors:oy,feature:On,featureCollection:En,geometry:PL,geometryCollection:FL,isNumber:Ef,isObject:hy,lengthToDegrees:DL,lengthToRadians:cy,lineString:Yn,lineStrings:IL,multiLineString:ay,multiPoint:n_,multiPolygon:ly,point:Zt,points:BL,polygon:kt,polygons:TL,radiansToDegrees:i_,radiansToLength:uy,round:ML,unitsFactors:EL,validateBBox:LL,validateId:zL},Symbol.toStringTag,{value:"Module"}));function Pf(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 QL(t,n,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 i=0,o=t.features;i<o.length;i++){var r=o[i];if(!r||r.type!=="Feature"||!r.geometry)throw new Error("Invalid input to "+e+", Feature with geometry required");if(!r.geometry||r.geometry.type!==n)throw new Error("Invalid input to "+e+": must be a "+n+", given "+r.geometry.type)}}function Fi(t){return t.type==="Feature"?t.geometry:t}function VL(t,n){return t.type==="FeatureCollection"?"FeatureCollection":t.type==="GeometryCollection"?"GeometryCollection":t.type==="Feature"&&t.geometry!==null?t.geometry.type:t.type}function Mi(t,n,e){e===void 0&&(e={});var i=Pf(t),o=Pf(n),r=tu(o[1]-i[1]),a=tu(o[0]-i[0]),s=tu(i[1]),l=tu(o[1]),u=Math.pow(Math.sin(r/2),2)+Math.pow(Math.sin(a/2),2)*Math.cos(s)*Math.cos(l);return uy(2*Math.atan2(Math.sqrt(u),Math.sqrt(1-u)),e.units)}function Yo(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,d=t.type,p=d==="FeatureCollection",g=d==="Feature",v=p?t.features.length:1,y=0;y<v;y++){u=p?t.features[y].geometry:g?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var m=0;m<s;m++){var b=0,x=0;if(a=f?u.geometries[m]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,b,x)===!1)return!1;h++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,b,x)===!1)return!1;h++,E==="MultiPoint"&&b++}E==="LineString"&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,b,x)===!1)return!1;h++}E==="MultiLineString"&&b++,E==="Polygon"&&x++}E==="Polygon"&&b++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,b,x)===!1)return!1;h++}x++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(Yo(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function NL(t,n,e,i){var o=e;return Yo(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function r_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function HL(t,n,e){var i=e;return r_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function ya(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function GL(t,n,e){var i=e;return ya(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function WL(t){var n=[];return Yo(t,function(e){n.push(e)}),n}function Ay(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,d=t.type==="FeatureCollection",p=t.type==="Feature",g=d?t.features.length:1;for(e=0;e<g;e++){for(s=d?t.features[e].geometry:p?t.geometry:t,u=d?t.features[e].properties:p?t.properties:{},A=d?t.features[e].bbox:p?t.bbox:void 0,h=d?t.features[e].id:p?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function jL(t,n,e){var i=e;return Ay(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function rr(t,n){Ay(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(On(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(On(h,o),i,u)===!1)return!1}})}function qL(t,n,e){var i=e;return rr(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function o_(t,n){rr(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(Yo(e,function(h,f,d,p,g){if(s===void 0||i>l||p>u||g>A){s=h,l=i,u=p,A=g,r=0;return}var v=Yn([s,h],e.properties);if(n(v,i,o,g,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function s_(t,n,e){var i=e,o=!1;return o_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function a_(t,n){if(!t)throw new Error("geojson is required");rr(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(Yn(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function KL(t,n,e){var i=e;return a_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function ZL(t,n){if(n=n||{},!hy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),Yn([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),Yn([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),Yn([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),Yn([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function $L(t,n){if(n=n||{},!hy(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return Zt(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),Zt(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),Zt(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),Zt(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),Zt(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),Zt(l[i][o][r],a,n)}throw new Error("geojson is invalid")}const XL=Object.freeze(Object.defineProperty({__proto__:null,coordAll:WL,coordEach:Yo,coordReduce:NL,featureEach:ya,featureReduce:GL,findPoint:$L,findSegment:ZL,flattenEach:rr,flattenReduce:qL,geomEach:Ay,geomReduce:jL,lineEach:a_,lineReduce:KL,propEach:r_,propReduce:HL,segmentEach:o_,segmentReduce:s_},Symbol.toStringTag,{value:"Module"}));function YL(t,n){return n===void 0&&(n={}),s_(t,function(e,i){var o=i.geometry.coordinates;return e+Mi(o[0],o[1],n)},0)}function JL(t){var n=Yn(t),e=YL(n,{units:"meters"});return e}function*ez(t){t.type==="FeatureCollection"?yield*t.features.map(n=>[n.geometry,n]):t.type==="Feature"&&(yield[t.geometry,t])}function*tz(t){for(const[n,e]of ez(t))if(n.type==="LineString")yield[n.coordinates,e];else if(n.type==="MultiLineString")for(let i of n.coordinates)yield[i,e]}function nz(t,n,e){return[...tz(t)].map(([i,o])=>{if(i.length<2)return;const r=i.map(l=>[l[0],l[1],l[2]??0]),s=JL(r)/e;return{positions:r,repeat:s,width:n,extra:{geojson:{feature:o}}}}).filter(i=>!!i)}const nu=_.ArcType,iz=_.arrayRemoveDuplicates,rz=_.BoundingSphere,It=_.Cartesian3,Pn=_.Color,va=_.ComponentDatatype,oz=_.Frozen,Ln=_.defined,wa=_.DeveloperError,Di=_.Ellipsoid,sz=_.Geometry,ba=_.GeometryAttribute,az=_.GeometryAttributes,lz=_.GeometryType,uz=_.IndexDatatype,l_=_.Math,iu=_.PolylinePipeline,cz=_.PrimitiveType,or=_.VertexFormat;var u_=[];function hz(t,n,e,i,o){var r=u_;r.length=o;var a,s=e.red,l=e.green,u=e.blue,A=e.alpha,h=i.red,f=i.green,d=i.blue,p=i.alpha;if(Pn.equals(e,i)){for(a=0;a<o;a++)r[a]=Pn.clone(e);return r}var g=(h-s)/o,v=(f-l)/o,y=(d-u)/o,m=(p-A)/o;for(a=0;a<o;a++)r[a]=new Pn(s+a*g,l+a*v,u+a*y,A+a*m);return r}function xa(t){t=t??oz.EMPTY_OBJECT;var n=t.positions,e=t.colors,i=t.width??1,o=t.colorsPerVertex??!1;if(!Ln(n)||n.length<2)throw new wa("At least two positions are required.");if(typeof i!="number")throw new wa("width must be a number");if(Ln(e)&&(o&&e.length<n.length||!o&&e.length<n.length-1))throw new wa("colors has an invalid length.");this._positions=n,this._colors=e,this._width=i,this._colorsPerVertex=o,this._vertexFormat=or.clone(t.vertexFormat??or.DEFAULT),this._arcType=t.arcType??nu.GEODESIC,this._granularity=t.granularity??l_.RADIANS_PER_DEGREE,this._ellipsoid=Di.clone(t.ellipsoid??Di.WGS84),this._workerName="createPolylineGeometry";var r=1+n.length*It.packedLength;r+=Ln(e)?1+e.length*Pn.packedLength:1,this.packedLength=r+Di.packedLength+or.packedLength+4}xa.pack=function(t,n,e){if(!Ln(t))throw new wa("value is required");if(!Ln(n))throw new wa("array is required");e=e??0;var i,o=t._positions,r=o.length;for(n[e++]=r,i=0;i<r;++i,e+=It.packedLength)It.pack(o[i],n,e);var a=t._colors;for(r=Ln(a)?a.length:0,n[e++]=r,i=0;i<r;++i,e+=Pn.packedLength)Pn.pack(a[i],n,e);return Di.pack(t._ellipsoid,n,e),e+=Di.packedLength,or.pack(t._vertexFormat,n,e),e+=or.packedLength,n[e++]=t._width,n[e++]=t._colorsPerVertex?1:0,n[e++]=t._arcType,n[e]=t._granularity,n};var c_=Di.clone(Di.UNIT_SPHERE),h_=new or,Jo={positions:void 0,colors:void 0,ellipsoid:c_,vertexFormat:h_,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};xa.unpack=function(t,n,e){if(!Ln(t))throw new wa("array is required");n=n??0;var i,o=t[n++],r=new Array(o);for(i=0;i<o;++i,n+=It.packedLength)r[i]=It.unpack(t,n);o=t[n++];var a=o>0?new Array(o):void 0;for(i=0;i<o;++i,n+=Pn.packedLength)a[i]=Pn.unpack(t,n);var s=Di.unpack(t,n,c_);n+=Di.packedLength;var l=or.unpack(t,n,h_);n+=or.packedLength;var u=t[n++],A=t[n++]===1,h=t[n++],f=t[n];return Ln(e)?(e._positions=r,e._colors=a,e._ellipsoid=Di.clone(s,e._ellipsoid),e._vertexFormat=or.clone(l,e._vertexFormat),e._width=u,e._colorsPerVertex=A,e._arcType=h,e._granularity=f,e):(Jo.positions=r,Jo.colors=a,Jo.width=u,Jo.colorsPerVertex=A,Jo.arcType=h,Jo.granularity=f,new xa(Jo))};var A_=new It,f_=new It,p_=new It,d_=new It;xa.createGeometry=function(t){var n=t._width,e=t._vertexFormat,i=t._colors,o=t._colorsPerVertex,r=t._arcType,a=t._granularity,s=t._ellipsoid,l,u,A,h=iz(t._positions,It.equalsEpsilon),f=h.length;if(f<2||n<=0)return;if(r===nu.GEODESIC||r===nu.RHUMB){var d,p;r===nu.GEODESIC?(d=l_.chordLength(a,s.maximumRadius),p=iu.numberOfPoints):(d=a,p=iu.numberOfPointsRhumbLine);var g=iu.extractHeights(h,s);if(Ln(i)){var v=1;for(l=0;l<f-1;++l)v+=p(h[l],h[l+1],d);var y=new Array(v),m=0;for(l=0;l<f-1;++l){var b=h[l],x=h[l+1],E=i[l],B=p(b,x,d);if(o&&l<v){var P=i[l+1],I=hz(b,x,E,P,B),M=I.length;for(u=0;u<M;++u)y[m++]=I[u]}else for(u=0;u<B;++u)y[m++]=Pn.clone(E)}y[m]=Pn.clone(i[i.length-1]),i=y,u_.length=0}r===nu.GEODESIC?h=iu.generateCartesianArc({positions:h,minDistance:d,ellipsoid:s,height:g}):h=iu.generateCartesianRhumbArc({positions:h,granularity:d,ellipsoid:s,height:g})}f=h.length;var F=f*4-4,S=new Float64Array(F*3),T=new Float64Array(F*3),w=new Float64Array(F*3),C=new Float32Array(F*2),D=e.st?new Float32Array(F*2):void 0,R=Ln(i)?new Uint8Array(F*4):void 0,U=0,O=0,z=0,k=0,Q;let N=[0];{for(l=0;l<f-1;l++){const G=_.Cartesian3.distance(h[l],h[l+1]);N.push(N[N.length-1]+G)}N=N.map(G=>G/N[N.length-1])}for(u=0;u<f;++u){u===0?(Q=A_,It.subtract(h[0],h[1],Q),It.add(h[0],Q,Q)):Q=h[u-1],It.clone(Q,p_),It.clone(h[u],f_),u===f-1?(Q=A_,It.subtract(h[f-1],h[f-2],Q),It.add(h[f-1],Q,Q)):Q=h[u+1],It.clone(Q,d_);var j,J;Ln(R)&&(u!==0&&!o?j=i[u-1]:j=i[u],u!==f-1&&(J=i[u]));var ee=u===0?2:0,ie=u===f-1?2:4;for(A=ee;A<ie;++A){It.pack(f_,S,U),It.pack(p_,T,U),It.pack(d_,w,U),U+=3;var oe=A-2<0?-1:1;if(C[O++]=2*(A%2)-1,C[O++]=oe*n,e.st&&(D[z++]=N[u],D[z++]=Math.max(C[O-2],0)),Ln(R)){var ue=A<2?j:J;R[k++]=Pn.floatToByte(ue.red),R[k++]=Pn.floatToByte(ue.green),R[k++]=Pn.floatToByte(ue.blue),R[k++]=Pn.floatToByte(ue.alpha)}}}var le=new az;le.position=new ba({componentDatatype:va.DOUBLE,componentsPerAttribute:3,values:S}),le.prevPosition=new ba({componentDatatype:va.DOUBLE,componentsPerAttribute:3,values:T}),le.nextPosition=new ba({componentDatatype:va.DOUBLE,componentsPerAttribute:3,values:w}),le.expandAndWidth=new ba({componentDatatype:va.FLOAT,componentsPerAttribute:2,values:C}),e.st&&(le.st=new ba({componentDatatype:va.FLOAT,componentsPerAttribute:2,values:D})),Ln(R)&&(le.color=new ba({componentDatatype:va.UNSIGNED_BYTE,componentsPerAttribute:4,values:R,normalize:!0}));var ne=uz.createTypedArray(F,f*6-6),ce=0,$=0,q=f-1;for(u=0;u<q;++u)ne[$++]=ce,ne[$++]=ce+2,ne[$++]=ce+1,ne[$++]=ce+1,ne[$++]=ce+2,ne[$++]=ce+3,ce+=4;return new sz({attributes:le,indices:ne,primitiveType:cz.TRIANGLES,boundingSphere:rz.fromPoints(h),geometryType:lz.POLYLINES})};var fy;function Az(){return typeof fy>"u"&&(fy=new _.EllipsoidGeodesic),fy}function fz(t,n){var e=n/3e7;return e=Math.min(1,e),e=1-Math.pow(1-e,2),Math.sin(Math.PI*t)*1e6*e}function pz(t,n,e,i=1){var o=Az(),r=_.Cartesian3.fromDegreesArray([t[0],t[1],n[0],n[1]]),a=[0,0];t.length>=3&&n.length>=3&&(a=[t[2],n[2]]);var s=_.Cartographic.fromDegrees(t[0],t[1]),l=_.Cartographic.fromDegrees(n[0],n[1]);o.setEndPoints(s,l);var u=o.surfaceDistance,A=_.PolylinePipeline.generateCartesianArc({positions:r,height:a,minDistance:u/36}),h=A.length;return A.forEach(function(f,d){var p=d/(h-1),g=fz(p,u*i),v=_.Cartographic.fromCartesian(f);v.height+=g,_.Cartesian3.fromRadians(v.longitude,v.latitude,v.height,_.Ellipsoid.WGS84,A[d])}),A}function dz(t=[.8,.8,0,1],n=!0,e=!0,i){var o;const r=i?{type:"Image",uniforms:{color:new _.Color(...t)}}:{type:"Color",uniforms:{color:new _.Color(...t)}};n?(o=new _.PolylineMaterialAppearance({material:new _.Material({fabric:r,translucent:!1}),translucent:!1}),o.renderState.blending=_.BlendingState.ADDITIVE_BLEND,o.renderState.depthMask=!1,o.renderState.depthTest={enabled:!0},o.getRenderState=function(){const A=_.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i)):(o=new _.PolylineMaterialAppearance({material:new _.Material({fabric:r,translucent:!0})}),o.getRenderState=function(){const A=_.Appearance.prototype.getRenderState.call(this);return A.depthTest={enabled:e},A.depthMask=!1,A},o.material.type==="Image"&&(o.material._uniforms.image_1=i));var a=_.ShaderSource.replaceMain(o._vertexShaderSource,"czm_twp_main"),s=`out vec4 v_twp;
3669
3669
  out vec4 v_color;
3670
3670
  out vec4 v_bgColor;
3671
3671
  out float v_expand;
@@ -3691,7 +3691,7 @@ void main()
3691
3691
  {
3692
3692
  czm_twp2_main();
3693
3693
  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=l+`
3694
- `+u,o}function dz(t,n,e,i,o,r,a){const s=xa.createGeometry(new xa({positions:n,width:e,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:i}));if(s){r||(r=_.Color.clone(o||_.Color.WHITE),r.alpha=.2);var l=new _.GeometryInstance({geometry:s,id:t,attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(o||_.Color.WHITE),bgColor:_.ColorGeometryInstanceAttribute.fromColor(r),twp:new _.GeometryInstanceAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:a})}});return l}}const Bf=new _.Cartesian4(0,0,0,0),Ri=new _.Cartesian4(0,0,0,0),ru={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function mz(t,n,e,i,o=!0,r=!0,a,s){var l=[];try{t.forEach(function(A,h){var f=A.positions&&A.positions.map(P=>_.Cartesian3.fromDegrees(...P))||fz(A.startPos,A.endPos,void 0,typeof A.heightRatio>"u"?1:A.heightRatio);const d=i(h,void 0,ru),{timeRatio:p,repeat:g,color:v,bidirectional:y,bgColor:m}=d,b=new _.Color(...v),x=new _.Color(...m),E=[p,g,y,0];var B=dz(h,f,A.width,e,b,x,E);if(!B)throw new Error("cannot get geoemetry instance!");l.push(B)})}catch{return}var u=new _.Primitive({geometryInstances:l,appearance:pz(n,o,r,a),asynchronous:!1});return _.Primitive.prototype&&(u.ESSceneObjectID=s),u.update=function(A){const h=this;if(typeof h._batchTable<"u")for(var f=h._batchTableAttributeIndices.twp,d=h._batchTableAttributeIndices.color,p=h._batchTableAttributeIndices.bgColor,g=h._batchTable._numberOfInstances,v=0;v<g;++v){var y=v;ru.timeRatio=0,ru.repeat=1,ru.color.splice(0,4,1,1,1);const m=i(y,A,ru),{timeRatio:b,repeat:x,color:E,bidirectional:B,bgColor:P}=m;Bf.x=b,Bf.y=x,Bf.z=typeof B!="number"?0:B,h._batchTable.setBatchedAttribute(y,f,Bf),Ri.x=255*E[0],Ri.y=255*E[1],Ri.z=255*E[2],Ri.w=255*E[3],h._batchTable.setBatchedAttribute(y,d,Ri),Ri.x=255*P[0],Ri.y=255*P[1],Ri.z=255*P[2],Ri.w=255*P[3],h._batchTable.setBatchedAttribute(y,p,Ri)}_.Primitive.prototype.update.call(h,A)},u}class gz extends c.Destroyable{constructor(e,i,o){super();L(this,"_nativePrimitive");this._viewer=e;const r=this._viewer,a=i.routePaths;if(!a)throw new Error("!routePath");const s=i.arcType!==void 0?_.ArcType[i.arcType]:_.ArcType.GEODESIC,l=mz(a,i.color,s,(u,A,h)=>{const f=a[u];if(!i)return h;h.repeat=(f.repeat??1)*i.repeat;const d=f.startTime??i.startTime,p=f.transmissionTime??i.transmissionTime??i.duration??sr.defaults.duration,g=i.currentTime??sr.defaults.currentTime,v=c.clamp((g-d)/p,0,1);h.timeRatio=v/h.repeat;const y=f.color??i.color,m=f.bgColor??i.bgColor;return h.color.splice(0,4,...y),h.bgColor.splice(0,4,...m),h.bidirectional=f.bidirectional??i.bidirectional,(i.routePathCallback&&i.routePathCallback(h,u,A))??h},i.brightening,i.depthTest,o,i.id);l&&(r.scene.primitives.add(l),this.dispose(()=>{r.scene.primitives.remove(l)}),l.show=i.show??!0,this.dispose(i.showChanged.disposableOn(()=>{l&&(l.show=i.show??!0)})),this._nativePrimitive=l)}get nativePrimitive(){return this._nativePrimitive}}const yz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",vz=`默认示例代码
3694
+ `+u,o}function mz(t,n,e,i,o,r,a){const s=xa.createGeometry(new xa({positions:n,width:e,vertexFormat:_.PolylineMaterialAppearance.VERTEX_FORMAT,arcType:i}));if(s){r||(r=_.Color.clone(o||_.Color.WHITE),r.alpha=.2);var l=new _.GeometryInstance({geometry:s,id:t,attributes:{color:_.ColorGeometryInstanceAttribute.fromColor(o||_.Color.WHITE),bgColor:_.ColorGeometryInstanceAttribute.fromColor(r),twp:new _.GeometryInstanceAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:4,normalize:!1,value:a})}});return l}}const Bf=new _.Cartesian4(0,0,0,0),Ri=new _.Cartesian4(0,0,0,0),ru={timeRatio:0,repeat:1,color:[1,1,1,1],bgColor:[1,1,1,1],bidirectional:0};function gz(t,n,e,i,o=!0,r=!0,a,s){var l=[];try{t.forEach(function(A,h){var f=A.positions&&A.positions.map(P=>_.Cartesian3.fromDegrees(...P))||pz(A.startPos,A.endPos,void 0,typeof A.heightRatio>"u"?1:A.heightRatio);const d=i(h,void 0,ru),{timeRatio:p,repeat:g,color:v,bidirectional:y,bgColor:m}=d,b=new _.Color(...v),x=new _.Color(...m),E=[p,g,y,0];var B=mz(h,f,A.width,e,b,x,E);if(!B)throw new Error("cannot get geoemetry instance!");l.push(B)})}catch{return}var u=new _.Primitive({geometryInstances:l,appearance:dz(n,o,r,a),asynchronous:!1});return _.Primitive.prototype&&(u.ESSceneObjectID=s),u.update=function(A){const h=this;if(typeof h._batchTable<"u")for(var f=h._batchTableAttributeIndices.twp,d=h._batchTableAttributeIndices.color,p=h._batchTableAttributeIndices.bgColor,g=h._batchTable._numberOfInstances,v=0;v<g;++v){var y=v;ru.timeRatio=0,ru.repeat=1,ru.color.splice(0,4,1,1,1);const m=i(y,A,ru),{timeRatio:b,repeat:x,color:E,bidirectional:B,bgColor:P}=m;Bf.x=b,Bf.y=x,Bf.z=typeof B!="number"?0:B,h._batchTable.setBatchedAttribute(y,f,Bf),Ri.x=255*E[0],Ri.y=255*E[1],Ri.z=255*E[2],Ri.w=255*E[3],h._batchTable.setBatchedAttribute(y,d,Ri),Ri.x=255*P[0],Ri.y=255*P[1],Ri.z=255*P[2],Ri.w=255*P[3],h._batchTable.setBatchedAttribute(y,p,Ri)}_.Primitive.prototype.update.call(h,A)},u}class yz extends c.Destroyable{constructor(e,i,o){super();L(this,"_nativePrimitive");this._viewer=e;const r=this._viewer,a=i.routePaths;if(!a)throw new Error("!routePath");const s=i.arcType!==void 0?_.ArcType[i.arcType]:_.ArcType.GEODESIC,l=gz(a,i.color,s,(u,A,h)=>{const f=a[u];if(!i)return h;h.repeat=(f.repeat??1)*i.repeat;const d=f.startTime??i.startTime,p=f.transmissionTime??i.transmissionTime??i.duration??sr.defaults.duration,g=i.currentTime??sr.defaults.currentTime,v=c.clamp((g-d)/p,0,1);h.timeRatio=v/h.repeat;const y=f.color??i.color,m=f.bgColor??i.bgColor;return h.color.splice(0,4,...y),h.bgColor.splice(0,4,...m),h.bidirectional=f.bidirectional??i.bidirectional,(i.routePathCallback&&i.routePathCallback(h,u,A))??h},i.brightening,i.depthTest,o,i.id);l&&(r.scene.primitives.add(l),this.dispose(()=>{r.scene.primitives.remove(l)}),l.show=i.show??!0,this.dispose(i.showChanged.disposableOn(()=>{l&&(l.show=i.show??!0)})),this._nativePrimitive=l)}get nativePrimitive(){return this._nativePrimitive}}const vz="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAAABCAYAAABubagXAAAATUlEQVQYlaXLOQqEUBQF0SMmojgvpfe/JiccEvlNwwuM24IK7oXKUkof7ylQoUGHHsPDMf4WNcpociTcuHBgx4oFczg9/O0tPKP7D3wBky8UMt76XnoAAAAASUVORK5CYII=",wz=`默认示例代码
3695
3695
  \`\`\`
3696
3696
  // result 最后的结果
3697
3697
  // this 是当前的信号传输器集合
@@ -3705,7 +3705,7 @@ function (result, this, instanceIndex, frameState) {
3705
3705
  result.bgColor = [c*.5+.5, (1.0 - c)*.5+.5, 0.5, 0.3];
3706
3706
  return result;
3707
3707
  }\`\`\`
3708
- `,uo=class uo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(c.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new c.Player);{const d=uo.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],p=>p??d.loop,p=>p??d.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],p=>p??d.currentTime,p=>p??d.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],p=>p??d.duration,p=>p??d.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],p=>p??d.playing,p=>p??d.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],p=>p??d.speed,p=>p??d.speed))}const o=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(c.createProcessingFromAsyncFunc(async d=>{this.routePaths=void 0;const p=o.value;if(p)try{const v=await(await fetch(p)).json();this.routePaths=tz(v,this.width,this.repeatLength);return}catch(g){console.error(`geojson加载解析出错!${g}`),console.error(g)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const g=this.positionsSet;if(g){this.routePaths=g.map(v=>({positions:v,width:this.width}));return}}}));{const d=()=>{r.restart()};d();const p=this.disposeVar(c.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(p.disposableOn(d))}{const d=()=>{const p=Sp(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);p&&(this.routePathCallback=p)};d(),this.dispose(this.routePathCallbackStrChanged.disposableOn(d))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new bs),u=this.disposeVar(c.createProcessingFromAsyncFunc(async d=>{if(!s.value)return;const p=R0(a.scene.context).getTextureHandler(s.value);if(p instanceof bs)l.reset(p);else{const g=await d.promise(p);l.reset(g)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,h=()=>u.restart();h(),this.dispose(s.changed.disposableOn(h));const f=this.ad(c.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new c.ObjResettingWithEvent(f,()=>this.routePaths?new gz(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(d=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,d);else{const p=computeBoundingSphere(this.routePaths[0].positions);if(!p)return;const[g,v]=p;Fe(a,g,v*3,void 0,d)}}))}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}};L(uo,"whiteGradientImageBase64",yz),L(uo,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),L(uo,"routePathCallbackStrMd",vz),L(uo,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(uo,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let sr=uo;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:c.reactPositionsSet(void 0),data:c.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(sr||(sr={})),c.extendClassProps(sr.prototype,sr.createDefaultProps);class Yr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_collection");this._collection=this.disposeVar(new sr(e,i)),this.dispose(c.track([this._collection,"show"],[this,"show"])),this.dispose(c.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(c.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(c.track([this._collection,"color"],[this,"color"])),this.dispose(c.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(c.track([this._collection,"width"],[this,"width"])),this.dispose(c.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(c.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(c.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(c.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(c.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(c.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(c.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([this._collection,"playing"],[this,"playing"])),this.dispose(c.track([this._collection,"loop"],[this,"loop"])),this.dispose(c.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._collection,"duration"],[this,"duration"])),this.dispose(c.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((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.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}}L(Yr,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(Yr,"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:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:c.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Yr||(Yr={})),c.extendClassProps(Yr.prototype,Yr.createDefaultProps);const Vc=class Vc extends on{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Yr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(c.track([r,"startTime"],[e,"startTime"])),this.dispose(c.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(c.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"brightening"],[e,"brightening"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Vc,"type",Vc.register("ESCesiumViewer",yf.type,Vc));let py=Vc;function es(t){var n=[1/0,1/0,-1/0,-1/0];return Yo(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}es.default=es;var m_={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(Uo,function(){function e(m,b,x,E,B){(function P(I,M,F,S,T){for(;S>F;){if(S-F>600){var w=S-F+1,C=M-F+1,D=Math.log(w),R=.5*Math.exp(2*D/3),U=.5*Math.sqrt(D*R*(w-R)/w)*(C-w/2<0?-1:1),O=Math.max(F,Math.floor(M-C*R/w+U)),z=Math.min(S,Math.floor(M+(w-C)*R/w+U));P(I,M,O,z,T)}var k=I[M],Q=F,N=S;for(i(I,F,M),T(I[S],k)>0&&i(I,F,S);Q<N;){for(i(I,Q,N),Q++,N--;T(I[Q],k)<0;)Q++;for(;T(I[N],k)>0;)N--}T(I[F],k)===0?i(I,F,N):i(I,++N,S),N<=M&&(F=N+1),M<=N&&(S=N-1)}})(m,b,x||0,E||m.length-1,B||o)}function i(m,b,x){var E=m[b];m[b]=m[x],m[x]=E}function o(m,b){return m<b?-1:m>b?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(m,b,x){if(!x)return b.indexOf(m);for(var E=0;E<b.length;E++)if(x(m,b[E]))return E;return-1}function s(m,b){l(m,0,m.children.length,b,m)}function l(m,b,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=b;P<x;P++){var I=m.children[P];u(B,m.leaf?E(I):I)}return B}function u(m,b){return m.minX=Math.min(m.minX,b.minX),m.minY=Math.min(m.minY,b.minY),m.maxX=Math.max(m.maxX,b.maxX),m.maxY=Math.max(m.maxY,b.maxY),m}function A(m,b){return m.minX-b.minX}function h(m,b){return m.minY-b.minY}function f(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function d(m){return m.maxX-m.minX+(m.maxY-m.minY)}function p(m,b){return m.minX<=b.minX&&m.minY<=b.minY&&b.maxX<=m.maxX&&b.maxY<=m.maxY}function g(m,b){return b.minX<=m.maxX&&b.minY<=m.maxY&&b.maxX>=m.minX&&b.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,b,x,E,B){for(var P=[b,x];P.length;)if(!((x=P.pop())-(b=P.pop())<=E)){var I=b+Math.ceil((x-b)/E/2)*E;e(m,I,b,x,B),P.push(b,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var b=this.data,x=[];if(!g(m,b))return x;for(var E=this.toBBox,B=[];b;){for(var P=0;P<b.children.length;P++){var I=b.children[P],M=b.leaf?E(I):I;g(m,M)&&(b.leaf?x.push(I):p(m,M)?this._all(I,x):B.push(I))}b=B.pop()}return x},r.prototype.collides=function(m){var b=this.data;if(!g(m,b))return!1;for(var x=[];b;){for(var E=0;E<b.children.length;E++){var B=b.children[E],P=b.leaf?this.toBBox(B):B;if(g(m,P)){if(b.leaf||p(m,P))return!0;x.push(B)}}b=x.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var b=0;b<m.length;b++)this.insert(m[b]);return this}var x=this._build(m.slice(),0,m.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 E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,b){if(!m)return this;for(var x,E,B,P=this.data,I=this.toBBox(m),M=[],F=[];P||M.length;){if(P||(P=M.pop(),E=M[M.length-1],x=F.pop(),B=!0),P.leaf){var S=a(m,P.children,b);if(S!==-1)return P.children.splice(S,1),M.push(P),this._condense(M),this}B||P.leaf||!p(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(M.push(P),F.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,b){return m.minX-b.minX},r.prototype.compareMinY=function(m,b){return m.minY-b.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,b){for(var x=[];m;)m.leaf?b.push.apply(b,m.children):x.push.apply(x,m.children),m=x.pop();return b},r.prototype._build=function(m,b,x,E){var B,P=x-b+1,I=this._maxEntries;if(P<=I)return s(B=v(m.slice(b,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var M=Math.ceil(P/I),F=M*Math.ceil(Math.sqrt(I));y(m,b,x,F,this.compareMinX);for(var S=b;S<=x;S+=F){var T=Math.min(S+F-1,x);y(m,S,T,M,this.compareMinY);for(var w=S;w<=T;w+=M){var C=Math.min(w+M-1,T);B.children.push(this._build(m,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(m,b,x,E){for(;E.push(b),!b.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,M=0;M<b.children.length;M++){var F=b.children[M],S=f(F),T=(w=m,C=F,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=F):T===P&&S<B&&(B=S,I=F)}b=I||b.children[0]}var w,C;return b},r.prototype._insert=function(m,b,x){var E=x?m:this.toBBox(m),B=[],P=this._chooseSubtree(E,this.data,b,B);for(P.children.push(m),u(P,E);b>=0&&B[b].children.length>this._maxEntries;)this._split(B,b),b--;this._adjustParentBBoxes(E,B,b)},r.prototype._split=function(m,b){var x=m[b],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),b?m[b-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(m,b){this.data=v([m,b]),this.data.height=m.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,b,x){for(var E,B,P,I,M,F,S,T=1/0,w=1/0,C=b;C<=x-b;C++){var D=l(m,0,C,this.toBBox),R=l(m,C,x,this.toBBox),U=(B=D,P=R,I=void 0,M=void 0,F=void 0,S=void 0,I=Math.max(B.minX,P.minX),M=Math.max(B.minY,P.minY),F=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,F-I)*Math.max(0,S-M)),O=f(D)+f(R);U<T?(T=U,E=C,w=O<w?O:w):U===T&&O<w&&(w=O,E=C)}return E||x-b},r.prototype._chooseSplitAxis=function(m,b,x){var E=m.leaf?this.compareMinX:A,B=m.leaf?this.compareMinY:h;this._allDistMargin(m,b,x,E)<this._allDistMargin(m,b,x,B)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,b,x,E){m.children.sort(E);for(var B=this.toBBox,P=l(m,0,b,B),I=l(m,x-b,x,B),M=d(P)+d(I),F=b;F<x-b;F++){var S=m.children[F];u(P,m.leaf?B(S):S),M+=d(P)}for(var T=x-b-1;T>=b;T--){var w=m.children[T];u(I,m.leaf?B(w):w),M+=d(I)}return M},r.prototype._adjustParentBBoxes=function(m,b,x){for(var E=x;E>=0;E--)u(b[E],m)},r.prototype._condense=function(m){for(var b=m.length-1,x=void 0;b>=0;b--)m[b].children.length===0?b>0?(x=m[b-1].children).splice(x.indexOf(m[b]),1):this.clear():s(m[b],this.toBBox)},r})})(m_);var wz=m_.exports;function hn(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=Pf(t),o=Fi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&bz(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(g_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,h=1;h<s[u].length&&!A;)g_(i,s[u][h],!e.ignoreBoundary)&&(A=!0),h++;A||(l=!0)}return l}function g_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var h=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;h&&(i=!i)}return i}function bz(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function xz(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return y_(t);case"FeatureCollection":return _z(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return dy(t);default:throw new Error("unknown GeoJSON type")}}function y_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=v_(t.properties),n.geometry=dy(t.geometry),n}function v_(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=v_(i):n[e]=i}),n}function _z(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return y_(e)}),n}function dy(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return dy(e)}),n):(n.coordinates=w_(t.coordinates),n)}function w_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return w_(e)})}function b_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=QL(t),o=[];switch(i){case"LineString":o=my(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(a){o.push(my(a))});break;case"MultiPolygon":Ii(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(my(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ii(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):On({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function my(t){var n=Ii(t);if(n.length===2&&!x_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&__(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,x_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return __(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function x_(t,n){return t[0]===n[0]&&t[1]===n[1]}function __(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,h=s-r,f=l-a,d=u*f-A*h;return d!==0?!1:Math.abs(h)>=Math.abs(f)?h>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function Cz(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return Yo(t,function(r){e+=r[0],i+=r[1],o++},!0),Zt([e/o,i/o],n.properties)}function C_(t){if(!t)throw new Error("geojson is required");var n=[];return rr(t,function(e){Sz(e,n)}),En(n)}function Sz(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ii(i);break;case"LineString":e=[Ii(i)]}e.forEach(function(o){var r=Ez(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function Ez(t,n){var e=[];return t.reduce(function(i,o){var r=Yn([i,o],n);return r.bbox=Pz(i,o),e.push(r),o}),e}function Pz(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var gy={exports:{}},S_={};(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:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,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 n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return h(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,D=S;C<D.length;C++){var R=D[C];if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<R[R.length-1].length;U++)if(R[R.length-1][U]!==R[0][U])throw new Error("First and last Position are not equivalent.")}var O={type:"Polygon",coordinates:S};return n(O,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function h(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=h;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function d(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=d;function p(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=p;function g(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=g;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return b(v(S,T))}t.lengthToDegrees=y;function m(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=m;function b(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=b;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var D=t.areaFactors[w];if(!D)throw new Error("invalid final units");return S/C*D}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function M(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=M;function F(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=F})(S_);var Rt={};const Bz=q1(zL);Object.defineProperty(Rt,"__esModule",{value:!0});var an=Bz;function ou(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,d=t.type,p=d==="FeatureCollection",g=d==="Feature",v=p?t.features.length:1,y=0;y<v;y++){u=p?t.features[y].geometry:g?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var m=0;m<s;m++){var b=0,x=0;if(a=f?u.geometries[m]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,b,x)===!1)return!1;h++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,b,x)===!1)return!1;h++,E==="MultiPoint"&&b++}E==="LineString"&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,b,x)===!1)return!1;h++}E==="MultiLineString"&&b++,E==="Polygon"&&x++}E==="Polygon"&&b++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,b,x)===!1)return!1;h++}x++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(ou(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Tz(t,n,e,i){var o=e;return ou(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function E_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function Iz(t,n,e){var i=e;return E_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function P_(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function Fz(t,n,e){var i=e;return P_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function Mz(t){var n=[];return ou(t,function(e){n.push(e)}),n}function yy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,d=t.type==="FeatureCollection",p=t.type==="Feature",g=d?t.features.length:1;for(e=0;e<g;e++){for(s=d?t.features[e].geometry:p?t.geometry:t,u=d?t.features[e].properties:p?t.properties:{},A=d?t.features[e].bbox:p?t.bbox:void 0,h=d?t.features[e].id:p?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Dz(t,n,e){var i=e;return yy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function Tf(t,n){yy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(an.feature(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(an.feature(h,o),i,u)===!1)return!1}})}function Rz(t,n,e){var i=e;return Tf(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function B_(t,n){Tf(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(ou(e,function(h,f,d,p,g){if(s===void 0||i>l||p>u||g>A){s=h,l=i,u=p,A=g,r=0;return}var v=an.lineString([s,h],e.properties);if(n(v,i,o,g,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function Uz(t,n,e){var i=e,o=!1;return B_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function T_(t,n){if(!t)throw new Error("geojson is required");Tf(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(an.lineString(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Oz(t,n,e){var i=e;return T_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function Lz(t,n){if(n=n||{},!an.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),an.lineString([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),an.lineString([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),an.lineString([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),an.lineString([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function zz(t,n){if(n=n||{},!an.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return an.point(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),an.point(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),an.point(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),an.point(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),an.point(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),an.point(l[i][o][r],a,n)}throw new Error("geojson is invalid")}Rt.coordAll=Mz,Rt.coordEach=ou,Rt.coordReduce=Tz,Rt.featureEach=P_,Rt.featureReduce=Fz,Rt.findPoint=zz,Rt.findSegment=Lz,Rt.flattenEach=Tf,Rt.flattenReduce=Rz,Rt.geomEach=yy,Rt.geomReduce=Dz,Rt.lineEach=T_,Rt.lineReduce=Oz,Rt.propEach=E_,Rt.propReduce=Iz,Rt.segmentEach=B_,Rt.segmentReduce=Uz;var vy={};const kz=q1($L);Object.defineProperty(vy,"__esModule",{value:!0});var Qz=kz;function wy(t){var n=[1/0,1/0,-1/0,-1/0];return Qz.coordEach(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}wy.default=wy,vy.default=wy;var Ui=wz,I_=S_,F_=Rt,_a=vy.default,Vz=F_.featureEach;F_.coordEach,I_.polygon;var M_=I_.featureCollection;function D_(t){var n=new Ui(t);return n.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:_a(e),Ui.prototype.insert.call(this,e)},n.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:_a(o),i.push(o)}):Vz(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:_a(o),i.push(o)}),Ui.prototype.load.call(this,i)},n.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:_a(e),Ui.prototype.remove.call(this,e,i)},n.clear=function(){return Ui.prototype.clear.call(this)},n.search=function(e){var i=Ui.prototype.search.call(this,this.toBBox(e));return M_(i)},n.collides=function(e){return Ui.prototype.collides.call(this,this.toBBox(e))},n.all=function(){var e=Ui.prototype.all.call(this);return M_(e)},n.toJSON=function(){return Ui.prototype.toJSON.call(this)},n.fromJSON=function(e){return Ui.prototype.fromJSON.call(this,e)},n.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=_a(e);else if(e.type==="FeatureCollection")i=_a(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},n}gy.exports=D_,gy.exports.default=D_;var Nz=gy.exports;const Hz=Il(Nz);function by(t,n){var e={},i=[];if(t.type==="LineString"&&(t=On(t)),n.type==="LineString"&&(n=On(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=R_(t,n);return o&&i.push(o),En(i)}var r=Hz();return r.load(C_(n)),ya(C_(t),function(a){ya(r.search(a),function(s){var l=R_(a,s);if(l){var u=Ii(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),En(i)}function R_(t,n){var e=Ii(t),i=Ii(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],h=i[1][1],f=(h-u)*(a-o)-(A-l)*(s-r),d=(A-l)*(r-u)-(h-u)*(o-l),p=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var g=d/f,v=p/f;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(a-o),m=r+g*(s-r);return Zt([y,m])}return null}function If(t,n,e){e===void 0&&(e={});for(var i=Pf(t),o=Ii(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Gz(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Gz(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],h=e[0]-s,f=e[1]-l,d=u-s,p=A-l,g=h*p-f*d;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<=u:u<=r&&r<s:p>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<u:u<r&&r<=s:p>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<u:u<r&&r<s:p>0?l<a&&a<A:A<a&&a<l}else return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<=u:u<=r&&r<=s:p>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function Wz(t,n){var e=Fi(t),i=Fi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return jz(e,i);case"LineString":return If(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return hn(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return qz(e,i);case"LineString":return Kz(e,i);case"Polygon":case"MultiPolygon":return Zz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return $z(e,i);case"Polygon":case"MultiPolygon":return Xz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Yz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function jz(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(O_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function qz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)O_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function Kz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!If(t.coordinates[i],n))return!1;e||(e=If(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function Zz(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=hn(t.coordinates[1],n),!i){e=!1;break}i=hn(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function $z(t,n){for(var e=0;e<t.coordinates.length;e++)if(!If(t.coordinates[e],n))return!1;return!0}function Xz(t,n){var e=es(n),i=es(t);if(!U_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!hn(t.coordinates[r],n))return!1;if(o||(o=hn(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=Jz(t.coordinates[r],t.coordinates[r+1]);o=hn(a,n,{ignoreBoundary:!0})}}return o}function Yz(t,n){var e=es(t),i=es(n);if(!U_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!hn(t.coordinates[0][o],n))return!1;return!0}function U_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function O_(t,n){return t[0]===n[0]&&t[1]===n[1]}function Jz(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function L_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Mi([o,r],[a,r],e),u=l*(a-o),A=n/Mi([o,r],[o,s],e),h=A*(s-r),f=a-o,d=s-r,p=Math.floor(f/u),g=Math.floor(d/h),v=(f-p*u)/2,y=(d-g*h)/2,m=o+v;m<=a;){for(var b=r+y;b<=s;){var x=Zt([m,b],e.properties);e.mask?Wz(x,e.mask)&&i.push(x):i.push(x),b+=h}m+=u}return En(i)}function xy(t,n){n===void 0&&(n={});var e=Fi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return ek(e,n);case"MultiPolygon":return tk(e,n);default:throw new Error("invalid poly")}}function ek(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return z_(i,o)}function tk(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push(z_(a,o))}),En(r)}function z_(t,n){return t.length>1?ay(t,n):Yn(t[0],n)}var k_=Object.prototype.toString,Q_=function(n){var e=k_.call(n),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&k_.call(n.callee)==="[object Function]"),i},_y,V_;function nk(){if(V_)return _y;V_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Q_,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.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},A=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(d){var p=d!==null&&typeof d=="object",g=e.call(d)==="[object Function]",v=i(d),y=p&&e.call(d)==="[object String]",m=[];if(!p&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var b=a&&g;if(y&&d.length>0&&!n.call(d,0))for(var x=0;x<d.length;++x)m.push(String(x));if(v&&d.length>0)for(var E=0;E<d.length;++E)m.push(String(E));else for(var B in d)!(b&&B==="prototype")&&n.call(d,B)&&m.push(String(B));if(r)for(var P=h(d),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(d,s[I])&&m.push(s[I]);return m}}return _y=t,_y}var ik=Array.prototype.slice,rk=Q_,N_=Object.keys,Ff=N_?function(n){return N_(n)}:nk(),H_=Object.keys;Ff.shim=function(){if(Object.keys){var n=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);n||(Object.keys=function(i){return rk(i)?H_(ik.call(i)):H_(i)})}else Object.keys=Ff;return Object.keys||Ff};var G_=Ff,W_=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},ok=W_,Cy=function(){return ok()&&!!Symbol.toStringTag},j_=Object,q_=Error,sk=EvalError,ak=RangeError,lk=ReferenceError,K_=SyntaxError,Ca=TypeError,uk=URIError,ck=Math.abs,hk=Math.floor,Ak=Math.max,fk=Math.min,pk=Math.pow,dk=Math.round,mk=Number.isNaN||function(n){return n!==n},gk=mk,yk=function(n){return gk(n)||n===0?n:n<0?-1:1},vk=Object.getOwnPropertyDescriptor,Mf=vk;if(Mf)try{Mf([],"length")}catch{Mf=null}var Sa=Mf,Df=Object.defineProperty||!1;if(Df)try{Df({},"a",{value:1})}catch{Df=!1}var Rf=Df,Sy,Z_;function wk(){if(Z_)return Sy;Z_=1;var t=typeof Symbol<"u"&&Symbol,n=W_;return Sy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},Sy}var $_=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,bk=j_,X_=bk.getPrototypeOf||null,xk="Function.prototype.bind called on incompatible ",_k=Object.prototype.toString,Ck=Math.max,Sk="[object Function]",Y_=function(n,e){for(var i=[],o=0;o<n.length;o+=1)i[o]=n[o];for(var r=0;r<e.length;r+=1)i[r+n.length]=e[r];return i},Ek=function(n,e){for(var i=[],o=e,r=0;o<n.length;o+=1,r+=1)i[r]=n[o];return i},Pk=function(t,n){for(var e="",i=0;i<t.length;i+=1)e+=t[i],i+1<t.length&&(e+=n);return e},Bk=function(n){var e=this;if(typeof e!="function"||_k.apply(e)!==Sk)throw new TypeError(xk+e);for(var i=Ek(arguments,1),o,r=function(){if(this instanceof o){var A=e.apply(this,Y_(i,arguments));return Object(A)===A?A:this}return e.apply(n,Y_(i,arguments))},a=Ck(0,e.length-i.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(o=Function("binder","return function ("+Pk(s,",")+"){ return binder.apply(this,arguments); }")(r),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},Tk=Bk,su=Function.prototype.bind||Tk,Ey=Function.prototype.call,Py=Function.prototype.apply,Ik=typeof Reflect<"u"&&Reflect&&Reflect.apply,Fk=su,Mk=Py,Dk=Ey,Rk=Ik,J_=Rk||Fk.call(Dk,Mk),Uk=su,Ok=Ca,Lk=Ey,zk=J_,By=function(n){if(n.length<1||typeof n[0]!="function")throw new Ok("a function is required");return zk(Uk,Lk,n)},kk=By,eC=Sa,tC;try{tC=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ty=!!tC&&eC&&eC(Object.prototype,"__proto__"),nC=Object,iC=nC.getPrototypeOf,Qk=Ty&&typeof Ty.get=="function"?kk([Ty.get]):typeof iC=="function"?function(n){return iC(n==null?n:nC(n))}:!1,rC=$_,oC=X_,sC=Qk,aC=rC?function(n){return rC(n)}:oC?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return oC(n)}:sC?function(n){return sC(n)}:null,Vk=Function.prototype.call,Nk=Object.prototype.hasOwnProperty,Hk=su,lC=Hk.call(Vk,Nk),We,Gk=j_,Wk=q_,jk=sk,qk=ak,Kk=lk,Ea=K_,Pa=Ca,Zk=uk,$k=ck,Xk=hk,Yk=Ak,Jk=fk,e6=pk,t6=dk,n6=yk,uC=Function,Iy=function(t){try{return uC('"use strict"; return ('+t+").constructor;")()}catch{}},au=Sa,i6=Rf,Fy=function(){throw new Pa},r6=au?function(){try{return arguments.callee,Fy}catch{try{return au(arguments,"callee").get}catch{return Fy}}}():Fy,Ba=wk()(),Qt=aC,o6=X_,s6=$_,cC=Py,lu=Ey,Ta={},a6=typeof Uint8Array>"u"||!Qt?We:Qt(Uint8Array),ts={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?We:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?We:ArrayBuffer,"%ArrayIteratorPrototype%":Ba&&Qt?Qt([][Symbol.iterator]()):We,"%AsyncFromSyncIteratorPrototype%":We,"%AsyncFunction%":Ta,"%AsyncGenerator%":Ta,"%AsyncGeneratorFunction%":Ta,"%AsyncIteratorPrototype%":Ta,"%Atomics%":typeof Atomics>"u"?We:Atomics,"%BigInt%":typeof BigInt>"u"?We:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?We:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?We:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?We:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Wk,"%eval%":eval,"%EvalError%":jk,"%Float16Array%":typeof Float16Array>"u"?We:Float16Array,"%Float32Array%":typeof Float32Array>"u"?We:Float32Array,"%Float64Array%":typeof Float64Array>"u"?We:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?We:FinalizationRegistry,"%Function%":uC,"%GeneratorFunction%":Ta,"%Int8Array%":typeof Int8Array>"u"?We:Int8Array,"%Int16Array%":typeof Int16Array>"u"?We:Int16Array,"%Int32Array%":typeof Int32Array>"u"?We:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ba&&Qt?Qt(Qt([][Symbol.iterator]())):We,"%JSON%":typeof JSON=="object"?JSON:We,"%Map%":typeof Map>"u"?We:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ba||!Qt?We:Qt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Gk,"%Object.getOwnPropertyDescriptor%":au,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?We:Promise,"%Proxy%":typeof Proxy>"u"?We:Proxy,"%RangeError%":qk,"%ReferenceError%":Kk,"%Reflect%":typeof Reflect>"u"?We:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?We:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ba||!Qt?We:Qt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?We:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ba&&Qt?Qt(""[Symbol.iterator]()):We,"%Symbol%":Ba?Symbol:We,"%SyntaxError%":Ea,"%ThrowTypeError%":r6,"%TypedArray%":a6,"%TypeError%":Pa,"%Uint8Array%":typeof Uint8Array>"u"?We:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?We:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?We:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?We:Uint32Array,"%URIError%":Zk,"%WeakMap%":typeof WeakMap>"u"?We:WeakMap,"%WeakRef%":typeof WeakRef>"u"?We:WeakRef,"%WeakSet%":typeof WeakSet>"u"?We:WeakSet,"%Function.prototype.call%":lu,"%Function.prototype.apply%":cC,"%Object.defineProperty%":i6,"%Object.getPrototypeOf%":o6,"%Math.abs%":$k,"%Math.floor%":Xk,"%Math.max%":Yk,"%Math.min%":Jk,"%Math.pow%":e6,"%Math.round%":t6,"%Math.sign%":n6,"%Reflect.getPrototypeOf%":s6};if(Qt)try{null.error}catch(t){var l6=Qt(Qt(t));ts["%Error.prototype%"]=l6}var u6=function t(n){var e;if(n==="%AsyncFunction%")e=Iy("async function () {}");else if(n==="%GeneratorFunction%")e=Iy("function* () {}");else if(n==="%AsyncGeneratorFunction%")e=Iy("async function* () {}");else if(n==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(n==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&Qt&&(e=Qt(o.prototype))}return ts[n]=e,e},hC={__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"]},uu=su,Uf=lC,c6=uu.call(lu,Array.prototype.concat),h6=uu.call(cC,Array.prototype.splice),AC=uu.call(lu,String.prototype.replace),Of=uu.call(lu,String.prototype.slice),A6=uu.call(lu,RegExp.prototype.exec),f6=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,p6=/\\(\\)?/g,d6=function(n){var e=Of(n,0,1),i=Of(n,-1);if(e==="%"&&i!=="%")throw new Ea("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ea("invalid intrinsic syntax, expected opening `%`");var o=[];return AC(n,f6,function(r,a,s,l){o[o.length]=s?AC(l,p6,"$1"):a||r}),o},m6=function(n,e){var i=n,o;if(Uf(hC,i)&&(o=hC[i],i="%"+o[0]+"%"),Uf(ts,i)){var r=ts[i];if(r===Ta&&(r=u6(i)),typeof r>"u"&&!e)throw new Pa("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:r}}throw new Ea("intrinsic "+n+" does not exist!")},fC=function(n,e){if(typeof n!="string"||n.length===0)throw new Pa("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Pa('"allowMissing" argument must be a boolean');if(A6(/^%?[^%]*%?$/,n)===null)throw new Ea("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=d6(n),o=i.length>0?i[0]:"",r=m6("%"+o+"%",e),a=r.name,s=r.value,l=!1,u=r.alias;u&&(o=u[0],h6(i,c6([0,1],u)));for(var A=1,h=!0;A<i.length;A+=1){var f=i[A],d=Of(f,0,1),p=Of(f,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new Ea("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(l=!0),o+="."+f,a="%"+o+"%",Uf(ts,a))s=ts[a];else if(s!=null){if(!(f in s)){if(!e)throw new Pa("base intrinsic for "+n+" exists, but the property is not available.");return}if(au&&A+1>=i.length){var g=au(s,f);h=!!g,h&&"get"in g&&!("originalValue"in g.get)?s=g.get:s=s[f]}else h=Uf(s,f),s=s[f];h&&!l&&(ts[a]=s)}}return s},pC=fC,dC=By,g6=dC([pC("%String.prototype.indexOf%")]),My=function(n,e){var i=pC(n,!!e);return typeof i=="function"&&g6(n,".prototype.")>-1?dC([i]):i},y6=Cy(),v6=My,Dy=v6("Object.prototype.toString"),Lf=function(n){return y6&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:Dy(n)==="[object Arguments]"},mC=function(n){return Lf(n)?!0:n!==null&&typeof n=="object"&&"length"in n&&typeof n.length=="number"&&n.length>=0&&Dy(n)!=="[object Array]"&&"callee"in n&&Dy(n.callee)==="[object Function]"},w6=function(){return Lf(arguments)}();Lf.isLegacyArguments=mC;var b6=w6?Lf:mC,gC=Rf,x6=K_,Ia=Ca,yC=Sa,Ry=function(n,e,i){if(!n||typeof n!="object"&&typeof n!="function")throw new Ia("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ia("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ia("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ia("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ia("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ia("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!yC&&yC(n,e);if(gC)gC(n,e,{configurable:a===null&&l?l.configurable:!a,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:r===null&&l?l.writable:!r});else if(s||!o&&!r&&!a)n[e]=i;else throw new x6("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Uy=Rf,vC=function(){return!!Uy};vC.hasArrayLengthDefineBug=function(){if(!Uy)return null;try{return Uy([],"length",{value:1}).length!==1}catch{return!0}};var Oy=vC,_6=G_,C6=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",S6=Object.prototype.toString,E6=Array.prototype.concat,wC=Ry,P6=function(t){return typeof t=="function"&&S6.call(t)==="[object Function]"},bC=Oy(),B6=function(t,n,e,i){if(n in t){if(i===!0){if(t[n]===e)return}else if(!P6(i)||!i())return}bC?wC(t,n,e,!0):wC(t,n,e)},xC=function(t,n){var e=arguments.length>2?arguments[2]:{},i=_6(n);C6&&(i=E6.call(i,Object.getOwnPropertySymbols(n)));for(var o=0;o<i.length;o+=1)B6(t,i[o],n[i[o]],e[i[o]])};xC.supportsDescriptors=!!bC;var cu=xC,_C={exports:{}},T6=fC,CC=Ry,I6=Oy(),SC=Sa,EC=Ca,F6=T6("%Math.floor%"),M6=function(n,e){if(typeof n!="function")throw new EC("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||F6(e)!==e)throw new EC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in n&&SC){var a=SC(n,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(r=!1)}return(o||r||!i)&&(I6?CC(n,"length",e,!0,!0):CC(n,"length",e)),n},D6=su,R6=Py,U6=J_,O6=function(){return U6(D6,R6,arguments)};(function(t){var n=M6,e=Rf,i=By,o=O6;t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(_C);var PC=_C.exports,BC=function(t){return t!==t},TC=function(n,e){return n===0&&e===0?1/n===1/e:!!(n===e||BC(n)&&BC(e))},L6=TC,IC=function(){return typeof Object.is=="function"?Object.is:L6},z6=IC,k6=cu,Q6=function(){var n=z6();return k6(Object,{is:n},{is:function(){return Object.is!==n}}),n},V6=cu,N6=PC,H6=TC,FC=IC,G6=Q6,MC=N6(FC(),Object);V6(MC,{getPolyfill:FC,implementation:H6,shim:G6});var W6=MC,DC=My,j6=Cy(),q6=lC,K6=Sa,Ly;if(j6){var Z6=DC("RegExp.prototype.exec"),RC={},zy=function(){throw RC},UC={toString:zy,valueOf:zy};typeof Symbol.toPrimitive=="symbol"&&(UC[Symbol.toPrimitive]=zy),Ly=function(n){if(!n||typeof n!="object")return!1;var e=K6(n,"lastIndex"),i=e&&q6(e,"value");if(!i)return!1;try{Z6(n,UC)}catch(o){return o===RC}}}else{var $6=DC("Object.prototype.toString"),X6="[object RegExp]";Ly=function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:$6(n)===X6}}var Y6=Ly,hu=function(){return typeof(function(){}).name=="string"},Au=Object.getOwnPropertyDescriptor;if(Au)try{Au([],"length")}catch{Au=null}hu.functionsHaveConfigurableNames=function(){if(!hu()||!Au)return!1;var n=Au(function(){},"name");return!!n&&!!n.configurable};var J6=Function.prototype.bind;hu.boundFunctionsHaveNames=function(){return hu()&&typeof J6=="function"&&(function(){}).bind().name!==""};var eQ=hu,OC=Ry,tQ=Oy(),nQ=eQ.functionsHaveConfigurableNames(),iQ=Ca,rQ=function(n,e){if(typeof n!="function")throw new iQ("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||nQ)&&(tQ?OC(n,"name",e,!0,!0):OC(n,"name",e)),n},oQ=rQ,sQ=Ca,aQ=Object,LC=oQ(function(){if(this==null||this!==aQ(this))throw new sQ("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.unicodeSets&&(n+="v"),this.sticky&&(n+="y"),n},"get flags",!0),lQ=LC,uQ=cu.supportsDescriptors,cQ=Object.getOwnPropertyDescriptor,zC=function(){if(uQ&&/a/mig.flags==="gim"){var n=cQ(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),n.get.call(i),e==="dy")return n.get}}return lQ},hQ=cu.supportsDescriptors,AQ=zC,fQ=Sa,pQ=Object.defineProperty,dQ=q_,kC=aC,mQ=/a/,gQ=function(){if(!hQ||!kC)throw new dQ("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=AQ(),e=kC(mQ),i=fQ(e,"flags");return(!i||i.get!==n)&&pQ(e,"flags",{configurable:!0,enumerable:!1,get:n}),n},yQ=cu,vQ=PC,wQ=LC,QC=zC,bQ=gQ,VC=vQ(QC());yQ(VC,{getPolyfill:QC,implementation:wQ,shim:bQ});var xQ=VC,NC=My,_Q=NC("Date.prototype.getDay"),CQ=function(n){try{return _Q(n),!0}catch{return!1}},SQ=NC("Object.prototype.toString"),EQ="[object Date]",PQ=Cy(),BQ=function(n){return typeof n!="object"||n===null?!1:PQ?CQ(n):SQ(n)===EQ},HC=G_,GC=b6,WC=W6,jC=Y6,qC=xQ,KC=BQ,ZC=Date.prototype.getTime;function $C(t,n,e){var i=e||{};return(i.strict?WC(t,n):t===n)?!0:!t||!n||typeof t!="object"&&typeof n!="object"?i.strict?WC(t,n):t==n:TQ(t,n,i)}function XC(t){return t==null}function YC(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 TQ(t,n,e){var i,o;if(typeof t!=typeof n||XC(t)||XC(n)||t.prototype!==n.prototype||GC(t)!==GC(n))return!1;var r=jC(t),a=jC(n);if(r!==a)return!1;if(r||a)return t.source===n.source&&qC(t)===qC(n);if(KC(t)&&KC(n))return ZC.call(t)===ZC.call(n);var s=YC(t),l=YC(n);if(s!==l)return!1;if(s||l){if(t.length!==n.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}if(typeof t!=typeof n)return!1;try{var u=HC(t),A=HC(n)}catch{return!1}if(u.length!==A.length)return!1;for(u.sort(),A.sort(),i=u.length-1;i>=0;i--)if(u[i]!=A[i])return!1;for(i=u.length-1;i>=0;i--)if(o=u[i],!$C(t[o],n[o],e))return!1;return!0}var IQ=$C;function FQ(t,n){var e=!0;return rr(t,function(i){rr(n,function(o){if(e===!1)return!1;e=MQ(i.geometry,o.geometry)})}),e}function MQ(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!OQ(t.coordinates,n.coordinates);case"LineString":return!JC(n,t);case"Polygon":return!hn(t,n)}break;case"LineString":switch(n.type){case"Point":return!JC(t,n);case"LineString":return!DQ(t,n);case"Polygon":return!eS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!hn(n,t);case"LineString":return!eS(t,n);case"Polygon":return!RQ(n,t)}}return!1}function JC(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(UQ(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function DQ(t,n){var e=by(t,n);return e.features.length>0}function eS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(hn(o,t))return!0}var r=by(n,xy(t));return r.features.length>0}function RQ(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(hn(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(hn(s,t))return!0}var l=by(xy(t),xy(n));return l.features.length>0}function UQ(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function OQ(t,n){return t[0]===n[0]&&t[1]===n[1]}var LQ=IQ,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:zQ};Oi.prototype.compare=function(t,n){if(t.type!==n.type||!nS(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,n);case"Feature":return this.compareFeature(t,n);default:if(t.type.indexOf("Multi")===0){var e=this,i=tS(t),o=tS(n);return i.every(function(r){return this.some(function(a){return e.compare(r,a)})},o)}}return!1};function tS(t){return t.coordinates.map(function(n){return{type:t.type.replace("Multi",""),coordinates:n}})}function nS(t,n){return t.hasOwnProperty("coordinates")?t.coordinates.length===n.coordinates.length:t.length===n.length}Oi.prototype.compareCoord=function(t,n){if(t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==n[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,n,e,i){if(!nS(t,n))return!1;var o=this.pseudoNode?t:this.removePseudo(t),r=this.pseudoNode?n:this.removePseudo(n);if(!(i&&!this.compareCoord(o[0],r[0])&&(r=this.fixStartIndex(r,o),!r))){var a=this.compareCoord(o[e],r[e]);return this.direction||a?this.comparePath(o,r):this.compareCoord(o[e],r[r.length-(1+e)])?this.comparePath(o.slice().reverse(),r):!1}},Oi.prototype.fixStartIndex=function(t,n){for(var e,i=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],n[0])){i=o;break}return i>=0&&(e=[].concat(t.slice(i,t.length),t.slice(1,i+1))),e},Oi.prototype.comparePath=function(t,n){var e=this;return t.every(function(i,o){return e.compareCoord(i,this[o])},n)},Oi.prototype.comparePolygon=function(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length),o=this;return e.every(function(r){return this.some(function(a){return o.compareLine(r,a,1,!0)})},i)}else return!1},Oi.prototype.compareFeature=function(t,n){return t.id!==n.id||!this.objectComparator(t.properties,n.properties)||!this.compareBBox(t,n)?!1:this.compare(t.geometry,n.geometry)},Oi.prototype.compareBBox=function(t,n){return!!(!t.bbox&&!n.bbox||t.bbox&&n.bbox&&this.compareCoord(t.bbox,n.bbox))},Oi.prototype.removePseudo=function(t){return t};function zQ(t,n){return LQ(t,n,{strict:!0})}var kQ=Oi;const QQ=Il(kQ);function VQ(t,n){var e=Fi(t).type,i=Fi(n).type;if(e!==i)return!1;var o=new QQ({precision:6});return o.compare(b_(t),b_(n))}function NQ(t,n){var e=!1;return rr(t,function(i){rr(n,function(o){if(e===!0)return!0;e=!FQ(i.geometry,o.geometry)})}),e}/**
3708
+ `,uo=class uo extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_player");L(this,"_finalImageUrlReact",this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"imageUrl"])));L(this,"_routePaths",this.disposeVar(c.react(void 0)));L(this,"routePathCallback");L(this,"_id",this.disposeVar(c.react(c.createGuid())));i&&(this._id.value=i),this._player=this.disposeVar(new c.Player);{const d=uo.defaults;this.dispose(c.bind([this._player,"loop"],[this,"loop"],p=>p??d.loop,p=>p??d.loop)),this.dispose(c.bind([this._player,"currentTime"],[this,"currentTime"],p=>p??d.currentTime,p=>p??d.currentTime)),this.dispose(c.bind([this._player,"duration"],[this,"duration"],p=>p??d.duration,p=>p??d.duration)),this.dispose(c.bind([this._player,"playing"],[this,"playing"],p=>p??d.playing,p=>p??d.playing)),this.dispose(c.bind([this._player,"speed"],[this,"speed"],p=>p??d.speed,p=>p??d.speed))}const o=this.disposeVar(c.ESSceneObject.context.createEnvStrReact([this,"geoJsonUrl"])),r=this.disposeVar(c.createProcessingFromAsyncFunc(async d=>{this.routePaths=void 0;const p=o.value;if(p)try{const v=await(await fetch(p)).json();this.routePaths=nz(v,this.width,this.repeatLength);return}catch(g){console.error(`geojson加载解析出错!${g}`),console.error(g)}if(this.data){this.routePaths=[...this.data];return}if(this.positionsSet){const g=this.positionsSet;if(g){this.routePaths=g.map(v=>({positions:v,width:this.width}));return}}}));{const d=()=>{r.restart()};d();const p=this.disposeVar(c.createNextAnimateFrameEvent(o.changed,this.positionsSetChanged,this.dataChanged,this.finalImageUrlReact.changed,this.widthChanged,this.repeatLengthChanged,this.arcTypeChanged,this.brighteningChanged,this.depthTestChanged));this.dispose(p.disposableOn(d))}{const d=()=>{const p=Sp(this.routePathCallbackStr,["result","this","instanceIndex","frameState"]);p&&(this.routePathCallback=p)};d(),this.dispose(this.routePathCallbackStrChanged.disposableOn(d))}const a=e.viewer;if(!a){console.warn("viewer is undefined!");return}const s=this.finalImageUrlReact,l=this.disposeVar(new bs),u=this.disposeVar(c.createProcessingFromAsyncFunc(async d=>{if(!s.value)return;const p=R0(a.scene.context).getTextureHandler(s.value);if(p instanceof bs)l.reset(p);else{const g=await d.promise(p);l.reset(g)}})),A=()=>l.valid?l.raw:a.scene.context.defaultTexture,h=()=>u.restart();h(),this.dispose(s.changed.disposableOn(h));const f=this.ad(c.createNextAnimateFrameEvent(this.routePathsChanged,this.colorChanged,this.bgColorChanged));this.disposeVar(new c.ObjResettingWithEvent(f,()=>this.routePaths?new yz(a,this,s.value&&A||void 0):void 0)),this.dispose(this.flyToEvent.disposableOn(d=>{if(!(!this.routePaths||this.routePaths.length===0)&&this.routePaths.length===1)if(!Object.prototype.hasOwnProperty.call(this.routePaths[0],"positions"))Fe(a,this.routePaths[0].startPos,a.camera.positionCartographic.height,void 0,d);else{const p=computeBoundingSphere(this.routePaths[0].positions);if(!p)return;const[g,v]=p;Fe(a,g,v*3,void 0,d)}}))}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}};L(uo,"whiteGradientImageBase64",vz),L(uo,"defaultRoutePathCallback",function(e,i,o){const r=i/50,a=r-Math.floor(r);return e.color=[a*.5+.5,(1-a)*.5+.5,.5,1],e.bgColor=[a*.5+.5,(1-a)*.5+.5,.5,.3],e}),L(uo,"routePathCallbackStrMd",wz),L(uo,"defaults",{loop:!0,startTime:0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(uo,"defaultImageUri","${earthsdk3-assets-script-dir}/assets/img/signal.png");let sr=uo;(t=>{t.createDefaultProps=()=>({show:!0,imageUrl:void 0,repeat:1,bidirectional:0,startTime:0,transmissionTime:void 0,color:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positionsSet:c.reactPositionsSet(void 0),data:c.reactJson(void 0),geoJsonUrl:"",allowPicking:!1,routePathCallbackStr:"",loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(sr||(sr={})),c.extendClassProps(sr.prototype,sr.createDefaultProps);class Yr extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_collection");this._collection=this.disposeVar(new sr(e,i)),this.dispose(c.track([this._collection,"show"],[this,"show"])),this.dispose(c.track([this._collection,"startTime"],[this,"startTime"])),this.dispose(c.track([this._collection,"transmissionTime"],[this,"transmissionTime"])),this.dispose(c.track([this._collection,"color"],[this,"color"])),this.dispose(c.track([this._collection,"bgColor"],[this,"bgColor"])),this.dispose(c.track([this._collection,"width"],[this,"width"])),this.dispose(c.track([this._collection,"arcType"],[this,"arcType"])),this.dispose(c.track([this._collection,"brightening"],[this,"brightening"])),this.dispose(c.track([this._collection,"depthTest"],[this,"depthTest"])),this.dispose(c.track([this._collection,"imageUrl"],[this,"imageUrl"])),this.dispose(c.track([this._collection,"repeat"],[this,"repeat"])),this.dispose(c.track([this._collection,"repeatLength"],[this,"repeatLength"])),this.dispose(c.track([this._collection,"bidirectional"],[this,"bidirectional"])),this.dispose(c.track([this._collection,"allowPicking"],[this,"allowPicking"])),this.dispose(c.bind([this._collection,"playing"],[this,"playing"])),this.dispose(c.track([this._collection,"loop"],[this,"loop"])),this.dispose(c.bind([this._collection,"currentTime"],[this,"currentTime"])),this.dispose(c.bind([this._collection,"duration"],[this,"duration"])),this.dispose(c.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((a,s)=>{var l;if(!(!this.positions||s==((l=this.positions)==null?void 0:l.length)-1))return{startPos:a,endPos:this.positions[s+1],width:this.width,heightRatio:this.heightRatio}}).filter(a=>a!==void 0);return}this._collection.data=void 0};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this.positionsChanged,this.heightRatioChanged,this.widthChanged));this.dispose(r.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}}L(Yr,"defaults",{loop:!0,currentTime:0,duration:3e3,speed:1,playing:!0,transmissionTime:3e3}),L(Yr,"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:c.reactArray([0,1,0,1]),bgColor:c.reactArray([0,1,0,.2]),width:3,repeatLength:1e4,arcType:"GEODESIC",brightening:!1,depthTest:!0,positions:c.reactPositions(void 0),heightRatio:0,allowPicking:!1,loop:void 0,currentTime:void 0,duration:void 0,speed:void 0,playing:void 0})})(Yr||(Yr={})),c.extendClassProps(Yr.prototype,Yr.createDefaultProps);const Vc=class Vc extends on{constructor(e,i){super(e,i);L(this,"_czmSignalTransmission");if(this._czmSignalTransmission=this.disposeVar(new Yr(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmSignalTransmission;{const a=()=>{r.show=e.show&&e.stroked};a(),this.ad(e.showChanged.don(a)),this.ad(e.strokedChanged.don(a))}this.dispose(c.track([r,"allowPicking"],[e,"allowPicking"])),this.dispose(c.bind([r,"positions"],[e,"points"])),this.dispose(c.track([r,"width"],[e,"strokeWidth"])),this.dispose(c.track([r,"bgColor"],[e,"strokeColor"])),this.dispose(c.track([r,"startTime"],[e,"startTime"])),this.dispose(c.track([r,"transmissionTime"],[e,"transmissionTime"])),this.dispose(c.track([r,"heightRatio"],[e,"heightRatio"])),this.dispose(c.track([r,"arcType"],[e,"arcType"])),this.dispose(c.track([r,"brightening"],[e,"brightening"])),this.dispose(c.track([r,"depthTest"],[e,"depthTest"])),this.dispose(c.track([r,"imageUrl"],[e,"imageUrl"])),this.dispose(c.track([r,"repeat"],[e,"repeat"])),this.dispose(c.track([r,"bidirectional"],[e,"bidirectional"])),this.dispose(c.track([r,"loop"],[e,"loop"])),this.dispose(c.track([r,"currentTime"],[e,"currentTime"])),this.dispose(c.track([r,"duration"],[e,"duration"])),this.dispose(c.track([r,"playing"],[e,"playing"])),this.dispose(c.track([r,"speed"],[e,"speed"]))}get czmSignalTransmission(){return this._czmSignalTransmission}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmSignalTransmission:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(Vc,"type",Vc.register("ESCesiumViewer",yf.type,Vc));let py=Vc;function es(t){var n=[1/0,1/0,-1/0,-1/0];return Yo(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}es.default=es;var m_={exports:{}};(function(t,n){(function(e,i){t.exports=i()})(Uo,function(){function e(m,b,x,E,B){(function P(I,M,F,S,T){for(;S>F;){if(S-F>600){var w=S-F+1,C=M-F+1,D=Math.log(w),R=.5*Math.exp(2*D/3),U=.5*Math.sqrt(D*R*(w-R)/w)*(C-w/2<0?-1:1),O=Math.max(F,Math.floor(M-C*R/w+U)),z=Math.min(S,Math.floor(M+(w-C)*R/w+U));P(I,M,O,z,T)}var k=I[M],Q=F,N=S;for(i(I,F,M),T(I[S],k)>0&&i(I,F,S);Q<N;){for(i(I,Q,N),Q++,N--;T(I[Q],k)<0;)Q++;for(;T(I[N],k)>0;)N--}T(I[F],k)===0?i(I,F,N):i(I,++N,S),N<=M&&(F=N+1),M<=N&&(S=N-1)}})(m,b,x||0,E||m.length-1,B||o)}function i(m,b,x){var E=m[b];m[b]=m[x],m[x]=E}function o(m,b){return m<b?-1:m>b?1:0}var r=function(m){m===void 0&&(m=9),this._maxEntries=Math.max(4,m),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function a(m,b,x){if(!x)return b.indexOf(m);for(var E=0;E<b.length;E++)if(x(m,b[E]))return E;return-1}function s(m,b){l(m,0,m.children.length,b,m)}function l(m,b,x,E,B){B||(B=v(null)),B.minX=1/0,B.minY=1/0,B.maxX=-1/0,B.maxY=-1/0;for(var P=b;P<x;P++){var I=m.children[P];u(B,m.leaf?E(I):I)}return B}function u(m,b){return m.minX=Math.min(m.minX,b.minX),m.minY=Math.min(m.minY,b.minY),m.maxX=Math.max(m.maxX,b.maxX),m.maxY=Math.max(m.maxY,b.maxY),m}function A(m,b){return m.minX-b.minX}function h(m,b){return m.minY-b.minY}function f(m){return(m.maxX-m.minX)*(m.maxY-m.minY)}function d(m){return m.maxX-m.minX+(m.maxY-m.minY)}function p(m,b){return m.minX<=b.minX&&m.minY<=b.minY&&b.maxX<=m.maxX&&b.maxY<=m.maxY}function g(m,b){return b.minX<=m.maxX&&b.minY<=m.maxY&&b.maxX>=m.minX&&b.maxY>=m.minY}function v(m){return{children:m,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(m,b,x,E,B){for(var P=[b,x];P.length;)if(!((x=P.pop())-(b=P.pop())<=E)){var I=b+Math.ceil((x-b)/E/2)*E;e(m,I,b,x,B),P.push(b,I,I,x)}}return r.prototype.all=function(){return this._all(this.data,[])},r.prototype.search=function(m){var b=this.data,x=[];if(!g(m,b))return x;for(var E=this.toBBox,B=[];b;){for(var P=0;P<b.children.length;P++){var I=b.children[P],M=b.leaf?E(I):I;g(m,M)&&(b.leaf?x.push(I):p(m,M)?this._all(I,x):B.push(I))}b=B.pop()}return x},r.prototype.collides=function(m){var b=this.data;if(!g(m,b))return!1;for(var x=[];b;){for(var E=0;E<b.children.length;E++){var B=b.children[E],P=b.leaf?this.toBBox(B):B;if(g(m,P)){if(b.leaf||p(m,P))return!0;x.push(B)}}b=x.pop()}return!1},r.prototype.load=function(m){if(!m||!m.length)return this;if(m.length<this._minEntries){for(var b=0;b<m.length;b++)this.insert(m[b]);return this}var x=this._build(m.slice(),0,m.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 E=this.data;this.data=x,x=E}this._insert(x,this.data.height-x.height-1,!0)}else this.data=x;return this},r.prototype.insert=function(m){return m&&this._insert(m,this.data.height-1),this},r.prototype.clear=function(){return this.data=v([]),this},r.prototype.remove=function(m,b){if(!m)return this;for(var x,E,B,P=this.data,I=this.toBBox(m),M=[],F=[];P||M.length;){if(P||(P=M.pop(),E=M[M.length-1],x=F.pop(),B=!0),P.leaf){var S=a(m,P.children,b);if(S!==-1)return P.children.splice(S,1),M.push(P),this._condense(M),this}B||P.leaf||!p(P,I)?E?(x++,P=E.children[x],B=!1):P=null:(M.push(P),F.push(x),x=0,E=P,P=P.children[0])}return this},r.prototype.toBBox=function(m){return m},r.prototype.compareMinX=function(m,b){return m.minX-b.minX},r.prototype.compareMinY=function(m,b){return m.minY-b.minY},r.prototype.toJSON=function(){return this.data},r.prototype.fromJSON=function(m){return this.data=m,this},r.prototype._all=function(m,b){for(var x=[];m;)m.leaf?b.push.apply(b,m.children):x.push.apply(x,m.children),m=x.pop();return b},r.prototype._build=function(m,b,x,E){var B,P=x-b+1,I=this._maxEntries;if(P<=I)return s(B=v(m.slice(b,x+1)),this.toBBox),B;E||(E=Math.ceil(Math.log(P)/Math.log(I)),I=Math.ceil(P/Math.pow(I,E-1))),(B=v([])).leaf=!1,B.height=E;var M=Math.ceil(P/I),F=M*Math.ceil(Math.sqrt(I));y(m,b,x,F,this.compareMinX);for(var S=b;S<=x;S+=F){var T=Math.min(S+F-1,x);y(m,S,T,M,this.compareMinY);for(var w=S;w<=T;w+=M){var C=Math.min(w+M-1,T);B.children.push(this._build(m,w,C,E-1))}}return s(B,this.toBBox),B},r.prototype._chooseSubtree=function(m,b,x,E){for(;E.push(b),!b.leaf&&E.length-1!==x;){for(var B=1/0,P=1/0,I=void 0,M=0;M<b.children.length;M++){var F=b.children[M],S=f(F),T=(w=m,C=F,(Math.max(C.maxX,w.maxX)-Math.min(C.minX,w.minX))*(Math.max(C.maxY,w.maxY)-Math.min(C.minY,w.minY))-S);T<P?(P=T,B=S<B?S:B,I=F):T===P&&S<B&&(B=S,I=F)}b=I||b.children[0]}var w,C;return b},r.prototype._insert=function(m,b,x){var E=x?m:this.toBBox(m),B=[],P=this._chooseSubtree(E,this.data,b,B);for(P.children.push(m),u(P,E);b>=0&&B[b].children.length>this._maxEntries;)this._split(B,b),b--;this._adjustParentBBoxes(E,B,b)},r.prototype._split=function(m,b){var x=m[b],E=x.children.length,B=this._minEntries;this._chooseSplitAxis(x,B,E);var P=this._chooseSplitIndex(x,B,E),I=v(x.children.splice(P,x.children.length-P));I.height=x.height,I.leaf=x.leaf,s(x,this.toBBox),s(I,this.toBBox),b?m[b-1].children.push(I):this._splitRoot(x,I)},r.prototype._splitRoot=function(m,b){this.data=v([m,b]),this.data.height=m.height+1,this.data.leaf=!1,s(this.data,this.toBBox)},r.prototype._chooseSplitIndex=function(m,b,x){for(var E,B,P,I,M,F,S,T=1/0,w=1/0,C=b;C<=x-b;C++){var D=l(m,0,C,this.toBBox),R=l(m,C,x,this.toBBox),U=(B=D,P=R,I=void 0,M=void 0,F=void 0,S=void 0,I=Math.max(B.minX,P.minX),M=Math.max(B.minY,P.minY),F=Math.min(B.maxX,P.maxX),S=Math.min(B.maxY,P.maxY),Math.max(0,F-I)*Math.max(0,S-M)),O=f(D)+f(R);U<T?(T=U,E=C,w=O<w?O:w):U===T&&O<w&&(w=O,E=C)}return E||x-b},r.prototype._chooseSplitAxis=function(m,b,x){var E=m.leaf?this.compareMinX:A,B=m.leaf?this.compareMinY:h;this._allDistMargin(m,b,x,E)<this._allDistMargin(m,b,x,B)&&m.children.sort(E)},r.prototype._allDistMargin=function(m,b,x,E){m.children.sort(E);for(var B=this.toBBox,P=l(m,0,b,B),I=l(m,x-b,x,B),M=d(P)+d(I),F=b;F<x-b;F++){var S=m.children[F];u(P,m.leaf?B(S):S),M+=d(P)}for(var T=x-b-1;T>=b;T--){var w=m.children[T];u(I,m.leaf?B(w):w),M+=d(I)}return M},r.prototype._adjustParentBBoxes=function(m,b,x){for(var E=x;E>=0;E--)u(b[E],m)},r.prototype._condense=function(m){for(var b=m.length-1,x=void 0;b>=0;b--)m[b].children.length===0?b>0?(x=m[b-1].children).splice(x.indexOf(m[b]),1):this.clear():s(m[b],this.toBBox)},r})})(m_);var bz=m_.exports;function hn(t,n,e){if(e===void 0&&(e={}),!t)throw new Error("point is required");if(!n)throw new Error("polygon is required");var i=Pf(t),o=Fi(n),r=o.type,a=n.bbox,s=o.coordinates;if(a&&xz(i,a)===!1)return!1;r==="Polygon"&&(s=[s]);for(var l=!1,u=0;u<s.length&&!l;u++)if(g_(i,s[u][0],e.ignoreBoundary)){for(var A=!1,h=1;h<s[u].length&&!A;)g_(i,s[u][h],!e.ignoreBoundary)&&(A=!0),h++;A||(l=!0)}return l}function g_(t,n,e){var i=!1;n[0][0]===n[n.length-1][0]&&n[0][1]===n[n.length-1][1]&&(n=n.slice(0,n.length-1));for(var o=0,r=n.length-1;o<n.length;r=o++){var a=n[o][0],s=n[o][1],l=n[r][0],u=n[r][1],A=t[1]*(a-l)+s*(l-t[0])+u*(t[0]-a)===0&&(a-t[0])*(l-t[0])<=0&&(s-t[1])*(u-t[1])<=0;if(A)return!e;var h=s>t[1]!=u>t[1]&&t[0]<(l-a)*(t[1]-s)/(u-s)+a;h&&(i=!i)}return i}function xz(t,n){return n[0]<=t[0]&&n[1]<=t[1]&&n[2]>=t[0]&&n[3]>=t[1]}function _z(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return y_(t);case"FeatureCollection":return Cz(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return dy(t);default:throw new Error("unknown GeoJSON type")}}function y_(t){var n={type:"Feature"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"properties":case"geometry":return;default:n[e]=t[e]}}),n.properties=v_(t.properties),n.geometry=dy(t.geometry),n}function v_(t){var n={};return t&&Object.keys(t).forEach(function(e){var i=t[e];typeof i=="object"?i===null?n[e]=null:Array.isArray(i)?n[e]=i.map(function(o){return o}):n[e]=v_(i):n[e]=i}),n}function Cz(t){var n={type:"FeatureCollection"};return Object.keys(t).forEach(function(e){switch(e){case"type":case"features":return;default:n[e]=t[e]}}),n.features=t.features.map(function(e){return y_(e)}),n}function dy(t){var n={type:t.type};return t.bbox&&(n.bbox=t.bbox),t.type==="GeometryCollection"?(n.geometries=t.geometries.map(function(e){return dy(e)}),n):(n.coordinates=w_(t.coordinates),n)}function w_(t){var n=t;return typeof n[0]!="object"?n.slice():n.map(function(e){return w_(e)})}function b_(t,n){n===void 0&&(n={});var e=typeof n=="object"?n.mutate:n;if(!t)throw new Error("geojson is required");var i=VL(t),o=[];switch(i){case"LineString":o=my(t);break;case"MultiLineString":case"Polygon":Ii(t).forEach(function(a){o.push(my(a))});break;case"MultiPolygon":Ii(t).forEach(function(a){var s=[];a.forEach(function(l){s.push(my(l))}),o.push(s)});break;case"Point":return t;case"MultiPoint":var r={};Ii(t).forEach(function(a){var s=a.join("-");Object.prototype.hasOwnProperty.call(r,s)||(o.push(a),r[s]=!0)});break;default:throw new Error(i+" geometry not supported")}return t.coordinates?e===!0?(t.coordinates=o,t):{type:i,coordinates:o}:e===!0?(t.geometry.coordinates=o,t):On({type:i,coordinates:o},t.properties,{bbox:t.bbox,id:t.id})}function my(t){var n=Ii(t);if(n.length===2&&!x_(n[0],n[1]))return n;var e=[],i=n.length-1,o=e.length;e.push(n[0]);for(var r=1;r<i;r++){var a=e[e.length-1];n[r][0]===a[0]&&n[r][1]===a[1]||(e.push(n[r]),o=e.length,o>2&&__(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1))}if(e.push(n[n.length-1]),o=e.length,x_(n[0],n[n.length-1])&&o<4)throw new Error("invalid polygon");return __(e[o-3],e[o-1],e[o-2])&&e.splice(e.length-2,1),e}function x_(t,n){return t[0]===n[0]&&t[1]===n[1]}function __(t,n,e){var i=e[0],o=e[1],r=t[0],a=t[1],s=n[0],l=n[1],u=i-r,A=o-a,h=s-r,f=l-a,d=u*f-A*h;return d!==0?!1:Math.abs(h)>=Math.abs(f)?h>0?r<=i&&i<=s:s<=i&&i<=r:f>0?a<=o&&o<=l:l<=o&&o<=a}function Sz(t,n){n===void 0&&(n={});var e=0,i=0,o=0;return Yo(t,function(r){e+=r[0],i+=r[1],o++},!0),Zt([e/o,i/o],n.properties)}function C_(t){if(!t)throw new Error("geojson is required");var n=[];return rr(t,function(e){Ez(e,n)}),En(n)}function Ez(t,n){var e=[],i=t.geometry;if(i!==null){switch(i.type){case"Polygon":e=Ii(i);break;case"LineString":e=[Ii(i)]}e.forEach(function(o){var r=Pz(o,t.properties);r.forEach(function(a){a.id=n.length,n.push(a)})})}}function Pz(t,n){var e=[];return t.reduce(function(i,o){var r=Yn([i,o],n);return r.bbox=Bz(i,o),e.push(r),o}),e}function Bz(t,n){var e=t[0],i=t[1],o=n[0],r=n[1],a=e<o?e:o,s=i<r?i:r,l=e>o?e:o,u=i>r?i:r;return[a,s,l,u]}var gy={exports:{}},S_={};(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:8982708286548395e-21,feet:3.28084,inches:39.37,kilometers:.001,kilometres:.001,meters:1,metres:1,miles:.0006213711922373339,millimeters:1e3,millimetres:1e3,nauticalmiles:.0005399568034557236,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 n(S,T,w){w===void 0&&(w={});var C={type:"Feature"};return(w.id===0||w.id)&&(C.id=w.id),w.bbox&&(C.bbox=w.bbox),C.properties=T||{},C.geometry=S,C}t.feature=n;function e(S,T,w){switch(S){case"Point":return i(T).geometry;case"LineString":return s(T).geometry;case"Polygon":return r(T).geometry;case"MultiPoint":return h(T).geometry;case"MultiLineString":return A(T).geometry;case"MultiPolygon":return f(T).geometry;default:throw new Error(S+" is invalid")}}t.geometry=e;function i(S,T,w){if(w===void 0&&(w={}),!S)throw new Error("coordinates is required");if(!Array.isArray(S))throw new Error("coordinates must be an Array");if(S.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!P(S[0])||!P(S[1]))throw new Error("coordinates must contain numbers");var C={type:"Point",coordinates:S};return n(C,T,w)}t.point=i;function o(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return i(C,T)}),w)}t.points=o;function r(S,T,w){w===void 0&&(w={});for(var C=0,D=S;C<D.length;C++){var R=D[C];if(R.length<4)throw new Error("Each LinearRing of a Polygon must have 4 or more Positions.");for(var U=0;U<R[R.length-1].length;U++)if(R[R.length-1][U]!==R[0][U])throw new Error("First and last Position are not equivalent.")}var O={type:"Polygon",coordinates:S};return n(O,T,w)}t.polygon=r;function a(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return r(C,T)}),w)}t.polygons=a;function s(S,T,w){if(w===void 0&&(w={}),S.length<2)throw new Error("coordinates must be an array of two or more positions");var C={type:"LineString",coordinates:S};return n(C,T,w)}t.lineString=s;function l(S,T,w){return w===void 0&&(w={}),u(S.map(function(C){return s(C,T)}),w)}t.lineStrings=l;function u(S,T){T===void 0&&(T={});var w={type:"FeatureCollection"};return T.id&&(w.id=T.id),T.bbox&&(w.bbox=T.bbox),w.features=S,w}t.featureCollection=u;function A(S,T,w){w===void 0&&(w={});var C={type:"MultiLineString",coordinates:S};return n(C,T,w)}t.multiLineString=A;function h(S,T,w){w===void 0&&(w={});var C={type:"MultiPoint",coordinates:S};return n(C,T,w)}t.multiPoint=h;function f(S,T,w){w===void 0&&(w={});var C={type:"MultiPolygon",coordinates:S};return n(C,T,w)}t.multiPolygon=f;function d(S,T,w){w===void 0&&(w={});var C={type:"GeometryCollection",geometries:S};return n(C,T,w)}t.geometryCollection=d;function p(S,T){if(T===void 0&&(T=0),T&&!(T>=0))throw new Error("precision must be a positive number");var w=Math.pow(10,T||0);return Math.round(S*w)/w}t.round=p;function g(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S*w}t.radiansToLength=g;function v(S,T){T===void 0&&(T="kilometers");var w=t.factors[T];if(!w)throw new Error(T+" units is invalid");return S/w}t.lengthToRadians=v;function y(S,T){return b(v(S,T))}t.lengthToDegrees=y;function m(S){var T=S%360;return T<0&&(T+=360),T}t.bearingToAzimuth=m;function b(S){var T=S%(2*Math.PI);return T*180/Math.PI}t.radiansToDegrees=b;function x(S){var T=S%360;return T*Math.PI/180}t.degreesToRadians=x;function E(S,T,w){if(T===void 0&&(T="kilometers"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("length must be a positive number");return g(v(S,T),w)}t.convertLength=E;function B(S,T,w){if(T===void 0&&(T="meters"),w===void 0&&(w="kilometers"),!(S>=0))throw new Error("area must be a positive number");var C=t.areaFactors[T];if(!C)throw new Error("invalid original units");var D=t.areaFactors[w];if(!D)throw new Error("invalid final units");return S/C*D}t.convertArea=B;function P(S){return!isNaN(S)&&S!==null&&!Array.isArray(S)}t.isNumber=P;function I(S){return!!S&&S.constructor===Object}t.isObject=I;function M(S){if(!S)throw new Error("bbox is required");if(!Array.isArray(S))throw new Error("bbox must be an Array");if(S.length!==4&&S.length!==6)throw new Error("bbox must be an Array of 4 or 6 numbers");S.forEach(function(T){if(!P(T))throw new Error("bbox must only contain numbers")})}t.validateBBox=M;function F(S){if(!S)throw new Error("id is required");if(["string","number"].indexOf(typeof S)===-1)throw new Error("id must be a number or a string")}t.validateId=F})(S_);var Rt={};const Tz=q1(kL);Object.defineProperty(Rt,"__esModule",{value:!0});var an=Tz;function ou(t,n,e){if(t!==null)for(var i,o,r,a,s,l,u,A=0,h=0,f,d=t.type,p=d==="FeatureCollection",g=d==="Feature",v=p?t.features.length:1,y=0;y<v;y++){u=p?t.features[y].geometry:g?t.geometry:t,f=u?u.type==="GeometryCollection":!1,s=f?u.geometries.length:1;for(var m=0;m<s;m++){var b=0,x=0;if(a=f?u.geometries[m]:u,a!==null){l=a.coordinates;var E=a.type;switch(A=e&&(E==="Polygon"||E==="MultiPolygon")?1:0,E){case null:break;case"Point":if(n(l,h,y,b,x)===!1)return!1;h++,b++;break;case"LineString":case"MultiPoint":for(i=0;i<l.length;i++){if(n(l[i],h,y,b,x)===!1)return!1;h++,E==="MultiPoint"&&b++}E==="LineString"&&b++;break;case"Polygon":case"MultiLineString":for(i=0;i<l.length;i++){for(o=0;o<l[i].length-A;o++){if(n(l[i][o],h,y,b,x)===!1)return!1;h++}E==="MultiLineString"&&b++,E==="Polygon"&&x++}E==="Polygon"&&b++;break;case"MultiPolygon":for(i=0;i<l.length;i++){for(x=0,o=0;o<l[i].length;o++){for(r=0;r<l[i][o].length-A;r++){if(n(l[i][o][r],h,y,b,x)===!1)return!1;h++}x++}b++}break;case"GeometryCollection":for(i=0;i<a.geometries.length;i++)if(ou(a.geometries[i],n,e)===!1)return!1;break;default:throw new Error("Unknown Geometry Type")}}}}}function Iz(t,n,e,i){var o=e;return ou(t,function(r,a,s,l,u){a===0&&e===void 0?o=r:o=n(o,r,a,s,l,u)},i),o}function E_(t,n){var e;switch(t.type){case"FeatureCollection":for(e=0;e<t.features.length&&n(t.features[e].properties,e)!==!1;e++);break;case"Feature":n(t.properties,0);break}}function Fz(t,n,e){var i=e;return E_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function P_(t,n){if(t.type==="Feature")n(t,0);else if(t.type==="FeatureCollection")for(var e=0;e<t.features.length&&n(t.features[e],e)!==!1;e++);}function Mz(t,n,e){var i=e;return P_(t,function(o,r){r===0&&e===void 0?i=o:i=n(i,o,r)}),i}function Dz(t){var n=[];return ou(t,function(e){n.push(e)}),n}function yy(t,n){var e,i,o,r,a,s,l,u,A,h,f=0,d=t.type==="FeatureCollection",p=t.type==="Feature",g=d?t.features.length:1;for(e=0;e<g;e++){for(s=d?t.features[e].geometry:p?t.geometry:t,u=d?t.features[e].properties:p?t.properties:{},A=d?t.features[e].bbox:p?t.bbox:void 0,h=d?t.features[e].id:p?t.id:void 0,l=s?s.type==="GeometryCollection":!1,a=l?s.geometries.length:1,o=0;o<a;o++){if(r=l?s.geometries[o]:s,r===null){if(n(null,f,u,A,h)===!1)return!1;continue}switch(r.type){case"Point":case"LineString":case"MultiPoint":case"Polygon":case"MultiLineString":case"MultiPolygon":{if(n(r,f,u,A,h)===!1)return!1;break}case"GeometryCollection":{for(i=0;i<r.geometries.length;i++)if(n(r.geometries[i],f,u,A,h)===!1)return!1;break}default:throw new Error("Unknown Geometry Type")}}f++}}function Rz(t,n,e){var i=e;return yy(t,function(o,r,a,s,l){r===0&&e===void 0?i=o:i=n(i,o,r,a,s,l)}),i}function Tf(t,n){yy(t,function(e,i,o,r,a){var s=e===null?null:e.type;switch(s){case null:case"Point":case"LineString":case"Polygon":return n(an.feature(e,o,{bbox:r,id:a}),i,0)===!1?!1:void 0}var l;switch(s){case"MultiPoint":l="Point";break;case"MultiLineString":l="LineString";break;case"MultiPolygon":l="Polygon";break}for(var u=0;u<e.coordinates.length;u++){var A=e.coordinates[u],h={type:l,coordinates:A};if(n(an.feature(h,o),i,u)===!1)return!1}})}function Uz(t,n,e){var i=e;return Tf(t,function(o,r,a){r===0&&a===0&&e===void 0?i=o:i=n(i,o,r,a)}),i}function B_(t,n){Tf(t,function(e,i,o){var r=0;if(e.geometry){var a=e.geometry.type;if(!(a==="Point"||a==="MultiPoint")){var s,l=0,u=0,A=0;if(ou(e,function(h,f,d,p,g){if(s===void 0||i>l||p>u||g>A){s=h,l=i,u=p,A=g,r=0;return}var v=an.lineString([s,h],e.properties);if(n(v,i,o,g,r)===!1)return!1;r++,s=h})===!1)return!1}}})}function Oz(t,n,e){var i=e,o=!1;return B_(t,function(r,a,s,l,u){o===!1&&e===void 0?i=r:i=n(i,r,a,s,l,u),o=!0}),i}function T_(t,n){if(!t)throw new Error("geojson is required");Tf(t,function(e,i,o){if(e.geometry!==null){var r=e.geometry.type,a=e.geometry.coordinates;switch(r){case"LineString":if(n(e,i,o,0,0)===!1)return!1;break;case"Polygon":for(var s=0;s<a.length;s++)if(n(an.lineString(a[s],e.properties),i,o,s)===!1)return!1;break}}})}function Lz(t,n,e){var i=e;return T_(t,function(o,r,a,s){r===0&&e===void 0?i=o:i=n(i,o,r,a,s)}),i}function zz(t,n){if(n=n||{},!an.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.segmentIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":case"MultiPoint":return null;case"LineString":return r<0&&(r=l.length+r-1),an.lineString([l[r],l[r+1]],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r-1),an.lineString([l[o][r],l[o][r+1]],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r-1),an.lineString([l[i][r],l[i][r+1]],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r-1),an.lineString([l[i][o][r],l[i][o][r+1]],a,n)}throw new Error("geojson is invalid")}function kz(t,n){if(n=n||{},!an.isObject(n))throw new Error("options is invalid");var e=n.featureIndex||0,i=n.multiFeatureIndex||0,o=n.geometryIndex||0,r=n.coordIndex||0,a=n.properties,s;switch(t.type){case"FeatureCollection":e<0&&(e=t.features.length+e),a=a||t.features[e].properties,s=t.features[e].geometry;break;case"Feature":a=a||t.properties,s=t.geometry;break;case"Point":case"MultiPoint":return null;case"LineString":case"Polygon":case"MultiLineString":case"MultiPolygon":s=t;break;default:throw new Error("geojson is invalid")}if(s===null)return null;var l=s.coordinates;switch(s.type){case"Point":return an.point(l,a,n);case"MultiPoint":return i<0&&(i=l.length+i),an.point(l[i],a,n);case"LineString":return r<0&&(r=l.length+r),an.point(l[r],a,n);case"Polygon":return o<0&&(o=l.length+o),r<0&&(r=l[o].length+r),an.point(l[o][r],a,n);case"MultiLineString":return i<0&&(i=l.length+i),r<0&&(r=l[i].length+r),an.point(l[i][r],a,n);case"MultiPolygon":return i<0&&(i=l.length+i),o<0&&(o=l[i].length+o),r<0&&(r=l[i][o].length-r),an.point(l[i][o][r],a,n)}throw new Error("geojson is invalid")}Rt.coordAll=Dz,Rt.coordEach=ou,Rt.coordReduce=Iz,Rt.featureEach=P_,Rt.featureReduce=Mz,Rt.findPoint=kz,Rt.findSegment=zz,Rt.flattenEach=Tf,Rt.flattenReduce=Uz,Rt.geomEach=yy,Rt.geomReduce=Rz,Rt.lineEach=T_,Rt.lineReduce=Lz,Rt.propEach=E_,Rt.propReduce=Fz,Rt.segmentEach=B_,Rt.segmentReduce=Oz;var vy={};const Qz=q1(XL);Object.defineProperty(vy,"__esModule",{value:!0});var Vz=Qz;function wy(t){var n=[1/0,1/0,-1/0,-1/0];return Vz.coordEach(t,function(e){n[0]>e[0]&&(n[0]=e[0]),n[1]>e[1]&&(n[1]=e[1]),n[2]<e[0]&&(n[2]=e[0]),n[3]<e[1]&&(n[3]=e[1])}),n}wy.default=wy,vy.default=wy;var Ui=bz,I_=S_,F_=Rt,_a=vy.default,Nz=F_.featureEach;F_.coordEach,I_.polygon;var M_=I_.featureCollection;function D_(t){var n=new Ui(t);return n.insert=function(e){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:_a(e),Ui.prototype.insert.call(this,e)},n.load=function(e){var i=[];return Array.isArray(e)?e.forEach(function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:_a(o),i.push(o)}):Nz(e,function(o){if(o.type!=="Feature")throw new Error("invalid features");o.bbox=o.bbox?o.bbox:_a(o),i.push(o)}),Ui.prototype.load.call(this,i)},n.remove=function(e,i){if(e.type!=="Feature")throw new Error("invalid feature");return e.bbox=e.bbox?e.bbox:_a(e),Ui.prototype.remove.call(this,e,i)},n.clear=function(){return Ui.prototype.clear.call(this)},n.search=function(e){var i=Ui.prototype.search.call(this,this.toBBox(e));return M_(i)},n.collides=function(e){return Ui.prototype.collides.call(this,this.toBBox(e))},n.all=function(){var e=Ui.prototype.all.call(this);return M_(e)},n.toJSON=function(){return Ui.prototype.toJSON.call(this)},n.fromJSON=function(e){return Ui.prototype.fromJSON.call(this,e)},n.toBBox=function(e){var i;if(e.bbox)i=e.bbox;else if(Array.isArray(e)&&e.length===4)i=e;else if(Array.isArray(e)&&e.length===6)i=[e[0],e[1],e[3],e[4]];else if(e.type==="Feature")i=_a(e);else if(e.type==="FeatureCollection")i=_a(e);else throw new Error("invalid geojson");return{minX:i[0],minY:i[1],maxX:i[2],maxY:i[3]}},n}gy.exports=D_,gy.exports.default=D_;var Hz=gy.exports;const Gz=Il(Hz);function by(t,n){var e={},i=[];if(t.type==="LineString"&&(t=On(t)),n.type==="LineString"&&(n=On(n)),t.type==="Feature"&&n.type==="Feature"&&t.geometry!==null&&n.geometry!==null&&t.geometry.type==="LineString"&&n.geometry.type==="LineString"&&t.geometry.coordinates.length===2&&n.geometry.coordinates.length===2){var o=R_(t,n);return o&&i.push(o),En(i)}var r=Gz();return r.load(C_(n)),ya(C_(t),function(a){ya(r.search(a),function(s){var l=R_(a,s);if(l){var u=Ii(l).join(",");e[u]||(e[u]=!0,i.push(l))}})}),En(i)}function R_(t,n){var e=Ii(t),i=Ii(n);if(e.length!==2)throw new Error("<intersects> line1 must only contain 2 coordinates");if(i.length!==2)throw new Error("<intersects> line2 must only contain 2 coordinates");var o=e[0][0],r=e[0][1],a=e[1][0],s=e[1][1],l=i[0][0],u=i[0][1],A=i[1][0],h=i[1][1],f=(h-u)*(a-o)-(A-l)*(s-r),d=(A-l)*(r-u)-(h-u)*(o-l),p=(a-o)*(r-u)-(s-r)*(o-l);if(f===0)return null;var g=d/f,v=p/f;if(g>=0&&g<=1&&v>=0&&v<=1){var y=o+g*(a-o),m=r+g*(s-r);return Zt([y,m])}return null}function If(t,n,e){e===void 0&&(e={});for(var i=Pf(t),o=Ii(n),r=0;r<o.length-1;r++){var a=!1;if(e.ignoreEndVertices&&(r===0&&(a="start"),r===o.length-2&&(a="end"),r===0&&r+1===o.length-1&&(a="both")),Wz(o[r],o[r+1],i,a,typeof e.epsilon>"u"?null:e.epsilon))return!0}return!1}function Wz(t,n,e,i,o){var r=e[0],a=e[1],s=t[0],l=t[1],u=n[0],A=n[1],h=e[0]-s,f=e[1]-l,d=u-s,p=A-l,g=h*p-f*d;if(o!==null){if(Math.abs(g)>o)return!1}else if(g!==0)return!1;if(i){if(i==="start")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<=u:u<=r&&r<s:p>0?l<a&&a<=A:A<=a&&a<l;if(i==="end")return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<u:u<r&&r<=s:p>0?l<=a&&a<A:A<a&&a<=l;if(i==="both")return Math.abs(d)>=Math.abs(p)?d>0?s<r&&r<u:u<r&&r<s:p>0?l<a&&a<A:A<a&&a<l}else return Math.abs(d)>=Math.abs(p)?d>0?s<=r&&r<=u:u<=r&&r<=s:p>0?l<=a&&a<=A:A<=a&&a<=l;return!1}function jz(t,n){var e=Fi(t),i=Fi(n),o=e.type,r=i.type;switch(o){case"Point":switch(r){case"MultiPoint":return qz(e,i);case"LineString":return If(e,i,{ignoreEndVertices:!0});case"Polygon":case"MultiPolygon":return hn(e,i,{ignoreBoundary:!0});default:throw new Error("feature2 "+r+" geometry not supported")}case"MultiPoint":switch(r){case"MultiPoint":return Kz(e,i);case"LineString":return Zz(e,i);case"Polygon":case"MultiPolygon":return $z(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"LineString":switch(r){case"LineString":return Xz(e,i);case"Polygon":case"MultiPolygon":return Yz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}case"Polygon":switch(r){case"Polygon":case"MultiPolygon":return Jz(e,i);default:throw new Error("feature2 "+r+" geometry not supported")}default:throw new Error("feature1 "+o+" geometry not supported")}}function qz(t,n){var e,i=!1;for(e=0;e<n.coordinates.length;e++)if(O_(n.coordinates[e],t.coordinates)){i=!0;break}return i}function Kz(t,n){for(var e=0;e<t.coordinates.length;e++){for(var i=!1,o=0;o<n.coordinates.length;o++)O_(t.coordinates[e],n.coordinates[o])&&(i=!0);if(!i)return!1}return!0}function Zz(t,n){for(var e=!1,i=0;i<t.coordinates.length;i++){if(!If(t.coordinates[i],n))return!1;e||(e=If(t.coordinates[i],n,{ignoreEndVertices:!0}))}return e}function $z(t,n){for(var e=!0,i=!1,o=0;o<t.coordinates.length;o++){if(i=hn(t.coordinates[1],n),!i){e=!1;break}i=hn(t.coordinates[1],n,{ignoreBoundary:!0})}return e&&i}function Xz(t,n){for(var e=0;e<t.coordinates.length;e++)if(!If(t.coordinates[e],n))return!1;return!0}function Yz(t,n){var e=es(n),i=es(t);if(!U_(e,i))return!1;for(var o=!1,r=0;r<t.coordinates.length-1;r++){if(!hn(t.coordinates[r],n))return!1;if(o||(o=hn(t.coordinates[r],n,{ignoreBoundary:!0})),!o){var a=e6(t.coordinates[r],t.coordinates[r+1]);o=hn(a,n,{ignoreBoundary:!0})}}return o}function Jz(t,n){var e=es(t),i=es(n);if(!U_(i,e))return!1;for(var o=0;o<t.coordinates[0].length;o++)if(!hn(t.coordinates[0][o],n))return!1;return!0}function U_(t,n){return!(t[0]>n[0]||t[2]<n[2]||t[1]>n[1]||t[3]<n[3])}function O_(t,n){return t[0]===n[0]&&t[1]===n[1]}function e6(t,n){return[(t[0]+n[0])/2,(t[1]+n[1])/2]}function L_(t,n,e){e===void 0&&(e={}),e.mask&&!e.units&&(e.units="kilometers");for(var i=[],o=t[0],r=t[1],a=t[2],s=t[3],l=n/Mi([o,r],[a,r],e),u=l*(a-o),A=n/Mi([o,r],[o,s],e),h=A*(s-r),f=a-o,d=s-r,p=Math.floor(f/u),g=Math.floor(d/h),v=(f-p*u)/2,y=(d-g*h)/2,m=o+v;m<=a;){for(var b=r+y;b<=s;){var x=Zt([m,b],e.properties);e.mask?jz(x,e.mask)&&i.push(x):i.push(x),b+=h}m+=u}return En(i)}function xy(t,n){n===void 0&&(n={});var e=Fi(t);switch(!n.properties&&t.type==="Feature"&&(n.properties=t.properties),e.type){case"Polygon":return t6(e,n);case"MultiPolygon":return n6(e,n);default:throw new Error("invalid poly")}}function t6(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{};return z_(i,o)}function n6(t,n){n===void 0&&(n={});var e=Fi(t),i=e.coordinates,o=n.properties?n.properties:t.type==="Feature"?t.properties:{},r=[];return i.forEach(function(a){r.push(z_(a,o))}),En(r)}function z_(t,n){return t.length>1?ay(t,n):Yn(t[0],n)}var k_=Object.prototype.toString,Q_=function(n){var e=k_.call(n),i=e==="[object Arguments]";return i||(i=e!=="[object Array]"&&n!==null&&typeof n=="object"&&typeof n.length=="number"&&n.length>=0&&k_.call(n.callee)==="[object Function]"),i},_y,V_;function i6(){if(V_)return _y;V_=1;var t;if(!Object.keys){var n=Object.prototype.hasOwnProperty,e=Object.prototype.toString,i=Q_,o=Object.prototype.propertyIsEnumerable,r=!o.call({toString:null},"toString"),a=o.call(function(){},"prototype"),s=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],l=function(f){var d=f.constructor;return d&&d.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},A=function(){if(typeof window>"u")return!1;for(var f in window)try{if(!u["$"+f]&&n.call(window,f)&&window[f]!==null&&typeof window[f]=="object")try{l(window[f])}catch{return!0}}catch{return!0}return!1}(),h=function(f){if(typeof window>"u"||!A)return l(f);try{return l(f)}catch{return!1}};t=function(d){var p=d!==null&&typeof d=="object",g=e.call(d)==="[object Function]",v=i(d),y=p&&e.call(d)==="[object String]",m=[];if(!p&&!g&&!v)throw new TypeError("Object.keys called on a non-object");var b=a&&g;if(y&&d.length>0&&!n.call(d,0))for(var x=0;x<d.length;++x)m.push(String(x));if(v&&d.length>0)for(var E=0;E<d.length;++E)m.push(String(E));else for(var B in d)!(b&&B==="prototype")&&n.call(d,B)&&m.push(String(B));if(r)for(var P=h(d),I=0;I<s.length;++I)!(P&&s[I]==="constructor")&&n.call(d,s[I])&&m.push(s[I]);return m}}return _y=t,_y}var r6=Array.prototype.slice,o6=Q_,N_=Object.keys,Ff=N_?function(n){return N_(n)}:i6(),H_=Object.keys;Ff.shim=function(){if(Object.keys){var n=function(){var e=Object.keys(arguments);return e&&e.length===arguments.length}(1,2);n||(Object.keys=function(i){return o6(i)?H_(r6.call(i)):H_(i)})}else Object.keys=Ff;return Object.keys||Ff};var G_=Ff,W_=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var n={},e=Symbol("test"),i=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var o=42;n[e]=o;for(var r in n)return!1;if(typeof Object.keys=="function"&&Object.keys(n).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(n).length!==0)return!1;var a=Object.getOwnPropertySymbols(n);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(n,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(n,e);if(s.value!==o||s.enumerable!==!0)return!1}return!0},s6=W_,Cy=function(){return s6()&&!!Symbol.toStringTag},j_=Object,q_=Error,a6=EvalError,l6=RangeError,u6=ReferenceError,K_=SyntaxError,Ca=TypeError,c6=URIError,h6=Math.abs,A6=Math.floor,f6=Math.max,p6=Math.min,d6=Math.pow,m6=Math.round,g6=Number.isNaN||function(n){return n!==n},y6=g6,v6=function(n){return y6(n)||n===0?n:n<0?-1:1},w6=Object.getOwnPropertyDescriptor,Mf=w6;if(Mf)try{Mf([],"length")}catch{Mf=null}var Sa=Mf,Df=Object.defineProperty||!1;if(Df)try{Df({},"a",{value:1})}catch{Df=!1}var Rf=Df,Sy,Z_;function b6(){if(Z_)return Sy;Z_=1;var t=typeof Symbol<"u"&&Symbol,n=W_;return Sy=function(){return typeof t!="function"||typeof Symbol!="function"||typeof t("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:n()},Sy}var $_=typeof Reflect<"u"&&Reflect.getPrototypeOf||null,x6=j_,X_=x6.getPrototypeOf||null,_6="Function.prototype.bind called on incompatible ",C6=Object.prototype.toString,S6=Math.max,E6="[object Function]",Y_=function(n,e){for(var i=[],o=0;o<n.length;o+=1)i[o]=n[o];for(var r=0;r<e.length;r+=1)i[r+n.length]=e[r];return i},P6=function(n,e){for(var i=[],o=e,r=0;o<n.length;o+=1,r+=1)i[r]=n[o];return i},B6=function(t,n){for(var e="",i=0;i<t.length;i+=1)e+=t[i],i+1<t.length&&(e+=n);return e},T6=function(n){var e=this;if(typeof e!="function"||C6.apply(e)!==E6)throw new TypeError(_6+e);for(var i=P6(arguments,1),o,r=function(){if(this instanceof o){var A=e.apply(this,Y_(i,arguments));return Object(A)===A?A:this}return e.apply(n,Y_(i,arguments))},a=S6(0,e.length-i.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(o=Function("binder","return function ("+B6(s,",")+"){ return binder.apply(this,arguments); }")(r),e.prototype){var u=function(){};u.prototype=e.prototype,o.prototype=new u,u.prototype=null}return o},I6=T6,su=Function.prototype.bind||I6,Ey=Function.prototype.call,Py=Function.prototype.apply,F6=typeof Reflect<"u"&&Reflect&&Reflect.apply,M6=su,D6=Py,R6=Ey,U6=F6,J_=U6||M6.call(R6,D6),O6=su,L6=Ca,z6=Ey,k6=J_,By=function(n){if(n.length<1||typeof n[0]!="function")throw new L6("a function is required");return k6(O6,z6,n)},Q6=By,eC=Sa,tC;try{tC=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ty=!!tC&&eC&&eC(Object.prototype,"__proto__"),nC=Object,iC=nC.getPrototypeOf,V6=Ty&&typeof Ty.get=="function"?Q6([Ty.get]):typeof iC=="function"?function(n){return iC(n==null?n:nC(n))}:!1,rC=$_,oC=X_,sC=V6,aC=rC?function(n){return rC(n)}:oC?function(n){if(!n||typeof n!="object"&&typeof n!="function")throw new TypeError("getProto: not an object");return oC(n)}:sC?function(n){return sC(n)}:null,N6=Function.prototype.call,H6=Object.prototype.hasOwnProperty,G6=su,lC=G6.call(N6,H6),We,W6=j_,j6=q_,q6=a6,K6=l6,Z6=u6,Ea=K_,Pa=Ca,$6=c6,X6=h6,Y6=A6,J6=f6,ek=p6,tk=d6,nk=m6,ik=v6,uC=Function,Iy=function(t){try{return uC('"use strict"; return ('+t+").constructor;")()}catch{}},au=Sa,rk=Rf,Fy=function(){throw new Pa},ok=au?function(){try{return arguments.callee,Fy}catch{try{return au(arguments,"callee").get}catch{return Fy}}}():Fy,Ba=b6()(),Qt=aC,sk=X_,ak=$_,cC=Py,lu=Ey,Ta={},lk=typeof Uint8Array>"u"||!Qt?We:Qt(Uint8Array),ts={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?We:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?We:ArrayBuffer,"%ArrayIteratorPrototype%":Ba&&Qt?Qt([][Symbol.iterator]()):We,"%AsyncFromSyncIteratorPrototype%":We,"%AsyncFunction%":Ta,"%AsyncGenerator%":Ta,"%AsyncGeneratorFunction%":Ta,"%AsyncIteratorPrototype%":Ta,"%Atomics%":typeof Atomics>"u"?We:Atomics,"%BigInt%":typeof BigInt>"u"?We:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?We:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?We:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?We:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":j6,"%eval%":eval,"%EvalError%":q6,"%Float16Array%":typeof Float16Array>"u"?We:Float16Array,"%Float32Array%":typeof Float32Array>"u"?We:Float32Array,"%Float64Array%":typeof Float64Array>"u"?We:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?We:FinalizationRegistry,"%Function%":uC,"%GeneratorFunction%":Ta,"%Int8Array%":typeof Int8Array>"u"?We:Int8Array,"%Int16Array%":typeof Int16Array>"u"?We:Int16Array,"%Int32Array%":typeof Int32Array>"u"?We:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ba&&Qt?Qt(Qt([][Symbol.iterator]())):We,"%JSON%":typeof JSON=="object"?JSON:We,"%Map%":typeof Map>"u"?We:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ba||!Qt?We:Qt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":W6,"%Object.getOwnPropertyDescriptor%":au,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?We:Promise,"%Proxy%":typeof Proxy>"u"?We:Proxy,"%RangeError%":K6,"%ReferenceError%":Z6,"%Reflect%":typeof Reflect>"u"?We:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?We:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ba||!Qt?We:Qt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?We:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ba&&Qt?Qt(""[Symbol.iterator]()):We,"%Symbol%":Ba?Symbol:We,"%SyntaxError%":Ea,"%ThrowTypeError%":ok,"%TypedArray%":lk,"%TypeError%":Pa,"%Uint8Array%":typeof Uint8Array>"u"?We:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?We:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?We:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?We:Uint32Array,"%URIError%":$6,"%WeakMap%":typeof WeakMap>"u"?We:WeakMap,"%WeakRef%":typeof WeakRef>"u"?We:WeakRef,"%WeakSet%":typeof WeakSet>"u"?We:WeakSet,"%Function.prototype.call%":lu,"%Function.prototype.apply%":cC,"%Object.defineProperty%":rk,"%Object.getPrototypeOf%":sk,"%Math.abs%":X6,"%Math.floor%":Y6,"%Math.max%":J6,"%Math.min%":ek,"%Math.pow%":tk,"%Math.round%":nk,"%Math.sign%":ik,"%Reflect.getPrototypeOf%":ak};if(Qt)try{null.error}catch(t){var uk=Qt(Qt(t));ts["%Error.prototype%"]=uk}var ck=function t(n){var e;if(n==="%AsyncFunction%")e=Iy("async function () {}");else if(n==="%GeneratorFunction%")e=Iy("function* () {}");else if(n==="%AsyncGeneratorFunction%")e=Iy("async function* () {}");else if(n==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(e=i.prototype)}else if(n==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&Qt&&(e=Qt(o.prototype))}return ts[n]=e,e},hC={__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"]},uu=su,Uf=lC,hk=uu.call(lu,Array.prototype.concat),Ak=uu.call(cC,Array.prototype.splice),AC=uu.call(lu,String.prototype.replace),Of=uu.call(lu,String.prototype.slice),fk=uu.call(lu,RegExp.prototype.exec),pk=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,dk=/\\(\\)?/g,mk=function(n){var e=Of(n,0,1),i=Of(n,-1);if(e==="%"&&i!=="%")throw new Ea("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&e!=="%")throw new Ea("invalid intrinsic syntax, expected opening `%`");var o=[];return AC(n,pk,function(r,a,s,l){o[o.length]=s?AC(l,dk,"$1"):a||r}),o},gk=function(n,e){var i=n,o;if(Uf(hC,i)&&(o=hC[i],i="%"+o[0]+"%"),Uf(ts,i)){var r=ts[i];if(r===Ta&&(r=ck(i)),typeof r>"u"&&!e)throw new Pa("intrinsic "+n+" exists, but is not available. Please file an issue!");return{alias:o,name:i,value:r}}throw new Ea("intrinsic "+n+" does not exist!")},fC=function(n,e){if(typeof n!="string"||n.length===0)throw new Pa("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new Pa('"allowMissing" argument must be a boolean');if(fk(/^%?[^%]*%?$/,n)===null)throw new Ea("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=mk(n),o=i.length>0?i[0]:"",r=gk("%"+o+"%",e),a=r.name,s=r.value,l=!1,u=r.alias;u&&(o=u[0],Ak(i,hk([0,1],u)));for(var A=1,h=!0;A<i.length;A+=1){var f=i[A],d=Of(f,0,1),p=Of(f,-1);if((d==='"'||d==="'"||d==="`"||p==='"'||p==="'"||p==="`")&&d!==p)throw new Ea("property names with quotes must have matching quotes");if((f==="constructor"||!h)&&(l=!0),o+="."+f,a="%"+o+"%",Uf(ts,a))s=ts[a];else if(s!=null){if(!(f in s)){if(!e)throw new Pa("base intrinsic for "+n+" exists, but the property is not available.");return}if(au&&A+1>=i.length){var g=au(s,f);h=!!g,h&&"get"in g&&!("originalValue"in g.get)?s=g.get:s=s[f]}else h=Uf(s,f),s=s[f];h&&!l&&(ts[a]=s)}}return s},pC=fC,dC=By,yk=dC([pC("%String.prototype.indexOf%")]),My=function(n,e){var i=pC(n,!!e);return typeof i=="function"&&yk(n,".prototype.")>-1?dC([i]):i},vk=Cy(),wk=My,Dy=wk("Object.prototype.toString"),Lf=function(n){return vk&&n&&typeof n=="object"&&Symbol.toStringTag in n?!1:Dy(n)==="[object Arguments]"},mC=function(n){return Lf(n)?!0:n!==null&&typeof n=="object"&&"length"in n&&typeof n.length=="number"&&n.length>=0&&Dy(n)!=="[object Array]"&&"callee"in n&&Dy(n.callee)==="[object Function]"},bk=function(){return Lf(arguments)}();Lf.isLegacyArguments=mC;var xk=bk?Lf:mC,gC=Rf,_k=K_,Ia=Ca,yC=Sa,Ry=function(n,e,i){if(!n||typeof n!="object"&&typeof n!="function")throw new Ia("`obj` must be an object or a function`");if(typeof e!="string"&&typeof e!="symbol")throw new Ia("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ia("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ia("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ia("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ia("`loose`, if provided, must be a boolean");var o=arguments.length>3?arguments[3]:null,r=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!yC&&yC(n,e);if(gC)gC(n,e,{configurable:a===null&&l?l.configurable:!a,enumerable:o===null&&l?l.enumerable:!o,value:i,writable:r===null&&l?l.writable:!r});else if(s||!o&&!r&&!a)n[e]=i;else throw new _k("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},Uy=Rf,vC=function(){return!!Uy};vC.hasArrayLengthDefineBug=function(){if(!Uy)return null;try{return Uy([],"length",{value:1}).length!==1}catch{return!0}};var Oy=vC,Ck=G_,Sk=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",Ek=Object.prototype.toString,Pk=Array.prototype.concat,wC=Ry,Bk=function(t){return typeof t=="function"&&Ek.call(t)==="[object Function]"},bC=Oy(),Tk=function(t,n,e,i){if(n in t){if(i===!0){if(t[n]===e)return}else if(!Bk(i)||!i())return}bC?wC(t,n,e,!0):wC(t,n,e)},xC=function(t,n){var e=arguments.length>2?arguments[2]:{},i=Ck(n);Sk&&(i=Pk.call(i,Object.getOwnPropertySymbols(n)));for(var o=0;o<i.length;o+=1)Tk(t,i[o],n[i[o]],e[i[o]])};xC.supportsDescriptors=!!bC;var cu=xC,_C={exports:{}},Ik=fC,CC=Ry,Fk=Oy(),SC=Sa,EC=Ca,Mk=Ik("%Math.floor%"),Dk=function(n,e){if(typeof n!="function")throw new EC("`fn` is not a function");if(typeof e!="number"||e<0||e>4294967295||Mk(e)!==e)throw new EC("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],o=!0,r=!0;if("length"in n&&SC){var a=SC(n,"length");a&&!a.configurable&&(o=!1),a&&!a.writable&&(r=!1)}return(o||r||!i)&&(Fk?CC(n,"length",e,!0,!0):CC(n,"length",e)),n},Rk=su,Uk=Py,Ok=J_,Lk=function(){return Ok(Rk,Uk,arguments)};(function(t){var n=Dk,e=Rf,i=By,o=Lk;t.exports=function(a){var s=i(arguments),l=a.length-(arguments.length-1);return n(s,1+(l>0?l:0),!0)},e?e(t.exports,"apply",{value:o}):t.exports.apply=o})(_C);var PC=_C.exports,BC=function(t){return t!==t},TC=function(n,e){return n===0&&e===0?1/n===1/e:!!(n===e||BC(n)&&BC(e))},zk=TC,IC=function(){return typeof Object.is=="function"?Object.is:zk},kk=IC,Qk=cu,Vk=function(){var n=kk();return Qk(Object,{is:n},{is:function(){return Object.is!==n}}),n},Nk=cu,Hk=PC,Gk=TC,FC=IC,Wk=Vk,MC=Hk(FC(),Object);Nk(MC,{getPolyfill:FC,implementation:Gk,shim:Wk});var jk=MC,DC=My,qk=Cy(),Kk=lC,Zk=Sa,Ly;if(qk){var $k=DC("RegExp.prototype.exec"),RC={},zy=function(){throw RC},UC={toString:zy,valueOf:zy};typeof Symbol.toPrimitive=="symbol"&&(UC[Symbol.toPrimitive]=zy),Ly=function(n){if(!n||typeof n!="object")return!1;var e=Zk(n,"lastIndex"),i=e&&Kk(e,"value");if(!i)return!1;try{$k(n,UC)}catch(o){return o===RC}}}else{var Xk=DC("Object.prototype.toString"),Yk="[object RegExp]";Ly=function(n){return!n||typeof n!="object"&&typeof n!="function"?!1:Xk(n)===Yk}}var Jk=Ly,hu=function(){return typeof(function(){}).name=="string"},Au=Object.getOwnPropertyDescriptor;if(Au)try{Au([],"length")}catch{Au=null}hu.functionsHaveConfigurableNames=function(){if(!hu()||!Au)return!1;var n=Au(function(){},"name");return!!n&&!!n.configurable};var eQ=Function.prototype.bind;hu.boundFunctionsHaveNames=function(){return hu()&&typeof eQ=="function"&&(function(){}).bind().name!==""};var tQ=hu,OC=Ry,nQ=Oy(),iQ=tQ.functionsHaveConfigurableNames(),rQ=Ca,oQ=function(n,e){if(typeof n!="function")throw new rQ("`fn` is not a function");var i=arguments.length>2&&!!arguments[2];return(!i||iQ)&&(nQ?OC(n,"name",e,!0,!0):OC(n,"name",e)),n},sQ=oQ,aQ=Ca,lQ=Object,LC=sQ(function(){if(this==null||this!==lQ(this))throw new aQ("RegExp.prototype.flags getter called on non-object");var n="";return this.hasIndices&&(n+="d"),this.global&&(n+="g"),this.ignoreCase&&(n+="i"),this.multiline&&(n+="m"),this.dotAll&&(n+="s"),this.unicode&&(n+="u"),this.unicodeSets&&(n+="v"),this.sticky&&(n+="y"),n},"get flags",!0),uQ=LC,cQ=cu.supportsDescriptors,hQ=Object.getOwnPropertyDescriptor,zC=function(){if(cQ&&/a/mig.flags==="gim"){var n=hQ(RegExp.prototype,"flags");if(n&&typeof n.get=="function"&&"dotAll"in RegExp.prototype&&"hasIndices"in RegExp.prototype){var e="",i={};if(Object.defineProperty(i,"hasIndices",{get:function(){e+="d"}}),Object.defineProperty(i,"sticky",{get:function(){e+="y"}}),n.get.call(i),e==="dy")return n.get}}return uQ},AQ=cu.supportsDescriptors,fQ=zC,pQ=Sa,dQ=Object.defineProperty,mQ=q_,kC=aC,gQ=/a/,yQ=function(){if(!AQ||!kC)throw new mQ("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var n=fQ(),e=kC(gQ),i=pQ(e,"flags");return(!i||i.get!==n)&&dQ(e,"flags",{configurable:!0,enumerable:!1,get:n}),n},vQ=cu,wQ=PC,bQ=LC,QC=zC,xQ=yQ,VC=wQ(QC());vQ(VC,{getPolyfill:QC,implementation:bQ,shim:xQ});var _Q=VC,NC=My,CQ=NC("Date.prototype.getDay"),SQ=function(n){try{return CQ(n),!0}catch{return!1}},EQ=NC("Object.prototype.toString"),PQ="[object Date]",BQ=Cy(),TQ=function(n){return typeof n!="object"||n===null?!1:BQ?SQ(n):EQ(n)===PQ},HC=G_,GC=xk,WC=jk,jC=Jk,qC=_Q,KC=TQ,ZC=Date.prototype.getTime;function $C(t,n,e){var i=e||{};return(i.strict?WC(t,n):t===n)?!0:!t||!n||typeof t!="object"&&typeof n!="object"?i.strict?WC(t,n):t==n:IQ(t,n,i)}function XC(t){return t==null}function YC(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 IQ(t,n,e){var i,o;if(typeof t!=typeof n||XC(t)||XC(n)||t.prototype!==n.prototype||GC(t)!==GC(n))return!1;var r=jC(t),a=jC(n);if(r!==a)return!1;if(r||a)return t.source===n.source&&qC(t)===qC(n);if(KC(t)&&KC(n))return ZC.call(t)===ZC.call(n);var s=YC(t),l=YC(n);if(s!==l)return!1;if(s||l){if(t.length!==n.length)return!1;for(i=0;i<t.length;i++)if(t[i]!==n[i])return!1;return!0}if(typeof t!=typeof n)return!1;try{var u=HC(t),A=HC(n)}catch{return!1}if(u.length!==A.length)return!1;for(u.sort(),A.sort(),i=u.length-1;i>=0;i--)if(u[i]!=A[i])return!1;for(i=u.length-1;i>=0;i--)if(o=u[i],!$C(t[o],n[o],e))return!1;return!0}var FQ=$C;function MQ(t,n){var e=!0;return rr(t,function(i){rr(n,function(o){if(e===!1)return!1;e=DQ(i.geometry,o.geometry)})}),e}function DQ(t,n){switch(t.type){case"Point":switch(n.type){case"Point":return!LQ(t.coordinates,n.coordinates);case"LineString":return!JC(n,t);case"Polygon":return!hn(t,n)}break;case"LineString":switch(n.type){case"Point":return!JC(t,n);case"LineString":return!RQ(t,n);case"Polygon":return!eS(n,t)}break;case"Polygon":switch(n.type){case"Point":return!hn(n,t);case"LineString":return!eS(t,n);case"Polygon":return!UQ(n,t)}}return!1}function JC(t,n){for(var e=0;e<t.coordinates.length-1;e++)if(OQ(t.coordinates[e],t.coordinates[e+1],n.coordinates))return!0;return!1}function RQ(t,n){var e=by(t,n);return e.features.length>0}function eS(t,n){for(var e=0,i=n.coordinates;e<i.length;e++){var o=i[e];if(hn(o,t))return!0}var r=by(n,xy(t));return r.features.length>0}function UQ(t,n){for(var e=0,i=t.coordinates[0];e<i.length;e++){var o=i[e];if(hn(o,n))return!0}for(var r=0,a=n.coordinates[0];r<a.length;r++){var s=a[r];if(hn(s,t))return!0}var l=by(xy(t),xy(n));return l.features.length>0}function OQ(t,n,e){var i=e[0]-t[0],o=e[1]-t[1],r=n[0]-t[0],a=n[1]-t[1],s=i*a-o*r;return s!==0?!1:Math.abs(r)>=Math.abs(a)?r>0?t[0]<=e[0]&&e[0]<=n[0]:n[0]<=e[0]&&e[0]<=t[0]:a>0?t[1]<=e[1]&&e[1]<=n[1]:n[1]<=e[1]&&e[1]<=t[1]}function LQ(t,n){return t[0]===n[0]&&t[1]===n[1]}var zQ=FQ,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:kQ};Oi.prototype.compare=function(t,n){if(t.type!==n.type||!nS(t,n))return!1;switch(t.type){case"Point":return this.compareCoord(t.coordinates,n.coordinates);case"LineString":return this.compareLine(t.coordinates,n.coordinates,0,!1);case"Polygon":return this.comparePolygon(t,n);case"Feature":return this.compareFeature(t,n);default:if(t.type.indexOf("Multi")===0){var e=this,i=tS(t),o=tS(n);return i.every(function(r){return this.some(function(a){return e.compare(r,a)})},o)}}return!1};function tS(t){return t.coordinates.map(function(n){return{type:t.type.replace("Multi",""),coordinates:n}})}function nS(t,n){return t.hasOwnProperty("coordinates")?t.coordinates.length===n.coordinates.length:t.length===n.length}Oi.prototype.compareCoord=function(t,n){if(t.length!==n.length)return!1;for(var e=0;e<t.length;e++)if(t[e].toFixed(this.precision)!==n[e].toFixed(this.precision))return!1;return!0},Oi.prototype.compareLine=function(t,n,e,i){if(!nS(t,n))return!1;var o=this.pseudoNode?t:this.removePseudo(t),r=this.pseudoNode?n:this.removePseudo(n);if(!(i&&!this.compareCoord(o[0],r[0])&&(r=this.fixStartIndex(r,o),!r))){var a=this.compareCoord(o[e],r[e]);return this.direction||a?this.comparePath(o,r):this.compareCoord(o[e],r[r.length-(1+e)])?this.comparePath(o.slice().reverse(),r):!1}},Oi.prototype.fixStartIndex=function(t,n){for(var e,i=-1,o=0;o<t.length;o++)if(this.compareCoord(t[o],n[0])){i=o;break}return i>=0&&(e=[].concat(t.slice(i,t.length),t.slice(1,i+1))),e},Oi.prototype.comparePath=function(t,n){var e=this;return t.every(function(i,o){return e.compareCoord(i,this[o])},n)},Oi.prototype.comparePolygon=function(t,n){if(this.compareLine(t.coordinates[0],n.coordinates[0],1,!0)){var e=t.coordinates.slice(1,t.coordinates.length),i=n.coordinates.slice(1,n.coordinates.length),o=this;return e.every(function(r){return this.some(function(a){return o.compareLine(r,a,1,!0)})},i)}else return!1},Oi.prototype.compareFeature=function(t,n){return t.id!==n.id||!this.objectComparator(t.properties,n.properties)||!this.compareBBox(t,n)?!1:this.compare(t.geometry,n.geometry)},Oi.prototype.compareBBox=function(t,n){return!!(!t.bbox&&!n.bbox||t.bbox&&n.bbox&&this.compareCoord(t.bbox,n.bbox))},Oi.prototype.removePseudo=function(t){return t};function kQ(t,n){return zQ(t,n,{strict:!0})}var QQ=Oi;const VQ=Il(QQ);function NQ(t,n){var e=Fi(t).type,i=Fi(n).type;if(e!==i)return!1;var o=new VQ({precision:6});return o.compare(b_(t),b_(n))}function HQ(t,n){var e=!1;return rr(t,function(i){rr(n,function(o){if(e===!0)return!0;e=!MQ(i.geometry,o.geometry)})}),e}/**
3709
3709
  * splaytree v3.1.2
3710
3710
  * Fast Splay tree for Node and browser
3711
3711
  *
@@ -3725,8 +3725,8 @@ function (result, this, instanceIndex, frameState) {
3725
3725
 
3726
3726
  See the Apache Version 2.0 License for specific language governing permissions
3727
3727
  and limitations under the License.
3728
- ***************************************************************************** */function HQ(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(A){return l([u,A])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return 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(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1],r=u;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(u);break}r[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(A){u=[6,A],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Jr=function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t}();function GQ(t,n){return t>n?1:t<n?-1:0}function eo(t,n,e){for(var i=new Jr(null,null),o=i,r=i;;){var a=e(t,n.key);if(a<0){if(n.left===null)break;if(e(t,n.left.key)<0){var s=n.left;if(n.left=s.right,s.right=n,n=s,n.left===null)break}r.left=n,r=n,n=n.left}else if(a>0){if(n.right===null)break;if(e(t,n.right.key)>0){var s=n.right;if(n.right=s.left,s.left=n,n=s,n.right===null)break}o.right=n,o=n,n=n.right}else break}return o.right=n.left,r.left=n.right,n.left=i.right,n.right=i.left,n}function ky(t,n,e,i){var o=new Jr(t,n);if(e===null)return o.left=o.right=null,o;e=eo(t,e,i);var r=i(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function iS(t,n,e){var i=null,o=null;if(n){n=eo(t,n,e);var r=e(n.key,t);r===0?(i=n.left,o=n.right):r<0?(o=n.right,n.right=null,i=n):(i=n.left,n.left=null,o=n)}return{left:i,right:o}}function WQ(t,n,e){return n===null?t:(t===null||(n=eo(t.key,n,e),n.left=t),n)}function Qy(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
3729
- `);var r=n+(e?" ":"│ ");t.left&&Qy(t.left,r,!1,i,o),t.right&&Qy(t.right,r,!0,i,o)}}var Vy=function(){function t(n){n===void 0&&(n=GQ),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=ky(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new Jr(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=eo(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=eo(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=eo(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=eo(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=eo(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},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(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return qQ(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&Gy(n,e,0,o-1,r),this._root===null)this._root=Ny(n,e,0,o),this._size=o;else{var a=KQ(this.toList(),jQ(n,e),r);o=this._size+o,this._root=Hy({head:a},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(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return Qy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=iS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=ky(e,i,s,o):a=ky(e,i,a,o),this._root=WQ(a,s,o)},t.prototype.split=function(n){return iS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return HQ(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Ny(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new Jr(a,s);return l.left=Ny(t,n,e,r),l.right=Ny(t,n,r+1,i),l}return null}function jQ(t,n){for(var e=new Jr(null,null),i=e,o=0;o<t.length;o++)i=i.next=new Jr(t[o],n[o]);return i.next=null,e.next}function qQ(t){for(var n=t,e=[],i=!1,o=new Jr(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Hy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Hy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Hy(t,o+1,e),a}return null}function KQ(t,n,e){for(var i=new Jr(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function Gy(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}Gy(t,n,e,s,o),Gy(t,n,s+1,i,o)}}const ar=11102230246251565e-32,ln=134217729,ZQ=(3+8*ar)*ar;function Wy(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],h=0,f=0;A>u==A>-u?(r=u,u=n[++h]):(r=A,A=i[++f]);let d=0;if(h<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++h]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[d++]=s);h<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[d++]=s);for(;h<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h],r=a,s!==0&&(o[d++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[d++]=s);return(r!==0||d===0)&&(o[d++]=r),d}function $Q(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function fu(t){return new Float64Array(t)}const XQ=(3+16*ar)*ar,YQ=(2+12*ar)*ar,JQ=(9+64*ar)*ar*ar,Fa=fu(4),rS=fu(8),oS=fu(12),sS=fu(16),An=fu(4);function e8(t,n,e,i,o,r,a){let s,l,u,A,h,f,d,p,g,v,y,m,b,x,E,B,P,I;const M=t-o,F=e-o,S=n-r,T=i-r;x=M*T,f=ln*M,d=f-(f-M),p=M-d,f=ln*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=S*F,f=ln*S,d=f-(f-S),p=S-d,f=ln*F,g=f-(f-F),v=F-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,Fa[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,Fa[1]=b-(y+h)+(h-B),I=m+y,h=I-m,Fa[2]=m-(I-h)+(y-h),Fa[3]=I;let w=$Q(4,Fa),C=YQ*a;if(w>=C||-w>=C||(h=t-M,s=t-(M+h)+(h-o),h=e-F,u=e-(F+h)+(h-o),h=n-S,l=n-(S+h)+(h-r),h=i-T,A=i-(T+h)+(h-r),s===0&&l===0&&u===0&&A===0)||(C=JQ*a+ZQ*Math.abs(w),w+=M*A+T*s-(S*u+F*l),w>=C||-w>=C))return w;x=s*T,f=ln*s,d=f-(f-s),p=s-d,f=ln*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=l*F,f=ln*l,d=f-(f-l),p=l-d,f=ln*F,g=f-(f-F),v=F-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,An[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,An[1]=b-(y+h)+(h-B),I=m+y,h=I-m,An[2]=m-(I-h)+(y-h),An[3]=I;const D=Wy(4,Fa,4,An,rS);x=M*A,f=ln*M,d=f-(f-M),p=M-d,f=ln*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=S*u,f=ln*S,d=f-(f-S),p=S-d,f=ln*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,An[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,An[1]=b-(y+h)+(h-B),I=m+y,h=I-m,An[2]=m-(I-h)+(y-h),An[3]=I;const R=Wy(D,rS,4,An,oS);x=s*A,f=ln*s,d=f-(f-s),p=s-d,f=ln*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=l*u,f=ln*l,d=f-(f-l),p=l-d,f=ln*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,An[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,An[1]=b-(y+h)+(h-B),I=m+y,h=I-m,An[2]=m-(I-h)+(y-h),An[3]=I;const U=Wy(R,oS,4,An,sS);return sS[U-1]}function pu(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=XQ*u?l:-e8(t,n,e,i,o,r,u)}const du=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,jy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let to=Number.EPSILON;to===void 0&&(to=Math.pow(2,-52));const t8=to*to,aS=(t,n)=>{if(-to<t&&t<to&&-to<n&&n<to)return 0;const e=t-n;return e*e<t8*t*n?0:t<n?-1:1};class n8{constructor(){this.reset()}reset(){this.xRounder=new lS,this.yRounder=new lS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class lS{constructor(){this.tree=new Vy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&aS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&aS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const mu=new n8,zf=(t,n)=>t.x*n.y-t.y*n.x,uS=(t,n)=>t.x*n.x+t.y*n.y,cS=(t,n,e)=>{const i=pu(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},kf=t=>Math.sqrt(uS(t,t)),i8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return zf(o,i)/kf(o)/kf(i)},r8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return uS(o,i)/kf(o)/kf(i)},hS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},AS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},o8=(t,n,e,i)=>{if(n.x===0)return AS(e,i,t.x);if(i.x===0)return AS(t,n,e.x);if(n.y===0)return hS(e,i,t.y);if(i.y===0)return hS(t,n,e.y);const o=zf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=zf(r,n)/o,s=zf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,h=e.y+a*i.y,f=(l+u)/2,d=(A+h)/2;return{x:f,y:d}};class Jn{static compare(n,e){const i=Jn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:no.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:i8(this.point,n.point,r.point),cosine:r8(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let s8=0;class no{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const h=n.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const h=e.comparePoint(n.leftSE.point);if(h!==0)return h;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const h=e.comparePoint(n.rightSE.point);if(h!==0)return h}if(r>a){const h=n.comparePoint(e.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(r!==a){const h=u-s,f=r-i,d=A-l,p=a-o;if(h>f&&d<p)return 1;if(h<f&&d>p)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++s8,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Jn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Jn(o,!0),u=new Jn(r,!1);return new no(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=jy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=du(e,s)&&this.comparePoint(s)===0,A=du(i,r)&&n.comparePoint(r)===0,h=du(e,l)&&this.comparePoint(l)===0,f=du(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!h?a:!f&&h?l:null;if(A)return h&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&h)return null;if(f)return a;if(h)return l;const d=o8(r,this.vector(),s,n.vector());return d===null||!du(o,d)?null:mu.round(d.x,d.y)}split(n){const e=[],i=n.events!==void 0,o=new Jn(n,!0),r=new Jn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new no(o,a,this.rings.slice(),this.windings.slice());return Jn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Jn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=no.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.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 n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],h=e.indexOf(u);h===-1?(e.push(u),i.push(A)):i[h]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const h=r.indexOf(u.poly);h!==-1&&r.splice(h,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].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 n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(fi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===fi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${fi.type}`)}return this._isInResult}}class fS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=mu.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=mu.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(no.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(no.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class a8{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new fS(n[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 i=1,o=n.length;i<o;i++){const r=new fS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class pS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}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 i=0,o=n.length;i<o;i++){const r=new a8(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Qf{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,h=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const g=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let d=null;for(let g=0,v=h.length;g<v;g++)if(h[g].point===s.point){d=g;break}if(d!==null){const g=h.splice(d)[0],v=u.splice(g.index);v.unshift(v[0].otherSE),e.push(new Qf(v.reverse()));continue}h.push({index:u.length,point:s.point});const p=s.getLeftmostComparator(a);l=f.sort(p)[0].otherSE;break}e.push(new Qf(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const h=this.events[u].point,f=this.events[u+1].point;cS(h,n,f)!==0&&(e.push(h),n=h)}if(e.length===1)return null;const i=e[0],o=e[1];cS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Jn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class dS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class l8{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new dS(r));else{const a=r.enclosingRing();a.poly||e.push(new dS(a)),a.poly.addInterior(r)}}return e}}class u8{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:no.compare;this.queue=n,this.tree=new Vy(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.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 r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const h=s.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(u=h),!s.isAnEndpoint(h))){const f=this._splitSafely(s,h);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}let A=null;if(l){const h=l.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(A=h),!l.isAnEndpoint(h))){const f=this._splitSafely(l,h);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}if(u!==null||A!==null){let h=null;u===null?h=A:A===null?h=u:h=Jn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(h);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const mS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,c8=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class h8{run(n,e,i){fi.type=n,mu.reset();const o=[new pS(e,!0)];for(let h=0,f=i.length;h<f;h++)o.push(new pS(i[h],!1));if(fi.numMultiPolys=o.length,fi.type==="difference"){const h=o[0];let f=1;for(;f<o.length;)jy(o[f].bbox,h.bbox)!==null?f++:o.splice(f,1)}if(fi.type==="intersection")for(let h=0,f=o.length;h<f;h++){const d=o[h];for(let p=h+1,g=o.length;p<g;p++)if(jy(d.bbox,o[p].bbox)===null)return[]}const r=new Vy(Jn.compare);for(let h=0,f=o.length;h<f;h++){const d=o[h].getSweepEvents();for(let p=0,g=d.length;p<g;p++)if(r.insert(d[p]),r.size>mS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new u8(r);let s=r.size,l=r.pop();for(;l;){const h=l.key;if(r.size===s){const d=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(r.size>mS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>c8)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(h);for(let d=0,p=f.length;d<p;d++){const g=f[d];g.consumedBy===void 0&&r.insert(g)}s=r.size,l=r.pop()}mu.reset();const u=Qf.factory(a.segments);return new l8(u).getGeom()}}const fi=new h8;var A8={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("difference",t,e)}};function Vf(t,n,e){e===void 0&&(e={});var i=Fi(t),o=Fi(n),r=A8.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?kt(r[0],e.properties):ly(r,e.properties)}function f8(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Mi([o,l],[a,l],e),h=A*(a-o),f=n*2/Mi([u,r],[u,s],e),d=f*(s-r),p=h/2,g=p*2,v=Math.sqrt(3)/2*d,y=a-o,m=s-r,b=3/4*g,x=v,E=(y-g)/(g-p/2),B=Math.floor(E),P=(B*b-p/2-y)/2-p/2+b/2,I=Math.floor((m-v)/v),M=(m-I*v)/2,F=I*v-m>v/2;F&&(M-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var D=[],R=0;R<=B;R++)for(var U=0;U<=I;U++){var O=R%2===1;if(!(U===0&&O)&&!(U===0&&F)){var z=R*b+o-P,k=U*x+r+M;if(O&&(k-=v/2),e.triangles===!0)d8([z,k],h/2,d/2,JSON.parse(i),S,T).forEach(function(N){e.mask?Vf(e.mask,N)&&D.push(N):D.push(N)});else{var Q=p8([z,k],h/2,d/2,JSON.parse(i),S,T);e.mask?Vf(e.mask,Q)&&D.push(Q):D.push(Q)}}}return En(D)}function p8(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),kt([a],i)}function d8(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(kt([l],i))}return a}function m8(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Mi([r,a],[s,a],i),A=u*(s-r),h=e/Mi([r,a],[r,l],i),f=h*(l-a),d=s-r,p=l-a,g=Math.floor(d/A),v=Math.floor(p/f),y=(d-g*A)/2,m=(p-v*f)/2,b=r+y,x=0;x<g;x++){for(var E=a+m,B=0;B<v;B++){var P=kt([[[b,E],[b,E+f],[b+A,E+f],[b+A,E],[b,E]]],i.properties);i.mask?NQ(i.mask,P)&&o.push(P):o.push(P),E+=f}b+=A}return En(o)}function g8(t,n,e){return e===void 0&&(e={}),m8(t,n,n,e)}function y8(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Mi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Mi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,h=t[1];h<=t[3];){var f=null,d=null;l%2===0&&A%2===0?(f=kt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),d=kt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)):l%2===0&&A%2===1?(f=kt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties),d=kt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties)):A%2===0&&l%2===1?(f=kt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties),d=kt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties)):A%2===1&&l%2===1&&(f=kt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),d=kt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)),e.mask?(Vf(e.mask,f)&&i.push(f),Vf(e.mask,d)&&i.push(d)):(i.push(f),i.push(d)),h+=s,A++}l++,u+=r}return En(i)}function v8(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(kL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=es(t),s;switch(i){case"point":case"points":s=L_(a,n,e);break;case"square":case"squares":s=g8(a,n,e);break;case"hex":case"hexes":s=f8(a,n,e);break;case"triangle":case"triangles":s=y8(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return ya(s,function(u){var A=0,h=0;ya(t,function(d){var p=i==="point"?u:Cz(u),g=Mi(p,d,e),v;if(o!==void 0&&(v=d.properties[o]),v===void 0&&(v=d.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(A=v);var y=1/Math.pow(g,r);h+=y,A+=y*v});var f=xz(u);f.properties[o]=A/h,l.push(f)}),En(l)}function w8(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const gS=(t=0)=>new Promise(n=>setTimeout(n,t));function b8(t,n){const e=En(t.map(l=>Zt(l))),i=kt([t]);return v8(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>hn(Zt(l),i))}function x8(t){const n=_.JulianDate.fromDate(t),e=_.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return $a(e)}function _8(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const Nc=class Nc extends Un{constructor(e,i){super(e,i);L(this,"czmPointPrimitiveCollection");L(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Ro(i,e.id));this.czmPointPrimitiveCollection=r,this.d(c.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],A=e.sampleDistance,h=b8(u,A).map(b=>[...b,e.height]),f=Math.floor(e.extrudedHeight/A);if(f>0){const b=[...h];for(let x=1;x<=f;x++)h.push(...b.map(E=>[E[0],E[1],e.height+x*A]))}const{startTime:d,endTime:p,spanTime:g}=e,v=g*36e5,y=Math.floor((p-d)/v),m=Array(h.length).fill(0);e:for(let b=0;b<y;b++){if(await gS(),this._stopRun)break e;const x=new Date(d+b*v),E=x8(x);t:for(let B=0;B<h.length;B++){if(await gS(),this._stopRun)break t;w8(h[B],E,o.scene)||(m[B]=(m[B]*y+1)/y)}!this._stopRun&&(e.progress=Number(((b+1)/y*100).toFixed(2))),console.log("colorScalelist",m),l(h,m)}},s=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}));const l=(u,A)=>{const h=u.map((f,d)=>({position:[...f],color:_8(e.startColor,e.endColor,A[d]),pixelSize:10}));r.pointPrimitiveOptions=h}}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};L(Nc,"type",Nc.register("ESCesiumViewer",c.ESSunshineAnalysis.type,Nc));let qy=Nc;const yS=Math.pow(2,-52),Nf=new Uint32Array(512);class Ky{static from(n,e=B8,i=T8){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new Ky(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let M=0;M<a;M++){const F=n[2*M],S=n[2*M+1];F<s&&(s=F),S<l&&(l=S),F>u&&(u=F),S>A&&(A=S),this._ids[M]=M}const h=(s+u)/2,f=(l+A)/2;let d,p,g;for(let M=0,F=1/0;M<a;M++){const S=Zy(h,f,n[2*M],n[2*M+1]);S<F&&(d=M,F=S)}const v=n[2*d],y=n[2*d+1];for(let M=0,F=1/0;M<a;M++){if(M===d)continue;const S=Zy(v,y,n[2*M],n[2*M+1]);S<F&&S>0&&(p=M,F=S)}let m=n[2*p],b=n[2*p+1],x=1/0;for(let M=0;M<a;M++){if(M===d||M===p)continue;const F=E8(v,y,m,b,n[2*M],n[2*M+1]);F<x&&(g=M,x=F)}let E=n[2*g],B=n[2*g+1];if(x===1/0){for(let S=0;S<a;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];Ma(this._ids,this._dists,0,a-1);const M=new Uint32Array(a);let F=0;for(let S=0,T=-1/0;S<a;S++){const w=this._ids[S],C=this._dists[w];C>T&&(M[F++]=w,T=C)}this.hull=M.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(pu(v,y,m,b,E,B)<0){const M=p,F=m,S=b;p=g,m=E,b=B,g=M,E=F,B=S}const P=P8(v,y,m,b,E,B);this._cx=P.x,this._cy=P.y;for(let M=0;M<a;M++)this._dists[M]=Zy(n[2*M],n[2*M+1],P.x,P.y);Ma(this._ids,this._dists,0,a-1),this._hullStart=d;let I=3;i[d]=e[g]=p,i[p]=e[d]=g,i[g]=e[p]=d,o[d]=0,o[p]=1,o[g]=2,r.fill(-1),r[this._hashKey(v,y)]=d,r[this._hashKey(m,b)]=p,r[this._hashKey(E,B)]=g,this.trianglesLen=0,this._addTriangle(d,p,g,-1,-1,-1);for(let M=0,F,S;M<this._ids.length;M++){const T=this._ids[M],w=n[2*T],C=n[2*T+1];if(M>0&&Math.abs(w-F)<=yS&&Math.abs(C-S)<=yS||(F=w,S=C,T===d||T===p||T===g))continue;let D=0;for(let k=0,Q=this._hashKey(w,C);k<this._hashSize&&(D=r[(Q+k)%this._hashSize],!(D!==-1&&D!==i[D]));k++);D=e[D];let R=D,U;for(;U=i[R],pu(w,C,n[2*R],n[2*R+1],n[2*U],n[2*U+1])>=0;)if(R=U,R===D){R=-1;break}if(R===-1)continue;let O=this._addTriangle(R,T,i[R],-1,-1,o[R]);o[T]=this._legalize(O+2),o[R]=O,I++;let z=i[R];for(;U=i[z],pu(w,C,n[2*z],n[2*z+1],n[2*U],n[2*U+1])<0;)O=this._addTriangle(z,T,U,o[T],-1,o[z]),o[T]=this._legalize(O+2),i[z]=z,I--,z=U;if(R===D)for(;U=e[R],pu(w,C,n[2*U],n[2*U+1],n[2*R],n[2*R+1])<0;)O=this._addTriangle(U,T,R,-1,o[R],o[U]),this._legalize(O+2),o[U]=O,i[R]=R,I--,R=U;this._hullStart=e[T]=R,i[R]=e[z]=T,i[T]=z,r[this._hashKey(w,C)]=T,r[this._hashKey(n[2*R],n[2*R+1])]=R}this.hull=new Uint32Array(I);for(let M=0,F=this._hullStart;M<I;M++)this.hull[M]=F,F=i[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(C8(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=Nf[--r];continue}const u=s-s%3,A=l+(n+1)%3,h=u+(s+2)%3,f=e[a],d=e[n],p=e[A],g=e[h];if(S8(o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*p],o[2*p+1],o[2*g],o[2*g+1])){e[n]=g,e[s]=f;const y=i[h];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===h){this._hullTri[b]=n;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,h);const m=u+(s+1)%3;r<Nf.length&&(Nf[r++]=m)}else{if(r===0)break;n=Nf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function C8(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function Zy(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function S8(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,h=i-s,f=o-a,d=r-s,p=l*l+u*u,g=A*A+h*h,v=f*f+d*d;return l*(h*v-g*d)-u*(A*v-g*f)+p*(A*d-h*f)<0}function E8(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),d=(u*A-s*h)*f,p=(a*h-l*A)*f;return d*d+p*p}function P8(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),d=t+(u*A-s*h)*f,p=n+(a*h-l*A)*f;return{x:d,y:p}}function Ma(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;gu(t,o,r),n[t[e]]>n[t[i]]&&gu(t,e,i),n[t[r]]>n[t[i]]&&gu(t,r,i),n[t[e]]>n[t[r]]&&gu(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;gu(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(Ma(t,n,r,i),Ma(t,n,e,a-1)):(Ma(t,n,e,a-1),Ma(t,n,r,i))}}function gu(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function B8(t){return t[0]}function T8(t){return t[1]}const vS=(t=0)=>new Promise(n=>setTimeout(n,t)),hs=class hs extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_startEvent",this.disposeVar(new c.Event));L(this,"_stopEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolyline");L(this,"_customPrimitive");L(this,"_geoDivPoi");L(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ye(e,i)),this._customPrimitive=this.disposeVar(new at(e,i)),this._geoDivPoi=this.disposeVar(new wt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Gi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),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=`
3728
+ ***************************************************************************** */function GQ(t,n){var e={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,o,r,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(u){return function(A){return l([u,A])}}function l(u){if(i)throw new TypeError("Generator is already executing.");for(;e;)try{if(i=1,o&&(r=u[0]&2?o.return:u[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,u[1])).done)return r;switch(o=0,r&&(u=[u[0]&2,r.value]),u[0]){case 0:case 1:r=u;break;case 4:return 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(r=e.trys,!(r=r.length>0&&r[r.length-1])&&(u[0]===6||u[0]===2)){e=0;continue}if(u[0]===3&&(!r||u[1]>r[0]&&u[1]<r[3])){e.label=u[1];break}if(u[0]===6&&e.label<r[1]){e.label=r[1],r=u;break}if(r&&e.label<r[2]){e.label=r[2],e.ops.push(u);break}r[2]&&e.ops.pop(),e.trys.pop();continue}u=n.call(t,e)}catch(A){u=[6,A],o=0}finally{i=r=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}var Jr=function(){function t(n,e){this.next=null,this.key=n,this.data=e,this.left=null,this.right=null}return t}();function WQ(t,n){return t>n?1:t<n?-1:0}function eo(t,n,e){for(var i=new Jr(null,null),o=i,r=i;;){var a=e(t,n.key);if(a<0){if(n.left===null)break;if(e(t,n.left.key)<0){var s=n.left;if(n.left=s.right,s.right=n,n=s,n.left===null)break}r.left=n,r=n,n=n.left}else if(a>0){if(n.right===null)break;if(e(t,n.right.key)>0){var s=n.right;if(n.right=s.left,s.left=n,n=s,n.right===null)break}o.right=n,o=n,n=n.right}else break}return o.right=n.left,r.left=n.right,n.left=i.right,n.right=i.left,n}function ky(t,n,e,i){var o=new Jr(t,n);if(e===null)return o.left=o.right=null,o;e=eo(t,e,i);var r=i(t,e.key);return r<0?(o.left=e.left,o.right=e,e.left=null):r>=0&&(o.right=e.right,o.left=e,e.right=null),o}function iS(t,n,e){var i=null,o=null;if(n){n=eo(t,n,e);var r=e(n.key,t);r===0?(i=n.left,o=n.right):r<0?(o=n.right,n.right=null,i=n):(i=n.left,n.left=null,o=n)}return{left:i,right:o}}function jQ(t,n,e){return n===null?t:(t===null||(n=eo(t.key,n,e),n.left=t),n)}function Qy(t,n,e,i,o){if(t){i(""+n+(e?"└── ":"├── ")+o(t)+`
3729
+ `);var r=n+(e?" ":"│ ");t.left&&Qy(t.left,r,!1,i,o),t.right&&Qy(t.right,r,!0,i,o)}}var Vy=function(){function t(n){n===void 0&&(n=WQ),this._root=null,this._size=0,this._comparator=n}return t.prototype.insert=function(n,e){return this._size++,this._root=ky(n,e,this._root,this._comparator)},t.prototype.add=function(n,e){var i=new Jr(n,e);this._root===null&&(i.left=i.right=null,this._size++,this._root=i);var o=this._comparator,r=eo(n,this._root,o),a=o(n,r.key);return a===0?this._root=r:(a<0?(i.left=r.left,i.right=r,r.left=null):a>0&&(i.right=r.right,i.left=r,r.right=null),this._size++,this._root=i),this._root},t.prototype.remove=function(n){this._root=this._remove(n,this._root,this._comparator)},t.prototype._remove=function(n,e,i){var o;if(e===null)return null;e=eo(n,e,i);var r=i(n,e.key);return r===0?(e.left===null?o=e.right:(o=eo(n,e.left,i),o.right=e.right),this._size--,o):e},t.prototype.pop=function(){var n=this._root;if(n){for(;n.left;)n=n.left;return this._root=eo(n.key,this._root,this._comparator),this._root=this._remove(n.key,this._root,this._comparator),{key:n.key,data:n.data}}return null},t.prototype.findStatic=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return e;o<0?e=e.left:e=e.right}return null},t.prototype.find=function(n){return this._root&&(this._root=eo(n,this._root,this._comparator),this._comparator(n,this._root.key)!==0)?null:this._root},t.prototype.contains=function(n){for(var e=this._root,i=this._comparator;e;){var o=i(n,e.key);if(o===0)return!0;o<0?e=e.left:e=e.right}return!1},t.prototype.forEach=function(n,e){for(var i=this._root,o=[],r=!1;!r;)i!==null?(o.push(i),i=i.left):o.length!==0?(i=o.pop(),n.call(e,i),i=i.right):r=!0;return this},t.prototype.range=function(n,e,i,o){for(var r=[],a=this._comparator,s=this._root,l;r.length!==0||s;)if(s)r.push(s),s=s.left;else{if(s=r.pop(),l=a(s.key,e),l>0)break;if(a(s.key,n)>=0&&i.call(o,s))return this;s=s.right}return this},t.prototype.keys=function(){var n=[];return this.forEach(function(e){var i=e.key;return n.push(i)}),n},t.prototype.values=function(){var n=[];return this.forEach(function(e){var i=e.data;return n.push(i)}),n},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(n){if(n===void 0&&(n=this._root),n)for(;n.left;)n=n.left;return n},t.prototype.maxNode=function(n){if(n===void 0&&(n=this._root),n)for(;n.right;)n=n.right;return n},t.prototype.at=function(n){for(var e=this._root,i=!1,o=0,r=[];!i;)if(e)r.push(e),e=e.left;else if(r.length>0){if(e=r.pop(),o===n)return e;o++,e=e.right}else i=!0;return null},t.prototype.next=function(n){var e=this._root,i=null;if(n.right){for(i=n.right;i.left;)i=i.left;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?(i=e,e=e.left):e=e.right}return i},t.prototype.prev=function(n){var e=this._root,i=null;if(n.left!==null){for(i=n.left;i.right;)i=i.right;return i}for(var o=this._comparator;e;){var r=o(n.key,e.key);if(r===0)break;r<0?e=e.left:(i=e,e=e.right)}return i},t.prototype.clear=function(){return this._root=null,this._size=0,this},t.prototype.toList=function(){return KQ(this._root)},t.prototype.load=function(n,e,i){e===void 0&&(e=[]),i===void 0&&(i=!1);var o=n.length,r=this._comparator;if(i&&Gy(n,e,0,o-1,r),this._root===null)this._root=Ny(n,e,0,o),this._size=o;else{var a=ZQ(this.toList(),qQ(n,e),r);o=this._size+o,this._root=Hy({head:a},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(n){n===void 0&&(n=function(i){return String(i.key)});var e=[];return Qy(this._root,"",!0,function(i){return e.push(i)},n),e.join("")},t.prototype.update=function(n,e,i){var o=this._comparator,r=iS(n,this._root,o),a=r.left,s=r.right;o(n,e)<0?s=ky(e,i,s,o):a=ky(e,i,a,o),this._root=jQ(a,s,o)},t.prototype.split=function(n){return iS(n,this._root,this._comparator)},t.prototype[Symbol.iterator]=function(){var n,e,i;return GQ(this,function(o){switch(o.label){case 0:n=this._root,e=[],i=!1,o.label=1;case 1:return i?[3,6]:n===null?[3,2]:(e.push(n),n=n.left,[3,5]);case 2:return e.length===0?[3,4]:(n=e.pop(),[4,n]);case 3:return o.sent(),n=n.right,[3,5];case 4:i=!0,o.label=5;case 5:return[3,1];case 6:return[2]}})},t}();function Ny(t,n,e,i){var o=i-e;if(o>0){var r=e+Math.floor(o/2),a=t[r],s=n[r],l=new Jr(a,s);return l.left=Ny(t,n,e,r),l.right=Ny(t,n,r+1,i),l}return null}function qQ(t,n){for(var e=new Jr(null,null),i=e,o=0;o<t.length;o++)i=i.next=new Jr(t[o],n[o]);return i.next=null,e.next}function KQ(t){for(var n=t,e=[],i=!1,o=new Jr(null,null),r=o;!i;)n?(e.push(n),n=n.left):e.length>0?(n=r=r.next=e.pop(),n=n.right):i=!0;return r.next=null,o.next}function Hy(t,n,e){var i=e-n;if(i>0){var o=n+Math.floor(i/2),r=Hy(t,n,o),a=t.head;return a.left=r,t.head=t.head.next,a.right=Hy(t,o+1,e),a}return null}function ZQ(t,n,e){for(var i=new Jr(null,null),o=i,r=t,a=n;r!==null&&a!==null;)e(r.key,a.key)<0?(o.next=r,r=r.next):(o.next=a,a=a.next),o=o.next;return r!==null?o.next=r:a!==null&&(o.next=a),i.next}function Gy(t,n,e,i,o){if(!(e>=i)){for(var r=t[e+i>>1],a=e-1,s=i+1;;){do a++;while(o(t[a],r)<0);do s--;while(o(t[s],r)>0);if(a>=s)break;var l=t[a];t[a]=t[s],t[s]=l,l=n[a],n[a]=n[s],n[s]=l}Gy(t,n,e,s,o),Gy(t,n,s+1,i,o)}}const ar=11102230246251565e-32,ln=134217729,$Q=(3+8*ar)*ar;function Wy(t,n,e,i,o){let r,a,s,l,u=n[0],A=i[0],h=0,f=0;A>u==A>-u?(r=u,u=n[++h]):(r=A,A=i[++f]);let d=0;if(h<t&&f<e)for(A>u==A>-u?(a=u+r,s=r-(a-u),u=n[++h]):(a=A+r,s=r-(a-A),A=i[++f]),r=a,s!==0&&(o[d++]=s);h<t&&f<e;)A>u==A>-u?(a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h]):(a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f]),r=a,s!==0&&(o[d++]=s);for(;h<t;)a=r+u,l=a-r,s=r-(a-l)+(u-l),u=n[++h],r=a,s!==0&&(o[d++]=s);for(;f<e;)a=r+A,l=a-r,s=r-(a-l)+(A-l),A=i[++f],r=a,s!==0&&(o[d++]=s);return(r!==0||d===0)&&(o[d++]=r),d}function XQ(t,n){let e=n[0];for(let i=1;i<t;i++)e+=n[i];return e}function fu(t){return new Float64Array(t)}const YQ=(3+16*ar)*ar,JQ=(2+12*ar)*ar,e8=(9+64*ar)*ar*ar,Fa=fu(4),rS=fu(8),oS=fu(12),sS=fu(16),An=fu(4);function t8(t,n,e,i,o,r,a){let s,l,u,A,h,f,d,p,g,v,y,m,b,x,E,B,P,I;const M=t-o,F=e-o,S=n-r,T=i-r;x=M*T,f=ln*M,d=f-(f-M),p=M-d,f=ln*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=S*F,f=ln*S,d=f-(f-S),p=S-d,f=ln*F,g=f-(f-F),v=F-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,Fa[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,Fa[1]=b-(y+h)+(h-B),I=m+y,h=I-m,Fa[2]=m-(I-h)+(y-h),Fa[3]=I;let w=XQ(4,Fa),C=JQ*a;if(w>=C||-w>=C||(h=t-M,s=t-(M+h)+(h-o),h=e-F,u=e-(F+h)+(h-o),h=n-S,l=n-(S+h)+(h-r),h=i-T,A=i-(T+h)+(h-r),s===0&&l===0&&u===0&&A===0)||(C=e8*a+$Q*Math.abs(w),w+=M*A+T*s-(S*u+F*l),w>=C||-w>=C))return w;x=s*T,f=ln*s,d=f-(f-s),p=s-d,f=ln*T,g=f-(f-T),v=T-g,E=p*v-(x-d*g-p*g-d*v),B=l*F,f=ln*l,d=f-(f-l),p=l-d,f=ln*F,g=f-(f-F),v=F-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,An[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,An[1]=b-(y+h)+(h-B),I=m+y,h=I-m,An[2]=m-(I-h)+(y-h),An[3]=I;const D=Wy(4,Fa,4,An,rS);x=M*A,f=ln*M,d=f-(f-M),p=M-d,f=ln*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=S*u,f=ln*S,d=f-(f-S),p=S-d,f=ln*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,An[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,An[1]=b-(y+h)+(h-B),I=m+y,h=I-m,An[2]=m-(I-h)+(y-h),An[3]=I;const R=Wy(D,rS,4,An,oS);x=s*A,f=ln*s,d=f-(f-s),p=s-d,f=ln*A,g=f-(f-A),v=A-g,E=p*v-(x-d*g-p*g-d*v),B=l*u,f=ln*l,d=f-(f-l),p=l-d,f=ln*u,g=f-(f-u),v=u-g,P=p*v-(B-d*g-p*g-d*v),y=E-P,h=E-y,An[0]=E-(y+h)+(h-P),m=x+y,h=m-x,b=x-(m-h)+(y-h),y=b-B,h=b-y,An[1]=b-(y+h)+(h-B),I=m+y,h=I-m,An[2]=m-(I-h)+(y-h),An[3]=I;const U=Wy(R,oS,4,An,sS);return sS[U-1]}function pu(t,n,e,i,o,r){const a=(n-r)*(e-o),s=(t-o)*(i-r),l=a-s,u=Math.abs(a+s);return Math.abs(l)>=YQ*u?l:-t8(t,n,e,i,o,r,u)}const du=(t,n)=>t.ll.x<=n.x&&n.x<=t.ur.x&&t.ll.y<=n.y&&n.y<=t.ur.y,jy=(t,n)=>{if(n.ur.x<t.ll.x||t.ur.x<n.ll.x||n.ur.y<t.ll.y||t.ur.y<n.ll.y)return null;const e=t.ll.x<n.ll.x?n.ll.x:t.ll.x,i=t.ur.x<n.ur.x?t.ur.x:n.ur.x,o=t.ll.y<n.ll.y?n.ll.y:t.ll.y,r=t.ur.y<n.ur.y?t.ur.y:n.ur.y;return{ll:{x:e,y:o},ur:{x:i,y:r}}};let to=Number.EPSILON;to===void 0&&(to=Math.pow(2,-52));const n8=to*to,aS=(t,n)=>{if(-to<t&&t<to&&-to<n&&n<to)return 0;const e=t-n;return e*e<n8*t*n?0:t<n?-1:1};class i8{constructor(){this.reset()}reset(){this.xRounder=new lS,this.yRounder=new lS}round(n,e){return{x:this.xRounder.round(n),y:this.yRounder.round(e)}}}class lS{constructor(){this.tree=new Vy,this.round(0)}round(n){const e=this.tree.add(n),i=this.tree.prev(e);if(i!==null&&aS(e.key,i.key)===0)return this.tree.remove(n),i.key;const o=this.tree.next(e);return o!==null&&aS(e.key,o.key)===0?(this.tree.remove(n),o.key):n}}const mu=new i8,zf=(t,n)=>t.x*n.y-t.y*n.x,uS=(t,n)=>t.x*n.x+t.y*n.y,cS=(t,n,e)=>{const i=pu(t.x,t.y,n.x,n.y,e.x,e.y);return i>0?-1:i<0?1:0},kf=t=>Math.sqrt(uS(t,t)),r8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return zf(o,i)/kf(o)/kf(i)},o8=(t,n,e)=>{const i={x:n.x-t.x,y:n.y-t.y},o={x:e.x-t.x,y:e.y-t.y};return uS(o,i)/kf(o)/kf(i)},hS=(t,n,e)=>n.y===0?null:{x:t.x+n.x/n.y*(e-t.y),y:e},AS=(t,n,e)=>n.x===0?null:{x:e,y:t.y+n.y/n.x*(e-t.x)},s8=(t,n,e,i)=>{if(n.x===0)return AS(e,i,t.x);if(i.x===0)return AS(t,n,e.x);if(n.y===0)return hS(e,i,t.y);if(i.y===0)return hS(t,n,e.y);const o=zf(n,i);if(o==0)return null;const r={x:e.x-t.x,y:e.y-t.y},a=zf(r,n)/o,s=zf(r,i)/o,l=t.x+s*n.x,u=e.x+a*i.x,A=t.y+s*n.y,h=e.y+a*i.y,f=(l+u)/2,d=(A+h)/2;return{x:f,y:d}};class Jn{static compare(n,e){const i=Jn.comparePoints(n.point,e.point);return i!==0?i:(n.point!==e.point&&n.link(e),n.isLeft!==e.isLeft?n.isLeft?1:-1:no.compare(n.segment,e.segment))}static comparePoints(n,e){return n.x<e.x?-1:n.x>e.x?1:n.y<e.y?-1:n.y>e.y?1:0}constructor(n,e){n.events===void 0?n.events=[this]:n.events.push(this),this.point=n,this.isLeft=e}link(n){if(n.point===this.point)throw new Error("Tried to link already linked events");const e=n.point.events;for(let i=0,o=e.length;i<o;i++){const r=e[i];this.point.events.push(r),r.point=this.point}this.checkForConsuming()}checkForConsuming(){const n=this.point.events.length;for(let e=0;e<n;e++){const i=this.point.events[e];if(i.segment.consumedBy===void 0)for(let o=e+1;o<n;o++){const r=this.point.events[o];r.consumedBy===void 0&&i.otherSE.point.events===r.otherSE.point.events&&i.segment.consume(r.segment)}}}getAvailableLinkedEvents(){const n=[];for(let e=0,i=this.point.events.length;e<i;e++){const o=this.point.events[e];o!==this&&!o.segment.ringOut&&o.segment.isInResult()&&n.push(o)}return n}getLeftmostComparator(n){const e=new Map,i=o=>{const r=o.otherSE;e.set(o,{sine:r8(this.point,n.point,r.point),cosine:o8(this.point,n.point,r.point)})};return(o,r)=>{e.has(o)||i(o),e.has(r)||i(r);const{sine:a,cosine:s}=e.get(o),{sine:l,cosine:u}=e.get(r);return a>=0&&l>=0?s<u?1:s>u?-1:0:a<0&&l<0?s<u?-1:s>u?1:0:l<a?-1:l>a?1:0}}}let a8=0;class no{static compare(n,e){const i=n.leftSE.point.x,o=e.leftSE.point.x,r=n.rightSE.point.x,a=e.rightSE.point.x;if(a<i)return 1;if(r<o)return-1;const s=n.leftSE.point.y,l=e.leftSE.point.y,u=n.rightSE.point.y,A=e.rightSE.point.y;if(i<o){if(l<s&&l<u)return 1;if(l>s&&l>u)return-1;const h=n.comparePoint(e.leftSE.point);if(h<0)return 1;if(h>0)return-1;const f=e.comparePoint(n.rightSE.point);return f!==0?f:-1}if(i>o){if(s<l&&s<A)return-1;if(s>l&&s>A)return 1;const h=e.comparePoint(n.leftSE.point);if(h!==0)return h;const f=n.comparePoint(e.rightSE.point);return f<0?1:f>0?-1:1}if(s<l)return-1;if(s>l)return 1;if(r<a){const h=e.comparePoint(n.rightSE.point);if(h!==0)return h}if(r>a){const h=n.comparePoint(e.rightSE.point);if(h<0)return 1;if(h>0)return-1}if(r!==a){const h=u-s,f=r-i,d=A-l,p=a-o;if(h>f&&d<p)return 1;if(h<f&&d>p)return-1}return r>a?1:r<a||u<A?-1:u>A?1:n.id<e.id?-1:n.id>e.id?1:0}constructor(n,e,i,o){this.id=++a8,this.leftSE=n,n.segment=this,n.otherSE=e,this.rightSE=e,e.segment=this,e.otherSE=n,this.rings=i,this.windings=o}static fromRing(n,e,i){let o,r,a;const s=Jn.comparePoints(n,e);if(s<0)o=n,r=e,a=1;else if(s>0)o=e,r=n,a=-1;else throw new Error(`Tried to create degenerate segment at [${n.x}, ${n.y}]`);const l=new Jn(o,!0),u=new Jn(r,!1);return new no(l,u,[i],[a])}replaceRightSE(n){this.rightSE=n,this.rightSE.segment=this,this.rightSE.otherSE=this.leftSE,this.leftSE.otherSE=this.rightSE}bbox(){const n=this.leftSE.point.y,e=this.rightSE.point.y;return{ll:{x:this.leftSE.point.x,y:n<e?n:e},ur:{x:this.rightSE.point.x,y:n>e?n:e}}}vector(){return{x:this.rightSE.point.x-this.leftSE.point.x,y:this.rightSE.point.y-this.leftSE.point.y}}isAnEndpoint(n){return n.x===this.leftSE.point.x&&n.y===this.leftSE.point.y||n.x===this.rightSE.point.x&&n.y===this.rightSE.point.y}comparePoint(n){if(this.isAnEndpoint(n))return 0;const e=this.leftSE.point,i=this.rightSE.point,o=this.vector();if(e.x===i.x)return n.x===e.x?0:n.x<e.x?1:-1;const r=(n.y-e.y)/o.y,a=e.x+r*o.x;if(n.x===a)return 0;const s=(n.x-e.x)/o.x,l=e.y+s*o.y;return n.y===l?0:n.y<l?-1:1}getIntersection(n){const e=this.bbox(),i=n.bbox(),o=jy(e,i);if(o===null)return null;const r=this.leftSE.point,a=this.rightSE.point,s=n.leftSE.point,l=n.rightSE.point,u=du(e,s)&&this.comparePoint(s)===0,A=du(i,r)&&n.comparePoint(r)===0,h=du(e,l)&&this.comparePoint(l)===0,f=du(i,a)&&n.comparePoint(a)===0;if(A&&u)return f&&!h?a:!f&&h?l:null;if(A)return h&&r.x===l.x&&r.y===l.y?null:r;if(u)return f&&a.x===s.x&&a.y===s.y?null:s;if(f&&h)return null;if(f)return a;if(h)return l;const d=s8(r,this.vector(),s,n.vector());return d===null||!du(o,d)?null:mu.round(d.x,d.y)}split(n){const e=[],i=n.events!==void 0,o=new Jn(n,!0),r=new Jn(n,!1),a=this.rightSE;this.replaceRightSE(r),e.push(r),e.push(o);const s=new no(o,a,this.rings.slice(),this.windings.slice());return Jn.comparePoints(s.leftSE.point,s.rightSE.point)>0&&s.swapEvents(),Jn.comparePoints(this.leftSE.point,this.rightSE.point)>0&&this.swapEvents(),i&&(o.checkForConsuming(),r.checkForConsuming()),e}swapEvents(){const n=this.rightSE;this.rightSE=this.leftSE,this.leftSE=n,this.leftSE.isLeft=!0,this.rightSE.isLeft=!1;for(let e=0,i=this.windings.length;e<i;e++)this.windings[e]*=-1}consume(n){let e=this,i=n;for(;e.consumedBy;)e=e.consumedBy;for(;i.consumedBy;)i=i.consumedBy;const o=no.compare(e,i);if(o!==0){if(o>0){const r=e;e=i,i=r}if(e.prev===i){const r=e;e=i,i=r}for(let r=0,a=i.rings.length;r<a;r++){const s=i.rings[r],l=i.windings[r],u=e.rings.indexOf(s);u===-1?(e.rings.push(s),e.windings.push(l)):e.windings[u]+=l}i.rings=null,i.windings=null,i.consumedBy=e,i.leftSE.consumedBy=e.leftSE,i.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 n=this.prev.consumedBy||this.prev;this._beforeState=n.afterState()}return this._beforeState}afterState(){if(this._afterState!==void 0)return this._afterState;const n=this.beforeState();this._afterState={rings:n.rings.slice(0),windings:n.windings.slice(0),multiPolys:[]};const e=this._afterState.rings,i=this._afterState.windings,o=this._afterState.multiPolys;for(let s=0,l=this.rings.length;s<l;s++){const u=this.rings[s],A=this.windings[s],h=e.indexOf(u);h===-1?(e.push(u),i.push(A)):i[h]+=A}const r=[],a=[];for(let s=0,l=e.length;s<l;s++){if(i[s]===0)continue;const u=e[s],A=u.poly;if(a.indexOf(A)===-1)if(u.isExterior)r.push(A);else{a.indexOf(A)===-1&&a.push(A);const h=r.indexOf(u.poly);h!==-1&&r.splice(h,1)}}for(let s=0,l=r.length;s<l;s++){const u=r[s].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 n=this.beforeState().multiPolys,e=this.afterState().multiPolys;switch(fi.type){case"union":{const i=n.length===0,o=e.length===0;this._isInResult=i!==o;break}case"intersection":{let i,o;n.length<e.length?(i=n.length,o=e.length):(i=e.length,o=n.length),this._isInResult=o===fi.numMultiPolys&&i<o;break}case"xor":{const i=Math.abs(n.length-e.length);this._isInResult=i%2===1;break}case"difference":{const i=o=>o.length===1&&o[0].isSubject;this._isInResult=i(n)!==i(e);break}default:throw new Error(`Unrecognized operation type found ${fi.type}`)}return this._isInResult}}class fS{constructor(n,e,i){if(!Array.isArray(n)||n.length===0)throw new Error("Input geometry is not a valid Polygon or MultiPolygon");if(this.poly=e,this.isExterior=i,this.segments=[],typeof n[0][0]!="number"||typeof n[0][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");const o=mu.round(n[0][0],n[0][1]);this.bbox={ll:{x:o.x,y:o.y},ur:{x:o.x,y:o.y}};let r=o;for(let a=1,s=n.length;a<s;a++){if(typeof n[a][0]!="number"||typeof n[a][1]!="number")throw new Error("Input geometry is not a valid Polygon or MultiPolygon");let l=mu.round(n[a][0],n[a][1]);l.x===r.x&&l.y===r.y||(this.segments.push(no.fromRing(r,l,this)),l.x<this.bbox.ll.x&&(this.bbox.ll.x=l.x),l.y<this.bbox.ll.y&&(this.bbox.ll.y=l.y),l.x>this.bbox.ur.x&&(this.bbox.ur.x=l.x),l.y>this.bbox.ur.y&&(this.bbox.ur.y=l.y),r=l)}(o.x!==r.x||o.y!==r.y)&&this.segments.push(no.fromRing(r,o,this))}getSweepEvents(){const n=[];for(let e=0,i=this.segments.length;e<i;e++){const o=this.segments[e];n.push(o.leftSE),n.push(o.rightSE)}return n}}class l8{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");this.exteriorRing=new fS(n[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 i=1,o=n.length;i<o;i++){const r=new fS(n[i],this,!1);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.interiorRings.push(r)}this.multiPoly=e}getSweepEvents(){const n=this.exteriorRing.getSweepEvents();for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class pS{constructor(n,e){if(!Array.isArray(n))throw new Error("Input geometry is not a valid Polygon or MultiPolygon");try{typeof n[0][0][0]=="number"&&(n=[n])}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 i=0,o=n.length;i<o;i++){const r=new l8(n[i],this);r.bbox.ll.x<this.bbox.ll.x&&(this.bbox.ll.x=r.bbox.ll.x),r.bbox.ll.y<this.bbox.ll.y&&(this.bbox.ll.y=r.bbox.ll.y),r.bbox.ur.x>this.bbox.ur.x&&(this.bbox.ur.x=r.bbox.ur.x),r.bbox.ur.y>this.bbox.ur.y&&(this.bbox.ur.y=r.bbox.ur.y),this.polys.push(r)}this.isSubject=e}getSweepEvents(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getSweepEvents();for(let r=0,a=o.length;r<a;r++)n.push(o[r])}return n}}class Qf{static factory(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.isInResult()||r.ringOut)continue;let a=null,s=r.leftSE,l=r.rightSE;const u=[s],A=s.point,h=[];for(;a=s,s=l,u.push(s),s.point!==A;)for(;;){const f=s.getAvailableLinkedEvents();if(f.length===0){const g=u[0].point,v=u[u.length-1].point;throw new Error(`Unable to complete output ring starting at [${g.x}, ${g.y}]. Last matching segment found ends at [${v.x}, ${v.y}].`)}if(f.length===1){l=f[0].otherSE;break}let d=null;for(let g=0,v=h.length;g<v;g++)if(h[g].point===s.point){d=g;break}if(d!==null){const g=h.splice(d)[0],v=u.splice(g.index);v.unshift(v[0].otherSE),e.push(new Qf(v.reverse()));continue}h.push({index:u.length,point:s.point});const p=s.getLeftmostComparator(a);l=f.sort(p)[0].otherSE;break}e.push(new Qf(u))}return e}constructor(n){this.events=n;for(let e=0,i=n.length;e<i;e++)n[e].segment.ringOut=this;this.poly=null}getGeom(){let n=this.events[0].point;const e=[n];for(let u=1,A=this.events.length-1;u<A;u++){const h=this.events[u].point,f=this.events[u+1].point;cS(h,n,f)!==0&&(e.push(h),n=h)}if(e.length===1)return null;const i=e[0],o=e[1];cS(i,n,o)===0&&e.shift(),e.push(e[0]);const r=this.isExteriorRing()?1:-1,a=this.isExteriorRing()?0:e.length-1,s=this.isExteriorRing()?e.length:-1,l=[];for(let u=a;u!=s;u+=r)l.push([e[u].x,e[u].y]);return l}isExteriorRing(){if(this._isExteriorRing===void 0){const n=this.enclosingRing();this._isExteriorRing=n?!n.isExteriorRing():!0}return this._isExteriorRing}enclosingRing(){return this._enclosingRing===void 0&&(this._enclosingRing=this._calcEnclosingRing()),this._enclosingRing}_calcEnclosingRing(){let n=this.events[0];for(let o=1,r=this.events.length;o<r;o++){const a=this.events[o];Jn.compare(n,a)>0&&(n=a)}let e=n.segment.prevInResult(),i=e?e.prevInResult():null;for(;;){if(!e)return null;if(!i)return e.ringOut;if(i.ringOut!==e.ringOut)return i.ringOut.enclosingRing()!==e.ringOut?e.ringOut:e.ringOut.enclosingRing();e=i.prevInResult(),i=e?e.prevInResult():null}}}class dS{constructor(n){this.exteriorRing=n,n.poly=this,this.interiorRings=[]}addInterior(n){this.interiorRings.push(n),n.poly=this}getGeom(){const n=[this.exteriorRing.getGeom()];if(n[0]===null)return null;for(let e=0,i=this.interiorRings.length;e<i;e++){const o=this.interiorRings[e].getGeom();o!==null&&n.push(o)}return n}}class u8{constructor(n){this.rings=n,this.polys=this._composePolys(n)}getGeom(){const n=[];for(let e=0,i=this.polys.length;e<i;e++){const o=this.polys[e].getGeom();o!==null&&n.push(o)}return n}_composePolys(n){const e=[];for(let i=0,o=n.length;i<o;i++){const r=n[i];if(!r.poly)if(r.isExteriorRing())e.push(new dS(r));else{const a=r.enclosingRing();a.poly||e.push(new dS(a)),a.poly.addInterior(r)}}return e}}class c8{constructor(n){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:no.compare;this.queue=n,this.tree=new Vy(e),this.segments=[]}process(n){const e=n.segment,i=[];if(n.consumedBy)return n.isLeft?this.queue.remove(n.otherSE):this.tree.remove(e),i;const o=n.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 r=o,a=o,s,l;for(;s===void 0;)r=this.tree.prev(r),r===null?s=null:r.key.consumedBy===void 0&&(s=r.key);for(;l===void 0;)a=this.tree.next(a),a===null?l=null:a.key.consumedBy===void 0&&(l=a.key);if(n.isLeft){let u=null;if(s){const h=s.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(u=h),!s.isAnEndpoint(h))){const f=this._splitSafely(s,h);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}let A=null;if(l){const h=l.getIntersection(e);if(h!==null&&(e.isAnEndpoint(h)||(A=h),!l.isAnEndpoint(h))){const f=this._splitSafely(l,h);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}}if(u!==null||A!==null){let h=null;u===null?h=A:A===null?h=u:h=Jn.comparePoints(u,A)<=0?u:A,this.queue.remove(e.rightSE),i.push(e.rightSE);const f=e.split(h);for(let d=0,p=f.length;d<p;d++)i.push(f[d])}i.length>0?(this.tree.remove(e),i.push(n)):(this.segments.push(e),e.prev=s)}else{if(s&&l){const u=s.getIntersection(l);if(u!==null){if(!s.isAnEndpoint(u)){const A=this._splitSafely(s,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}if(!l.isAnEndpoint(u)){const A=this._splitSafely(l,u);for(let h=0,f=A.length;h<f;h++)i.push(A[h])}}}this.tree.remove(e)}return i}_splitSafely(n,e){this.tree.remove(n);const i=n.rightSE;this.queue.remove(i);const o=n.split(e);return o.push(i),n.consumedBy===void 0&&this.tree.add(n),o}}const mS=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_QUEUE_SIZE||1e6,h8=typeof process<"u"&&process.env.POLYGON_CLIPPING_MAX_SWEEPLINE_SEGMENTS||1e6;class A8{run(n,e,i){fi.type=n,mu.reset();const o=[new pS(e,!0)];for(let h=0,f=i.length;h<f;h++)o.push(new pS(i[h],!1));if(fi.numMultiPolys=o.length,fi.type==="difference"){const h=o[0];let f=1;for(;f<o.length;)jy(o[f].bbox,h.bbox)!==null?f++:o.splice(f,1)}if(fi.type==="intersection")for(let h=0,f=o.length;h<f;h++){const d=o[h];for(let p=h+1,g=o.length;p<g;p++)if(jy(d.bbox,o[p].bbox)===null)return[]}const r=new Vy(Jn.compare);for(let h=0,f=o.length;h<f;h++){const d=o[h].getSweepEvents();for(let p=0,g=d.length;p<g;p++)if(r.insert(d[p]),r.size>mS)throw new Error("Infinite loop when putting segment endpoints in a priority queue (queue size too big).")}const a=new c8(r);let s=r.size,l=r.pop();for(;l;){const h=l.key;if(r.size===s){const d=h.segment;throw new Error(`Unable to pop() ${h.isLeft?"left":"right"} SweepEvent [${h.point.x}, ${h.point.y}] from segment #${d.id} [${d.leftSE.point.x}, ${d.leftSE.point.y}] -> [${d.rightSE.point.x}, ${d.rightSE.point.y}] from queue.`)}if(r.size>mS)throw new Error("Infinite loop when passing sweep line over endpoints (queue size too big).");if(a.segments.length>h8)throw new Error("Infinite loop when passing sweep line over endpoints (too many sweep line segments).");const f=a.process(h);for(let d=0,p=f.length;d<p;d++){const g=f[d];g.consumedBy===void 0&&r.insert(g)}s=r.size,l=r.pop()}mu.reset();const u=Qf.factory(a.segments);return new u8(u).getGeom()}}const fi=new A8;var f8={union:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("union",t,e)},intersection:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("intersection",t,e)},xor:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("xor",t,e)},difference:function(t){for(var n=arguments.length,e=new Array(n>1?n-1:0),i=1;i<n;i++)e[i-1]=arguments[i];return fi.run("difference",t,e)}};function Vf(t,n,e){e===void 0&&(e={});var i=Fi(t),o=Fi(n),r=f8.intersection(i.coordinates,o.coordinates);return r.length===0?null:r.length===1?kt(r[0],e.properties):ly(r,e.properties)}function p8(t,n,e){e===void 0&&(e={});var i=JSON.stringify(e.properties||{}),o=t[0],r=t[1],a=t[2],s=t[3],l=(r+s)/2,u=(o+a)/2,A=n*2/Mi([o,l],[a,l],e),h=A*(a-o),f=n*2/Mi([u,r],[u,s],e),d=f*(s-r),p=h/2,g=p*2,v=Math.sqrt(3)/2*d,y=a-o,m=s-r,b=3/4*g,x=v,E=(y-g)/(g-p/2),B=Math.floor(E),P=(B*b-p/2-y)/2-p/2+b/2,I=Math.floor((m-v)/v),M=(m-I*v)/2,F=I*v-m>v/2;F&&(M-=v/4);for(var S=[],T=[],w=0;w<6;w++){var C=2*Math.PI/6*w;S.push(Math.cos(C)),T.push(Math.sin(C))}for(var D=[],R=0;R<=B;R++)for(var U=0;U<=I;U++){var O=R%2===1;if(!(U===0&&O)&&!(U===0&&F)){var z=R*b+o-P,k=U*x+r+M;if(O&&(k-=v/2),e.triangles===!0)m8([z,k],h/2,d/2,JSON.parse(i),S,T).forEach(function(N){e.mask?Vf(e.mask,N)&&D.push(N):D.push(N)});else{var Q=d8([z,k],h/2,d/2,JSON.parse(i),S,T);e.mask?Vf(e.mask,Q)&&D.push(Q):D.push(Q)}}}return En(D)}function d8(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=t[0]+n*o[s],u=t[1]+e*r[s];a.push([l,u])}return a.push(a[0].slice()),kt([a],i)}function m8(t,n,e,i,o,r){for(var a=[],s=0;s<6;s++){var l=[];l.push(t),l.push([t[0]+n*o[s],t[1]+e*r[s]]),l.push([t[0]+n*o[(s+1)%6],t[1]+e*r[(s+1)%6]]),l.push(t),a.push(kt([l],i))}return a}function g8(t,n,e,i){i===void 0&&(i={});for(var o=[],r=t[0],a=t[1],s=t[2],l=t[3],u=n/Mi([r,a],[s,a],i),A=u*(s-r),h=e/Mi([r,a],[r,l],i),f=h*(l-a),d=s-r,p=l-a,g=Math.floor(d/A),v=Math.floor(p/f),y=(d-g*A)/2,m=(p-v*f)/2,b=r+y,x=0;x<g;x++){for(var E=a+m,B=0;B<v;B++){var P=kt([[[b,E],[b,E+f],[b+A,E+f],[b+A,E],[b,E]]],i.properties);i.mask?HQ(i.mask,P)&&o.push(P):o.push(P),E+=f}b+=A}return En(o)}function y8(t,n,e){return e===void 0&&(e={}),g8(t,n,n,e)}function v8(t,n,e){e===void 0&&(e={});for(var i=[],o=n/Mi([t[0],t[1]],[t[2],t[1]],e),r=o*(t[2]-t[0]),a=n/Mi([t[0],t[1]],[t[0],t[3]],e),s=a*(t[3]-t[1]),l=0,u=t[0];u<=t[2];){for(var A=0,h=t[1];h<=t[3];){var f=null,d=null;l%2===0&&A%2===0?(f=kt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),d=kt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)):l%2===0&&A%2===1?(f=kt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties),d=kt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties)):A%2===0&&l%2===1?(f=kt([[[u,h],[u,h+s],[u+r,h+s],[u,h]]],e.properties),d=kt([[[u,h],[u+r,h+s],[u+r,h],[u,h]]],e.properties)):A%2===1&&l%2===1&&(f=kt([[[u,h],[u,h+s],[u+r,h],[u,h]]],e.properties),d=kt([[[u,h+s],[u+r,h+s],[u+r,h],[u,h+s]]],e.properties)),e.mask?(Vf(e.mask,f)&&i.push(f),Vf(e.mask,d)&&i.push(d)):(i.push(f),i.push(d)),h+=s,A++}l++,u+=r}return En(i)}function w8(t,n,e){if(e=e||{},typeof e!="object")throw new Error("options is invalid");var i=e.gridType,o=e.property,r=e.weight;if(!t)throw new Error("points is required");if(QL(t,"Point","input must contain Points"),!n)throw new Error("cellSize is required");if(r!==void 0&&typeof r!="number")throw new Error("weight must be a number");o=o||"elevation",i=i||"square",r=r||1;var a=es(t),s;switch(i){case"point":case"points":s=L_(a,n,e);break;case"square":case"squares":s=y8(a,n,e);break;case"hex":case"hexes":s=p8(a,n,e);break;case"triangle":case"triangles":s=v8(a,n,e);break;default:throw new Error("invalid gridType")}var l=[];return ya(s,function(u){var A=0,h=0;ya(t,function(d){var p=i==="point"?u:Sz(u),g=Mi(p,d,e),v;if(o!==void 0&&(v=d.properties[o]),v===void 0&&(v=d.geometry.coordinates[2]),v===void 0)throw new Error("zValue is missing");g===0&&(A=v);var y=1/Math.pow(g,r);h+=y,A+=y*v});var f=_z(u);f.properties[o]=A/h,l.push(f)}),En(l)}function b8(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a);return!!(e.globe.pick(a,e)||s)}const gS=(t=0)=>new Promise(n=>setTimeout(n,t));function x8(t,n){const e=En(t.map(l=>Zt(l))),i=kt([t]);return w8(e,n,{gridType:"point",units:"meters"}).features.map(l=>l.geometry.coordinates).filter(l=>hn(Zt(l),i))}function _8(t){const n=_.JulianDate.fromDate(t),e=_.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(n);return $a(e)}function C8(t,n,e){const i=t[0]+(n[0]-t[0])*e,o=t[1]+(n[1]-t[1])*e,r=t[2]+(n[2]-t[2])*e,a=t[3]+(n[3]-t[3])*e;return[i,o,r,a]}const Nc=class Nc extends Un{constructor(e,i){super(e,i);L(this,"czmPointPrimitiveCollection");L(this,"_stopRun",!1);const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Ro(i,e.id));this.czmPointPrimitiveCollection=r,this.d(c.track([r,"show"],[e,"show"]));{const a=async()=>{if(!(e.points&&e.points.length>=3)||e.endTime<e.startTime){r.pointPrimitiveOptions=void 0;return}const u=[...e.points,e.points[0]],A=e.sampleDistance,h=x8(u,A).map(b=>[...b,e.height]),f=Math.floor(e.extrudedHeight/A);if(f>0){const b=[...h];for(let x=1;x<=f;x++)h.push(...b.map(E=>[E[0],E[1],e.height+x*A]))}const{startTime:d,endTime:p,spanTime:g}=e,v=g*36e5,y=Math.floor((p-d)/v),m=Array(h.length).fill(0);e:for(let b=0;b<y;b++){if(await gS(),this._stopRun)break e;const x=new Date(d+b*v),E=_8(x);t:for(let B=0;B<h.length;B++){if(await gS(),this._stopRun)break t;b8(h[B],E,o.scene)||(m[B]=(m[B]*y+1)/y)}!this._stopRun&&(e.progress=Number(((b+1)/y*100).toFixed(2))),console.log("colorScalelist",m),l(h,m)}},s=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(a())}));this.d(e.startEvent.don(()=>{this._stopRun=!1,r.pointPrimitiveOptions=void 0,e.progress=0,s.restart()})),this.d(e.stopEvent.don(()=>{this._stopRun=!0,r.pointPrimitiveOptions=void 0,e.progress=0,s.isRunning&&s.cancel()}));const l=(u,A)=>{const h=u.map((f,d)=>({position:[...f],color:C8(e.startColor,e.endColor,A[d]),pixelSize:10}));r.pointPrimitiveOptions=h}}}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,geoPolygon:a}=this;if(!a||!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);if(a.positions){const s=[...a.positions];return a.positions.forEach(l=>{s.push([l[0],l[1],o.extrudedHeight],[l[0],l[1],o.height])}),Me(r,o,i,s,e),!0}return!1}};L(Nc,"type",Nc.register("ESCesiumViewer",c.ESSunshineAnalysis.type,Nc));let qy=Nc;const yS=Math.pow(2,-52),Nf=new Uint32Array(512);class Ky{static from(n,e=T8,i=I8){const o=n.length,r=new Float64Array(o*2);for(let a=0;a<o;a++){const s=n[a];r[2*a]=e(s),r[2*a+1]=i(s)}return new Ky(r)}constructor(n){const e=n.length>>1;if(e>0&&typeof n[0]!="number")throw new Error("Expected coords to contain numbers.");this.coords=n;const i=Math.max(2*e-5,0);this._triangles=new Uint32Array(i*3),this._halfedges=new Int32Array(i*3),this._hashSize=Math.ceil(Math.sqrt(e)),this._hullPrev=new Uint32Array(e),this._hullNext=new Uint32Array(e),this._hullTri=new Uint32Array(e),this._hullHash=new Int32Array(this._hashSize),this._ids=new Uint32Array(e),this._dists=new Float64Array(e),this.update()}update(){const{coords:n,_hullPrev:e,_hullNext:i,_hullTri:o,_hullHash:r}=this,a=n.length>>1;let s=1/0,l=1/0,u=-1/0,A=-1/0;for(let M=0;M<a;M++){const F=n[2*M],S=n[2*M+1];F<s&&(s=F),S<l&&(l=S),F>u&&(u=F),S>A&&(A=S),this._ids[M]=M}const h=(s+u)/2,f=(l+A)/2;let d,p,g;for(let M=0,F=1/0;M<a;M++){const S=Zy(h,f,n[2*M],n[2*M+1]);S<F&&(d=M,F=S)}const v=n[2*d],y=n[2*d+1];for(let M=0,F=1/0;M<a;M++){if(M===d)continue;const S=Zy(v,y,n[2*M],n[2*M+1]);S<F&&S>0&&(p=M,F=S)}let m=n[2*p],b=n[2*p+1],x=1/0;for(let M=0;M<a;M++){if(M===d||M===p)continue;const F=P8(v,y,m,b,n[2*M],n[2*M+1]);F<x&&(g=M,x=F)}let E=n[2*g],B=n[2*g+1];if(x===1/0){for(let S=0;S<a;S++)this._dists[S]=n[2*S]-n[0]||n[2*S+1]-n[1];Ma(this._ids,this._dists,0,a-1);const M=new Uint32Array(a);let F=0;for(let S=0,T=-1/0;S<a;S++){const w=this._ids[S],C=this._dists[w];C>T&&(M[F++]=w,T=C)}this.hull=M.subarray(0,F),this.triangles=new Uint32Array(0),this.halfedges=new Uint32Array(0);return}if(pu(v,y,m,b,E,B)<0){const M=p,F=m,S=b;p=g,m=E,b=B,g=M,E=F,B=S}const P=B8(v,y,m,b,E,B);this._cx=P.x,this._cy=P.y;for(let M=0;M<a;M++)this._dists[M]=Zy(n[2*M],n[2*M+1],P.x,P.y);Ma(this._ids,this._dists,0,a-1),this._hullStart=d;let I=3;i[d]=e[g]=p,i[p]=e[d]=g,i[g]=e[p]=d,o[d]=0,o[p]=1,o[g]=2,r.fill(-1),r[this._hashKey(v,y)]=d,r[this._hashKey(m,b)]=p,r[this._hashKey(E,B)]=g,this.trianglesLen=0,this._addTriangle(d,p,g,-1,-1,-1);for(let M=0,F,S;M<this._ids.length;M++){const T=this._ids[M],w=n[2*T],C=n[2*T+1];if(M>0&&Math.abs(w-F)<=yS&&Math.abs(C-S)<=yS||(F=w,S=C,T===d||T===p||T===g))continue;let D=0;for(let k=0,Q=this._hashKey(w,C);k<this._hashSize&&(D=r[(Q+k)%this._hashSize],!(D!==-1&&D!==i[D]));k++);D=e[D];let R=D,U;for(;U=i[R],pu(w,C,n[2*R],n[2*R+1],n[2*U],n[2*U+1])>=0;)if(R=U,R===D){R=-1;break}if(R===-1)continue;let O=this._addTriangle(R,T,i[R],-1,-1,o[R]);o[T]=this._legalize(O+2),o[R]=O,I++;let z=i[R];for(;U=i[z],pu(w,C,n[2*z],n[2*z+1],n[2*U],n[2*U+1])<0;)O=this._addTriangle(z,T,U,o[T],-1,o[z]),o[T]=this._legalize(O+2),i[z]=z,I--,z=U;if(R===D)for(;U=e[R],pu(w,C,n[2*U],n[2*U+1],n[2*R],n[2*R+1])<0;)O=this._addTriangle(U,T,R,-1,o[R],o[U]),this._legalize(O+2),o[U]=O,i[R]=R,I--,R=U;this._hullStart=e[T]=R,i[R]=e[z]=T,i[T]=z,r[this._hashKey(w,C)]=T,r[this._hashKey(n[2*R],n[2*R+1])]=R}this.hull=new Uint32Array(I);for(let M=0,F=this._hullStart;M<I;M++)this.hull[M]=F,F=i[F];this.triangles=this._triangles.subarray(0,this.trianglesLen),this.halfedges=this._halfedges.subarray(0,this.trianglesLen)}_hashKey(n,e){return Math.floor(S8(n-this._cx,e-this._cy)*this._hashSize)%this._hashSize}_legalize(n){const{_triangles:e,_halfedges:i,coords:o}=this;let r=0,a=0;for(;;){const s=i[n],l=n-n%3;if(a=l+(n+2)%3,s===-1){if(r===0)break;n=Nf[--r];continue}const u=s-s%3,A=l+(n+1)%3,h=u+(s+2)%3,f=e[a],d=e[n],p=e[A],g=e[h];if(E8(o[2*f],o[2*f+1],o[2*d],o[2*d+1],o[2*p],o[2*p+1],o[2*g],o[2*g+1])){e[n]=g,e[s]=f;const y=i[h];if(y===-1){let b=this._hullStart;do{if(this._hullTri[b]===h){this._hullTri[b]=n;break}b=this._hullPrev[b]}while(b!==this._hullStart)}this._link(n,y),this._link(s,i[a]),this._link(a,h);const m=u+(s+1)%3;r<Nf.length&&(Nf[r++]=m)}else{if(r===0)break;n=Nf[--r]}}return a}_link(n,e){this._halfedges[n]=e,e!==-1&&(this._halfedges[e]=n)}_addTriangle(n,e,i,o,r,a){const s=this.trianglesLen;return this._triangles[s]=n,this._triangles[s+1]=e,this._triangles[s+2]=i,this._link(s,o),this._link(s+1,r),this._link(s+2,a),this.trianglesLen+=3,s}}function S8(t,n){const e=t/(Math.abs(t)+Math.abs(n));return(n>0?3-e:1+e)/4}function Zy(t,n,e,i){const o=t-e,r=n-i;return o*o+r*r}function E8(t,n,e,i,o,r,a,s){const l=t-a,u=n-s,A=e-a,h=i-s,f=o-a,d=r-s,p=l*l+u*u,g=A*A+h*h,v=f*f+d*d;return l*(h*v-g*d)-u*(A*v-g*f)+p*(A*d-h*f)<0}function P8(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),d=(u*A-s*h)*f,p=(a*h-l*A)*f;return d*d+p*p}function B8(t,n,e,i,o,r){const a=e-t,s=i-n,l=o-t,u=r-n,A=a*a+s*s,h=l*l+u*u,f=.5/(a*u-s*l),d=t+(u*A-s*h)*f,p=n+(a*h-l*A)*f;return{x:d,y:p}}function Ma(t,n,e,i){if(i-e<=20)for(let o=e+1;o<=i;o++){const r=t[o],a=n[r];let s=o-1;for(;s>=e&&n[t[s]]>a;)t[s+1]=t[s--];t[s+1]=r}else{const o=e+i>>1;let r=e+1,a=i;gu(t,o,r),n[t[e]]>n[t[i]]&&gu(t,e,i),n[t[r]]>n[t[i]]&&gu(t,r,i),n[t[e]]>n[t[r]]&&gu(t,e,r);const s=t[r],l=n[s];for(;;){do r++;while(n[t[r]]<l);do a--;while(n[t[a]]>l);if(a<r)break;gu(t,r,a)}t[e+1]=t[a],t[a]=s,i-r+1>=a-e?(Ma(t,n,r,i),Ma(t,n,e,a-1)):(Ma(t,n,e,a-1),Ma(t,n,r,i))}}function gu(t,n,e){const i=t[n];t[n]=t[e],t[e]=i}function T8(t){return t[0]}function I8(t){return t[1]}const vS=(t=0)=>new Promise(n=>setTimeout(n,t)),hs=class hs extends c.Destroyable{constructor(e,i){super();L(this,"_pickedEvent",this.disposeVar(new c.Event));L(this,"_startEvent",this.disposeVar(new c.Event));L(this,"_stopEvent",this.dv(new c.Event));L(this,"_flyToEvent",this.disposeVar(new c.Event));L(this,"_geoPolyline");L(this,"_customPrimitive");L(this,"_geoDivPoi");L(this,"_starting",!1);const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}this._geoPolyline=this.disposeVar(new Ye(e,i)),this._customPrimitive=this.disposeVar(new at(e,i)),this._geoDivPoi=this.disposeVar(new wt(e,i)),this.ad(this._geoDivPoi.pickedEvent.don(r=>{Gi(r)===0&&this.pickedEvent.emit(r)})),this._geoPolyline.loop=!0,this.d(this.flyToEvent.don(r=>{this._geoPolyline&&this._geoPolyline.flyTo(r)})),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=`
3730
3730
  uniform vec4 u_color;
3731
3731
  void main()
3732
3732
  {
@@ -3738,7 +3738,7 @@ void main()
3738
3738
  gl_Position = czm_modelViewProjection * vec4(position, 1.0);
3739
3739
  }
3740
3740
  `,this._customPrimitive.uniformMap={u_color:[1,1,0,1]},this.d(c.track([this._customPrimitive,"show"],[this,"show"])),this.d(c.track([this._geoPolyline,"show"],[this,"show"])),this.d(c.bind([this._geoPolyline,"positions"],[this,"positions"])),this.d(c.bind([this._geoPolyline,"width"],[this,"outlineWidth"])),this.d(c.bind([this._geoPolyline,"color"],[this,"outlineColor"]));{let r=function(u,A){const h=[];for(const f of A)switch(f){case"SquareMeter_SquareKilometer":u>=1e6?h.push(`面积:${(u/1e6).toFixed(2)} km²`):h.push(`面积:${u.toFixed(2)} m²`);break;case"MU_Hectare":const d=u*(1/666.7);if(d>=15){const p=d/15;h.push(`面积:${p.toFixed(2)} 公顷`)}else h.push(`面积:${d.toFixed(2)} 亩`);break}return h};const a=()=>{let u=[];this.totalArea?this._starting?u=["分析计算中..."]:u=[...r(this.totalArea,this.units)]:this._starting?u=["分析计算中..."]:u=["暂无分析结果"],this._geoDivPoi&&(this._geoDivPoi.innerHTML=xo([...u].join(`
3741
- `),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(c.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Ex(this.positions):this._geoDivPoi.position=void 0)}));const s=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??hs.defaults.interpolationDistance,A=this.interpolation??hs.defaults.interpolation,h=this.offsetHeight??hs.defaults.offsetHeight,f=this.drillDepth??hs.defaults.drillDepth,d=[];if(this.positions)for(let z=0;z<this.positions.length;++z){const k=_.Cartesian3.fromDegrees(this.positions[z][0],this.positions[z][1],this.positions[z][2]);d.push(k)}var p=F8(d);if(isNaN(p.x)||isNaN(p.y)||isNaN(p.z)){console.warn("法向量计算错误!");return}var g=M8(d),v=_.Cartesian3.normalize(g,new _.Cartesian3),y=_.Cartesian3.dot(v,p);y<0&&(p=wS(p),d.reverse());let m=_.Transforms.eastNorthUpToFixedFrame(g),b=_.Matrix4.inverseTransformation(m,new _.Matrix4);if(Math.abs(y)<.999){const z=D8(p,v);var x=wS(g),E=_.Matrix4.fromTranslation(x,new _.Matrix4);b=_.Matrix4.multiply(z,E,E),m=_.Matrix4.inverse(b,new _.Matrix4)}var B=Da(d,b),P=[],I=[],M=U8(B);if(A&&u>0){var F=R8(B);const z=Math.max(F.maxy-F.miny,F.maxx-F.minx);var S=k8(M,F,u);const k=await $y(S,m,b,p,o.scene,h,f,z);var T=Q8(B,u);const Q=await $y(T,m,b,p,o.scene,h,f,z);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let N=0;N<B.length;++N){const j=B[N];var w=await $y([j],m,b,p,o.scene,h,f,z);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const J=[j.x,j.y,j.z+h];P.push(J);var C=Da([_.Cartesian3.fromArray(J)],m);for(let ee=0;ee<C.length;++ee)I.push(C[ee])}}}else{const z=B.map(k=>_.Cartesian3.fromArray([k.x,k.y,k.z+z]));P=z,I=Da(z,m)}var D=O8(P,M);const R=L8(I,D);this.totalArea=R;const U=[];P.forEach(z=>{const k=[z.x,z.y,z.z];k&&U.push(...k)});const O={position:{typedArray:new Float32Array(U),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=_.Matrix4.toArray(m),this.customPrimitive.attributes=O;const z=await I8([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(z),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:N}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,N)}},l=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.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,a()}))}}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}};L(hs,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let ns=hs;(t=>{t.createDefaultProps=()=>({positions:c.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:c.reactArray([1,1,1,1]),units:c.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(ns||(ns={})),c.extendClassProps(ns.prototype,ns.createDefaultProps);async function I8(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await vS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function F8(t){var n=new _.Cartesian3(0,0,0),e=new _.Cartesian3(0,0,0),i=new _.Cartesian3(0,0,0),o=new _.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=_.Cartesian3.subtract(a,s,n),e=_.Cartesian3.subtract(a,l,e),i=_.Cartesian3.cross(n,e,i),!i.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6)&&(i=_.Cartesian3.normalize(i,i),o=_.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function M8(t){var n=new _.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=_.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function wS(t){return new _.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function D8(t,n){var e=_.Cartesian3.cross(t,n,new _.Cartesian3);e=_.Cartesian3.normalize(e,e);var i=_.Cartesian3.cross(t,e,new _.Cartesian3);i=_.Cartesian3.normalize(i,i);var o=t,r=new _.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function Da(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=_.Matrix4.multiplyByPoint(n,i,new _.Cartesian3);e.push(o)}return e}function R8(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function U8(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function O8(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=Ky.from(e).triangles;const o=[],r=kt([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,h=(t[s].y+t[l].y+t[u].y)/3;hn([A,h],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function L8(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=z8(o)}return e}function z8(t){var n=_.Cartesian3.distance(t[0],t[1]),e=_.Cartesian3.distance(t[1],t[2]),i=_.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function k8(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)N8([o,r],t)&&i.push(new _.Cartesian3(o,r,0));return i}function Q8(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=V8(i,o,n);e.push(...r)}return e}function V8(t,n,e){var i=[],o=_.Cartesian3.distance(t,n),r=_.Cartesian3.subtract(n,t,new _.Cartesian3);if(r.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6))return[];r=_.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new _.Cartesian3(r.x*a,r.y*a,r.z*a),l=_.Cartesian3.add(t,s,new _.Cartesian3);i.push(l),a+=e}return i}function N8(t,n){var e=Zt(t);if(!VQ(Zt(n[0]),Zt(n[n.length-1])))return!1;var i=[];i.push(n);var o=kt(i);return hn(e,o)}async function $y(t,n,e,i,o,r,a,s){var l=[];t.forEach(b=>{var x=b.clone();x.z=s,l.push(x)});var u=Da(l,n),A=new _.Cartesian3(-1*i.x,-1*i.y,-1*i.z),h=[],f=[],d=[];for(let b=0;b<u.length;++b){await vS();var p=u[b],g=new _.Ray(p,A),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new _.Ray(p,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=Da([y],e);m.forEach(x=>{x.z+=r}),y=Da(m,n)[0],d.push(y),y=_.Cartographic.fromCartesian(y),h.push([y.longitude,y.latitude,y.height]),f.push(m[0])}}}return{local:f,world:h,world_cartesian:d}}const Hc=class Hc extends Un{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new ns(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(c.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(c.track([r,"units"],[e,"units"])),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"positions"],[e,"points"])),this.d(c.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(c.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};L(Hc,"type",Hc.register("ESCesiumViewer",c.ESSurfaceAreaMeasurement.type,Hc));let Xy=Hc;async function H8(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const Gc=class Gc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof ot))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${c.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${c.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const h=document.createElement("span");A.appendChild(h),this.dispose(()=>A.removeChild(h));const f=document.createElement("span");h.appendChild(f),this.dispose(()=>h.removeChild(f));const d=document.createElement("span");h.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),H8(g)}),d.style.cursor="pointer",this.dispose(()=>h.removeChild(d));const p=document.createElement("span");A.appendChild(p),this.dispose(()=>A.removeChild(p));{const g=()=>{A.style.height=(e.height??c.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??c.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{A.style.fontSize=(e.fontSize??c.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${c.ESViewerStatusBar.defaults.bgColor[0]},${c.ESViewerStatusBar.defaults.bgColor[1]},${c.ESViewerStatusBar.defaults.bgColor[2]},${c.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{p.innerText=`Cesium 版本 : ${_.VERSION} `;let g;const v=()=>{e.show?(A.style.display="flex",g=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const b=u.getCameraInfo();if(b){const B=(I,M)=>b.position[I].toFixed(M),P=(I,M)=>b.rotation[I].toFixed(M);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);m=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else m="暂时无法获取鼠标位置...";d.innerText=m})),g.start()):(A.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(Gc,"type",Gc.register("ESCesiumViewer",c.ESViewerStatusBar.type,Gc));let Yy=Gc;const Wc=class Wc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(c.track([r,"show"],[e,"show"])),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof ot))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const h=document.createElement("div");A.appendChild(h),h.style.width="100%",h.className="ESViewerStatusBarScale",h.style.position="absolute",h.style.display="flex",h.style.height=`${c.ESViewerStatusBarScale.defaults.height}px`,h.style.left="0",h.style.bottom="0",h.style.color="#fff",h.style.padding="0 20px 0 0",h.style.boxSizing="border-box",h.style.lineHeight=`${c.ESViewerStatusBarScale.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const f=document.createElement("div");h.appendChild(f);const d=document.createElement("div");f.appendChild(d);const p=document.createElement("div");f.appendChild(p);const g=document.createElement("div");h.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const b=document.createElement("span");g.appendChild(b);{const I=()=>{h.style.height=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px",h.style.lineHeight=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{h.style.fontSize=(e.fontSize??c.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{e.bgColor?h.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:h.style.background=`rgba(${c.ESViewerStatusBarScale.defaults.bgColor[0]},${c.ESViewerStatusBarScale.defaults.bgColor[1]},${c.ESViewerStatusBarScale.defaults.bgColor[2]},${c.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",d.style.fontWeight="bold",d.style.padding="0 0 0 25px";let x="EarthSDK";d.innerText=x,p.style.fontWeight="";let E="——免费开源地球可视化开发包";p.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const M=i.viewerLegend.legend.computedLengthInStr;M&&(y.innerHTML=M);const F=i.viewerLegend.legend.computedLengthInPixels;if(F){m.style.width=`${F}px`;const S=(135-F)/2;m.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const M=()=>{e.show?(A.style.display="block",I=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var w;let F="";const S=u.getCameraInfo();if(S){const C=(D,R)=>S.position[D].toFixed(R);F+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(D,R)=>T[D].toFixed(R);F+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else F+="暂时无法获取鼠标位置...";b.innerText=F})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(M)),M()}}}}get customDiv(){return this._customDiv}};L(Wc,"type",Wc.register("ESCesiumViewer",c.ESViewerStatusBarScale.type,Wc));let Jy=Wc;const bS=_.Math.toDegrees,G8=new _.Cartographic;function xS(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const p=_.Cartesian3.distance(i,s.position),g=_.Cartesian3.distance(i,l);u=p<g?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=_.Cartesian3.distance(i,o),f=_.Cartesian3.distance(i,u)>A?o:u,d=_.Cartographic.fromCartesian(f,void 0,G8);return[bS(d.longitude),bS(d.latitude),d.height]}const jc=class jc extends on{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new Dn(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new Dn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([a,"show"],[e,"show"])),this.d(c.track([a,"color"],[e,"visibleColor"])),this.d(c.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const h=[],f=[],[d,p,g]=u[0],v=[d,p,g+A];try{u.forEach((y,m)=>{if(m===0)return;const b=xS(v,y,o.scene);b?(h.push([y,b]),f.push([v,b])):f.push([v,y])}),r.positions=h,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};L(jc,"type",jc.register("ESCesiumViewer",c.ESVisibilityAnalysis.type,jc));let ev=jc;class yu extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new c.Event));L(this,"_enableEvent",this.dv(new c.Event));L(this,"_clearEvent",this.dv(new c.Event));L(this,"_gridPoints",this.dv(c.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Dn(e,i)),a=this.dv(new Dn(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(c.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(c.track([l,"show"],[this,"show"])),l.show=!1;{const d=this.ad(new Ti(e,i));this.d(c.track([d,"show"],[this,"show"])),this.d(c.bind([d,"allowPicking"],[this,"allowPicking"])),this.d(c.bind([d,"positions"],[this,"positions"])),this.d(c.bind([d,"depthTest"],[this,"depthTest"])),this.d(c.bind([d,"outlineWidth"],[this,"outlineWidth"])),this.d(c.bind([d,"outlineColor"],[this,"outlineColor"])),this.d(c.bind([d,"outline"],[this,"outline"])),this.d(c.bind([d,"color"],[this,"fillColor"])),this.d(c.bind([d,"fill"],[this,"filled"])),this.d(c.bind([d,"strokeGround"],[this,"strokeGround"])),this.d(c.bind([d,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{d.flyTo(v)}));const p=()=>{d.positions=this.positions};p();const g=this.dv(c.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(p))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:d,maxPos:p}=c.getMinMaxCorner(this.positions),g=d[0],v=d[1],y=p[0],m=p[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[g,v,y,m],B=this.gridWidth,M=L_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),F=_.Math.toRadians;return M.map(T=>new _.Cartographic(F(T[0]),F(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},h=this.dv(c.createProcessingFromAsyncFunc(async d=>{const p=u();let g=0,v=300;const y=Math.ceil(p.length/v),m=[];do{let b=[];g===y-1?b=p.slice(g*v):b=p.slice(g*v,(g+1)*v);const x=o.scene.sampleHeightMostDetailed(b),E=await d.promise(x);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=_.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let f=null;{const d=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let p=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const b=this.positions;m[2]>b[0][2]?(p+=this.gridWidth*this.gridWidth*(m[2]-b[0][2]),g.push([m,[m[0],m[1],b[0][2]]])):(v+=this.gridWidth*this.gridWidth*(b[0][2]-m[2]),y.push([m,[m[0],m[1],b[0][2]]]))}),s.positions=g,l.positions=y,s.show=!0,l.show=!0,this.area=Sx(this.positions),this.cutVolume=p,this.fillVolume=v,this.cutAndFillVolume=v-p,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};d(),this.d(this.gridPointsChanged.don(d)),this.d(()=>clearTimeout(f))}{const d=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};d(),this.d(this.positionsChanged.don(d))}{const d=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const p=JSON.parse(JSON.stringify(this.positions.slice(1)));p.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=p};d(),this.d(this.planeHeightChanged.don(d))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,h.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:c.reactPositions(void 0),planeHeight:c.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})})(yu||(yu={})),c.extendClassProps(yu.prototype,yu.createDefaultProps);const qc=class qc extends Un{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new yu(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"positions"],[e,"points"])),this.d(c.track([r,"allowPicking"],[e,"allowPicking"])),this.d(c.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(c.track([r,"gridWidth"],[e,"gridWidth"])),this.d(c.track([e,"cutVolume"],[r,"cutVolume"])),this.d(c.track([e,"fillVolume"],[r,"fillVolume"])),this.d(c.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(c.bind([e,"progress"],[r,"progress"])),this.d(c.track([r,"depthTest"],[e,"depthTest"])),this.d(c.track([r,"outline"],[e,"stroked"])),this.d(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(c.track([r,"outlineColor"],[e,"strokeColor"])),this.d(c.track([r,"filled"],[e,"filled"])),this.d(c.track([r,"fillColor"],[e,"fillColor"])),this.d(c.track([r,"fillGround"],[e,"fillGround"])),this.d(c.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(c.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(qc,"type",qc.register("ESCesiumViewer",c.ESVolumeMeasurement.type,qc));let tv=qc;const Kc=class Kc extends Un{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new c.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(c.bind([r,"show"],[e,"show"])),this.ad(c.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(c.bind([r,"stroked"],[e,"stroked"])),this.ad(c.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(c.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const h=structuredClone(e.points);h.push(h[0]),e.perPositionHeight?r.points=h:r.points=h.map(f=>(f[2]=e.height??c.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});_.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new _.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new _.CallbackProperty(()=>s,!1));const l=()=>{const u=$t(e.points??[]);if(u.length<2){s=new _.PolygonHierarchy;return}s=new _.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new _.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new _.ConstantProperty(e.height??c.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new _.ConstantProperty(e.extrudedHeight??c.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=_.Color.fromCartesian4(_.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new c.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new ot.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=c.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L(Kc,"type",Kc.register("ESCesiumViewer",c.ESGeoExtrudedPolygon.type,Kc));let nv=Kc;const Zc=class Zc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(c.bind([o,"position"],[n,"position"])),this.dispose(c.bind([o,"rotation"],[n,"rotation"])),this.ad(c.bind([o,"scale"],[n,"scale"])),this.ad(c.track([r,"scale"],[n,"scale"])),this.dispose(c.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(c.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(Zc,"type",Zc.register("ESCesiumViewer",c.ESHumanPoi.type,Zc));let iv=Zc;const $c=class $c extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,h,f,d;const u=(d=(f=(h=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:h._model)==null?void 0:f._featureTables[0])==null?void 0:d._features[0];u?o.strokeFeature([u],_.Color.LIME.toBytes().map(p=>p/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,d)=>{try{if(f.getPropertyIds().includes("materialName"))return _.Color.clone(_.Color.WHITE,d);const p=f.getProperty("layer"),g=f.getProperty("dataset"),v=p.toString(),y=g.toString(),m=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(m&&m.value.color){const x=m.value.color;return _.Color.fromCssColorString(x,d)}const b=s.filter(x=>x.dataset.toString()===y);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return _.Color.fromCssColorString(x,d)}else return _.Color.clone(_.Color.WHITE,d)}catch(p){return console.warn(p),_.Color.clone(_.Color.WHITE,d)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(n.visJson);for(let x=0;x<b.length;x++){const E=b[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const d=f.getProperty("layer"),p=f.getProperty("dataset"),g=d.toString(),v=p.toString(),y=s.find(b=>b.dataset.toString()===v&&b.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=s.filter(b=>b.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(d){return console.warn(d),!0}};let h;l!=="HIGHLIGHT"?h=new _.Cesium3DTileStyle({color:{evaluateColor:function(f,d){return u(f,d)}},show:{evaluate:function(f){return A(f)}}}):h=new _.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",h),o.style=h};r();const a=this.dv(c.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};L($c,"type",$c.register("ESCesiumViewer",c.ESRtsTileset.type,$c));let rv=$c;const Xc=class Xc extends la{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Xc,"type",Xc.register("ESCesiumViewer",c.ESRtsFeatureEditing.type,Xc));let ov=Xc;const Yc=class Yc extends la{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Yc,"type",Yc.register("ESCesiumViewer",c.ESMsTileset.type,Yc));let sv=Yc;const Jc=class Jc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Wn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Jc,"type",Jc.register("ESCesiumViewer",c.ESStaticMesh.type,Jc));let av=Jc;const eh=class eh extends on{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new b0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:c.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=Ue(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(eh,"type",eh.register("ESCesiumViewer",c.ESSkylineAnalysis.type,eh));let lv=eh;class W8 extends c.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));const o=e.sceneObject;this._rectangle=this.ad(new Ci(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(c.bind([this.rectangle,"show"],[o,"show"])),this.ad(c.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class j8 extends c.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new c.Event),h=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new _.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const d=()=>{this.primitive&&(this.primitive.show=a.show)};d(),this.ad(a.showChanged.don(d))}{const d=this.ad(c.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(d.don(h))}{const d=()=>{r.rectangle&&(l=new _.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(p=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=c.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new _.MaterialAppearance({material:new _.Material({fabric:{type:"Image",uniforms:{image:p}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=p,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),d(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
3741
+ `),24))};a(),this.d(this.totalAreaChanged.don(a)),this.d(this.unitsChanged.don(a)),this.d(c.track([this._geoDivPoi,"show"],[this,"show"])),this.d(this.positionsChanged.don(()=>{this._geoDivPoi&&(this.positions&&this.positions.length>=3?this._geoDivPoi.position=Ex(this.positions):this._geoDivPoi.position=void 0)}));const s=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??hs.defaults.interpolationDistance,A=this.interpolation??hs.defaults.interpolation,h=this.offsetHeight??hs.defaults.offsetHeight,f=this.drillDepth??hs.defaults.drillDepth,d=[];if(this.positions)for(let z=0;z<this.positions.length;++z){const k=_.Cartesian3.fromDegrees(this.positions[z][0],this.positions[z][1],this.positions[z][2]);d.push(k)}var p=M8(d);if(isNaN(p.x)||isNaN(p.y)||isNaN(p.z)){console.warn("法向量计算错误!");return}var g=D8(d),v=_.Cartesian3.normalize(g,new _.Cartesian3),y=_.Cartesian3.dot(v,p);y<0&&(p=wS(p),d.reverse());let m=_.Transforms.eastNorthUpToFixedFrame(g),b=_.Matrix4.inverseTransformation(m,new _.Matrix4);if(Math.abs(y)<.999){const z=R8(p,v);var x=wS(g),E=_.Matrix4.fromTranslation(x,new _.Matrix4);b=_.Matrix4.multiply(z,E,E),m=_.Matrix4.inverse(b,new _.Matrix4)}var B=Da(d,b),P=[],I=[],M=O8(B);if(A&&u>0){var F=U8(B);const z=Math.max(F.maxy-F.miny,F.maxx-F.minx);var S=Q8(M,F,u);const k=await $y(S,m,b,p,o.scene,h,f,z);var T=V8(B,u);const Q=await $y(T,m,b,p,o.scene,h,f,z);I.push(...k.world_cartesian),P.push(...k.local),I.push(...Q.world_cartesian),P.push(...Q.local);for(let N=0;N<B.length;++N){const j=B[N];var w=await $y([j],m,b,p,o.scene,h,f,z);if(w.local.length>0)P.push(...w.local),I.push(...w.world_cartesian);else{const J=[j.x,j.y,j.z+h];P.push(J);var C=Da([_.Cartesian3.fromArray(J)],m);for(let ee=0;ee<C.length;++ee)I.push(C[ee])}}}else{const z=B.map(k=>_.Cartesian3.fromArray([k.x,k.y,k.z+z]));P=z,I=Da(z,m)}var D=L8(P,M);const R=z8(I,D);this.totalArea=R;const U=[];P.forEach(z=>{const k=[z.x,z.y,z.z];k&&U.push(...k)});const O={position:{typedArray:new Float32Array(U),componentsPerAttribute:3}};if(this.customPrimitive){this.customPrimitive.modelMatrix=_.Matrix4.toArray(m),this.customPrimitive.attributes=O;const z=await F8([...D]);this.customPrimitive.indexTypedArray=new Uint32Array(z),this.customPrimitive.show=!0;const k=this.customPrimitive.computeLocalAxisedBoundingBoxFromAttribute("position");if(!k)return;const{min:Q,max:N}=k;this.customPrimitive.setLocalAxisedBoundingBox(Q,N)}},l=this.dv(c.createProcessingFromAsyncFunc(async u=>{await u.promise(s()),this._starting=!1,a()}));this.d(this.startEvent.don(()=>{if(this._starting){console.log("正在计算中...");return}this._starting=!0,a(),l.restart()})),this.d(this.stopEvent.don(()=>{l.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,a()}))}}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}};L(hs,"defaults",{positions:[],totalArea:0,interpolation:!0,interpolationDistance:.5,offsetHeight:0,drillDepth:3,outlineWidth:2,outlineColor:[1,1,1,1]});let ns=hs;(t=>{t.createDefaultProps=()=>({positions:c.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:c.reactArray([1,1,1,1]),units:c.reactArray(["SquareMeter_SquareKilometer","MU_Hectare"])})})(ns||(ns={})),c.extendClassProps(ns.prototype,ns.createDefaultProps);async function F8(t){t.length%3!==0&&console.warn("当前传入的索引不是3的倍数,可能不是三角片的索引!");const n=t.length/3|0,e=new Array(n*6);for(let i=0;i<n;++i)await vS(),e[i*6+0]=t[i*3+0],e[i*6+1]=t[i*3+1],e[i*6+2]=t[i*3+2],e[i*6+3]=t[i*3+1],e[i*6+4]=t[i*3+2],e[i*6+5]=t[i*3+0];return e}function M8(t){var n=new _.Cartesian3(0,0,0),e=new _.Cartesian3(0,0,0),i=new _.Cartesian3(0,0,0),o=new _.Cartesian3(0,0,0);t[0].equals(t[t.length-1])&&t.pop();var r=t.length;for(let u=0;u<r;++u){var a=t[u],s;u==0?s=t[t.length-1]:s=t[u-1];var l;u==t.length-1?l=t[0]:l=t[u+1],n=_.Cartesian3.subtract(a,s,n),e=_.Cartesian3.subtract(a,l,e),i=_.Cartesian3.cross(n,e,i),!i.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6)&&(i=_.Cartesian3.normalize(i,i),o=_.Cartesian3.add(o,i,o))}return i.x=o.x/r,i.y=o.y/r,i.z=o.z/r,i}function D8(t){var n=new _.Cartesian3(0,0,0),e=t.length;for(let o=0;o<e;++o){var i=t[o];n=_.Cartesian3.add(n,i,n)}return n.x=n.x/e,n.y=n.y/e,n.z=n.z/e,n}function wS(t){return new _.Cartesian3(-1*t.x,-1*t.y,-1*t.z)}function R8(t,n){var e=_.Cartesian3.cross(t,n,new _.Cartesian3);e=_.Cartesian3.normalize(e,e);var i=_.Cartesian3.cross(t,e,new _.Cartesian3);i=_.Cartesian3.normalize(i,i);var o=t,r=new _.Matrix4(e.x,e.y,e.z,0,i.x,i.y,i.z,0,o.x,o.y,o.z,0,0,0,0,1);return r}function Da(t,n){var e=[];for(let r=0;r<t.length;++r){var i=t[r],o=_.Matrix4.multiplyByPoint(n,i,new _.Cartesian3);e.push(o)}return e}function U8(t){var n=t[0].x,e=t[0].y,i=t[0].x,o=t[0].y;return t.forEach(r=>{n=Math.min(n,r.x),e=Math.min(e,r.y),i=Math.max(i,r.x),o=Math.max(o,r.y)}),{minx:n,miny:e,maxx:i,maxy:o}}function O8(t){var n=[];return t.forEach(e=>{n.push([e.x,e.y])}),n.push(n[0]),n}function L8(t,n){var e=[];t.forEach(a=>{const s=[a.x,a.y];e.push(s)});var i=Ky.from(e).triangles;const o=[],r=kt([n]);for(let a=0;a<i.length;a+=3){const s=i[a],l=i[a+1],u=i[a+2],A=(t[s].x+t[l].x+t[u].x)/3,h=(t[s].y+t[l].y+t[u].y)/3;hn([A,h],r)&&o.push(s,l,u)}return new Uint32Array(o.reverse())}function z8(t,n){for(var e=0,i=0;i<n.length;i+=3){const o=[t[n[i]],t[n[i+1]],t[n[i+2]]];e+=k8(o)}return e}function k8(t){var n=_.Cartesian3.distance(t[0],t[1]),e=_.Cartesian3.distance(t[1],t[2]),i=_.Cartesian3.distance(t[2],t[0]),o=(n+e+i)/2,r=Math.sqrt(o*(o-n)*(o-e)*(o-i));return r||0}function Q8(t,n,e){for(var i=[],o=n.minx;o<n.maxx;o+=e)for(var r=n.miny;r<n.maxy;r+=e)H8([o,r],t)&&i.push(new _.Cartesian3(o,r,0));return i}function V8(t,n){var e=[];for(let a=0;a<t.length;++a){var i=t[a],o;a==t.length-1?o=t[0]:o=t[a+1];var r=N8(i,o,n);e.push(...r)}return e}function N8(t,n,e){var i=[],o=_.Cartesian3.distance(t,n),r=_.Cartesian3.subtract(n,t,new _.Cartesian3);if(r.equalsEpsilon(_.Cartesian3.ZERO,_.Math.EPSILON6))return[];r=_.Cartesian3.normalize(r,r);for(var a=e;a<o;){var s=new _.Cartesian3(r.x*a,r.y*a,r.z*a),l=_.Cartesian3.add(t,s,new _.Cartesian3);i.push(l),a+=e}return i}function H8(t,n){var e=Zt(t);if(!NQ(Zt(n[0]),Zt(n[n.length-1])))return!1;var i=[];i.push(n);var o=kt(i);return hn(e,o)}async function $y(t,n,e,i,o,r,a,s){var l=[];t.forEach(b=>{var x=b.clone();x.z=s,l.push(x)});var u=Da(l,n),A=new _.Cartesian3(-1*i.x,-1*i.y,-1*i.z),h=[],f=[],d=[];for(let b=0;b<u.length;++b){await vS();var p=u[b],g=new _.Ray(p,A),v=void 0;try{v=o.pickFromRay(g)}catch{}if(!v){g=new _.Ray(p,i);try{v=o.pickFromRay(g)}catch{}}if(v){var y=v.position;if(!(!y||!y.x||isNaN(y.x))){var m=Da([y],e);m.forEach(x=>{x.z+=r}),y=Da(m,n)[0],d.push(y),y=_.Cartographic.fromCartesian(y),h.push([y.longitude,y.latitude,y.height]),f.push(m[0])}}}return{local:f,world:h,world_cartesian:d}}const Hc=class Hc extends Un{constructor(e,i){super(e,i);L(this,"_czmAreaMeasurement");if(this._czmAreaMeasurement=this.disposeVar(new ns(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmAreaMeasurement;this.ad(c.track([e,"surfaceArea"],[r,"totalArea"])),this.ad(c.track([r,"units"],[e,"units"])),this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([r,"positions"],[e,"points"])),this.d(c.track([r,"interpolationDistance"],[e,"interpolation"])),this.d(c.track([r,"offsetHeight"],[e,"offsetHeight"]));{const a=()=>{if(this.geoPolygon&&(this.geoPolygon.outline=!1),e.stroked)r.outlineWidth=e.strokeWidth;else{r.outlineWidth=0;return}r.outlineWidth=e.strokeWidth,r.outlineColor=e.strokeColor};a();const s=this.disposeVar(c.createNextAnimateFrameEvent(e.strokeStyleChanged,e.strokedChanged));this.d(s.disposableOn(a))}this.d(e.startEvent.don(()=>{this._czmAreaMeasurement.start()})),this.d(e.stopEvent.don(()=>{this._czmAreaMeasurement.stop()}))}get czmAreaMeasurement(){return this._czmAreaMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}flyIn(e,i){const{sceneObject:o,czmViewer:r,czmAreaMeasurement:a}=this;return r.actived?o.flyInParam?super.flyIn(e,i):(a.positions&&Me(r,o,i,a.positions,e),!0):!1}};L(Hc,"type",Hc.register("ESCesiumViewer",c.ESSurfaceAreaMeasurement.type,Hc));let Xy=Hc;async function G8(t){navigator.clipboard.writeText(t).then(function(){console.log("复制成功")},function(n){console.log("复制失败")})}const Gc=class Gc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof ot))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A)),A.style.width="100%",A.style.position="absolute",A.style.height=`${c.ESViewerStatusBar.defaults.height}px`,A.style.left="0",A.style.bottom="0",A.style.color="#fff",A.style.padding="0 20px 0 0",A.style.boxSizing="border-box",A.style.lineHeight=`${c.ESViewerStatusBar.defaults.height}px`,A.style.zIndex="100",A.style.alignContent="center",A.style.justifyContent="space-between";const h=document.createElement("span");A.appendChild(h),this.dispose(()=>A.removeChild(h));const f=document.createElement("span");h.appendChild(f),this.dispose(()=>h.removeChild(f));const d=document.createElement("span");h.appendChild(d),d.addEventListener("dblclick",function(){let g=d.innerHTML;g.startsWith("鼠标位置")&&(g=g.slice(5)),G8(g)}),d.style.cursor="pointer",this.dispose(()=>h.removeChild(d));const p=document.createElement("span");A.appendChild(p),this.dispose(()=>A.removeChild(p));{const g=()=>{A.style.height=(e.height??c.ESViewerStatusBar.defaults.height)+"px",A.style.lineHeight=(e.height??c.ESViewerStatusBar.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(g)),g()}{const g=()=>{A.style.fontSize=(e.fontSize??c.ESViewerStatusBar.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(g)),g()}{const g=()=>{e.bgColor?A.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:A.style.background=`rgba(${c.ESViewerStatusBar.defaults.bgColor[0]},${c.ESViewerStatusBar.defaults.bgColor[1]},${c.ESViewerStatusBar.defaults.bgColor[2]},${c.ESViewerStatusBar.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(g)),g()}{p.innerText=`Cesium 版本 : ${_.VERSION} `;let g;const v=()=>{e.show?(A.style.display="flex",g=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var E;let y="",m="";const b=u.getCameraInfo();if(b){const B=(I,M)=>b.position[I].toFixed(M),P=(I,M)=>b.rotation[I].toFixed(M);y=`帧率:${u.getFPS()}FPS 经度: ${B(0,5)}° 纬度: ${B(1,5)}° 高度: ${B(2,2)}米 偏航角: ${P(0,2)}° 俯仰角: ${P(1,2)}° 翻滚角:${P(2,2)}° `}f.innerText=y;const x=(E=u.extensions)==null?void 0:E.cursorPositionInfo.cursorPosition;if(x){const B=(P,I)=>x[P].toFixed(I);m=`鼠标位置:${B(0,5)}° ${B(1,5)}° ${B(2,2)}m`}else m="暂时无法获取鼠标位置...";d.innerText=m})),g.start()):(A.style.display="none",g.destroy())};this.dispose(e.showChanged.disposableOn(v)),v()}}}}get customDiv(){return this._customDiv}};L(Gc,"type",Gc.register("ESCesiumViewer",c.ESViewerStatusBar.type,Gc));let Yy=Gc;const Wc=class Wc extends c.EngineObject{constructor(e,i){super(e,i);L(this,"_customDiv");if(this._customDiv=this.disposeVar(new c.ESCustomDiv(e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._customDiv;i.add(r),this.dispose(()=>i.delete(r)),this.dispose(c.track([r,"show"],[e,"show"])),r.instanceClass=class extends c.Destroyable{constructor(s,l,u){if(super(),this._subContainer=s,!u||!(u instanceof ot))return;u.extensions.cursorPositionInfo.enabled=!0;const A=document.createElement("div");this._subContainer.appendChild(A),this.dispose(()=>this._subContainer.removeChild(A));const h=document.createElement("div");A.appendChild(h),h.style.width="100%",h.className="ESViewerStatusBarScale",h.style.position="absolute",h.style.display="flex",h.style.height=`${c.ESViewerStatusBarScale.defaults.height}px`,h.style.left="0",h.style.bottom="0",h.style.color="#fff",h.style.padding="0 20px 0 0",h.style.boxSizing="border-box",h.style.lineHeight=`${c.ESViewerStatusBarScale.defaults.height}px`,h.style.zIndex="100",h.style.alignContent="center",h.style.justifyContent="space-between";const f=document.createElement("div");h.appendChild(f);const d=document.createElement("div");f.appendChild(d);const p=document.createElement("div");f.appendChild(p);const g=document.createElement("div");h.appendChild(g);const v=document.createElement("div");g.appendChild(v);const y=document.createElement("div");v.appendChild(y);const m=document.createElement("div");v.appendChild(m);const b=document.createElement("span");g.appendChild(b);{const I=()=>{h.style.height=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px",h.style.lineHeight=(e.height??c.ESViewerStatusBarScale.defaults.height)+"px"};this.dispose(e.heightChanged.disposableOn(I)),I()}{const I=()=>{h.style.fontSize=(e.fontSize??c.ESViewerStatusBarScale.defaults.fontSize)+"px"};this.dispose(e.fontSizeChanged.disposableOn(I)),I()}{const I=()=>{e.bgColor?h.style.background=`rgba(${e.bgColor[0]*255},${e.bgColor[1]*255},${e.bgColor[2]*255},${e.bgColor[3]})`:h.style.background=`rgba(${c.ESViewerStatusBarScale.defaults.bgColor[0]},${c.ESViewerStatusBarScale.defaults.bgColor[1]},${c.ESViewerStatusBarScale.defaults.bgColor[2]},${c.ESViewerStatusBarScale.defaults.bgColor[3]})`};this.dispose(e.bgColorChanged.disposableOn(I)),I()}f.style.display="flex",d.style.fontWeight="bold",d.style.padding="0 0 0 25px";let x="EarthSDK";d.innerText=x,p.style.fontWeight="";let E="——免费开源地球可视化开发包";p.innerText=E,g.style.width="550px",v.style.position="fixed",v.style.width="125px",v.style.height="30px",v.style.padding="0 5px",v.style.display="flex",v.style.justifyContent="flex-end",v.style.pointerEvents="auto",v.style.zIndex="101",y.style.width="125px",y.style.display="inline-block",y.style.textAlign="center",y.style.fontSize="14px",y.style.fontWeight="lighter",y.style.lineHeight="30px",y.style.color="#fff",y.innerHTML="1000km",m.style.borderRight="1px solid #fff",m.style.borderLeft="1px solid #fff",m.style.borderBottom="1px solid #fff",m.style.position="absolute",m.style.height="10px",m.style.top="15px",m.style.width="75px",m.style.right="30px",b.style.display="flex",b.style.zIndex="101",b.style.justifyContent="flex-end",b.style.right="0";const B=()=>{const I=i.viewerLegend.legend.computedLengthInMeters;if(e.show===!1||I&&I>1e6)v.style.display="none";else{v.style.display="block";const M=i.viewerLegend.legend.computedLengthInStr;M&&(y.innerHTML=M);const F=i.viewerLegend.legend.computedLengthInPixels;if(F){m.style.width=`${F}px`;const S=(135-F)/2;m.style.left=`${S}px`}}};B();const P=setInterval(()=>{B()},200);this.dispose(()=>clearInterval(P));{let I;const M=()=>{e.show?(A.style.display="block",I=this.disposeVar(c.createAnimateFrameWithStartValues(()=>{var w;let F="";const S=u.getCameraInfo();if(S){const C=(D,R)=>S.position[D].toFixed(R);F+=`帧率:${u.getFPS()}FPS 相机: ${C(2,2)}米 `}const T=(w=u.extensions)==null?void 0:w.cursorPositionInfo.cursorPosition;if(T){const C=(D,R)=>T[D].toFixed(R);F+=`位置:${C(0,5)}° ${C(1,5)}° ${C(2,2)}米`}else F+="暂时无法获取鼠标位置...";b.innerText=F})),I.start()):(A.style.display="none",I.destroy())};this.dispose(e.showChanged.disposableOn(M)),M()}}}}get customDiv(){return this._customDiv}};L(Wc,"type",Wc.register("ESCesiumViewer",c.ESViewerStatusBarScale.type,Wc));let Jy=Wc;const bS=_.Math.toDegrees,W8=new _.Cartographic;function xS(t,n,e){const i=_.Cartesian3.fromDegrees(t[0],t[1],t[2]),o=_.Cartesian3.fromDegrees(n[0],n[1],n[2]),r=_.Cartesian3.subtract(o,i,new _.Cartesian3);_.Cartesian3.normalize(r,r);const a=new _.Ray(i,r),s=e.pickFromRay(a),l=e.globe.pick(a,e);var u;if(s&&s.position&&l){const p=_.Cartesian3.distance(i,s.position),g=_.Cartesian3.distance(i,l);u=p<g?s.position:l}else s&&s.position?u=s.position:l&&(u=l);if(!u)return;const A=_.Cartesian3.distance(i,o),f=_.Cartesian3.distance(i,u)>A?o:u,d=_.Cartographic.fromCartesian(f,void 0,W8);return[bS(d.longitude),bS(d.latitude),d.height]}const jc=class jc extends on{constructor(e,i){super(e,i);L(this,"_hideGeoPolylines",this.disposeVar(new Dn(this.czmViewer,this.sceneObject.id)));L(this,"_visibleGeoPolylines",this.disposeVar(new Dn(this.czmViewer,this.sceneObject.id)));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this._hideGeoPolylines,a=this._visibleGeoPolylines;this.d(c.track([r,"show"],[e,"show"])),this.d(c.track([a,"show"],[e,"show"])),this.d(c.track([a,"color"],[e,"visibleColor"])),this.d(c.track([r,"color"],[e,"invisibleColor"]));{const s=()=>{const u=e.points,A=e.heightOffset;if(!u||u.length<2||u[0].toString()===u[1].toString()){r.positions=void 0,a.positions=void 0;return}const h=[],f=[],[d,p,g]=u[0],v=[d,p,g+A];try{u.forEach((y,m)=>{if(m===0)return;const b=xS(v,y,o.scene);b?(h.push([y,b]),f.push([v,b])):f.push([v,y])}),r.positions=h,a.positions=f}catch(y){console.warn(y)}};s();const l=this.dv(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightOffsetChanged));this.d(l.don(s))}}get hideGeoPolylines(){return this._hideGeoPolylines}get visibleGeoPolylines(){return this._visibleGeoPolylines}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyToParam||o.flyInParam)return super.flyTo(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;if(!r.actived)return!1;if(o.flyInParam)return super.flyIn(e,i);{let a=[];return this.visibleGeoPolylines.positions&&(a=[...this.visibleGeoPolylines.positions.flat()]),this.hideGeoPolylines.positions&&(a=[...a,...this.hideGeoPolylines.positions.flat()]),Me(r,o,i,a,e),!0}}};L(jc,"type",jc.register("ESCesiumViewer",c.ESVisibilityAnalysis.type,jc));let ev=jc;class yu extends c.Destroyable{constructor(e,i){super();L(this,"_flyToEvent",this.dv(new c.Event));L(this,"_enableEvent",this.dv(new c.Event));L(this,"_clearEvent",this.dv(new c.Event));L(this,"_gridPoints",this.dv(c.reactJson([])));L(this,"excavationPolylines");L(this,"fillPolylines");const o=e.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.dv(new Dn(e,i)),a=this.dv(new Dn(e,i));this.excavationPolylines=r,this.fillPolylines=a;const s=r;s.color=[1,1,0,1],this.d(c.track([s,"show"],[this,"show"])),s.show=!1,s.depthTest=!0;const l=a;l.color=[0,0,1,1],this.d(c.track([l,"show"],[this,"show"])),l.show=!1;{const d=this.ad(new Ti(e,i));this.d(c.track([d,"show"],[this,"show"])),this.d(c.bind([d,"allowPicking"],[this,"allowPicking"])),this.d(c.bind([d,"positions"],[this,"positions"])),this.d(c.bind([d,"depthTest"],[this,"depthTest"])),this.d(c.bind([d,"outlineWidth"],[this,"outlineWidth"])),this.d(c.bind([d,"outlineColor"],[this,"outlineColor"])),this.d(c.bind([d,"outline"],[this,"outline"])),this.d(c.bind([d,"color"],[this,"fillColor"])),this.d(c.bind([d,"fill"],[this,"filled"])),this.d(c.bind([d,"strokeGround"],[this,"strokeGround"])),this.d(c.bind([d,"ground"],[this,"fillGround"])),this.d(this.flyToEvent.don(v=>{d.flyTo(v)}));const p=()=>{d.positions=this.positions};p();const g=this.dv(c.createNextAnimateFrameEvent(this.positionsChanged));this.d(g.don(p))}const u=()=>{if(!this.positions||!this.positions.length)return;const{minPos:d,maxPos:p}=c.getMinMaxCorner(this.positions),g=d[0],v=d[1],y=p[0],m=p[1],x={type:"Polygon",coordinates:[[...this.positions.map(T=>[T[0],T[1]])]]},E=[g,v,y,m],B=this.gridWidth,M=L_(E,B,{units:"meters",mask:x}).features.map(T=>T.geometry.coordinates),F=_.Math.toRadians;return M.map(T=>new _.Cartographic(F(T[0]),F(T[1])))},A=()=>{s.positions=[],l.positions=[],this.area=0,this.cutVolume=0,this.fillVolume=0,this.cutAndFillVolume=0,s.depthTest=!0},h=this.dv(c.createProcessingFromAsyncFunc(async d=>{const p=u();let g=0,v=300;const y=Math.ceil(p.length/v),m=[];do{let b=[];g===y-1?b=p.slice(g*v):b=p.slice(g*v,(g+1)*v);const x=o.scene.sampleHeightMostDetailed(b),E=await d.promise(x);if(g===y-1?this.progress=Math.round(this.progress+100/y):this.progress+=100/y,E&&E.length){const B=_.Math.toDegrees,P=E.filter(I=>I!=null).map(I=>[B(I.longitude),B(I.latitude),I.height]);m.push(...P)}g++}while(g<y);!m||!m.length||(this.gridPoints=m)}));let f=null;{const d=()=>{if(!this.positions||!this.positions.length||!this.gridPoints)return;let p=0;const g=[];let v=0;const y=[];this.gridPoints.forEach(m=>{const b=this.positions;m[2]>b[0][2]?(p+=this.gridWidth*this.gridWidth*(m[2]-b[0][2]),g.push([m,[m[0],m[1],b[0][2]]])):(v+=this.gridWidth*this.gridWidth*(b[0][2]-m[2]),y.push([m,[m[0],m[1],b[0][2]]]))}),s.positions=g,l.positions=y,s.show=!0,l.show=!0,this.area=Sx(this.positions),this.cutVolume=p,this.fillVolume=v,this.cutAndFillVolume=v-p,f&&clearTimeout(f),f=setTimeout(()=>{s.depthTest=!1},200)};d(),this.d(this.gridPointsChanged.don(d)),this.d(()=>clearTimeout(f))}{const d=()=>{if(!this.positions||!this.positions.length){this.planeHeight=void 0;return}this.planeHeight=this.positions[0][2]};d(),this.d(this.positionsChanged.don(d))}{const d=()=>{if(!this.planeHeight||!this.positions||!this.positions.length)return;const p=JSON.parse(JSON.stringify(this.positions.slice(1)));p.unshift([this.positions[0][0],this.positions[0][1],this.planeHeight]),this.positions=p};d(),this.d(this.planeHeightChanged.don(d))}this.d(this.enableEvent.don(()=>{A(),this.gridPoints=[],this.progress=0,h.restart()})),this.d(this.clearEvent.don(()=>{A()}))}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:c.reactPositions(void 0),planeHeight:c.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})})(yu||(yu={})),c.extendClassProps(yu.prototype,yu.createDefaultProps);const qc=class qc extends Un{constructor(e,i){super(e,i);L(this,"_geoVolumeMeasurement");if(this._geoVolumeMeasurement=this.dv(new yu(this.czmViewer,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._geoVolumeMeasurement;this.d(c.track([r,"show"],[e,"show"])),this.d(c.bind([r,"positions"],[e,"points"])),this.d(c.track([r,"allowPicking"],[e,"allowPicking"])),this.d(c.bind([r,"planeHeight"],[e,"planeHeight"])),this.d(c.track([r,"gridWidth"],[e,"gridWidth"])),this.d(c.track([e,"cutVolume"],[r,"cutVolume"])),this.d(c.track([e,"fillVolume"],[r,"fillVolume"])),this.d(c.track([e,"cutAndFillVolume"],[r,"cutAndFillVolume"])),this.d(c.bind([e,"progress"],[r,"progress"])),this.d(c.track([r,"depthTest"],[e,"depthTest"])),this.d(c.track([r,"outline"],[e,"stroked"])),this.d(c.track([r,"outlineWidth"],[e,"strokeWidth"])),this.d(c.track([r,"outlineColor"],[e,"strokeColor"])),this.d(c.track([r,"filled"],[e,"filled"])),this.d(c.track([r,"fillColor"],[e,"fillColor"])),this.d(c.track([r,"fillGround"],[e,"fillGround"])),this.d(c.track([r,"strokeGround"],[e,"strokeGround"])),this.ad(c.track([e,"volume"],[e,"cutAndFillVolume"])),this.d(e.startEvent.don(()=>{r.enableEmit()})),this.d(e.clearEvent.don(()=>{r.clearEmit()}))}get geoVolumeMeasurement(){return this._geoVolumeMeasurement}flyTo(e,i){const{sceneObject:o,czmViewer:r,geoVolumeMeasurement:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):a.positions?(Me(r,o,i,a.positions,e),!0):!1:!1}};L(qc,"type",qc.register("ESCesiumViewer",c.ESVolumeMeasurement.type,qc));let tv=qc;const Kc=class Kc extends Un{constructor(e,i){super(e,i);L(this,"czmEntity");L(this,"czmPolyline",this.ad(new c.ESGeoLineString));const o=i.viewer;if(!o){console.warn("viewer is undefined!");return}const r=this.czmPolyline;i.add(r),this.ad(()=>i.delete(r)),this.ad(c.bind([r,"show"],[e,"show"])),this.ad(c.bind([r,"allowPicking"],[e,"allowPicking"])),this.ad(c.bind([r,"stroked"],[e,"stroked"])),this.ad(c.bind([r,"strokeColor"],[e,"strokeColor"])),this.ad(c.bind([r,"strokeWidth"],[e,"strokeWidth"])),this.ad(c.bind([r,"strokeGround"],[e,"strokeGround"]));{const u=()=>{if(!e.points||e.points.length<2)r.points=e.points;else{const h=structuredClone(e.points);h.push(h[0]),e.perPositionHeight?r.points=h:r.points=h.map(f=>(f[2]=e.height??c.ESGeoExtrudedPolygon.defaults.height,f))}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.heightChanged,e.perPositionHeightChanged));this.ad(A.don(u))}const a=this.czmEntity=o.entities.add({polygon:{}});_.Entity.prototype&&(a.ESSceneObjectID=e.id),this.dispose(()=>o.entities.remove(a));let s=new _.PolygonHierarchy;a.polygon&&(a.polygon.hierarchy=new _.CallbackProperty(()=>s,!1));const l=()=>{const u=$t(e.points??[]);if(u.length<2){s=new _.PolygonHierarchy;return}s=new _.PolygonHierarchy(u)};l(),this.dispose(e.pointsChanged.disposableOn(l));{const u=()=>{a.show=e.show&&e.filled,this.geoPolygon&&(this.geoPolygon.show=e.show&&!a.show&&e.filled)};u();const A=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.filledChanged));this.ad(A.don(u))}{const u=()=>{a.polygon&&(a.polygon.perPositionHeight=new _.ConstantProperty(e.perPositionHeight),l())};u(),this.ad(e.perPositionHeightChanged.don(u))}{const u=()=>{a.polygon&&(a.polygon.height=new _.ConstantProperty(e.height??c.ESGeoExtrudedPolygon.defaults.height))};u(),this.dispose(e.heightChanged.disposableOn(u))}{const u=()=>{a.polygon&&(a.polygon.extrudedHeight=new _.ConstantProperty(e.extrudedHeight??c.ESGeoExtrudedPolygon.defaults.extrudedHeight))};u(),this.dispose(e.extrudedHeightChanged.disposableOn(u))}{const u=()=>{const A=_.Color.fromCartesian4(_.Cartesian4.fromArray(e.fillColor));a.polygon&&(a.polygon.material=A)};u(),this.dispose(e.fillColorChanged.disposableOn(u))}this.disposeVar(new c.ObjResettingWithEvent(e.allowPickingChanged,()=>{if(!e.allowPicking)return new ot.ObjectsToExcludeWrapper(i,a)}))}getMinAndMaxheight(){const{sceneObject:e}=this;if(e.points){const{minPos:i,maxPos:o}=c.getMinMaxCorner(e.points);return[i[2],o[2]]}return[0,0]}};L(Kc,"type",Kc.register("ESCesiumViewer",c.ESGeoExtrudedPolygon.type,Kc));let nv=Kc;const Zc=class Zc extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}const{human:o,poi:r}=n;this.dispose(c.bind([o,"position"],[n,"position"])),this.dispose(c.bind([o,"rotation"],[n,"rotation"])),this.ad(c.bind([o,"scale"],[n,"scale"])),this.ad(c.track([r,"scale"],[n,"scale"])),this.dispose(c.track([r,"rotation"],[n,"rotation"]));const a=()=>{const l=n.position;r.position=[l[0],l[1],l[2]+n.poiOffsetHeight]};a();const s=this.dv(c.createNextAnimateFrameEvent(n.positionChanged,n.poiOffsetHeightChanged));this.d(s.don(a)),this.ad(r.pickedEvent.don(l=>{l.assign({sceneObject:n}),n.pickedEvent.emit(l)}))}};L(Zc,"type",Zc.register("ESCesiumViewer",c.ESHumanPoi.type,Zc));let iv=Zc;const $c=class $c extends c.EngineObject{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}this.d(n.highlightInner3DtilesetEvent.don(o=>{o.strokeFeature([]);const r=o.d(o.tilesetReady.donce(l=>{l.allTilesLoaded.addEventListener(()=>{var A,h,f,d;const u=(d=(f=(h=(A=l==null?void 0:l._root)==null?void 0:A._content)==null?void 0:h._model)==null?void 0:f._featureTables[0])==null?void 0:d._features[0];u?o.strokeFeature([u],_.Color.LIME.toBytes().map(p=>p/255)):console.warn("tileset?._root?._content?._model?._featureTables[0]?._features[0] is undefined !",l),r()})})),a=o.url,s=Date.now();a.includes("?reload=")?o.url=a.replace(/\?reload=\d+/,`?reload=${s}`):o.url=a+`?reload=${s}`})),this.d(n.removeHighlightInner3DtilesetEvent.don(o=>{o.strokeFeature([])})),this.d(n.es3DTileset.tilesetReady.don(o=>{const r=()=>{const s=n.layerConfig;if(!s){o.style=void 0;return}const l=n.colorBlendMode,u=(f,d)=>{try{if(f.getPropertyIds().includes("materialName"))return _.Color.clone(_.Color.WHITE,d);const p=f.getProperty("layer"),g=f.getProperty("dataset"),v=p.toString(),y=g.toString(),m=s.find(x=>x.dataset.toString()===y&&x.layer.toString()===v);if(m&&m.value.color){const x=m.value.color;return _.Color.fromCssColorString(x,d)}const b=s.filter(x=>x.dataset.toString()===y);if(b.length==1&&b[0].value.color){const x=b[0].value.color;return _.Color.fromCssColorString(x,d)}else return _.Color.clone(_.Color.WHITE,d)}catch(p){return console.warn(p),_.Color.clone(_.Color.WHITE,d)}},A=f=>{try{if(f.getPropertyIds().includes("id")){const b=Object.entries(n.visJson);for(let x=0;x<b.length;x++){const E=b[x];if(f.getProperty("id").toString()===E[0])return E[1]}}if(f.getPropertyIds().includes("materialName"))return!0;const d=f.getProperty("layer"),p=f.getProperty("dataset"),g=d.toString(),v=p.toString(),y=s.find(b=>b.dataset.toString()===v&&b.layer.toString()===g);if(y&&y.value.visible===!1)return!1;if(y&&y.value.visible===!0)return!0;const m=s.filter(b=>b.dataset.toString()===v);return!(m.length==1&&m[0].value.visible===!1)}catch(d){return console.warn(d),!0}};let h;l!=="HIGHLIGHT"?h=new _.Cesium3DTileStyle({color:{evaluateColor:function(f,d){return u(f,d)}},show:{evaluate:function(f){return A(f)}}}):h=new _.Cesium3DTileStyle({show:{evaluate:function(f){return A(f)}}}),console.log("style",h),o.style=h};r();const a=this.dv(c.createNextAnimateFrameEvent(n.layerConfigChanged,n.colorBlendModeChanged,n.visJsonChanged));this.d(a.don(()=>{r()}))}))}};L($c,"type",$c.register("ESCesiumViewer",c.ESRtsTileset.type,$c));let rv=$c;const Xc=class Xc extends la{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Xc,"type",Xc.register("ESCesiumViewer",c.ESRtsFeatureEditing.type,Xc));let ov=Xc;const Yc=class Yc extends la{constructor(n,e){if(super(n,e),!e.viewer){console.warn("viewer is undefined!");return}}};L(Yc,"type",Yc.register("ESCesiumViewer",c.ESMsTileset.type,Yc));let sv=Yc;const Jc=class Jc extends He{constructor(e,i){super(e,i);L(this,"_czmGeoPoint");if(this._czmGeoPoint=this.disposeVar(new Wn(i,e.id)),!i.viewer){console.warn("viewer is undefined!");return}const r=this._czmGeoPoint;this.dispose(c.track([r,"show"],[e,"show"])),this.dispose(c.bind([r,"position"],[e,"position"]))}get czmGeoPoint(){return this._czmGeoPoint}flyTo(e,i){const{sceneObject:o,czmViewer:r,czmGeoPoint:a}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):(a.flyTo(e),o.flyOverEvent.emit(i,"over",r),!0):!1}};L(Jc,"type",Jc.register("ESCesiumViewer",c.ESStaticMesh.type,Jc));let av=Jc;const eh=class eh extends on{constructor(n,e){super(n,e);const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=this.ad(new b0(i));this.ad(n.startEvent.don(async()=>{const r=await o.getDepthsFromScreen(),a=Number.isFinite(n.radius)?n.radius:c.ESSkylineAnalysis.defaults.radius,{depths:s,windowPositions:l,positions:u}=o.getSkylineDepthsAndPositions(r,i.scene.canvas.width,i.scene.canvas.height,a),A=Ue(i.camera.position);u.push(A),n.depths=s,n.windowPositions=l,n.points=u}))}flyTo(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyToParam||i.flyInParam?super.flyTo(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}flyIn(n,e){const{sceneObject:i,czmViewer:o}=this;return o.actived?i.flyInParam?super.flyIn(n,e):i.points?(Me(o,i,e,i.points,n),!0):!1:!1}};L(eh,"type",eh.register("ESCesiumViewer",c.ESSkylineAnalysis.type,eh));let lv=eh;class j8 extends c.Destroyable{constructor(e,i){super();L(this,"_rectangle");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));const o=e.sceneObject;this._rectangle=this.ad(new Ci(i,o.id)),this._rectangle.ground=!0,this._rectangle.outline=!1,this.ad(c.bind([this.rectangle,"show"],[o,"show"])),this.ad(c.bind([this.rectangle,"allowPicking"],[o,"allowPicking"])),this.ad(this.updateHeatMapEvent.don(r=>{this.rectangle.rectangle=e.rectangle,this.rectangle.material={type:"Image",image:r}}))}get rectangle(){return this._rectangle}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}}class q8 extends c.Destroyable{constructor(e,i){super();L(this,"_primitive");L(this,"_updateHeatMapEvent",this.disposeVar(new c.Event));L(this,"czmViewer");L(this,"czmESHeatMap");const o=this.czmViewer=i,r=this.czmESHeatMap=e,a=r.sceneObject,s=o.viewer;if(!s)return;let l,u;const A=this.ad(new c.Event),h=()=>{f(),!(!l||!u)&&(this._primitive=s.scene.primitives.add(new _.Primitive({geometryInstances:l,appearance:u,asynchronous:!1,allowPicking:a.allowPicking})))},f=()=>{this.primitive&&s.scene.primitives.remove(this.primitive)};this.ad(f);{const d=()=>{this.primitive&&(this.primitive.show=a.show)};d(),this.ad(a.showChanged.don(d))}{const d=this.ad(c.createNextAnimateFrameEvent(a.allowPickingChanged,A));this.ad(d.don(h))}{const d=()=>{r.rectangle&&(l=new _.GeometryInstance({geometry:this.createHeatmapGeometry(Number.parseFloat(r.div.style.width),Number.parseFloat(r.div.style.height))}),this.primitive&&(this._primitive._state=3,this._primitive._appearance=void 0,this._primitive.geometryInstances=l,this._primitive._recomputeBoundingSpheres=!0))};this.ad(this.updateHeatMapEvent.don(p=>{if(!r.rectangle)return;const g=r.rectangle[1]+(r.rectangle[3]-r.rectangle[1])*.5,v=c.getDistancesFromPositions([[r.rectangle[0],g,0],[r.rectangle[2],g,0]],"GEODESIC")[0]/5;u=new _.MaterialAppearance({material:new _.Material({fabric:{type:"Image",uniforms:{image:p}},translucent:!0}),vertexShaderSource:this.getVertexShaderSource(v),flat:!0}),this.primitive&&r.rectangle&&(this.primitive.appearance.material.uniforms.image=p,this.primitive.appearance._vertexShaderSource=this.getVertexShaderSource(v)),d(),this.primitive||A.emit()}))}}get primitive(){return this._primitive}get updateHeatMapEvent(){return this._updateHeatMapEvent}updateHeatMap(e){this._updateHeatMapEvent.emit(e)}getVertexShaderSource(e){return`
3742
3742
  in vec3 position3DHigh;
3743
3743
  in vec3 position3DLow;
3744
3744
  in vec3 normal;
@@ -3761,7 +3761,7 @@ void main()
3761
3761
  p += vec4(color.a * upDir * ${e??1e3}, 0.0);
3762
3762
 
3763
3763
  gl_Position = czm_modelViewProjectionRelativeToEye * p;
3764
- }`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,h=(u-s)/(r-1),f=(A-l)/(a-1),d=[],p=[],g=[],v=[];for(let y=0;y<r;y++){const m=s+h*y;for(let b=0;b<a;b++){const x=l+f*b;o.heatmap.getValueAt({x:y,y:b});const E=_.Cartesian3.fromDegrees(m,x,o.heatmap._renderer._min);d.push(E.x,E.y,E.z),p.push(y/(r-1),b/(a-1)),b!==a-1&&y!==r-1&&(g.push((y+1)*a+b+1,y*a+b+1,y*a+b),g.push(y*a+b,(y+1)*a+b,(y+1)*a+b+1))}}return this.createGeometry(d,p,g,v)}createGeometry(e,i,o,r){return new _.Geometry({attributes:new _.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:_.BoundingSphere.fromVertices(e,new _.Cartesian3,3),primitiveType:_.PrimitiveType.TRIANGLES})}}const Bn={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 q8{constructor(n){L(this,"_coordinator");L(this,"_data");L(this,"_radi");L(this,"_min");L(this,"_max");L(this,"_xField");L(this,"_yField");L(this,"_valueField");L(this,"_cfgRadius");this._coordinator=new _S,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||Bn.defaultXField,this._yField=n.yField||n.defaultYField||Bn.defaultYField,this._valueField=n.valueField||n.defaultValueField||Bn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||Bn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_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(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class K8{constructor(n){L(this,"shadowCanvas");L(this,"canvas");L(this,"_renderBoundaries");L(this,"_width");L(this,"_height");L(this,"shadowCtx");L(this,"ctx");L(this,"_palette");L(this,"_templates");L(this,"_blur",Bn.defaultBlur);L(this,"_opacity",0);L(this,"_maxOpacity",Bn.defaultMaxOpacity*255);L(this,"_minOpacity",Bn.defaultMinOpacity*255);L(this,"_useGradientOpacity",!1);L(this,"_min",0);L(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.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(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||Bn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,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(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||Bn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||Bn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||Bn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class _S{constructor(){L(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class Z8{constructor(n={}){L(this,"_config");L(this,"_coordinator");L(this,"_renderer");L(this,"_store");if(this._config={...Bn,...n},this._coordinator=new _S,this._config.plugin){const e=Bn.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 K8(this._config),this._store=new q8(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||Bn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},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(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const $8=t=>new Z8(t),th=class th extends Nn{constructor(e,i){super(e,i);L(this,"_heatmap");L(this,"_div");L(this,"_primitiveObj");L(this,"_rectangle",this.disposeVar(c.react(void 0)));L(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new c.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new j8(this,i):new W8(this,i))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=$8({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new c.Event);let s=[],l={max:100,min:0};{const u=()=>{const h={radius:e.radius??c.ESHeatMap.defaults.radius,gradient:e.gradient??c.ESHeatMap.defaults.gradient,blur:e.blur??c.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(h),this.heatmap._store._cfgRadius=h.radius,a.emit()};u();const A=this.ad(c.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:h,minPos:f}=c.getMinMaxCorner(e.data),d=h[0]-f[0],p=h[1]-f[1];if(l={max:h[2]??100,min:f[2]??0},!Number.isFinite(d)||!Number.isFinite(p)||d<=0||p<=0)return;const g=1/Math.cos((f[1]+p*.5)*Math.PI/180);if(g==1/0)return;const v=r*p/d*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=d/r*(e.radius??c.ESHeatMap.defaults.radius)*2,m=p/v*(e.radius??c.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[f[0]-y,f[1]-m,h[0]+y,h[1]+m],s=X8(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.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,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};L(th,"type",th.register("ESCesiumViewer",c.ESHeatMap.type,th));let uv=th;function X8(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const nh=class nh extends on{constructor(e,i){super(e,i);L(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Ro(i,e.id)),this._updateShow();const r=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.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(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??c.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??c.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??c.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??c.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(nh,"type",nh.register("ESCesiumViewer",c.ESGeoPoints.type,nh));let cv=nh;const As=class As extends In{constructor(e){super();L(this,"_config",this.disposeVar(c.react(As.defaultConfig)));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_pointerEventFilterFunc",this.disposeVar(c.react(As.defaultPointerEventFilterFunc)));L(this,"point");L(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 c.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new Y8(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 Wn(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}};L(As,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),L(As,"defaultPointerEventFilterFunc",e=>e.button===0),L(As,"defaults",{...In.defaults,position:[116.39,39.9,0]});let Li=As;(t=>{t.createDefaultProps=()=>({...In.createDefaultProps(),position:c.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Li||(Li={})),c.extendClassProps(Li.prototype,Li.createDefaultProps);class Y8 extends c.Destroyable{constructor(e,i){super();L(this,"_doings",[]);L(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;const o=(r,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(r=>{if(!r.pointerEvent)return;const a=new J8(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class J8 extends c.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=Xv(o,e,this._owner.placeEditing.virtualHeight),[a]=c.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class zn extends In{constructor(){super()}}L(zn,"defaults",{...In.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...In.createDefaultProps(),position:c.reactArrayWithUndefined(void 0)})})(zn||(zn={})),c.extendClassProps(zn.prototype,zn.createDefaultProps);function hv(t,n){const e=new Ye(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const ii=class ii extends c.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(hv(n,ii.defaults.xAxisColor)),i=this.disposeVar(hv(n,ii.defaults.yAxisColor)),o=this.disposeVar(hv(n,ii.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(c.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=ii.defaults.position,heading:l=ii.defaults.heading}=this,[u,A,h]=s,{dimensions:f=ii.defaults.dimensions}=this;o.positions=[s,[u,A,h+f[2]]];const d=c.geoRhumbDestination(s,f[0],90+l);d&&(e.positions=[s,d]);const p=c.geoRhumbDestination(s,f[1],0+l);p&&(i.positions=[s,p])};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??ii.defaults.xAxisColor,i.color=this.yAxisColor??ii.defaults.yAxisColor,o.color=this.zAxisColor??ii.defaults.zAxisColor};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};L(ii,"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 io=ii;(t=>{t.createDefaultProps=()=>({show:!0,position:c.reactArrayWithUndefined(void 0),heading:0,dimensions:c.reactArray([1e3,1e3,1e3]),xAxisColor:c.reactArray([1,0,0,1]),yAxisColor:c.reactArray([0,1,0,1]),zAxisColor:c.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(io||(io={})),c.extendClassProps(io.prototype,io.createDefaultProps);const co=class co extends zn{constructor(e){super();L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.ad(c.react("none")),originPosition:this.disposeVar(c.reactArray(zn.defaults.position)),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_createCoordinates",e=>{const i=this.ad(new io(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{CS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??co.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});L(this,"_createOriginCoordinates",e=>{const i=this.ad(new io(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});L(this,"_createGrid",e=>{const i=this.ad(new ai(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s+90);if(h){const f=c.geoRhumbDestination(h,l,s+180),d=c.geoRhumbDestination(h,l,s);f&&d&&u.push([f,h,d])}}for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s);if(h){const f=c.geoRhumbDestination(h,l,s-90),d=c.geoRhumbDestination(h,l,s+90);f&&d&&u.push([f,h,d])}}i.positions=u};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});L(this,"_createHelpLine",e=>{const i=this.ad(new Ye(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});L(this,"_createCircle",e=>{const i=this.ad(new ai(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const h=c.geoRhumbDestination(a,s,A*360/u);h&&l.push(h)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});L(this,"_pickingXYProcessing",e=>this.ad(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!gs(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;Ao(s,a),this._opInfo.constraintMode.value==="x"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));L(this,"_pickingZProcessing",e=>this.ad(new c.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!_h(e.viewer.scene,ft(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));L(this,"_pickingZAxisProcessing",e=>this.ad(new c.Processing(()=>{const i=[0,0,0],o=new _.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!gs(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;Ao(o,i);const s=c.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=c.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=_.Math.toDegrees(_.Math.negativePiToPi(_.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(c.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new vp(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));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((r,a)=>r===this._opInfo.targetPosition.value[a])){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),r=this._createOriginCoordinates(e),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const A=this.ad(c.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(c.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],CS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),h=this._pickingZAxisProcessing(e),f=()=>{const b=[...this.position??co.defaults.position];e.editingHeightOffset&&(b[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=b},d=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,p=()=>this._opInfo.originDimensions.value=i.value,g={constraintMode:"none",startDragPos:[0,0,0]},v=b=>{const x={position:o.position??co.defaults.position,heading:o.heading??co.defaults.heading,dimensions:o.dimensions??co.defaults.dimensions};e.viewer&&ap(b,e.viewer.scene,x,this.axisSnapPixelSize,g,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=g.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=g.startDragPos},y=this.ad(c.createProcessingFromAsyncFunc(async b=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",b.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(b,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((d(),this.headingChanged.don(d))),x.disposer.dispose((p(),i.changed.don(p))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&g.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await c.step(b,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(h.restart(),x.disposer.dispose(()=>h.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),m=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};m(),this.ad(this.enabledChanged.don(m))}}}};L(co,"defaults",{...zn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let lr=co;(t=>{t.createDefaultProps=()=>({...zn.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})})(lr||(lr={})),c.extendClassProps(lr.prototype,lr.createDefaultProps);function CS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class Av extends c.HasOwner{constructor(e){super(e);L(this,"_valid",!1);L(this,"_normal",new _.Cartesian3(0,0,0));L(this,"_origin",new _.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 i=this.owner.cartesian,o=oi(e);return Yv(this.scene,i,this.normal,o)}}class eV extends Av{constructor(n){super(n);{const e=()=>{const o=st({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 i=this.ad(c.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class tV extends Av{constructor(n){super(n);const e=()=>{const i=st({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=st({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.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 nV extends Av{constructor(n){super(n);const e=()=>{const i=st({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=st({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.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 Ra extends c.Destroyable{constructor(e){super();L(this,"_czmTexture");L(this,"_customPrimitiveForCircle");L(this,"_circleCanvas");L(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ht(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 i=this.disposeVar(c.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,h=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[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,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=h,u.stroke();{u.lineWidth=1,u.beginPath();let p=_.Math.zeroToTwoPi(l.startRotation),g=_.Math.zeroToTwoPi(l.endRotation);g<p&&(g+=_.Math.TWO_PI),(p!==g||p!==0)&&(u.moveTo(128,128),u.arc(128,128,64,p,g,g-p>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=_.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,_.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(_.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var d=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=_.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-d*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(c.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=st({rotation:this.selfRotation});if(!s)return;const l=st({position:this.position,rotation:this.rotation,localModelMatrix:_.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=_.Cartesian3.dot(u.scene.camera.directionWC,new _.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(c.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(iV(e)),this.dispose(c.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(c.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(c.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(c.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=st({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(rV(e)),this.dispose(c.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([this._debugAxis,"position"],[this,"position"])),this.dispose(c.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(c.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=st({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}L(Ra,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,color:c.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(Ra||(Ra={})),c.extendClassProps(Ra.prototype,Ra.createDefaultProps);function iV(t){return Cp({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]},at,t)}function rV(t){return Cp({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
3764
+ }`}createHeatmapGeometry(e,i){const o=this.czmESHeatMap,r=e||256,a=Math.ceil(i||256),[s,l,u,A]=o.rectangle,h=(u-s)/(r-1),f=(A-l)/(a-1),d=[],p=[],g=[],v=[];for(let y=0;y<r;y++){const m=s+h*y;for(let b=0;b<a;b++){const x=l+f*b;o.heatmap.getValueAt({x:y,y:b});const E=_.Cartesian3.fromDegrees(m,x,o.heatmap._renderer._min);d.push(E.x,E.y,E.z),p.push(y/(r-1),b/(a-1)),b!==a-1&&y!==r-1&&(g.push((y+1)*a+b+1,y*a+b+1,y*a+b),g.push(y*a+b,(y+1)*a+b,(y+1)*a+b+1))}}return this.createGeometry(d,p,g,v)}createGeometry(e,i,o,r){return new _.Geometry({attributes:new _.GeometryAttributes({position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:new Float32Array(i)})}),indices:new Uint32Array(o),boundingSphere:_.BoundingSphere.fromVertices(e,new _.Cartesian3,3),primitiveType:_.PrimitiveType.TRIANGLES})}}const Bn={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 K8{constructor(n){L(this,"_coordinator");L(this,"_data");L(this,"_radi");L(this,"_min");L(this,"_max");L(this,"_xField");L(this,"_yField");L(this,"_valueField");L(this,"_cfgRadius");this._coordinator=new _S,this._data={},this._radi={},this._min=0,this._max=1,this._xField=n.xField||n.defaultXField||Bn.defaultXField,this._yField=n.yField||n.defaultYField||Bn.defaultYField,this._valueField=n.valueField||n.defaultValueField||Bn.defaultValueField,n.radius&&(this._cfgRadius=n.radius)}_organiseData(n,e){const i=n[this._xField],o=n[this._yField],r=n[this._valueField]||1,a=n.radius||this._cfgRadius||Bn.defaultRadius;return this._data[i]||(this._data[i]={},this._radi[i]={}),this._data[i][o]?this._data[i][o]+=r:(this._data[i][o]=r,this._radi[i][o]=a),this._data[i][o]>this._max?(e?this.setDataMax(this._data[i][o]):this._max=this._data[i][o],!1):{x:i,y:o,value:r,radius:a,min:this._min,max:this._max}}_unOrganizeData(){const n=[];for(const e in this._data)for(const i in this._data[e])n.push({x:Number(e),y:Number(i),radius:this._radi[e][i],value:this._data[e][i]});return{min:this._min,max:this._max,data:n}}_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(n){if(Array.isArray(n))n.forEach(e=>this.addData(e));else{const e=this._organiseData(n,!0);e&&this._coordinator.emit("renderpartial",{min:this._min,max:this._max,data:[e]})}return this}setData(n){this._data={},this._radi={};for(const e of n.data)this._organiseData(e,!1);return this._max=n.max,this._min=n.min||0,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMax(n){return this._max=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setDataMin(n){return this._min=n,this._onExtremaChange(),this._coordinator.emit("renderall",this._getInternalData()),this}setCoordinator(n){this._coordinator=n}getData(){return this._unOrganizeData()}}class Z8{constructor(n){L(this,"shadowCanvas");L(this,"canvas");L(this,"_renderBoundaries");L(this,"_width");L(this,"_height");L(this,"shadowCtx");L(this,"ctx");L(this,"_palette");L(this,"_templates");L(this,"_blur",Bn.defaultBlur);L(this,"_opacity",0);L(this,"_maxOpacity",Bn.defaultMaxOpacity*255);L(this,"_minOpacity",Bn.defaultMinOpacity*255);L(this,"_useGradientOpacity",!1);L(this,"_min",0);L(this,"_max",1);const e=n.container;this.shadowCanvas=document.createElement("canvas"),this.canvas=n.canvas||document.createElement("canvas"),this._renderBoundaries=[1e4,1e4,0,0];const i=getComputedStyle(e);this.canvas.className="heatmap-canvas",this._width=this.canvas.width=this.shadowCanvas.width=+i.width.replace(/px/,""),this._height=this.canvas.height=this.shadowCanvas.height=+i.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(n),this._templates={},this._setStyles(n)}_getColorPalette(n){const e=n.gradient||n.defaultGradient||Bn.defaultGradient,i=document.createElement("canvas"),o=i.getContext("2d");i.width=256,i.height=1;const r=o.createLinearGradient(0,0,256,1);for(const a in e)r.addColorStop(Number(a),e[a]);return o.fillStyle=r,o.fillRect(0,0,256,1),o.getImageData(0,0,256,1).data}_getPointTemplate(n,e){const i=document.createElement("canvas"),o=i.getContext("2d"),r=n,a=n;if(i.width=i.height=n*2,e===1)o.beginPath(),o.arc(r,a,n,0,2*Math.PI,!1),o.fillStyle="rgba(0,0,0,1)",o.fill();else{const s=o.createRadialGradient(r,a,n*e,r,a,n);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),o.fillStyle=s,o.fillRect(0,0,2*n,2*n)}return i}renderPartial(n){this._drawAlpha(n),this._colorize()}renderAll(n){this._clear(),this._drawAlpha(this._prepareData(n)),this._colorize()}_prepareData(n){const e=[],i=Object.keys(n.data);for(const o of i){const r=Object.keys(n.data[o]);for(const a of r)e.push({x:Number(o),y:Number(a),value:n.data[o][a],radius:n.radi[o][a]})}return{min:n.min,max:n.max,data:e}}updateConfig(n){n.gradient&&(this._palette=this._getColorPalette(n)),this._setStyles(n)}setDimensions(n,e){this._width=n,this._height=e,this.canvas.width=this.shadowCanvas.width=n,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(n){this._blur=n.blur===0?0:n.blur||n.defaultBlur||Bn.defaultBlur,n.backgroundColor&&(this.canvas.style.backgroundColor=n.backgroundColor),this._opacity=(n.opacity||0)*255,this._maxOpacity=(n.maxOpacity||n.defaultMaxOpacity||Bn.defaultMaxOpacity)*255,this._minOpacity=(n.minOpacity||n.defaultMinOpacity||Bn.defaultMinOpacity)*255,this._useGradientOpacity=!!n.useGradientOpacity}_drawAlpha(n){this._min=n.min,this._max=n.max;const e=1-this._blur;for(const i of n.data){const o=i.radius,r=i.x-o,a=i.y-o,s=Math.min(i.value,this._max);this._templates[o]=this._getPointTemplate(o,e),this.shadowCtx.globalAlpha=(s-this._min)/(this._max-this._min),this.shadowCtx.drawImage(this._templates[o],r,a),this._renderBoundaries[0]=Math.min(this._renderBoundaries[0],r),this._renderBoundaries[1]=Math.min(this._renderBoundaries[1],a),this._renderBoundaries[2]=Math.max(this._renderBoundaries[2],r+2*o),this._renderBoundaries[3]=Math.max(this._renderBoundaries[3],a+2*o)}}_colorize(){let[n,e,i,o]=this._renderBoundaries;n=Math.max(0,n),e=Math.max(0,e),i=Math.min(this._width-n,i-n),o=Math.min(this._height-e,o-e);const r=this.shadowCtx.getImageData(n,e,i,o),a=r.data;for(let s=3;s<a.length;s+=4){const l=a[s],u=l*4;if(!u)continue;let A;this._opacity>0?A=this._opacity:A=l<this._maxOpacity?l<this._minOpacity?this._minOpacity:l:this._maxOpacity,a[s-3]=this._palette[u],a[s-2]=this._palette[u+1],a[s-1]=this._palette[u+2],a[s]=this._useGradientOpacity?this._palette[u+3]:A}this.ctx.putImageData(r,n,e),this._renderBoundaries=[1e3,1e3,0,0]}getValueAt(n){const i=this.shadowCtx.getImageData(n.x,n.y,1,1).data[3];return Math.abs(this._max-this._min)*(i/255)>>0}getDataURL(){return this.canvas.toDataURL()}}class _S{constructor(){L(this,"cStore");this.cStore={}}on(n,e,i){this.cStore[n]||(this.cStore[n]=[]),this.cStore[n].push(o=>e.call(i,o))}emit(n,e){this.cStore[n]&&this.cStore[n].forEach(i=>i(e))}}class $8{constructor(n={}){L(this,"_config");L(this,"_coordinator");L(this,"_renderer");L(this,"_store");if(this._config={...Bn,...n},this._coordinator=new _S,this._config.plugin){const e=Bn.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 Z8(this._config),this._store=new K8(this._config);this._connect()}_connect(){this._coordinator.on("renderpartial",n=>this._renderer.renderPartial(n),this._renderer),this._coordinator.on("renderall",n=>this._renderer.renderAll(n),this._renderer),this._coordinator.on("extremachange",n=>{var e,i;(i=(e=this._config).onExtremaChange)==null||i.call(e,{min:n.min,max:n.max,gradient:this._config.gradient||this._config.defaultGradient||Bn.defaultGradient})}),this._store.setCoordinator(this._coordinator)}addData(n){return this._store.addData(n),this}setData(n){return this._store.setData(n),this}setDataMax(n){return this._store.setDataMax(n),this}setDataMin(n){return this._store.setDataMin(n),this}configure(n){return this._config={...this._config,...n},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(n){return this._store.getValueAt?this._store.getValueAt(n):this._renderer.getValueAt?this._renderer.getValueAt(n):null}}const X8=t=>new $8(t),th=class th extends Nn{constructor(e,i){super(e,i);L(this,"_heatmap");L(this,"_div");L(this,"_primitiveObj");L(this,"_rectangle",this.disposeVar(c.react(void 0)));L(this,"onePixelRadius",1e-4);const o=i.viewer,r=256;if(this._primitiveObj=this.ad(new c.ObjResettingWithEvent(e.is3DChanged,()=>e.is3D?new q8(this,i):new j8(this,i))),!o){console.warn("viewer is undefined!");return}this._div=document.createElement("div"),this.div.style.display="none",this.div.style.width=`${r}px`,this.div.style.height=`${r}px`,document.body.appendChild(this.div),this.ad(()=>{document.body.removeChild(this.div)}),this._heatmap=X8({container:this.div}),this.heatmap._renderer.setDimensions(r,r);const a=this.ad(new c.Event);let s=[],l={max:100,min:0};{const u=()=>{const h={radius:e.radius??c.ESHeatMap.defaults.radius,gradient:e.gradient??c.ESHeatMap.defaults.gradient,blur:e.blur??c.ESHeatMap.defaults.blur,maxOpacity:1,minOpacity:0};this.heatmap.configure(h),this.heatmap._store._cfgRadius=h.radius,a.emit()};u();const A=this.ad(c.createNextAnimateFrameEvent(e.radiusChanged,e.gradientChanged,e.blurChanged));this.ad(A.don(u))}{const u=()=>{if(e.data&&e.data.length>2){const{maxPos:h,minPos:f}=c.getMinMaxCorner(e.data),d=h[0]-f[0],p=h[1]-f[1];if(l={max:h[2]??100,min:f[2]??0},!Number.isFinite(d)||!Number.isFinite(p)||d<=0||p<=0)return;const g=1/Math.cos((f[1]+p*.5)*Math.PI/180);if(g==1/0)return;const v=r*p/d*g;this.div.style.width=`${r}px`,this.div.style.height=`${v}px`,this.heatmap._renderer.setDimensions(r,v);const y=d/r*(e.radius??c.ESHeatMap.defaults.radius)*2,m=p/v*(e.radius??c.ESHeatMap.defaults.radius)*2;this.onePixelRadius=Math.min(y,m),this.rectangle=[f[0]-y,f[1]-m,h[0]+y,h[1]+m],s=Y8(e.data,this.rectangle,r,v),a.emit()}};u();const A=this.ad(c.createNextAnimateFrameEvent(e.dataChanged,e.radiusChanged));this.ad(A.don(u))}{const u=()=>{const A={max:l.max,min:l.min,data:s};this.heatmap.setData(A),this.heatmap.repaint(),this.primitiveObj&&this.primitiveObj.updateHeatMap(this.heatmap.getDataURL())};u(),this.ad(a.don(u))}this.ad(this._primitiveObj.objChanged.don(()=>{a.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,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?super.flyTo(e,i):this.rectangle?(Me(r,o,i,[[this.rectangle[0],this.rectangle[1],0],[this.rectangle[2],this.rectangle[3],0]],e),!0):!1:!1}};L(th,"type",th.register("ESCesiumViewer",c.ESHeatMap.type,th));let uv=th;function Y8(t,n,e,i,o){return t.map(r=>({x:(r[0]-n[0])*e/(n[2]-n[0])|0,y:(1-(r[1]-n[1])/(n[3]-n[1]))*i|0,value:r[2]}))}const nh=class nh extends on{constructor(e,i){super(e,i);L(this,"czmPoints");if(!i.viewer){console.error("viewer is null");return}this.czmPoints=this.ad(new Ro(i,e.id)),this._updateShow();const r=this.ad(c.createNextAnimateFrameEvent(e.showChanged,e.pointedChanged));this.ad(r.don(()=>this._updateShow())),this._updatePoints();const a=this.ad(c.createNextAnimateFrameEvent(e.pointsChanged,e.pointStyleChanged));this.ad(a.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(i=>{var o,r,a,s;return{position:i,pixelSize:((o=this.sceneObject.pointStyle)==null?void 0:o.size)??c.ESGeoPoints.defaults.pointStyle.size,color:((r=this.sceneObject.pointStyle)==null?void 0:r.color)??c.ESGeoPoints.defaults.pointStyle.color,outlineColor:((a=this.sceneObject.pointStyle)==null?void 0:a.outlineColor)??c.ESGeoPoints.defaults.pointStyle.outlineColor,outlineWidth:((s=this.sceneObject.pointStyle)==null?void 0:s.outlineWidth)??c.ESGeoPoints.defaults.pointStyle.outlineWidth}}))}flyTo(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyToParam||o.flyInParam?(super.flyTo(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}flyIn(e,i){const{sceneObject:o,czmViewer:r}=this;return r.actived?o.flyInParam?(super.flyIn(e,i),!0):o.points?(Me(r,o,i,o.points,e),!0):!1:!1}};L(nh,"type",nh.register("ESCesiumViewer",c.ESGeoPoints.type,nh));let cv=nh;const As=class As extends In{constructor(e){super();L(this,"_config",this.disposeVar(c.react(As.defaultConfig)));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_pointerEventFilterFunc",this.disposeVar(c.react(As.defaultPointerEventFilterFunc)));L(this,"point");L(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 c.ObjResettingWithEvent(this.enabledChanged,()=>this.enabled?new J8(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 Wn(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}};L(As,"defaultConfig",{clickEnabled:!0,dblClickEnabled:!0}),L(As,"defaultPointerEventFilterFunc",e=>e.button===0),L(As,"defaults",{...In.defaults,position:[116.39,39.9,0]});let Li=As;(t=>{t.createDefaultProps=()=>({...In.createDefaultProps(),position:c.reactArrayWithUndefined(void 0),virtualHeight:void 0,clickEnabled:!0,dblClickEnabled:!1})})(Li||(Li={})),c.extendClassProps(Li.prototype,Li.createDefaultProps);class J8 extends c.Destroyable{constructor(e,i){super();L(this,"_doings",[]);L(this,"initDoings",this.ad(()=>{this._doings.forEach(e=>e.destroy()),this._doings.length=0}));this._czmViewer=e,this._placeEditing=i;const o=(r,a)=>{a=="click"&&(!i.clickEnabled||!i.pointerEventFilterFunc(r))||a=="dblclick"&&(!i.dblClickEnabled||!i.pointerEventFilterFunc(r))||(i.over(),i.enabled=!1)};this.ad(e.clickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"click")})),this.ad(e.dblclickEvent.don(r=>{r.pointerEvent&&o(r.pointerEvent,"dblclick")})),this.ad(e.pointerMoveEvent.don(r=>{if(!r.pointerEvent)return;const a=new eV(this,r.pointerEvent,s=>{if(!s||s[2]<-1e5){i.position=void 0;return}const l=[...s];e.editingHeightOffset&&(l[2]+=e.editingHeightOffset),i.position=l,this._doings.splice(0,this._doings.indexOf(a)+1).forEach(A=>A.destroy())});this._doings.push(a)}))}get czmViewer(){return this._czmViewer}get placeEditing(){return this._placeEditing}}class eV extends c.Destroyable{constructor(n,e,i){super(),this._owner=n;const{czmViewer:o}=this._owner,r=Xv(o,e,this._owner.placeEditing.virtualHeight),[a]=c.getEventFromPromise(r);this.dispose(a.disposableOn(i))}}class zn extends In{constructor(){super()}}L(zn,"defaults",{...In.defaults,position:[116.39,39.9,0]}),(t=>{t.createDefaultProps=()=>({...In.createDefaultProps(),position:c.reactArrayWithUndefined(void 0)})})(zn||(zn={})),c.extendClassProps(zn.prototype,zn.createDefaultProps);function hv(t,n){const e=new Ye(t);return e.hasArrow=!0,e.arcType="RHUMB",e.width=10,e.color=n,e}const ii=class ii extends c.Destroyable{constructor(n){if(super(),!n.viewer)return;const e=this.disposeVar(hv(n,ii.defaults.xAxisColor)),i=this.disposeVar(hv(n,ii.defaults.yAxisColor)),o=this.disposeVar(hv(n,ii.defaults.zAxisColor));{const r=()=>{e.show=this.xAxisShow&&this.show,i.show=this.yAxisShow&&this.show,o.show=this.zAxisShow&&this.show};r();const a=this.ad(c.createNextAnimateFrameEvent(this.showChanged,this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.dispose(a.disposableOn(r))}{const r=()=>{const{position:s=ii.defaults.position,heading:l=ii.defaults.heading}=this,[u,A,h]=s,{dimensions:f=ii.defaults.dimensions}=this;o.positions=[s,[u,A,h+f[2]]];const d=c.geoRhumbDestination(s,f[0],90+l);d&&(e.positions=[s,d]);const p=c.geoRhumbDestination(s,f[1],0+l);p&&(i.positions=[s,p])};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.positionChanged,this.dimensionsChanged,this.headingChanged));this.dispose(a.disposableOn(r))}{const r=()=>{e.color=this.xAxisColor??ii.defaults.xAxisColor,i.color=this.yAxisColor??ii.defaults.yAxisColor,o.color=this.zAxisColor??ii.defaults.zAxisColor};r();const a=this.disposeVar(c.createNextAnimateFrameEvent(this.xAxisColorChanged,this.yAxisColorChanged,this.zAxisColorChanged));this.dispose(a.disposableOn(r))}}};L(ii,"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 io=ii;(t=>{t.createDefaultProps=()=>({show:!0,position:c.reactArrayWithUndefined(void 0),heading:0,dimensions:c.reactArray([1e3,1e3,1e3]),xAxisColor:c.reactArray([1,0,0,1]),yAxisColor:c.reactArray([0,1,0,1]),zAxisColor:c.reactArray([0,0,1,1]),xAxisShow:!0,yAxisShow:!0,zAxisShow:!0})})(io||(io={})),c.extendClassProps(io.prototype,io.createDefaultProps);const co=class co extends zn{constructor(e){super();L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.ad(c.react("none")),originPosition:this.disposeVar(c.reactArray(zn.defaults.position)),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_createCoordinates",e=>{const i=this.ad(new io(e));this.dispose(this._opInfo.step.changed.disposableOn(()=>{CS(i,this._opInfo.constraintMode.value,this._opInfo.step.value)}));{const o=()=>{const a=[...this.position??co.defaults.position];e.editingHeightOffset&&(a[2]-=e.editingHeightOffset),i.position=a};o(),this.dispose(this.positionChanged.disposableOn(o))}{const o=()=>{i.heading=this.heading??0};o(),this.dispose(this.headingChanged.disposableOn(o))}{const o=()=>{i.dimensions=this._opInfo.originDimensions.value};o(),this.dispose(this._opInfo.originDimensions.changed.disposableOn(o))}return i});L(this,"_createOriginCoordinates",e=>{const i=this.ad(new io(e));i.xAxisColor=[1,0,0,.5],i.yAxisColor=[0,1,0,.5],i.zAxisColor=[0,0,1,.5];const{originPosition:o,originHeading:r,originDimensions:a}=this._opInfo;{const s=()=>{i.position=o.value};s(),this.dispose(o.changed.disposableOn(s))}{const s=()=>{i.heading=r.value??0};s(),this.dispose(r.changed.disposableOn(s))}{const s=()=>{i.dimensions=a.value};s(),this.dispose(a.changed.disposableOn(s))}return i});L(this,"_createGrid",e=>{const i=this.ad(new ai(e));{const o=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originHeading.value,l=this._opInfo.originDimensions.value[0],u=[];for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s+90);if(h){const f=c.geoRhumbDestination(h,l,s+180),d=c.geoRhumbDestination(h,l,s);f&&d&&u.push([f,h,d])}}for(let A=-4;A<5;++A){const h=c.geoRhumbDestination(a,l*.2*A,s);if(h){const f=c.geoRhumbDestination(h,l,s-90),d=c.geoRhumbDestination(h,l,s+90);f&&d&&u.push([f,h,d])}}i.positions=u};o();const r=this.disposeVar(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originHeading.changed,this._opInfo.originDimensions.changed));this.dispose(r.disposableOn(o))}return i});L(this,"_createHelpLine",e=>{const i=this.ad(new Ye(e));i.hasDash=!0,i.arcType="RHUMB",i.color=[1,1,0,.99];{const o=()=>{i.positions=[this._opInfo.originPosition.value,this._opInfo.targetPosition.value]},r=this.ad(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.targetPosition.changed));this.ad(r.don(o))}return i});L(this,"_createCircle",e=>{const i=this.ad(new ai(e));i.arcType="RHUMB",i.width=2,i.hasDash=!0;const o=this.disposeVar(c.createNextAnimateFrameEvent(this._opInfo.originPosition.changed,this._opInfo.originDimensions.changed)),r=()=>{const a=this._opInfo.originPosition.value,s=this._opInfo.originDimensions.value[0],l=[],u=32;for(let A=0;A<=u;++A){const h=c.geoRhumbDestination(a,s,A*360/u);h&&l.push(h)}i.positions=[l]};return r(),this.dispose(o.disposableOn(r)),i});L(this,"_pickingXYProcessing",e=>this.ad(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.don(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!gs(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;Ao(s,a),this._opInfo.constraintMode.value==="x"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="y"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a;const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A})})));L(this,"_pickingZProcessing",e=>this.ad(new c.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!_h(e.viewer.scene,ft(this._opInfo.originPosition.value),a,i))return;const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s]}})})));L(this,"_pickingZAxisProcessing",e=>this.ad(new c.Processing(()=>{const i=[0,0,0],o=new _.Cartographic;return e.pointerMoveEvent.don(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!gs(e.viewer.scene,a,this._opInfo.originPosition.value[2],o))return;Ao(o,i);const s=c.geoRhumbHeading(this._opInfo.originPosition.value,this._opInfo.draggingStartPosition.value),u=c.geoRhumbHeading(this._opInfo.originPosition.value,i)-s;let A=this._opInfo.originHeading.value+u;A=_.Math.toDegrees(_.Math.negativePiToPi(_.Math.toRadians(A))),this._opInfo.movingPosition.value=i,this.heading=this._opInfo.targetHeading.value=A})})));if(!e.viewer)return;const i=this.ad(c.reactArray([1,1,1]));this.ad(e.dblclickEvent.don(()=>this.enabled=!1)),this.ad(new vp(e,this.positionReact,i,this.axisPixelSize));{this.ad(this._opInfo.targetPosition.changed.don(r=>{if(this._opInfo.moved){const a=[...r];e.editingHeightOffset&&(a[2]+=e.editingHeightOffset),this.position=a}})),this.ad(this._opInfo.targetHeading.changed.don(r=>this._opInfo.moved&&(this.heading=r)));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((r,a)=>r===this._opInfo.targetPosition.value[a])){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),r=this._createOriginCoordinates(e),a=this._createGrid(e),s=this._createHelpLine(e),l=this._createCircle(e);{const u=()=>{l.show=a.show=this.enabled&&this.showCircle,s.show=this.enabled&&this.showCircle&&this._opInfo.moved.value,o.show=this.enabled&&this.showCoordinates,r.show=this.enabled&&this.showCoordinates&&this._opInfo.moved.value};u();const A=this.ad(c.createNextAnimateFrameEvent(this.enabledChanged,this.showCircleChanged,this.showCoordinatesChanged,this._opInfo.moved.changed));this.ad(A.don(u))}{const u=()=>{o.xAxisShow=r.xAxisShow=this.xAxisShow,o.yAxisShow=r.yAxisShow=this.yAxisShow,o.zAxisShow=r.zAxisShow=this.zAxisShow};u();const A=this.ad(c.createNextAnimateFrameEvent(this.xAxisShowChanged,this.yAxisShowChanged,this.zAxisShowChanged));this.ad(A.don(u))}{const u=()=>{a.color=this._opInfo.constraintMode.value!=="none"?[1,1,0,.6]:[1,1,0,.3],l.color=this._opInfo.constraintMode.value==="zAxis"?[1,1,0,.99]:[1,1,0,.5],CS(o,this._opInfo.constraintMode.value,this._opInfo.step.value)};u(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(u))}{const u=this._pickingXYProcessing(e),A=this._pickingZProcessing(e),h=this._pickingZAxisProcessing(e),f=()=>{const b=[...this.position??co.defaults.position];e.editingHeightOffset&&(b[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=b},d=()=>this._opInfo.targetHeading.value=this._opInfo.originHeading.value=this.heading,p=()=>this._opInfo.originDimensions.value=i.value,g={constraintMode:"none",startDragPos:[0,0,0]},v=b=>{const x={position:o.position??co.defaults.position,heading:o.heading??co.defaults.heading,dimensions:o.dimensions??co.defaults.dimensions};e.viewer&&ap(b,e.viewer.scene,x,this.axisSnapPixelSize,g,{x:this.disableX,y:this.disableY,z:this.disableZ,xy:this.disableXY,zAxis:this.disableZAxis}),this._opInfo.constraintMode.value=g.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=g.startDragPos},y=this.ad(c.createProcessingFromAsyncFunc(async b=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",b.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(b,async x=>{x.disposer.dispose((f(),this.positionChanged.don(f))),x.disposer.dispose((d(),this.headingChanged.don(d))),x.disposer.dispose((p(),i.changed.don(p))),x.disposer.dispose(e.pointerMoveEvent.don(E=>{E.pointerEvent&&v(E.pointerEvent)})),await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerDownEvent.don(I=>{I.pointerEvent&&v(I.pointerEvent),I.pointerEvent&&I.pointerEvent.button===0&&g.constraintMode!=="none"&&B()}))}))}),this._opInfo.step.value=!1,await c.step(b,async x=>{if(e.incrementDisabledInputStack(),x.disposer.dispose(()=>{e.decrementDisabledInputStack()}),["xy","x","y"].includes(this._opInfo.constraintMode.value)){const E=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),B=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);u.restart(void 0,E,B),x.disposer.dispose(()=>u.cancel())}else this._opInfo.constraintMode.value==="z"?(A.restart(),x.disposer.dispose(()=>A.cancel())):this._opInfo.constraintMode.value==="zAxis"?(h.restart(),x.disposer.dispose(()=>h.cancel())):console.warn(`pickingInfo.constraintMode error! ${this._opInfo.constraintMode.value}`);await c.step(x,E=>new Promise((B,P)=>{E.disposer.dispose(P),E.disposer.dispose(e.pointerUpEvent.don(()=>{B()})),E.disposer.dispose(e.pointerOutEvent.don(()=>B()))}))}),y.restart()})),m=()=>{this.enabled?y.restart():y.isRunning&&y.cancel()};m(),this.ad(this.enabledChanged.don(m))}}}};L(co,"defaults",{...zn.defaults,heading:0,dimensions:[1e3,1e3,1e3],xAxisColor:[1,0,0,1],yAxisColor:[0,1,0,1],zAxisColor:[0,0,1,1]});let lr=co;(t=>{t.createDefaultProps=()=>({...zn.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})})(lr||(lr={})),c.extendClassProps(lr.prototype,lr.createDefaultProps);function CS(t,n,e){t.xAxisColor=[1,0,0,.99],t.yAxisColor=[0,1,0,.99],t.zAxisColor=[0,0,1,.99],n==="x"?t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="y"?t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="z"?t.zAxisColor=e?[1,1,0,.8]:[1,1,0,.99]:n==="xy"&&(t.xAxisColor=e?[1,1,0,.8]:[1,1,0,.99],t.yAxisColor=e?[1,1,0,.8]:[1,1,0,.99])}class Av extends c.HasOwner{constructor(e){super(e);L(this,"_valid",!1);L(this,"_normal",new _.Cartesian3(0,0,0));L(this,"_origin",new _.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 i=this.owner.cartesian,o=oi(e);return Yv(this.scene,i,this.normal,o)}}class tV extends Av{constructor(n){super(n);{const e=()=>{const o=st({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 i=this.ad(c.createNextAnimateFrameEvent(this.sceneObject.positionChanged,this.sceneObject.rotationChanged));this.ad(i.don(e))}}}class nV extends Av{constructor(n){super(n);const e=()=>{const i=st({rotation:[this.sceneObject.selfRotation[0],0,0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=st({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[0],r.y=-o[1],r.z=-o[2]}{const r=this._origin;r.x=o[4],r.y=o[5],r.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 iV extends Av{constructor(n){super(n);const e=()=>{const i=st({rotation:[this.sceneObject.selfRotation[0],this.sceneObject.selfRotation[1],0]});if(!i)throw new Error("PitchPlane: rm is undefined");const o=st({position:this.sceneObject.position,rotation:this.sceneObject.rotation,localModelMatrix:_.Matrix4.toArray(i)});if(this._valid=!!o,!!o){{const r=this._normal;r.x=-o[4],r.y=-o[5],r.z=-o[6]}{const r=this._origin;r.x=o[8],r.y=o[9],r.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 Ra extends c.Destroyable{constructor(e){super();L(this,"_czmTexture");L(this,"_customPrimitiveForCircle");L(this,"_circleCanvas");L(this,"_debugAxis");e.viewer&&(this._czmTexture=this.disposeVar(new ht(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 i=this.disposeVar(c.react(!1));const o=document.createElement("canvas");o.width=o.height=256,this._circleCanvas=o.getContext("2d");{const a=()=>{const l={rotation:this.circleRotation*Math.PI/180,startRotation:this.circleStartRotation*Math.PI/180,endRotation:this.circleEndRotation*Math.PI/180},u=this._circleCanvas,A=this.color,h=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, ${A[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,${A[3]})`,u.stroke(),u.lineWidth=4,u.beginPath(),u.arc(128,128,64,0,Math.PI*2,!1),u.strokeStyle=h,u.stroke();{u.lineWidth=1,u.beginPath();let p=_.Math.zeroToTwoPi(l.startRotation),g=_.Math.zeroToTwoPi(l.endRotation);g<p&&(g+=_.Math.TWO_PI),(p!==g||p!==0)&&(u.moveTo(128,128),u.arc(128,128,64,p,g,g-p>Math.PI),u.lineTo(128,128),u.strokeStyle="rgba(255, 255, 0, 1.0)",u.stroke())}let f=_.Math.negativePiToPi(l.rotation);u.lineWidth=3,u.beginPath(),u.moveTo(128,128),u.arc(128,128,64,0,f,_.Math.negativePiToPi(f-0)<0),u.lineTo(128,128),u.fillStyle=`rgba(${A[0]*255|0}, ${A[1]*255|0}, ${A[2]*255|0}, 0.5)`,u.fill();{u.save(),u.font="16px console",u.textBaseline="middle";const v=`${(_.Math.negativePiToPi(f-0)*180/Math.PI*10|0)/10}°`;var d=u.measureText(v).width;u.translate(128,128),u.rotate(Math.PI*.5),f=_.Math.negativePiToPi(f-0)+0,u.rotate((f+0)*.5),u.scale(i.value?-1:1,1),u.translate(-128,-128),u.fillStyle="white",u.fillText(v,128-d*.5,54),u.lineWidth=1,u.restore()}this.czmTexture&&this.czmTexture.copyFromCanvas(o)};a();const s=this.ad(c.createNextAnimateFrameEvent(this.colorChanged,this.circleRotationChanged,this.circleStartRotationChanged,this.circleEndRotationChanged,i.changed));this.ad(s.don(a)),this.czmTexture&&this.ad(this.czmTexture.readyEvent.don(a))}{const r=()=>{const s=st({rotation:this.selfRotation});if(!s)return;const l=st({position:this.position,rotation:this.rotation,localModelMatrix:_.Matrix4.toArray(s)});if(!l)return;const{viewer:u}=e;if(!u)return;const A=_.Cartesian3.dot(u.scene.camera.directionWC,new _.Cartesian3(l[8],l[9],l[10]));i.value=A>0};r();const a=this.ad(c.createNextAnimateFrameEvent(e.cameraChanged,this.positionChanged,this.rotationChanged,this.selfRotationChanged));this.ad(a.don(r))}}_createCustomPrimitiveForCircle(e){this._customPrimitiveForCircle=this.disposeVar(rV(e)),this.dispose(c.track([this._customPrimitiveForCircle,"show"],[this,"show"])),this.dispose(c.track([this._customPrimitiveForCircle,"position"],[this,"position"])),this.dispose(c.track([this._customPrimitiveForCircle,"rotation"],[this,"rotation"])),this.dispose(c.track([this._customPrimitiveForCircle,"pixelSize"],[this,"pixelSize"]));{const i=()=>{const o=st({rotation:this.selfRotation});this._customPrimitiveForCircle&&(this._customPrimitiveForCircle.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this.customPrimitiveForCircle&&this.czmTexture&&(this.customPrimitiveForCircle.uniformMap={u_image:{type:"texture",id:this.czmTexture.id},u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}_createDebugAxis(e){this._debugAxis=this.ad(oV(e)),this.dispose(c.track([this._debugAxis,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([this._debugAxis,"position"],[this,"position"])),this.dispose(c.track([this._debugAxis,"rotation"],[this,"rotation"])),this.dispose(c.track([this._debugAxis,"show"],[this,"debug"]));{const i=()=>{const o=st({rotation:this.selfRotation});this._debugAxis&&(this._debugAxis.localModelMatrix=o&&_.Matrix4.toArray(o)||void 0)};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{this._debugAxis&&(this._debugAxis.uniformMap={u_color:this.color})};i(),this.dispose(this.colorChanged.disposableOn(i))}}}L(Ra,"defaults",{position:[116.39,39.9,100]}),(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,editing:!1,position:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,color:c.reactArray([1,1,1,1]),circleRotation:0,circleStartRotation:0,circleEndRotation:0,debug:!1})})(Ra||(Ra={})),c.extendClassProps(Ra.prototype,Ra.createDefaultProps);function rV(t){return Cp({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]},at,t)}function oV(t){return Cp({type:"CzmCustomPrimitive",allowPicking:!0,position:[114.86128105686282,40.86825802653499,0],primitiveType:"LINES",vertexShaderSource:`in vec3 position;
3765
3765
  void main()
3766
3766
  {
3767
3767
  // 如果这一句注释,要相应地注释掉attribute中的normal,也就是说顶点属性要和shader中的一一匹配!
@@ -3772,7 +3772,7 @@ void main()
3772
3772
  {
3773
3773
  out_FragColor = u_color;
3774
3774
  }
3775
- `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},at,t)}class oV extends c.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[pi.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(c.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const h=A.pick(l);if(!h||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(h,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=fv(f,d,A.normal),g=fv(A.origin,f,A.normal),v=fv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[pi.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await c.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,h=A*3/128;if(!(u>=A-h&&u<=A+h))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[pi.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ni(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function fv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const fs=class fs extends zn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(c.react("none")));L(this,"_movingPlaneType",this.disposeVar(c.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new eV(this)),pitch:this.disposeVar(new tV(this)),roll:this.disposeVar(new nV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new oV(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&ft(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}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 Ht(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(c.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(c.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(c.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=st({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{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)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Ra(e));this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([o,"debug"],[this,"debug"])),this.dispose(c.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=fs.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[fs.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[fs.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(fs,"rotationNum",{heading:0,pitch:1,roll:2}),L(fs,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let pi=fs;(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(pi||(pi={})),c.extendClassProps(pi.prototype,pi.createDefaultProps);const ps=class ps extends c.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ps.defaults.positions[0],this.stopPosition??ps.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ps.defaults.positions[0],n??ps.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Ye(n,e));o.arcType="RHUMB";const r=this.ad(new Wn(n,e));this.ad(c.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(c.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(ps,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let is=ps;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(t.defaults.positions),width:10,color:c.reactArray([1,0,0,1])})})(is||(is={})),c.extendClassProps(is.prototype,is.createDefaultProps);class ur extends zn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.disposeVar(c.react("none")),originPosition:this.disposeVar(c.reactArray([0,0,0])),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!gs(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;Ao(s,a),this._opInfo.constraintMode.value==="x"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let h=this.scale[0],f=this.scale[1];const d=c.geoDistance(A,this._opInfo.originPosition.value)-c.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?h+=p:h-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),h<=0&&(h+=p),f<=0&&(f+=p),this.scale=[h??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new c.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!_h(e.viewer.scene,ft(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const h=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=h:u-=h),u<=0&&(u+=h),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new vp(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 r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=ur.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[h,f,d]=s;l.stopPosition=[h,f,d+this._opInfo.originDimensions.value[2]];const p=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(c.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{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((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??ur.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ap(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await c.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),h=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};h(),this.dispose(this.enabledChanged.disposableOn(h))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new is(e));return o.width=10,this.ad(c.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),scale:c.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(ur||(ur={})),c.extendClassProps(ur.prototype,ur.createDefaultProps);const ho=class ho extends In{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new c.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(c.react(!1)));L(this,"_status",this.disposeVar(c.react("None")));L(this,"_positionsChanged",this.ad(new c.Event));L(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(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}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 i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??ho.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??ho.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 i=this.ad(new Ye(e));this.ad(c.track([i,"color"],[this,"polylineColor"])),this.ad(c.track([i,"width"],[this,"polylineWidth"])),this.ad(c.track([i,"show"],[this,"polylineShow"])),this.ad(c.track([i,"arcType"],[this,"polylineArcType"])),this.ad(c.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new c.CursorInfo(e.container,c.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(ho,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(ho,"defaults",{...In.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:ho.baseImageUrl+"point-green.png",otherControlPointImageUrl:ho.baseImageUrl+"point-yellow.png"});let ei=ho;(t=>{t.createDefaultProps=()=>({...In.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:c.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})})(ei||(ei={})),c.extendClassProps(ei.prototype,ei.createDefaultProps);let sV=0;class SS extends c.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_id",sV++);L(this,"_menuPoi");i&&(this.position=i),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 Ss(e.czmViewer));o.enabled=!1,this.ad(c.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??ei.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ei.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}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 ES extends SS{constructor(n,e){super(n,e)}}class Et extends ei{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new c.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Li(e));i.enabled=!1,this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Et.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Et.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(c.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new ES(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Et.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=c.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(c.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new aV(this,r)));const A=s.disposer.disposeVar(new uV(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(h=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,h(!0)):h(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,h(!0)):h(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>h(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps()})})(Et||(Et={})),c.extendClassProps(Et.prototype,Et.createDefaultProps);class aV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));const{placeEditing:o}=e;let r=new ES(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Et.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);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(c.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Et.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function lV(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class uV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_doEvent",this.disposeVar(new c.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(lV(e,i)))),(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class PS extends Et{constructor(n){super(n),this.loop=!1}}class BS extends Et{constructor(n){super(n),this.loop=!0}}class Hf extends SS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new yi(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??tt.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??tt.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const h=hp(u,A);if(!h)return o();h[2]-=n.czmViewer.editingHeightOffset??0,i.position=h;const f=l<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new Hf(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class tt extends ei{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"translationEditing");{const r=this.ad(c.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new c.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new cV(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new lr(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(c.step(r,async s=>{const l=s.disposer,u=l.ad(new hV(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>u.modify(h))),await s.promise(new Promise(h=>{l.dispose(u.overEvent.disposableOnce(f=>{h(f)}))}))})),a===-1)(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const h=this.editingPoints.get(u).position;if(!h)return;const f=hp(l,h);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new Hf(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new Hf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),c.extendClassProps(tt.prototype,tt.createDefaultProps);class cV extends c.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class hV extends c.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new AV(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),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 AV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));this._modifying=e,this._posEditor=i,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(c.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class TS extends tt{constructor(n){super(n),this.loop=!1}}class IS extends tt{constructor(n){super(n),this.loop=!0}}class Ua extends Et{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),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 i=c.geoHeading(this.startPosition,this.endPosition),o=c.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([90,0,0]),distance:c.react(1)})})(Ua||(Ua={})),c.extendClassProps(Ua.prototype,Ua.createDefaultProps);class rs extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.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","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=c.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=c.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),distance:c.react(0)})})(rs||(rs={})),c.extendClassProps(rs.prototype,rs.createDefaultProps);class FS extends Et{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class MS extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Oa extends Et{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(Oa||(Oa={})),c.extendClassProps(Oa.prototype,Oa.createDefaultProps);class La extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(La||(La={})),c.extendClassProps(La.prototype,La.createDefaultProps);class DS extends rs{constructor(n){super(n),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 un extends c.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_currentEditing",this.disposeVar(c.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Et&&((r=this.currentEditing.currentProcess)!=null&&r.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 Li&&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 ih=class ih extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Li(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),i.enabled=!i.position||c.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};L(ih,"type",ih.registerEditing("ESCesiumViewer",c.ESJEditingMode.Place,ih));let pv=ih;const rh=class rh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new pi(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(c.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};L(rh,"type",rh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Rotation,rh));let dv=rh;const oh=class oh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ur(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};L(oh,"type",oh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Scale,oh));let mv=oh;const sh=class sh extends un{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new lr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=c.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=vn({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=vn({originPosition:a},[u.position])[0][0];u.position=_r({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=vn({originPosition:a},u.points)[0];u.points=_r({originPosition:a},A.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(c.bind([i,"position"],[n,"position"]));else if(n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=c.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=vn({originPosition:a},[r])[0][0];const l=vn({originPosition:a},o.points)[0];o.points=_r({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};L(sh,"type",sh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Translation,sh));let Gf=sh;const ah=class ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ua(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(c.bind([i,"startPosition"],[o,"position"])),this.ad(Mt([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(c.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(c.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(c.bind([i,"distance"],[o,"distance"]));else{const r=ft(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Ni(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!c.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(ah,"type",ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsAppend,ah));let gv=ah;const lh=class lh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new rs(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(c.bind([i,"startPosition"],[r,"position"])),this.ad(Mt([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(c.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(c.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(c.bind([i,"distance"],[r,"distance"]));else{const a=ft(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Ni(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(c.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(lh,"type",lh.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsModify,lh));let yv=lh;const uh=class uh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new BS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};L(uh,"type",uh.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularAppend,uh));let vv=uh;const ch=class ch extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new IS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};L(ch,"type",ch.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularInsert,ch));let wv=ch;const hh=class hh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new PS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};L(hh,"type",hh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringAppend,hh));let bv=hh;const Ah=class Ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new TS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};L(Ah,"type",Ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringInsert,Ah));let xv=Ah;const fh=class fh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new FS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};L(fh,"type",fh.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterAppend,fh));let _v=fh;const ph=class ph extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new MS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};L(ph,"type",ph.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterModify,ph));let Cv=ph;const dh=class dh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Oa(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};L(dh,"type",dh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityAppend,dh));let Sv=dh;const mh=class mh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new La(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};L(mh,"type",mh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityModify,mh));let Ev=mh;const gh=class gh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new DS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof c.ESClassification||r instanceof c.ESPolygonFence;let A=c.getMinMaxCorner(r.points).center,h=[...A],f=u?r.points[0][2]:0;l?a?h[2]=r.extrudedHeight:h[2]=r.height+f:(s&&(A[2]=r.height),a&&(h[2]=r.extrudedHeight)),i.startPosition=A,i.distance=h[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(gh,"type",gh.registerEditing("ESCesiumViewer",c.ESJEditingMode.HeightModify,gh));let Pv=gh;const Vt=class Vt extends c.Destroyable{constructor(e,i,o,r=!0){super();L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);L(this,"currentEditingMode");L(this,"currentEditingWrapper");L(this,"_notSupportedEditCount",this.disposeVar(c.react(0)));L(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&c.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);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,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Vt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_ESCAPE&&Vt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Vt.MOUSE_LEFT&&c.nextAnimateFrame(()=>{Vt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Vt.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 i=c.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Vt.stop(),Vt.esEditModeInstance=new Vt(e,i,o,r)}static stop(){const e=Vt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Vt.esEditModeInstance=void 0}};L(Vt,"KEY_ESCAPE","Escape"),L(Vt,"KEY_SPACE","Space"),L(Vt,"MOUSE_LEFT",0),L(Vt,"esEditModeInstance");let Wf=Vt;function RS(){const t=c.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new Gf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class fV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n,c.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof c.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(c.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class pV extends c.Destroyable{constructor(e){super();L(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new c.ESSceneObjectWithId));this.dispose(c.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new c.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new fV(e,i)}))}}class dV extends c.Destroyable{constructor(n){super(),this.dv(new c.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new mV(n)}))}}class mV extends c.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(c.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{if(o)return new gV(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=c.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof c.ESExcavate?c.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof c.ESHole&&c.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class gV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=c.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof c.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof c.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class yV extends c.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class vV extends c.Destroyable{constructor(e){var a;super();L(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Qo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function wV(t,n){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,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function bV(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=t??_.Matrix4.IDENTITY;const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.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 xV(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function _V(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=i??e,this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function CV(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function SV(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defined,o=t.OrientedBoundingBox,r=t.Rectangle,a=t.TaskProcessor,s=t.TerrainData,l=t.TerrainEncoding,u=t.TerrainMesh,A=t.GoogleEarthEnterpriseTerrainData,h="createVerticesFromGoogleEarthEnterpriseBuffer",f=new a(h),d=new a(h,s.maximumAsynchronousTasks),p=new r,g=new r;A.prototype.createMesh=function(v){v=v??Xe.Frozen.EMPTY_OBJECT;const y=v.tilingScheme,m=v.x,b=v.y,x=v.level,E=v.exaggeration??1,B=v.exaggerationRelativeHeight??0,P=v.throttle??!0,I=y.ellipsoid;y.tileXYToNativeRectangle(m,b,x,p),y.tileXYToRectangle(m,b,x,g);const M=I.cartographicToCartesian(r.center(g));this._skirtHeight=1.9134410999999999e6;const S=(P?d:f).scheduleTask({buffer:this._buffer,nativeRectangle:p,rectangle:r.clone(g),relativeToCenter:M,ellipsoid:I,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:B,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!i(S))return;const T=this;return S.then(function(w){return T._mesh=new u(M,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,n.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),l.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),T._minimumHeight=w.minimumHeight,T._maximumHeight=w.maximumHeight,T._buffer=void 0,T._mesh})}}function EV(){return _.VERSION.split(".").map(n=>parseInt(n))}let Bv;function PV(){return Bv||(Bv=EV()),Bv}function BV(){const t=PV();t[0]===1&&t[1]>=92?SV(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function TV(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function IV(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function FV(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const MV=`#ifdef GL_OES_standard_derivatives
3775
+ `,uniformMap:{u_color:[1,1,0,1]},name:"CzmCustomPrimitive_47fd",attributes:{position:{typedArray:{type:"Float32Array",array:[0,0,0,0,0,1]},componentsPerAttribute:3}}},at,t)}class sV extends c.HasOwner{constructor(n){super(n);const{czmViewer:e}=this.owner;let i;this.dispose(()=>this.owner.hoveredPlaneType="none");const o=this._createRotatorMoveProcessing();this.dispose(e.pointerMoveEvent.disposableOn(r=>{const a=i=this._getStartInfo(r.pointerEvent);a&&(this.owner.hoveredPlaneType=a.currentPlaneType)})),this.dispose(e.pointerDownEvent.disposableOn(r=>{i&&i.currentPlaneType!=="none"&&(o.restart(void 0,e,i),i=void 0)})),this.dispose(e.dblclickEvent.disposableOn(r=>{const a=this._getStartInfo(r.pointerEvent);if(a&&a.currentPlaneType!=="none"){const{currentPlaneType:s}=a,l=[...this.owner.selfRotation];l[pi.rotationNum[s]]=0,this.owner.selfRotation=l;return}this.owner.enabled=!1}))}_createRotatorMoveProcessing(){return this.ad(c.createProcessingFromAsyncFunc(async(n,e,i)=>{const o=this.owner.circles[i.currentPlaneType];e.incrementDisabledInputStack(),n.disposer.dispose(()=>e.decrementDisabledInputStack()),n.disposer.dispose(e.pointerMoveEvent.don(r=>{if(i&&r.pointerEvent){const{offsetX:a,offsetY:s}=r.pointerEvent,l=[a,s],{currentPlaneType:u}=i;if(u==="none")return;const A=this.owner.getPlane(u);if(!i.currentV)return;const h=A.pick(l);if(!h||!this.owner.cartesian)return;const f=_.Cartesian3.subtract(i.currentV,this.owner.cartesian,new _.Cartesian3);_.Cartesian3.normalize(f,f);const d=_.Cartesian3.subtract(h,this.owner.cartesian,new _.Cartesian3);if(_.Cartesian3.normalize(d,d),!A.normal||!A.origin)return;const p=fv(f,d,A.normal),g=fv(A.origin,f,A.normal),v=fv(A.origin,d,A.normal);{const y=[...this.owner.selfRotation];y[pi.rotationNum[u]]=i.startRotation+p,this.owner.selfRotation=y,o.circleStartRotation=g,o.circleEndRotation=v}}})),this.owner.movingPlaneType=i.currentPlaneType,n.disposer.dispose(()=>{this.owner.movingPlaneType="none"}),n.disposer.dispose(()=>{o.circleStartRotation=0,o.circleEndRotation=0}),await c.step(n,r=>new Promise((a,s)=>{r.disposer.dispose(s),r.disposer.dispose(e.pointerUpEvent.don(()=>{a()})),r.disposer.dispose(e.pointerOutEvent.don(()=>{a()}))}))}))}_pickPlane(n,e,i,o,r){const a=this.owner.cartesian;if(!a)return;const{selfRotation:s}=this.owner,l=this.owner.getPlane(i).pick(o);if(!l)return;const u=_.Cartesian3.distance(a,l),A=r/4,h=A*3/128;if(!(u>=A-h&&u<=A+h))return;const d=_.Cartesian3.distance(e.camera.positionWC,l);n.currentD2c<=d||(n.currentPlaneType=i,n.currentD2c=d,n.currentV=l,n.startRotation=s[pi.rotationNum[i]])}_getStartInfo(n){var A;const{czmViewer:e}=this.owner,i=(A=e.viewer)==null?void 0:A.scene;if(!this.owner.position||!this.owner.cartesian)return;const o=Ni(i,this.owner.cartesian,this.owner.pixelSize);if(!o)return;const{offsetX:r,offsetY:a}=n,s=[r,a],l=n.pointerId,u={currentPlaneType:"none",currentD2c:Number.POSITIVE_INFINITY,currentV:void 0,startRotation:0,pointerId:l};return this._pickPlane(u,i,"heading",s,o),this._pickPlane(u,i,"pitch",s,o),this._pickPlane(u,i,"roll",s,o),u}}function fv(t,n,e){const i=_.Cartesian3.cross(n,t,new _.Cartesian3);if(i.equals(_.Cartesian3.ZERO))return 0;_.Cartesian3.normalize(i,i);const o=_.Cartesian3.dot(i,e);let r=Math.acos(_.Cartesian3.dot(t,n))*180/Math.PI;return r=o>0?r:-r,r}const fs=class fs extends zn{constructor(e){super();L(this,"_hoveredPlaneType",this.disposeVar(c.react("none")));L(this,"_movingPlaneType",this.disposeVar(c.react("none")));L(this,"_circles");L(this,"_czmCameraModel");L(this,"_cartesian");L(this,"_planes",{heading:this.disposeVar(new tV(this)),pitch:this.disposeVar(new nV(this)),roll:this.disposeVar(new iV(this))});L(this,"_rotatorRunningResetting");this._czmViewer=e;const i=this._czmViewer;if(this._rotatorRunningResetting=this.disposeVar(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new sV(this)})),this._circles={heading:this._createRotatorCircle(i,"heading"),pitch:this._createRotatorCircle(i,"pitch"),roll:this._createRotatorCircle(i,"roll")},!!i.viewer){{const r=()=>{this._cartesian=this.position&&ft(this.position)||void 0};r(),this.dispose(this.positionChanged.disposableOn(r))}this._createCameraModel(i)}}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 Ht(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(c.track([this._czmCameraModel,"pixelSize"],[this,"pixelSize"],i=>i*.1)),this.dispose(c.track([this._czmCameraModel,"position"],[this,"position"])),this.dispose(c.track([this._czmCameraModel,"rotation"],[this,"rotation"]));{const i=()=>{const o=st({rotation:this.selfRotation});if(!o)throw new Error("!rm");this._czmCameraModel&&(this._czmCameraModel.localModelMatrix=_.Matrix4.toArray(o))};i(),this.dispose(this.selfRotationChanged.disposableOn(i))}{const i=()=>{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)};i(),this.dispose(this.enabledChanged.disposableOn(i)),this.dispose(this.showHelperChanged.disposableOn(i))}}_createRotatorCircle(e,i){const o=this.ad(new Ra(e));this.dispose(c.track([o,"position"],[this,"position"])),this.dispose(c.track([o,"pixelSize"],[this,"pixelSize"])),this.dispose(c.track([o,"debug"],[this,"debug"])),this.dispose(c.track([o,"rotation"],[this,"rotation"]));{const r=()=>{o.selfRotation=fs.rotationFuncs[i](this.selfRotation),o.circleRotation=this.selfRotation[fs.rotationNum[i]]};r(),this.dispose(this.selfRotationChanged.disposableOn(r))}{const r=()=>{const a=this.movingPlaneType===i,s=this.hoveredPlaneType===i,u=[0,0,0,a||s?1:.8];u[fs.rotationNum[i]]=1,o.color=u};r(),this.dispose(this.movingPlaneTypeChanged.disposableOn(r)),this.dispose(this.hoveredPlaneTypeChanged.disposableOn(r))}return o}};L(fs,"rotationNum",{heading:0,pitch:1,roll:2}),L(fs,"rotationFuncs",{heading:([e,i,o])=>[0,0,0],pitch:([e,i,o])=>[e,0,-90],roll:([e,i,o])=>[e,i+90,0]});let pi=fs;(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),rotation:c.reactArray([0,0,0]),selfRotation:c.reactArray([0,0,0]),pixelSize:300,showHelper:!1,debug:!1})})(pi||(pi={})),c.extendClassProps(pi.prototype,pi.createDefaultProps);const ps=class ps extends c.Destroyable{get startPosition(){return this.positions&&this.positions[0]}set startPosition(n){this.positions=[n??ps.defaults.positions[0],this.stopPosition??ps.defaults.positions[1]]}get startPositionChanged(){return this.positionsChanged}get stopPosition(){return this.positions&&this.positions[1]}set stopPosition(n){this.positions=[this.startPosition??ps.defaults.positions[0],n??ps.defaults.positions[1]]}get stopPositionChanged(){return this.positionsChanged}constructor(n,e){if(super(),!n.viewer)return;const o=this.ad(new Ye(n,e));o.arcType="RHUMB";const r=this.ad(new Wn(n,e));this.ad(c.track([o,"allowPicking"],[this,"allowPicking"])),this.ad(c.track([r,"allowPicking"],[this,"allowPicking"]));{const a=()=>{o.show=r.show=this.show};a(),this.ad(this.showChanged.don(a))}{const a=()=>{o.width=this.width/2,r.pixelSize=this.width};a(),this.ad(this.widthChanged.don(a))}{const a=()=>{o.color=r.color=this.color};a(),this.ad(this.colorChanged.don(a))}{const a=()=>{o.positions=this.positions,r.position=this.stopPosition};a(),this.dispose(this.startPositionChanged.disposableOn(a)),this.dispose(this.stopPositionChanged.disposableOn(a))}}};L(ps,"defaults",{positions:[[0,0,0],[0,0,1e6]]});let is=ps;(t=>{t.createDefaultProps=()=>({show:!0,allowPicking:!1,positions:c.reactPositions(t.defaults.positions),width:10,color:c.reactArray([1,0,0,1])})})(is||(is={})),c.extendClassProps(is.prototype,is.createDefaultProps);class ur extends zn{constructor(e){super();L(this,"_lastPosition");L(this,"_opInfo",{step:this.ad(c.react(!1)),moved:this.ad(c.react(!1)),constraintMode:this.disposeVar(c.react("none")),originPosition:this.disposeVar(c.reactArray([0,0,0])),originHeading:this.disposeVar(c.react(0)),originDimensions:this.disposeVar(c.reactArray([1,1,1])),draggingStartPosition:this.disposeVar(c.reactArray([0,0,0])),movingPosition:this.disposeVar(c.reactArray([0,0,0])),targetPosition:this.disposeVar(c.reactArray([0,0,0])),targetHeading:this.disposeVar(c.react(0))});L(this,"_scaleAxis");L(this,"_pickingXYProcessing",e=>this.disposeVar(new c.Processing((i,o,r)=>{const a=[0,0,0],s=new _.Cartographic;return e.pointerMoveEvent.disposableOn(l=>{if(!l.pointerEvent||!e.viewer)return;const u=oi(c.getDomEventCurrentTargetPos(l.pointerEvent));if(!gs(e.viewer.scene,u,this._opInfo.originPosition.value[2],s))return;Ao(s,a),this._opInfo.constraintMode.value==="x"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value,a,a):this._opInfo.constraintMode.value==="y"?po(this._opInfo.originPosition.value,this._opInfo.originHeading.value+90,a,a):this._opInfo.constraintMode.value==="xy"||console.warn("should not be here!"),this._opInfo.movingPosition.value=a,this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const A=[0,0,0];c.geoRhumbDestination(a,r,o,A),this._opInfo.targetPosition.value=A;let h=this.scale[0],f=this.scale[1];const d=c.geoDistance(A,this._opInfo.originPosition.value)-c.geoDistance(this._lastPosition,this._opInfo.originPosition.value);this._lastPosition=[...A];const p=this._opInfo.originDimensions.value[0]/100;d!=0&&this._opInfo.constraintMode.value==="y"&&(d>0?h+=p:h-=p),d!=0&&this._opInfo.constraintMode.value==="x"&&(d>0?f+=p:f-=p),h<=0&&(h+=p),f<=0&&(f+=p),this.scale=[h??1,f??1,this.scale[2]??1]})})));L(this,"_pickingZProcessing",e=>this.disposeVar(new c.Processing(()=>{const i=new _.Cartesian3,o=[0,0,0];return e.pointerMoveEvent.disposableOn(r=>{if(!r.pointerEvent||!e.viewer)return;const a=oi(c.getDomEventCurrentTargetPos(r.pointerEvent));if(!_h(e.viewer.scene,ft(this._opInfo.originPosition.value),a,i))return;this._lastPosition||(this._lastPosition=[...this._opInfo.draggingStartPosition.value]);const s=this._opInfo.originPosition.value[2]-this._opInfo.draggingStartPosition.value[2];if(Ue(i,o)){this._opInfo.movingPosition.value=o;const l=this._opInfo.originPosition.value;this._opInfo.targetPosition.value=[l[0],l[1],o[2]+s];let u=this.scale[2];const A=o[2]-this._lastPosition[2];this._lastPosition=[...o];const h=this._opInfo.originDimensions.value[0]/100;A!=0&&(A>0?u+=h:u-=h),u<=0&&(u+=h),this.scale=[this.scale[0]??1,this.scale[1]??1,u??1]}})})));const i=e.viewer;if(!i)return;const{scene:o}=i;this.ad(new vp(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 r=()=>{if(!this._scaleAxis)return;const{zAxis:a,yAxis:s,xAxis:l}=this._scaleAxis,u=this._opInfo.constraintMode.value,A=this._opInfo.step;a.color=[0,0,1,.99],s.color=[0,1,0,.99],l.color=[1,0,0,.99],u==="x"?l.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="y"?s.color=A?[1,1,0,.8]:[1,1,0,.99]:u==="z"&&(a.color=A?[1,1,0,.8]:[1,1,0,.99])};r(),this.dispose(this._opInfo.constraintMode.changed.disposableOn(r)),this.dispose(this._opInfo.step.changed.disposableOn(r))}{const r=()=>{if(!this._scaleAxis)return;const{position:s=ur.defaults.position}=this,{zAxis:l,yAxis:u,xAxis:A}=this._scaleAxis;l.startPosition=u.startPosition=A.startPosition=s;const[h,f,d]=s;l.stopPosition=[h,f,d+this._opInfo.originDimensions.value[2]];const p=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[0],90);p&&(A.stopPosition=p);const g=c.geoRhumbDestination(s,this._opInfo.originDimensions.value[1],0);g&&(u.stopPosition=g)};r();const a=this.ad(c.createNextAnimateFrameEvent(this.positionChanged,this._opInfo.originDimensions.changed));this.ad(a.don(r))}{const r=()=>{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((a,s)=>a===this._opInfo.targetPosition.value[s])){this._opInfo.moved.value=!0;return}};r(),this.dispose(this._opInfo.originHeading.changed.disposableOn(r)),this.dispose(this._opInfo.originPosition.changed.disposableOn(r)),this.dispose(this._opInfo.targetHeading.changed.disposableOn(r)),this.dispose(this._opInfo.targetPosition.changed.disposableOn(r))}{const r=this._pickingXYProcessing(e),a=this._pickingZProcessing(e),s=()=>{const f=[...this.position??ur.defaults.position];e.editingHeightOffset&&(f[2]-=e.editingHeightOffset),this._opInfo.targetPosition.value=this._opInfo.originPosition.value=f},l={constraintMode:"none",startDragPos:[0,0,0]},u=f=>{if(!this.position)return;const d={position:this.position,dimensions:this._opInfo.originDimensions.value,heading:0};ap(f,o,d,this.axisSnapPixelSize,l),this._opInfo.constraintMode.value=l.constraintMode,this._opInfo.movingPosition.value=this._opInfo.draggingStartPosition.value=l.startDragPos},A=this.disposeVar(c.createProcessingFromAsyncFunc(async f=>{this._opInfo.step.value=!0,this._opInfo.constraintMode.value="none",f.disposer.dispose(()=>{this._opInfo.constraintMode.value="none"}),await c.step(f,async d=>{d.disposer.dispose((s(),this.positionChanged.disposableOn(s))),d.disposer.dispose(e.pointerMoveEvent.disposableOn(p=>{p.pointerEvent&&u(p.pointerEvent)})),await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerDownEvent.don(y=>{y.pointerEvent&&u(y.pointerEvent),y.pointerEvent&&y.pointerEvent.button===0&&l.constraintMode!=="none"&&g()}))}))}),this._opInfo.step.value=!1,await c.step(f,async d=>{if(e.incrementDisabledInputStack(),d.disposer.dispose(()=>e.decrementDisabledInputStack()),["x","y"].includes(this._opInfo.constraintMode.value)){const p=c.geoRhumbHeading(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value),g=c.geoRhumbDistance(this._opInfo.draggingStartPosition.value,this._opInfo.originPosition.value);r.restart(void 0,p,g),d.disposer.dispose(()=>r.cancel())}else this._opInfo.constraintMode.value==="z"&&(a.restart(),d.disposer.dispose(()=>a.cancel()));await c.step(d,p=>new Promise((g,v)=>{p.disposer.dispose(v),p.disposer.dispose(e.pointerUpEvent.don(()=>{g()})),p.disposer.dispose(e.pointerOutEvent.don(()=>{g()}))})),this._lastPosition=void 0}),A.restart()})),h=()=>{this.enabled?A.restart():A.isRunning&&A.cancel()};h(),this.dispose(this.enabledChanged.disposableOn(h))}}get scaleAxis(){return this._scaleAxis}_createScaleAxis(e,i){const o=this.ad(new is(e));return o.width=10,this.ad(c.track([o,"show"],[this,"enabled"])),o}}(t=>{t.createDefaultProps=()=>({...zn.createDefaultProps(),scale:c.reactArray([1,1,1]),axisPixelSize:100,axisSnapPixelSize:5})})(ur||(ur={})),c.extendClassProps(ur.prototype,ur.createDefaultProps);const ho=class ho extends In{constructor(e){super();L(this,"_editingPoints",this.disposeVar(new c.ObservableArray));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_currentProcess");L(this,"_menuPoiEnabled",this.disposeVar(c.react(!1)));L(this,"_status",this.disposeVar(c.react("None")));L(this,"_positionsChanged",this.ad(new c.Event));L(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(i=>{for(let{start:o,deleteCount:r,items:a}of i){for(const s of a)s.menuPoi.enabled=this.menuPoiEnabled??!1;for(let s=o;s<o+r;++s)this.editingPoints.get(s).destroy()}})),this.dispose(this.menuPoiEnabledChanged.disposableOn(()=>{for(let i of this.editingPoints)i.menuPoi.enabled=this.menuPoiEnabled??!1})),this.dispose(e.dblclickEvent.don(i=>{this.ad(()=>{var o;((o=i.pointerEvent)==null?void 0:o.button)===0&&this.enabled&&this.currentProcess&&this.currentProcess.cancel()})})),this.dispose(this.enabledChanged.disposableOn(i=>{this._currentProcess&&(i?this._currentProcess.restart():this._currentProcess.isRunning&&this._currentProcess.cancel())}));{const i=()=>{this.polylineShow=this.czmViewer.editingLineShow};i(),this.ad(this.czmViewer.editingLineShowChanged.don(i))}}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 i of this._editingPoints)i.position&&e.push([...i.position]);return e}resetPositions(e){if(this.enabled??ho.defaults.enabled)return console.warn("MultiPointsEditing.resetPositions error: this.enabled === true"),!1;const i=e||[];return!(i.length===this.editingPoints.length&&i.every((o,r)=>o.every((a,s)=>{const l=this.editingPoints.get(r);return l.position&&l.position[s]===a})))}forceResetPositions(e){(this.enabled??ho.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 i=this.ad(new Ye(e));this.ad(c.track([i,"color"],[this,"polylineColor"])),this.ad(c.track([i,"width"],[this,"polylineWidth"])),this.ad(c.track([i,"show"],[this,"polylineShow"])),this.ad(c.track([i,"arcType"],[this,"polylineArcType"])),this.ad(c.track([i,"loop"],[this,"loop"]));{const o=()=>{const r=[];for(const a of this.getPositions())a[2]-=e.editingHeightOffset??0,r.push(a);i.positions=r};o(),this.ad(this.positionsChanged.don(o))}}_createCursorInfo(e){const i=this._cursorInfo=this.ad(new c.CursorInfo(e.container,c.CursorFloatDiv));this.dispose(this.statusChanged.disposableOn(()=>{const o=this.status;if(i){if(!this.hideCursorInfo){i.show=!1;return}o==="Adding"?(i.text="右键/BackSpace键:删除上一个控制点;Esc键或左键双击:退出添加状态,进入修改状态",i.show=!0):o==="Modifying"||o==="Modifying_Point"?(i.text="Esc键或左键双击:退出编辑状态",i.show=!0):o==="None"&&(i.text="",i.show=!1)}}))}};L(ho,"baseImageUrl","${earthsdk3-assets-script-dir}/assets/img/"),L(ho,"defaults",{...In.defaults,debug:!1,polylineShow:!1,polylineWidth:1,polylineColor:[1,1,1,1],polylineArcType:"GEODESIC",maxPointsNum:Number.MAX_SAFE_INTEGER,loop:!1,firstControlPointImageUrl:ho.baseImageUrl+"point-green.png",otherControlPointImageUrl:ho.baseImageUrl+"point-yellow.png"});let ei=ho;(t=>{t.createDefaultProps=()=>({...In.createDefaultProps(),loop:!1,debug:!1,polylineShow:!0,polylineWidth:1,polylineColor:c.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})})(ei||(ei={})),c.extendClassProps(ei.prototype,ei.createDefaultProps);let aV=0;class SS extends c.Destroyable{constructor(e,i){super();L(this,"_position",this.disposeVar(c.reactArrayWithUndefined(void 0)));L(this,"_id",aV++);L(this,"_menuPoi");i&&(this.position=i),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 Ss(e.czmViewer));o.enabled=!1,this.ad(c.track([o,"show"],[e,"enabled"]));{const r=()=>{if(this.position===void 0){o.position=void 0;return}const a=[...this.position];a[2]-=e.czmViewer.editingHeightOffset??0,o.position=a,e.positionsChanged.emit()};r(),this.d(this.positionChanged.don(r))}{const r=()=>{const a=e.editingPoints.indexOf(this)+1;a!==0&&(o.title=`控制点${a}`,a===1?o.imageUri=e.firstControlPointImageUrl??ei.defaults.firstControlPointImageUrl:o.imageUri=e.otherControlPointImageUrl??ei.defaults.otherControlPointImageUrl)};r(),this.dispose(e.editingPoints.changedEvent.disposableOn(r))}}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 ES extends SS{constructor(n,e){super(n,e)}}class Et extends ei{constructor(e){super(e);L(this,"_deletePreviousPointWhileAddingEvent",this.disposeVar(new c.Event));L(this,"placeEditing");if(!e.viewer)return;const i=this.placeEditing=this.ad(new Li(e));i.enabled=!1,this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async o=>{o.disposer.dispose(()=>{(this.debug??Et.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),(this.debug??Et.defaults.debug)&&console.log("直接进入Adding状态"),this.status="Adding",await o.promise(c.step(o,async r=>{const a=r.disposer,s=a.ad(this._addingEditingProcessing());a.dispose(()=>"adding canceled!"),a.dispose(this.cancelEvent.disposableOn(()=>s.cancel())),await r.promise(new Promise(l=>{a.dispose(s.completeEvent.disposableOnce(l))}))}))})),this.dispose(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)===2&&this.deletePreviousPointWhileAdding()}))}deletePreviousPointWhileAdding(){this._deletePreviousPointWhileAddingEvent.emit()}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new ES(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}_addingEditingProcessing(){const e=()=>{if(this.maxPointsNum!==void 0)return this.editingPoints.length>=this.maxPointsNum&&(this.debug??Et.defaults.debug)&&console.log("impl.positionEditors.length >= impl.maxPointsNum"),this.editingPoints.length>=this.maxPointsNum},i=c.createProcessingFromAsyncFunc(async o=>{let r=this.editingPoints.length;this.menuPoiEnabled=!1,await o.promise(c.step(o,async s=>{let l;!e()&&(l=s.disposer.disposeVar(new lV(this,r)));const A=s.disposer.disposeVar(new cV(this,r));return s.disposer.dispose(this._deletePreviousPointWhileAddingEvent.disposableOn(()=>A.do())),await s.promise(new Promise(h=>{l&&s.disposer.dispose(l.overEvent.disposableOnce(f=>{f?(r++,h(!0)):h(!1)})),s.disposer.dispose(A.overEvent.disposableOnce(f=>{f?(r--,h(!0)):h(!1)})),s.disposer.dispose(this.cancelEvent.disposableOn(()=>h(!1)))}))}))&&i.restart()});return i.start(),i}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps()})})(Et||(Et={})),c.extendClassProps(Et.prototype,Et.createDefaultProps);class lV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));const{placeEditing:o}=e;let r=new ES(e,void 0);e.editingPoints.splice(i,0,r);const a=()=>{(e.debug??Et.defaults.debug)&&console.log("delete currentPosEditor");const u=e.editingPoints.indexOf(r);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(c.track([r,"position"],[o,"position"])),o.enabled=!0;let s=!1;const l=()=>{a(),this._overEvent.emit(!1)};this.dispose(()=>{o.enabled=!1,!s&&l()}),this.dispose(o.overEvent.disposableOnce(()=>{s=!0,r.position===void 0?l():this._overEvent.emit(!0)})),(e.debug??Et.defaults.debug)&&console.log(`PointAdding creating! index(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PointAdding destroying! index(${i})`)})}get overEvent(){return this._overEvent}}function uV(t,n){const e=t.editingPoints,i=n-1;return i<0?(console.warn("previousIndex < 0, cannot delete the point!"),!1):(e.splice(i,1),!0)}class cV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_doEvent",this.disposeVar(new c.Event));this.dispose(this._doEvent.disposableOn(()=>this._overEvent.emit(uV(e,i)))),(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting creating! currentIndex(${i})`),this.dispose(()=>{(e.debug??Et.defaults.debug)&&console.log(`PreviousPointDeleting destroying! currentIndex(${i})`)})}get overEvent(){return this._overEvent}do(){return this._doEvent.emit()}}class PS extends Et{constructor(n){super(n),this.loop=!1}}class BS extends Et{constructor(n){super(n),this.loop=!0}}class Hf extends SS{constructor(n,e){super(n,e);{const{menuPoi:i}=this;i.commands=[["add","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],i.clickCommandName="modify",i.rightClickCommandName="delete",this.dispose(i.commandEvent.disposableOn(o=>{n.menuPoiCommand(this,o)})),this.dispose(i.dbclickEvent.disposableOn(()=>{n.menuPoiCommand(this,"dbClick")}))}if(n.middlePointShow){const i=this.ad(new yi(n.czmViewer));{i.imageUri=n.firstControlPointImageUrl??tt.defaults.firstControlPointImageUrl,i.tooltip="点击增加一个控制点",i.bgColor=[0,0,0,.6],i.fgColor=[1,1,1,1],i.size=[8,8],i.originRatioAndOffset=[.5,.5,0,0];{const o=()=>{i.enabled=i.show=!1},r=()=>{var d;if(!(n.enabled??tt.defaults.enabled))return o();const a=n.editingPoints.indexOf(this),s=n.editingPoints,l=s.length;if(a===-1||l===0||!(n.loop??tt.defaults.loop)&&a+1>=l)return o();const u=this.position;if(!u)return o();const A=(d=s.get((a+1)%l))==null?void 0:d.position;if(!A)return o();const h=hp(u,A);if(!h)return o();h[2]-=n.czmViewer.editingHeightOffset??0,i.position=h;const f=l<(n.maxPointsNum??tt.defaults.maxPointsNum);i.enabled=i.show=f};r(),this.dispose(n.positionsChanged.disposableOn(r)),this.dispose(n.loopChanged.disposableOn(r)),this.dispose(n.enabledChanged.disposableOn(r))}this.dispose(i.clickEvent.disposableOn(o=>{if(o.button!==0||n.editingPoints.length>=(n.maxPointsNum??tt.defaults.maxPointsNum))return;const r=n.editingPoints.indexOf(this);if(r===-1)return;const a=i.position?[...i.position]:void 0;a&&(a[2]+=n.czmViewer.editingHeightOffset??0);let s=new Hf(n,a);n.editingPoints.splice(r+1,0,s),n.modify(s)}))}}}}class tt extends ei{constructor(e){super(e);L(this,"_menuPoiCommand",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"translationEditing");{const r=this.ad(c.createNextAnimateFrameEvent(this.moveWithFirstPositionChanged,this.editingPoints.changedEvent));this.ad(new c.ObjResettingWithEvent(r,()=>{if(!(!this.moveWithFirstPosition||this.editingPoints.length<=1))return new hV(this.editingPoints.get(0),this)}))}const i=this.translationEditing=this.disposeVar(new lr(e));i.enabled=!1;const o=async(r,a)=>{if((this.debug??tt.defaults.debug)&&console.log("进入Modifying修改状态"),this.status="Modifying",a=await r.promise(c.step(r,async s=>{const l=s.disposer,u=l.ad(new AV(this));return l.dispose(()=>"modifying canceled!"),this.editingPoints.length>0&&u.modify(this.editingPoints.get(a===-1||a>=this.editingPoints.length?0:a)),l.dispose(this.cancelEvent.disposableOn(()=>u.cancel())),l.dispose(this._forceModifyPosEditorEvent.disposableOn(h=>u.modify(h))),await s.promise(new Promise(h=>{l.dispose(u.overEvent.disposableOnce(f=>{h(f)}))}))})),a===-1)(this.debug??tt.defaults.debug)&&console.log("退出编辑状态");else{if(this.editingPoints.length>=(this.maxPointsNum??tt.defaults.maxPointsNum))return;if(this.editingPoints.length===0){console.error("impl.positionEditors.length === 0!");return}this.loop??tt.defaults.loop;const l=this.editingPoints.get(a-1).position;if(!l)return;let u=a%this.editingPoints.length;const h=this.editingPoints.get(u).position;if(!h)return;const f=hp(l,h);if(!f)return;f&&(f[2]+=this.czmViewer.editingHeightOffset??0);let d=new Hf(this,f);this.editingPoints.splice(a,0,d),await o(r,a)}};this.currentProcess=this.disposeVar(c.createProcessingFromAsyncFunc(async r=>{r.disposer.dispose(()=>{(this.debug??tt.defaults.debug)&&console.log("---editing canceled~~~"),this.status="None",this.enabled=!1}),await o(r,-1),this.status="None",this.enabled=!1}))}menuPoiCommand(e,i){this._menuPoiCommand.emit(e,i)}modify(e){this._forceModifyPosEditorEvent.emit(e)}resetPositions(e){if(!super.resetPositions(e))return!0;const i=e?e.map(o=>new Hf(this,o)):[];return this.editingPoints.splice(0,this.editingPoints.length,...i),!0}get overEvent(){return this._overEvent}}(t=>{t.createDefaultProps=()=>({...ei.createDefaultProps(),moveWithFirstPosition:!1})})(tt||(tt={})),c.extendClassProps(tt.prototype,tt.createDefaultProps);class hV extends c.Destroyable{constructor(n,e){super(),this._firstPositionEditor=n,this.multiPointsModifyEditing=e,this._firstPositionEditor.positionChanged.disposableOn((i,o)=>{if(i===void 0||o===void 0)return;var r=[i[0]-o[0],i[1]-o[1],i[2]-o[2]];const a=this.multiPointsModifyEditing.editingPoints.length;for(let s=1;s<a;s++){const l=this.multiPointsModifyEditing.editingPoints.get(s),u=l.position;u!==void 0&&(l.position=[u[0]+r[0],u[1]+r[1],u[2]+r[2]])}})}}class AV extends c.Destroyable{constructor(e){super();L(this,"_overEvent",this.disposeVar(new c.Event));L(this,"_cancelEvent",this.disposeVar(new c.Event));L(this,"_forceModifyPosEditorEvent",this.disposeVar(new c.Event));e.menuPoiEnabled=!0,this.dispose(()=>e.menuPoiEnabled=!1);let i;const o=()=>{i==null||i.destroy(),i=void 0,e.status="Modifying"};this.dispose(o);const r=a=>{o(),e.status="Modifying_Point",i=new fV(e,a),i.dispose(i.overEvent.disposableOn(()=>{o()}))};this.dispose(this._forceModifyPosEditorEvent.disposableOn(r)),this.dispose(e._menuPoiCommand.disposableOn((a,s)=>{if(s==="delete"){if(e.editingPoints.length<=2)return;const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");e.editingPoints.splice(l,1)}else if(s==="modify")r(a);else if(s==="add"){const l=e.editingPoints.indexOf(a);if(l===-1)throw console.error("posEditor not found"),new Error("posEditor not found");this._overEvent.emit(l+1)}else s==="dbClick"?this._overEvent.emit(-1):alert(`未知的commandName(${s})`)})),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 fV extends c.Destroyable{constructor(e,i){super();L(this,"_overEvent",this.disposeVar(new c.Event));this._modifying=e,this._posEditor=i,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(c.track([this._posEditor,"position"],[o,"position"])),this.dispose(o.enabledChanged.disposableOnce(r=>{r||this._overEvent.emit()}))}get overEvent(){return this._overEvent}}class TS extends tt{constructor(n){super(n),this.loop=!1}}class IS extends tt{constructor(n){super(n),this.loop=!0}}class Ua extends Et{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),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 i=c.geoHeading(this.startPosition,this.endPosition),o=c.geoDistance(this.startPosition,this.endPosition);if(o<=0){this.rotation=[90,0,0],this.distance=1;return}const r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/o)*180/Math.PI,s=Math.sqrt(o*o+r*r);this.rotation=[i,a,0],this.distance=s};e(),this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([90,0,0]),distance:c.react(1)})})(Ua||(Ua={})),c.extendClassProps(Ua.prototype,Ua.createDefaultProps);class rs extends tt{init(){const n=this.startPosition;if(!n)return;const e=this.distance,i=this.rotation,o=e*Math.cos(i[1]*Math.PI/180),r=c.geoDestination(n,o,i[0]);if(!r){this.positions=[n];return}const a=e*Math.sin(i[1]*Math.PI/180);r[2]+=a,this.positions=[n,r],this.editingPoints.length==2&&(this.editingPoints.get(0).position=n,this.editingPoints.get(1).position=r)}constructor(n){super(n),this.loop=!0,this.maxPointsNum=2,this.middlePointShow=!1,this.moveWithFirstPosition=!0;{const e=()=>{var s;if(!((s=this.positions)!=null&&s.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","增加控制点","",tt.baseImageUrl+"add.png"],["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]],this.rotation=[90,0,0],this.distance=1;this.endPosition=this.positions[1];for(let l of this.editingPoints)l.menuPoi.commands=[["delete","删除当前控制点","",tt.baseImageUrl+"delete.png"],["modify","修改当前控制点","",tt.baseImageUrl+"modify.png"]];const i=c.geoDistance(this.startPosition,this.endPosition);if(Math.abs(i)<=0)return this.rotation=[90,0,0],this.distance=1;const o=c.geoHeading(this.startPosition,this.endPosition),r=this.endPosition[2]-this.startPosition[2],a=Math.atan(r/i)*180/Math.PI;this.rotation=[o,a,0],this.distance=Math.hypot(i,r)};this.ad(this.positionsChanged.don(e))}}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),startPosition:c.reactArrayWithUndefined(void 0),endPosition:c.reactArrayWithUndefined(void 0),rotation:c.reactArray([0,0,0]),distance:c.react(0)})})(rs||(rs={})),c.extendClassProps(rs.prototype,rs.createDefaultProps);class FS extends Et{constructor(n){super(n),this.loop=!1,this.polylineShow=!1}}class MS extends tt{constructor(n){super(n),this.loop=!1,this.polylineShow=!1,this.middlePointShow=!1}}class Oa extends Et{constructor(n){super(n),n.viewer||(this.loop=!1);{const e=()=>{if(!this.positions||this.positions.length<2){this.visibilityPositions=void 0;return}const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...Et.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(Oa||(Oa={})),c.extendClassProps(Oa.prototype,Oa.createDefaultProps);class La extends tt{constructor(n){if(super(n),!!n.viewer){this.loop=!1,this.middlePointShow=!1;{const e=()=>{if(!this.positions||this.positions.length<2)return;const i=[...this.positions[0]];i[2]-=n.editingHeightOffset??0,this.visibilityPositions=this.positions.map(o=>(o[2]-=n.editingHeightOffset??0,[i,o]))};e(),this.ad(this.positionsChanged.don(e))}}}createPolyline(n){const e=this.ad(new ai(n));e.topOrBottom="bottom",this.ad(c.track([e,"color"],[this,"polylineColor"])),this.ad(c.track([e,"width"],[this,"polylineWidth"])),this.ad(c.track([e,"show"],[this,"polylineShow"])),this.ad(c.track([e,"arcType"],[this,"polylineArcType"])),this.ad(c.track([e,"loop"],[this,"loop"])),this.ad(c.track([e,"positions"],[this,"visibilityPositions"]))}}(t=>{t.createDefaultProps=()=>({...tt.createDefaultProps(),visibilityPositions:c.reactPositionsSet(void 0)})})(La||(La={})),c.extendClassProps(La.prototype,La.createDefaultProps);class DS extends rs{constructor(n){super(n),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 un extends c.EngineObject{constructor(e,i,o){super(e,i,o??!0);L(this,"_currentEditing",this.disposeVar(c.react(void 0)));this.ad(this.toDestroyEvent.don(()=>{var r;if(this.currentEditing)if(this.currentEditing instanceof Et&&((r=this.currentEditing.currentProcess)!=null&&r.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 Li&&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 ih=class ih extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Li(e));if(this.ad(e.clickEvent.don(o=>{var r;((r=o.pointerEvent)==null?void 0:r.button)==2&&(i.enabled=!0)})),Reflect.has(n,"position")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),i.enabled=!i.position||c.equalsN3(i.position,[0,0,0])}else throw new Error(`PlaceEditingWrapper:${n.typeName} 坐标属性无法绑定位置编辑`)}};L(ih,"type",ih.registerEditing("ESCesiumViewer",c.ESJEditingMode.Place,ih));let pv=ih;const rh=class rh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new pi(e));if(i.rotation=[90,0,0],this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);o&&(this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"])),this.ad(c.bind([i,"selfRotation"],[n,"rotation"])))});else if(Reflect.has(n,"position")&&Reflect.has(n,"rotation")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"selfRotation"],[o,"rotation"]))}else throw new Error(`RotationEditingWrapper:${n.typeName} 旋转属性无法绑定旋转编辑`)}};L(rh,"type",rh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Rotation,rh));let dv=rh;const oh=class oh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new ur(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")&&Reflect.has(n,"scale")){const o=n;this.ad(c.bind([i,"position"],[o,"position"])),this.ad(c.bind([i,"scale"],[o,"scale"]))}else throw new Error(`ScaleEditingWrapper:${n.typeName} 缩放属性无法绑定缩放编辑`)}};L(oh,"type",oh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Scale,oh));let mv=oh;const sh=class sh extends un{constructor(n,e){super(Array.isArray(n)?n[0]:n,e,!0);const i=this.currentEditing=this.ad(new lr(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Array.isArray(n)){const o=[];for(let r=0;r<n.length;r++){const a=n[r];Reflect.has(a,"position")?o.push(a.position):a.points&&o.push(...a.points)}i.position=c.getMinMaxCorner(o).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(!(!r||!a)){var s=vn({originPosition:a},[r])[0][0];n.forEach(l=>{const u=l;if(Reflect.has(l,"position")){const A=vn({originPosition:a},[u.position])[0][0];u.position=_r({originPosition:a},[[A[0]+s[0],A[1]+s[1],A[2]+s[2]]])[0][0]}else if(Reflect.has(u,"points")&&u.points){const A=vn({originPosition:a},u.points)[0];u.points=_r({originPosition:a},A.map(h=>[h[0]+s[0],h[1]+s[1],h[2]+s[2]]))[0]}})}}))}else if(Reflect.has(n,"position"))this.ad(c.bind([i,"position"],[n,"position"]));else if(n instanceof c.ES3DTileset)c.registerCreatedEventUpdate(this,n,()=>{const o=e.getEngineObject(n);this.ad(c.bind([i,"position"],[o.czm3DTiles,"position"]))});else if(Reflect.has(n,"points")){const o=n;if(o.points===void 0||o.points.length===0){this.destroy();return}i.position=c.getMinMaxCorner(o.points).center,this.ad(i.positionChanged.disposableOn((r,a)=>{if(r===void 0||a===void 0||o.points===void 0||o.points.length===0){this.destroy();return}var s=vn({originPosition:a},[r])[0][0];const l=vn({originPosition:a},o.points)[0];o.points=_r({originPosition:a},l.map(u=>[u[0]+s[0],u[1]+s[1],u[2]+s[2]]))[0]}))}else throw new Error(`TranslationEditingWrapper:${n.typeName} 坐标属性无法绑定平移编辑`)}};L(sh,"type",sh.registerEditing("ESCesiumViewer",c.ESJEditingMode.Translation,sh));let Gf=sh;const ah=class ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Ua(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"position")){const o=n;if(this.ad(c.bind([i,"startPosition"],[o,"position"])),this.ad(Mt([i,"rotation"],[o,"rotation"])),Reflect.has(o,"far"))this.ad(c.bind([i,"distance"],[o,"far"]));else if(Reflect.has(o,"radius"))this.ad(c.bind([i,"distance"],[o,"radius"]));else if(Reflect.has(o,"distance"))this.ad(c.bind([i,"distance"],[o,"distance"]));else{const r=ft(o.position);if(_.Cartesian3.ZERO.equals(r)||!e.viewer)return;i.distance=Ni(e.viewer.scene,r,100)??1}}else if(Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`DoublePointsAppendEditingWrapper:${n.typeName} 坐标属性无法绑定双点追加编辑`);i.startPosition&&!c.equalsN3(i.startPosition,[0,0,0])&&i.init(),i.enabled=!0}};L(ah,"type",ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsAppend,ah));let gv=ah;const lh=class lh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new rs(e));if(Reflect.has(n,"position")){const r=n;if(this.ad(c.bind([i,"startPosition"],[r,"position"])),this.ad(Mt([i,"rotation"],[r,"rotation"])),Reflect.has(r,"far"))this.ad(c.bind([i,"distance"],[r,"far"]));else if(Reflect.has(r,"radius"))this.ad(c.bind([i,"distance"],[r,"radius"]));else if(Reflect.has(r,"distance"))this.ad(c.bind([i,"distance"],[r,"distance"]));else{const a=ft(r.position);if(_.Cartesian3.ZERO.equals(a)||!e.viewer)return;i.distance=Ni(e.viewer.scene,a,100)??1}}else if(Reflect.has(n,"points")){const r=n;if(r.points.length!=2)throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.moveWithFirstPosition=!1;const a=()=>i.positions=r.points??[];a(),this.ad(r.pointsChanged.don(()=>!i.enabled&&a())),this.ad(c.track([r,"points"],[i,"positions"]))}else throw new Error(`DoublePointsModifyEditingWrapper:${n.typeName} 坐标属性无法绑定双点修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(lh,"type",lh.registerEditing("ESCesiumViewer",c.ESJEditingMode.DoublePointsModify,lh));let yv=lh;const uh=class uh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new BS(e));this.ad(i.enabledChanged.don(r=>{!r&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))}));const o=n;if(Reflect.has(o,"points")){const r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularAppendEditingWrapper:${o.typeName} 坐标属性无法绑定环形追加编辑`)}};L(uh,"type",uh.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularAppend,uh));let vv=uh;const ch=class ch extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new IS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`CircularInsertEditingWrapper:${n.typeName} 坐标属性无法绑定环形插值编辑`)}};L(ch,"type",ch.registerEditing("ESCesiumViewer",c.ESJEditingMode.CircularInsert,ch));let wv=ch;const hh=class hh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new PS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringAppendEditingWrapper:${n.typeName} 坐标属性无法绑定线段追加编辑`)}};L(hh,"type",hh.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringAppend,hh));let bv=hh;const Ah=class Ah extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new TS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`LineStringInsertEditingWrapper:${n.typeName} 坐标属性无法绑定线段插入编辑`)}};L(Ah,"type",Ah.registerEditing("ESCesiumViewer",c.ESJEditingMode.LineStringInsert,Ah));let xv=Ah;const fh=class fh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new FS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterAppendEditingWrapper:${n.typeName} 坐标属性无法绑定散点追加编辑`)}};L(fh,"type",fh.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterAppend,fh));let _v=fh;const ph=class ph extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new MS(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`ScatterModifyEditingWrapper:${n.typeName} 坐标属性无法绑定散点修改编辑`)}};L(ph,"type",ph.registerEditing("ESCesiumViewer",c.ESJEditingMode.ScatterModify,ph));let Cv=ph;const dh=class dh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new Oa(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityAppendEditingWrapper:${n.typeName} 坐标属性无法绑定可见性追加编辑`)}};L(dh,"type",dh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityAppend,dh));let Sv=dh;const mh=class mh extends un{constructor(n,e){super(n,e,!0);const i=this.currentEditing=this.ad(new La(e));if(this.ad(i.enabledChanged.don(o=>{!o&&this.ad(c.nextAnimateFrame(()=>{this.destroy()}))})),Reflect.has(n,"points")){const o=n,r=()=>i.positions=o.points??[];r(),this.ad(o.pointsChanged.don(()=>!i.enabled&&r())),i.enabled=!0,this.ad(c.track([o,"points"],[i,"positions"]))}else throw new Error(`VisibilityModifyEditingWrapper:${n.typeName} 坐标属性无法绑定可见性修改编辑`)}};L(mh,"type",mh.registerEditing("ESCesiumViewer",c.ESJEditingMode.VisibilityModify,mh));let Ev=mh;const gh=class gh extends un{constructor(n,e){if(super(n,e,!0),!e.viewer)return;const i=this.currentEditing=this.ad(new DS(e));if(Reflect.has(n,"points")){const r=n,a=Reflect.has(r,"extrudedHeight"),s=Reflect.has(r,"height"),l=Reflect.has(r,"perPositionHeight")?r.perPositionHeight:!a,u=r instanceof c.ESClassification||r instanceof c.ESPolygonFence;let A=c.getMinMaxCorner(r.points).center,h=[...A],f=u?r.points[0][2]:0;l?a?h[2]=r.extrudedHeight:h[2]=r.height+f:(s&&(A[2]=r.height),a&&(h[2]=r.extrudedHeight)),i.startPosition=A,i.distance=h[2]-A[2],i.moveWithFirstPosition=!1;let d=[...A];this.ad(i.positionsChanged.don(()=>{i.positions.length===2&&(l?(r.points=r.points.map(p=>[p[0],p[1],p[2]+i.positions[0][2]-d[2]]),a?r.extrudedHeight=i.positions[1][2]:s&&(r.height=i.positions[1][2]-(u?i.positions[0][2]:0))):(s&&(r.height=i.positions[0][2]),a&&(r.extrudedHeight=i.positions[1][2])),d=[...i.positions[0]])}))}else throw new Error(`HeightModifyEditingWrapper:${n.typeName} 坐标属性无法绑定高度修改编辑`);i.init(),i.enabled=!0;const o=this.ad(c.createNextAnimateFrameEvent(i.enabledChanged,i.startPositionChanged));this.ad(o.don(()=>{(!i.enabled||!i.startPosition||c.equalsN3(i.startPosition,[0,0,0]))&&this.destroy()}))}};L(gh,"type",gh.registerEditing("ESCesiumViewer",c.ESJEditingMode.HeightModify,gh));let Pv=gh;const Vt=class Vt extends c.Destroyable{constructor(e,i,o,r=!0){super();L(this,"editingModes",[]);L(this,"editingID");L(this,"useKeyToSwitch");L(this,"currentIndex",0);L(this,"currentEditingMode");L(this,"currentEditingWrapper");L(this,"_notSupportedEditCount",this.disposeVar(c.react(0)));L(this,"_onEditEnd",()=>{this._cleanupCurrentWrapper(),this.notSupportedEditCount<this.editingModes.length&&c.nextAnimateFrame(()=>this._createEditingMode(this.currentIndex+1))});this.czmViewer=e,this.sceneObject=i;const a=(Array.isArray(o)?o:[o]).filter(s=>i.supportEditingModes().includes(s));if(this.editingModes=a,this.editingID=i.editingID,this.useKeyToSwitch=r,this.editingModes.length)console.log("[ESEditMode] 可用的编辑模式",a);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,i){this.czmViewer.editingEvent.emit({objectIDs:[this.sceneObject.parentID],editingID:this.editingID,type:e,add:i})}_bindEvents(){this.ad(this.sceneObject.toDestroyEvent.don(Vt.stop)),this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_ESCAPE&&Vt.stop())),this.ad(this.czmViewer.dblclickEvent.don(e=>{var i;return((i=e.pointerEvent)==null?void 0:i.button)===Vt.MOUSE_LEFT&&c.nextAnimateFrame(()=>{Vt.stop()})})),this.useKeyToSwitch&&this.ad(this.czmViewer.keyDownEvent.don(e=>e.code===Vt.KEY_SPACE&&this._onEditEnd())),this.ad(()=>this._cleanupCurrentWrapper()),this.ad(this.notSupportedEditCountChanged.don(()=>{this.notSupportedEditCount>=this.editingModes.length&&Vt.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 i=c.EngineObject.contextEditing.getEngineObjConstructor(this.currentEditingMode,this.czmViewer.typeName);if(!i){this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd();return}this.currentEditingWrapper=new i(this.sceneObject,this.czmViewer),this._emitEditingEvent("changed",{cMode:this.currentEditingMode,cIndex:e}),this.notSupportedEditCount=0}catch(i){this.notSupportedEditCount++,console.error(`[ESEditMode] 创建编辑模式${this.currentEditingMode}失败`,i),this._emitEditingEvent("changedFailed",{cMode:this.currentEditingMode,cIndex:this.currentIndex}),this._onEditEnd()}}}static create(e,i,o,r=!0){Vt.stop(),Vt.esEditModeInstance=new Vt(e,i,o,r)}static stop(){const e=Vt.esEditModeInstance;if(e&&!e.isDestroyed()){const{czmViewer:i,sceneObject:o,editingID:r,editingModes:a}=e;e.destroy(),i.editingEvent.emit({objectIDs:[o.parentID],editingID:r,type:"end",add:{modes:a}})}Vt.esEditModeInstance=void 0}};L(Vt,"KEY_ESCAPE","Escape"),L(Vt,"KEY_SPACE","Space"),L(Vt,"MOUSE_LEFT",0),L(Vt,"esEditModeInstance");let Wf=Vt;function RS(){const t=c.createProcessingFromAsyncFunc(async(n,e,i,o)=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"start"});const r=()=>{e.editingEvent.emit({objectIDs:i.map(l=>l.parentID),editingID:o,type:"end"}),t.isRunning&&t.cancel()};n.disposer.ad(r);const a=l=>{l.code=="Escape"&&r()};n.disposer.ad(e.keyDownEvent.don(a));const s=new Gf(i,e);n.disposer.ad(()=>{!s.isDestroyed()&&s.destroy()}),await n.promise(new Promise(l=>{s.isDestroyed()&&l(),n.disposer.ad(s.toDestroyEvent.don(()=>{console.log("移动结束"),l()})),n.disposer.ad(e.dblclickEvent.don(()=>l()))}))});return t}class pV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n,c.registerCreatedEventUpdate(this,e,()=>{let i;const o=n.getEngineObject(e);e instanceof c.ESBoxClipping&&(i=o.czmBoxClippingPlanes),!(!i||!("computedClippingPlanes"in i)||!("computedClippingPlanesChanged"in i))&&(this.dispose(c.track([this._czmViewer,"sceneGlobeClippingPlanes"],[i,"computedClippingPlanes"])),this.dispose(()=>this._czmViewer.sceneGlobeClippingPlanes=void 0))})}}class dV extends c.Destroyable{constructor(e){super();L(this,"_clippingPlanesSceneObjectWithId",this.disposeVar(new c.ESSceneObjectWithId));this.dispose(c.track([this._clippingPlanesSceneObjectWithId,"id"],[e,"sceneGlobeClippingPlanesId"])),this.disposeVar(new c.ObjResettingWithEvent(this._clippingPlanesSceneObjectWithId.sceneObjectChanged,()=>{const{sceneObject:i}=this._clippingPlanesSceneObjectWithId;if(i)return new pV(e,i)}))}}class mV extends c.Destroyable{constructor(n){super(),this.dv(new c.ObjResettingWithEvent(n.sceneGlobeClippingPolygonsIdChanged,(e,i)=>{if(!(!e||e===i||e&&e.length===0))return new gV(n)}))}}class gV extends c.Destroyable{constructor(n){super(),this._czmViewer=n,this.d(()=>this._czmViewer.sceneGlobeClippingPolygons=void 0);const e=this._czmViewer.sceneGlobeClippingPolygonsId,i=o=>{if(!o)return;const r=this.dv(c.createNextAnimateFrameEvent(o.positionsChanged,o.reverseChanged,o.enabledChanged,o.showHelperChanged));this.dv(new c.ObjResettingWithEvent(r,()=>{if(o)return new yV(n,o)}))};for(let o=0;o<e.length;o++){const r=e[o],a=c.ESSceneObject.getSceneObjById(r);if(!a)return;let s;a instanceof c.ESExcavate?c.registerCreatedEventUpdate(this,a,()=>{s=n.getEngineObject(a).czmPolygonClipping,i(s)}):a instanceof c.ESHole&&c.registerCreatedEventUpdate(this,a.excavate,()=>{s=n.getEngineObject(a.excavate).czmPolygonClipping,i(s)})}}}class yV extends c.Destroyable{constructor(n,e){super(),this._czmViewer=n;const i=this._czmViewer.sceneGlobeClippingPolygonsId,o=e.enabled?e.reverse:void 0;if(i&&i.length>0){const r={polygons:[],enabled:!0,inverse:!1};for(let a=0;a<i.length;a++){const s=i[a],l=c.ESSceneObject.getSceneObjById(s);if(!l)return;let u;if(l instanceof c.ESExcavate?u=n.getEngineObject(l).czmPolygonClipping:l instanceof c.ESHole&&(u=n.getEngineObject(l.excavate).czmPolygonClipping),!u)return;u&&u.positions&&u.positions.length>=3&&u.enabled&&(r.polygons[a]={positions:u.positions},r.inverse=o??u.reverse)}this._czmViewer.sceneGlobeClippingPolygons=r}}}class vV extends c.Destroyable{constructor(n,e){var a;super(),this._viewer=n;const i=(a=this._viewer.extensions)==null?void 0:a.pickingManager;if(!i)return;const{objectsToExclude:o}=i,r=Array.isArray(e)?[...e]:[e];for(const s of r){if(o.includes(s))throw new Error("objectsToExclude.includes(p)");o.push(s)}this.dispose(()=>{for(let s of r){const l=o.indexOf(s);if(l===-1)throw new Error("-1 === objectsToExclude.indexOf(p)");o.splice(l,1)}})}}class wV extends c.Destroyable{constructor(e){var a;super();L(this,"_czmGlobeMaterial");this._czmViewer=e,this._czmGlobeMaterial=this.dv(new Qo(e)),this._czmGlobeMaterial.show=!0;let i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),o=(a=this._czmViewer.viewer)==null?void 0:a.scene.preUpdate.addEventListener(()=>{var l;const s=i.elevationContour.show&&(((l=this._czmViewer.getCameraInfo())==null?void 0:l.position[2])??0)<=i.elevationContour.spacing*1e3;this._czmGlobeMaterial.enableContour!==s&&(this._czmGlobeMaterial.enableContour=s)});this.d(()=>{o&&o()});const r=()=>{i=Object.assign({},ot.defaults.terrainShader,this._czmViewer.terrainShader),this._czmGlobeMaterial.shadingMode="none",i.aspect.show&&(this._czmGlobeMaterial.shadingMode="aspect"),i.slope.show&&(this._czmGlobeMaterial.shadingMode="slope"),i.elevationRamp.show&&(this._czmGlobeMaterial.shadingMode="elevation"),this._czmGlobeMaterial.contourSpacing=i.elevationContour.spacing,this._czmGlobeMaterial.contourWidth=i.elevationContour.width,this._czmGlobeMaterial.contourColor=i.elevationContour.color,this._czmGlobeMaterial.elevationParam={minHeight:i.elevationRamp.minHeight,maxHeight:i.elevationRamp.maxHeight,color:i.elevationRamp.color}};r(),this.d(this._czmViewer.terrainShaderChanged.don(r))}get czmGlobeMaterial(){return this._czmGlobeMaterial}}async function bV(t,n){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,...n??{}},i=new _.Viewer(t,e);return i.imageryLayers.removeAll(),i.extend(_.viewerCesiumInspectorMixin),i.cesiumInspector.container.style.display="none",i.extend(_.viewerCesium3DTilesInspectorMixin),i.cesium3DTilesInspector.container.style.display="none",i.cesium3DTilesInspector.viewModel.picking=!1,i.clock.currentTime=_.JulianDate.fromDate(new Date("2022-04-19T20:00:53.10067292911116965Z")),i.scene.screenSpaceCameraController.lookEventTypes=[{eventType:_.CameraEventType.RIGHT_DRAG}],i.scene.screenSpaceCameraController.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}],i.scene.screenSpaceCameraController.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_CLICK),i.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),i._cesiumWidget._creditContainer.style.display="none",i}function xV(){_.Cesium3DTile.prototype.updateTransform=function(t,n){t=t??_.Matrix4.IDENTITY;const e=_.Matrix4.multiplyTransformation(t,this.transform,new _.Matrix4),i=!_.Matrix4.equals(e,this.computedTransform),o=_.defined(n)&&(this._verticalExaggeration!==n.verticalExaggeration||this._verticalExaggerationRelativeHeight!==n.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&_.Matrix4.clone(e,this.computedTransform),o&&(this._verticalExaggeration=n.verticalExaggeration,this._verticalExaggerationRelativeHeight=n.verticalExaggerationRelativeHeight);const r=this._header,a=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform),_.defined(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(a.boundingVolume,this.computedTransform)),_.defined(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.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 _V(){Reflect.getOwnPropertyDescriptor(_.Camera.prototype,"_currentFlight")||Object.defineProperties(_.Camera.prototype,{_currentFlight:{get:function(){return this._vtxf_currentFlight},set:function(t){if(this._vtxf_currentFlight!==t){this._vtxf_currentFlight=t;var n=this._vtxf_currentFlight,e=t;this.currentFlightEvent.raiseEvent(e,n)}}},currentFlightEvent:{get:function(){return typeof this._vtxf_currentFlightEvent>"u"&&(this._vtxf_currentFlightEvent=new _.Event),this._vtxf_currentFlightEvent}}})}function CV(){const t=new _.Matrix4;function n(i,o){const r=i.positionWC;_.Matrix4.clone(i.transform,t),i.lookAtTransform(_.Matrix4.IDENTITY),i.look(r,o),i.lookAtTransform(t)}const e=Math.PI/60;_.Camera.prototype.lookLeft=function(i){i=i??e,this._mode!==_.SceneMode.SCENE2D&&n(this,-i)},_.Camera.prototype.lookRight=function(i){this.lookLeft(-i)}}function SV(){if(!_.DepthPlane.xbsjFixed){_.DepthPlane.xbsjFixed=!0;var t=_.DepthPlane.prototype.update;_.DepthPlane.prototype.update=function(){t.bind(this)(...arguments);var n=arguments[0];if(!this.hasXbsjIndexBuffer&&this._va){this.hasXbsjIndexBuffer=!0;var e=n.context,i=new _.Geometry({attributes:{position:new _.GeometryAttribute({componentDatatype:_.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(15)})},indices:[0,1,4,1,3,4,3,2,4,2,0,4],primitiveType:_.PrimitiveType.TRIANGLES});this._va=_.VertexArray.fromGeometry({context:e,geometry:i,attributeLocations:{position:0},bufferUsage:_.BufferUsage.DYNAMIC_DRAW}),this._command.vertexArray=this._va}}}}function EV(t){const n=t.BoundingSphere,e=t.Cartesian3,i=t.defined,o=t.OrientedBoundingBox,r=t.Rectangle,a=t.TaskProcessor,s=t.TerrainData,l=t.TerrainEncoding,u=t.TerrainMesh,A=t.GoogleEarthEnterpriseTerrainData,h="createVerticesFromGoogleEarthEnterpriseBuffer",f=new a(h),d=new a(h,s.maximumAsynchronousTasks),p=new r,g=new r;A.prototype.createMesh=function(v){v=v??Xe.Frozen.EMPTY_OBJECT;const y=v.tilingScheme,m=v.x,b=v.y,x=v.level,E=v.exaggeration??1,B=v.exaggerationRelativeHeight??0,P=v.throttle??!0,I=y.ellipsoid;y.tileXYToNativeRectangle(m,b,x,p),y.tileXYToRectangle(m,b,x,g);const M=I.cartographicToCartesian(r.center(g));this._skirtHeight=1.9134410999999999e6;const S=(P?d:f).scheduleTask({buffer:this._buffer,nativeRectangle:p,rectangle:r.clone(g),relativeToCenter:M,ellipsoid:I,skirtHeight:this._skirtHeight,exaggeration:E,exaggerationRelativeHeight:B,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!i(S))return;const T=this;return S.then(function(w){return T._mesh=new u(M,new Float32Array(w.vertices),new Uint16Array(w.indices),w.indexCountWithoutSkirts,w.vertexCountWithoutSkirts,w.minimumHeight,w.maximumHeight,n.clone(w.boundingSphere3D),e.clone(w.occludeePointInScaledSpace),w.numberOfAttributes,o.clone(w.orientedBoundingBox),l.clone(w.encoding),w.westIndicesSouthToNorth,w.southIndicesEastToWest,w.eastIndicesNorthToSouth,w.northIndicesWestToEast),T._minimumHeight=w.minimumHeight,T._maximumHeight=w.maximumHeight,T._buffer=void 0,T._mesh})}}function PV(){return _.VERSION.split(".").map(n=>parseInt(n))}let Bv;function BV(){return Bv||(Bv=PV()),Bv}function TV(){const t=BV();t[0]===1&&t[1]>=92?EV(_):console.warn(`don't need to fixGoogleEarth, cesium version is ${t.join(".")}`)}function IV(){const t=_.Resource.prototype.fetchJson,n=_.Resource.prototype.fetchArrayBuffer;_.Resource.prototype.fetchJson=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getJson(i)}else return t.call(this,...e)},_.Resource.prototype.fetchArrayBuffer=function(...e){if(this.url.startsWith(`https://${c.defaultLocalFileServer.prefix}`)){const i=this.url.substring(8);return c.defaultLocalFileServer.getArrayBuffer(i).then(o=>{if(!o)throw new Error("result is undefined!");return o})}else return n.call(this,...e)}}function FV(){const t=_.ModelSceneGraph.prototype.buildDrawCommands;_.ModelSceneGraph.prototype.buildDrawCommands=function(...n){const e=this._model,i=e.modelMatrix;e.modelMatrix=_.Matrix4.IDENTITY;const o=t.call(this,...n);return e.modelMatrix=i,o}}function MV(){const t=_.ShaderSource._czmBuiltinsAndUniforms;t.czm_materialInput.indexOf("vec4 color")===-1&&(t.czm_materialInput=t.czm_materialInput.replace("float aspect;","float aspect; vec4 color;"))}const DV=`#ifdef GL_OES_standard_derivatives
3776
3776
  #extension GL_OES_standard_derivatives : enable
3777
3777
  #endif
3778
3778
 
@@ -3806,8 +3806,9 @@ material.alpha = materialInput.color.a;
3806
3806
 
3807
3807
  return material;
3808
3808
  }
3809
- `;_.Material.GlobeLevelMaterialType="GlobelLevel",_.Material._materialCache.addMaterial(_.Material.GlobeLevelMaterialType,{fabric:{type:_.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new _.Cartesian3(0,0,0),input_highlights:new _.Cartesian3(1,1,1),midtones:new _.Cartesian3(.5,.5,.5),output_shadows:new _.Cartesian3(0,0,0),output_highlights:new _.Cartesian3(1,1,1)},source:MV},translucent:!1});const{PrimitiveRenderResources:DV,ModelUtility:RV,Cartesian3:ti,Matrix4:za,ModelRenderResources:UV,defined:OV,NodeRenderResources:LV,BoundingSphere:cr,ModelDrawCommands:zV}=_,kV=new ti,QV=new ti,US=new ti,OS=new ti;class VV extends DV{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=za.inverse(i,new za),r=RV.getPositionMinMax(e.primitive,za.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,US),za.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,OS));this.positionMin=ti.clone(r.min,new ti),this.positionMax=ti.clone(r.max,new ti),this.boundingSphere=cr.fromCornerPoints(this.positionMin,this.positionMax,new cr)}}function NV(){_.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new UV(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=ti.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,kV),l=ti.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,QV);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!OV(u))continue;u.configurePipeline();const A=u.pipelineStages,h=new LV(e,u);for(r=0;r<A.length;r++)A[r].process(h,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const d=u.runtimePrimitives[r];d.configurePipeline(t);const p=d.pipelineStages,g=new VV(h,d,f);for(a=0;a<p.length;a++)p[a].process(g,d.primitive,t);d.boundingSphere=cr.clone(g.boundingSphere,new cr);const v=za.multiplyByPoint(f,g.positionMin,US),y=za.multiplyByPoint(f,g.positionMax,OS);ti.minimumByComponent(s,v,s),ti.maximumByComponent(l,y,l);const m=zV.buildModelDrawCommand(g,t);d.drawCommand=m}}this._boundingSphere=cr.fromCornerPoints(s,l,new cr),this._boundingSphere=cr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=cr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=cr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const yh=class yh extends c.Destroyable{constructor(){super(),_.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{yh.oldUpdate.call(this,n),this._particles.forEach(i=>{_.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{_.ParticleSystem.prototype.update=yh.oldUpdate})}};L(yh,"oldUpdate",_.ParticleSystem.prototype.update);let Tv=yh;function HV(){if(_.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(_.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,_.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=_.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class GV{constructor(n){L(this,"index");L(this,"image");L(this,"resolve");L(this,"reject");L(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function WV(){_.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,m)=>new GV({index:m,image:y})).filter((y,m)=>_.defined(y.image)&&!_.defined(l.get(m)));let A=0,h=0,f=0;for(let y=n;y<o.length;++y){const{width:m,height:b}=o[y].image;A=Math.max(A,m),h=Math.max(h,b),f+=m*b,u.push(o[y])}a=Math.max(A,a),s=Math.max(h,s),t.webgl2||(a=_.Math.nextPowerOfTwo(a),s=_.Math.nextPowerOfTwo(s));const d=Math.sqrt(f);s*=Math.ceil(d/s),a*=Math.ceil(d/a),u.sort(({image:y},{image:m})=>m.height*m.width-y.height*y.width);const p=new Array(this._nextIndex);for(const y of this._subRegions.keys())_.defined(l.get(y))&&(p[y]=i[y]);let g,v=!1;for(;!v;){g=new _.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:m,image:b}=u[y];if(!_.defined(b))continue;const x=g.pack(m,b);if(!_.defined(x)){a>s?s*=2:a*=2;break}p[m]=x.rectangle}v=y===u.length}this._texturePacker=g,this._texture=this._copyFromTexture(t,a,s,p),r.destroy(),this._rectangles=p,this._guid=_.createGuid()}}const ro={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:jV,Indices:qV,FeatureIdAttribute:LS,FeatureIdTexture:zS,FeatureIdImplicitRange:kS,MorphTarget:KV,Primitive:ZV,Instances:$V,Skin:XV,Node:YV,AnimatedPropertyType:JV,AnimationSampler:e3,AnimationTarget:t3,AnimationChannel:n3,Animation:i3,ArticulationStage:r3,Articulation:o3,Asset:s3,Scene:a3,Components:l3,MetallicRoughness:u3,SpecularGlossiness:c3,Specular:h3,Anisotropy:Iv,Clearcoat:Fv,Material:A3}=_.ModelComponents;function f3(){_.GltfLoader.prototype.process=function(t){if(_.Check.typeOf.object("frameState",t),this._state===ro.LOADED&&!_.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=p3(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),_.defined(this._processError)){this._state=ro.FAILED;const o=this._processError;this._processError=void 0,Mv(this,o)}const n=this._textureErrors.pop();if(_.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===ro.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=ro.FAILED,Mv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=ro.FAILED,Mv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function p3(t,n){_.FeatureDetection.supportsWebP.initialized||await _.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new _.SupportedImageFormats({webp:_.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=m3(t,n);return t._state=ro.PROCESSING,t._textureState=ro.PROCESSING,_.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(_.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const d3=new _.Cartesian3;function m3(t,n){const e=t.gltfJson,i=e.extensions??_.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(_.defined(r)){const m=r.featureTables,b=r.featureTextures,x=_.defined(m)?m:[],E=_.defined(b)?b:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=g3(t,n),l=x3(t,s),u=_3(t,s),A=C3(e),h=S3(e,s),f=new l3,d=new s3,p=e.asset.copyright;if(_.defined(p)){const m=p.split(";").map(function(b){return new _.Credit(b.trim())});d.credits=m}if(f.asset=d,f.scene=h,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,_.defined(a)){const m=_.Cartesian3.fromArray(a.center,0,d3);f.transform=_.Matrix4.fromTranslation(m,f.transform)}if(t._components=f,_.defined(o)||_.defined(r)){const m=E3(t,o,r,n);t._loaderPromises.push(m)}const g=i.NGA_gpm_local;if(_.defined(g)){const m=_.GltfGpmLoader.load(g);t._components.extensions.NGA_gpm_local=m}const v=e.meshes;if(_.defined(v))for(const m of v){const b=m.primitives;if(_.defined(b))for(const x of b){const E=x.extensions;if(_.defined(E)){const B=E.NGA_gpm_local;if(_.defined(B)){const P=P3(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return KS(y,t._loaderPromises),t._incrementallyLoadTextures||KS(y,t._texturesPromises),Promise.all(y)}function g3(t,n){const e=t.gltfJson.nodes;if(!_.defined(e))return[];const i=e.map(function(o,r){const a=y3(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(_.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function y3(t,n,e){const i=new YV;i.name=n.name,i.matrix=kn(_.Matrix4,n.matrix),i.translation=kn(_.Cartesian3,n.translation),i.rotation=kn(_.Quaternion,n.rotation),i.scale=kn(_.Cartesian3,n.scale);const o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(_.defined(r)){if(t._loadForClassification)throw new _.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=B3(t,o,e)}_.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(_.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(v3(t,u[f],_.defined(i.instances),e));const A=n.weights??l.weights,h=i.primitives[0].morphTargets;i.morphWeights=_.defined(A)?A.slice():new Array(h.length).fill(0)}return i}function v3(t,n,e,i){const o=new ZV,r=new _.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;_.defined(a)&&(o.material=w3(t,t.gltfJson.materials[a],i));const s=n.extensions??_.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&_.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=T3(t,u));const A=s.KHR_spz_gaussian_splats_compression;_.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const h=t._loadForClassification,f=s.KHR_draco_mesh_compression;let d=!1;const p=n.attributes;if(_.defined(p))for(const B in p){if(!p.hasOwnProperty(B))continue;const P=p[B],I=Dv(t,_.VertexAttributeSemantic,B),M=I.modelSemantic;if(h&&!F3(M))continue;M===_.VertexAttributeSemantic.FEATURE_ID&&(d=!0);const F=QS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(F),o.attributes.push(F.attribute)}const g=n.targets;if(_.defined(g)&&!h)for(let B=0;B<g.length;++B)o.morphTargets.push(M3(t,g[B],l,r,i));const v=n.indices;if(_.defined(v)){const B=D3(t,v,n,f,d,l,i);_.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,m=s.EXT_mesh_features,b=s.EXT_feature_metadata,x=_.defined(b);_.defined(m)?R3(t,o,m,i):x&&U3(t,o,b,i),_.defined(y)?O3(o,y):x&&L3(t,o,b);const E=n.mode;if(h&&E!==_.PrimitiveType.TRIANGLES)throw new _.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function w3(t,n,e){const i=new A3,o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=_.defined(o.KHR_materials_unlit),_.defined(r)?i.specularGlossiness=b3(t,r,e):(_.defined(u)&&(i.metallicRoughness=z3(t,u,e)),_.defined(a)&&!i.unlit&&(i.specular=k3(t,a,e)),_.defined(s)&&!i.unlit&&(i.anisotropy=Q3(t,s,e)),_.defined(l)&&!i.unlit&&(i.clearcoat=V3(t,l,e))),_.defined(n.emissiveTexture)&&(i.emissiveTexture=fn(t,n.emissiveTexture,e,void 0)),_.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=fn(t,n.normalTexture,e,void 0)),_.defined(n.occlusionTexture)&&(i.occlusionTexture=fn(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=kn(_.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function b3(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new c3;return _.defined(i)&&(l.diffuseTexture=fn(t,i,e,void 0)),_.defined(o)&&(l.specularGlossinessTexture=fn(t,o,e,void 0)),l.diffuseFactor=kn(_.Cartesian4,r),l.specularFactor=kn(_.Cartesian3,a),l.glossinessFactor=s,l}function Mv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function x3(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!_.defined(e))return[];const i=e.map(function(r,a){const s=N3(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;_.defined(a)&&(n[r].skin=i[a])}return i}function _3(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!_.defined(e)?[]:e.map(function(o,r){const a=H3(t,o,n);return a.index=r,a})}function C3(t){var i;const e=(i=(t.extensions??_.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return _.defined(e)?e.map(G3):[]}function S3(t,n){const e=new a3,i=W3(t);return e.nodes=i.map(function(o){return n[o]}),e}async function E3(t,n,e,i){const o=new _.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function P3(t,n,e,i){const o=new _.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function kn(t,n){if(_.defined(n))return t===Number?n[0]:t.unpack(n)}function B3(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new $V,r=i.attributes;if(_.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(j3(t,A,r,u,e))}const a=i.extensions??_.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return _.defined(s)?q3(o,s):_.defined(l)&&K3(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function T3(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return jf(t,i,!1)}const I3={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function Dv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=I3;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function F3(t){const n=t===_.VertexAttributeSemantic.POSITION,e=t===_.VertexAttributeSemantic.FEATURE_ID,i=t===_.VertexAttributeSemantic.TEXCOORD;return n||e||i}function QS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===_.VertexAttributeSemantic.POSITION,h=u===_.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,d=A&&t._enablePick&&!l.context.webgl2,p=t._loadForClassification&&h,g=t._loadAttributesAsTypedArray,v=!g,y=g||f||d||p,x=VS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new _.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function M3(t,n,e,i,o){const r=new KV,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const h=n[A],f=Dv(t,VertexAttributeSemantic,A),d=QS(t,h,f,a,s,l,u,e,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function D3(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!_.defined(i)&&!_.defined(l))return;const u=new qV;u.count=s.count;const A=t._loadAttributesAsTypedArray,h=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,p=!A,g=A||h||f,m=Z3(t,n,e,i,r?!1:p,r?!0:g,a),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{u.indexDatatype=m.indexDatatype,u.buffer=m.buffer,u.typedArray=m.typedArray};const E=new _.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=p,E.loadTypedArray=g,E}function R3(t,n,e,i){let o;_.defined(e)&&_.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;_.defined(a.texture)?l=$3(t,a,i,s):_.defined(a.attribute)?l=NS(a,s):l=HS(a,s),n.featureIds.push(l)}}function U3(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(_.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;let p;_.defined(u.featureIds.attribute)?p=GS(u,h,f,d):p=WS(u,h,f,d),n.featureIds.push(p)}const s=e.featureIdTextures;if(_.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;const p=X3(t,u,h,i,f,d);n.featureIds.push(p)}}function O3(t,n){if(!_.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;_.defined(e)&&(t.propertyTextureIds=e),_.defined(i)&&(t.propertyAttributeIds=i)}function L3(t,n,e){_.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function z3(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new u3;return _.defined(i)&&(l.baseColorTexture=fn(t,i,e,void 0)),_.defined(o)&&(l.metallicRoughnessTexture=fn(t,o,e,void 0)),l.baseColorFactor=kn(_.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function k3(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new h3;return _.defined(o)&&(s.specularTexture=fn(t,o,e,void 0)),_.defined(a)&&(s.specularColorTexture=fn(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=kn(_.Cartesian3,r),s}function Q3(t,n,e){const{anisotropyStrength:i=Iv.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Iv.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Iv;return _.defined(r)&&(a.anisotropyTexture=fn(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function V3(t,n,e){const{clearcoatFactor:i=Fv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Fv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Fv;return _.defined(o)&&(l.clearcoatTexture=fn(t,o,e,void 0)),_.defined(a)&&(l.clearcoatRoughnessTexture=fn(t,a,e,void 0)),_.defined(s)&&(l.clearcoatNormalTexture=fn(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function fn(t,n,e,i){const o=t.gltfJson,r=_.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!_.defined(r))return;const a=_.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=_.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=ro.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,_.defined(i)&&(s.texture.sampler=i)},s}function N3(t,n,e){const i=new XV,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(_.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=jf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(_.Matrix4.IDENTITY);return i}function H3(t,n,e){const i=new i3;i.name=n.name;const o=n.samplers.map(function(a,s){const l=Y3(t,a);return l.index=s,l}),r=n.channels.map(function(a){return J3(a,o,e)});return i.samplers=o,i.channels=r,i}function G3(t){const n=new o3;return n.name=t.name,n.stages=t.stages.map(tN),n}function W3(t){let n;return _.defined(t.scenes)&&_.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=_.defined(n)?n:[],n}function j3(t,n,e,i,o){const r=t.gltfJson.accessors,a=_.defined(e.ROTATION),s=_.defined(e.TRANSLATION)&&_.defined(r[e.TRANSLATION].min)&&_.defined(r[e.TRANSLATION].max),l=Dv(t,_.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===_.InstanceAttributeSemantic.TRANSLATION||u===_.InstanceAttributeSemantic.ROTATION||u===_.InstanceAttributeSemantic.SCALE,h=u===_.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,d=t._enablePick&&!o.context.webgl2,p=!f,g=t._loadAttributesFor2D&&!o.scene3DOnly;return VS(t,n,l,void 0,void 0,void 0,p,f||h&&(!s||g||d),o)}function q3(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;_.defined(o.attribute)?a=NS(o,r):a=HS(o,r),t.featureIds.push(a)}}function K3(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(_.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,h=`instanceFeatureId_${a}`;let f;_.defined(s.featureIds.attribute)?f=GS(s,u,A,h):f=WS(s,u,A,h),n.featureIds.push(f)}}function jf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(_.defined(o)){const r=eN(t,o),a=nN(t,r,n,e,i);return t._loaderPromises.push(a),i}return iN(n,i)}function VS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],h=A.bufferView,f=e.gltfSemantic,d=e.renamedSemantic,p=e.modelSemantic,g=_.defined(p)?jS(d):void 0,y=rN(u,n,f,p,g);if(!_.defined(o)&&!_.defined(h)&&!_.defined(r))return y;const m=oN(t,n,f,i,o,r,a,s,l),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();return t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{_.defined(o)&&_.defined(o.attributes)&&_.defined(o.attributes[f])?sN(y,m,a,s):_.defined(r)?aN(y,m,a,s):lN(u,A,y,m,a,s)},y}function Z3(t,n,e,i,o,r,a){return _.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function $3(t,n,e,i){const o=new zS;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=fn(t,r,e,_.Sampler.NEAREST);const s=(_.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function NS(t,n){const e=new LS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function HS(t,n){const e=new kS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function GS(t,n,e,i){const o=new LS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=jS(r.attribute),o.positionalLabel=i,o}function WS(t,n,e,i){const o=new kS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function X3(t,n,e,i,o,r){const a=new zS,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=fn(t,l,i,_.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function Y3(t,n){const e=new e3,i=t.gltfJson.accessors,o=i[n.input];e.input=jf(t,o,void 0);const r=n.interpolation;e.interpolation=_.InterpolationType[r]??_.InterpolationType.LINEAR;const a=i[n.output];return e.output=jf(t,a,!0),e}function J3(t,n,e){const i=new n3,o=t.sampler;return i.sampler=n[o],i.target=uN(t.target,e),i}function eN(t,n){const e=_.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function tN(t){const n=new r3;n.name=t.name;const e=t.type.toUpperCase();return n.type=_.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function nN(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=qS(r,e,n.typedArray);i=i??!1,cN(e,a,o,i)}function iN(t,n){const e=t.type;if(e===_.AttributeType.SCALAR)return n.fill(0);const i=_.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function jS(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function rN(t,n,e,i,o){var h;const r=t.accessors[n],a=_.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new jV;l.name=e,l.semantic=i,l.setIndex=o,l.constant=hN(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=kn(a,r.min),l.max=kn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=_.getAccessorByteStride(t,r),_.hasExtension(r,"WEB3D_quantized_attributes")&&AN(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===_.VertexAttributeSemantic.POSITION||l.semantic===_.VertexAttributeSemantic.NORMAL||l.semantic===_.VertexAttributeSemantic.TANGENT||l.semantic===_.VertexAttributeSemantic.TEXCOORD||l.semantic===_.VertexAttributeSemantic.FEATURE_ID||l.semantic===_.VertexAttributeSemantic.SCALE||l.semantic===_.VertexAttributeSemantic.ROTATION;return((h=t.extensionsRequired)==null?void 0:h.includes("KHR_mesh_quantization"))&&s&&u&&pN(l,a),l}function oN(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,h=u.accessors[n].bufferView;return _.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:h,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function sN(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=_.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=_.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function aN(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&_.defined(n.typedArray)&&(t.typedArray=_.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===_.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,h=1/0,f=-1/0;for(let d=0;d<a.length;d+=3){const p=a[d],g=a[d+1],v=a[d+2];s=Math.min(s,p),l=Math.max(l,p),u=Math.min(u,g),A=Math.max(A,g),h=Math.min(h,v),f=Math.max(f,v)}return[new _.Cartesian3(s,u,h),new _.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function lN(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=qS(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function uN(t,n){const e=new t3,i=t.node;if(!_.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=JV[o],e}function qS(t,n,e){let i=n.byteOffset;const o=_.getAccessorByteStride(t,n),r=n.count,a=_.numberOfComponentsForType(n.type),s=n.componentType,l=_.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),_.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const h=_.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),d=new Array(a),p=_.getComponentReader(n.componentType);i=e.byteOffset+i;for(let g=0;g<r;++g){p(f,i,a,l,d);for(let v=0;v<a;++v)h[g*a+v]=d[v];i+=o}return h}function cN(t,n,e,i){const o=t.type,r=t.count;if(o===_.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===_.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=_.Quaternion.unpack(n,a*4);else{const a=_.AttributeType.getMathType(o),s=_.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function hN(t){return t===Number?0:new t}function AN(t,n,e){const i=t.decodeMatrix,o=kn(e,t.decodedMin),r=kn(e,t.decodedMax);_.defined(o)&&_.defined(r)&&(n.min=o,n.max=r);const a=new _.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new _.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new _.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new _.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new _.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new _.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new _.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const fN={VEC2:new _.Cartesian2(-1,-1),VEC3:new _.Cartesian3(-1,-1,-1),VEC4:new _.Cartesian4(-1,-1,-1,-1)};function pN(t,n){const e=dN(t.componentDatatype),i=fN[t.type];let o=t.min;_.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;_.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function dN(t){switch(t){case _.ComponentDatatype.BYTE:return 127;case _.ComponentDatatype.UNSIGNED_BYTE:return 255;case _.ComponentDatatype.SHORT:return 32767;case _.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function KS(t,n){if(!_.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}_.Material.XbsjPolylineArrow="XbsjPolylineArrow",_.Material._materialCache.addMaterial(_.Material.XbsjPolylineArrow,{fabric:{type:_.Material.XbsjPolylineArrow,uniforms:{color:new _.Color(1,1,1,1),image:c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
3809
+ `;_.Material.GlobeLevelMaterialType="GlobelLevel",_.Material._materialCache.addMaterial(_.Material.GlobeLevelMaterialType,{fabric:{type:_.Material.GlobeLevelMaterialType,uniforms:{input_shadows:new _.Cartesian3(0,0,0),input_highlights:new _.Cartesian3(1,1,1),midtones:new _.Cartesian3(.5,.5,.5),output_shadows:new _.Cartesian3(0,0,0),output_highlights:new _.Cartesian3(1,1,1)},source:DV},translucent:!1});const{PrimitiveRenderResources:RV,ModelUtility:UV,Cartesian3:ti,Matrix4:za,ModelRenderResources:OV,defined:LV,NodeRenderResources:zV,BoundingSphere:cr,ModelDrawCommands:kV}=_,QV=new ti,VV=new ti,US=new ti,OS=new ti;class NV extends RV{constructor(n,e,i){if(super(n,e),!n.runtimeNode.instancingTranslationMin||!n.runtimeNode.instancingTranslationMax)return;const o=za.inverse(i,new za),r=UV.getPositionMinMax(e.primitive,za.multiplyByPoint(o,n.runtimeNode.instancingTranslationMin,US),za.multiplyByPoint(o,n.runtimeNode.instancingTranslationMax,OS));this.positionMin=ti.clone(r.min,new ti),this.positionMax=ti.clone(r.max,new ti),this.boundingSphere=cr.fromCornerPoints(this.positionMin,this.positionMax,new cr)}}function HV(){_.ModelSceneGraph.prototype.buildDrawCommands=function(t){const n=this._model,e=new OV(n);n.statistics.clear(),this.configurePipeline(t);const i=this.modelPipelineStages;let o,r,a;for(o=0;o<i.length;o++)i[o].process(e,n,t);const s=ti.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,QV),l=ti.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,VV);for(o=0;o<this._runtimeNodes.length;o++){const u=this._runtimeNodes[o];if(!LV(u))continue;u.configurePipeline();const A=u.pipelineStages,h=new zV(e,u);for(r=0;r<A.length;r++)A[r].process(h,u.node,t);const f=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){const d=u.runtimePrimitives[r];d.configurePipeline(t);const p=d.pipelineStages,g=new NV(h,d,f);for(a=0;a<p.length;a++)p[a].process(g,d.primitive,t);d.boundingSphere=cr.clone(g.boundingSphere,new cr);const v=za.multiplyByPoint(f,g.positionMin,US),y=za.multiplyByPoint(f,g.positionMax,OS);ti.minimumByComponent(s,v,s),ti.maximumByComponent(l,y,l);const m=kV.buildModelDrawCommand(g,t);d.drawCommand=m}}this._boundingSphere=cr.fromCornerPoints(s,l,new cr),this._boundingSphere=cr.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=cr.transform(this._boundingSphere,this._components.transform,this._boundingSphere),n._boundingSphere=cr.transform(this._boundingSphere,n.modelMatrix,n._boundingSphere),n._initialRadius=n._boundingSphere.radius,n._boundingSphere.radius*=n._clampedScale}}const yh=class yh extends c.Destroyable{constructor(){super(),_.ParticleSystem.prototype.update=function(n){const e=n.time;n.time=this._falseTime;try{yh.oldUpdate.call(this,n),this._particles.forEach(i=>{_.Billboard.prototype&&(i._billboard.ESSceneObjectID=this.ESSceneObjectID)})}catch{}n.time=e},this.d(()=>{_.ParticleSystem.prototype.update=yh.oldUpdate})}};L(yh,"oldUpdate",_.ParticleSystem.prototype.update);let Tv=yh;function GV(){if(_.ParticleSystem.prototype.timeStamp!==void 0){console.warn("fixParticleSystem已经执行过!");return}Object.defineProperties(_.ParticleSystem.prototype,{timeStamp:{get(){return this._innerCurrentTimeStamp===void 0&&(this._innerCurrentTimeStamp=0),this._innerCurrentTimeStamp},set(t){this.timeStamp!==t&&(this._innerCurrentTimeStamp=t,_.JulianDate.fromDate(new Date(t),this._falseTime))}},_falseTime:{get(){return this.__falseTime||(this.__falseTime=_.JulianDate.fromDate(new Date(0))),this.__falseTime}}})}class WV{constructor(n){L(this,"index");L(this,"image");L(this,"resolve");L(this,"reject");L(this,"rectangle");this.index=n.index,this.image=n.image,this.resolve=n.resolve,this.reject=n.reject,this.rectangle=void 0}}function jV(){_.TextureAtlas.prototype._resize=function(t,n=0){const e=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture;let a=r.width,s=r.height;const l=this._subRegions,u=i.map((y,m)=>new WV({index:m,image:y})).filter((y,m)=>_.defined(y.image)&&!_.defined(l.get(m)));let A=0,h=0,f=0;for(let y=n;y<o.length;++y){const{width:m,height:b}=o[y].image;A=Math.max(A,m),h=Math.max(h,b),f+=m*b,u.push(o[y])}a=Math.max(A,a),s=Math.max(h,s),t.webgl2||(a=_.Math.nextPowerOfTwo(a),s=_.Math.nextPowerOfTwo(s));const d=Math.sqrt(f);s*=Math.ceil(d/s),a*=Math.ceil(d/a),u.sort(({image:y},{image:m})=>m.height*m.width-y.height*y.width);const p=new Array(this._nextIndex);for(const y of this._subRegions.keys())_.defined(l.get(y))&&(p[y]=i[y]);let g,v=!1;for(;!v;){g=new _.TexturePacker({height:s,width:a,borderPadding:e});let y;for(y=0;y<u.length;++y){const{index:m,image:b}=u[y];if(!_.defined(b))continue;const x=g.pack(m,b);if(!_.defined(x)){a>s?s*=2:a*=2;break}p[m]=x.rectangle}v=y===u.length}this._texturePacker=g,this._texture=this._copyFromTexture(t,a,s,p),r.destroy(),this._rectangles=p,this._guid=_.createGuid()}}const ro={LOADED:2,PROCESSING:3,FAILED:7},{Attribute:qV,Indices:KV,FeatureIdAttribute:LS,FeatureIdTexture:zS,FeatureIdImplicitRange:kS,MorphTarget:ZV,Primitive:$V,Instances:XV,Skin:YV,Node:JV,AnimatedPropertyType:e3,AnimationSampler:t3,AnimationTarget:n3,AnimationChannel:i3,Animation:r3,ArticulationStage:o3,Articulation:s3,Asset:a3,Scene:l3,Components:u3,MetallicRoughness:c3,SpecularGlossiness:h3,Specular:A3,Anisotropy:Iv,Clearcoat:Fv,Material:f3}=_.ModelComponents;function p3(){_.GltfLoader.prototype.process=function(t){if(_.Check.typeOf.object("frameState",t),this._state===ro.LOADED&&!_.defined(this._loadResourcesPromise)&&(this._loadResourcesPromise=d3(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),_.defined(this._processError)){this._state=ro.FAILED;const o=this._processError;this._processError=void 0,Mv(this,o)}const n=this._textureErrors.pop();if(_.defined(n)){const o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===ro.FAILED)return!1;let e=!1;try{e=this._process(t)}catch(o){this._state=ro.FAILED,Mv(this,o)}let i=!1;try{i=this._processTextures(t)}catch(o){this._textureState=ro.FAILED,Mv(this,o)}return this._incrementallyLoadTextures?e:e&&i}}async function d3(t,n){_.FeatureDetection.supportsWebP.initialized||await _.FeatureDetection.supportsWebP.initialize(),t._supportedImageFormats=new _.SupportedImageFormats({webp:_.FeatureDetection.supportsWebP(),basis:n.context.supportsBasis});const e=g3(t,n);return t._state=ro.PROCESSING,t._textureState=ro.PROCESSING,_.defined(t._gltfJsonLoader)&&t._releaseGltfJson&&(_.ResourceCache.unload(t._gltfJsonLoader),t._gltfJsonLoader=void 0),e}const m3=new _.Cartesian3;function g3(t,n){const e=t.gltfJson,i=e.extensions??_.Frozen.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,a=i.CESIUM_RTC;if(_.defined(r)){const m=r.featureTables,b=r.featureTextures,x=_.defined(m)?m:[],E=_.defined(b)?b:[];t._sortedPropertyTableIds=Object.keys(x).sort(),t._sortedFeatureTextureIds=Object.keys(E).sort()}const s=y3(t,n),l=_3(t,s),u=C3(t,s),A=S3(e),h=E3(e,s),f=new u3,d=new a3,p=e.asset.copyright;if(_.defined(p)){const m=p.split(";").map(function(b){return new _.Credit(b.trim())});d.credits=m}if(f.asset=d,f.scene=h,f.nodes=s,f.skins=l,f.animations=u,f.articulations=A,f.upAxis=t._upAxis,f.forwardAxis=t._forwardAxis,_.defined(a)){const m=_.Cartesian3.fromArray(a.center,0,m3);f.transform=_.Matrix4.fromTranslation(m,f.transform)}if(t._components=f,_.defined(o)||_.defined(r)){const m=P3(t,o,r,n);t._loaderPromises.push(m)}const g=i.NGA_gpm_local;if(_.defined(g)){const m=_.GltfGpmLoader.load(g);t._components.extensions.NGA_gpm_local=m}const v=e.meshes;if(_.defined(v))for(const m of v){const b=m.primitives;if(_.defined(b))for(const x of b){const E=x.extensions;if(_.defined(E)){const B=E.NGA_gpm_local;if(_.defined(B)){const P=B3(t,e,B,n);t._loaderPromises.push(P)}}}}const y=[];return KS(y,t._loaderPromises),t._incrementallyLoadTextures||KS(y,t._texturesPromises),Promise.all(y)}function y3(t,n){const e=t.gltfJson.nodes;if(!_.defined(e))return[];const i=e.map(function(o,r){const a=v3(t,o,n);return a.index=r,a});for(let o=0;o<i.length;++o){const r=e[o].children;if(_.defined(r))for(let a=0;a<r.length;++a)i[o].children.push(i[r[a]])}return i}function v3(t,n,e){const i=new JV;i.name=n.name,i.matrix=kn(_.Matrix4,n.matrix),i.translation=kn(_.Cartesian3,n.translation),i.rotation=kn(_.Quaternion,n.rotation),i.scale=kn(_.Cartesian3,n.scale);const o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,a=o.AGI_articulations;if(_.defined(r)){if(t._loadForClassification)throw new _.RuntimeError("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=T3(t,o,e)}_.defined(a)&&(i.articulationName=a.articulationName);const s=n.mesh;if(_.defined(s)){const l=t.gltfJson.meshes[s],u=l.primitives;for(let f=0;f<u.length;++f)i.primitives.push(w3(t,u[f],_.defined(i.instances),e));const A=n.weights??l.weights,h=i.primitives[0].morphTargets;i.morphWeights=_.defined(A)?A.slice():new Array(h.length).fill(0)}return i}function w3(t,n,e,i){const o=new $V,r=new _.PrimitiveLoadPlan(o);t._primitiveLoadPlans.push(r);const a=n.material;_.defined(a)&&(o.material=b3(t,t.gltfJson.materials[a],i));const s=n.extensions??_.Frozen.EMPTY_OBJECT;let l=!1;const u=s.CESIUM_primitive_outline;t._loadPrimitiveOutline&&_.defined(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=I3(t,u));const A=s.KHR_spz_gaussian_splats_compression;_.defined(A)&&(l=!0,r.needsGaussianSplats=!0);const h=t._loadForClassification,f=s.KHR_draco_mesh_compression;let d=!1;const p=n.attributes;if(_.defined(p))for(const B in p){if(!p.hasOwnProperty(B))continue;const P=p[B],I=Dv(t,_.VertexAttributeSemantic,B),M=I.modelSemantic;if(h&&!M3(M))continue;M===_.VertexAttributeSemantic.FEATURE_ID&&(d=!0);const F=QS(t,P,I,n,f,A,e,l,i);r.attributePlans.push(F),o.attributes.push(F.attribute)}const g=n.targets;if(_.defined(g)&&!h)for(let B=0;B<g.length;++B)o.morphTargets.push(D3(t,g[B],l,r,i));const v=n.indices;if(_.defined(v)){const B=R3(t,v,n,f,d,l,i);_.defined(B)&&(r.indicesPlan=B,o.indices=B.indices)}const y=s.EXT_structural_metadata,m=s.EXT_mesh_features,b=s.EXT_feature_metadata,x=_.defined(b);_.defined(m)?U3(t,o,m,i):x&&O3(t,o,b,i),_.defined(y)?L3(o,y):x&&z3(t,o,b);const E=n.mode;if(h&&E!==_.PrimitiveType.TRIANGLES)throw new _.RuntimeError("Only triangle meshes can be used for classification.");return o.primitiveType=E,o}function b3(t,n,e){const i=new f3,o=n.extensions??_.Frozen.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,a=o.KHR_materials_specular,s=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=n.pbrMetallicRoughness;return i.unlit=_.defined(o.KHR_materials_unlit),_.defined(r)?i.specularGlossiness=x3(t,r,e):(_.defined(u)&&(i.metallicRoughness=k3(t,u,e)),_.defined(a)&&!i.unlit&&(i.specular=Q3(t,a,e)),_.defined(s)&&!i.unlit&&(i.anisotropy=V3(t,s,e)),_.defined(l)&&!i.unlit&&(i.clearcoat=N3(t,l,e))),_.defined(n.emissiveTexture)&&(i.emissiveTexture=fn(t,n.emissiveTexture,e,void 0)),_.defined(n.normalTexture)&&!t._loadForClassification&&(i.normalTexture=fn(t,n.normalTexture,e,void 0)),_.defined(n.occlusionTexture)&&(i.occlusionTexture=fn(t,n.occlusionTexture,e,void 0)),i.emissiveFactor=kn(_.Cartesian3,n.emissiveFactor),i.alphaMode=n.alphaMode,i.alphaCutoff=n.alphaCutoff,i.doubleSided=n.doubleSided,i.name=n.name,i}function x3(t,n,e){const{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:a,glossinessFactor:s}=n,l=new h3;return _.defined(i)&&(l.diffuseTexture=fn(t,i,e,void 0)),_.defined(o)&&(l.specularGlossinessTexture=fn(t,o,e,void 0)),l.diffuseFactor=kn(_.Cartesian4,r),l.specularFactor=kn(_.Cartesian3,a),l.glossinessFactor=s,l}function Mv(t,n){throw t.unload(),t.getError("Failed to load glTF",n)}function _3(t,n){const e=t.gltfJson.skins;if(t._loadForClassification||!_.defined(e))return[];const i=e.map(function(r,a){const s=H3(t,r,n);return s.index=a,s}),o=t.gltfJson.nodes;for(let r=0;r<n.length;++r){const a=o[r].skin;_.defined(a)&&(n[r].skin=i[a])}return i}function C3(t,n){const e=t.gltfJson.animations;return t._loadForClassification||!_.defined(e)?[]:e.map(function(o,r){const a=G3(t,o,n);return a.index=r,a})}function S3(t){var i;const e=(i=(t.extensions??_.Frozen.EMPTY_OBJECT).AGI_articulations)==null?void 0:i.articulations;return _.defined(e)?e.map(W3):[]}function E3(t,n){const e=new l3,i=j3(t);return e.nodes=i.map(function(o){return n[o]}),e}async function P3(t,n,e,i){const o=new _.GltfStructuralMetadataLoader({gltf:t.gltfJson,extension:n,extensionLegacy:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._structuralMetadataLoader=o,o.load()}async function B3(t,n,e,i){const o=new _.GltfMeshPrimitiveGpmLoader({gltf:n,extension:e,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:i,asynchronous:t._asynchronous});return t._meshPrimitiveGpmLoader=o,o.load()}function kn(t,n){if(_.defined(n))return t===Number?n[0]:t.unpack(n)}function T3(t,n,e){const i=n.EXT_mesh_gpu_instancing,o=new XV,r=i.attributes;if(_.defined(r))for(const u in r){if(!r.hasOwnProperty(u))continue;const A=r[u];o.attributes.push(q3(t,A,r,u,e))}const a=i.extensions??_.Frozen.EMPTY_OBJECT,s=n.EXT_instance_features,l=a.EXT_feature_metadata;return _.defined(s)?K3(o,s):_.defined(l)&&Z3(t.gltfJson,o,l,t._sortedPropertyTableIds),o}function I3(t,n){const e=n.indices,i=t.gltfJson.accessors[e];return jf(t,i,!1)}const F3={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function Dv(t,n,e){let i=e;t._renameBatchIdSemantic&&(e==="_BATCHID"||e==="BATCHID")&&(i="_FEATURE_ID_0");const o=n.fromGltfSemantic(i),r=F3;return r.gltfSemantic=e,r.renamedSemantic=i,r.modelSemantic=o,r}function M3(t){const n=t===_.VertexAttributeSemantic.POSITION,e=t===_.VertexAttributeSemantic.FEATURE_ID,i=t===_.VertexAttributeSemantic.TEXCOORD;return n||e||i}function QS(t,n,e,i,o,r,a,s,l){const u=e.modelSemantic,A=u===_.VertexAttributeSemantic.POSITION,h=u===_.VertexAttributeSemantic.FEATURE_ID,f=A&&!a&&t._loadAttributesFor2D&&!l.scene3DOnly,d=A&&t._enablePick&&!l.context.webgl2,p=t._loadForClassification&&h,g=t._loadAttributesAsTypedArray,v=!g,y=g||f||d||p,x=VS(t,n,e,i,o,r,s?!1:v,s?!0:y,l),E=new _.PrimitiveLoadPlan.AttributeLoadPlan(x);return E.loadBuffer=v,E.loadTypedArray=y,E}function D3(t,n,e,i,o){const r=new ZV,a=void 0,s=void 0,l=void 0,u=!1;for(const A in n){if(!n.hasOwnProperty(A))continue;const h=n[A],f=Dv(t,VertexAttributeSemantic,A),d=QS(t,h,f,a,s,l,u,e,o);r.attributes.push(d.attribute),i.attributePlans.push(d)}return r}function R3(t,n,e,i,o,r,a){const s=t.gltfJson.accessors[n],l=s.bufferView;if(!_.defined(i)&&!_.defined(l))return;const u=new KV;u.count=s.count;const A=t._loadAttributesAsTypedArray,h=(t._loadIndicesForWireframe||t._enablePick)&&!a.context.webgl2,f=t._loadForClassification&&o,p=!A,g=A||h||f,m=$3(t,n,e,i,r?!1:p,r?!0:g,a),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{u.indexDatatype=m.indexDatatype,u.buffer=m.buffer,u.typedArray=m.typedArray};const E=new _.PrimitiveLoadPlan.IndicesLoadPlan(u);return E.loadBuffer=p,E.loadTypedArray=g,E}function U3(t,n,e,i){let o;_.defined(e)&&_.defined(e.featureIds)?o=e.featureIds:o=[];for(let r=0;r<o.length;r++){const a=o[r],s=`featureId_${r}`;let l;_.defined(a.texture)?l=X3(t,a,i,s):_.defined(a.attribute)?l=NS(a,s):l=HS(a,s),n.featureIds.push(l)}}function O3(t,n,e,i){const{featureTables:o}=t.gltfJson.extensions.EXT_feature_metadata;let r=0;const a=e.featureIdAttributes;if(_.defined(a))for(let l=0;l<a.length;++l){const u=a[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;let p;_.defined(u.featureIds.attribute)?p=GS(u,h,f,d):p=WS(u,h,f,d),n.featureIds.push(p)}const s=e.featureIdTextures;if(_.defined(s))for(let l=0;l<s.length;++l){const u=s[l],A=u.featureTable,h=t._sortedPropertyTableIds.indexOf(A),f=o[A].count,d=`featureId_${r}`;r++;const p=Y3(t,u,h,i,f,d);n.featureIds.push(p)}}function L3(t,n){if(!_.defined(n))return;const{propertyTextures:e,propertyAttributes:i}=n;_.defined(e)&&(t.propertyTextureIds=e),_.defined(i)&&(t.propertyAttributeIds=i)}function z3(t,n,e){_.defined(e.featureTextures)&&(n.propertyTextureIds=e.featureTextures.map(function(i){return t._sortedFeatureTextureIds.indexOf(i)}))}function k3(t,n,e){const{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:a,roughnessFactor:s}=n,l=new c3;return _.defined(i)&&(l.baseColorTexture=fn(t,i,e,void 0)),_.defined(o)&&(l.metallicRoughnessTexture=fn(t,o,e,void 0)),l.baseColorFactor=kn(_.Cartesian4,r),l.metallicFactor=a,l.roughnessFactor=s,l}function Q3(t,n,e){const{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:a}=n,s=new A3;return _.defined(o)&&(s.specularTexture=fn(t,o,e,void 0)),_.defined(a)&&(s.specularColorTexture=fn(t,a,e,void 0)),s.specularFactor=i,s.specularColorFactor=kn(_.Cartesian3,r),s}function V3(t,n,e){const{anisotropyStrength:i=Iv.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=Iv.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=n,a=new Iv;return _.defined(r)&&(a.anisotropyTexture=fn(t,r,e,void 0)),a.anisotropyStrength=i,a.anisotropyRotation=o,a}function N3(t,n,e){const{clearcoatFactor:i=Fv.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=Fv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:a,clearcoatNormalTexture:s}=n,l=new Fv;return _.defined(o)&&(l.clearcoatTexture=fn(t,o,e,void 0)),_.defined(a)&&(l.clearcoatRoughnessTexture=fn(t,a,e,void 0)),_.defined(s)&&(l.clearcoatNormalTexture=fn(t,s,e,void 0)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function fn(t,n,e,i){const o=t.gltfJson,r=_.GltfLoaderUtil.getImageIdFromTexture({gltf:o,textureId:n.index,supportedImageFormats:t._supportedImageFormats});if(!_.defined(r))return;const a=_.ResourceCache.getTextureLoader({gltf:o,textureInfo:n,gltfResource:t._gltfResource,baseResource:t._baseResource,supportedImageFormats:t._supportedImageFormats,frameState:e,asynchronous:t._asynchronous}),s=_.GltfLoaderUtil.createModelTextureReader({textureInfo:n}),l=t._textureLoaders.length;t._textureLoaders.push(a);const u=a.load().catch(A=>{if(!t.isDestroyed()){if(!t._incrementallyLoadTextures)throw A;t._textureState=ro.FAILED,t._textureErrors.push(A)}});return t._texturesPromises.push(u),t._textureCallbacks[l]=()=>{s.texture=a.texture,_.defined(i)&&(s.texture.sampler=i)},s}function H3(t,n,e){const i=new YV,o=n.joints;i.joints=o.map(a=>e[a]);const r=n.inverseBindMatrices;if(_.defined(r)){const a=t.gltfJson.accessors[r];i.inverseBindMatrices=jf(t,a,void 0)}else i.inverseBindMatrices=new Array(o.length).fill(_.Matrix4.IDENTITY);return i}function G3(t,n,e){const i=new r3;i.name=n.name;const o=n.samplers.map(function(a,s){const l=J3(t,a);return l.index=s,l}),r=n.channels.map(function(a){return eN(a,o,e)});return i.samplers=o,i.channels=r,i}function W3(t){const n=new s3;return n.name=t.name,n.stages=t.stages.map(nN),n}function j3(t){let n;return _.defined(t.scenes)&&_.defined(t.scene)&&(n=t.scenes[t.scene].nodes),n=n??t.nodes,n=_.defined(n)?n:[],n}function q3(t,n,e,i,o){const r=t.gltfJson.accessors,a=_.defined(e.ROTATION),s=_.defined(e.TRANSLATION)&&_.defined(r[e.TRANSLATION].min)&&_.defined(r[e.TRANSLATION].max),l=Dv(t,_.InstanceAttributeSemantic,i),u=l.modelSemantic,A=u===_.InstanceAttributeSemantic.TRANSLATION||u===_.InstanceAttributeSemantic.ROTATION||u===_.InstanceAttributeSemantic.SCALE,h=u===_.InstanceAttributeSemantic.TRANSLATION,f=t._loadAttributesAsTypedArray||a&&A||!o.context.instancedArrays,d=t._enablePick&&!o.context.webgl2,p=!f,g=t._loadAttributesFor2D&&!o.scene3DOnly;return VS(t,n,l,void 0,void 0,void 0,p,f||h&&(!s||g||d),o)}function K3(t,n){const e=n.featureIds;for(let i=0;i<e.length;i++){const o=e[i],r=`instanceFeatureId_${i}`;let a;_.defined(o.attribute)?a=NS(o,r):a=HS(o,r),t.featureIds.push(a)}}function Z3(t,n,e,i){const o=t.extensions.EXT_feature_metadata.featureTables,r=e.featureIdAttributes;if(_.defined(r))for(let a=0;a<r.length;++a){const s=r[a],l=s.featureTable,u=i.indexOf(l),A=o[l].count,h=`instanceFeatureId_${a}`;let f;_.defined(s.featureIds.attribute)?f=GS(s,u,A,h):f=WS(s,u,A,h),n.featureIds.push(f)}}function jf(t,n,e){const i=new Array(n.count),o=n.bufferView;if(_.defined(o)){const r=tN(t,o),a=iN(t,r,n,e,i);return t._loaderPromises.push(a),i}return rN(n,i)}function VS(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,A=u.accessors[n],h=A.bufferView,f=e.gltfSemantic,d=e.renamedSemantic,p=e.modelSemantic,g=_.defined(p)?jS(d):void 0,y=oN(u,n,f,p,g);if(!_.defined(o)&&!_.defined(h)&&!_.defined(r))return y;const m=sN(t,n,f,i,o,r,a,s,l),b=t._geometryLoaders.length;t._geometryLoaders.push(m);const x=m.load();return t._loaderPromises.push(x),t._geometryCallbacks[b]=()=>{_.defined(o)&&_.defined(o.attributes)&&_.defined(o.attributes[f])?aN(y,m,a,s):_.defined(r)?lN(y,m,a,s):uN(u,A,y,m,a,s)},y}function $3(t,n,e,i,o,r,a){return _.ResourceCache.getIndexBufferLoader({gltf:t.gltfJson,accessorId:n,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:a,primitive:e,draco:i,asynchronous:t._asynchronous,loadBuffer:o,loadTypedArray:r})}function X3(t,n,e,i){const o=new zS;o.featureCount=n.featureCount,o.nullFeatureId=n.nullFeatureId,o.propertyTableId=n.propertyTable,o.label=n.label,o.positionalLabel=i;const r=n.texture;o.textureReader=fn(t,r,e,_.Sampler.NEAREST);const s=(_.defined(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=s,o}function NS(t,n){const e=new LS;return e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.propertyTableId=t.propertyTable,e.setIndex=t.attribute,e.label=t.label,e.positionalLabel=n,e}function HS(t,n){const e=new kS;return e.propertyTableId=t.propertyTable,e.featureCount=t.featureCount,e.nullFeatureId=t.nullFeatureId,e.label=t.label,e.positionalLabel=n,e.offset=0,e.repeat=1,e}function GS(t,n,e,i){const o=new LS,r=t.featureIds;return o.featureCount=e,o.propertyTableId=n,o.setIndex=jS(r.attribute),o.positionalLabel=i,o}function WS(t,n,e,i){const o=new kS,r=t.featureIds;o.propertyTableId=n,o.featureCount=e,o.offset=r.constant??0;const a=r.divisor??0;return o.repeat=a===0?void 0:a,o.positionalLabel=i,o}function Y3(t,n,e,i,o,r){const a=new zS,s=n.featureIds,l=s.texture;return a.featureCount=o,a.propertyTableId=e,a.textureReader=fn(t,l,i,_.Sampler.NEAREST),a.textureReader.channels=s.channels,a.positionalLabel=r,a}function J3(t,n){const e=new t3,i=t.gltfJson.accessors,o=i[n.input];e.input=jf(t,o,void 0);const r=n.interpolation;e.interpolation=_.InterpolationType[r]??_.InterpolationType.LINEAR;const a=i[n.output];return e.output=jf(t,a,!0),e}function eN(t,n,e){const i=new i3,o=t.sampler;return i.sampler=n[o],i.target=cN(t.target,e),i}function tN(t,n){const e=_.ResourceCache.getBufferViewLoader({gltf:t.gltfJson,bufferViewId:n,gltfResource:t._gltfResource,baseResource:t._baseResource});return t._bufferViewLoaders.push(e),e}function nN(t){const n=new o3;n.name=t.name;const e=t.type.toUpperCase();return n.type=_.ArticulationStageType[e],n.minimumValue=t.minimumValue,n.maximumValue=t.maximumValue,n.initialValue=t.initialValue,n}async function iN(t,n,e,i,o){const{gltfJson:r}=t;if(await n.load(),t.isDestroyed())return;const a=qS(r,e,n.typedArray);i=i??!1,hN(e,a,o,i)}function rN(t,n){const e=t.type;if(e===_.AttributeType.SCALAR)return n.fill(0);const i=_.AttributeType.getMathType(e);return n.fill(i.clone(i.ZERO))}function jS(t){const e=/^\w+_(\d+)$/.exec(t);if(e!==null)return parseInt(e[1])}function oN(t,n,e,i,o){var h;const r=t.accessors[n],a=_.AttributeType.getMathType(r.type),s=r.normalized??!1,l=new qV;l.name=e,l.semantic=i,l.setIndex=o,l.constant=AN(a),l.componentDatatype=r.componentType,l.normalized=s,l.count=r.count,l.type=r.type,l.min=kn(a,r.min),l.max=kn(a,r.max),l.byteOffset=r.byteOffset,l.byteStride=_.getAccessorByteStride(t,r),_.hasExtension(r,"WEB3D_quantized_attributes")&&fN(r.extensions.WEB3D_quantized_attributes,l,a);const u=l.semantic===_.VertexAttributeSemantic.POSITION||l.semantic===_.VertexAttributeSemantic.NORMAL||l.semantic===_.VertexAttributeSemantic.TANGENT||l.semantic===_.VertexAttributeSemantic.TEXCOORD||l.semantic===_.VertexAttributeSemantic.FEATURE_ID||l.semantic===_.VertexAttributeSemantic.SCALE||l.semantic===_.VertexAttributeSemantic.ROTATION;return((h=t.extensionsRequired)==null?void 0:h.includes("KHR_mesh_quantization"))&&s&&u&&dN(l,a),l}function sN(t,n,e,i,o,r,a,s,l){const u=t.gltfJson,h=u.accessors[n].bufferView;return _.ResourceCache.getVertexBufferLoader({gltf:u,gltfResource:t._gltfResource,baseResource:t._baseResource,frameState:l,bufferViewId:h,primitive:i,draco:o,spz:r,attributeSemantic:e,accessorId:n,asynchronous:t._asynchronous,loadBuffer:a,loadTypedArray:s})}function aN(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,t.quantization=n.quantization,e&&(t.buffer=n.buffer),i){const o=_.defined(n.quantization)?n.quantization.componentDatatype:t.componentDatatype;t.typedArray=_.ComponentDatatype.createArrayBufferView(o,n.typedArray.buffer)}}function lN(t,n,e,i){if(t.byteOffset=0,t.byteStride=void 0,e&&(t.buffer=n.buffer),i&&_.defined(n.typedArray)&&(t.typedArray=_.ComponentDatatype.createArrayBufferView(t.componentDatatype,n.typedArray.buffer)),t.semantic===_.VertexAttributeSemantic.POSITION){const o=a=>{let s=1/0,l=-1/0,u=1/0,A=-1/0,h=1/0,f=-1/0;for(let d=0;d<a.length;d+=3){const p=a[d],g=a[d+1],v=a[d+2];s=Math.min(s,p),l=Math.max(l,p),u=Math.min(u,g),A=Math.max(A,g),h=Math.min(h,v),f=Math.max(f,v)}return[new _.Cartesian3(s,u,h),new _.Cartesian3(l,A,f)]},r=t.typedArray;[t.min,t.max]=o(r)}}function uN(t,n,e,i,o,r){if(o&&(e.buffer=i.buffer),r){const a=i.typedArray;e.typedArray=qS(t,n,a),o||(e.byteOffset=0,e.byteStride=void 0)}}function cN(t,n){const e=new n3,i=t.node;if(!_.defined(i))return;e.node=n[i];const o=t.path.toUpperCase();return e.path=e3[o],e}function qS(t,n,e){let i=n.byteOffset;const o=_.getAccessorByteStride(t,n),r=n.count,a=_.numberOfComponentsForType(n.type),s=n.componentType,l=_.ComponentDatatype.getSizeInBytes(s),u=l*a,A=r*a;if(o===u)return e=new Uint8Array(e),_.ComponentDatatype.createArrayBufferView(s,e.buffer,e.byteOffset+i,A);const h=_.ComponentDatatype.createTypedArray(s,A),f=new DataView(e.buffer),d=new Array(a),p=_.getComponentReader(n.componentType);i=e.byteOffset+i;for(let g=0;g<r;++g){p(f,i,a,l,d);for(let v=0;v<a;++v)h[g*a+v]=d[v];i+=o}return h}function hN(t,n,e,i){const o=t.type,r=t.count;if(o===_.AttributeType.SCALAR)for(let a=0;a<r;a++)e[a]=n[a];else if(o===_.AttributeType.VEC4&&i)for(let a=0;a<r;a++)e[a]=_.Quaternion.unpack(n,a*4);else{const a=_.AttributeType.getMathType(o),s=_.AttributeType.getNumberOfComponents(o);for(let l=0;l<r;l++)e[l]=a.unpack(n,l*s)}return e}function AN(t){return t===Number?0:new t}function fN(t,n,e){const i=t.decodeMatrix,o=kn(e,t.decodedMin),r=kn(e,t.decodedMax);_.defined(o)&&_.defined(r)&&(n.min=o,n.max=r);const a=new _.ModelComponents.Quantization;a.componentDatatype=n.componentDatatype,a.type=n.type,i.length===4?(a.quantizedVolumeOffset=i[2],a.quantizedVolumeStepSize=i[0]):i.length===9?(a.quantizedVolumeOffset=new _.Cartesian2(i[6],i[7]),a.quantizedVolumeStepSize=new _.Cartesian2(i[0],i[4])):i.length===16?(a.quantizedVolumeOffset=new _.Cartesian3(i[12],i[13],i[14]),a.quantizedVolumeStepSize=new _.Cartesian3(i[0],i[5],i[10])):i.length===25&&(a.quantizedVolumeOffset=new _.Cartesian4(i[20],i[21],i[22],i[23]),a.quantizedVolumeStepSize=new _.Cartesian4(i[0],i[6],i[12],i[18])),n.quantization=a}const pN={VEC2:new _.Cartesian2(-1,-1),VEC3:new _.Cartesian3(-1,-1,-1),VEC4:new _.Cartesian4(-1,-1,-1,-1)};function dN(t,n){const e=mN(t.componentDatatype),i=pN[t.type];let o=t.min;_.defined(o)&&(o=n.divideByScalar(o,e,o),o=n.maximumByComponent(o,i,o));let r=t.max;_.defined(r)&&(r=n.divideByScalar(r,e,r),r=n.maximumByComponent(r,i,r)),t.min=o,t.max=r}function mN(t){switch(t){case _.ComponentDatatype.BYTE:return 127;case _.ComponentDatatype.UNSIGNED_BYTE:return 255;case _.ComponentDatatype.SHORT:return 32767;case _.ComponentDatatype.UNSIGNED_SHORT:return 65535;default:return 1}}function KS(t,n){if(!_.defined(n))return;const e=n.length;if(e===0)return;const i=t.length;t.length+=e;for(let o=0;o<e;o++)t[i+o]=n[o]}_.Material.XbsjPolylineArrow="XbsjPolylineArrow",_.Material._materialCache.addMaterial(_.Material.XbsjPolylineArrow,{fabric:{type:_.Material.XbsjPolylineArrow,uniforms:{color:new _.Color(1,1,1,1),arrowColor:new _.Color(1,1,1,1),image:c.ESSceneObject.context.getStrFromEnv("${earthsdk3-assets-script-dir}/assets/img/signal.png"),speed:1,repeat:60},source:`
3810
3810
  uniform vec4 color; // 叠加颜色
3811
+ uniform vec4 arrowColor; // 箭头颜色
3811
3812
  uniform sampler2D image; // 箭头贴图
3812
3813
  uniform float repeat; // 重复像素
3813
3814
  uniform float speed; // 滚动速度
@@ -3834,15 +3835,15 @@ return material;
3834
3835
  float arrowRepeat = pos.x / (repeat * czm_pixelRatio);
3835
3836
  float u = fract(arrowRepeat - speed / 10.0 * czm_frameNumber / 60.0);
3836
3837
  vec4 colorImage = texture(image, vec2(u, materialInput.st.t));
3837
- vec4 fragColor = vec4(colorImage.rgb*colorImage.a + color.rgb*(1.0-colorImage.a), color.a);
3838
+ vec4 fragColor = colorImage.a * arrowColor + (1.0 - colorImage.a) * color;
3838
3839
 
3839
3840
  fragColor = czm_gammaCorrect(fragColor);
3840
3841
  material.emission = fragColor.rgb;
3841
3842
  material.alpha = fragColor.a;
3842
3843
 
3843
3844
  return material;
3844
- }`},translucent:!0}),xV(),_V(),CV(),BV(),TV(),IV(),FV(),bV(),NV(),HV(),WV(),f3(),_.Camera.DEFAULT_VIEW_RECTANGLE=_.Rectangle.fromDegrees(70,5,140,55);function mN(){return new Promise((t,n)=>_.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class gN extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Qn(s);if(l&&(l.destroy(),Rv(s,void 0)),_.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=wV;await s.promise(mN());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=_.JulianDate.fromDate(new Date(e.currentTime));_.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=_.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new JS(A,e);Rv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const yN=new _.EllipsoidTerrainProvider;class ZS extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.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 r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??yN}))}_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 i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.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 i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class $S extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof wt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof wt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].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,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof wt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof wt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class vN extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)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 wN extends c.Destroyable{constructor(e){super();L(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:i}=this,o=i.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 bN extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new wN(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class xN extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new bN(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class XS extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new vN(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new xN(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class YS extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,d]=u;try{(async()=>{const{scene:p,camera:g}=i,v=Ze(A),y=g.getPickRay(v);if(y){let E;if(h?E=await p.pickFromRayMostDetailed(y,this.objectsToExclude):E=p.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=Ue(E.position);return B?f(B):d(new Error("positionFromCartesian failed"))}if(!(p.terrainProvider instanceof _.EllipsoidTerrainProvider)){const B=p.globe.pick(y,p);if(!B)return d(new Error("scene.globe.pick failed"));const P=Ue(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):d(new Error("positionFromCartesian failed"))}}const m=p.terrainProvider instanceof _.EllipsoidTerrainProvider?p.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(Ze(A),m);if(!b)return d(new Error("Pick failed"));const x=Ue(b);return x?f(x):d(new Error("positionFromCartesian failed"))})()}catch(p){d(p)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,d,p]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let g=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!g&&_.defined(i.scene.globe)&&(g=await _N(i,Ze(A)));let v;if(g&&g instanceof _.Cesium3DTileFeature){v={};try{g&&g.getPropertyIds().forEach(F=>{v&&(v[F]=g.getProperty(F))})}catch(M){console.warn(M)}}if(!g){const{left:M,top:F}=e.container.getBoundingClientRect();g=(E=document.elementFromPoint(A[0]+M,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;g&&(g.id&&g.id instanceof _.Entity&&g.id.ESSceneObjectID?y=g.id.ESSceneObjectID:g.collection&&g.collection.ESSceneObjectID?y=g.collection.ESSceneObjectID:g.primitive&&g.primitive.ESSceneObjectID?y=g.primitive.ESSceneObjectID:Array.isArray(g)&&g[0]instanceof _.ImageryLayerFeatureInfo?y=g[0].imageryLayer.ESSceneObjectID:g instanceof HTMLElement&&(y=g.dataset.esSceneObjectId));let m=y?c.ESSceneObject.getSceneObject(y):void 0;m&&m.parentID&&(m=c.ESSceneObject.getSceneObject(m.parentID));let b={};if(m&&Reflect.has(m,"allowPicking")&&Reflect.has(m,"pickedEvent")&&(m.allowPicking??!1)){if(m instanceof c.ESEntityCluster){const M=new _.JulianDate;b=g.id instanceof _.Entity?{name:g.id.label.text.getValue(M),properties:(B=g.id.properties)==null?void 0:B.getValue(M),coordinates:$a(g.id.position.getValue(M))}:(P=g.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(M),coordinates:$a(F.position.getValue(M))}})}else if(m instanceof c.ESGeoJson){const M=new _.JulianDate;if(!g.id.entityCollection)return;const F=g.id.polygon?"Polygon":g.id.polyline?"LineString":"Point",S=((I=g.id.properties)==null?void 0:I.getValue(M))??{},T=F=="Point"?Ue(g.id.position.getValue(M)):F=="LineString"?g.id.polyline.positions.getValue(M).map(w=>Ue(w)):yp(g.id.polygon.hierarchy.getValue(M));b=m.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(m instanceof c.ESGltfModel){let M;Reflect.has(g,"featureId")?M=g.featureId:Reflect.has(g,"instanceId")&&(M=g.instanceId),M&&(g.id=g.primitive.structuralMetadata.getPropertyTable(0).getProperty(g.instanceId,"id"))}m.pickedEvent.emit(new c.ESJPickedResult(g,m,v,b,f,A))}m&&Reflect.has(m,"allowPicking")&&!m.allowPicking&&d(new c.ESJPickedResult);const x=new c.ESJPickedResult(g,m,v,b,f,A);d(x)})()}catch(g){p(g)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.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((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function _N(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(_.defined(o))return o}class CN extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Qn(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}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 Qn(t){return c.getExtProp(t,"_viewerExtensions")}function Rv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class JS extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new XS(this.viewer)),this._terrainManager=this.dv(new ZS(this.viewer)),this._labelManager=this.dv(new $S(this.viewer)),this._poiContext=this.disposeVar(new U0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new CN(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new YS(i))}))}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 eE=new _.Cartesian3,tE=new _.Cartesian3;function nE(t,n,e){let i=_.Matrix4.clone(t.transform);t.lookAtTransform(_.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=_.Cartesian3.normalize(r,eE),s=_.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=_.Cartesian3.cross(t.direction,a,tE);else var l=_.Cartesian3.cross(t.up,a,tE);var u=l;if(e){var A=_.Cartesian3.cross(a,l,eE);u=A}var h=_.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,d=f.longitude,p=f.latitude;_.Cartesian3.fromRadians(d,p,o,void 0,t.position),t.lookAtTransform(i)}function iE(t,n){nE(t,n,!1)}function rE(t,n){nE(t,-n,!0)}class SN extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&iE(r,A*h),a.MoveBackword&&iE(r,-A*h),a.MoveLeft&&rE(r,-A*h),a.MoveRight&&rE(r,A*h));{const{rotateSpeed:f}=this.controller,d=_.Math.toRadians(f*A);a.RotateRight?r.lookRight(d):a.RotateLeft?r.lookRight(-d):a.RotateUp?r.lookDown(-d):a.RotateDown&&r.lookDown(d)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}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 i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class qf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
3845
- `))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=qf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=qf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.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 EN extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new qf(this)),this._cameraOp=this.dv(new SN(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const ep=class ep extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(ep.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new EN(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()}};L(ep,"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 Kf=ep;function PN(t,n){t.lookRight(_.Math.toRadians(n.movementX)*.1),t.lookDown(_.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=_.Math.clamp(e,-_.Math.PI_OVER_TWO,_.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class BN extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;PN(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const tp=class tp extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new BN(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=tp.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(tp,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Uv=tp;class TN extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Uv(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 IN extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new TN(this)));L(this,"_keyboardCameraController",this.dv(new Kf(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 oE(t){t.removeInputAction(_.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(_.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)}function Ov(t,n,e,i=void 0){const r=t.camera,a=new _.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new _.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof _.OrthographicFrustum?(h=l.origin,f=u.origin,_.Cartesian3.add(r.direction,h,h),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(h,r.position,h),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(h,h),_.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let d=_.Cartesian3.dot(h,f);d<1&&(A=Math.acos(d)),A=n.startPosition.x>n.endPosition.x?A:-A;const p=e._horizontalRotationAxis;if(_.defined(i)?r.look(i,-A):_.defined(p)?r.look(p,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,!(!l||!u))if(r.frustum instanceof _.OrthographicFrustum?(h=l.origin,f=u.origin,_.Cartesian3.add(r.direction,h,h),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(h,r.position,h),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(h,h),_.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),d=_.Cartesian3.dot(h,f),d<1&&(A=Math.acos(d)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??p,_.defined(i)){const g=r.direction,v=_.Cartesian3.negate(i,new _.Cartesian3),y=_.Cartesian3.equalsEpsilon(g,i,_.Math.EPSILON2),m=_.Cartesian3.equalsEpsilon(g,v,_.Math.EPSILON2);if(!y&&!m){d=_.Cartesian3.dot(g,i);let b=_.Math.acosClamped(d);A>0&&A>b&&(A=b-_.Math.EPSILON4),d=_.Cartesian3.dot(g,v),b=_.Math.acosClamped(d),A<0&&-A>b&&(A=-b+_.Math.EPSILON4);const x=_.Cartesian3.cross(i,g,new _.Cartesian3);r.look(x,A)}else(y&&A<0||m&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class FN extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=ft(n.position),f=i.camera.positionWC,d=_.Cartesian3.distance(h,f);n.viewDistance=d}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new FN(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=ms(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"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:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class vu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new sa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new MN(this,e);if(this.lineMode==="manual")return new DN(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:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(vu||(vu={})),c.extendClassProps(vu.prototype,vu.createDefaultProps);class MN extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class DN extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class RN extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class UN extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new RN(r,e)}))}}class wu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new UN(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})})(wu||(wu={})),c.extendClassProps(wu.prototype,wu.createDefaultProps);class ON extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new _.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},_.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,i=e.positionCartographic;e.flyTo({destination:_.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*_.Math.PI*2/this.cycle;e.setView({destination:_.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.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 LN extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new ON(i)),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 zN extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new _.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new _.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=_.Cartesian3.fromDegrees(...this.position);a&&(this._transform=_.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=_.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=_.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}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 i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new _.Cartesian3(0,i,o);e.flyTo({destination:_.Matrix4.multiplyByPoint(this._transform,r,new _.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*_.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new _.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(_.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class kN extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new zN(i));{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 QN extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new IN(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.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=Kf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new LN(e)),this._rotatePoint=this.dv(new kN(e)),this._followController=this.dv(new wu(e)),this._pathCameraController=this.dv(new vu(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,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=_.Cartesian3.fromDegrees(e[0],e[1],(l??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,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const d=m0(A);this._pathCameraController.polylinePath.rotationRadius=!l||d==!1?[0]:d.map(p=>p/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new _.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&oE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Ov(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Ov(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Ov(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&oE(o),r.lookEventTypes=_.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=_.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],r.translateEventTypes=_.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}])}}const VN=[{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 NN extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new _.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:ft(s.position)});(()=>{o.removeAll();for(let s of VN)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class bu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(_.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.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})})(bu||(bu={})),c.extendClassProps(bu.prototype,bu.createDefaultProps);const HN=`
3845
+ }`},translucent:!0}),_V(),CV(),SV(),TV(),IV(),FV(),MV(),xV(),HV(),GV(),jV(),p3(),_.Camera.DEFAULT_VIEW_RECTANGLE=_.Rectangle.fromDegrees(70,5,140,55);function gN(){return new Promise((t,n)=>_.GroundPolylinePrimitive.initializeTerrainHeights().then(t))}class yN extends c.Destroyable{constructor(n,e,i,o){super();const r=()=>{e.setStatus("Raw");const{viewer:s}=e;if(s){const l=Qn(s);if(l&&(l.destroy(),Rv(s,void 0)),_.defined(s)){s.entities.removeAll(),s.dataSources.removeAll(),s.imageryLayers.removeAll(),s.scene.primitives.removeAll(),s.scene.groundPrimitives.removeAll(),s.scene.postProcessStages.removeAll();let u=s.scene.context._originalGLContext;u.canvas.width=u.canvas.height=1,u.getExtension("WEBGL_lose_context").loseContext(),u=null}s.destroy(),i(void 0)}};this.d(r);const a=this.dv(c.createProcessingFromAsyncFunc(async(s,l)=>{e.setStatus("Creating"),e.setStatusLog("正在创建Cesium视口...");const u=bV;await s.promise(gN());const A=await s.promise(c.createCancelablePromise(u(l,o)));A.scene._xbsjOriginSkyAtmosphere=A.scene.skyAtmosphere,A.scene._xbsjOriginSkyBox=A.scene.skyBox,A.scene.renderError.removeEventListener(A.cesiumWidget._onRenderError),A.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(e.currentTime)),this.dispose(e.currentTimeChanged.disposableOn(()=>{if(e.currentTime===void 0)return;const h=_.JulianDate.fromDate(new Date(e.currentTime));_.JulianDate.equals(h,A.clockViewModel.currentTime)||(A.clockViewModel.currentTime=h)})),this.dispose(gi(A.clockViewModel,"currentTime",h=>{const f=_.JulianDate.toDate(A.clockViewModel.currentTime).getTime();f!==e.currentTime&&(e.currentTime=f)}));{const h=new JS(A,e);Rv(A,h)}e.setStatus("Created"),e.setStatusLog("成功创建Cesium视口!"),i(A)}));a.start(n),a.errorEvent.don(s=>{console.error(s),e.setStatus("Error"),e.setStatusLog("创建Cesium视口失败!")})}}const vN=new _.EllipsoidTerrainProvider;class ZS extends c.Destroyable{constructor(e){super();L(this,"_terrainMap",new Map);L(this,"_nextAnimateFrame",this.dv(c.createNextAnimateFrame()));L(this,"selectedTerrain");this._viewer=e;const i=this._viewer,o=i.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 r=Number.MIN_SAFE_INTEGER;for(let a of this._terrainMap.keys())a.sceneObject.activate=!1,(a.sceneObject.show??!0)&&a.sceneObject.zIndex>=r&&(this.selectedTerrain&&console.warn(`存在多个terrain,只能显示一个,当前terrian:${this.selectedTerrain.sceneObject.name}(${this.selectedTerrain.sceneObject.id}), 即将被替换成${a.sceneObject.name}(${a.sceneObject.id})`),r=a.sceneObject.zIndex,this.selectedTerrain=a);this.selectedTerrain&&!this.selectedTerrain.provider&&(this.selectedTerrain.sceneObject.activate=!0,this.selectedTerrain.sceneObject.activateEvent.emit()),i.scene.terrainProvider=(this.selectedTerrain&&this.selectedTerrain.provider)??vN}))}_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 i=new c.Destroyable;i.dispose(e.providerChanged.disposableOn(()=>this._makeDirty())),i.dispose(e.sceneObject.showChanged.disposableOn(()=>this._makeDirty())),this._terrainMap.set(e,()=>i.destroy()),this._makeDirty();const o=this.ad(c.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 i=this._terrainMap.get(e);if(!i){console.error("!disposeFunc");return}i(),this._terrainMap.delete(e),this.selectedTerrain===e&&(this.selectedTerrain=void 0),this._makeDirty()}}class $S extends c.Destroyable{constructor(e){super();L(this,"_labelMap",{div:new Map,canvas:new Map});this._viewer=e,this.d(e.scene.camera.changed.addEventListener(()=>{this._updateZOrder()}))}add(e){const i=e instanceof wt?"div":"canvas";if(this._labelMap[i].has(e)){console.warn(`this._labelMap[${i}].has(poi)`,e);return}const o=new c.Destroyable;{const r=o.dv(c.createNextAnimateFrameEvent(e.zOrderChanged,e.positionChanged));o.dispose(r.don(()=>{this._updateZOrder()}))}this._labelMap[i].set(e,()=>o.destroy()),this._updateZOrder()}delete(e){const i=e instanceof wt?"div":"canvas";if(!this._labelMap[i].has(e)){console.warn(`!this._labelMap[${i}].has(poi)`,e);return}const o=this._labelMap[i].get(e);if(!o){console.error("!disposeFunc");return}o(),this._labelMap[i].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,i){const o={};for(const s of e.keys())o[s.zOrder]||(o[s.zOrder]=new Map),o[s.zOrder].set(s,s instanceof wt?s.czmDivPoi?s.czmDivPoi.depth:0:s.canvasObj?s.canvasObj.czmCanvasPoi.depth:0);const r=Object.keys(o).sort((s,l)=>i=="div"?Number(l)-Number(s):Number(s)-Number(l));let a=e.size;for(let s=0;s<r.length;s++)new Map([...o[r[s]]].sort((u,A)=>Number(A[1])-Number(u[1]))).forEach((u,A)=>{A instanceof wt&&A.czmDivPoi&&(A.czmDivPoi.zOrder=a),A instanceof Wi&&A.canvasObj&&(A.canvasObj.czmCanvasPoi.zOrder=a),a--})}}class wN extends c.Destroyable{constructor(e){super();L(this,"_czmImageryLayerWrappers",new Set);L(this,"_zIndexChangedEvent",this.dv(new c.Event));this._viewer=e,this.d(this._zIndexChangedEvent.don(()=>{const i=[...this.czmImageryLayerWrappers.values()];i.sort((o,r)=>{const a=o.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex,s=r.czmImageryWrapper.imagery.zIndex??c.ESImageryLayer.defaults.zIndex;return a-s});for(const o of i)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 bN extends c.Destroyable{constructor(e){super();L(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:i}=this,o=i.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 xN extends c.Destroyable{constructor(e){super();L(this,"_objResetting");this._czmImageryWrapper=e,this._objResetting=this.dv(new c.ObjResettingWithEvent(this.czmImageryWrapper.imagery.showChanged,()=>{if(this.czmImageryWrapper.imagery.show??!0)return new bN(this.czmImageryWrapper)}))}get czmImageryWrapper(){return this._czmImageryWrapper}get objResetting(){return this._objResetting}}class _N extends c.Destroyable{constructor(e,i){super();L(this,"_czmImageryLayerWrapperObjResetting");this._imagery=e,this._manager=i,this._czmImageryLayerWrapperObjResetting=this.dv(new c.ObjResettingWithEvent(this.imagery.layerChanged,()=>{if(this.imagery.layer)return new xN(this)}))}get imagery(){return this._imagery}get manager(){return this._manager}get czmImageryLayerWrapperObjResetting(){return this._czmImageryLayerWrapperObjResetting}}class XS extends c.Destroyable{constructor(e){super();L(this,"_czmImageryWrappers",new Set);L(this,"_czmImageryLayersManager");this._viewer=e,this._czmImageryLayersManager=this.dv(new wN(this.viewer))}get czmImageryWrappers(){return this._czmImageryWrappers}get czmImageriesManager(){return this._czmImageryLayersManager}get viewer(){return this._viewer}add(e){for(let i of this.czmImageryWrappers)if(i.imagery===e){console.warn("imageriesManager add error: has already added!",e);return}this.czmImageryWrappers.add(new _N(e,this))}has(e){for(let i of this.czmImageryWrappers)if(i.imagery===e)return!0;return!1}delete(e){for(const i of this.czmImageryWrappers)if(i.imagery===e){this.czmImageryWrappers.delete(i);return}console.warn("imageriesManager delete error!",e)}}class YS extends c.Destroyable{constructor(e){super();L(this,"_pause",this.disposeVar(c.react(!1)));L(this,"_pickPositionTasks",[]);L(this,"_pickTasks",[]);L(this,"pickHeightMustGreaterThanZero",!0);L(this,"objectsToExclude",[]);const i=e.viewer;{this.dispose(()=>{this._pickPositionTasks.length>0&&(this._pickPositionTasks.forEach(s=>s[3]("CzmViewer销毁,任务不再执行!")),this._pickPositionTasks.length=0),this._pickTasks.length>0&&(this._pickTasks.forEach(s=>s[4]("CzmViewer销毁,任务不再执行!")),this._pickTasks.length=0)});const o=()=>{const s=[...this._pickPositionTasks];this._pickPositionTasks.length=0;for(let u of s){const[A,h,f,d]=u;try{(async()=>{const{scene:p,camera:g}=i,v=Ze(A),y=g.getPickRay(v);if(y){let E;if(h?E=await p.pickFromRayMostDetailed(y,this.objectsToExclude):E=p.pickFromRay(y,this.objectsToExclude),E&&E.position){const B=Ue(E.position);return B?f(B):d(new Error("positionFromCartesian failed"))}if(!(p.terrainProvider instanceof _.EllipsoidTerrainProvider)){const B=p.globe.pick(y,p);if(!B)return d(new Error("scene.globe.pick failed"));const P=Ue(B);return P?(this.pickHeightMustGreaterThanZero&&P[2]<0&&(P[2]=0),f(P)):d(new Error("positionFromCartesian failed"))}}const m=p.terrainProvider instanceof _.EllipsoidTerrainProvider?p.terrainProvider.tilingScheme.ellipsoid:i.scene.globe.ellipsoid,b=i.camera.pickEllipsoid(Ze(A),m);if(!b)return d(new Error("Pick failed"));const x=Ue(b);return x?f(x):d(new Error("positionFromCartesian failed"))})()}catch(p){d(p)}}const l=[...this._pickTasks];this._pickTasks.length=0;for(let u of l){const[A,h,f,d,p]=u;e.pickCustomAttachedInfo=f;try{(async()=>{var E,B,P,I;let g=i.scene.pick(Ze(A),h&&h[0],h&&h[1]);!g&&_.defined(i.scene.globe)&&(g=await CN(i,Ze(A)));let v;if(g&&g instanceof _.Cesium3DTileFeature){v={};try{g&&g.getPropertyIds().forEach(F=>{v&&(v[F]=g.getProperty(F))})}catch(M){console.warn(M)}}if(!g){const{left:M,top:F}=e.container.getBoundingClientRect();g=(E=document.elementFromPoint(A[0]+M,A[1]+F))==null?void 0:E.closest("[data-es-scene-object-id]")}let y;g&&(g.id&&g.id instanceof _.Entity&&g.id.ESSceneObjectID?y=g.id.ESSceneObjectID:g.collection&&g.collection.ESSceneObjectID?y=g.collection.ESSceneObjectID:g.primitive&&g.primitive.ESSceneObjectID?y=g.primitive.ESSceneObjectID:Array.isArray(g)&&g[0]instanceof _.ImageryLayerFeatureInfo?y=g[0].imageryLayer.ESSceneObjectID:g instanceof HTMLElement&&(y=g.dataset.esSceneObjectId));let m=y?c.ESSceneObject.getSceneObject(y):void 0;m&&m.parentID&&(m=c.ESSceneObject.getSceneObject(m.parentID));let b={};if(m&&Reflect.has(m,"allowPicking")&&Reflect.has(m,"pickedEvent")&&(m.allowPicking??!1)){if(m instanceof c.ESEntityCluster){const M=new _.JulianDate;b=g.id instanceof _.Entity?{name:g.id.label.text.getValue(M),properties:(B=g.id.properties)==null?void 0:B.getValue(M),coordinates:$a(g.id.position.getValue(M))}:(P=g.id)==null?void 0:P.map(F=>{var S;return{name:F.id,properties:(S=F.properties)==null?void 0:S.getValue(M),coordinates:$a(F.position.getValue(M))}})}else if(m instanceof c.ESGeoJson){const M=new _.JulianDate;if(!g.id.entityCollection)return;const F=g.id.polygon?"Polygon":g.id.polyline?"LineString":"Point",S=((I=g.id.properties)==null?void 0:I.getValue(M))??{},T=F=="Point"?Ue(g.id.position.getValue(M)):F=="LineString"?g.id.polyline.positions.getValue(M).map(w=>Ue(w)):yp(g.id.polygon.hierarchy.getValue(M));b=m.pickedInfoType=="FeatureCollection"?{type:"Feature",geometry:{type:F,coordinates:T},properties:S}:{type:F,coordinates:T,properties:S}}else if(m instanceof c.ESGltfModel){let M;Reflect.has(g,"featureId")?M=g.featureId:Reflect.has(g,"instanceId")&&(M=g.instanceId),M&&(g.id=g.primitive.structuralMetadata.getPropertyTable(0).getProperty(g.instanceId,"id"))}m.pickedEvent.emit(new c.ESJPickedResult(g,m,v,b,f,A))}m&&Reflect.has(m,"allowPicking")&&!m.allowPicking&&d(new c.ESJPickedResult);const x=new c.ESJPickedResult(g,m,v,b,f,A);d(x)})()}catch(g){p(g)}}};let r=i.scene.postRender.addEventListener(o);const a=()=>{r&&r(),r=void 0};this.ad(a),this.ad(this.pauseChanged.don(s=>{s?a():r=i.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((i,o)=>{this._pickPositionTasks.push([e,!0,i,o])})}quickPickPosition(e){return new Promise((i,o)=>{this._pickPositionTasks.push([e,!1,i,o])})}pick(e,i,o){return new Promise((r,a)=>{this._pickTasks.push([e,i,o,r,a])})}}function CN(t,n){const e=t.scene,i=e.camera.getPickRay(n);if(!i)return;const o=e.imageryLayers.pickImageryLayerFeatures(i,e);if(_.defined(o))return o}class SN extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.disposeVar(c.react(!1)));L(this,"_cursorPosition",c.react(void 0));L(this,"quickPickPosition",!0);let i=new c.Destroyable;const o=()=>{i&&(i.destroy(),i=void 0)};this.dispose(o);const r=()=>{if(o(),!this._enabled.value||!e)return;const a=Qn(e);if(!a)return;i=new c.Destroyable;const s=i.disposeVar(c.react(void 0)),l=i.disposeVar(c.createNextAnimateFrameEvent(s.changed));i.dispose(a.czmViewer.pointerMoveEvent.disposableOn(A=>{A.pointerEvent&&(s.value=c.getDomEventCurrentTargetPos(A.pointerEvent))}));const u=i.disposeVar(c.createProcessingFromAsyncFunc(async A=>{if(a.pickingManager&&s.value)if(this.quickPickPosition){const h=await A.promise(c.createCancelablePromise(a.pickingManager.quickPickPosition(s.value)));this._cursorPosition.value=h}else{const h=await A.promise(c.createCancelablePromise(a.pickingManager.pickPosition(s.value)));this._cursorPosition.value=h}}));i.dispose(l.disposableOn(()=>{u.restart()}))};r(),this.dispose(this._enabled.changed.disposableOn(r))}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 Qn(t){return c.getExtProp(t,"_viewerExtensions")}function Rv(t,n){c.setExtProp(t,"_viewerExtensions",n)}class JS extends c.Destroyable{constructor(e,i){super();L(this,"_imageriesManager");L(this,"_terrainManager");L(this,"_labelManager");L(this,"_pickingManager");L(this,"_poiContext");L(this,"_cursorPositionInfo");this._viewer=e,this._czmViewer=i,this._imageriesManager=this.dv(new XS(this.viewer)),this._terrainManager=this.dv(new ZS(this.viewer)),this._labelManager=this.dv(new $S(this.viewer)),this._poiContext=this.disposeVar(new U0(this._viewer)),this._cursorPositionInfo=this.disposeVar(new SN(this._viewer)),this.ad(i.viewerChanged.don(()=>{this._pickingManager=this.dv(new YS(i))}))}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 eE=new _.Cartesian3,tE=new _.Cartesian3;function nE(t,n,e){let i=_.Matrix4.clone(t.transform);t.lookAtTransform(_.Matrix4.IDENTITY);var o=t.positionCartographic.height,r=t.positionWC,a=_.Cartesian3.normalize(r,eE),s=_.Cartesian3.dot(t.direction,a);if(s>-.9&&s<.9)var l=_.Cartesian3.cross(t.direction,a,tE);else var l=_.Cartesian3.cross(t.up,a,tE);var u=l;if(e){var A=_.Cartesian3.cross(a,l,eE);u=A}var h=_.Cartesian3.magnitude(r);t.rotate(u,n/h);var f=t.positionCartographic,d=f.longitude,p=f.latitude;_.Cartesian3.fromRadians(d,p,o,void 0,t.position),t.lookAtTransform(i)}function iE(t,n){nE(t,n,!1)}function rE(t,n){nE(t,-n,!0)}class EN extends c.Destroyable{constructor(e){super();L(this,"_actions",{MoveForward:!1,MoveBackword:!1,MoveLeft:!1,MoveRight:!1});this._running=e;const{controller:i}=this,{viewer:o}=i.firstPersonController,{camera:r}=o;this.dispose(this.running.keyStatus.currentKeyIdsChanged.disposableOn(()=>{this._updateActions()})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SpeedUp"?this.controller.speed=this.controller.speed*2:s[a.code]==="SpeedDown"&&(this.controller.speed=this.controller.speed*.5)})),this.dispose(this.controller.keyDownEvent.disposableOn(a=>{const{keyStatusMap:s}=this.running.keyboardCameraController;s[a.code]==="SwitchAlwaysWithCamera"&&(this.controller.alwaysWithCamera=!this.controller.alwaysWithCamera)}));{const{actions:a}=this;let s=Date.now();const l=()=>{const u=Date.now(),A=u-s;s=u;const h=this.controller.speed;a.WithCamera||this.controller.alwaysWithCamera?(a.MoveForward&&r.moveForward(A*h),a.MoveBackword&&r.moveBackward(A*h),a.MoveLeft&&r.moveLeft(A*h),a.MoveRight&&r.moveRight(A*h)):(a.MoveForward&&iE(r,A*h),a.MoveBackword&&iE(r,-A*h),a.MoveLeft&&rE(r,-A*h),a.MoveRight&&rE(r,A*h));{const{rotateSpeed:f}=this.controller,d=_.Math.toRadians(f*A);a.RotateRight?r.lookRight(d):a.RotateLeft?r.lookRight(-d):a.RotateUp?r.lookDown(-d):a.RotateDown&&r.lookDown(d)}};o.scene.preUpdate.addEventListener(l),this.dispose(()=>o.scene.preUpdate.removeEventListener(l))}}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 i of e)this._actions[i]=!1}_updateActions(){const{running:e}=this,{keyStatus:i}=e,{actions:o}=this;this._resetActions();const{keyStatusMap:r}=this.running.keyboardCameraController;for(let a of i.currentKeyIds)o[r[a]]=!0}}class qf extends c.Destroyable{constructor(e){super();L(this,"_currentKeyIds",new Set);L(this,"_currentKeyIdsChanged",this.dv(new c.Event));L(this,"_debug",this.dv(c.react(!1)));L(this,"_debugResetting",this.dv(new c.ObjResettingWithEvent(this.debugChanged,()=>{if(this.debug)return new class extends c.Destroyable{constructor(e){super();const i=()=>{console.log([...e.currentKeyIds].join(`
3846
+ `))};i(),this.d(e.currentKeyIdsChanged.don(i))}}(this)})));this._keyboardCameraControllerRunning=e;const{keyboardCameraController:i}=this._keyboardCameraControllerRunning;{const o=r=>{const a=qf.getKeyId(r);this._currentKeyIds.has(a)||(this._currentKeyIds.add(a),this._currentKeyIdsChanged.emit())};this.d(i.keyDownEvent.don(o))}{const o=r=>{const a=qf.getKeyId(r);this._currentKeyIds.has(a)&&(this._currentKeyIds.delete(a),this._currentKeyIdsChanged.emit())};this.d(i.keyUpEvent.don(o))}{const o=()=>{this._currentKeyIds.clear(),this._currentKeyIdsChanged.emit()};this.d(i.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 PN extends c.Destroyable{constructor(e){super();L(this,"_keyStatus");L(this,"_cameraOp");this._keyboardCameraController=e,this._keyStatus=this.dv(new qf(this)),this._cameraOp=this.dv(new EN(this))}get keyboardCameraController(){return this._keyboardCameraController}get keyStatus(){return this._keyStatus}get cameraOp(){return this._cameraOp}}const ep=class ep extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"_keyStatusMap",this.dv(c.react(ep.defaultKeyStatusMap)));L(this,"_speed",this.dv(c.react(1)));L(this,"_rotateSpeed",this.dv(c.react(.01)));L(this,"_alwaysWithCamera",this.dv(c.react(!1)));L(this,"_keyDownEvent",this.dv(new c.Event));L(this,"_keyUpEvent",this.dv(new c.Event));L(this,"_abortEvent",this.dv(new c.Event));this._firstPersonController=e,this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new PN(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()}};L(ep,"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 Kf=ep;function BN(t,n){t.lookRight(_.Math.toRadians(n.movementX)*.1),t.lookDown(_.Math.toRadians(n.movementY)*.1);const e=t.pitch,i=_.Math.clamp(e,-_.Math.PI_OVER_TWO,_.Math.PI_OVER_TWO);i!==e&&t.setView({destination:t.positionWC,orientation:{heading:t.heading,pitch:i,roll:t.roll}})}class TN extends c.Destroyable{constructor(n,e){super(),this._firstPersonController=n,this._mouseCameraController=e;const{canvas:i}=this._firstPersonController.viewer;{const o=r=>{const{camera:a}=this._firstPersonController.viewer.scene;BN(a,r)};i.addEventListener("pointermove",o),this.dispose(()=>i.removeEventListener("pointermove",o))}}}const tp=class tp extends c.Destroyable{constructor(e){super();L(this,"_mouseMoving",this.dv(new TN(this.firstPersonController,this.mouseCameraController)));this._mouseCameraController=e;const{viewer:i}=this.firstPersonController;this.mouseCameraController.enableViewerOriginInputs(!1),this.dispose(()=>this.mouseCameraController.enableViewerOriginInputs(!0)),Element.prototype.setPointerCapture=()=>{},this.dispose(()=>Element.prototype.setPointerCapture=tp.origin_setPointerCapture);const o=i.canvas;o.requestPointerLock(),this.dispose(()=>document.exitPointerLock());{const r=()=>{document.pointerLockElement!==o&&(this.firstPersonController.mouseEnabled=!1)};document.addEventListener("pointerlockchange",r,!1),this.dispose(()=>document.removeEventListener("pointerlockchange",r,!1))}{const r=()=>{this.firstPersonController.mouseEnabled=!1,console.log("Error locking pointer")};document.addEventListener("pointerlockerror",r)}}get mouseCameraController(){return this._mouseCameraController}get firstPersonController(){return this.mouseCameraController.firstPersonController}get mouseMoving(){return this._mouseMoving}};L(tp,"origin_setPointerCapture",Element.prototype.setPointerCapture);let Uv=tp;class IN extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!1)));L(this,"enableViewerOriginInputs",e=>{e?this.firstPersonController.czmViewer.incrementDisabledInputStack():this.firstPersonController.czmViewer.decrementDisabledInputStack()});L(this,"_mouseResetting",this.dv(new c.ObjResettingWithEvent(this.enabledChanged,()=>{if(this.enabled)return new Uv(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 FN extends c.Destroyable{constructor(e){super();L(this,"viewer");L(this,"_mouseCameraController",this.dv(new IN(this)));L(this,"_keyboardCameraController",this.dv(new Kf(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 oE(t){t.removeInputAction(_.ScreenSpaceEventType.LEFT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_DOWN),t.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),t.removeInputAction(_.ScreenSpaceEventType.LEFT_UP),t.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP),t.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)}function Ov(t,n,e,i=void 0){const r=t.camera,a=new _.Cartesian2;a.x=n.startPosition.x,a.y=0;const s=new _.Cartesian2;s.x=n.endPosition.x,s.y=0;let l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,h,f;if(!l||!u)return;r.frustum instanceof _.OrthographicFrustum?(h=l.origin,f=u.origin,_.Cartesian3.add(r.direction,h,h),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(h,r.position,h),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(h,h),_.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction);let d=_.Cartesian3.dot(h,f);d<1&&(A=Math.acos(d)),A=n.startPosition.x>n.endPosition.x?A:-A;const p=e._horizontalRotationAxis;if(_.defined(i)?r.look(i,-A):_.defined(p)?r.look(p,-A):r.lookLeft(A),a.x=0,a.y=n.startPosition.y,s.x=0,s.y=n.endPosition.y,l=r.getPickRay(a,new _.Ray),u=r.getPickRay(s,new _.Ray),A=0,!(!l||!u))if(r.frustum instanceof _.OrthographicFrustum?(h=l.origin,f=u.origin,_.Cartesian3.add(r.direction,h,h),_.Cartesian3.add(r.direction,f,f),_.Cartesian3.subtract(h,r.position,h),_.Cartesian3.subtract(f,r.position,f),_.Cartesian3.normalize(h,h),_.Cartesian3.normalize(f,f)):(h=l.direction,f=u.direction),d=_.Cartesian3.dot(h,f),d<1&&(A=Math.acos(d)),A=n.startPosition.y>n.endPosition.y?A:-A,i=i??p,_.defined(i)){const g=r.direction,v=_.Cartesian3.negate(i,new _.Cartesian3),y=_.Cartesian3.equalsEpsilon(g,i,_.Math.EPSILON2),m=_.Cartesian3.equalsEpsilon(g,v,_.Math.EPSILON2);if(!y&&!m){d=_.Cartesian3.dot(g,i);let b=_.Math.acosClamped(d);A>0&&A>b&&(A=b-_.Math.EPSILON4),d=_.Cartesian3.dot(g,v),b=_.Math.acosClamped(d),A<0&&-A>b&&(A=-b+_.Math.EPSILON4);const x=_.Cartesian3.cross(i,g,new _.Cartesian3);r.look(x,A)}else(y&&A<0||m&&A>0)&&r.look(r.right,-A)}else r.lookUp(A)}class MN extends c.Destroyable{constructor(n,e){super();const i=e.viewer;if(!i)throw new Error("viewer is undefined");let o=!0;this.d(n.positionChanged.don(()=>o=!0)),this.d(n.rotationChanged.don(()=>o=!0)),this.d(n.offsetHeightChanged.don(()=>o=!0)),this.d(n.viewDistanceChanged.don(()=>o=!0)),this.d(n.offsetRotationChanged.don(()=>o=!0)),this.d(n.relativeRotationChanged.don(()=>o=!0));const r=[0,0,0],a=[0,0,0];this.d(i.clock.onTick.addEventListener(()=>{if(!o)return;if(o=!1,!n.position){console.warn("相机控制器未能设置位置,无法启用!");return}if(n.viewDistance===void 0){console.warn("相机控制器未能设置视距,将自动设置视距!");const h=ft(n.position),f=i.camera.positionWC,d=_.Cartesian3.distance(h,f);n.viewDistance=d}c.Vector.clone(n.position,a),n.offsetHeight&&(a[2]+=n.offsetHeight);const{rotation:s,offsetRotation:l=zi.defaults.offsetRotation}=n,u=[...l];c.Vector.set(r,0,0,0),s&&(n.relativeRotation??zi.defaults.relativeRotation)&&(c.Vector.add(s,r,r),u[0]+=90),c.Vector.add(u,r,r);const A={distance:n.viewDistance,heading:r[0],pitch:r[1],flyDuration:0,hDelta:0,pDelta:0};e.flyTo(A,a)})),e.incrementDisabledInputStack(),this.d(()=>{e.decrementDisabledInputStack()}),this.d(e.pointerMoveEvent.don(s=>{const l=s==null?void 0:s.pointerEvent;if(l&&n.enabledRotationInput&&(l.buttons===1||l.buttons===2)){const{movementX:u,movementY:A}=l;n.offsetRotation=c.Vector.add(n.offsetRotation??zi.defaults.offsetRotation,[u*.2,A*-.2,0])}})),this.d(e.wheelEvent.don(s=>{if(!n.enabledScaleInput)return;const l=s.deltaY,A=Math.max(1,n.viewDistance)*(l*.001);n.viewDistance=n.viewDistance+A}))}}class zi extends c.Destroyable{constructor(e){super();L(this,"_resetWithCameraEvent",this.dv(new c.Event));const i=e.viewer;if(!i)throw new Error("viewer is undefined");const o=this;let r;const a=()=>{r&&(r.destroy(),r=void 0)};this.d(a);const s=()=>{a(),o.enabled&&(r=new MN(o,e))};s(),this.d(o.enabledChanged.don(s)),this.d(o.resetWithCameraEvent.don(l=>{if(!e.actived)return;const u=ms(i.camera);if(!u)return;const A=o.rotation;o.offsetRotation=[u[0]-(o.relativeRotation?A[0]:90),u[1]-(o.relativeRotation?A[1]:0),u[2]-(o.relativeRotation?A[2]:0)]}))}get resetWithCameraEvent(){return this._resetWithCameraEvent}resetWithCamera(e){this._resetWithCameraEvent.emit(e)}}L(zi,"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:c.reactArrayWithUndefined(void 0),rotation:c.reactArrayWithUndefined(void 0),rotationEditing:!1,viewDistance:1e3,offsetHeight:0,offsetRotation:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,relativeRotation:!0})})(zi||(zi={})),c.extendClassProps(zi.prototype,zi.createDefaultProps);class vu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");L(this,"_geoPolylinePath");this._geoCameraController=this.dv(new zi(e)),this._geoPolylinePath=this.dv(new sa(e)),this._geoPolylinePath.show=!1,this._geoPolylinePath.currentTime=0;const i=()=>{(this.usePathPosition??!0)&&(this._geoCameraController.position=this._geoPolylinePath.currentPosition),(this.usePathRotation??!0)&&(this._geoCameraController.rotation=this._geoPolylinePath.currentRotation)};i(),this.d(this._geoPolylinePath.currentPositionChanged.don(i)),this.d(this._geoPolylinePath.currentRotationChanged.don(i)),this.dispose(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dispose(c.bind([this._geoCameraController,"viewDistance"],[this,"viewDistance"])),this.dispose(c.bind([this._geoCameraController,"offsetHeight"],[this,"offsetHeight"])),this.dispose(c.bind([this._geoCameraController,"offsetRotation"],[this,"offsetRotation"])),this.dispose(c.track([this._geoCameraController,"enabledRotationInput"],[this,"enabledRotationInput"])),this.dispose(c.track([this._geoCameraController,"enabledScaleInput"],[this,"enabledScaleInput"])),this.dv(new c.ObjResettingWithEvent(this.lineModeChanged,()=>{if(this.lineMode!==void 0){if(this.lineMode==="auto")return new DN(this,e);if(this.lineMode==="manual")return new RN(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:c.reactArray([0,-60,0]),enabledRotationInput:!0,enabledScaleInput:!0,lineMode:void 0})})(vu||(vu={})),c.extendClassProps(vu.prototype,vu.createDefaultProps);class DN extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");n.offsetRotation=[-90,0,0]}}class RN extends c.Destroyable{constructor(n,e){if(super(),!e.viewer)throw new Error("viewer is undefined");const o=r=>{(r.key==="w"||r.key==="s")&&(n.polylinePath.playing=r.type==="keydown",n.polylinePath.speed=r.key==="w"||r.type==="keyup"?1:-1)};this.dispose(e.keyDownEvent.don(o)),this.dispose(e.keyUpEvent.don(o))}}class UN extends c.Destroyable{constructor(n,e){super();const i=e.positionPropertyName??"position",o=e.positionChangedPropertyName??i+"Changed",r=e.rotationPropertyName??"rotation",a=e.rotationChangedPropertyName??r+"Changed",s=(e.positionTracking??!0)&&Reflect.has(n,i)&&Reflect.has(n,o),l=(e.rotationTracking??!0)&&Reflect.has(n,r)&&Reflect.has(n,a);if(!(!s&&!l)){if(s){const u=()=>{e.geoCameraController.position=n[i]};u();const A=n[o];this.d(A.don(u))}if(l){const u=()=>{e.geoCameraController.rotation=n[r]};u();const A=n[o];this.d(A.don(u))}}}}class ON extends c.Destroyable{constructor(n,e){super();const i=this.dv(new c.ESSceneObjectWithId);i.id=n;const o=this.dv(c.createNextAnimateFrameEvent(e.enabledChanged,e.positionTrackingChanged,e.rotationTrackingChanged,e.positionPropertyNameChanged,e.positionChangedPropertyNameChanged,e.rotationPropertyNameChanged,e.rotationChangedPropertyNameChanged,i.sceneObjectChanged));this.disposeVar(new c.ObjResettingWithEvent(o,()=>{const{sceneObject:r}=i;if(!(!e.enabled||!r))return new UN(r,e)}))}}class wu extends c.Destroyable{constructor(e){super();L(this,"_geoCameraController");this._geoCameraController=this.dv(new zi(e)),this.d(c.bind([this._geoCameraController,"enabled"],[this,"enabled"])),this.dv(new c.ObjResettingWithEvent(this.sceneObjectIdChanged,()=>{if(this.sceneObjectId)return new ON(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})})(wu||(wu={})),c.extendClassProps(wu.prototype,wu.createDefaultProps);class LN extends c.Destroyable{constructor(e){super();L(this,"height",1e7);L(this,"cycle",60);L(this,"latitude",6.632251044444445);L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");L(this,"leftDownCancel",!0);this._viewer=e,this._sseh=this.dv(new _.ScreenSpaceEventHandler(this._viewer.canvas)),this._sseh.setInputAction(()=>{this.leftDownCancel&&this.cancel()},_.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,i=e.positionCartographic;e.flyTo({destination:_.Cartesian3.fromRadians(i.longitude,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.Math.PI,roll:0},complete:()=>{this._running=!0;var o=void 0;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((r,a)=>{if(!o){o=new Date().getTime();return}const s=(new Date().getTime()-o)/1e3,l=e.positionCartographic.longitude+s*_.Math.PI*2/this.cycle;e.setView({destination:_.Cartesian3.fromRadians(l,this.latitude,this.height),orientation:{heading:0,pitch:-.5*_.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 zN extends c.Destroyable{constructor(e){super();L(this,"_height",this.dv(c.react(1e7)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_latitude",this.dv(c.react(38)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("未初始化viewer");this._inner=this.dv(new LN(i)),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 kN extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_transform");L(this,"_headingRadius");L(this,"_pitchRadius");L(this,"_running",!1);L(this,"_sseh");L(this,"_eventDisposer");this._viewer=e;const i=this.viewer.scene,o=this.viewer.camera;this._sseh=this.dv(new _.ScreenSpaceEventHandler(this.viewer.canvas)),this.d(()=>{this.cancel()});{const r=()=>{let a;if(this.position==null){var s=o.getPickRay(new _.Cartesian2(i.canvas.width*.5,i.canvas.height*.5));if(!s)return;a=i.globe.pick(s,i)}else a=_.Cartesian3.fromDegrees(...this.position);a&&(this._transform=_.Transforms.eastNorthUpToFixedFrame(a),this.start())};r(),this.d(this.positionChanged.don(r))}{const r=()=>{this._headingRadius=_.Math.toRadians(this.heading)};r(),this.d(this.headingChanged.don(r))}{const r=()=>{this._pitchRadius=_.Math.toRadians(this.pitch)};r(),this.d(this.pitchChanged.don(r))}}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 i=this.distance*Math.sin(this._pitchRadius),o=this.distance*Math.cos(this._pitchRadius),r=new _.Cartesian3(0,i,o);e.flyTo({destination:_.Matrix4.multiplyByPoint(this._transform,r,new _.Cartesian3),orientation:{heading:this._headingRadius,pitch:this._pitchRadius,roll:0},endTransform:this._transform,complete:()=>{this._running=!0;let a;this._eventDisposer=this.viewer.scene.postUpdate.addEventListener((s,l)=>{if(!a){a=new Date().getTime();return}const u=(new Date().getTime()-a)/1e3;this._headingRadius+=u*_.Math.PI*2/this.cycle,e.lookAtTransform(this._transform,new _.HeadingPitchRange(this._headingRadius,this._pitchRadius,this.distance)),a=new Date().getTime()})},duration:.5,maximumHeight:e.positionCartographic.height})}cancel(){if(!this._running)return;this.viewer.camera.lookAtTransform(_.Matrix4.IDENTITY),this._eventDisposer&&(this._eventDisposer(),this._eventDisposer=void 0),this._running=!1}}class QN extends c.Destroyable{constructor(e){super();L(this,"_position",this.dv(c.reactArrayWithUndefined(void 0)));L(this,"_distance",this.dv(c.react(5e4)));L(this,"_cycle",this.dv(c.react(60)));L(this,"_heading",this.dv(c.react(0)));L(this,"_pitch",this.dv(c.react(-30)));L(this,"_inner");this._czmViewer=e;const i=this._czmViewer.viewer;if(!i)throw new Error("viewer is undefined");this._inner=this.dv(new kN(i));{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 VN extends c.Destroyable{constructor(e){super();L(this,"_firstPersonController");L(this,"_rotateGlobe");L(this,"_rotatePoint");L(this,"_followController");L(this,"_pathCameraController");L(this,"_handler");this._viewer=e;{this._firstPersonController=this.dv(new FN(e)),this.d(this._viewer.keyDownEvent.don(i=>this._firstPersonController.keyboardCameraController.keyDown(i))),this.d(this._viewer.keyUpEvent.don(i=>this._firstPersonController.keyboardCameraController.keyUp(i)));{const{subContainer:i}=this._viewer;if(!i)throw new Error("_firstPersonControllerInit error!");const o=()=>this._firstPersonController.keyboardCameraController.abort();i.addEventListener("blur",o,!1),this.d(()=>i.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=Kf.defaultKeyStatusMap,this.d(this._firstPersonController.keyboardEnabledChanged.don(()=>{var i;(i=this._viewer.subContainer)==null||i.focus()}))}this._rotateGlobe=this.dv(new zN(e)),this._rotatePoint=this.dv(new QN(e)),this._followController=this.dv(new wu(e)),this._pathCameraController=this.dv(new vu(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,i=4.2,o=1.6){this.resetNavigation();const r=this._viewer.navigationMode!="Walk";this._changedMouseEvent("Walk");const a=this._viewer.getCameraInfo(),s=[(a==null?void 0:a.rotation[0])??0,0,0];this._viewer.getHeightByLonLat(e[0],e[1]).then(l=>{r?this._viewer.flyIn([e[0],e[1],(l??0)+o],s):this._viewer.viewer&&(this._viewer.viewer.camera.position=_.Cartesian3.fromDegrees(e[0],e[1],(l??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,i=1e7,o=60){this.resetNavigation(),this._changedMouseEvent("RotateGlobe"),this._rotateGlobe.latitude=e,this._rotateGlobe.height=i,this._rotateGlobe.cycle=o,this._rotateGlobe.start()}changeToRotatePoint(e,i=5e4,o=60,r=0,a=-30){this.resetNavigation(),this._changedMouseEvent("RotatePoint"),this._rotatePoint.position=e,this._rotatePoint.distance=i,this._rotatePoint.cycle=o,this._rotatePoint.heading=r,this._rotatePoint.pitch=a,this._rotatePoint.start()}changeToFollow(e,i=0,o=0,r=-30,a=!0){this.resetNavigation(),this._changedMouseEvent("Follow"),this._followController.sceneObjectId=e,this._followController.geoCameraController.offsetRotation=[o,r,0],this._followController.geoCameraController.relativeRotation=a,i!==0?this._followController.geoCameraController.viewDistance=i:this._followController.geoCameraController.viewDistance=1e3,this._followController.enabled=!0}changeToLine(e,i=10,o=10,r=!0,a=10,s="auto"){this.resetNavigation(),this._changedMouseEvent("Line");const l=s==="auto",u=c.ESSceneObject.getSceneObjById(e);if(!u)return;const{points:A}=u;if(!A)return;const h=c.getDistancesFromPositions(A,"NONE"),f=h[h.length-1];this._pathCameraController.viewDistance=0,this._pathCameraController.polylinePath.positions=[...A],this._pathCameraController.polylinePath.duration=f/i*1e3,this._pathCameraController.polylinePath.loop=r,this._pathCameraController.offsetHeight=o;const d=m0(A);this._pathCameraController.polylinePath.rotationRadius=!l||d==!1?[0]:d.map(p=>p/a*i),this._pathCameraController.enabledRotationInput=!l,this._pathCameraController.enabledScaleInput=!1,this._pathCameraController.polylinePath.playing=l,this._pathCameraController.lineMode=s,this._pathCameraController.enabled=!0}_changedMouseEvent(e){const i=this._viewer.viewer;if(!i)return;this._handler||(this._handler=new _.ScreenSpaceEventHandler(i.scene.canvas));const o=this._handler,r=i.scene.screenSpaceCameraController;this.d(()=>{o&&oE(o)}),e=="Walk"||e=="RotateGlobe"?(r.lookEventTypes=void 0,r.rotateEventTypes=void 0,r.tiltEventTypes=void 0,r.zoomEventTypes=void 0,r.translateEventTypes=void 0,o&&e=="Walk"&&(o.setInputAction(a=>{o.setInputAction(s=>{Ov(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_UP)},_.ScreenSpaceEventType.LEFT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Ov(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_UP)},_.ScreenSpaceEventType.RIGHT_DOWN),o.setInputAction(a=>{o.setInputAction(s=>{Ov(i.scene,s,r)},_.ScreenSpaceEventType.MOUSE_MOVE),o.setInputAction(s=>{o.removeInputAction(_.ScreenSpaceEventType.MOUSE_MOVE),o.removeInputAction(_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_UP)},_.ScreenSpaceEventType.MIDDLE_DOWN))):(o&&oE(o),r.lookEventTypes=_.CameraEventType.RIGHT_DRAG,r.rotateEventTypes=_.CameraEventType.LEFT_DRAG,r.tiltEventTypes=[_.CameraEventType.MIDDLE_DRAG,_.CameraEventType.PINCH,{eventType:_.CameraEventType.LEFT_DRAG,modifier:_.KeyboardEventModifier.CTRL},{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.CTRL}],r.translateEventTypes=_.CameraEventType.LEFT_DRAG,r.zoomEventTypes=[_.CameraEventType.WHEEL,_.CameraEventType.PINCH,{eventType:_.CameraEventType.RIGHT_DRAG,modifier:_.KeyboardEventModifier.SHIFT}])}}const NN=[{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 HN extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"cloudsPostProcess");const i=e.viewer;if(!i)throw new Error("Cesium Viewer is not initialized");const o=new _.CloudCollection;i.scene.primitives.add(o),this.dispose(()=>i.scene.primitives.remove(o));{const r=()=>{o.show=this.show};r(),this.dispose(this.showChanged.disposableOn(r))}{const r=s=>({slice:s.slice,brightness:s.brightness,scale:Ze(s.scale),maximumSize:ri(s.maximumSize),color:Be(s.color),position:ft(s.position)});(()=>{o.removeAll();for(let s of NN)o.add(r(s))})()}}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}class bu extends c.Destroyable{constructor(n){super();const e=n.viewer;if(!e){console.warn("viewer is undefined!");return}const i=e.scene.postProcessStages.add(_.PostProcessStageLibrary.createDepthOfFieldStage());this.d(()=>e.scene.postProcessStages.remove(i));{const o=()=>{i.enabled=this.show};o(),this.d(this.showChanged.don(o))}{const o=()=>{i.uniforms.fogByDistance=this.focalDistance};o(),this.d(this.focalDistanceChanged.don(o))}{const o=()=>{i.uniforms.delta=this.delta};o(),this.d(this.deltaChanged.don(o))}{const o=()=>{i.uniforms.sigma=this.sigma};o(),this.d(this.sigmaChanged.don(o))}{const o=()=>{i.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})})(bu||(bu={})),c.extendClassProps(bu.prototype,bu.createDefaultProps);const GN=`
3846
3847
  float getDistance(sampler2D depthTexture, vec2 texCoords)
3847
3848
  {
3848
3849
  float depth = czm_unpackDepth(texture(depthTexture, texCoords));
@@ -3878,7 +3879,7 @@ return material;
3878
3879
  vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount);
3879
3880
  out_FragColor = alphaBlend(finalFogColor, sceneColor);
3880
3881
  }
3881
- `;class GN extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"postProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(i.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new _.PostProcessStage({name:"earthsdk3_fog",fragmentShader:HN,uniforms:{fogByDistance:new _.Cartesian4(10,0,1e3,.9),fogColor:_.Color.WHITE}}),i.scene.postProcessStages.add(this.postProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const WN=`
3882
+ `;class WN extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"postProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.postProcess&&(i.scene.postProcessStages.remove(this.postProcess),this.postProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.postProcess||(this.postProcess=new _.PostProcessStage({name:"earthsdk3_fog",fragmentShader:GN,uniforms:{fogByDistance:new _.Cartesian4(10,0,1e3,.9),fogColor:_.Color.WHITE}}),i.scene.postProcessStages.add(this.postProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const jN=`
3882
3883
  uniform sampler2D colorTexture;
3883
3884
  in vec2 v_textureCoordinates;
3884
3885
 
@@ -3905,7 +3906,7 @@ void main(void){
3905
3906
 
3906
3907
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c,1), 0.5);
3907
3908
  }
3908
- `;class jN extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"rainPostProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(i.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new _.PostProcessStage({name:"earthsdk3_rain",fragmentShader:WN}),i.scene.postProcessStages.add(this.rainPostProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const qN=`
3909
+ `;class qN extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"rainPostProcess");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}const o=()=>{this.rainPostProcess&&(i.scene.postProcessStages.remove(this.rainPostProcess),this.rainPostProcess=void 0)};this.d(o);const r=()=>{o(),(this.show??!0)&&(this.rainPostProcess||(this.rainPostProcess=new _.PostProcessStage({name:"earthsdk3_rain",fragmentShader:jN}),i.scene.postProcessStages.add(this.rainPostProcess)))};r(),this.d(this.showChanged.don(r))}get show(){return this._show.value}set show(e){this._show.value=e}get showChanged(){return this._show.changed}}const KN=`
3909
3910
  uniform sampler2D colorTexture; //输入的场景渲染照片
3910
3911
  in vec2 v_textureCoordinates;
3911
3912
 
@@ -3936,7 +3937,7 @@ void main(void){
3936
3937
  finalColor=(vec3(c)); //屏幕上雪的颜色
3937
3938
  out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.5); //将雪和三维场景融合
3938
3939
  }
3939
- `,KN=`
3940
+ `,ZN=`
3940
3941
  #extension GL_OES_standard_derivatives : enable
3941
3942
  uniform sampler2D colorTexture;
3942
3943
  uniform sampler2D depthTexture;
@@ -3976,7 +3977,7 @@ void main() {
3976
3977
  }
3977
3978
  out_FragColor = mix(color, vec4(1.0), dotNumWC*alpha);
3978
3979
  }
3979
- `;class ZN extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"_alpha",this.dv(c.react(0)));L(this,"snow");L(this,"snowCover");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}let{snow:o,snowCover:r}=this;const a=()=>{o&&(i.scene.postProcessStages.remove(o),o=void 0)};this.d(a);const s=()=>{r&&(i.scene.postProcessStages.remove(r),r=void 0)};this.d(s);const l=()=>{if(!r)return;const A=_.Math.clamp(this.alpha,0,1);r.uniforms.alpha=A};l(),this.d(this.alphaChanged.don(l));const u=()=>{a(),s(),(this.show??!0)&&(o=new _.PostProcessStage({name:"earthsdk3_snow",fragmentShader:qN}),i.scene.postProcessStages.add(o),r=new _.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:KN,uniforms:{alpha:this.alpha}}),i.scene.postProcessStages.add(r),l())};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 $N extends c.Destroyable{constructor(e){super();L(this,"rain");L(this,"cloud");L(this,"snow");L(this,"fog");L(this,"depthOfField");const i=e.viewer;if(!i)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new jN(e)),r=this.dv(new NN(e)),a=this.dv(new ZN(e)),s=this.dv(new GN(e)),l=this.dv(new bu(e));this.rain=o,this.cloud=r,this.snow=a,this.fog=s,this.depthOfField=l;{const{scene:u}=i,A=()=>{u.sun&&(u.sun.show=e.sun??ot.defaults.sun),u.globe.enableLighting=e.sun??ot.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?r.show=!0:r.show=!1,e.snow>0&&e.snow<=1?(a.show=!0,a.alpha=e.snow):a.show=!1,e.fog>0&&e.fog<=1?s.show=!0:s.show=!1,e.depthOfField>0&&e.depthOfField<=1?l.show=!0:l.show=!1};A();const h=this.dv(c.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(h.don(A))}}}const Lv=_.BoundingRectangle,XN=_.Color,oo=_.defined,YN=_.destroyObject,sE=_.DeveloperError,JN=_.RenderState,eH=_.ShaderSource,tH=_._shadersViewportQuadFS,nH=_.BlendingState,aE=_.Material;function Zf(t){this.show=!0;let n;oo(n)||(n=new Lv),this.rectangle=Lv.clone(n),oo(t)||(t=aE.fromType(aE.ColorType,{color:new XN(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}Zf.prototype.update=function(t){if(this.show){if(!oo(this.material))throw new sE("this.material must be defined.");if(!oo(this.rectangle))throw new sE("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var n=this._rs;(!oo(n)||!Lv.equals(n.viewport,this.rectangle))&&(this._rs=JN.fromCache({blending:nH.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var i=t.context;if(this._material!==this.material||!oo(this._overlayCommand)){this._material=this.material,oo(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new eH({sources:[this._material.shaderSource,tH]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(i),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},Zf.prototype.isDestroyed=function(){return!1},Zf.prototype.destroy=function(){return oo(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),YN(this)};function lE(t){const{positiveX:n,negativeX:e,positiveY:i,negativeY:o,positiveZ:r,negativeZ:a}=t;if(!n||!e||!i||!o||!r||!a){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:c.ESSceneObject.context.getStrFromEnv(n),negativeX:c.ESSceneObject.context.getStrFromEnv(e),positiveY:c.ESSceneObject.context.getStrFromEnv(i),negativeY:c.ESSceneObject.context.getStrFromEnv(o),positiveZ:c.ESSceneObject.context.getStrFromEnv(r),negativeZ:c.ESSceneObject.context.getStrFromEnv(a)}}const iH=`in vec3 v_outerPositionWC;
3980
+ `;class $N extends c.Destroyable{constructor(e){super();L(this,"_show",this.dv(c.react(!1)));L(this,"_alpha",this.dv(c.react(0)));L(this,"snow");L(this,"snowCover");const i=e.viewer;if(!i){console.warn("viewer is undefined!");return}let{snow:o,snowCover:r}=this;const a=()=>{o&&(i.scene.postProcessStages.remove(o),o=void 0)};this.d(a);const s=()=>{r&&(i.scene.postProcessStages.remove(r),r=void 0)};this.d(s);const l=()=>{if(!r)return;const A=_.Math.clamp(this.alpha,0,1);r.uniforms.alpha=A};l(),this.d(this.alphaChanged.don(l));const u=()=>{a(),s(),(this.show??!0)&&(o=new _.PostProcessStage({name:"earthsdk3_snow",fragmentShader:KN}),i.scene.postProcessStages.add(o),r=new _.PostProcessStage({name:"earthsdk3_snowCover",fragmentShader:ZN,uniforms:{alpha:this.alpha}}),i.scene.postProcessStages.add(r),l())};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 XN extends c.Destroyable{constructor(e){super();L(this,"rain");L(this,"cloud");L(this,"snow");L(this,"fog");L(this,"depthOfField");const i=e.viewer;if(!i)throw new Error("Cesium.Viewer不存在!");const o=this.dv(new qN(e)),r=this.dv(new HN(e)),a=this.dv(new $N(e)),s=this.dv(new WN(e)),l=this.dv(new bu(e));this.rain=o,this.cloud=r,this.snow=a,this.fog=s,this.depthOfField=l;{const{scene:u}=i,A=()=>{u.sun&&(u.sun.show=e.sun??ot.defaults.sun),u.globe.enableLighting=e.sun??ot.defaults.sun,e.rain>0&&e.rain<=1?o.show=!0:o.show=!1,e.cloud>0&&e.cloud<=1?r.show=!0:r.show=!1,e.snow>0&&e.snow<=1?(a.show=!0,a.alpha=e.snow):a.show=!1,e.fog>0&&e.fog<=1?s.show=!0:s.show=!1,e.depthOfField>0&&e.depthOfField<=1?l.show=!0:l.show=!1};A();const h=this.dv(c.createNextAnimateFrameEvent(e.sunChanged,e.rainChanged,e.cloudChanged,e.snowChanged,e.fogChanged,e.depthOfFieldChanged,e.atmosphereChanged));this.d(h.don(A))}}}const Lv=_.BoundingRectangle,YN=_.Color,oo=_.defined,JN=_.destroyObject,sE=_.DeveloperError,eH=_.RenderState,tH=_.ShaderSource,nH=_._shadersViewportQuadFS,iH=_.BlendingState,aE=_.Material;function Zf(t){this.show=!0;let n;oo(n)||(n=new Lv),this.rectangle=Lv.clone(n),oo(t)||(t=aE.fromType(aE.ColorType,{color:new YN(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}Zf.prototype.update=function(t){if(this.show){if(!oo(this.material))throw new sE("this.material must be defined.");if(!oo(this.rectangle))throw new sE("this.rectangle must be defined.");this.rectangle.width=t.context.drawingBufferWidth,this.rectangle.height=t.context.drawingBufferHeight;var n=this._rs;(!oo(n)||!Lv.equals(n.viewport,this.rectangle))&&(this._rs=eH.fromCache({blending:iH.ALPHA_BLEND,viewport:this.rectangle}),this._overlayCommand&&(this._overlayCommand.renderState=this._rs));var e=t.passes;if(e.render){var i=t.context;if(this._material!==this.material||!oo(this._overlayCommand)){this._material=this.material,oo(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();var o=new tH({sources:[this._material.shaderSource,nH]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this})}this._material.update(i),this._overlayCommand.uniformMap=this._material._uniforms}return this._overlayCommand}},Zf.prototype.isDestroyed=function(){return!1},Zf.prototype.destroy=function(){return oo(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),JN(this)};function lE(t){const{positiveX:n,negativeX:e,positiveY:i,negativeY:o,positiveZ:r,negativeZ:a}=t;if(!n||!e||!i||!o||!r||!a){console.warn("sceneSkyBoxSources的信息不全,无法设置skybox!");return}return{positiveX:c.ESSceneObject.context.getStrFromEnv(n),negativeX:c.ESSceneObject.context.getStrFromEnv(e),positiveY:c.ESSceneObject.context.getStrFromEnv(i),negativeY:c.ESSceneObject.context.getStrFromEnv(o),positiveZ:c.ESSceneObject.context.getStrFromEnv(r),negativeZ:c.ESSceneObject.context.getStrFromEnv(a)}}const rH=`in vec3 v_outerPositionWC;
3980
3981
 
3981
3982
  uniform vec3 u_hsbShift;
3982
3983
 
@@ -4055,7 +4056,7 @@ void main (void)
4055
4056
  out_FragColor = color;
4056
4057
  // ------------------ skybox vtxf end -------------------
4057
4058
  }
4058
- `,so=_.Cartesian3,hr=_.defined,rH=_.destroyObject,oH=_.Ellipsoid,uE=_.EllipsoidGeometry,sH=_.GeometryPipeline,ka=_.Math,Ar=_.Matrix4,aH=_.VertexFormat,lH=_.BufferUsage,uH=_.DrawCommand,cH=_.RenderState,hH=_.ShaderProgram,cE=_.ShaderSource,AH=_.VertexArray,hE=_._shadersAtmosphereCommon,AE=_._shadersSkyAtmosphereCommon,fH=_._shadersSkyAtmosphereVS,pH=_.Axis,dH=_.BlendingState,mH=_.CullFace,fE=_.SceneMode,$f=_.Transforms,gH=_.Matrix3,pE=_.DeveloperError,yH=_.loadCubeMap,vH=_.CubeMap;function Qa(t,n){t=t??oH.WGS84,this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=so.multiplyByScalar(t.radii,e,new so);this._scaleMatrix=Ar.fromScale(i),this._modelMatrix=new Ar,this._command=new uH({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new so(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new so(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 so;const o=new so;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new gH,Ar.getMatrix3(r._eunMatrix||Ar.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(Qa.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Qa.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const zv=new Ar;Qa.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==fE.SCENE3D&&e!==fE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const p=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!hr(o.positiveX)||!hr(o.negativeX)||!hr(o.positiveY)||!hr(o.negativeY)||!hr(o.positiveZ)||!hr(o.negativeZ))throw new pE("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 pE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?yH(p,this._sources).then(function(g){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=g}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new vH({context:p,source:o}))}const r=Ar.fromRotationTranslation(t.context.uniformState.inverseViewRotation,so.ZERO,zv),a=Ar.multiplyTransformation(r,pH.Y_UP_TO_Z_UP,zv),s=Ar.multiply(this._scaleMatrix,a,zv);Ar.clone(s,this._modelMatrix);const l=t.context,u=wH(this),A=t.globeTranslucencyState.translucent,h=this.perFragmentAtmosphere||A||!hr(n)||!n.show,f=this._command;if($f.eastUpNorthToFixedFrame=$f.eastUpNorthToFixedFrame||$f.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=$f.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!hr(f.vertexArray)){const p=uE.createGeometry(new uE({radii:new so(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:aH.POSITION_ONLY}));f.vertexArray=AH.fromGeometry({context:l,geometry:p,attributeLocations:sH.createAttributeLocations(p),bufferUsage:lH.STATIC_DRAW}),f.renderState=cH.fromCache({cull:{enabled:!0,face:mH.FRONT},blending:dH.ALPHA_BLEND,depthMask:!1})}const d=u|h<<2|A<<3;if(d!==this._flags){this._flags=d;const p=[];u&&p.push("COLOR_CORRECT"),h&&p.push("PER_FRAGMENT_ATMOSPHERE"),A&&p.push("GLOBE_TRANSLUCENT");const g=new cE({defines:p,sources:[hE,AE,fH]}),v=new cE({defines:p,sources:[hE,AE,iH]});this._spSkyAtmosphere=hH.fromCache({context:l,vertexShaderSource:g,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(hr(this._cubeMap))return f};function wH(t){return!(ka.equalsEpsilon(t.hueShift,0,ka.EPSILON7)&&ka.equalsEpsilon(t.saturationShift,0,ka.EPSILON7)&&ka.equalsEpsilon(t.brightnessShift,0,ka.EPSILON7))}Qa.prototype.isDestroyed=function(){return!1},Qa.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(),rH(this)};const Za=class Za extends c.Destroyable{constructor(e,i){super();L(this,"_navigationManager");L(this,"_envManager");L(this,"_reu",(e,i)=>c.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new QN(r)),this._envManager=this.dv(new $N(r)),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Za.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=lE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Za.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends c.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new c.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=ot.latestDefaultAccessToken??ot.currentDefaultAccessToken;_.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=_.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(c.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=_.JulianDate.fromDate(new Date(r.currentTime));_.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(gi(o.clockViewModel,"currentTime",s=>{const l=_.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=_.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=_.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new _.SunLight,l=new _.DirectionalLight({direction:o.scene.camera.directionWC});class u extends c.Destroyable{constructor(){super();const h=r.flashLighting??!1;o.scene.light=h?l:s,h&&this.dispose(o.scene.preRender.addEventListener(function(f,d){l.direction=_.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new c.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(p,g)=>c.registerEventUpdate(this,p,g),h=ot.defaults,f=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);if(!Reflect.has(h,p))throw new Error(`!Reflect.has(CzmViewer.defaults, ${p})`);g(r[p]??h[p])}),d=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);g(r[p])});f("splitPosition",p=>o.scene.splitPosition=p),f("resolutionScale",p=>o.resolutionScale=p),f("msaaSamples",p=>o.scene.msaaSamples=p),d("shadows",p=>o.shadows=p),f("scenePpsfxaaEnabled",p=>s.postProcessStages.fxaa.enabled=p),d("scenePpsAmbientOcclusionEnabled",p=>s.postProcessStages.ambientOcclusion.enabled=p),d("scenePpsAmbientOcclusionAmbientOcclusionOnly",p=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=p),d("scenePpsAmbientOcclusionIntensity",p=>s.postProcessStages.ambientOcclusion.uniforms.intensity=p),d("scenePpsAmbientOcclusionBias",p=>s.postProcessStages.ambientOcclusion.uniforms.bias=p),d("scenePpsAmbientOcclusionLengthCap",p=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=p),d("scenePpsAmbientOcclusionStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=p),d("scenePpsAmbientOcclusionBlurStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=p),d("scenePpsBloomEnabled",p=>s.postProcessStages.bloom.enabled=p),d("scenePpsBloomGlowOnly",p=>s.postProcessStages.bloom.uniforms.glowOnly=p),d("scenePpsBloomContrast",p=>s.postProcessStages.bloom.uniforms.contrast=p),d("scenePpsBloomBrightness",p=>s.postProcessStages.bloom.uniforms.brightness=p),d("scenePpsBloomDelta",p=>s.postProcessStages.bloom.uniforms.delta=p),d("scenePpsBloomSigma",p=>s.postProcessStages.bloom.uniforms.sigma=p),d("scenePpsBloomStepSize",p=>s.postProcessStages.bloom.uniforms.stepSize=p),f("globeShow",p=>s.globe.show=p),f("depthTestAgainstTerrain",p=>{s.globe.depthTestAgainstTerrain=p}),s.globe.translucency.enabled=!0,f("terrainOpacity",p=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=c.clamp(p,0,1)}),f("sceneGlobeShadows",p=>s.globe.shadows=_.ShadowMode[p]),d("sceneGlobeTerrainExaggeration",p=>s.globe.terrainExaggeration=p),d("sceneGlobeTerrainExaggerationRelativeHeight",p=>s.globe.terrainExaggerationRelativeHeight=p),d("sceneGlobeVerticalExaggeration",p=>s.globe.verticalExaggeration=p),d("sceneGlobeVerticalExaggerationRelativeHeight",p=>s.globe.verticalExaggerationRelativeHeight=p),d("sceneGlobeBackFaceCulling",p=>s.globe.backFaceCulling=p),d("sceneGlobeShowSkirts",p=>s.globe.showSkirts=p),d("sceneGlobeShowWaterEffect",p=>s.globe.showWaterEffect=p),d("sceneGlobeBaseColor",p=>s.globe.baseColor=Be(p)),d("sceneGlobeCartographicLimitRectangle",p=>s.globe.cartographicLimitRectangle=mt(p)),d("sceneGlobeClippingPlanes",p=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=Ya(p??{enabled:!1});return}vh(s.globe.clippingPlanes,p)}),d("sceneGlobeClippingPolygons",p=>{s.globe.clippingPolygons=p?wh(p):void 0}),f("sceneSunGlowFactor",p=>s.sun&&(s.sun.glowFactor=p)),f("moon",p=>s.moon&&(s.moon.show=p)),f("sceneMoonOnlySunLighting",p=>s.moon&&(s.moon.onlySunLighting=p)),f("sceneMoonTextureUrl",p=>s.moon&&(s.moon.textureUrl=c.ESSceneObject.context.getStrFromEnv(p))),d("sceneSkyBoxShow",p=>s._xbsjOriginSkyBox.show=p),f("sceneSkyBoxSources",p=>s._xbsjOriginSkyBox.sources=p&&lE(p)),d("atmosphere",p=>o.scene._xbsjOriginSkyAtmosphere.show=p),d("sceneBackgroundColor",p=>o.scene.backgroundColor=Be(p)),f("sceneFogEnabled",p=>s.fog.enabled=p),f("sceneFogDensity",p=>s.fog.density=p),f("sceneFogScreenSpaceErrorFactor",p=>s.fog.screenSpaceErrorFactor=p),f("sceneFogMinimumBrightness",p=>s.fog.minimumBrightness=p),f("sceneDebugShowFramesPerSecond",p=>s.debugShowFramesPerSecond=p),f("sceneDebugShowCommands",p=>s.debugShowCommands=p),f("sceneDebugShowFrustums",p=>s.debugShowFrustums=p),f("sceneDebugShowFrustumPlanes",p=>s.debugShowFrustumPlanes=p),f("sceneDebugShowDepthFrustum",p=>s.debugShowDepthFrustum=p),f("sceneGlobeUndergroundColor",p=>u.undergroundColor=Be(p)),f("sceneGlobeUndergroundColorAlphaByDistance",p=>u.undergroundColorAlphaByDistance=gr(p)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",p=>u.translucency.backFaceAlphaByDistance=p&&gr(p)),d("sceneGlobeTranslucencyFrontFaceAlphaByDistance",p=>u.translucency.frontFaceAlphaByDistance=p&&gr(p)),f("sceneGlobeTranslucencyRectangle",p=>u.translucency.rectangle=mt(p)),f("sceneSplitPosition",p=>s.splitPosition=c.clamp(p,0,1)),f("sceneSsccEnableCollisionDetection",p=>s.screenSpaceCameraController.enableCollisionDetection=p),f("sceneSsccZoomFactor",p=>s.screenSpaceCameraController._zoomFactor=p);{const p=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};p(),this.d(r.showCesiumInspectorChanged.don(p))}f("cesiumInspectorWireframe",p=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=p)});{const p=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};p(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(p))}this.ad(new c.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Tv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};L(Za,"BackGroundResetting",class extends c.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new Zf;r.material=_.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),L(Za,"LocalSkyBoxResetting",class extends c.Destroyable{constructor(o,r,a){super();L(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new Qa(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let kv=Za;function bH(t,n,e,i,o){var r=_.Cartesian3.subtract(t,e,new _.Cartesian3),a=_.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function xH(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=_.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[bH(a,l,s,u,A),r]}const _H=_.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function CH(t){return-Math.log2(t/_H)}var Qv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function SH(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=Qv[++e];);const i=n/Qv[e-1]|0;return[i*Qv[e-1],i,e]}class EH extends c.Destroyable{constructor(){super();L(this,"_lengthInPixels",this.disposeVar(c.react(100)));L(this,"_resolution",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInPixels",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInMeters",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInStr",this.disposeVar(c.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=SH(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}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 PH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!0)));L(this,"_resolution",this.dv(c.react(void 0)));L(this,"_center",this.dv(c.react(void 0)));L(this,"_zoom",this.dv(c.react(void 0)));L(this,"_legend",this.dv(new EH));this._czmViewer=e;{const i=this.dv(c.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(c.sleep(1e3));const l=await o.promise(xH(this._czmViewer));if(l){const[u,A]=l;r=u,a=CH(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(c.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}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 BH(t,n){try{const e=_.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=_.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return _.Matrix4.clone(_.Matrix4.IDENTITY,n)}}const{combine:TH}=_,{ShaderDestination:os}=_,dE={name:"FlattenedPipelineStage"};dE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,os.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",os.BOTH),i.addUniform("vec4","u_flattenedBound",os.BOTH),i.addUniform("bool","u_flattened",os.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",os.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",os.BOTH),i.addUniform("bool","u_flattenDiscard",os.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??_.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??_.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=_.Matrix4.multiply(r,n.xbsjElevationMatrix??_.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new _.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??_.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=_.Matrix4.multiply(n.xbsjElevationMatrixInv??_.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new _.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=TH(o,t.uniformMap)}};function mE(){Object.defineProperties(_.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&&_.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new _.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 gE(){Object.defineProperties(_.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 yE(){const t=_.Model3DTileContent.prototype.update;_.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function vE(){const t=_.ModelSceneGraph.prototype.configurePipeline;_.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(dE),i}}mE(),gE(),yE(),vE();const IH=()=>({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:c.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:c.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:c.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:c.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:c.reactArray([]),sceneGlobeUndergroundColor:c.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:c.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:c.reactJson(ot.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:c.reactArray([1,1,1,1]),xbsjLocalBoxSources:c.reactJsonWithUndefined(void 0),sceneBackgroundColor:c.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}),FH=`
4059
+ `,so=_.Cartesian3,hr=_.defined,oH=_.destroyObject,sH=_.Ellipsoid,uE=_.EllipsoidGeometry,aH=_.GeometryPipeline,ka=_.Math,Ar=_.Matrix4,lH=_.VertexFormat,uH=_.BufferUsage,cH=_.DrawCommand,hH=_.RenderState,AH=_.ShaderProgram,cE=_.ShaderSource,fH=_.VertexArray,hE=_._shadersAtmosphereCommon,AE=_._shadersSkyAtmosphereCommon,pH=_._shadersSkyAtmosphereVS,dH=_.Axis,mH=_.BlendingState,gH=_.CullFace,fE=_.SceneMode,$f=_.Transforms,yH=_.Matrix3,pE=_.DeveloperError,vH=_.loadCubeMap,wH=_.CubeMap;function Qa(t,n){t=t??sH.WGS84,this.show=!0,this.sources=n,this.perFragmentAtmosphere=!1,this._ellipsoid=t;const e=1.025,i=so.multiplyByScalar(t.radii,e,new so);this._scaleMatrix=Ar.fromScale(i),this._modelMatrix=new Ar,this._command=new cH({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new so(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new so(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 so;const o=new so;o.x=t.maximumRadius*e,o.y=t.maximumRadius,o.z=0,this._radiiAndDynamicAtmosphereColor=o;const r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy},u_rotateMatrix:function(){return r._scratchRoateMatrix=r._scratchRoateMatrix||new yH,Ar.getMatrix3(r._eunMatrix||Ar.IDENTITY,r._scratchRoateMatrix)},u_cubeMap:function(){return r._cubeMap}}}Object.defineProperties(Qa.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}}),Qa.prototype.setDynamicLighting=function(t){this._radiiAndDynamicAtmosphereColor.z=t};const zv=new Ar;Qa.prototype.update=function(t,n){if(!this.show)return;const e=t.mode;if(e!==fE.SCENE3D&&e!==fE.MORPHING||!t.passes.render)return;if(this._sources!==this.sources){const p=t.context;var i=this;this._sources=this.sources;var o=this.sources;if(!hr(o.positiveX)||!hr(o.negativeX)||!hr(o.positiveY)||!hr(o.negativeY)||!hr(o.positiveZ)||!hr(o.negativeZ))throw new pE("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 pE("this.sources properties must all be the same type.");typeof o.positiveX=="string"?vH(p,this._sources).then(function(g){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=g}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new wH({context:p,source:o}))}const r=Ar.fromRotationTranslation(t.context.uniformState.inverseViewRotation,so.ZERO,zv),a=Ar.multiplyTransformation(r,dH.Y_UP_TO_Z_UP,zv),s=Ar.multiply(this._scaleMatrix,a,zv);Ar.clone(s,this._modelMatrix);const l=t.context,u=bH(this),A=t.globeTranslucencyState.translucent,h=this.perFragmentAtmosphere||A||!hr(n)||!n.show,f=this._command;if($f.eastUpNorthToFixedFrame=$f.eastUpNorthToFixedFrame||$f.localFrameToFixedFrameGenerator("east","up"),this._eunMatrix=$f.eastUpNorthToFixedFrame(t.camera._positionWC,void 0,this._eunMatrix),!hr(f.vertexArray)){const p=uE.createGeometry(new uE({radii:new so(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:lH.POSITION_ONLY}));f.vertexArray=fH.fromGeometry({context:l,geometry:p,attributeLocations:aH.createAttributeLocations(p),bufferUsage:uH.STATIC_DRAW}),f.renderState=hH.fromCache({cull:{enabled:!0,face:gH.FRONT},blending:mH.ALPHA_BLEND,depthMask:!1})}const d=u|h<<2|A<<3;if(d!==this._flags){this._flags=d;const p=[];u&&p.push("COLOR_CORRECT"),h&&p.push("PER_FRAGMENT_ATMOSPHERE"),A&&p.push("GLOBE_TRANSLUCENT");const g=new cE({defines:p,sources:[hE,AE,pH]}),v=new cE({defines:p,sources:[hE,AE,rH]});this._spSkyAtmosphere=AH.fromCache({context:l,vertexShaderSource:g,fragmentShaderSource:v}),f.shaderProgram=this._spSkyAtmosphere}if(hr(this._cubeMap))return f};function bH(t){return!(ka.equalsEpsilon(t.hueShift,0,ka.EPSILON7)&&ka.equalsEpsilon(t.saturationShift,0,ka.EPSILON7)&&ka.equalsEpsilon(t.brightnessShift,0,ka.EPSILON7))}Qa.prototype.isDestroyed=function(){return!1},Qa.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(),oH(this)};const Za=class Za extends c.Destroyable{constructor(e,i){super();L(this,"_navigationManager");L(this,"_envManager");L(this,"_reu",(e,i)=>c.registerEventUpdate(this,e,i));this._czmViewer=e,this._viewer=i;const o=this.viewer,r=this.czmViewer,a=o.scene.screenSpaceCameraController;this._navigationManager=this.dv(new VN(r)),this._envManager=this.dv(new XN(r)),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjUseBackgroundChanged,()=>{if(this._czmViewer.xbsjUseBackground)return new Za.BackGroundResetting(this._czmViewer,this._viewer)})),this.disposeVar(new c.ObjResettingWithEvent(this._czmViewer.xbsjLocalBoxSourcesChanged,()=>{if(!this._czmViewer.xbsjLocalBoxSources)return;const s=lE(this._czmViewer.xbsjLocalBoxSources);if(s)return new Za.LocalSkyBoxResetting(this._czmViewer,this._viewer,s)}));{this._reu(r.disabledInputStackChanged,()=>{const l=r.disabledInputStack===0;a.enableInputs=l,a.enableTranslate=l,a.enableZoom=l,a.enableRotate=l,a.enableTilt=l,a.enableLook=l});class s extends c.Destroyable{constructor(){super(),r.incrementDisabledInputStack(),this.dispose(()=>r.decrementDisabledInputStack())}}this.disposeVar(new c.ObjResettingWithEvent(r.sceneSsccEnableInputsChanged,()=>r.sceneSsccEnableInputs??!0?void 0:new s))}this.d(o.scene.camera.changed.addEventListener(()=>r.cameraChanged.emit()));{const s=()=>{const l=ot.latestDefaultAccessToken??ot.currentDefaultAccessToken;_.Ion.defaultAccessToken=r.ionAccessToken===""?l:r.ionAccessToken};s(),this.dispose(r.ionAccessTokenChanged.disposableOn(s))}{const{scene:s}=o,l=()=>{if(s.globe.show=r.globeShow??!0,"fov"in s.camera.frustum){const A=s.camera.frustum.aspectRatio;if(!A){console.error("aspectRatio is undefined,请检查Cesium的scene.camera.frustum");return}s.camera.frustum.fov=_.Math.toRadians(A>=1?r.fov:r.fov/A)}};l();const u=this.dv(c.createNextAnimateFrameEvent(r.globeShowChanged,r.fovChanged));this.d(u.don(l))}o.clockViewModel.currentTime=_.JulianDate.fromDate(new Date(r.currentTime)),this.dispose(r.currentTimeChanged.disposableOn(()=>{if(r.currentTime===void 0)return;const s=_.JulianDate.fromDate(new Date(r.currentTime));_.JulianDate.equals(s,o.clockViewModel.currentTime)||(o.clockViewModel.currentTime=s)})),this.dispose(gi(o.clockViewModel,"currentTime",s=>{const l=_.JulianDate.toDate(o.clockViewModel.currentTime).getTime();l!==r.currentTime&&(r.currentTime=l)}));{let s=_.getTimestamp(),l=0;this.d(o.scene.preUpdate.addEventListener(()=>{var u=_.getTimestamp();l++;var A=u-s;A>1e3&&(r._fps.value=l*1e3/A|0,s=u,l=0)}))}{const s=new _.SunLight,l=new _.DirectionalLight({direction:o.scene.camera.directionWC});class u extends c.Destroyable{constructor(){super();const h=r.flashLighting??!1;o.scene.light=h?l:s,h&&this.dispose(o.scene.preRender.addEventListener(function(f,d){l.direction=_.Cartesian3.clone(f.camera.directionWC,f.light.direction)}))}}this.disposeVar(new c.ObjResettingWithEvent(r.flashLightingChanged,()=>new u))}{const{scene:s}=o,{screenSpaceCameraController:l,globe:u}=s,A=(p,g)=>c.registerEventUpdate(this,p,g),h=ot.defaults,f=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);if(!Reflect.has(h,p))throw new Error(`!Reflect.has(CzmViewer.defaults, ${p})`);g(r[p]??h[p])}),d=(p,g)=>A(r[p+"Changed"],()=>{if(!Reflect.has(r,p))throw new Error(`!Reflect.has(czmViewer, ${p})`);g(r[p])});f("splitPosition",p=>o.scene.splitPosition=p),f("resolutionScale",p=>o.resolutionScale=p),f("msaaSamples",p=>o.scene.msaaSamples=p),d("shadows",p=>o.shadows=p),f("scenePpsfxaaEnabled",p=>s.postProcessStages.fxaa.enabled=p),d("scenePpsAmbientOcclusionEnabled",p=>s.postProcessStages.ambientOcclusion.enabled=p),d("scenePpsAmbientOcclusionAmbientOcclusionOnly",p=>s.postProcessStages.ambientOcclusion.uniforms.ambientOcclusionOnly=p),d("scenePpsAmbientOcclusionIntensity",p=>s.postProcessStages.ambientOcclusion.uniforms.intensity=p),d("scenePpsAmbientOcclusionBias",p=>s.postProcessStages.ambientOcclusion.uniforms.bias=p),d("scenePpsAmbientOcclusionLengthCap",p=>s.postProcessStages.ambientOcclusion.uniforms.lengthCap=p),d("scenePpsAmbientOcclusionStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.stepSize=p),d("scenePpsAmbientOcclusionBlurStepSize",p=>s.postProcessStages.ambientOcclusion.uniforms.blurStepSize=p),d("scenePpsBloomEnabled",p=>s.postProcessStages.bloom.enabled=p),d("scenePpsBloomGlowOnly",p=>s.postProcessStages.bloom.uniforms.glowOnly=p),d("scenePpsBloomContrast",p=>s.postProcessStages.bloom.uniforms.contrast=p),d("scenePpsBloomBrightness",p=>s.postProcessStages.bloom.uniforms.brightness=p),d("scenePpsBloomDelta",p=>s.postProcessStages.bloom.uniforms.delta=p),d("scenePpsBloomSigma",p=>s.postProcessStages.bloom.uniforms.sigma=p),d("scenePpsBloomStepSize",p=>s.postProcessStages.bloom.uniforms.stepSize=p),f("globeShow",p=>s.globe.show=p),f("depthTestAgainstTerrain",p=>{s.globe.depthTestAgainstTerrain=p}),s.globe.translucency.enabled=!0,f("terrainOpacity",p=>{s.globe.translucency.frontFaceAlpha=s.globe.translucency.backFaceAlpha=c.clamp(p,0,1)}),f("sceneGlobeShadows",p=>s.globe.shadows=_.ShadowMode[p]),d("sceneGlobeTerrainExaggeration",p=>s.globe.terrainExaggeration=p),d("sceneGlobeTerrainExaggerationRelativeHeight",p=>s.globe.terrainExaggerationRelativeHeight=p),d("sceneGlobeVerticalExaggeration",p=>s.globe.verticalExaggeration=p),d("sceneGlobeVerticalExaggerationRelativeHeight",p=>s.globe.verticalExaggerationRelativeHeight=p),d("sceneGlobeBackFaceCulling",p=>s.globe.backFaceCulling=p),d("sceneGlobeShowSkirts",p=>s.globe.showSkirts=p),d("sceneGlobeShowWaterEffect",p=>s.globe.showWaterEffect=p),d("sceneGlobeBaseColor",p=>s.globe.baseColor=Be(p)),d("sceneGlobeCartographicLimitRectangle",p=>s.globe.cartographicLimitRectangle=mt(p)),d("sceneGlobeClippingPlanes",p=>{if(!s.globe.clippingPlanes){s.globe.clippingPlanes=Ya(p??{enabled:!1});return}vh(s.globe.clippingPlanes,p)}),d("sceneGlobeClippingPolygons",p=>{s.globe.clippingPolygons=p?wh(p):void 0}),f("sceneSunGlowFactor",p=>s.sun&&(s.sun.glowFactor=p)),f("moon",p=>s.moon&&(s.moon.show=p)),f("sceneMoonOnlySunLighting",p=>s.moon&&(s.moon.onlySunLighting=p)),f("sceneMoonTextureUrl",p=>s.moon&&(s.moon.textureUrl=c.ESSceneObject.context.getStrFromEnv(p))),d("sceneSkyBoxShow",p=>s._xbsjOriginSkyBox.show=p),f("sceneSkyBoxSources",p=>s._xbsjOriginSkyBox.sources=p&&lE(p)),d("atmosphere",p=>o.scene._xbsjOriginSkyAtmosphere.show=p),d("sceneBackgroundColor",p=>o.scene.backgroundColor=Be(p)),f("sceneFogEnabled",p=>s.fog.enabled=p),f("sceneFogDensity",p=>s.fog.density=p),f("sceneFogScreenSpaceErrorFactor",p=>s.fog.screenSpaceErrorFactor=p),f("sceneFogMinimumBrightness",p=>s.fog.minimumBrightness=p),f("sceneDebugShowFramesPerSecond",p=>s.debugShowFramesPerSecond=p),f("sceneDebugShowCommands",p=>s.debugShowCommands=p),f("sceneDebugShowFrustums",p=>s.debugShowFrustums=p),f("sceneDebugShowFrustumPlanes",p=>s.debugShowFrustumPlanes=p),f("sceneDebugShowDepthFrustum",p=>s.debugShowDepthFrustum=p),f("sceneGlobeUndergroundColor",p=>u.undergroundColor=Be(p)),f("sceneGlobeUndergroundColorAlphaByDistance",p=>u.undergroundColorAlphaByDistance=gr(p)),f("sceneGlobeTranslucencyBackFaceAlphaByDistance",p=>u.translucency.backFaceAlphaByDistance=p&&gr(p)),d("sceneGlobeTranslucencyFrontFaceAlphaByDistance",p=>u.translucency.frontFaceAlphaByDistance=p&&gr(p)),f("sceneGlobeTranslucencyRectangle",p=>u.translucency.rectangle=mt(p)),f("sceneSplitPosition",p=>s.splitPosition=c.clamp(p,0,1)),f("sceneSsccEnableCollisionDetection",p=>s.screenSpaceCameraController.enableCollisionDetection=p),f("sceneSsccZoomFactor",p=>s.screenSpaceCameraController._zoomFactor=p);{const p=()=>{o.cesiumInspector&&(o.cesiumInspector.container.style.display=r.showCesiumInspector??!1?"block":"none")};p(),this.d(r.showCesiumInspectorChanged.don(p))}f("cesiumInspectorWireframe",p=>{"cesiumInspector"in o&&(o.cesiumInspector.viewModel.wireframe=p)});{const p=()=>{o.cesium3DTilesInspector&&(o.cesium3DTilesInspector.container.style.display=r.showCesium3DTilesInspector??!1?"block":"none")};p(),this.dispose(r.showCesium3DTilesInspectorChanged.disposableOn(p))}this.ad(new c.ObjResettingWithEvent(r.particleGlobalControlChanged,()=>{if(!r.particleGlobalControl)return new Tv}))}}get czmViewer(){return this._czmViewer}get viewer(){return this._viewer}get navigationManager(){return this._navigationManager}get envManager(){return this._envManager}};L(Za,"BackGroundResetting",class extends c.Destroyable{constructor(i,o){super(),this._czmViewer=i,this._viewer=o;const r=new Zf;r.material=_.Material.fromType("Image");const a=this._viewer;a.scene.skyBox=r,this.dispose(()=>a.scene.skyBox=a.scene._xbsjOriginSkyBox);{const s=()=>{r.show=this._czmViewer.sceneSkyBoxShow};s(),this.dispose(this._czmViewer.sceneSkyBoxShowChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.color=Be(this._czmViewer.xbsjBackgroundColor)};s(),this.dispose(this._czmViewer.xbsjBackgroundColorChanged.disposableOn(s))}{const s=()=>{r.material.uniforms.image=SceneObject.context.getStrFromEnv(this._czmViewer.xbsjBackgroundImageUri)};s(),this.dispose(this._czmViewer.xbsjBackgroundImageUriChanged.disposableOn(s))}}}),L(Za,"LocalSkyBoxResetting",class extends c.Destroyable{constructor(o,r,a){super();L(this,"_skyAtmosphere");this._czmViewer=o,this._viewer=r,this._sources=a,this._skyAtmosphere=new Qa(void 0,this._sources);const s=this._viewer;s.scene.skyAtmosphere=this._skyAtmosphere,this.dispose(()=>s.scene.skyAtmosphere=s.scene._xbsjOriginSkyAtmosphere);{const l=()=>{this._skyAtmosphere.show=this._czmViewer.atmosphere};l(),this.dispose(this._czmViewer.atmosphereChanged.disposableOn(l))}}get skyAtmosphere(){return this._skyAtmosphere}});let kv=Za;function xH(t,n,e,i,o){var r=_.Cartesian3.subtract(t,e,new _.Cartesian3),a=_.Cartesian3.dot(r,n);if(!(a<=0))return a*Math.tan(i*.5)*2/o}async function _H(t){const{viewer:n}=t;if(!n)return;const{width:e,height:i}=n.canvas,o=t.quickPickPosition([e*.5,i*.5]);if(!o)return;const r=await o;if(!r)return;const a=_.Cartesian3.fromDegrees(...r);if(!a)return;const s=n.camera.positionWC,l=n.camera.directionWC,u=n.camera.frustum.fovy;if(u===void 0)return;const A=n.canvas.height;return[xH(a,l,s,u,A),r]}const CH=_.Ellipsoid.WGS84.maximumRadius*2*Math.PI/512;function SH(t){return-Math.log2(t/CH)}var Qv=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8];function EH(t){const n=t|0;if(n<1||n>1e8)return;let e=-1;for(;n>=Qv[++e];);const i=n/Qv[e-1]|0;return[i*Qv[e-1],i,e]}class PH extends c.Destroyable{constructor(){super();L(this,"_lengthInPixels",this.disposeVar(c.react(100)));L(this,"_resolution",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInPixels",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInMeters",this.disposeVar(c.react(void 0)));L(this,"_computedLengthInStr",this.disposeVar(c.react(void 0)));{const e=()=>{let i,o;const{lengthInPixels:r,resolution:a}=this;if(r&&a){const s=EH(r*a);if(s){const[l,u,A]=s;o=l,i=l/a}}this._computedLengthInPixels.value=i,this._computedLengthInMeters.value=o};e(),this.dispose(this.lengthInPixelsChanged.disposableOn(e)),this.dispose(this.resolutionChanged.disposableOn(e))}{const e=()=>{const i=this.computedLengthInMeters;if(!i){this._computedLengthInStr.value=void 0;return}this._computedLengthInStr.value=i>1e3?`${i/1e3|0}km`:`${i}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 BH extends c.Destroyable{constructor(e){super();L(this,"_enabled",this.dv(c.react(!0)));L(this,"_resolution",this.dv(c.react(void 0)));L(this,"_center",this.dv(c.react(void 0)));L(this,"_zoom",this.dv(c.react(void 0)));L(this,"_legend",this.dv(new PH));this._czmViewer=e;{const i=this.dv(c.createProcessingFromAsyncFunc(async o=>{let r,a,s;await o.promise(c.sleep(1e3));const l=await o.promise(_H(this._czmViewer));if(l){const[u,A]=l;r=u,a=SH(u),s=A}this._resolution.value=r,this._zoom.value=a,this._center.value=s}));i.restart();{const o=()=>{this.enabled?i.restart():i.cancel()};o();const r=this.dv(c.createNextAnimateFrameEvent(this._czmViewer.cameraChanged,this.enabledChanged));this.dispose(r.disposableOn(o))}}{const i=()=>{this._legend.resolution=this.resolution};i(),this.dispose(this.resolutionChanged.disposableOn(i))}}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 TH(t,n){try{const e=_.Ellipsoid.WGS84,i=e.scaleToGeodeticSurface(t);return n=_.Transforms.eastNorthUpToFixedFrame(i,e,n),n}catch{return _.Matrix4.clone(_.Matrix4.IDENTITY,n)}}const{combine:IH}=_,{ShaderDestination:os}=_,dE={name:"FlattenedPipelineStage"};dE.process=function(t,n,e){if(n.xbsjFlattened){const i=t.shaderBuilder;i.addDefine("XBSJ_FLATTERN",void 0,os.BOTH),i.addUniform("sampler2D","u_flattenedPolygonTexture",os.BOTH),i.addUniform("vec4","u_flattenedBound",os.BOTH),i.addUniform("bool","u_flattened",os.BOTH),i.addUniform("mat4","u_inverseModelElevationMatrix",os.BOTH),i.addUniform("mat4","u_inverseElevationModelMatrix",os.BOTH),i.addUniform("bool","u_flattenDiscard",os.BOTH);const o={u_flattenedBound:function(){return n.xbsjFlattenedBound??_.Cartesian4.ZERO},u_flattened:function(){return n.xbsjFlattened},u_inverseModelElevationMatrix:function(){const r=e.context.uniformState.inverseModel??_.Matrix4.IDENTITY;return n._uniformElevationInverseModelMatrix=_.Matrix4.multiply(r,n.xbsjElevationMatrix??_.Matrix4.IDENTITY,n._uniformElevationInverseModelMatrix??new _.Matrix4),n._uniformElevationInverseModelMatrix},u_inverseElevationModelMatrix:function(){const r=e.context.uniformState.model??_.Matrix4.IDENTITY;return n._uniformInverseElevationModelMatrix=_.Matrix4.multiply(n.xbsjElevationMatrixInv??_.Matrix4.IDENTITY,r,n._uniformInverseElevationModelMatrix??new _.Matrix4),n._uniformInverseElevationModelMatrix},u_flattenedPolygonTexture:function(){return n.xbsjGetFlattenedTextureFunc?n.xbsjGetFlattenedTextureFunc()??e.context.defaultTexture:e.context.defaultTexture}};t.uniformMap=IH(o,t.uniformMap)}};function mE(){Object.defineProperties(_.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&&_.Matrix4.inverseTransformation(this._xbsjElevationMatrix,new _.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 gE(){Object.defineProperties(_.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 yE(){const t=_.Model3DTileContent.prototype.update;_.Model3DTileContent.prototype.update=function(n,e,...i){const o=this._model;return o.xbsjFlattened=n.xbsjFlattened,o.xbsjElevationMatrix=n.xbsjElevationMatrix,o.xbsjFlattenedBound=n.xbsjFlattenedBound,o.xbsjGetFlattenedTextureFunc=n.xbsjGetFlattenedTextureFunc,t.call(this,n,e,...i)}}function vE(){const t=_.ModelSceneGraph.prototype.configurePipeline;_.ModelSceneGraph.prototype.configurePipeline=function(n,...e){const i=t.call(this,n,...e),o=this._model,r=this.modelPipelineStages;return o.xbsjFlattened&&r.push(dE),i}}mE(),gE(),yE(),vE();const FH=()=>({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:c.reactArray([0,0,1,0]),sceneGlobeCartographicLimitRectangle:c.reactArray([-180,-90,180,90]),sceneGlobeClippingPlanes:c.reactJson(void 0),sceneGlobeClippingPlanesId:"",sceneGlobeClippingPolygons:c.reactJsonWithUndefined(void 0),sceneGlobeClippingPolygonsId:c.reactArray([]),sceneGlobeUndergroundColor:c.reactArrayWithUndefined(void 0),sceneGlobeUndergroundColorAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyBackFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyFrontFaceAlphaByDistance:c.reactArrayWithUndefined(void 0),sceneGlobeTranslucencyRectangle:c.reactArrayWithUndefined(void 0),sun:void 0,sceneSunGlowFactor:void 0,moon:void 0,sceneMoonTextureUrl:void 0,sceneMoonOnlySunLighting:void 0,sceneSkyBoxShow:!0,sceneSkyBoxSources:c.reactJson(ot.defaults.sceneSkyBoxSources),xbsjUseBackground:!1,xbsjBackgroundImageUri:"",xbsjBackgroundColor:c.reactArray([1,1,1,1]),xbsjLocalBoxSources:c.reactJsonWithUndefined(void 0),sceneBackgroundColor:c.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}),MH=`
4059
4060
  #### 示例代码1
4060
4061
  \`\`\`
4061
4062
  async function initCesiumViewer(container, czmViewer) {
@@ -4130,7 +4131,7 @@ async function initCesiumViewer(container, czmViewer) {
4130
4131
  return viewer;
4131
4132
  }
4132
4133
  \`\`\`
4133
- `,MH=`async function initCesiumViewer(container, czmViewer) {
4134
+ `,DH=`async function initCesiumViewer(container, czmViewer) {
4134
4135
  const viewer = await XE2.g.defaultCreateCesiumViewerFunc(container, czmViewer);
4135
4136
 
4136
4137
  // 若原Czm版权信息展示位置遮挡重要信息,可将以下语句解注释,在别的位置展示
@@ -4138,13 +4139,13 @@ async function initCesiumViewer(container, czmViewer) {
4138
4139
 
4139
4140
  return viewer;
4140
4141
  }
4141
- `;function DH(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
4142
+ `;function RH(){const t="https://gitee.com/mirrors/CesiumJS/blob/main/packages/engine/Source/Core/Ion.js#L7",e=` 因浏览器同源策略限制,需要用户自行打开网址获取最新的token,点击确定自动打开网址,请不要拦截!
4142
4143
  github地址:https://github.com/CesiumGS/cesium/blob/main/packages/engine/Source/Core/Ion.js#L7
4143
4144
  gitee地址:${t}
4144
- `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new pV(this)),this.ad(new dV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new vV(this)})),this._viewerLegend=this.dv(new PH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new gN(this.subContainer,this,o=>this._viewer.value=o,i.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&&Qn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:ms(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=_.Cartesian3.fromDegrees(...e),r=_.Transforms.eastNorthUpToFixedFrame(o),a=_.Matrix4.inverse(r,new _.Matrix4),s=_.Matrix4.multiplyByPoint(a,i.positionWC,new _.Cartesian3),l=_.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=_.Math.toDegrees(u);let A=_.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-_.Math.PI:_.Math.PI),A=_.Math.toDegrees(A);const h=ms(i),f=h[0]-A,d=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:d}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&rl(s,a,r)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:ms(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,Nt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return vn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",MH,FH,!0),new c.FunctionProperty([],()=>Nt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",DH),L(Nt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",yV),L(Nt,"defaults",{...c.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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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}),L(Nt,"getHeightsScartchCarto",new _.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...IH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.14",e="2025-10-15T08:26:43.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="d85e1020200203ea0aca1c05ac3f93f1f4e4574e",s=((Date.now()-1760516803e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4145
+ `;console.log(e);const i=window.prompt(e,t);i&&window.open(i,"_blank")}const Nt=class Nt extends c.ESViewer{constructor(e){super(e);L(this,"_disabledInputStack",this.disposeVar(c.react(0)));L(this,"_viewer",this.dv(c.react(void 0)));L(this,"_viewerInstance");L(this,"_viewerLegend");L(this,"pickCustomAttachedInfo");L(this,"_fps",this.dv(c.react(0)));L(this,"_notSupportEditingCount",this.disposeVar(c.react(0)));L(this,"_editingSystem",Wf);L(this,"_moveObjectsProcess",this.ad(RS()));if(e.type!=="ESCesiumViewer")throw new Error("option.type must be ESCesiumViewer");this.ad(new dV(this)),this.ad(new mV(this)),this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new wV(this)})),this._viewerLegend=this.dv(new BH(this)),this._viewerInstance=this.dv(new c.ObjResettingWithEvent(this.viewerChanged,()=>{if(this.viewer)return new kv(this,this.viewer)})),this.d(this.viewerChanged.don(o=>{this.viewer&&(this.viewer.scene.globe.baseColor=Be([1,1,1,1]))}));const i=e;this.d(this._viewer.changed.don(o=>{this.viewerChanged.emit(o)})),this.dv(new c.ObjResettingWithEvent(this.subContainerChanged,()=>{if(this.setStatus("Raw"),this.setStatusLog(""),!!this.subContainer)return new yN(this.subContainer,this,o=>this._viewer.value=o,i.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&&Qn(this.viewer)}get viewerInstance(){return this._viewerInstance}get viewerLegend(){return this._viewerLegend}async pick(e,i,o){if(!this.extensions)return;const{pickingManager:r}=this.extensions;return await r.pick(e,void 0,i)}async pickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.pickPosition(e)}async quickPickPosition(e){if(!this.extensions)return;const{pickingManager:i}=this.extensions;return await i.quickPickPosition(e)}async getTerrainHeight(e){const{viewer:i}=this;if(!i)return;const o=_.Cartographic.fromDegrees(e[0],e[1],e[2],Nt.getHeightsScartchCarto);return i.scene.globe.getHeight(o)}getCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:ms(e)}}calcFlyToParam(e){if(!this.viewer)return;const{camera:i}=this.viewer;if(!i||!e)return;const o=_.Cartesian3.fromDegrees(...e),r=_.Transforms.eastNorthUpToFixedFrame(o),a=_.Matrix4.inverse(r,new _.Matrix4),s=_.Matrix4.multiplyByPoint(a,i.positionWC,new _.Cartesian3),l=_.Cartesian3.magnitude(s);let u=-Math.asin(s.z/l);u=_.Math.toDegrees(u);let A=_.Math.PI_OVER_TWO-Math.atan(s.y/s.x);s.x>0&&(A+=s.y<0?-_.Math.PI:_.Math.PI),A=_.Math.toDegrees(A);const h=ms(i),f=h[0]-A,d=h[1]-u;return{distance:l,heading:A,pitch:u,flyDuration:1,hDelta:f,pDelta:d}}flyIn(e,i,o,r="default"){var l;if(!i)return;const a={position:e,rotation:i,duration:(o??1)*1e3},s=(l=this.viewer)==null?void 0:l.camera;return s&&rl(s,a,r)}flyTo(e,i,o="default"){var d;const{distance:r,heading:a,pitch:s,flyDuration:l,hDelta:u,pDelta:A}=e,h={position:i,viewDistance:r,rotation:[a,s,0],duration:l*1e3,hdelta:u,pdelta:A},f=(d=this.viewer)==null?void 0:d.camera;return f&&rl(f,h,o)}flyToBoundingSphere(e,i,o=1){var h;const r=[[e[0],e[1],0],[e[0],e[3],0],[e[2],e[3],0],[e[2],e[1],0]],a=c.getGeoBoundingSphereFromPositions(r);if(!a)return;const{center:s,radius:l}=a,u={position:s,viewDistance:i??l,rotation:[0,-90,0],duration:o*1e3},A=(h=this.viewer)==null?void 0:h.camera;return A&&rl(A,u)}getCurrentCameraInfo(){if(!this.viewer)return;const{camera:e}=this.viewer;return{position:Fn(e),rotation:ms(e)}}getLengthInPixel(){return this._viewerLegend.length}changeToWalk(e,i=4.2,o=1.6){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToWalk(e,i,o),this._navigationMode.value="Walk"}changeToMap(){var e,i;(i=(e=this._viewerInstance)==null?void 0:e.obj)==null||i.navigationManager.changeToMap(),this._navigationMode.value="Map"}changeToRotateGlobe(e,i,o){var r,a;(a=(r=this._viewerInstance)==null?void 0:r.obj)==null||a.navigationManager.changeToRotateGlobe(e,i,o),this._navigationMode.value="RotateGlobe"}changeToLine(e,i,o,r,a,s){var l,u;(u=(l=this._viewerInstance)==null?void 0:l.obj)==null||u.navigationManager.changeToLine(e,i,o,r,a,s),this._navigationMode.value="Line"}changeToUserDefined(e){this.changeToMap(),console.warn("Cesium引擎暂不支持自定义漫游,已切换为Map模式")}changeToRotatePoint(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToRotatePoint(e,i,o,r,a),this._navigationMode.value="RotatePoint"}changeToFollow(e,i,o,r,a){var s,l;(l=(s=this._viewerInstance)==null?void 0:s.obj)==null||l.navigationManager.changeToFollow(e,i,o,r,a),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=_.VERSION,e}async getHeightByLonLat(e,i,o){if(!this.viewer)return null;const r=_.Cartographic.fromDegrees(e,i,void 0,Nt.getHeightsScartchCarto);return this.viewer.scene.sampleHeight(r)??null}async getHeightsByLonLats(e,i){const o=e.map(a=>this.getHeightByLonLat(...a));return await Promise.all(o)}async capture(e,i){if(this.viewer)return await P0(this.viewer.scene,e,i)}async lonLatAltToScreenPosition(e){if(!this.viewer||!this.isPointVisible(e))return;const i=this.viewer.scene.cartesianToCanvasCoordinates(ft(e));if(i)return[i.x,i.y]}get notSupportEditingCount(){return this._notSupportEditingCount.value}set notSupportEditingCount(e){this._notSupportEditingCount.value=e}get notSupportEditingCountChanged(){return this._notSupportEditingCount.changed}startEditing(e,i,o){o=Object.assign({useKeyToSwitch:!0,callSource:"outer"},o);const r=e.components.main??e;r&&i!=null&&(r.editingID=`${o.callSource}_${c.createGuid()}`,this._editingSystem.create(this,r,i,o.useKeyToSwitch))}stopEditing(){this._editingSystem.stop()}moveObjects(e){const i=[],o=c.createGuid();for(let r=0;r<e.length;r++){const a=e[r],s=a.components.main??a;s.editingID=o,s&&i.push(s)}this._moveObjectsProcess.restart(void 0,this,i,o)}getCzmObject(e){return this.sceneObjectsMap.get(e)}setCurrentDefaultAccessToken(){this.ionAccessToken=Nt.currentDefaultAccessToken}setLatestDefaultAccessToken(){if(!Nt.latestDefaultAccessToken){alert("Cesium最新的iontoken无法获取!"),console.error("Cesium最新的iontoken无法获取!");return}this.ionAccessToken=Nt.latestDefaultAccessToken}positionsToLocalPositions(e,i){return vn(e,i)}localPositionsToPositions(e,i){return _r(e,i)}isPointVisible(e){if(!this.viewer)return!1;const i=ft(e),o=new _.EllipsoidalOccluder(this.viewer.scene.globe.ellipsoid,this.viewer.scene.camera.positionWC);if(o.cameraPosition=this.viewer.scene.camera.positionWC,!o.isPointVisible(i))return!1;const r=this.viewer.scene.cartesianToCanvasCoordinates(i);return!(!r||r.x<0||r.y<0)}getESProperties(){const e={...super.getESProperties()},i=Nt.defaults;return{...e,more:[...e.more,new c.GroupProperty([],"通用","通用"),new c.EvalStringProperty([this,"createCesiumViewerFuncStr"],"CesiumViewer创建函数",DH,MH,!0),new c.FunctionProperty([],()=>Nt.getCesiumIonToken(),[],"获取官方token"),new c.FunctionProperty([],()=>this.setCurrentDefaultAccessToken(),[],"重置为当前使用的Cesium版本的token"),new c.FunctionProperty([],()=>this.setLatestDefaultAccessToken(),[],"最新token","重置为当前Cesium官方的最新token"),new c.BooleanProperty([this,"flashLighting"],"头顶灯",i.flashLighting,!0),new c.BooleanProperty([this,"particleGlobalControl"],"粒子全局控制播放",i.particleGlobalControl,!0),new c.GroupProperty([],"Viewer","Viewer"),new c.NumberProperty([this,"resolutionScale"],"分辨率比率",i.resolutionScale,!0),new c.NumberProperty([this,"msaaSamples"],"msaaSamples",i.msaaSamples,!0),new c.BooleanProperty([this,"shadows"]),new c.GroupProperty([],"比例尺","比例尺(Legend)"),new c.NumberProperty([this.viewerLegend,"resolution"],"resolution",void 0,!0,!0),new c.NumberProperty([this.viewerLegend,"zoom"],"zoom",void 0,!0,!0),new c.Number3Property([this.viewerLegend,"center"],"center",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"lengthInPixels"],"lengthInPixels",100,!0,!1),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInPixels"],"computedLengthInPixels",void 0,!0,!0),new c.NumberProperty([this.viewerLegend.legend,"computedLengthInMeters"],"computedLengthInMeters",void 0,!0,!0),new c.StringProperty([this.viewerLegend.legend,"computedLengthInStr"],"computedLengthInStr",void 0,!0,!0),new c.GroupProperty([],"场景","场景(Scene)"),new c.NumberProperty([this,"sceneSplitPosition"],"内部视口分割比例",i.sceneSplitPosition,!0),new c.GroupProperty([],"Globe","Globe"),new c.EnumProperty([this,"sceneGlobeShadows"],[["禁用","DISABLED"],["启用","ENABLED"],["仅投射","CAST_ONLY"],["仅接收","RECEIVE_ONLY"]],"sceneGlobeShadows",i.sceneGlobeShadows,!0),new c.NumberProperty([this,"sceneGlobeTerrainExaggeration"]),new c.NumberProperty([this,"sceneGlobeTerrainExaggerationRelativeHeight"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggeration"]),new c.NumberProperty([this,"sceneGlobeVerticalExaggerationRelativeHeight"]),new c.BooleanProperty([this,"sceneGlobeBackFaceCulling"]),new c.BooleanProperty([this,"sceneGlobeShowSkirts"]),new c.BooleanProperty([this,"sceneGlobeShowWaterEffect"]),new c.ColorProperty([this,"sceneGlobeBaseColor"]),new c.Number4Property([this,"sceneGlobeCartographicLimitRectangle"]),new c.JsonProperty([this,"sceneGlobeClippingPlanes"]),new c.StringProperty([this,"sceneGlobeClippingPlanesId"]),new c.JsonProperty([this,"sceneGlobeClippingPolygons"]),new c.StringsProperty([this,"sceneGlobeClippingPolygonsId"]),new c.GroupProperty([],"underground","underground"),new c.ColorProperty([this,"sceneGlobeUndergroundColor"],"sceneGlobeUndergroundColor",i.sceneGlobeUndergroundColor,!0),new c.Number4Property([this,"sceneGlobeUndergroundColorAlphaByDistance"],"sceneGlobeUndergroundColorAlphaByDistance",i.sceneGlobeUndergroundColorAlphaByDistance,!0),new c.GroupProperty([],"Translucency","Translucency"),new c.Number4Property([this,"sceneGlobeTranslucencyBackFaceAlphaByDistance"],"背面渐变透明度",i.sceneGlobeTranslucencyBackFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyFrontFaceAlphaByDistance"],"正面渐变透明度",i.sceneGlobeTranslucencyFrontFaceAlphaByDistance,!0),new c.Number4Property([this,"sceneGlobeTranslucencyRectangle"],"矩形范围",i.sceneGlobeTranslucencyRectangle,!0),new c.GroupProperty([],"Sun","Sun"),new c.BooleanProperty([this,"sun"],"sun",i.sun,!0),new c.NumberProperty([this,"sceneSunGlowFactor"],"sceneSunGlowFactor",i.sceneSunGlowFactor,!0),new c.GroupProperty([],"Moon","Moon"),new c.BooleanProperty([this,"moon"],"moon",i.moon,!0),new c.StringProperty([this,"sceneMoonTextureUrl"],"sceneMoonTextureUrl",i.sceneMoonTextureUrl,!0),new c.BooleanProperty([this,"sceneMoonOnlySunLighting"],"sceneMoonOnlySunLighting",i.sceneMoonOnlySunLighting,!0),new c.GroupProperty([],"SkyBox","SkyBox"),new c.BooleanProperty([this,"sceneSkyBoxShow"]),new c.JsonProperty([this,"sceneSkyBoxSources"],"sceneSkyBoxSources",i.sceneSkyBoxSources,void 0,!0),new c.GroupProperty([],"Background","Background"),new c.BooleanProperty([this,"xbsjUseBackground"]),new c.StringProperty([this,"xbsjBackgroundImageUri"]),new c.ColorProperty([this,"xbsjBackgroundColor"]),new c.GroupProperty([],"SkyAtmosphere","SkyAtmosphere"),new c.JsonProperty([this,"xbsjLocalBoxSources"],"xbsjLocalBoxSources",i.xbsjLocalBoxSources,void 0,!0),new c.ColorProperty([this,"sceneBackgroundColor"]),new c.GroupProperty([],"Fog","Fog"),new c.BooleanProperty([this,"sceneFogEnabled"],"sceneFogEnabled",i.sceneFogEnabled,!0),new c.NumberProperty([this,"sceneFogDensity"],"sceneFogDensity",i.sceneFogDensity,!0),new c.NumberProperty([this,"sceneFogScreenSpaceErrorFactor"],"sceneFogScreenSpaceErrorFactor",i.sceneFogScreenSpaceErrorFactor,!0),new c.NumberProperty([this,"sceneFogMinimumBrightness"],"sceneFogMinimumBrightness",i.sceneFogMinimumBrightness,!0),new c.GroupProperty([],"Sscc","Sscc"),new c.BooleanProperty([this,"sceneSsccEnableInputs"],"sceneSsccEnableInputs",i.sceneSsccEnableInputs,!0),new c.BooleanProperty([this,"sceneSsccEnableCollisionDetection"],"sceneSsccEnableCollisionDetection",i.sceneSsccEnableCollisionDetection,!0),new c.NumberProperty([this,"sceneSsccZoomFactor"],"sceneSsccZoomFactor",i.sceneSsccZoomFactor,!0),new c.NumberProperty([this,"sceneCameraFrustumFov"],"相机广角"),new c.GroupProperty([],"后处理","后处理"),new c.BooleanProperty([this,"scenePpsfxaaEnabled"],"开启FXAA",i.scenePpsfxaaEnabled,!0),new c.GroupProperty([],"环境遮蔽","环境遮蔽"),new c.BooleanProperty([this,"scenePpsAmbientOcclusionEnabled"]),new c.BooleanProperty([this,"scenePpsAmbientOcclusionAmbientOcclusionOnly"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionIntensity"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBias"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionLengthCap"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionStepSize"]),new c.NumberProperty([this,"scenePpsAmbientOcclusionBlurStepSize"]),new c.GroupProperty([],"Bloom","Bloom"),new c.BooleanProperty([this,"scenePpsBloomEnabled"]),new c.BooleanProperty([this,"scenePpsBloomGlowOnly"]),new c.NumberProperty([this,"scenePpsBloomContrast"]),new c.NumberProperty([this,"scenePpsBloomBrightness"]),new c.NumberProperty([this,"scenePpsBloomDelta"]),new c.NumberProperty([this,"scenePpsBloomSigma"]),new c.NumberProperty([this,"scenePpsBloomStepSize"]),new c.GroupProperty([],"调试","调试"),new c.BooleanProperty([this,"sceneDebugShowFramesPerSecond"],"sceneDebugShowFramesPerSecond",i.sceneDebugShowFramesPerSecond,!0),new c.BooleanProperty([this,"sceneDebugShowCommands"],"sceneDebugShowCommands",i.sceneDebugShowCommands,!0),new c.BooleanProperty([this,"sceneDebugShowFrustums"],"sceneDebugShowFrustums",i.sceneDebugShowFrustums,!0),new c.BooleanProperty([this,"sceneDebugShowFrustumPlanes"],"sceneDebugShowFrustumPlanes",i.sceneDebugShowFrustumPlanes,!0),new c.NumberProperty([this,"sceneDebugShowDepthFrustum"],"sceneDebugShowDepthFrustum",i.sceneDebugShowDepthFrustum,!0),new c.GroupProperty([],"Inspector","Inspector"),new c.BooleanProperty([this,"showCesiumInspector"],"showCesiumInspector",i.showCesiumInspector,!0),new c.BooleanProperty([this,"cesiumInspectorWireframe"],"cesiumInspectorWireframe",i.cesiumInspectorWireframe,!0),new c.BooleanProperty([this,"showCesium3DTilesInspector"],"showCesium3DTilesInspector",i.showCesium3DTilesInspector,!0)]}}};L(Nt,"type",Nt.register("ESCesiumViewer",Nt)),L(Nt,"getCesiumIonToken",RH),L(Nt,"currentDefaultAccessToken",_.Ion.defaultAccessToken),L(Nt,"latestDefaultAccessToken"),L(Nt,"ObjectsToExcludeWrapper",vV),L(Nt,"defaults",{...c.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:_.buildModuleUrl("Assets/Textures/moonSmall.jpg"),sceneMoonOnlySunLighting:!0,sceneSkyBoxSources:{positiveX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_px.jpg"),negativeX:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_mx.jpg"),positiveY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_py.jpg"),negativeY:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_my.jpg"),positiveZ:_.buildModuleUrl("Assets/Textures/SkyBox/tycho2t3_80_pz.jpg"),negativeZ:_.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}),L(Nt,"getHeightsScartchCarto",new _.Cartographic);let ot=Nt;(t=>{t.createDefaultProps=()=>({...c.ESViewer.createDefaultProps(),...FH()})})(ot||(ot={})),c.extendClassProps(ot.prototype,ot.createDefaultProps),re.copyright=void 0;try{const t="earthsdk3-cesium",n="3.5.0-beta.16",e="2025-10-20T09:27:34.000Z",i="北京西部世界科技有限公司",o="地球可视化实验室 (EarthSDK&CesiumLab) https://www.bjxbsj.cn",r="68004f61674859e08549dce3fafcc248077970e5",s=((Date.now()-1760952454e3)/36e5).toFixed(1),l=`%c🌏 ${t}%c ${n}.${r.slice(0,8)}.${e} (距今${s}个小时)
4145
4146
  %c${o?o+`
4146
4147
  `:""}当前网站正在使用${t},此软件版权归${i}所有
4147
- `;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","d85e1020200203ea0aca1c05ac3f93f1f4e4574e")},get info(){return l},get date(){return"2025-10-15T08:26:43.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.14"},get name(){return"earthsdk3-cesium"},get commitId(){return"d85e1020200203ea0aca1c05ac3f93f1f4e4574e"},print(){console.info(this.info,`
4148
+ `;re.copyright=Object.freeze({get owner(){return"北京西部世界科技有限公司"},get ownerlink(){return OWNERLINK_},get gituri(){return GITURI_&&GITURI_.replace("${commitId}","68004f61674859e08549dce3fafcc248077970e5")},get info(){return l},get date(){return"2025-10-20T09:27:34.000Z"},get author(){return"suplyang"},get version(){return"3.5.0-beta.16"},get name(){return"earthsdk3-cesium"},get commitId(){return"68004f61674859e08549dce3fafcc248077970e5"},print(){console.info(this.info,`
4148
4149
  font-size: 18px;
4149
4150
  font-weight: 1000;
4150
4151
  line-height: 1;
@@ -4161,4 +4162,4 @@ async function initCesiumViewer(container, czmViewer) {
4161
4162
  color: rgb(0, 120, 215);
4162
4163
  padding-bottom: 2px;
4163
4164
  padding-left: 35px;
4164
- `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=re.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&re.copyright.print()}catch{}return bE(),re.BaseEditingWrapper=un,re.CircularAppendEditing=BS,re.CircularAppendEditingWrapper=vv,re.CircularInsertEditing=IS,re.CircularInsertEditingWrapper=wv,re.CurrentPositionsCenter=wp,re.CurrentScale=vp,re.CurrentSceneScalePoi=_0,re.CursorFloatDiv=UP,re.CursorInfo=OP,re.Czm3DTiles=$e,re.CzmCameraChanged=xh,re.CzmCanvasAndDivSwitchPoi=zP,re.CzmCanvasPoi=Op,re.CzmCircle=Mo,re.CzmCircleGroundPrimitive=Qr,re.CzmCircleOutlinePrimitive=Vr,re.CzmCirclePrimitive=kr,re.CzmClippingPlanes=aa,re.CzmClock=ze,re.CzmCustomPrimitive=at,re.CzmDivPoi=Lp,re.CzmES3DTileset=la,re.CzmESAlarm=Vm,re.CzmESApertureEffect=Nm,re.CzmESAreaMeasurement=Hm,re.CzmESBlastParticleSystem=Gm,re.CzmESBoxClipping=Wm,re.CzmESCameraView=jm,re.CzmESCameraVisibleRange=qm,re.CzmESCar=Km,re.CzmESCityBasePoint=$m,re.CzmESClassification=Xm,re.CzmESClippingPlane=zm,re.CzmESCustomPrimitive=Hg,re.CzmESCzml=Ym,re.CzmESDataMesh=Jm,re.CzmESDirectionMeasurement=eg,re.CzmESDistanceMeasurement=tg,re.CzmESDynamicWater=Gg,re.CzmESEntityCluster=Wg,re.CzmESExcavate=ng,re.CzmESFireParticleSystem=ig,re.CzmESGeHistoryImagery=jg,re.CzmESGeoBezierPath=og,re.CzmESGeoDiv=sg,re.CzmESGeoDivTextPoi=ag,re.CzmESGeoExtrudedPolygon=nv,re.CzmESGeoJson=lg,re.CzmESGeoLineString=fa,re.CzmESGeoPoints=cv,re.CzmESGeoPolygon=Un,re.CzmESGeoPolygonImpl=Ti,re.CzmESGeoRectangle=ug,re.CzmESGeoSmoothPolygon=cg,re.CzmESGeoVector=on,re.CzmESGeoWater=qg,re.CzmESGltfModel=hg,re.CzmESHeatMap=uv,re.CzmESHeightMeasurement=Ag,re.CzmESHuman=pg,re.CzmESHumanPoi=iv,re.CzmESImageLabel=dg,re.CzmESImageryLayer=mg,re.CzmESKml=Ig,re.CzmESLabel=Gl,re.CzmESLocalCircle=Fg,re.CzmESLocalLineString=Mg,re.CzmESLocalLineStringZ=Dg,re.CzmESLocalPolygon=Rg,re.CzmESLocalPolygonZ=Ug,re.CzmESLocalRectangle=Og,re.CzmESLocalSkyBox=gg,re.CzmESLocalVector=hf,re.CzmESLocationMeasurement=yg,re.CzmESMVTLayer=Kg,re.CzmESMsTileset=sv,re.CzmESNavigator=Lg,re.CzmESObjectWithLocation=He,re.CzmESParticleSystemPrimitive=vg,re.CzmESPath=zg,re.CzmESPipeFence=Zg,re.CzmESPipeline=$g,re.CzmESPipeserTileset=Yg,re.CzmESPit=iy,re.CzmESPoi2D=wg,re.CzmESPoi3D=bg,re.CzmESPolygonFence=kg,re.CzmESPolygonFlattenedPlane=Qm,re.CzmESPolygonWithHole=ry,re.CzmESRectangle=Qg,re.CzmESRoad=Vg,re.CzmESRtsFeatureEditing=ov,re.CzmESRtsTileset=rv,re.CzmESScale=Ng,re.CzmESSignalTransmission=py,re.CzmESSkylineAnalysis=lv,re.CzmESStaticMesh=av,re.CzmESSubmergingAnalysis=xg,re.CzmESSunshineAnalysis=qy,re.CzmESSurfaceAreaMeasurement=Xy,re.CzmESTerrainLayer=_g,re.CzmESTextLabel=Cg,re.CzmESUEWidget=Sg,re.CzmESUnrealActor=Eg,re.CzmESVideoFusion=Pg,re.CzmESViewShed=Bg,re.CzmESViewerStatusBar=Yy,re.CzmESViewerStatusBarScale=Jy,re.CzmESVisibilityAnalysis=ev,re.CzmESVisualObject=Nn,re.CzmESVolumeMeasurement=tv,re.CzmESWidget=Tg,re.CzmFlattenedPlane=Xr,re.CzmGlobeMaterial=Qo,re.CzmImageModel=$i,re.CzmImagery=Zr,re.CzmModelPrimitive=Ht,re.CzmParticleSystemPrimitive=wi,re.CzmPicking=b0,re.CzmPoint=Wn,re.CzmPointPrimitiveCollection=Ro,re.CzmPoisContext=U0,re.CzmPolygon=Cs,re.CzmPolygonClipping=pa,re.CzmPolygonGroundPrimitive=_s,re.CzmPolygonGroundPrimitiveWithHeight=Vs,re.CzmPolygonPrimitive=Sr,re.CzmPolygonPrimitiveWithHeight=Lr,re.CzmPolygonWithHeight=zr,re.CzmPolyline=Ye,re.CzmPolylineGroundPrimitive=Ps,re.CzmPolylinePrimitive=Bs,re.CzmPolylines=ai,re.CzmPolylinesGroundPrimitive=xs,re.CzmPolylinesPrimitive=Dn,re.CzmRectangle=Ci,re.CzmSignalTransmission=Yr,re.CzmTexture=ht,re.CzmView=bn,re.CzmViewDistanceRangeControl=fo,re.CzmWater=Do,re.CzmWaterPrimitive=Tl,re.DoublePointsAppendEditing=Ua,re.DoublePointsAppendEditingWrapper=gv,re.DoublePointsModifyEditing=rs,re.DoublePointsModifyEditingWrapper=yv,re.ESCesiumViewer=ot,re.ESCustomPrimitive=gf,re.ESGeHistoryImagery=pf,re.ESGeoBezierPath=wf,re.ESGeoSmoothPolygon=Kl,re.ESKml=df,re.ESLocalLineString=mf,re.ESLocalLineStringZ=ql,re.ESMVTLayer=ff,re.ESRoad=vf,re.ESSignalTransmission=yf,re.GeoCanvasImagePoi=yi,re.GeoCanvasMenuPoi=Ss,re.GeoCanvasPoi=Wi,re.GeoCanvasPointPoi=Er,re.GeoCustomDivPoi=wt,re.GeoDivSwitchPoi=So,re.GeoDivTextPoi=vi,re.GeoPolylinePath=da,re.HeightModifyEditing=DS,re.HeightModifyEditingWrapper=Pv,re.ImageLabel2D=Nx,re.ImageLabel3D=Hx,re.ImageriesManager=XS,re.LabelManager=$S,re.LineStringAppendEditing=PS,re.LineStringAppendEditingWrapper=bv,re.LineStringInsertEditing=TS,re.LineStringInsertEditingWrapper=xv,re.PickingManager=YS,re.PlaceEditing=Li,re.PlaceEditingWrapper=pv,re.PolylinePath=sa,re.ResourceHandler=bs,re.RotationEditing=pi,re.RotationEditingWrapper=dv,re.ScaleEditing=ur,re.ScaleEditingWrapper=mv,re.ScatterAppendEditing=FS,re.ScatterAppendEditingWrapper=_v,re.ScatterModifyEditing=MS,re.ScatterModifyEditingWrapper=Cv,re.SharedTexturePool=D0,re.SmoothMoving=x0,re.TerrainManager=ZS,re.TextLabel2D=Wx,re.TextLabel3D=jx,re.ToGCJ02WebMercatorTilingScheme=ax,re.ToWGS84WebMercatorTilingScheme=lx,re.TranslationEditing=lr,re.TranslationEditingWrapper=Gf,re.ViewerExtensions=JS,re.VisibilityAppendEditing=Oa,re.VisibilityAppendEditingWrapper=Sv,re.VisibilityModifyEditing=La,re.VisibilityModifyEditingWrapper=Ev,re.Widget2D=Pr,re.Widget3D=BA,re.WinPosFromCartesian=Ch,re.XbsjGroundPolylinePrimitive=Bi,re._ESEditModeInstance=Wf,re.angleToHumanStr=nl,re.areaToHumanStr=L2,re.bindNorthRotation=Mt,re.capture=P0,re.checkAndConvertImage=O2,re.computeCutPoint=xS,re.computeCzmModelMatrix=st,re.computePickingInfoWithCoordinates=ap,re.createClippingPlaneCollection=Ya,re.createClippingPolygonCollection=wh,re.createGeoBoudingSphereReactFromPositions=E0,re.createHelperLine=WE,re.createInfoPoi=Bp,re.createInnerClassFromJson=Cp,re.createInnerHtmlWithWhiteTextBlackBackground=xo,re.createMaterialFromJson=Jv,re.createMaterialRef=si,re.createMoveObjectsProcessing=RS,re.createPolygonHierarchy=Hi,re.createTexture=wo,re.createTextureFromImage=Rp,re.createTilingSchema=mi,re.czmFlyTo=rl,re.czmModelActiveAnimationsWithVisible=Bh,re.czmSubscribeAndEvaluate=gi,re.defaultFlyToRotation=Hn,re.distanceToHumanStr=Ih,re.extendComponentProps=z2,re.flyTo=Fe,re.flyWithPosition=Gn,re.flyWithPositions=Me,re.flyWithPrimitive=wn,re.fromCartesian=_E,re.fromCartesian2=Vv,re.fromCartesian3=$a,re.fromCartesian4=Nv,re.fromCartographic=Ao,re.fromColor=SE,re.fromDistanceDisplayCondition=BE,re.fromEllipsoid=OE,re.fromHeadingPitchRoll=PE,re.fromNearFarScalar=EE,re.fromQuaternion=IE,re.fromRectangle=RE,re.generateCartesianArc=A0,re.geoNeareastPointOnRhumbLine=po,re.geoNeareastPointOnRhumbLine2=jE,re.geoPolylineToBezierSpline=Tp,re.getCameraPosition=Fn,re.getCameraRotation=ms,re.getCameraTargetPos=jv,re.getCenterAndViewDistance=Ip,re.getCzmCode=M2,re.getDefaultComponentProps=k2,re.getDefaultWinPosAndDepth=e2,re.getDetailedTerrainDistance=I0,re.getDirectionVectorFromRotation=i0,re.getDistancesAndTimePosRotsFromPositions=mp,re.getElevationMatrix=BH,re.getEllipsoidGeodesicCenter=hp,re.getFlyToCenterAndRotation=Fh,re.getFoveatedInterpolationCallback=vx,re.getFuncFromStr=Sp,re.getGroundTerrainDistance=T0,re.getGroundTerrainDistances=B0,re.getIncludedAngleFromPositions=m0,re.getInverseModelMatrix=p0,re.getMinMaxPosition=S0,re.getModelMatrixFromPosition=gp,re.getObjectProperties=_o,re.getPointerEventButton=Gi,re.getPolygonPointsFromHierarchy=yp,re.getQuaternion=ip,re.getQuaternionWithXForwardZUp=Gv,re.getQuaternionWithYForwardZUp=bh,re.getResource=Mn,re.getSceneScaleForScreenPixelSize=Ni,re.getSharedTexturePool=R0,re.getTilingSchemeStr=v5,re.getViewerExtensions=Qn,re.getWinPos=n0,re.getXbsjWaterMaterial=y0,re.hackCesium3DTileset=gE,re.hackCzmModel3DTileContent=yE,re.hackModel=mE,re.hackModelSceneGraph=vE,re.imgUrlToBase64=Co,re.localPositionToPosition=xr,re.localPositionsToPositions=_r,re.merge3dTilesServer=S2,re.pickHeightPosition=_h,re.pickPosition=Xv,re.pickVirtualEarth=gs,re.pickVirtualPlane=Yv,re.positionAndRotationToQuaternion=DE,re.positionFromCartesian=Ue,re.positionToCartesian=ft,re.positionToHumanStr=Ep,re.positionToLocalPosition=d0,re.positionsToLocalPositions=vn,re.positionsToUniqueCartesians=$t,re.rectangleIsGlobal=_p,re.rpToap=Th,re.setClippingPlaneCollection=vh,re.setCylinderGeometry=Pp,re.setModelMaterial=tl,re.setRectangleGeometry=C0,re.setViewerExtensions=Rv,re.toCartesian=oi,re.toCartesian2=Ze,re.toCartesian3=ri,re.toCartesian4=np,re.toCartographic=CE,re.toCoefficients=xp,re.toColor=Be,re.toDistanceDisplayCondition=Xa,re.toEllipsoid=qe,re.toHeadingPitchRoll=Hv,re.toNearFarScalar=gr,re.toQuaternion=TE,re.toRectangle=mt,re.toRgbaString=Cr,re.updateEnvironmentMapManager=bp,re.updateMaterialFromJson=cp,re.winPosAndDepthEqual=t0,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"}),re}({},Cesium,EarthSDK3);
4165
+ `)}}),window.g_XE3CopyRights=window.g_XE3CopyRights||{},window.g_XE3CopyRights[t]=re.copyright,window.g_earthsdk_copyright_print=window.g_earthsdk_copyright_print??!0,window.g_earthsdk_copyright_print&&re.copyright.print()}catch{}return bE(),re.BaseEditingWrapper=un,re.CircularAppendEditing=BS,re.CircularAppendEditingWrapper=vv,re.CircularInsertEditing=IS,re.CircularInsertEditingWrapper=wv,re.CurrentPositionsCenter=wp,re.CurrentScale=vp,re.CurrentSceneScalePoi=_0,re.CursorFloatDiv=UP,re.CursorInfo=OP,re.Czm3DTiles=$e,re.CzmCameraChanged=xh,re.CzmCanvasAndDivSwitchPoi=zP,re.CzmCanvasPoi=Op,re.CzmCircle=Mo,re.CzmCircleGroundPrimitive=Qr,re.CzmCircleOutlinePrimitive=Vr,re.CzmCirclePrimitive=kr,re.CzmClippingPlanes=aa,re.CzmClock=ze,re.CzmCustomPrimitive=at,re.CzmDivPoi=Lp,re.CzmES3DTileset=la,re.CzmESAlarm=Vm,re.CzmESApertureEffect=Nm,re.CzmESAreaMeasurement=Hm,re.CzmESBlastParticleSystem=Gm,re.CzmESBoxClipping=Wm,re.CzmESCameraView=jm,re.CzmESCameraVisibleRange=qm,re.CzmESCar=Km,re.CzmESCityBasePoint=$m,re.CzmESClassification=Xm,re.CzmESClippingPlane=zm,re.CzmESCustomPrimitive=Hg,re.CzmESCzml=Ym,re.CzmESDataMesh=Jm,re.CzmESDirectionMeasurement=eg,re.CzmESDistanceMeasurement=tg,re.CzmESDynamicWater=Gg,re.CzmESEntityCluster=Wg,re.CzmESExcavate=ng,re.CzmESFireParticleSystem=ig,re.CzmESGeHistoryImagery=jg,re.CzmESGeoBezierPath=og,re.CzmESGeoDiv=sg,re.CzmESGeoDivTextPoi=ag,re.CzmESGeoExtrudedPolygon=nv,re.CzmESGeoJson=lg,re.CzmESGeoLineString=fa,re.CzmESGeoPoints=cv,re.CzmESGeoPolygon=Un,re.CzmESGeoPolygonImpl=Ti,re.CzmESGeoRectangle=ug,re.CzmESGeoSmoothPolygon=cg,re.CzmESGeoVector=on,re.CzmESGeoWater=qg,re.CzmESGltfModel=hg,re.CzmESHeatMap=uv,re.CzmESHeightMeasurement=Ag,re.CzmESHuman=pg,re.CzmESHumanPoi=iv,re.CzmESImageLabel=dg,re.CzmESImageryLayer=mg,re.CzmESKml=Ig,re.CzmESLabel=Gl,re.CzmESLocalCircle=Fg,re.CzmESLocalLineString=Mg,re.CzmESLocalLineStringZ=Dg,re.CzmESLocalPolygon=Rg,re.CzmESLocalPolygonZ=Ug,re.CzmESLocalRectangle=Og,re.CzmESLocalSkyBox=gg,re.CzmESLocalVector=hf,re.CzmESLocationMeasurement=yg,re.CzmESMVTLayer=Kg,re.CzmESMsTileset=sv,re.CzmESNavigator=Lg,re.CzmESObjectWithLocation=He,re.CzmESParticleSystemPrimitive=vg,re.CzmESPath=zg,re.CzmESPipeFence=Zg,re.CzmESPipeline=$g,re.CzmESPipeserTileset=Yg,re.CzmESPit=iy,re.CzmESPoi2D=wg,re.CzmESPoi3D=bg,re.CzmESPolygonFence=kg,re.CzmESPolygonFlattenedPlane=Qm,re.CzmESPolygonWithHole=ry,re.CzmESRectangle=Qg,re.CzmESRoad=Vg,re.CzmESRtsFeatureEditing=ov,re.CzmESRtsTileset=rv,re.CzmESScale=Ng,re.CzmESSignalTransmission=py,re.CzmESSkylineAnalysis=lv,re.CzmESStaticMesh=av,re.CzmESSubmergingAnalysis=xg,re.CzmESSunshineAnalysis=qy,re.CzmESSurfaceAreaMeasurement=Xy,re.CzmESTerrainLayer=_g,re.CzmESTextLabel=Cg,re.CzmESUEWidget=Sg,re.CzmESUnrealActor=Eg,re.CzmESVideoFusion=Pg,re.CzmESViewShed=Bg,re.CzmESViewerStatusBar=Yy,re.CzmESViewerStatusBarScale=Jy,re.CzmESVisibilityAnalysis=ev,re.CzmESVisualObject=Nn,re.CzmESVolumeMeasurement=tv,re.CzmESWidget=Tg,re.CzmFlattenedPlane=Xr,re.CzmGlobeMaterial=Qo,re.CzmImageModel=$i,re.CzmImagery=Zr,re.CzmModelPrimitive=Ht,re.CzmParticleSystemPrimitive=wi,re.CzmPicking=b0,re.CzmPoint=Wn,re.CzmPointPrimitiveCollection=Ro,re.CzmPoisContext=U0,re.CzmPolygon=Cs,re.CzmPolygonClipping=pa,re.CzmPolygonGroundPrimitive=_s,re.CzmPolygonGroundPrimitiveWithHeight=Vs,re.CzmPolygonPrimitive=Sr,re.CzmPolygonPrimitiveWithHeight=Lr,re.CzmPolygonWithHeight=zr,re.CzmPolyline=Ye,re.CzmPolylineGroundPrimitive=Ps,re.CzmPolylinePrimitive=Bs,re.CzmPolylines=ai,re.CzmPolylinesGroundPrimitive=xs,re.CzmPolylinesPrimitive=Dn,re.CzmRectangle=Ci,re.CzmSignalTransmission=Yr,re.CzmTexture=ht,re.CzmView=bn,re.CzmViewDistanceRangeControl=fo,re.CzmWater=Do,re.CzmWaterPrimitive=Tl,re.DoublePointsAppendEditing=Ua,re.DoublePointsAppendEditingWrapper=gv,re.DoublePointsModifyEditing=rs,re.DoublePointsModifyEditingWrapper=yv,re.ESCesiumViewer=ot,re.ESCustomPrimitive=gf,re.ESGeHistoryImagery=pf,re.ESGeoBezierPath=wf,re.ESGeoSmoothPolygon=Kl,re.ESKml=df,re.ESLocalLineString=mf,re.ESLocalLineStringZ=ql,re.ESMVTLayer=ff,re.ESRoad=vf,re.ESSignalTransmission=yf,re.GeoCanvasImagePoi=yi,re.GeoCanvasMenuPoi=Ss,re.GeoCanvasPoi=Wi,re.GeoCanvasPointPoi=Er,re.GeoCustomDivPoi=wt,re.GeoDivSwitchPoi=So,re.GeoDivTextPoi=vi,re.GeoPolylinePath=da,re.HeightModifyEditing=DS,re.HeightModifyEditingWrapper=Pv,re.ImageLabel2D=Nx,re.ImageLabel3D=Hx,re.ImageriesManager=XS,re.LabelManager=$S,re.LineStringAppendEditing=PS,re.LineStringAppendEditingWrapper=bv,re.LineStringInsertEditing=TS,re.LineStringInsertEditingWrapper=xv,re.PickingManager=YS,re.PlaceEditing=Li,re.PlaceEditingWrapper=pv,re.PolylinePath=sa,re.ResourceHandler=bs,re.RotationEditing=pi,re.RotationEditingWrapper=dv,re.ScaleEditing=ur,re.ScaleEditingWrapper=mv,re.ScatterAppendEditing=FS,re.ScatterAppendEditingWrapper=_v,re.ScatterModifyEditing=MS,re.ScatterModifyEditingWrapper=Cv,re.SharedTexturePool=D0,re.SmoothMoving=x0,re.TerrainManager=ZS,re.TextLabel2D=Wx,re.TextLabel3D=jx,re.ToGCJ02WebMercatorTilingScheme=ax,re.ToWGS84WebMercatorTilingScheme=lx,re.TranslationEditing=lr,re.TranslationEditingWrapper=Gf,re.ViewerExtensions=JS,re.VisibilityAppendEditing=Oa,re.VisibilityAppendEditingWrapper=Sv,re.VisibilityModifyEditing=La,re.VisibilityModifyEditingWrapper=Ev,re.Widget2D=Pr,re.Widget3D=BA,re.WinPosFromCartesian=Ch,re.XbsjGroundPolylinePrimitive=Bi,re._ESEditModeInstance=Wf,re.angleToHumanStr=nl,re.areaToHumanStr=L2,re.bindNorthRotation=Mt,re.capture=P0,re.checkAndConvertImage=O2,re.computeCutPoint=xS,re.computeCzmModelMatrix=st,re.computePickingInfoWithCoordinates=ap,re.createClippingPlaneCollection=Ya,re.createClippingPolygonCollection=wh,re.createGeoBoudingSphereReactFromPositions=E0,re.createHelperLine=WE,re.createInfoPoi=Bp,re.createInnerClassFromJson=Cp,re.createInnerHtmlWithWhiteTextBlackBackground=xo,re.createMaterialFromJson=Jv,re.createMaterialRef=si,re.createMoveObjectsProcessing=RS,re.createPolygonHierarchy=Hi,re.createTexture=wo,re.createTextureFromImage=Rp,re.createTilingSchema=mi,re.czmFlyTo=rl,re.czmModelActiveAnimationsWithVisible=Bh,re.czmSubscribeAndEvaluate=gi,re.defaultFlyToRotation=Hn,re.distanceToHumanStr=Ih,re.extendComponentProps=z2,re.flyTo=Fe,re.flyWithPosition=Gn,re.flyWithPositions=Me,re.flyWithPrimitive=wn,re.fromCartesian=_E,re.fromCartesian2=Vv,re.fromCartesian3=$a,re.fromCartesian4=Nv,re.fromCartographic=Ao,re.fromColor=SE,re.fromDistanceDisplayCondition=BE,re.fromEllipsoid=OE,re.fromHeadingPitchRoll=PE,re.fromNearFarScalar=EE,re.fromQuaternion=IE,re.fromRectangle=RE,re.generateCartesianArc=A0,re.geoNeareastPointOnRhumbLine=po,re.geoNeareastPointOnRhumbLine2=jE,re.geoPolylineToBezierSpline=Tp,re.getCameraPosition=Fn,re.getCameraRotation=ms,re.getCameraTargetPos=jv,re.getCenterAndViewDistance=Ip,re.getCzmCode=M2,re.getDefaultComponentProps=k2,re.getDefaultWinPosAndDepth=e2,re.getDetailedTerrainDistance=I0,re.getDirectionVectorFromRotation=i0,re.getDistancesAndTimePosRotsFromPositions=mp,re.getElevationMatrix=TH,re.getEllipsoidGeodesicCenter=hp,re.getFlyToCenterAndRotation=Fh,re.getFoveatedInterpolationCallback=vx,re.getFuncFromStr=Sp,re.getGroundTerrainDistance=T0,re.getGroundTerrainDistances=B0,re.getIncludedAngleFromPositions=m0,re.getInverseModelMatrix=p0,re.getMinMaxPosition=S0,re.getModelMatrixFromPosition=gp,re.getObjectProperties=_o,re.getPointerEventButton=Gi,re.getPolygonPointsFromHierarchy=yp,re.getQuaternion=ip,re.getQuaternionWithXForwardZUp=Gv,re.getQuaternionWithYForwardZUp=bh,re.getResource=Mn,re.getSceneScaleForScreenPixelSize=Ni,re.getSharedTexturePool=R0,re.getTilingSchemeStr=v5,re.getViewerExtensions=Qn,re.getWinPos=n0,re.getXbsjWaterMaterial=y0,re.hackCesium3DTileset=gE,re.hackCzmModel3DTileContent=yE,re.hackModel=mE,re.hackModelSceneGraph=vE,re.imgUrlToBase64=Co,re.localPositionToPosition=xr,re.localPositionsToPositions=_r,re.merge3dTilesServer=S2,re.pickHeightPosition=_h,re.pickPosition=Xv,re.pickVirtualEarth=gs,re.pickVirtualPlane=Yv,re.positionAndRotationToQuaternion=DE,re.positionFromCartesian=Ue,re.positionToCartesian=ft,re.positionToHumanStr=Ep,re.positionToLocalPosition=d0,re.positionsToLocalPositions=vn,re.positionsToUniqueCartesians=$t,re.rectangleIsGlobal=_p,re.rpToap=Th,re.setClippingPlaneCollection=vh,re.setCylinderGeometry=Pp,re.setModelMaterial=tl,re.setRectangleGeometry=C0,re.setViewerExtensions=Rv,re.toCartesian=oi,re.toCartesian2=Ze,re.toCartesian3=ri,re.toCartesian4=np,re.toCartographic=CE,re.toCoefficients=xp,re.toColor=Be,re.toDistanceDisplayCondition=Xa,re.toEllipsoid=qe,re.toHeadingPitchRoll=Hv,re.toNearFarScalar=gr,re.toQuaternion=TE,re.toRectangle=mt,re.toRgbaString=Cr,re.updateEnvironmentMapManager=bp,re.updateMaterialFromJson=cp,re.winPosAndDepthEqual=t0,Object.defineProperty(re,Symbol.toStringTag,{value:"Module"}),re}({},Cesium,EarthSDK3);