月球大数据地理空间分析展示平台-【前端】-月球2期前端
Surpriseplus
2023-07-13 f6dd93cb0d1b0fe17674e948f0daf6ceb792bb55
public/CIMSDK/CimSDK.min.js
@@ -16748,7 +16748,7 @@
                }
                material.alpha = u_alpha;
            }
            `})};c8.prototype.destroy=function(){this._tileset.customShader===this._customShader&&(this._customShader=void 0,this._tileset.customShader=void 0),this._scene.preUpdate.removeEventListener(this._preUpdate)};function iRi(){this.customShaders={},this.customShaders.lightLine=c8}var wlt=iRi;function GH(o,A){this.options=Ae(A,{}),this.earthCtrl=o,this.viewer=o.coreMap,this.CSME=mme,this.Cust=new this.CSME.CustomShaderStage(this.options.primitive,A),this.stageArr=[],this.eventListener=null,this.eventListener=this.viewer.scene.preUpdate.addEventListener(()=>{this.Cust.update()}),this.create()}GH.prototype.create=function(o){let A=this,f=null;o?f=o:f=A.options,f.lineMaterialStage&&(A.LineMaterialStage=new A.CSME.LineMaterialStage(Ae(f.lineMaterialStage,{weight:.5})),A.Cust.addStage(A.LineMaterialStage),A.stageArr.push(A.LineMaterialStage)),f.gradientMaterialStage&&(A.GradientMaterialStage=new A.CSME.GradientMaterialStage(Ae(f.gradientMaterialStage,{weight:.5})),A.Cust.addStage(A.GradientMaterialStage),A.stageArr.push(A.GradientMaterialStage)),f.normalizeMaterialStage&&(A.NormalizeMaterialStage=new A.CSME.NormalizeMaterialStage(Ae(f.normalizeMaterialStage,{weight:.5})),A.Cust.addStage(A.NormalizeMaterialStage),A.stageArr.push(A.NormalizeMaterialStage)),f.dynamicColorMaterialStage&&(A.DynamicColorMaterialStage=new A.CSME.DynamicColorMaterialStage(Ae(f.dynamicColorMaterialStage,{weight:.5})),A.Cust.addStage(A.DynamicColorMaterialStage),A.stageArr.push(A.DynamicColorMaterialStage)),f.reflectMaterialStage&&(A.ReflectMaterialStage=new A.CSME.ReflectMaterialStage(Ae(f.reflectMaterialStage,{weight:.5})),A.Cust.addStage(A.ReflectMaterialStage),A.stageArr.push(A.ReflectMaterialStage)),f.textureMaterialStage&&(A.TextureMaterialStage=new A.CSME.TextureMaterialStage(Ae(f.textureMaterialStage,{weight:.5,url:`${globalThis.GEOWORLD_BASE_URL}Assets/Textures/window.png`})),A.Cust.addStage(A.TextureMaterialStage),A.stageArr.push(A.TextureMaterialStage))};GH.prototype.addStage=function(o){let A=this;A.Cust.addStage(o),A.stageArr.push(o)};GH.prototype.removeStage=function(o){this.Cust.removeStage(o.name)};GH.prototype.update=function(){let o=this;o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=o.viewer.scene.preUpdate.addEventListener(()=>{o.Cust.update()})};GH.prototype.removeFromMap=function(){let o=this;for(let A=0;A<o.stageArr.length;A++)o.removeStage(o.stageArr[A]);o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=null};var blt=GH;function Qoe(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._options.visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#101010")),this._options.outlineWidth=Ae(A.outlineWidth,1),this._options.thresholdAngle=Ae(A.thresholdAngle,12*Math.PI/180),this.add()}Qoe.prototype.add=function(){this._edgeStage=aY();let o=this._edgeStage;o.visibleEdgeColor=this._options.visibleEdgeColor,o.outlineWidth=this._options.outlineWidth,o.thresholdAngle=this._options.thresholdAngle,o.selected=[{},{}],o.enabled=!0,this._earthCtrl.Viewer.postProcessStages.add(o)};Qoe.prototype.removeFromMap=function(){this._edgeStage&&(this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage),this.__edgeStage=null)};Object.defineProperties(Qoe.prototype,{show:{get:function(){return this._edgeStage.show},set:function(o){this._edgeStage.show=o}},outlineWidth:{get:function(){return this._edgeStage.outlineWidth},set:function(o){this._edgeStage.outlineWidth=o}},thresholdAngle:{get:function(){return this._edgeStage.thresholdAngle},set:function(o){!o||(this._edgeStage.thresholdAngle=o)}},visibleEdgeColor:{get:function(){return this._edgeStage.visibleEdgeColor},set:function(o){!o||(this._edgeStage.visibleEdgeColor=o)}},hiddenEdgeColor:{get:function(){return this._edgeStage.hiddenEdgeColor},set:function(o){!o||(this._edgeStage.hiddenEdgeColor=o)}},showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Qlt=Qoe;function Soe(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#ff0000")),this._hiddenEdgeColor=Ae(A.hiddenEdgeColor,ht.fromCssColorString("#4d4d4d")),this.handler=null,this.key=Ae(A.key,"id"),this.model=Ae(A.model,null),this.add()}Soe.prototype.add=function(){let o=this,A="";this._edgeStage=aY(!0);let f=this._edgeStage;f.visibleEdgeColor=this._visibleEdgeColor,f.hiddenEdgeColor=this._hiddenEdgeColor,f.selected=[],f.enabled=!1,this._earthCtrl.Viewer.postProcessStages.add(f);function m(C,y){function x(E,I){let w=E.featuresLength;for(let Q=0;Q<w;++Q){let M=E.getFeature(Q);if(M.getProperty(o.key)===A){let T={pickId:M.pickId};y.selected=[T],y.enabled=!0}}}function v(E,I){let w=E.content,Q=w.innerContents;if(O(Q)){let M=Q.length;for(let B=0;B<M;++B)x(Q[B],I)}else x(w,I)}C.tileVisible.addEventListener(function(E){A!==""&&v(E,null)})}m(this.model,f),this.handler=new zr(this._earthCtrl.coreMap.scene.canvas),this.handler.setInputAction(function(C){let y=o._earthCtrl.coreMap.scene.pick(C.position);if(f.selected=[],A="",!y||!y.primitive)return;let v=y.primitive._pickIds,I={pickId:y.pickId};f.selected=[I],f.enabled=!0,A=y.getProperty(o.key)},Yi.LEFT_CLICK)};Soe.prototype.removeFromMap=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._edgeStage&&this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage)};Object.defineProperties(Soe.prototype,{showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Slt=Soe;function Hs(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Sx(){return((1+qe.nextRandomNumber())*65536|0).toString(16).substring(1)}Hs.createUUID=function(){return`${Sx()+Sx()}-${Sx()}-${Sx()}-${Sx()}-${Sx()}${Sx()}${Sx()}`};Hs.createUUIDWithoutDash=function(){return Sx()+Sx()+Sx()+Sx()+Sx()+Sx()+Sx()+Sx()};Hs.prototype.createUUID=function(){return Hs.createUUID()};Hs.prototype.createGroup=function(o){let A=new s8;return A.id=o.id||Hs.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};Hs.prototype.createImageryLayer=function(o,A){let f=new foe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.IMAGERYPROVIDERS),f),f};Hs.prototype.createTerrainLayer=function(o,A){let f=new poe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.TERRAINPROVIDERS),f),f};Hs.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new VF({})};Hs.prototype.createFeatureLayer=function(o,A){let f=new xoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.FEATURELAYERS),f),f};Hs.prototype.createModelLayer=function(o,A){let f=new Coe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.MODELLAYERS),f),f};Hs.prototype.createWfsModel=function(o,A){let f=new yK(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.MODELLAYERS),f),f};Hs.prototype.createModel=function(o,A){let f=new Yne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.removeModel=function(o){O(o)&&o.removeFromMap()};Hs.prototype.createCZMLObject=function(o,A){let f=this,m=Ae(o.addToMap,!0),C=new Nie(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),C),C};Hs.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,O(o.name)&&(A.name=o.name),O(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};Hs.prototype.removeElement=function(o){O(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};Hs.prototype.createVideoProjection=function(o,A){o.addToMap=Ae(o.addToMap,!0);let f=Ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new Dne(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),m)):f==="panorama"?(m=new alt(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),m)):f==="fisheye"&&(m=new Tne(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),m)),m};Hs.prototype.createTrack=function(o,A){let f=new slt(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createSceneNode=function(o,A,f){let m=new s8(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};Hs.prototype.createFire=function(o,A){let f=new Rne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createSmoke=function(o,A){let f=new Fne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createExplosion=function(o,A){let f=new kne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createFireworks=function(o,A){let f=new Une(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createRadarScan=function(o,A){let f=new Hne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createCircleScan=function(o,A){let f=new plt(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createUpDownScan=function(o){let A=new Clt(this._earthCtrl,o);return A.show=!0,A};Hs.prototype.createWaters=function(o,A){let f=new _oe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createHeatmap=function(o,A){let f=Alt.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createLabel=function(o,A){let f=new Wne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createBillboard=function(o,A){let f=new zne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPolyline=function(o,A){let f=new qne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPolygon=function(o,A){let f=new Zne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPoint=function(o,A){let f=new eoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createBox=function(o,A){let f=new ioe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createEllipsoid=function(o,A){let f=new aoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createCylinder=function(o,A){let f=new noe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createRectangle=function(o,A){let f=new loe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createEllipse=function(o,A){let f=new coe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPolylineVolume=function(o,A){let f=new hoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createEChartLayer=function(o,A){let f=new Eoe(this._earthCtrl);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPointLight=function(o){return new xlt(this._earthCtrl,o)};Hs.prototype.createHawkeye=function(o){let A=new Boe(this._earthCtrl,o);A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&A.addToMap(o)};Hs.prototype.createSpotLight=function(o){let A=new boe(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderManager=function(o){let A=new wlt;return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderStage=function(o){let A=new blt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createModelOutline=function(o={}){let A=new Qlt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.modelClick=function(o={}){let A=new Slt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};var i2=Hs;var Doe=class extends n0{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new Sne(A);let m=new s8(A);m.id=i2.createUUID(),m.name=Ae(f.ProjectName,"root"),m.version=Ae(f.version,null),m.desc=Ae(f.desc,null),m.createTime=Ae(f.createTime,new Date().toISOString()),m.lastUpdate=Ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new eN("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];O(f)&&this.removeChild(f)}removeChild(A){O(A)&&O(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){O(A)&&O(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);O(m)&&O(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let y=0;y<m.parentNode.childNodes.length;y++)m.parentNode.childNodes[y].id===m.id&&(C=y);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=qe.clamp(f,0,A.length-1),m=qe.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,y){let x={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},v=0,E=[];for(let I in x){let w=x[I],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let T=Q.childNodes[B].toJSON();M.push(T)}Promise.all(M).then(function(B){let T=[];if(B.length!==0){for(let L=0;L<B.length;L++)T.push(B[L]);let D=T[0].class;D!=="IMAGERY_LAYER"&&D!=="TERRAIN_LAYER"&&D!=="MODEL_LAYER"&&D!=="FEATURE_LAYER"&&(D="USER_SCENE");let F={item:D,objJson:T};E.push(F)}v++,v===5&&(C(E),v=0)})}}).then(function(C){let y={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(y.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(y.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(y.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(y.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(y.userScene=C[w].objJson);let x={class:"ENVIRONMENT",underGround:Ae(f._earthCtrl.camera.undergroundMode,null),shadow:Ae(f._earthCtrl.shadows,null),depthTest:Ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:Ae(f._earthCtrl.environment.rain.show,null),snow:Ae(f._earthCtrl.environment.snow.show,null),fog:Ae(f._earthCtrl.environment.fog.show,null),bwMode:Ae(f._earthCtrl.environment.bwMode.show,null),nightMode:Ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:Ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:Ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:Ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:Ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},v={class:"SKYBOX",positiveX:Ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:Ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:Ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:Ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:Ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:Ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},E={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};y.userScene.push(x),y.userScene.push(v),y.userScene.push(E);let I=JSON.stringify(y);A&&A(I)})}};Object.defineProperties(Doe.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var Toe=Doe;function Dlt(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var S6i=new Es,D6i=new te,T6i=new te;Dlt.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let y=document.createElement("div");y.style=f,o.appendChild(y);let x=A.scene.canvas,v=A.scene.globe.ellipsoid;new zr(x).setInputAction(function(I){let w=A.camera.pickEllipsoid(I.endPosition,v);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=qe.toDegrees(Q.latitude).toFixed(6),B=qe.toDegrees(Q.longitude).toFixed(6),T=A.camera.positionCartographic.height.toFixed(1);y.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${T}\u7C73`}},Yi.MOUSE_MOVE)};var Tlt=Dlt;function cu(){}cu.parseBaseData=function(o,A){let f=[];if(O(A)&&O(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let y=A.imageryProviders[C];if(y.enable===!1||y.show===!1)continue;if(O(y.tilingScheme)){let v=y.tilingScheme;v.type==="GeographicTilingScheme"&&(y.tilingScheme=new mg(v))}let x=i2.createImageryLayer(y);f.push(x)}let m=[];if(O(A)&&O(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let y=A.terrainProviders[C];if(y.enable===!1||y.show===!1)continue;let x=i2.createTerrainLayer(y);m.push(x)}return{imageryProvider:f,terrainProvider:m}};cu.parse=function(o,A){if(!O(A))return;let f=[Zs.IMAGERYPROVIDERS,Zs.TERRAINPROVIDERS,Zs.MODELLAYERS,Zs.FEATURELAYERS,Zs.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(i2.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}O(A[Zs.IMAGERYPROVIDERS])&&HH(o,A[Zs.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),O(A[Zs.TERRAINPROVIDERS])&&HH(o,A[Zs.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),O(A[Zs.MODELLAYERS])&&HH(o,A[Zs.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),O(A[Zs.FEATURELAYERS])&&HH(o,A[Zs.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),O(A[Zs.USERSCENE])&&HH(o,A[Zs.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function HH(o,A,f,m){for(let C=0;C<A.length;C++){let y=A[C],x=null;if(y.enable===!1)continue;O(y.class)?(y.class==="IMAGERY"&&(y.class=vo.IMAGERY_LAYER),y.class==="TERRAIN"&&(y.class=vo.TERRAIN_LAYER),x=y.class):(m===0?y.class=vo.IMAGERY_LAYER:m===1&&(y.class=vo.TERRAIN_LAYER),x=y.class);let v=cu.parserMap[x];v!==void 0&&v(o,y,f)}}function rRi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=Ae(A.show,!0),o.userScene.addChild(f,m),O(A.childNodes)&&HH(o,A.childNodes,m)}function nRi(o,A,f){let m=A;if(O(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new mg(C))}o.factory.createImageryLayer(m,f)}function oRi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function aRi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function sRi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function lRi(o,A,f){o.coreMap.scene.skyBox=new J5({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function uRi(o,A,f){o.camera.undergroundMode=Ae(A.underGround,!1),o.shadows=Ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=Ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function cRi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function ARi(o,A,f){o.factory.createModel(A,f)}function hRi(o,A,f){o.factory.createWaters(A,f)}function dRi(o,A,f){o.factory.createExplosion(A,f)}function fRi(o,A,f){o.factory.createFireworks(A,f)}function gRi(o,A,f){o.factory.createSmoke(A,f)}function pRi(o,A,f){o.factory.createFire(A,f)}function mRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function CRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function yRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function xRi(o,A,f){A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function vRi(o,A,f){o.factory.createBillboard(A,f)}function ERi(o,A,f){A.positions&&(A.positions=cu.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new ht(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function IRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=cu.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function _Ri(o,A,f){A.coordinates&&(A.coordinates=Di.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function BRi(o,A,f){o.factory.createEllipse(A,f)}function wRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new te(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function bRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new te(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function QRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function SRi(o,A,f){o.factory.createPolylineVolume(A,f)}function DRi(o,A,f){o.factory.createVideoProjection(A,f)}function TRi(o,A,f){o.factory.createVideoProjection(A,f)}function MRi(o,A,f){o.factory.createTrack(A,f)}function PRi(o,A,f){o.factory.createHeatmap(A,f)}function RRi(o,A,f){o.factory.createEChartLayer(A,f)}function LRi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}cu.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=te.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};cu.parserMap={};cu.parserMap[vo.NODE]=rRi;cu.parserMap[vo.IMAGERY_LAYER]=nRi;cu.parserMap[vo.TERRAIN_LAYER]=oRi;cu.parserMap[vo.MODEL_LAYER]=aRi;cu.parserMap[vo.FEATURE_LAYER]=sRi;cu.parserMap[vo.SKYBOX]=lRi;cu.parserMap[vo.ENVIRONMENT]=uRi;cu.parserMap[vo.VIEWPOINT]=cRi;cu.parserMap[vo.MODEL]=ARi;cu.parserMap[vo.WATERS]=hRi;cu.parserMap[vo.EXPLOSION]=dRi;cu.parserMap[vo.FIREWORK]=fRi;cu.parserMap[vo.SMOKE]=gRi;cu.parserMap[vo.FIRE]=pRi;cu.parserMap[vo.RADARSCAN]=mRi;cu.parserMap[vo.CIRCLESCAN]=CRi;cu.parserMap[vo.POINT]=yRi;cu.parserMap[vo.LABEL]=xRi;cu.parserMap[vo.BILLBOARD]=vRi;cu.parserMap[vo.POLYLINE]=ERi;cu.parserMap[vo.POLYGON]=IRi;cu.parserMap[vo.RECTANGLE]=_Ri;cu.parserMap[vo.ELLIPSE]=BRi;cu.parserMap[vo.BOX]=wRi;cu.parserMap[vo.ELLIPSOID]=bRi;cu.parserMap[vo.CYLINDER]=QRi;cu.parserMap[vo.POLYLINEVOLUME]=SRi;cu.parserMap[vo.PERSPECTIVE_VIDEO_PROJECTION]=DRi;cu.parserMap[vo.FISHEYE_VIDEO_PROJECTION]=TRi;cu.parserMap[vo.TRACK]=MRi;cu.parserMap[vo.HEATMAP]=PRi;cu.parserMap[vo.ECHARTLAYER]=RRi;cu.parserMap.ELEMENT=LRi;var Mlt=cu;var pIe=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,O(this.editBillboard)&&O(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(O(A)&&O(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:O(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},Plt=pIe;var mIe=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,O(this.editPoint)&&O(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(O(A)&&O(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:O(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},Rlt=mIe;var CIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,O(this.editBox)&&O(this.editBox.entity.box)){let y=this.editBox.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te;this.getNorthPointByDistance(v,E),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:v,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:E,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),O(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let y=Kn.eastNorthUpToFixedFrame(C),x=new te,v=this.editBox.entity.box.dimensions._value;v||(v=this.editBox.entity.box.dimensions.getValue(m)),te.divideByScalar(v,2,x),te.clone(x,A),te.clone(x,f),A.y*=-1,Ze.multiplyByPoint(y,A,A),f.y*=-1,f.z*=-1,Ze.multiplyByPoint(y,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=gi.fromDate(f);if(O(this.currentPoint)||O(this.pickEditHeightPoint)||O(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,y=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!y)return;let x=$t.fromCartesian(y),v=te.fromRadians(x.longitude,x.latitude,x.height+this.height);if(O(this.currentPoint))this.currentPoint.position=v,this.editBox.entity.position=new Qn(function(){return v},!1);else if(O(this.dragPosition)){if(O(this.pickEditWHPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=te.normalize(w,new te);te.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=te.clone(M);B.x-=w.x,B.y+=w.y,te.abs(B,B),this.editBox.entity.box.dimensions=new Qn(function(){return B},!1)}else if(O(this.pickEditHeightPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=te.clone(Q);M.z+=w.z,te.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=y;let E=new te,I=new te;this.getNorthPointByDistance(E,I,m),this.editHeightPoint.position=E,this.editWHPoint.position=I}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(O(A)&&O(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:O(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Llt=CIe;var yIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,O(this.editCylinder)&&O(this.editCylinder.entity.cylinder)){let y=this.editCylinder.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value,I=new te,w=new te,Q=new te;this.getNorthPointByDistance(I,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),v>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:I,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),E>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,y=Kn.eastNorthUpToFixedFrame(C),x=this.editCylinder.entity.cylinder.length._value,v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value;v>0&&(A.z+=x/2,A.x+=v,Ze.multiplyByPoint(y,A,A)),E>0&&(f.x+=E,f.z-=x/2,Ze.multiplyByPoint(y,f,f)),m.z+=x/2,Ze.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.heightPoint)||O(this.topRadiusPoint)||O(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editCylinder.entity.position=y;else if(O(this.dragPosition)){if(O(this.pickHeightPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(O(this.pickTopRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(O(this.pickBottomRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let x=this.editCylinder.entity.cylinder.topRadius._value,v=this.editCylinder.entity.cylinder.bottomRadius._value,E=new te,I=new te,w=new te;this.getNorthPointByDistance(E,I,w),x>0&&(this.topRadiusPoint.position=E),v>0&&(this.bottomRadiusPoint.position=I),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(O(A)&&O(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:O(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Flt=yIe;var xIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,O(this.editEllipse)&&O(this.editEllipse.entity.ellipse)){let y=qe.PI_OVER_TWO,x=this.updatePoint(y);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:x,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new te,m=new te,C=new te,y=this.editEllipse.entity.ellipse;this.semiMinorAxis=y.semiMinorAxis._value,this.semiMajorAxis=y.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let x=Ae(y.rotation,0);this.center=this.editEllipse.entity.position._value;let v=this.semiMinorAxis*this.semiMinorAxis,E=this.semiMajorAxis*this.semiMajorAxis,I=this.semiMajorAxis*this.semiMinorAxis,w=te.magnitude(this.center),Q=te.normalize(this.center,f),M=te.cross(te.UNIT_Z,this.center,m);M=te.normalize(M,M);let B=te.cross(Q,M,C),T=new te;return N1.pointOnEllipsoid(A,x,B,M,v,I,E,w,Q,T)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickSemiMajorAxisPoint)||O(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(O(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(O(this.pickSemiMajorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let y=C*this.semiMinorAxis/this.semiMajorAxis;y>C&&(y=C),this.editEllipse.entity.ellipse.semiMinorAxis=y}else if(O(this.pickSemiMinorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(qe.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(O(A)&&O(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:O(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Nlt=xIe;var vIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,O(this.editEllipsoid)&&O(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let y=this.editEllipsoid.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te,I=new te;this.getNorthPointByDistance(v,E,I),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:E,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:I,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,y=Kn.eastNorthUpToFixedFrame(C),x=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=x.x,Ze.multiplyByPoint(y,A,A),f.y=-x.y,Ze.multiplyByPoint(y,f,f),m.z=x.z,Ze.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickRadiiXPoint)||O(this.pickRadiiYPoint)||O(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editEllipsoid.entity.position=y;else{if(O(this.dragPosition)){let I=te.subtract(m,this.dragPosition,new te),w=te.normalize(I,new te);te.dot(I,w,I);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=te.clone(Q);O(this.pickRadiiXPoint)?M.x-=I.x:O(this.pickRadiiYPoint)?M.y+=I.y:O(this.pickRadiiZPoint)&&(M.z+=I.z,this.editEllipsoid.entity.position=this.addHeight(I.z)),te.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let x=new te,v=new te,E=new te;this.getNorthPointByDistance(x,v,E),this.radiiXPoint.position=x,this.radiiYPoint.position=v,this.radiiZPoint.position=E}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(O(A)&&O(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:O(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},klt=vIe;var EIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,O(this.editPolygon)&&O(this.editPolygon.entity.polygon))for(let y=0;y<this.editPolygon.entity.polygon.hierarchy._value.positions.length;y++){let x=this.editPolygon.entity.polygon.hierarchy._value.positions[y],v=this.mEarthCtrl.entities.add({name:"polygon_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(O(A)&&O(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Olt=EIe;var IIe=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=ht.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,O(this.editModel)&&O(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=$t.clone(C);y.longitude=qe.toDegrees(y.longitude),y.latitude=qe.toDegrees(y.latitude),this.editModel.lon=y.longitude,this.editModel.lat=y.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(O(A)&&O(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(O(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Ult=IIe;var _Ie=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,O(this.editLabel)&&O(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(O(A)&&O(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:O(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},Glt=_Ie;var BIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,O(this.editPolyline)&&O(this.editPolyline.polyline))for(let y=0;y<this.editPolyline.polyline.positions._value.length;y++){let x=this.editPolyline.polyline.positions._value[y],v=this.mEarthCtrl.entities.add({name:"polyline_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(O(A)&&O(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Hlt=BIe;var wIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,O(this.editPolylineVolume)&&O(this.editPolylineVolume.entity.polylineVolume))for(let y=0;y<this.editPolylineVolume.entity.polylineVolume.positions._value.length;y++){let x=this.editPolylineVolume.entity.polylineVolume.positions._value[y],v=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:x,point:{color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(O(A)&&O(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:O(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Vlt=wIe;var bIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,O(this.editRectangle)&&O(this.editRectangle.entity.rectangle)){let y=this.editRectangle.entity.rectangle.coordinates._value,x=this.editRectangle.entity.rectangle.height._value,v=Di.northwest(y),E=te.fromRadians(v.longitude,v.latitude,x),I=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:E,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(I.id),v=Di.southeast(y);let w=te.fromRadians(v.longitude,v.latitude,x),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.leftTopPoint)||O(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=this.editRectangle.entity.rectangle.coordinates._value;O(this.leftTopPoint)?(this.leftTopPoint.position=m,y.west=C.longitude,y.north=C.latitude):O(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,y.south=C.latitude,y.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=y}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(O(A)&&O(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:O(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},zlt=bIe;function wd(o){this._earthCtrl=o,this._coreMap=o.coreMap}wd.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new Rlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};wd.prototype.updatePoint=function(o,A){o.updatePoint(A)};wd.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new Hlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};wd.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};wd.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Olt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};wd.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};wd.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new Llt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};wd.prototype.updateBox=function(o,A){o.updateBox(A)};wd.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new klt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};wd.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};wd.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new Flt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};wd.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};wd.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ult(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};wd.prototype.updateModel=function(o,A){o.updateModel(A)};wd.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new Plt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};wd.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};wd.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Glt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};wd.prototype.updateLabel=function(o,A){o.updateLabel(A)};wd.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new zlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};wd.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};wd.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new Nlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};wd.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};wd.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new Vlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};wd.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};wd.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var Moe=wd;function fy(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}fy.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],y="",x=[],v,E=this.scene.globe.ellipsoid,I={spot:[],distance:[],label:[],polyline:[]},w={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(w.point=A.point),O(A.polyline)&&(w.polyline=A.polyline));let Q=new k_;this.scene.primitives.add(Q);let M=new YA,B=new zr(f.scene.canvas),T=document.createElement("div");Zc(".map-widget",T),Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let F=document.getElementById("toolTip");F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let L;m=!0;let R=function(V){let U=0,W=`${0}\u7C73`,ie,ee,oe,ne,se,ce;for(let J=0;J<V.length-1;J+=1)ie=E.cartesianToCartographic(V[J]),ee=M.project(ie),oe=ee.x,ne=ee.y,ie=E.cartesianToCartographic(V[J+1]),ee=M.project(ie),se=ee.x,ce=ee.y,U=U+Math.sqrt((oe-se)*(oe-se)+(ne-ce)*(ne-ce));return U>0&&(W=`${U.toFixed(2)}\u7C73`),U/1e3>=1&&(W=`${(U/1e3).toFixed(2)}\u5343\u7C73`),W},k=function(){function V(U){if(!O(U))throw new Hi("positions is required!");if(U.length<2)throw new Hi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let W=hs.fromType(hs.ColorType);W.uniforms.color=new ht(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=U,this._init()}return V.prototype._init=function(){let U=this,W=function(){return U.path};this.options.polyline.positions=new Qn(W,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,I.polyline.push(this.lineEntity)},V}();B.setInputAction(function(V){let U,W;F.style.left=`${V.endPosition.x+10}px`,F.style.top=`${V.endPosition.y+20}px`,F.style.display="block",F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=!1,ee=f.camera.getPickRay(V.endPosition);ee&&(U=f.scene.globe.pick(ee,f.scene));let oe=f.scene.pick(V.endPosition);if(oe){console.log("feature",oe);let ne=f.scene.pickPosition(V.endPosition);ne&&(U=ne),ie=!0}if(!!U&&(W=Pi.WGS84.cartesianToCartographic(U),W)){let ne;ie?ne=f.scene.sampleHeight(W):ne=f.scene.globe.getHeight(W);let se=te.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,ne);if(m){if(C.length<1)return;O(v)?(v.path.pop(),v.path.push(se)):(C.push(se),v=new k(C));let ce=R(v.path);f.entities.remove(L),L=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v.path[v.path.length-1],label:{text:`\u603B\u957F\uFF1A${ce}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},Yi.MOUSE_MOVE);let G=function(V){x.push(V);let U=[];if(x.length>1){let W=x[x.length-2],ie=x[x.length-1],ee=Math.abs(W.longitude-ie.longitude)*1e7,oe=Math.abs(W.latitude-ie.latitude)*1e7;ee>oe&&(oe=ee);let ne=parseInt(oe/10);ne>1e3&&(ne=1e3),ne<2&&(ne=2);for(let se=0;se<ne;++se)U.push(new $t(qe.lerp(W.longitude,ie.longitude,se/(ne-1)),qe.lerp(W.latitude,ie.latitude,se/(ne-1))));U.push(ie.clone())}else U=x;if(U.length>0)for(let W=0;W<U.length;W++){V=U[W];let ie=f.scene.globe.getHeight(V),ee=te.fromDegrees(V.longitude/Math.PI*180,V.latitude/Math.PI*180,ie);C.push(ee)}};return B.setInputAction(function(V){let U,W,ie=!1,ee=f.camera.getPickRay(V.position);if(ee&&(U=f.scene.globe.pick(ee,f.scene)),f.scene.pick(V.position)){let ne=f.scene.pickPosition(V.position);ne&&(U=ne),ie=!0}if(U&&(W=Pi.WGS84.cartesianToCartographic(U)),W){let ne;ie?ne=f.scene.sampleHeight(W):ne=f.scene.globe.getHeight(W);let se=te.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,ne);if(m){v&&v.path.pop(),G(W);let ce="0\u7C73";v&&(ce=R(v.path)),y=ce,I.spot.push(se),I.distance.push(ce);let J=f.entities.add({position:se,point:{pixelSize:5,color:w.point,outlineColor:ht.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ce,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});I.label.push(J),f._points.push(J)}}},Yi.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(L),f._points[f._points.length-1].label.text=y,B.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(I),F.style.display="none"},Yi.RIGHT_CLICK),this};fy.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new zr(f.scene.canvas),C=[],y=null,x="0\u7C73",v=null,E,I="",w,Q=document.createElement("div");Zc(".map-widget",Q),Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T={name:"",spot:[],distance:[],label:[],ployline:[]},D={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(D.point=A.point),O(A.polyline)&&(D.polyline=A.polyline));let F=function(){function L(R){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:D.polyline,width:3,clampToGround:!1}},this.positions=R,this._init()}return L.prototype._init=function(){let R=this,k=function(){return R.positions};this.options.polyline.positions=new Qn(k,!1);let G=f.entities.add(this.options);f.item=G,T.ployline.push(G);let V=f.getuid();T.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${V}`},L}();return m.setInputAction(function(L){if(f.scene.bim){let R=f.scene.bim.PickWorldPositionSync(L.endPosition.x,L.endPosition.y);R[0]===0?v=f.scene.pickPosition(L.endPosition):v=new te(R[0],R[1],R[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.endPosition);!v||(B.style.left=`${L.endPosition.x+10}px`,B.style.top=`${L.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(O(y)?(C.pop(),C.push(v)):y=new F(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',x=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${x}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},Yi.MOUSE_MOVE),m.setInputAction(function(L){if(f.scene.bim){let k=f.scene.bim.PickWorldPositionSync(L.position.x,L.position.y);k[0]===0?v=f.scene.pickPosition(L.position):v=new te(k[0],k[1],k[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.position);if(!v)return;C.length===0&&C.push(v.clone()),C.push(v);let R=x;I=`\u603B\u957F\uFF1A${x}`,E=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:D.point,outlineColor:ht.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:R,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),heightReference:In.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(E),T.spot.push(v),T.distance.push(x),T.label.push(E)},Yi.LEFT_CLICK),m.setInputAction(function(L){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=I),m.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(T)},Yi.RIGHT_CLICK),this};fy.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=$t.fromCartesian(o[m]),y=$t.fromCartesian(o[m+1]),x=new xp;x.setEndPoints(C,y);let v=x.surfaceDistance;v=Math.sqrt(Math.pow(v,2)+Math.pow(y.height-C.height,2)),A=A+v}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};fy.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new zr(f.scene._imageryLayerCollection),y=document.getElementById("toolTip");y||(Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),y=document.getElementById("toolTip")),y.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let x=[],v={},E=[],I=[],w=null,Q=null,M,B={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(B.point=A.point),O(A.polyline)&&(B.polyline=A.polyline),O(A.polygon)&&(B.polygon=A.polygon));let T={mj:0,label:[],polygon:[]};y.style.display="block";let D=function(){function F(L){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=L,this._init()}return F.prototype._init=function(){let L=this,R=function(){return L.hierarchy};this.options.polygon.hierarchy=new Qn(R,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,T.polygon=this.polygon},F}();return C.setInputAction(function(F){if(y.style.left=`${F.endPosition.x+10}px`,y.style.top=`${F.endPosition.y+20}px`,f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.endPosition.x,F.endPosition.y);V[0]===0?Q=f.scene.pickPosition(F.endPosition):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.endPosition);if(!Q)return;let L=$t.fromCartesian(Q),R=qe.toDegrees(L.longitude),k=qe.toDegrees(L.latitude),G=L.height;if(x.length>=2){O(w)?(x.pop(),x.push(Q),v=new Hn(x),I.pop(),I.push({lon:R,lat:k,hei:G})):(v=new Hn(x),w=new D(v));let V=f.getArea(I,x);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:V,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),T.label=M}},Yi.MOUSE_MOVE),C.setInputAction(function(F){if(f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.position.x,F.position.y);V[0]===0?Q=f.scene.pickPosition(F.position):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.position);if(!Q)return;let L=$t.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",L);let R=qe.toDegrees(L.longitude),k=qe.toDegrees(L.latitude),G=L.height;x.length===0&&(x.push(Q.clone()),v=new Hn(x),I.push({lon:R,lat:k,hei:G}),x.push(Q.clone()),v=new Hn(x),I.push({lon:R,lat:k,hei:G})),x.push(Q),v=new Hn(x),E.push({lon:R,lat:k,hei:G}),I.push({lon:R,lat:k,hei:G})},Yi.LEFT_CLICK),C.setInputAction(function(F){y.style.display="none",f.entities.remove(M),C.destroy();let L=f.getArea(I,x);m=L;let R=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:L,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(R),f._lable=R,T.mj=m,T.label=R,O(o)&&typeof o=="function"&&o(T)},Yi.RIGHT_CLICK),this};fy.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,y=[],x={},v,E=f.scene,I=E.globe.ellipsoid,w=new k_;E.primitives.add(w);let Q,M,B=0,T={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(T.point=A.point),O(A.polyline)&&(T.polyline=A.polyline),O(A.polygon)&&(T.polygon=A.polygon));let D=document.createElement("div");Zc(".map-widget",D),Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let L=document.getElementById("toolTip");L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R=new zr(E.canvas),k=function(){function V(U){if(!O(U))throw new Hi("positions is required!");if(U.length<3)throw new Hi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:T.polygon,clampToGround:!1}},this.path=U,this._init()}return V.prototype._init=function(){let U=this,W=function(){return U.path};this.options.polygon.hierarchy=new Qn(W,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},V}();R.setInputAction(function(V){let U=0;f.entities.remove(M);let W,ie,ee=f.scene.camera.getPickRay(V.endPosition);ee&&(W=f.scene.globe.pick(ee,f.scene));let oe=f.scene.pick(V.endPosition),ne=!1;if(oe){let ce=f.scene.pickPosition(V.endPosition);ce&&(W=ce),ne=!0}if(!W)return;let se=function(ce){let J=new Array(ce.length),he=function(Ie){return Ie.longitude=Ie.longitude/Math.PI*180,Ie.latitude=Ie.latitude/Math.PI*180,Ie},Ce=function(Ie){let be=0;for(let Be=0;Be<Ie.length;Be++){let me=Ie[Be],z;Be<Ie.length-1?z=Ie[Be+1]:z=Ie[0],be+=me.x*z.y-z.x*me.y}return be/2};for(let Ie=0;Ie<ce.length;Ie++)J[Ie]=he(I.cartesianToCartographic(ce[Ie]));let Ee=0;for(let Ie=0;Ie<J.length;Ie++)Ee+=J[Ie].longitude;Ee=Ee/J.length;for(let Ie=0;Ie<J.length;Ie++)J[Ie]=f.Gauss_to_XY(J[Ie].longitude,J[Ie].latitude,Ee);return Math.abs(Ce(J))};if(ie=Pi.WGS84.cartesianToCartographic(W),ie&&C){if(L.style.left=`${V.endPosition.x+10}px`,L.style.top=`${V.endPosition.y+20}px`,L.style.display="block",y.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:`${U}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(O(v)?(v.path.positions.pop(),v.path.positions.push(W)):(y.push(W),x=new Hn(y),v=new k(x)),y.length>=2){L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ce=String(se(v.path.positions));ce=ce.substr(0,ce.indexOf(".",0)),ce.length<6?U=`${ce}\u5E73\u65B9\u7C73`:(ce=String(ce/1e6),ce=ce.substr(0,ce.indexOf(".",0)+3),U=`${ce}\u5E73\u65B9\u5343\u7C73`),m.mj=U,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},Yi.MOUSE_MOVE),R.setInputAction(function(V){let U;B=1;let W=f.scene.camera.getPickRay(V.position);W&&(U=f.scene.globe.pick(W,f.scene));let ie=f.scene.pick(V.position),ee=!1;if(ie){let oe=f.scene.pickPosition(V.position);oe&&(U=oe),ee=!0}U&&C&&(y.push(U),x=new Hn(y))},Yi.LEFT_CLICK),R.setInputAction(function(){R.removeInputAction(Yi.LEFT_CLICK),R.removeInputAction(Yi.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:y[y.length-1],pixelOffset:new wt(0,20),eyeOffset:new te(0,0,0),horizontalOrigin:cA.CENTER,verticalOrigin:Bn.CENTER,scale:1,color:new ht(1,1,1,1)}),L.style.display="none",R.destroy(),O(o)&&typeof o=="function"&&o(m)},Yi.RIGHT_CLICK);let G=function(V){let U=0,W=0,ie=0;for(let oe=0;oe<V.length;oe++)U+=V[oe].x,W+=V[oe].y,ie+=V[oe].z;return new te(U/V.length,W/V.length,ie/V.length)};return this};fy.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};fy.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,y,x,v,E;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,y=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,x=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,v=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,E=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-y/2*Math.sin(2*o)+x/4*Math.sin(4*o)-v/6*Math.sin(6*o)+E/8*Math.sin(8*o))};fy.prototype.to_Radian=function(o){return o*Math.PI/180};fy.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,y=Math.sqrt(6378137*6378137-C*C)/C,x=0,v=0,E=0,I=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);I=this.to_N(A),E=I*Math.cos(A),x=Math.tan(A),v=y*M;let B=Math.pow(x,2),T=Math.pow(x,4),D=Math.pow(v,2),F=Math.pow(v,4),L=Math.pow(M,3),R=Math.pow(M,5),k=this.to_Sm(A)+Math.pow(Q,2)/2*E*M*x+Math.pow(Q,4)/24*x*E*L*(5-B+9*D+4*F)+Math.pow(Q,6)/720*x*E*R*(61-58*x*x+T+270*D-330*x*x*D),G=Q*I*M+Math.pow(Q,3)/6*I*L*(1-x*x+v*v)+Math.pow(Q,5)/120*I*R*(5-18*x*x+T+14*D-58*D*B);return new wt(G,k)};fy.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,y=(m+2)%o.length,x=this.Angle(o[m],o[C],o[y]),v=this.getdistance(A[m],A[C]),E=this.getdistance(A[C],A[y]);f+=v*E*Math.abs(Math.sin(x))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};fy.prototype.getdistance=function(o,A){let f=$t.fromCartesian(o),m=$t.fromCartesian(A),C=new xp;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};fy.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,y=o.lon*f,x=A.lat*f,v=A.lon*f,E=-Math.atan2(Math.sin(y-v)*Math.cos(x),Math.cos(C)*Math.sin(x)-Math.sin(C)*Math.cos(x)*Math.cos(y-v));return E<0&&(E+=Math.PI*2),E=E*m,E};fy.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),y=m-C;return y<0&&(y+=360),y};fy.prototype.getuid=function(){return this.uuid(8,16)};fy.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|qe.nextRandomNumber()*A];else{let y;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(y=0|qe.nextRandomNumber()*16,m[C]=f[C===19?y&3|8:y])}return m.join("")};fy.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var lJ=fy;function tw(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=Ae(A.show,!0),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._heading=Ae(A.heading,0),this._pitch=Ae(A.pitch,0),this._distance=Ae(A.distance,300),this._position=te.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=Ae(A.horizontalViewAngle,90),this._verticalViewAngle=Ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=Ae(A.visibleAreaColor,ht.GREEN.withAlpha(.4)),this._invisibleAreaColor=Ae(A.invisibleAreaColor,ht.RED.withAlpha(.4)),this._size=Ae(A.size,10240),this._softShadows=Ae(A.softShadows,!0),this._colorStyle=Ae(A.colorStyle,ht.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(tw.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});tw.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};tw.prototype.removeFromMap=function(){let o=this;O(o.viewShedMap)&&(o.viewShedMap.enabled=!1),O(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};tw.prototype.visualConeShow=function(o){let A=this;O(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};tw.prototype.addVisualPyramid=function(){let o=this,A=new AK({radii:new Qn(function(){return new te(o._distance,o._distance,o._distance)},!1),minimumClock:new Qn(function(){return qe.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Qn(function(){return qe.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Qn(function(){return qe.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Qn(function(){return qe.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Qn(function(){return o._colorStyle},!1)}),f=new JA({position:new Qn(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};tw.prototype.createLightCamera=function(){O(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ol(this._coreMap.scene),this._lightCamera.position=this._position};tw.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!O(o)&&(O(o.lon)||O(o.lat)||O(o.height)||O(o.heading)||O(o.pitch)||O(o.roll)||O(o.far)||O(o.distance)||O(o.verticalViewAngle)||O(o.horizontalViewAngle))){let m=this._parameter;for(let v in o)o.hasOwnProperty(v)&&O(m[v])&&(m[v]=o[v]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=te.fromDegrees(m.lon,m.lat,m.height);let C=qe.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let y=qe.toRadians(A._horizontalViewAngle),x=qe.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(y/2)/Math.tan(x/2),y>x?f.frustum.fov=y:f.frustum.fov=x}};tw.prototype.createShadowMap=function(){if(O(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new JK({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Dx=new te;tw.prototype.drawViewCentrum=function(){let o=this;function A(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=new SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let f=this._earthCtrl.entities.add({polyline:{positions:new Qn(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=new SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let C=this._earthCtrl.entities.add({polyline:{positions:new Qn(m,!1),material:this._colorStyle}});this._lineArray.push(C);function y(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=new SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let x=this._earthCtrl.entities.add({polyline:{positions:new Qn(y,!1),material:this._colorStyle}});this._lineArray.push(x);function v(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let E=this._earthCtrl.entities.add({polyline:{positions:new Qn(v,!1),material:this._colorStyle}});this._lineArray.push(E)};tw.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};tw.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=qe.toRadians(this._horizontalViewAngle),A=qe.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:qe.toRadians(this._heading),pitch:qe.toRadians(this._pitch),roll:0}})};var Poe=tw;var QIe=Pi.WGS84;function Uf(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=FRi(this.coreMap.container)}function SIe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?SIe(o[f],null):A[f];return A}function Klt(o,A){let f=SIe(o),m;for(m in A)f[m]===void 0&&(f[m]=SIe(A[m]));return f}function FRi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let y=document.createElement("DIV");y.className="twipsy-inner",m.appendChild(y),this._div=m,this._title=y,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Uf.prototype.addToolbar=function(o,A){return A=Klt(A,{container:o}),new Uf.Toolbar(this,A)};var Ylt={shiftX:0,shiftY:0};Uf.prototype.createBillboardGroup=function(o,A,f){let m=new Uf.BillboardGroup(this,A);return m.addBillboards(o,f),m};Uf.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=Klt(A,Ylt);let f=new k_;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Uf.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new wt(this._options.shiftX,this._options.shiftY),eyeOffset:new te(0,0,-1e3),horizontalOrigin:cA.CENTER,verticalOrigin:Bn.CENTER,scale:.3,image:Ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new ht(1,1,1,1)});if(A){let y=function(v){C.enableRotate=v},x=function(){let v=0;for(let E=m._orderedBillboards.length;v<E&&m._orderedBillboards[v]!==f;++v);return v},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let v=this,E=new zr(v._scene.canvas);setListener(f,"leftDown",function(I){function w(M){f.position=M;for(let B=0,T=v._orderedBillboards.length;B<T&&v._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(x(),M)}function Q(M){E.destroy(),y(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(x(),M)}E.setInputAction(function(M){let B=v._scene.camera.pickEllipsoid(M.endPosition,QIe);B?w(B):Q(B)},Yi.MOUSE_MOVE),E.setInputAction(function(M){Q(v._scene.camera.pickEllipsoid(M.position,QIe))},Yi.LEFT_UP),y(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(x(),v._scene.camera.pickEllipsoid(I,QIe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(v){A.onDoubleClick(x())}),A.onClick&&setListener(f,"leftClick",function(v){A.onClick(x())}),A.tooltip&&(setListener(f,"mouseMove",function(v){m._drawHelper._tooltip.showAt(v,A.tooltip())}),setListener(f,"mouseOut",function(v){m._drawHelper._tooltip.setVisible(!1)}))}return f};Uf.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Uf.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Uf.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Uf.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Uf.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Uf.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Uf.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Uf.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Uf.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Uf.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Uf.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,y=[],x=[],v;this._positions=x;let E=new zr(f.canvas);this._mouseHandler=E;let I=new Uf.BillboardGroup(this,Ylt);this._markers=I,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),E.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),T=$t.fromCartesian(B),D=qe.toDegrees(T.longitude),F=qe.toDegrees(T.latitude);if(B){if(y.length===0&&(y.push(D,F),x.push(B),v=B,I.addBillboard(v)),x.length>=4){let L=ml.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(L!==void 0){let R=L.x-Q.position.x,k=L.y-Q.position.y;if(R*R+k*k<16){y.splice(y.length-2,2),x.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}y.push(D,F),x.push(B),I.addBillboard(B),x.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:te.fromDegreesArray(y),material:ht.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),Yi.LEFT_CLICK),E.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(x.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),T=f.globe.pick(B,f),D=$t.fromCartesian(T),F=qe.toDegrees(D.longitude),L=qe.toDegrees(D.latitude);if(T&&(y.splice(y.length-2,2),x.pop(),y.push(F,L),x.push(T),I.getBillboard(x.length-1).position=T,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4)){let R=ml.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(R!==void 0){let k=R.x-M.x,G=R.y-M.y;k*k+G*G<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),Yi.MOUSE_MOVE),E.setInputAction(function(Q){x.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),Yi.LEFT_DOUBLE_CLICK);function w(){return te.fromDegreesArray(y)}};Uf.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:ht.RED.withAlpha(.5),outline:!0,outlineColor:ht.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Uf.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Uf.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Uf.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function NRi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=$t.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,y=0,x=0,v=0,E=0,I=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(y=A[0],x=f[0]):(y=A[Q+1],x=f[Q+1]),E=m*x-y*C,v+=E,I+=(m+y)*E,w+=(C+x)*E;return v*=.5,I/=6*v,w/=6*v,new $t(I,w)}function kRi(o,A,f){let m=te.distance(o,A),C=te.distance(A,f),y=te.distance(f,o),x=(m+C+y)/2;return Math.sqrt(x*(x-m)*(x-C)*(x-y))}Uf.prototype.computeCutVolume=function(){let o=15e3;for(let k=0;k<this._positions.length;k++){let G=$t.fromCartesian(this._positions[k]),V=this._scene.globe.getHeight(G);o>V&&(o=V)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new Id.fromPositions({positions:this._positions,vertexFormat:Ya.FLAT_VERTEX_FORMAT,granularity:A}),m=new Id.createGeometry(f),C=0,y=0,x,v,E,I,w,Q,M,B,T,D,F,L;for(let k=0;k<m.indices.length;k+=3)x=m.indices[k],v=m.indices[k+1],E=m.indices[k+2],D=new te(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),F=$t.fromCartesian(D),I=this._scene.globe.getHeight(F),M=te.fromRadians(F.longitude,F.latitude,0),y<I&&(y=I),D=new te(m.attributes.position.values[v*3],m.attributes.position.values[v*3+1],m.attributes.position.values[v*3+2]),F=$t.fromCartesian(D),w=this._scene.globe.getHeight(F),B=te.fromRadians(F.longitude,F.latitude,0),y<w&&(y=w),D=new te(m.attributes.position.values[E*3],m.attributes.position.values[E*3+1],m.attributes.position.values[E*3+2]),F=$t.fromCartesian(D),Q=this._scene.globe.getHeight(F),T=te.fromRadians(F.longitude,F.latitude,0),y<Q&&(y=Q),L=kRi(M,B,T),C=C+L*(I-o+w-o+Q-o)/3;let R=NRi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:te.fromRadians(R.longitude,R.latitude,y+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:y,volume:C}};var Roe=Uf;function Jlt(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=Ae(A.color,new ht(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new Hi("invalid positions length!");this._duration=Ae(A.duration,4e3),this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,100),this._image=A.image,this._pps=null}function ORi(o,A){let f=$t.fromCartesian(o[0]),m=f.longitude,C=f.latitude,y=m,x=C,v=A;for(let E=1;E<o.length;E++){let I=$t.fromCartesian(o[E]);m>I.longitude?m=I.longitude:y<I.longitude&&(y=I.longitude),C>I.latitude?C=I.latitude:x<I.latitude&&(x=I.latitude)}return new te.fromRadians((m+y)/2,(C+x)/2,v)}function URi(o){if(O(o._pps))return;let A=ORi(o._positions,o._minHeight),f=$t.fromCartesian(A),m=new oi(A.x,A.y,A.z,1),C=new $t(f.longitude,f.latitude,o.maxHeight+100),y=$t.toCartesian(C),x=new oi(y.x,y.y,y.z,1),v=new oi,E=new oi,I=new te,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new wa({fragmentShader:HRi(Q),uniforms:{u_floodCenterEC:function(){return Ze.multiplyByVector(w._viewMatrix,m,v)},u_floodPlaneNormalEC:function(){let B=Ze.multiplyByVector(w._viewMatrix,m,v),T=Ze.multiplyByVector(w._viewMatrix,x,E);return I.x=T.x-B.x,I.y=T.y-B.y,I.z=T.z-B.z,te.normalize(I,I),I},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function GRi(o){O(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function HRi(o){return`uniform sampler2D colorTexture;
            `})};c8.prototype.destroy=function(){this._tileset.customShader===this._customShader&&(this._customShader=void 0,this._tileset.customShader=void 0),this._scene.preUpdate.removeEventListener(this._preUpdate)};function iRi(){this.customShaders={},this.customShaders.lightLine=c8}var wlt=iRi;function GH(o,A){this.options=Ae(A,{}),this.earthCtrl=o,this.viewer=o.coreMap,this.CSME=mme,this.Cust=new this.CSME.CustomShaderStage(this.options.primitive,A),this.stageArr=[],this.eventListener=null,this.eventListener=this.viewer.scene.preUpdate.addEventListener(()=>{this.Cust.update()}),this.create()}GH.prototype.create=function(o){let A=this,f=null;o?f=o:f=A.options,f.lineMaterialStage&&(A.LineMaterialStage=new A.CSME.LineMaterialStage(Ae(f.lineMaterialStage,{weight:.5})),A.Cust.addStage(A.LineMaterialStage),A.stageArr.push(A.LineMaterialStage)),f.gradientMaterialStage&&(A.GradientMaterialStage=new A.CSME.GradientMaterialStage(Ae(f.gradientMaterialStage,{weight:.5})),A.Cust.addStage(A.GradientMaterialStage),A.stageArr.push(A.GradientMaterialStage)),f.normalizeMaterialStage&&(A.NormalizeMaterialStage=new A.CSME.NormalizeMaterialStage(Ae(f.normalizeMaterialStage,{weight:.5})),A.Cust.addStage(A.NormalizeMaterialStage),A.stageArr.push(A.NormalizeMaterialStage)),f.dynamicColorMaterialStage&&(A.DynamicColorMaterialStage=new A.CSME.DynamicColorMaterialStage(Ae(f.dynamicColorMaterialStage,{weight:.5})),A.Cust.addStage(A.DynamicColorMaterialStage),A.stageArr.push(A.DynamicColorMaterialStage)),f.reflectMaterialStage&&(A.ReflectMaterialStage=new A.CSME.ReflectMaterialStage(Ae(f.reflectMaterialStage,{weight:.5})),A.Cust.addStage(A.ReflectMaterialStage),A.stageArr.push(A.ReflectMaterialStage)),f.textureMaterialStage&&(A.TextureMaterialStage=new A.CSME.TextureMaterialStage(Ae(f.textureMaterialStage,{weight:.5,url:`${globalThis.GEOWORLD_BASE_URL}Assets/Textures/window.png`})),A.Cust.addStage(A.TextureMaterialStage),A.stageArr.push(A.TextureMaterialStage))};GH.prototype.addStage=function(o){let A=this;A.Cust.addStage(o),A.stageArr.push(o)};GH.prototype.removeStage=function(o){this.Cust.removeStage(o.name)};GH.prototype.update=function(){let o=this;o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=o.viewer.scene.preUpdate.addEventListener(()=>{o.Cust.update()})};GH.prototype.removeFromMap=function(){let o=this;for(let A=0;A<o.stageArr.length;A++)o.removeStage(o.stageArr[A]);o.viewer.scene.preUpdate.removeEventListener(o.eventListener),o.eventListener=null};var blt=GH;function Qoe(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._options.visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#101010")),this._options.outlineWidth=Ae(A.outlineWidth,1),this._options.thresholdAngle=Ae(A.thresholdAngle,12*Math.PI/180),this.add()}Qoe.prototype.add=function(){this._edgeStage=aY();let o=this._edgeStage;o.visibleEdgeColor=this._options.visibleEdgeColor,o.outlineWidth=this._options.outlineWidth,o.thresholdAngle=this._options.thresholdAngle,o.selected=[{},{}],o.enabled=!0,this._earthCtrl.Viewer.postProcessStages.add(o)};Qoe.prototype.removeFromMap=function(){this._edgeStage&&(this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage),this.__edgeStage=null)};Object.defineProperties(Qoe.prototype,{show:{get:function(){return this._edgeStage.show},set:function(o){this._edgeStage.show=o}},outlineWidth:{get:function(){return this._edgeStage.outlineWidth},set:function(o){this._edgeStage.outlineWidth=o}},thresholdAngle:{get:function(){return this._edgeStage.thresholdAngle},set:function(o){!o||(this._edgeStage.thresholdAngle=o)}},visibleEdgeColor:{get:function(){return this._edgeStage.visibleEdgeColor},set:function(o){!o||(this._edgeStage.visibleEdgeColor=o)}},hiddenEdgeColor:{get:function(){return this._edgeStage.hiddenEdgeColor},set:function(o){!o||(this._edgeStage.hiddenEdgeColor=o)}},showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Qlt=Qoe;function Soe(o,A={}){this._earthCtrl=o,this._edgeStage=null,this._options=A,this._visibleEdgeColor=Ae(A.visibleEdgeColor,ht.fromCssColorString("#ff0000")),this._hiddenEdgeColor=Ae(A.hiddenEdgeColor,ht.fromCssColorString("#4d4d4d")),this.handler=null,this.key=Ae(A.key,"id"),this.model=Ae(A.model,null),this.add()}Soe.prototype.add=function(){let o=this,A="";this._edgeStage=aY(!0);let f=this._edgeStage;f.visibleEdgeColor=this._visibleEdgeColor,f.hiddenEdgeColor=this._hiddenEdgeColor,f.selected=[],f.enabled=!1,this._earthCtrl.Viewer.postProcessStages.add(f);function m(C,y){function x(E,I){let w=E.featuresLength;for(let Q=0;Q<w;++Q){let M=E.getFeature(Q);if(M.getProperty(o.key)===A){let T={pickId:M.pickId};y.selected=[T],y.enabled=!0}}}function v(E,I){let w=E.content,Q=w.innerContents;if(O(Q)){let M=Q.length;for(let B=0;B<M;++B)x(Q[B],I)}else x(w,I)}C.tileVisible.addEventListener(function(E){A!==""&&v(E,null)})}m(this.model,f),this.handler=new zr(this._earthCtrl.coreMap.scene.canvas),this.handler.setInputAction(function(C){let y=o._earthCtrl.coreMap.scene.pick(C.position);if(f.selected=[],A="",!y||!y.primitive)return;let v=y.primitive._pickIds,I={pickId:y.pickId};f.selected=[I],f.enabled=!0,A=y.getProperty(o.key)},Yi.LEFT_CLICK)};Soe.prototype.removeFromMap=function(){this.handler&&(this.handler.destroy(),this.handler=void 0),this._edgeStage&&this._earthCtrl.Viewer.postProcessStages.remove(this._edgeStage)};Object.defineProperties(Soe.prototype,{showGlow:{get:function(){return this._edgeStage.showGlow},set:function(o){this._edgeStage.showGlow=o}},edgeGlow:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeStrength:{get:function(){return this._edgeStage.edgeGlow},set:function(o){this._edgeStage.edgeGlow=o}},edgeOnly:{get:function(){return this._edgeStage.edgeOnly},set:function(o){this._edgeStage.edgeOnly=o}}});var Slt=Soe;function Hs(o){this._earthCtrl=o,this._coreMap=o.coreMap}function Sx(){return((1+qe.nextRandomNumber())*65536|0).toString(16).substring(1)}Hs.createUUID=function(){return`${Sx()+Sx()}-${Sx()}-${Sx()}-${Sx()}-${Sx()}${Sx()}${Sx()}`};Hs.createUUIDWithoutDash=function(){return Sx()+Sx()+Sx()+Sx()+Sx()+Sx()+Sx()+Sx()};Hs.prototype.createUUID=function(){return Hs.createUUID()};Hs.prototype.createGroup=function(o){let A=new s8;return A.id=o.id||Hs.createUUID(),A.name=o.name||"\u672A\u547D\u540D\u7EC4",A};Hs.prototype.createImageryLayer=function(o,A){let f=new foe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.IMAGERYPROVIDERS),f),f};Hs.prototype.createTerrainLayer=function(o,A){let f=new poe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.TERRAINPROVIDERS),f),f};Hs.prototype.removeTerrainLayer=function(o){this._coreMap.terrainProvider=new VF({})};Hs.prototype.createFeatureLayer=function(o,A){let f=new xoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.FEATURELAYERS),f),f};Hs.prototype.createModelLayer=function(o,A){let f=new Coe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.MODELLAYERS),f),f};Hs.prototype.createWfsModel=function(o,A){let f=new yK(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.MODELLAYERS),f),f};Hs.prototype.createModel=function(o,A){let f=new Yne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.removeModel=function(o){O(o)&&o.removeFromMap()};Hs.prototype.createCZMLObject=function(o,A){let f=this,m=Ae(o.addToMap,!0),C=new Nie(o.name);return C.load(o.url),m&&f._earthCtrl.dataSources.add(C),C.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,C):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),C),C};Hs.prototype.createElement=function(o){let A={};return A[o.type]=o.parameters,O(o.name)&&(A.name=o.name),O(o.position)&&(A.position=o.position),this._earthCtrl.entities.add(A)};Hs.prototype.removeElement=function(o){O(o)?this._earthCtrl.entities.remove(o):this._earthCtrl.entities.removeAll()};Hs.prototype.createVideoProjection=function(o,A){o.addToMap=Ae(o.addToMap,!0);let f=Ae(o.sourceType,"perspective"),m=null;return f==="perspective"?(m=new Dne(this._earthCtrl,o),m.initialize(o),m.name=o.name,A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),m)):f==="panorama"?(m=new alt(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),m)):f==="fisheye"&&(m=new Tne(this._earthCtrl,o),m.initialize(o),m.name=o.name,m.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,m):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),m)),m};Hs.prototype.createTrack=function(o,A){let f=new slt(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.initialize(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createSceneNode=function(o,A,f){let m=new s8(this._earthCtrl);return m.id=o,m.name=A,m.label=f,m};Hs.prototype.createFire=function(o,A){let f=new Rne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createSmoke=function(o,A){let f=new Fne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createExplosion=function(o,A){let f=new kne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createFireworks=function(o,A){let f=new Une(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createRadarScan=function(o,A){let f=new Hne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createCircleScan=function(o,A){let f=new plt(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createUpDownScan=function(o){let A=new Clt(this._earthCtrl,o);return A.show=!0,A};Hs.prototype.createWaters=function(o,A){let f=new _oe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),f.show=!0,A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createHeatmap=function(o,A){let f=Alt.create(this._earthCtrl,o.bbox,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createLabel=function(o,A){let f=new Wne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createBillboard=function(o,A){let f=new zne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPolyline=function(o,A){let f=new qne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPolygon=function(o,A){let f=new Zne(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPoint=function(o,A){let f=new eoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createBox=function(o,A){let f=new ioe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createEllipsoid=function(o,A){let f=new aoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createCylinder=function(o,A){let f=new noe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createRectangle=function(o,A){let f=new loe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createEllipse=function(o,A){let f=new coe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPolylineVolume=function(o,A){let f=new hoe(this._earthCtrl,o);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createEChartLayer=function(o,A){let f=new Eoe(this._earthCtrl);return f.name=o.name,f.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&f.addToMap(o),A?this._earthCtrl.userScene.addChild(A,f):this._earthCtrl.userScene.addChild(this._earthCtrl.userScene.rootNode.getChildByName(Zs.USERSCENE),f),f};Hs.prototype.createPointLight=function(o){return new xlt(this._earthCtrl,o)};Hs.prototype.createHawkeye=function(o){let A=new Boe(this._earthCtrl,o);A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),Ae(o.addToMap,!0)&&A.addToMap(o)};Hs.prototype.createSpotLight=function(o){let A=new boe(this._earthCtrl.coreMap,o.entities,o.lights);return A.name=o.name,A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderManager=function(o){let A=new wlt;return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createCustomShaderStage=function(o){let A=new blt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.createModelOutline=function(o={}){let A=new Qlt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};Hs.prototype.modelClick=function(o={}){let A=new Slt(this._earthCtrl,o);return A.name=Ae(o.name,null),A.id=Ae(o.id,this._earthCtrl.factory.createUUID()),A};var i2=Hs;var Doe=class extends n0{constructor(A,f){super(A),this._objectMap={},this._rootNode=null,this._isBenchUpdate=!1,this._selectSet=new Sne(A);let m=new s8(A);m.id=i2.createUUID(),m.name=Ae(f.ProjectName,"root"),m.version=Ae(f.version,null),m.desc=Ae(f.desc,null),m.createTime=Ae(f.createTime,new Date().toISOString()),m.lastUpdate=Ae(f.lastUpdate,null),m.show=!0,this._rootNode=m,this._editNode=m,this._objectMap[m.id]=m,this._EventDocumentChanged=new eN("EventDocumentChanged")}finalize(){this._rootNode=null,this._objectMap={}}getChildById(A){return this._objectMap.hasOwnProperty(A)?this._objectMap[A]:null}addChild(A,f){A.addChild(f),this._objectMap[f.id]=f,this._isBenchUpdate||this.commitChanged()}removeChildById(A){let f=this._objectMap[A];O(f)&&this.removeChild(f)}removeChild(A){O(A)&&O(A.parentNode)&&(A.removeFromMap(),A.parentNode.removeChild(A)),delete this._objectMap[A.id],this._isBenchUpdate||this.commitChanged()}removeAll(){}beginUpdate(){this._isBenchUpdate=!0}endUpdate(){this._isBenchUpdate&&(this.commitChanged(),this._isBenchUpdate=!1)}commitChanged(){this._EventDocumentChanged.notifyEvent(this)}flyTo(A,f){O(A)&&O(A._primitive)&&(A=A._primitive),this._earthCtrl.coreMap.flyTo(A,f)}findLocationByID(A,f){if(!A)return;let m=this.getChildById(A);O(m)&&O(m._primitive)&&(m=m._primitive),this._earthCtrl.coreMap.flyTo(m,f)}moveLayer(A,f){let m=this.getChildById(A),C=null;for(let y=0;y<m.parentNode.childNodes.length;y++)m.parentNode.childNodes[y].id===m.id&&(C=y);f==="up"?(this._earthCtrl.coreMap.scene.imageryLayers.raise(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C+1)):f==="down"&&(this._earthCtrl.coreMap.scene.imageryLayers.lower(m._primitive),this.changeLayer(m.parentNode.childNodes,C,C-1))}changeLayer(A,f,m){if(f=qe.clamp(f,0,A.length-1),m=qe.clamp(m,0,A.length-1),f===m)return;let C=A[f];A[f]=A[m],A[m]=C}outputJson(A){let f=this;new Promise(function(C,y){let x={IMAGERYPROVIDERS:"imageryProviders",TERRAINPROVIDERS:"terrainProviders",MODELLAYERS:"modelLayers",FEATURELAYERS:"featureLayers",USERSCENE:"userScene"},v=0,E=[];for(let I in x){let w=x[I],Q=f.rootNode.getChildByName(w);if(!Q)continue;let M=[];if(Q.childNodes.length===0)M=[];else for(let B=0;B<Q.childNodes.length;B++){let T=Q.childNodes[B].toJSON();M.push(T)}Promise.all(M).then(function(B){let T=[];if(B.length!==0){for(let L=0;L<B.length;L++)T.push(B[L]);let D=T[0].class;D!=="IMAGERY_LAYER"&&D!=="TERRAIN_LAYER"&&D!=="MODEL_LAYER"&&D!=="FEATURE_LAYER"&&(D="USER_SCENE");let F={item:D,objJson:T};E.push(F)}v++,v===5&&(C(E),v=0)})}}).then(function(C){let y={version:f.rootNode.version,projectName:f.rootNode.name,desc:f.rootNode.desc,createTime:f.rootNode.createTime,lastUpdate:new Date().toISOString(),imageryProviders:[],terrainProviders:[],modelLayers:[],featureLayers:[],userScene:[]};for(let w=0;w<C.length;w++)C[w].item==="IMAGERY_LAYER"&&(y.imageryProviders=C[w].objJson),C[w].item==="TERRAIN_LAYER"&&(y.terrainProviders=C[w].objJson),C[w].item==="MODEL_LAYER"&&(y.modelLayers=C[w].objJson),C[w].item==="FEATURE_LAYER"&&(y.featureLayers=C[w].objJson),C[w].item==="USER_SCENE"&&(y.userScene=C[w].objJson);let x={class:"ENVIRONMENT",underGround:Ae(f._earthCtrl.camera.undergroundMode,null),shadow:Ae(f._earthCtrl.shadows,null),depthTest:Ae(f._earthCtrl.coreMap.scene.globe.depthTestAgainstTerrain,null),rain:Ae(f._earthCtrl.environment.rain.show,null),snow:Ae(f._earthCtrl.environment.snow.show,null),fog:Ae(f._earthCtrl.environment.fog.show,null),bwMode:Ae(f._earthCtrl.environment.bwMode.show,null),nightMode:Ae(f._earthCtrl.environment.nightMode.show,null),colorAdjustment:{show:Ae(f._earthCtrl.environment.colorAdjustment.show,null),contrast:Ae(f._earthCtrl.environment.colorAdjustment.contrast,null),saturation:Ae(f._earthCtrl.environment.colorAdjustment.saturation,null),brightness:Ae(f._earthCtrl.environment.colorAdjustment.brightness,null)}},v={class:"SKYBOX",positiveX:Ae(f._earthCtrl.environment.SkyBoxSource.positiveX,null),negativeX:Ae(f._earthCtrl.environment.SkyBoxSource.negativeX,null),positiveY:Ae(f._earthCtrl.environment.SkyBoxSource.positiveY,null),negativeY:Ae(f._earthCtrl.environment.SkyBoxSource.negativeY,null),positiveZ:Ae(f._earthCtrl.environment.SkyBoxSource.positiveZ,null),negativeZ:Ae(f._earthCtrl.environment.SkyBoxSource.negativeZ,null)},E={class:"VIEWPOINT",lon:f._earthCtrl.camera.viewPoint.lon,lat:f._earthCtrl.camera.viewPoint.lat,alt:f._earthCtrl.camera.viewPoint.alt,heading:f._earthCtrl.camera.viewPoint.heading,pitch:f._earthCtrl.camera.viewPoint.pitch,roll:f._earthCtrl.camera.viewPoint.roll,duration:f._earthCtrl.camera.viewPoint.duration};y.userScene.push(x),y.userScene.push(v),y.userScene.push(E);let I=JSON.stringify(y);A&&A(I)})}};Object.defineProperties(Doe.prototype,{rootNode:{get:function(){return this._rootNode},set:function(o){this._rootNode=o}},editNode:{get:function(){return this._editNode},set:function(o){this._editNode=o}},selectSet:{get:function(){return this._selectSet}},EventDocumentChanged:{get:function(){return this._EventDocumentChanged}},EventObjectPropertyChanged:{get:function(){return this._EventObjectPropertyChanged}}});var Toe=Doe;function Dlt(o){this._earthCtrl=o,this._coreMap=o.coreMap,this.initialize()}var S6i=new Es,D6i=new te,T6i=new te;Dlt.prototype.initialize=function(){let o=document.createElement("div");o.className="map-info-bar",o.style="position: display:none; absolute;left: 0px;bottom:0px;width: 100%;background:rgba(0,0,0,0.4); color:#e9e9e9; text-shadow:2px 2px 2px #000";let A=this._coreMap;A.container.appendChild(o);let f="float: right; min-width: 100px;margin-right: 20px;",m=document.createElement("div");m.style=f,o.appendChild(m);let C=document.createElement("div");C.style=f,o.appendChild(C);let y=document.createElement("div");y.style=f,o.appendChild(y);let x=A.scene.canvas,v=A.scene.globe.ellipsoid;new zr(x).setInputAction(function(I){let w=A.camera.pickEllipsoid(I.endPosition,v);if(w){let Q=A.scene.globe.ellipsoid.cartesianToCartographic(w),M=qe.toDegrees(Q.latitude).toFixed(6),B=qe.toDegrees(Q.longitude).toFixed(6),T=A.camera.positionCartographic.height.toFixed(1);y.innerHTML=`\u7ECF\u5EA6\uFF1A${B}`,C.innerHTML=`\u7EAC\u5EA6\uFF1A${M}`,m.innerHTML=`\u89C6\u70B9\u9AD8\uFF1A${T}\u7C73`}},Yi.MOUSE_MOVE)};var Tlt=Dlt;function cu(){}cu.parseBaseData=function(o,A){let f=[];if(O(A)&&O(A.imageryProviders))for(let C=0;C<A.imageryProviders.length;C++){let y=A.imageryProviders[C];if(y.enable===!1||y.show===!1)continue;if(O(y.tilingScheme)){let v=y.tilingScheme;v.type==="GeographicTilingScheme"&&(y.tilingScheme=new mg(v))}let x=i2.createImageryLayer(y);f.push(x)}let m=[];if(O(A)&&O(A.terrainProviders))for(let C=0;C<A.terrainProviders.length;C++){let y=A.terrainProviders[C];if(y.enable===!1||y.show===!1)continue;let x=i2.createTerrainLayer(y);m.push(x)}return{imageryProvider:f,terrainProvider:m}};cu.parse=function(o,A){if(!O(A))return;let f=[Zs.IMAGERYPROVIDERS,Zs.TERRAINPROVIDERS,Zs.MODELLAYERS,Zs.FEATURELAYERS,Zs.USERSCENE];for(let m=0;m<f.length;m++){let C=o.factory.createSceneNode(i2.createUUID(),f[m]);C.show=!0,o.userScene.addChild(o.userScene.rootNode,C)}O(A[Zs.IMAGERYPROVIDERS])&&HH(o,A[Zs.IMAGERYPROVIDERS],o.userScene.rootNode.getChildByIndex(0),0),O(A[Zs.TERRAINPROVIDERS])&&HH(o,A[Zs.TERRAINPROVIDERS],o.userScene.rootNode.getChildByIndex(1),1),O(A[Zs.MODELLAYERS])&&HH(o,A[Zs.MODELLAYERS],o.userScene.rootNode.getChildByIndex(2)),O(A[Zs.FEATURELAYERS])&&HH(o,A[Zs.FEATURELAYERS],o.userScene.rootNode.getChildByIndex(3)),O(A[Zs.USERSCENE])&&HH(o,A[Zs.USERSCENE],o.userScene.rootNode.getChildByIndex(4))};function HH(o,A,f,m){for(let C=0;C<A.length;C++){let y=A[C],x=null;if(y.enable===!1)continue;O(y.class)?(y.class==="IMAGERY"&&(y.class=vo.IMAGERY_LAYER),y.class==="TERRAIN"&&(y.class=vo.TERRAIN_LAYER),x=y.class):(m===0?y.class=vo.IMAGERY_LAYER:m===1&&(y.class=vo.TERRAIN_LAYER),x=y.class);let v=cu.parserMap[x];v!==void 0&&v(o,y,f)}}function rRi(o,A,f){let m=o.factory.createSceneNode(A.id,A.name);m.show=Ae(A.show,!0),o.userScene.addChild(f,m),O(A.childNodes)&&HH(o,A.childNodes,m)}function nRi(o,A,f){let m=A;if(O(m.tilingScheme)){let C=m.tilingScheme;C.type==="GeographicTilingScheme"&&(m.tilingScheme=new mg(C))}o.factory.createImageryLayer(m,f)}function oRi(o,A,f){let m=A;o.factory.createTerrainLayer(m,f)}function aRi(o,A,f){let m=A;m.addToMap=!0;let C=m.sourceType;C==="3DTiles"||C==="b3dm"||C==="osgb"||C==="s3m"||C==="ude_block"||C==="ude_model"?o.factory.createModelLayer(m,f):C==="czml"?o.factory.createCZMLObject(m,f):C==="wfsModel"&&o.factory.createWfsModel(m,f)}function sRi(o,A,f){let m=o.factory.createFeatureLayer(A,f)}function lRi(o,A,f){o.coreMap.scene.skyBox=new J5({sources:{positiveX:A.positiveX,negativeX:A.negativeX,positiveY:A.positiveY,negativeY:A.negativeY,positiveZ:A.positiveZ,negativeZ:A.negativeZ}})}function uRi(o,A,f){o.camera.undergroundMode=Ae(A.underGround,!1),o.shadows=Ae(A.shadow,!1),A.rain===!0&&o.environment.showEffect("rain"),A.snow===!0&&o.environment.showEffect("snow"),A.fog===!0&&o.environment.showEffect("fog"),o.coreMap.scene.globe.depthTestAgainstTerrain=Ae(A.depthTest,!1),A.bwMode===!0&&o.environment.showEffect("bwMode"),A.nightMode===!0&&o.environment.showEffect("nightMode"),A.colorAdjustment.show===!0&&(o.environment.showEffect("colorAdjustment"),o.environment.colorAdjustment.contrast=A.colorAdjustment.contrast,o.environment.colorAdjustment.saturation=A.colorAdjustment.saturation,o.environment.colorAdjustment.brightness=A.colorAdjustment.brightness)}function cRi(o,A,f){o.camera.viewPoint=A,o.camera.flyTo(A.lon,A.lat,A.alt,A.heading,A.pitch,A.roll,A.duration)}function ARi(o,A,f){o.factory.createModel(A,f)}function hRi(o,A,f){o.factory.createWaters(A,f)}function dRi(o,A,f){o.factory.createExplosion(A,f)}function fRi(o,A,f){o.factory.createFireworks(A,f)}function gRi(o,A,f){o.factory.createSmoke(A,f)}function pRi(o,A,f){o.factory.createFire(A,f)}function mRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createRadarScan(A,f)}function CRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createCircleScan(A,f)}function yRi(o,A,f){A.color&&(A.color=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.color.red,A.color.green,A.color.blue,A.color.alpha)),o.factory.createPoint(A,f)}function xRi(o,A,f){A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),o.factory.createLabel(A,f)}function vRi(o,A,f){o.factory.createBillboard(A,f)}function ERi(o,A,f){A.positions&&(A.positions=cu.array2DtoMercator(A.positions)),A.lineColor&&(A.lineColor=new ht(A.lineColor.red,A.lineColor.green,A.lineColor.blue,A.lineColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createPolyline(A,f)}function IRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.positions&&(A.positions=cu.array2DtoMercator(A.positions)),o.factory.createPolygon(A,f)}function _Ri(o,A,f){A.coordinates&&(A.coordinates=Di.fromDegrees(A.coordinates[0],A.coordinates[1],A.coordinates[2],A.coordinates[3])),A.fillColor&&(A.fillColor=new ht(A.fillColor.red,A.fillColor.green,A.fillColor.blue,A.fillColor.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),o.factory.createRectangle(A,f)}function BRi(o,A,f){o.factory.createEllipse(A,f)}function wRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.dimensions&&(A.dimensions=new te(A.dimensions.x,A.dimensions.y,A.dimensions.z)),o.factory.createBox(A,f)}function bRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),A.radii&&(A.radii=new te(A.radii[0],A.radii[1],A.radii[2])),o.factory.createEllipsoid(A,f)}function QRi(o,A,f){A.material&&(A.material=new ht(A.material.red,A.material.green,A.material.blue,A.material.alpha)),A.outlineColor&&(A.outlineColor=new ht(A.outlineColor.red,A.outlineColor.green,A.outlineColor.blue,A.outlineColor.alpha)),A.position&&(A.position=te.fromDegrees(A.position[0],A.position[1],A.position[2])),o.factory.createCylinder(A,f)}function SRi(o,A,f){o.factory.createPolylineVolume(A,f)}function DRi(o,A,f){o.factory.createVideoProjection(A,f)}function TRi(o,A,f){o.factory.createVideoProjection(A,f)}function MRi(o,A,f){o.factory.createTrack(A,f)}function PRi(o,A,f){o.factory.createHeatmap(A,f)}function RRi(o,A,f){o.factory.createEChartLayer(A,f)}function LRi(o,A,f){let m=o.factory.createElement(A);o.userScene.addChild(f,m)}cu.array2DtoMercator=function(o){let A=[];return o.forEach(function(f){let m=te.fromDegrees(f[0],f[1],f[2]);A.push(m)}),A};cu.parserMap={};cu.parserMap[vo.NODE]=rRi;cu.parserMap[vo.IMAGERY_LAYER]=nRi;cu.parserMap[vo.TERRAIN_LAYER]=oRi;cu.parserMap[vo.MODEL_LAYER]=aRi;cu.parserMap[vo.FEATURE_LAYER]=sRi;cu.parserMap[vo.SKYBOX]=lRi;cu.parserMap[vo.ENVIRONMENT]=uRi;cu.parserMap[vo.VIEWPOINT]=cRi;cu.parserMap[vo.MODEL]=ARi;cu.parserMap[vo.WATERS]=hRi;cu.parserMap[vo.EXPLOSION]=dRi;cu.parserMap[vo.FIREWORK]=fRi;cu.parserMap[vo.SMOKE]=gRi;cu.parserMap[vo.FIRE]=pRi;cu.parserMap[vo.RADARSCAN]=mRi;cu.parserMap[vo.CIRCLESCAN]=CRi;cu.parserMap[vo.POINT]=yRi;cu.parserMap[vo.LABEL]=xRi;cu.parserMap[vo.BILLBOARD]=vRi;cu.parserMap[vo.POLYLINE]=ERi;cu.parserMap[vo.POLYGON]=IRi;cu.parserMap[vo.RECTANGLE]=_Ri;cu.parserMap[vo.ELLIPSE]=BRi;cu.parserMap[vo.BOX]=wRi;cu.parserMap[vo.ELLIPSOID]=bRi;cu.parserMap[vo.CYLINDER]=QRi;cu.parserMap[vo.POLYLINEVOLUME]=SRi;cu.parserMap[vo.PERSPECTIVE_VIDEO_PROJECTION]=DRi;cu.parserMap[vo.FISHEYE_VIDEO_PROJECTION]=TRi;cu.parserMap[vo.TRACK]=MRi;cu.parserMap[vo.HEATMAP]=PRi;cu.parserMap[vo.ECHARTLAYER]=RRi;cu.parserMap.ELEMENT=LRi;var Mlt=cu;var pIe=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editBillboard=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editBillboard=f,O(this.editBillboard)&&O(this.editBillboard.entity.billboard)?console.info(this.editBillboard.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Billboard entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBillboard.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBillboard.entity)||this.pickObject(A,this.editBillboard.entity))&&this.mCallback&&this.mCallback(this.editBillboard),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editBillboard.entity.position=m}return this.mCallback&&this.mCallback(this.editBillboard),!0}updateBillboard(A){if(O(A)&&O(this.editBillboard)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBillboard.entity.position=A[C]:O(A[C])&&(this.editBillboard.entity.billboard[C]=A[C])}}}endEditEntity(){}},Plt=pIe;var mIe=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editPoint=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editPoint=f,O(this.editPoint)&&O(this.editPoint.entity.point)?console.info(this.editPoint.entity.point):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Point entity is need!"}))}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPoint.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPoint.entity)||this.pickObject(A,this.editPoint.entity))&&this.mCallback&&this.mCallback(this.editPoint),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editPoint.entity.position=m}return this.mCallback&&this.mCallback(this.editPoint),!0}updatePoint(A){if(O(A)&&O(this.editPoint)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPoint.entity.position=A[C]:O(A[C])&&(this.editPoint.entity.point[C]=A[C])}}}endEditEntity(){}},Rlt=mIe;var CIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editBox=void 0,this.pickedEntity=void 0,this.editHeightPoint=void 0,this.editWHPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.dragPosition=void 0,this.editBox=f,O(this.editBox)&&O(this.editBox.entity.box)){let y=this.editBox.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te;this.getNorthPointByDistance(v,E),this.editHeightPoint=this.mEarthCtrl.entities.add({name:"box_edit_height_point",position:v,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editHeightPoint.id),this.editWHPoint=this.mEarthCtrl.entities.add({name:"box_edit_long_width_point",position:E,point:{heightReference:this.editBox.entity.box.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.editWHPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Box entity is need!"})}addHeight(A){let f=this.editBox.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C;console.info(this.editBox.entity.position),O(m)?C=this.editBox.entity.position.getValue(m):C=this.editBox.entity.position._value;let y=Kn.eastNorthUpToFixedFrame(C),x=new te,v=this.editBox.entity.box.dimensions._value;v||(v=this.editBox.entity.box.dimensions.getValue(m)),te.divideByScalar(v,2,x),te.clone(x,A),te.clone(x,f),A.y*=-1,Ze.multiplyByPoint(y,A,A),f.y*=-1,f.z*=-1,Ze.multiplyByPoint(y,f,f)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editBox.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=void 0):f.name==="box_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=f,this.pickEditWHPoint=void 0):f.name==="box_edit_long_width_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickEditHeightPoint=void 0,this.pickEditWHPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editBox)||this.pickObject(A,this.editBox.entity))&&this.mCallback&&this.mCallback(this.editBox),this.currentPoint=void 0,this.isEditing=!1,this.dragPosition=void 0,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;let f=new Date,m=gi.fromDate(f);if(O(this.currentPoint)||O(this.pickEditHeightPoint)||O(this.pickEditWHPoint)){let C=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,y=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,C);if(!y)return;let x=$t.fromCartesian(y),v=te.fromRadians(x.longitude,x.latitude,x.height+this.height);if(O(this.currentPoint))this.currentPoint.position=v,this.editBox.entity.position=new Qn(function(){return v},!1);else if(O(this.dragPosition)){if(O(this.pickEditWHPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=te.normalize(w,new te);te.dot(w,Q,w);let M=this.editBox.entity.box.dimensions._value;M||(M=this.editBox.entity.box.dimensions.getValue(m));let B=te.clone(M);B.x-=w.x,B.y+=w.y,te.abs(B,B),this.editBox.entity.box.dimensions=new Qn(function(){return B},!1)}else if(O(this.pickEditHeightPoint)){let w=te.subtract(y,this.dragPosition,new te),Q=this.editBox.entity.box.dimensions._value;Q||(Q=this.editBox.entity.box.dimensions.getValue(m));let M=te.clone(Q);M.z+=w.z,te.abs(M,M),this.editBox.entity.box.dimensions=M,this.editBox.entity.position=this.addHeight(w.z/2)}}this.dragPosition=y;let E=new te,I=new te;this.getNorthPointByDistance(E,I,m),this.editHeightPoint.position=E,this.editWHPoint.position=I}return this.mCallback&&this.mCallback(this.editBox),!0}updateBox(A){if(O(A)&&O(this.editBox)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editBox.entity.position=A[C]:O(A[C])&&(this.editBox.entity.box[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Llt=CIe;var yIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editCylinder=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.pointsId=[],this.height=0,this.topRadiusPoint=void 0,this.pickTopRadiusPoint=void 0,this.bottomRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0,this.heightPoint=void 0,this.pickHeightPoint=void 0,this.dragPosition=void 0,this.editCylinder=f,O(this.editCylinder)&&O(this.editCylinder.entity.cylinder)){let y=this.editCylinder.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value,I=new te,w=new te,Q=new te;this.getNorthPointByDistance(I,w,Q),this.heightPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_height_point",position:Q,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.heightPoint.id),v>0&&(this.topRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_top_radius_point",position:I,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.topRadiusPoint.id)),E>0&&(this.bottomRadiusPoint=this.mEarthCtrl.entities.add({name:"cylinder_edit_bottom_radius_point",position:w,point:{heightReference:this.editCylinder.entity.cylinder.heightReference,color:ht.RED,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.bottomRadiusPoint.id))}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Cylinder entity is need!"})}addHeight(A){let f=this.editCylinder.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editCylinder.entity.position._value,y=Kn.eastNorthUpToFixedFrame(C),x=this.editCylinder.entity.cylinder.length._value,v=this.editCylinder.entity.cylinder.topRadius._value,E=this.editCylinder.entity.cylinder.bottomRadius._value;v>0&&(A.z+=x/2,A.x+=v,Ze.multiplyByPoint(y,A,A)),E>0&&(f.x+=E,f.z-=x/2,Ze.multiplyByPoint(y,f,f)),m.z+=x/2,Ze.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editCylinder.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_height_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=f,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_top_radius_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=f,this.pickBottomRadiusPoint=void 0):f.name==="cylinder_edit_bottom_radius_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickHeightPoint=void 0,this.pickTopRadiusPoint=void 0,this.pickBottomRadiusPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editCylinder)||this.pickObject(A,this.editCylinder.entity))&&this.mCallback&&this.mCallback(this.editCylinder),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.heightPoint)||O(this.topRadiusPoint)||O(this.bottomRadiusPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editCylinder.entity.position=y;else if(O(this.dragPosition)){if(O(this.pickHeightPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.length._value;M+=Q.z,M=Math.abs(M),this.editCylinder.entity.position=this.addHeight(Q.z/2),this.editCylinder.entity.cylinder.length=M}else if(O(this.pickTopRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.topRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.topRadius=M}else if(O(this.pickBottomRadiusPoint)){let Q=te.subtract(m,this.dragPosition,new te),M=this.editCylinder.entity.cylinder.bottomRadius._value;M-=Q.x,M=Math.abs(M),this.editCylinder.entity.cylinder.bottomRadius=M}}this.dragPosition=m;let x=this.editCylinder.entity.cylinder.topRadius._value,v=this.editCylinder.entity.cylinder.bottomRadius._value,E=new te,I=new te,w=new te;this.getNorthPointByDistance(E,I,w),x>0&&(this.topRadiusPoint.position=E),v>0&&(this.bottomRadiusPoint.position=I),this.heightPoint.position=w}return this.mCallback&&this.mCallback(this.editCylinder),!0}updateCylinder(A){if(O(A)&&O(this.editCylinder)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editCylinder.entity.position=A[C]:O(A[C])&&(this.editCylinder.entity.cylinder[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Flt=yIe;var xIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipse=void 0,this.pickedEntity=void 0,this.semiMajorAxisPoint=void 0,this.semiMinorAxisPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0,this.pointsId=[],this.isEditing=!1,this.circle=!1,this.editEllipse=f,O(this.editEllipse)&&O(this.editEllipse.entity.ellipse)){let y=qe.PI_OVER_TWO,x=this.updatePoint(y);this.semiMajorAxisPoint=this.mEarthCtrl.entities.add({name:"semi_major_axis_point",position:x,point:{heightReference:this.editEllipse.entity.ellipse.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.semiMajorAxisPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipse entity is need!"})}updatePoint(A){let f=new te,m=new te,C=new te,y=this.editEllipse.entity.ellipse;this.semiMinorAxis=y.semiMinorAxis._value,this.semiMajorAxis=y.semiMajorAxis._value,this.circle=this.semiMajorAxis===this.semiMinorAxis;let x=Ae(y.rotation,0);this.center=this.editEllipse.entity.position._value;let v=this.semiMinorAxis*this.semiMinorAxis,E=this.semiMajorAxis*this.semiMajorAxis,I=this.semiMajorAxis*this.semiMinorAxis,w=te.magnitude(this.center),Q=te.normalize(this.center,f),M=te.cross(te.UNIT_Z,this.center,m);M=te.normalize(M,M);let B=te.cross(Q,M,C),T=new te;return N1.pointOnEllipsoid(A,x,B,M,v,I,E,w,Q,T)}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipse.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=void 0):f.name==="semi_minor_axis_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=void 0,this.pickSemiMinorAxisPoint=f):f.name==="semi_major_axis_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickSemiMajorAxisPoint=f,this.pickSemiMinorAxisPoint=void 0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipse)||this.pickObject(A,this.editEllipse.entity))&&this.mCallback&&this.mCallback(this.editEllipse),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickSemiMajorAxisPoint)||O(this.pickSemiMinorAxisPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;if(O(this.currentPoint))this.currentPoint.position=m,this.editEllipse.entity.position=m;else if(O(this.pickSemiMajorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMajorAxis=C;let y=C*this.semiMinorAxis/this.semiMajorAxis;y>C&&(y=C),this.editEllipse.entity.ellipse.semiMinorAxis=y}else if(O(this.pickSemiMinorAxisPoint)){let C=te.distance(this.center,m);this.editEllipse.entity.ellipse.semiMinorAxis=C}this.semiMajorAxisPoint.position=this.updatePoint(qe.PI_OVER_TWO)}return this.mCallback&&this.mCallback(this.editEllipse),!0}updateEllipse(A){if(O(A)&&O(this.editEllipse)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipse.entity.position=A[C]:O(A[C])&&(this.editEllipse.entity.ellipse[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Nlt=xIe;var vIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editEllipsoid=void 0,this.pickedEntity=void 0,this.height=0,this.isEditing=!1,this.pointsId=[],this.radiiXPoint=void 0,this.pickRadiiXPoint=void 0,this.radiiYPoint=void 0,this.pickRadiiYPoint=void 0,this.radiiZPoint=void 0,this.pickRadiiZPoint=void 0,this.dragPosition=void 0,this.editEllipsoid=f,O(this.editEllipsoid)&&O(this.editEllipsoid.entity.ellipsoid)){console.info(this.editEllipsoid.ellipsoid);let y=this.editEllipsoid.entity.position._value,x=$t.fromCartesian(y);this.height=x.height;let v=new te,E=new te,I=new te;this.getNorthPointByDistance(v,E,I),this.radiiXPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_x_point",position:v,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiXPoint.id),this.radiiYPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_y_point",position:E,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiYPoint.id),this.radiiZPoint=this.mEarthCtrl.entities.add({name:"ellipse_edit_z_point",position:I,point:{heightReference:this.editEllipsoid.entity.ellipsoid.heightReference,color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}}),this.pointsId.push(this.radiiZPoint.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Ellipsoid entity is need!"})}addHeight(A){let f=this.editEllipsoid.entity.position._value,m=$t.fromCartesian(f);return this.height=m.height+A,te.fromRadians(m.longitude,m.latitude,this.height)}getNorthPointByDistance(A,f,m){let C=this.editEllipsoid.entity.position._value,y=Kn.eastNorthUpToFixedFrame(C),x=this.editEllipsoid.entity.ellipsoid.radii._value;A.x=x.x,Ze.multiplyByPoint(y,A,A),f.y=-x.y,Ze.multiplyByPoint(y,f,f),m.z=x.z,Ze.multiplyByPoint(y,m,m)}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editEllipsoid.entity.id?(this.isEditing=!0,this.currentPoint=f,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_x_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=f,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_y_point"?(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=f,this.pickRadiiZPoint=void 0):f.name==="ellipse_edit_z_point"&&(this.isEditing=!0,this.currentPoint=void 0,this.pickRadiiXPoint=void 0,this.pickRadiiYPoint=void 0,this.pickRadiiZPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editEllipsoid)||this.pickObject(A,this.editEllipsoid.entity))&&this.mCallback&&this.mCallback(this.editEllipsoid),this.currentPoint=void 0,this.dragPosition=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)||O(this.pickRadiiXPoint)||O(this.pickRadiiYPoint)||O(this.pickRadiiZPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=te.fromRadians(C.longitude,C.latitude,C.height+this.height);if(O(this.currentPoint))this.currentPoint.position=y,this.editEllipsoid.entity.position=y;else{if(O(this.dragPosition)){let I=te.subtract(m,this.dragPosition,new te),w=te.normalize(I,new te);te.dot(I,w,I);let Q=this.editEllipsoid.entity.ellipsoid.radii._value,M=te.clone(Q);O(this.pickRadiiXPoint)?M.x-=I.x:O(this.pickRadiiYPoint)?M.y+=I.y:O(this.pickRadiiZPoint)&&(M.z+=I.z,this.editEllipsoid.entity.position=this.addHeight(I.z)),te.abs(M,M),this.editEllipsoid.entity.ellipsoid.radii=M}this.dragPosition=m}let x=new te,v=new te,E=new te;this.getNorthPointByDistance(x,v,E),this.radiiXPoint.position=x,this.radiiYPoint.position=v,this.radiiZPoint.position=E}return this.mCallback&&this.mCallback(this.editEllipsoid),!0}updateEllipsoid(A){if(O(A)&&O(this.editEllipsoid)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editEllipsoid.entity.position=A[C]:O(A[C])&&(this.editEllipsoid.entity.ellipsoid[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},klt=vIe;var EIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolygon=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolygon=f,O(this.editPolygon)&&O(this.editPolygon.entity.polygon))for(let y=0;y<this.editPolygon.entity.polygon.hierarchy._value.positions.length;y++){let x=this.editPolygon.entity.polygon.hierarchy._value.positions[y],v=this.mEarthCtrl.entities.add({name:"polygon_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polygon entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolygon.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polygon_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolygon)||this.pickObject(A,this.editPolygon.entity))&&this.mCallback&&this.mCallback(this.editPolygon),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolygon.entity.polygon.hierarchy=C}return this.mCallback&&this.mCallback(this.editPolygon),!0}updatePolygon(A){if(O(A)&&O(this.editPolygon)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolygon.entity.polygon[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Olt=EIe;var IIe=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editModel=void 0,this.pickedEntity=void 0,this.editColor=ht.RED.withAlpha(.8),this.isEditing=!1,this.editModel=f,this.oldColor=this.editModel.entity.color,this.editModel.entity.color=this.editColor,O(this.editModel)&&O(this.editModel.entity)?console.info(this.editModel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"gltf Model is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f===this.editModel.parameter.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editModel)||this.pickObject(A,this.editModel.entity))&&this.mCallback&&this.mCallback(this.editModel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=$t.clone(C);y.longitude=qe.toDegrees(y.longitude),y.latitude=qe.toDegrees(y.latitude),this.editModel.lon=y.longitude,this.editModel.lat=y.latitude}return this.mCallback&&this.mCallback(this.editModel),!0}updateModel(A){if(O(A)&&O(this.editModel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];if(O(A[C]))switch(C){case"lon":case"lat":case"alt":case"heading":case"pitch":case"roll":this.editModel[C]=A[C];break;default:this.editModel.entity[C]=A[C];break}}}}endEditEntity(){this.editModel.entity.color=this.oldColor}},Ult=IIe;var _Ie=class extends Ja{constructor(A,f,m,C){super(A,m,C),this.editLabel=void 0,this.pickedEntity=void 0,this.isEditing=!1,this.editLabel=f,O(this.editLabel)&&O(this.editLabel.entity.label)?console.info(this.editLabel.entity):(this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Label entity is need!"}))}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editLabel.entity.id&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editLabel.entity)||this.pickObject(A,this.editLabel.entity))&&this.mCallback&&this.mCallback(this.editLabel),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m,this.editLabel.entity.position=m}return this.mCallback&&this.mCallback(this.editLabel),!0}updateLabel(A){if(O(A)&&O(this.editLabel)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editLabel.entity.position=A[C]:O(A[C])&&(this.editLabel.entity.label[C]=A[C])}}}endEditEntity(){}},Glt=_Ie;var BIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolyline=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolyline=f,O(this.editPolyline)&&O(this.editPolyline.polyline))for(let y=0;y<this.editPolyline.polyline.positions._value.length;y++){let x=this.editPolyline.polyline.positions._value[y],v=this.mEarthCtrl.entities.add({name:"polyline_point",position:x,point:{color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Polyline entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolyline.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="polyline_point"&&(this.currentPoint=f,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolyline)||this.pickObject(A,this.editPolyline.entity))&&this.mCallback&&this.mCallback(this.editPolyline),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolyline.polyline.positions=C}return this.mCallback&&this.mCallback(this.editPolyline),!0}updatePolyline(A){if(O(A)&&O(this.editPolyline)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];O(A[C])&&(this.editPolyline.polyline[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Hlt=BIe;var wIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editPolylineVolume=void 0,this.pickedEntity=void 0,this.currentPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editPolylineVolume=f,O(this.editPolylineVolume)&&O(this.editPolylineVolume.entity.polylineVolume))for(let y=0;y<this.editPolylineVolume.entity.polylineVolume.positions._value.length;y++){let x=this.editPolylineVolume.entity.polylineVolume.positions._value[y],v=this.mEarthCtrl.entities.add({name:"edit_polylineVolume_point",position:x,point:{color:ht.WHITE,pixelSize:12,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(v.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"PolylineVolume entity is need!"})}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editPolylineVolume.entity.id?(this.isEditing=!0,this.currentPoint=void 0):f.name==="edit_polylineVolume_point"&&(this.isEditing=!0,this.currentPoint=f),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editPolylineVolume)||this.pickObject(A,this.editPolylineVolume.entity))&&this.mCallback&&this.mCallback(this.editPolylineVolume),this.currentPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.currentPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;this.currentPoint.position=m;let C=[];for(let y=0;y<this.pointsId.length;y++){let x=this.pointsId[y];C.push(this.mEarthCtrl.entities.getById(x).position._value)}this.editPolylineVolume.entity.polylineVolume.positions=C}return this.mCallback&&this.mCallback(this.editPolylineVolume),!0}updatePolylineVolume(A){if(O(A)&&O(this.editPolylineVolume)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editPolylineVolume.entity.position=A[C]:O(A[C])&&(this.editPolylineVolume.entity.polylineVolume[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},Vlt=wIe;var bIe=class extends Ja{constructor(A,f,m,C){if(super(A,m,C),this.editRectangle=void 0,this.pickedEntity=void 0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.pointsId=[],this.isEditing=!1,this.editRectangle=f,O(this.editRectangle)&&O(this.editRectangle.entity.rectangle)){let y=this.editRectangle.entity.rectangle.coordinates._value,x=this.editRectangle.entity.rectangle.height._value,v=Di.northwest(y),E=te.fromRadians(v.longitude,v.latitude,x),I=this.mEarthCtrl.entities.add({name:"rect_left_top_point",position:E,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(I.id),v=Di.southeast(y);let w=te.fromRadians(v.longitude,v.latitude,x),Q=this.mEarthCtrl.entities.add({name:"rect_right_bottom_point",position:w,point:{heightReference:this.editRectangle.entity.rectangle.heightReference,color:ht.WHITE,pixelSize:8,outlineColor:ht.BLACK,outlineWidth:1}});this.pointsId.push(Q.id)}else this.mEnable=!1,this.mCallback&&this.mCallback({msg:"Rectangle entity is need!"})}destory(){}onLButtonDown(A){if(super.onLButtonDown(A),this.pickedEntity={},this.pickObject(A,this.pickedEntity)){let f=this.pickedEntity.pickedObject.id;f.id===this.editRectangle.entity.id?(this.isEditing=!0,this.leftTopPoint=void 0,this.rightBottomPoint=void 0):f.name==="rect_left_top_point"?(this.leftTopPoint=f,this.rightBottomPoint=void 0,this.isEditing=!0):f.name==="rect_right_bottom_point"&&(this.rightBottomPoint=f,this.leftTopPoint=void 0,this.isEditing=!0),this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!1,this.mEarthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!1}}onLButtonUp(A){return super.onLButtonUp(A)===!1||!this.isEditing?!1:((O(this.editRectangle)||this.pickObject(A,this.editRectangle.entity))&&this.mCallback&&this.mCallback(this.editRectangle),this.leftTopPoint=void 0,this.rightBottomPoint=void 0,this.isEditing=!1,!0)}onLButtonDrag(A){if(!this.isEditing)return!1;if(O(this.leftTopPoint)||O(this.rightBottomPoint)){let f=this.mEarthCtrl.coreMap.scene.globe.ellipsoid,m=this.mEarthCtrl.coreMap.camera.pickEllipsoid(A,f);if(!m)return;let C=$t.fromCartesian(m),y=this.editRectangle.entity.rectangle.coordinates._value;O(this.leftTopPoint)?(this.leftTopPoint.position=m,y.west=C.longitude,y.north=C.latitude):O(this.rightBottomPoint)&&(this.rightBottomPoint.position=m,y.south=C.latitude,y.east=C.longitude),this.editRectangle.entity.rectangle.coordinates=y}return this.mCallback&&this.mCallback(this.editRectangle),!0}updateRectangle(A){if(O(A)&&O(this.editRectangle)){let f=Object.keys(A);for(let m=0;m<f.length;m++){let C=f[m];C==="position"?this.editRectangle.entity.position=A[C]:O(A[C])&&(this.editRectangle.entity.rectangle[C]=A[C])}}}endEditEntity(){for(let A=0;A<this.pointsId.length;A++){let f=this.pointsId[A];this.mEarthCtrl.entities.removeById(f)}this.pointsId=[]}},zlt=bIe;function wd(o){this._earthCtrl=o,this._coreMap=o.coreMap}wd.prototype.editPoint=function(o,A){this._earthCtrl.tools.clearTool();let f=new Rlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("point_edit_tool",f),f};wd.prototype.updatePoint=function(o,A){o.updatePoint(A)};wd.prototype.editPolyline=function(o,A){this._earthCtrl.tools.clearTool();let f=new Hlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polyline_edit_tool",f),f};wd.prototype.updatePolyline=function(o,A){o.updatePolyline(A)};wd.prototype.editPolygon=function(o,A){this._earthCtrl.tools.clearTool();let f=new Olt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polygon_edit_tool",f),f};wd.prototype.updatePolygon=function(o,A){o.updatePolygon(A)};wd.prototype.editBox=function(o,A){this._earthCtrl.tools.clearTool();let f=new Llt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("box_edit_tool",f),f};wd.prototype.updateBox=function(o,A){o.updateBox(A)};wd.prototype.editEllipsoid=function(o,A){this._earthCtrl.tools.clearTool();let f=new klt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipsoid_edit_tool",f),f};wd.prototype.updateEllipsoid=function(o,A){o.updateEllipsoid(A)};wd.prototype.editCylinder=function(o,A){this._earthCtrl.tools.clearTool();let f=new Flt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("cylinder_edit_tool",f),f};wd.prototype.updateCylinder=function(o,A){o.updateCylinder(A)};wd.prototype.editModel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Ult(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("model_edit_tool",f),f};wd.prototype.updateModel=function(o,A){o.updateModel(A)};wd.prototype.editBillboard=function(o,A){this._earthCtrl.tools.clearTool();let f=new Plt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("billboard_edit_tool",f),f};wd.prototype.updateBillboard=function(o,A){o.updateBillboard(A)};wd.prototype.editLabel=function(o,A){this._earthCtrl.tools.clearTool();let f=new Glt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("label_edit_tool",f),f};wd.prototype.updateLabel=function(o,A){o.updateLabel(A)};wd.prototype.editRectangle=function(o,A){this._earthCtrl.tools.clearTool();let f=new zlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("rectangle_edit_tool",f),f};wd.prototype.updateRectangle=function(o,A){o.updateRectangle(A)};wd.prototype.editEllipse=function(o,A){this._earthCtrl.tools.clearTool();let f=new Nlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("ellipse_edit_tool",f),f};wd.prototype.updateEllipse=function(o,A){o.updateEllipse(A)};wd.prototype.editPolylineVolume=function(o,A){this._earthCtrl.tools.clearTool();let f=new Vlt(this._earthCtrl,o,function(m){A&&A(m)});return this._earthCtrl.tools.registerTool("polylinevolume_edit_tool",f),f};wd.prototype.updatePolylineVolume=function(o,A){o.updatePolylineVolume(A)};wd.prototype.endEditEntity=function(o){this._earthCtrl.tools.clearTool(),o.endEditEntity(),this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableRotate=!0,this._earthCtrl.coreMap.scene.screenSpaceCameraController.enableZoom=!0};var Moe=wd;function fy(o){this.mEarthCtrl=o,this.scene=this.mEarthCtrl.coreMap.scene,this.entities=this.mEarthCtrl.entities,this.camera=this.mEarthCtrl.coreMap.camera,this._points=[],this.item=void 0}fy.prototype.horizontalDistance=function(o,A){let f=this,m=!1,C=[],y="",x=[],v,E=this.scene.globe.ellipsoid,I={spot:[],distance:[],label:[],polyline:[]},w={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(w.point=A.point),O(A.polyline)&&(w.polyline=A.polyline));let Q=new k_;this.scene.primitives.add(Q);let M=new YA,B=new zr(f.scene.canvas),T=document.createElement("div");Zc(".map-widget",T),Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let F=document.getElementById("toolTip");F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let L;m=!0;let R=function(V){let U=0,W=`${0}\u7C73`,ie,ee,oe,ne,se,ce;for(let J=0;J<V.length-1;J+=1)ie=E.cartesianToCartographic(V[J]),ee=M.project(ie),oe=ee.x,ne=ee.y,ie=E.cartesianToCartographic(V[J+1]),ee=M.project(ie),se=ee.x,ce=ee.y,U=U+Math.sqrt((oe-se)*(oe-se)+(ne-ce)*(ne-ce));return U>0&&(W=`${U.toFixed(2)}\u7C73`),U/1e3>=1&&(W=`${(U/1e3).toFixed(2)}\u5343\u7C73`),W},k=function(){function V(U){if(!O(U))throw new Hi("positions is required!");if(U.length<2)throw new Hi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E2");let W=hs.fromType(hs.ColorType);W.uniforms.color=new ht(1,1,0,.5),this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:w.polyline,width:3,clampToGround:!0}},this.path=U,this._init()}return V.prototype._init=function(){let U=this,W=function(){return U.path};this.options.polyline.positions=new Qn(W,!1),this.lineEntity=f.entities.add(this.options),f.item=this.lineEntity,I.polyline.push(this.lineEntity)},V}();B.setInputAction(function(V){let U,W;F.style.left=`${V.endPosition.x+10}px`,F.style.top=`${V.endPosition.y+20}px`,F.style.display="block",F.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ie=!1,ee=f.camera.getPickRay(V.endPosition);ee&&(U=f.scene.globe.pick(ee,f.scene));let oe=f.scene.pick(V.endPosition);if(oe){console.log("feature",oe);let ne=f.scene.pickPosition(V.endPosition);ne&&(U=ne),ie=!0}if(!!U&&(W=Pi.WGS84.cartesianToCartographic(U),W)){let ne;ie?ne=f.scene.sampleHeight(W):ne=f.scene.globe.getHeight(W);let se=te.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,ne);if(m){if(C.length<1)return;O(v)?(v.path.pop(),v.path.push(se)):(C.push(se),v=new k(C));let ce=R(v.path);f.entities.remove(L),L=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:v.path[v.path.length-1],label:{text:`\u603B\u957F\uFF1A${ce}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}})}}},Yi.MOUSE_MOVE);let G=function(V){x.push(V);let U=[];if(x.length>1){let W=x[x.length-2],ie=x[x.length-1],ee=Math.abs(W.longitude-ie.longitude)*1e7,oe=Math.abs(W.latitude-ie.latitude)*1e7;ee>oe&&(oe=ee);let ne=parseInt(oe/10);ne>1e3&&(ne=1e3),ne<2&&(ne=2);for(let se=0;se<ne;++se)U.push(new $t(qe.lerp(W.longitude,ie.longitude,se/(ne-1)),qe.lerp(W.latitude,ie.latitude,se/(ne-1))));U.push(ie.clone())}else U=x;if(U.length>0)for(let W=0;W<U.length;W++){V=U[W];let ie=f.scene.globe.getHeight(V),ee=te.fromDegrees(V.longitude/Math.PI*180,V.latitude/Math.PI*180,ie);C.push(ee)}};return B.setInputAction(function(V){let U,W,ie=!1,ee=f.camera.getPickRay(V.position);if(ee&&(U=f.scene.globe.pick(ee,f.scene)),f.scene.pick(V.position)){let ne=f.scene.pickPosition(V.position);ne&&(U=ne),ie=!0}if(U&&(W=Pi.WGS84.cartesianToCartographic(U)),W){let ne;ie?ne=f.scene.sampleHeight(W):ne=f.scene.globe.getHeight(W);let se=te.fromDegrees(W.longitude/Math.PI*180,W.latitude/Math.PI*180,ne);if(m){v&&v.path.pop(),G(W);let ce="0\u7C73";v&&(ce=R(v.path)),y=ce,I.spot.push(se),I.distance.push(ce);let J=f.entities.add({position:se,point:{pixelSize:5,color:w.point,outlineColor:ht.WHITE,outlineWidth:1,clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:ce,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),clampToGround:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY}});I.label.push(J),f._points.push(J)}}},Yi.LEFT_CLICK),B.setInputAction(function(){f.entities.remove(L),f._points[f._points.length-1].label.text=y,B.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(I),F.style.display="none"},Yi.RIGHT_CLICK),this};fy.prototype.spaceDistance=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=new zr(f.scene.canvas),C=[],y=null,x="0\u7C73",v=null,E,I="",w,Q=document.createElement("div");Zc(".map-widget",Q),Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let B=document.getElementById("toolTip");B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let T={name:"",spot:[],distance:[],label:[],ployline:[]},D={point:ht.RED,polyline:ht.fromRgba(4286644096)};O(A)&&(O(A.point)&&(D.point=A.point),O(A.polyline)&&(D.polyline=A.polyline));let F=function(){function L(R){this.options={name:"\u76F4\u7EBF",polyline:{show:!0,positions:[],material:D.polyline,width:3,clampToGround:!1}},this.positions=R,this._init()}return L.prototype._init=function(){let R=this,k=function(){return R.positions};this.options.polyline.positions=new Qn(k,!1);let G=f.entities.add(this.options);f.item=G,T.ployline.push(G);let V=f.getuid();T.name=`\u65B0\u5EFA\u7A7A\u95F4\u8DDD\u79BB${V}`},L}();return m.setInputAction(function(L){if(f.scene.bim){let R=f.scene.bim.PickWorldPositionSync(L.endPosition.x,L.endPosition.y);R[0]===0?v=f.scene.pickPosition(L.endPosition):v=new te(R[0],R[1],R[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.endPosition);!v||(B.style.left=`${L.endPosition.x+10}px`,B.style.top=`${L.endPosition.y+20}px`,B.style.display="block",C.length>=2&&(O(y)?(C.pop(),C.push(v)):y=new F(C),B.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>',x=f.getSpaceDistance(C)),f.entities.remove(w),w=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],label:{text:`\u603B\u957F\uFF1A${x}`,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),disableDepthTestDistance:Number.POSITIVE_INFINITY}}))},Yi.MOUSE_MOVE),m.setInputAction(function(L){if(f.scene.bim){let k=f.scene.bim.PickWorldPositionSync(L.position.x,L.position.y);k[0]===0?v=f.scene.pickPosition(L.position):v=new te(k[0],k[1],k[2]),console.log("????????",v)}else v=f.scene.pickPosition(L.position);if(!v)return;C.length===0&&C.push(v.clone()),C.push(v);let R=x;I=`\u603B\u957F\uFF1A${x}`,E=f.entities.add({name:"\u7A7A\u95F4\u76F4\u7EBF\u8DDD\u79BB",position:C[C.length-1],point:{pixelSize:5,color:D.point,outlineColor:ht.WHITE,outlineWidth:2,clampToGround:!1,disableDepthTestDistance:Number.POSITIVE_INFINITY},label:{text:R,show:!0,font:"26px \u6977\u4F53",fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-20),heightReference:In.NONE,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(E),T.spot.push(v),T.distance.push(x),T.label.push(E)},Yi.LEFT_CLICK),m.setInputAction(function(L){B.style.display="none",f.entities.remove(w),f._points.length>0&&(f._points[f._points.length-1].label.text=I),m.destroy(),C.pop(),O(o)&&typeof o=="function"&&o(T)},Yi.RIGHT_CLICK),this};fy.prototype.getSpaceDistance=function(o){let A=0,f="";for(let m=0;m<o.length-1;m++){let C=$t.fromCartesian(o[m]),y=$t.fromCartesian(o[m+1]),x=new xp;x.setEndPoints(C,y);let v=x.surfaceDistance;v=Math.sqrt(Math.pow(v,2)+Math.pow(y.height-C.height,2)),A=A+v}return A>=1e3?f=`${(A/1e3).toFixed(2)}\u5343\u7C73`:f=`${A.toFixed(2)}\u7C73`,f};fy.prototype.getPlaneArea=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m=0,C=new zr(f.scene._imageryLayerCollection),y=document.getElementById("toolTip");y||(Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>'),y=document.getElementById("toolTip")),y.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB\uFF0C\u53F3\u952E\u7ED3\u675F\uFF01</span>';let x=[],v={},E=[],I=[],w=null,Q=null,M,B={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(B.point=A.point),O(A.polyline)&&(B.polyline=A.polyline),O(A.polygon)&&(B.polygon=A.polygon));let T={mj:0,label:[],polygon:[]};y.style.display="block";let D=function(){function F(L){this.options={name:"\u591A\u8FB9\u5F62",polygon:{hierarchy:[],perPositionHeight:!0,material:B.polygon,clampToGround:!1}},this.hierarchy=L,this._init()}return F.prototype._init=function(){let L=this,R=function(){return L.hierarchy};this.options.polygon.hierarchy=new Qn(R,!1),this.polygon=f.entities.add(this.options),f.item=this.polygon,f._entity=this.polygon,T.polygon=this.polygon},F}();return C.setInputAction(function(F){if(y.style.left=`${F.endPosition.x+10}px`,y.style.top=`${F.endPosition.y+20}px`,f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.endPosition.x,F.endPosition.y);V[0]===0?Q=f.scene.pickPosition(F.endPosition):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.endPosition);if(!Q)return;let L=$t.fromCartesian(Q),R=qe.toDegrees(L.longitude),k=qe.toDegrees(L.latitude),G=L.height;if(x.length>=2){O(w)?(x.pop(),x.push(Q),v=new Hn(x),I.pop(),I.push({lon:R,lat:k,hei:G})):(v=new Hn(x),w=new D(v));let V=f.getArea(I,x);f.entities.remove(M),M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:V,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),T.label=M}},Yi.MOUSE_MOVE),C.setInputAction(function(F){if(f.scene.bim){let V=f.scene.bim.PickWorldPositionSync(F.position.x,F.position.y);V[0]===0?Q=f.scene.pickPosition(F.position):Q=new te(V[0],V[1],V[2])}else Q=f.scene.pickPosition(F.position);if(!Q)return;let L=$t.fromCartesian(Q);console.log("\u5DE6\u952E\u70B9",L);let R=qe.toDegrees(L.longitude),k=qe.toDegrees(L.latitude),G=L.height;x.length===0&&(x.push(Q.clone()),v=new Hn(x),I.push({lon:R,lat:k,hei:G}),x.push(Q.clone()),v=new Hn(x),I.push({lon:R,lat:k,hei:G})),x.push(Q),v=new Hn(x),E.push({lon:R,lat:k,hei:G}),I.push({lon:R,lat:k,hei:G})},Yi.LEFT_CLICK),C.setInputAction(function(F){y.style.display="none",f.entities.remove(M),C.destroy();let L=f.getArea(I,x);m=L;let R=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:x[x.length-1],label:{text:L,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}});f._points.push(R),f._lable=R,T.mj=m,T.label=R,O(o)&&typeof o=="function"&&o(T)},Yi.RIGHT_CLICK),this};fy.prototype.getSurfaceArea3d=function(o,A){let f=this;f.scene.globe.depthTestAgainstTerrain=!0;let m={mj:0,label:[],polygon:[]},C=!0,y=[],x={},v,E=f.scene,I=E.globe.ellipsoid,w=new k_;E.primitives.add(w);let Q,M,B=0,T={point:ht.RED,polyline:ht.fromRgba(4286644096),polygon:ht.fromRgba(4286644096).withAlpha(.5)};O(A)&&(O(A.point)&&(T.point=A.point),O(A.polyline)&&(T.polyline=A.polyline),O(A.polygon)&&(T.polygon=A.polygon));let D=document.createElement("div");Zc(".map-widget",D),Zc(".map-widget",'<div id="toolTip" style="display: none;position: absolute;visibility: visible;max-width: 200px;min-width: 100px;padding: 1px 1px 1px 25px;font-size: 11px;z-index: 1000;opacity: 0.8;background-color: rgba(0,0,0,0.7);border-radius: 3px;"></div>');let L=document.getElementById("toolTip");L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u5DE6\u952E\u5F00\u59CB,\u53F3\u952E\u7ED3\u675F\uFF01</span>';let R=new zr(E.canvas),k=function(){function V(U){if(!O(U))throw new Hi("positions is required!");if(U.length<3)throw new Hi("positions \u7684\u957F\u5EA6\u5FC5\u987B\u5927\u4E8E\u7B49\u4E8E3");this.options={polygon:{show:!0,hierarchy:void 0,material:T.polygon,clampToGround:!1}},this.path=U,this._init()}return V.prototype._init=function(){let U=this,W=function(){return U.path};this.options.polygon.hierarchy=new Qn(W,!1),this.polygonEntity=f.entities.add(this.options),f.item=this.polygonEntity,m.polygon=this.polygonEntity,f._entity=this.polygonEntity},V}();R.setInputAction(function(V){let U=0;f.entities.remove(M);let W,ie,ee=f.scene.camera.getPickRay(V.endPosition);ee&&(W=f.scene.globe.pick(ee,f.scene));let oe=f.scene.pick(V.endPosition),ne=!1;if(oe){let ce=f.scene.pickPosition(V.endPosition);ce&&(W=ce),ne=!0}if(!W)return;let se=function(ce){let J=new Array(ce.length),he=function(Ie){return Ie.longitude=Ie.longitude/Math.PI*180,Ie.latitude=Ie.latitude/Math.PI*180,Ie},Ce=function(Ie){let be=0;for(let Be=0;Be<Ie.length;Be++){let me=Ie[Be],z;Be<Ie.length-1?z=Ie[Be+1]:z=Ie[0],be+=me.x*z.y-z.x*me.y}return be/2};for(let Ie=0;Ie<ce.length;Ie++)J[Ie]=he(I.cartesianToCartographic(ce[Ie]));let Ee=0;for(let Ie=0;Ie<J.length;Ie++)Ee+=J[Ie].longitude;Ee=Ee/J.length;for(let Ie=0;Ie<J.length;Ie++)J[Ie]=f.Gauss_to_XY(J[Ie].longitude,J[Ie].latitude,Ee);return Math.abs(Ce(J))};if(ie=Pi.WGS84.cartesianToCartographic(W),ie&&C){if(L.style.left=`${V.endPosition.x+10}px`,L.style.top=`${V.endPosition.y+20}px`,L.style.display="block",y.length<2){B===1&&(M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:`${U}\u5E73\u65B9\u5343\u7C73`,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M);return}if(O(v)?(v.path.positions.pop(),v.path.positions.push(W)):(y.push(W),x=new Hn(y),v=new k(x)),y.length>=2){L.innerHTML='<span style="font-family:\u9ED1\u4F53;color:white;font-weight: bolder;font-size: 14px">\u53F3\u952E\u7ED3\u675F\uFF01</span>';let ce=String(se(v.path.positions));ce=ce.substr(0,ce.indexOf(".",0)),ce.length<6?U=`${ce}\u5E73\u65B9\u7C73`:(ce=String(ce/1e6),ce=ce.substr(0,ce.indexOf(".",0)+3),U=`${ce}\u5E73\u65B9\u5343\u7C73`),m.mj=U,M=f.entities.add({name:"\u591A\u8FB9\u5F62\u9762\u79EF",position:W,label:{text:U,font:"26px \u6977\u4F53",show:!0,fillColor:ht.WHITE,style:bA.FILL_AND_OUTLINE,outlineWidth:2,verticalOrigin:Bn.BOTTOM,pixelOffset:new wt(20,-40),heightReference:In.CLAMP_TO_GROUND,disableDepthTestDistance:Number.POSITIVE_INFINITY}}),f._points.push(M),m.label=M}}},Yi.MOUSE_MOVE),R.setInputAction(function(V){let U;B=1;let W=f.scene.camera.getPickRay(V.position);W&&(U=f.scene.globe.pick(W,f.scene));let ie=f.scene.pick(V.position),ee=!1;if(ie){let oe=f.scene.pickPosition(V.position);oe&&(U=oe),ee=!0}U&&C&&(y.push(U),x=new Hn(y))},Yi.LEFT_CLICK),R.setInputAction(function(){R.removeInputAction(Yi.LEFT_CLICK),R.removeInputAction(Yi.LEFT_DOUBLE_CLICK),f.trackedEntity=void 0,C=!1,Q=w.add({show:!0,id:"measureTool",position:y[y.length-1],pixelOffset:new wt(0,20),eyeOffset:new te(0,0,0),horizontalOrigin:cA.CENTER,verticalOrigin:Bn.CENTER,scale:1,color:new ht(1,1,1,1)}),L.style.display="none",R.destroy(),O(o)&&typeof o=="function"&&o(m)},Yi.RIGHT_CLICK);let G=function(V){let U=0,W=0,ie=0;for(let oe=0;oe<V.length;oe++)U+=V[oe].x,W+=V[oe].y,ie+=V[oe].z;return new te(U/V.length,W/V.length,ie/V.length)};return this};fy.prototype.to_N=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137;return 6378137/Math.sqrt(1-m*m*Math.sin(o)*Math.sin(o))};fy.prototype.to_Sm=function(o){let f=63567523142e-4,m=Math.sqrt(6378137*6378137-f*f)/6378137,C,y,x,v,E;return C=1+m*m*3/4+Math.pow(m,4)*45/64+Math.pow(m,6)*175/256+Math.pow(m,8)*11025/16384,y=Math.pow(m,2)*3/4+Math.pow(m,4)*15/16+Math.pow(m,6)*525/512+Math.pow(m,8)*2205/2048,x=Math.pow(m,4)*15/64+Math.pow(m,6)*105/256+Math.pow(m,8)*2205/4096,v=Math.pow(m,6)*35/512+Math.pow(m,8)*315/2048,E=Math.pow(m,8)*315/16384,6378137*(1-m*m)*(C*o-y/2*Math.sin(2*o)+x/4*Math.sin(4*o)-v/6*Math.sin(6*o)+E/8*Math.sin(8*o))};fy.prototype.to_Radian=function(o){return o*Math.PI/180};fy.prototype.Gauss_to_XY=function(o,A,f){let C=63567523142e-4,y=Math.sqrt(6378137*6378137-C*C)/C,x=0,v=0,E=0,I=0,w=this.to_Radian(f);A=this.to_Radian(A),o=this.to_Radian(o);let Q=o-w,M=Math.cos(A);I=this.to_N(A),E=I*Math.cos(A),x=Math.tan(A),v=y*M;let B=Math.pow(x,2),T=Math.pow(x,4),D=Math.pow(v,2),F=Math.pow(v,4),L=Math.pow(M,3),R=Math.pow(M,5),k=this.to_Sm(A)+Math.pow(Q,2)/2*E*M*x+Math.pow(Q,4)/24*x*E*L*(5-B+9*D+4*F)+Math.pow(Q,6)/720*x*E*R*(61-58*x*x+T+270*D-330*x*x*D),G=Q*I*M+Math.pow(Q,3)/6*I*L*(1-x*x+v*v)+Math.pow(Q,5)/120*I*R*(5-18*x*x+T+14*D-58*D*B);return new wt(G,k)};fy.prototype.getArea=function(o,A){let f=0;for(let m=0;m<o.length-2;m++){let C=(m+1)%o.length,y=(m+2)%o.length,x=this.Angle(o[m],o[C],o[y]),v=this.getdistance(A[m],A[C]),E=this.getdistance(A[C],A[y]);f+=v*E*Math.abs(Math.sin(x))}return f<1e6?f=`${f.toFixed(4)}\u5E73\u65B9\u7C73`:f=`${(f/1e6).toFixed(4)}\u5E73\u65B9\u5343\u7C73`,f};fy.prototype.getdistance=function(o,A){let f=$t.fromCartesian(o),m=$t.fromCartesian(A),C=new xp;C.setEndPoints(f,m);let y=C.surfaceDistance;return y=Math.sqrt(Math.pow(y,2)+Math.pow(m.height-f.height,2)),y};fy.prototype.Bearing=function(o,A){let f=Math.PI/180,m=180/Math.PI,C=o.lat*f,y=o.lon*f,x=A.lat*f,v=A.lon*f,E=-Math.atan2(Math.sin(y-v)*Math.cos(x),Math.cos(C)*Math.sin(x)-Math.sin(C)*Math.cos(x)*Math.cos(y-v));return E<0&&(E+=Math.PI*2),E=E*m,E};fy.prototype.Angle=function(o,A,f){let m=this.Bearing(A,o),C=this.Bearing(A,f),y=m-C;return y<0&&(y+=360),y};fy.prototype.getuid=function(){return this.uuid(8,16)};fy.prototype.uuid=function(o,A){let f="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split(""),m=[],C;if(A=A||f.length,o)for(C=0;C<o;C++)m[C]=f[0|qe.nextRandomNumber()*A];else{let y;for(m[8]=m[13]=m[18]=m[23]="-",m[14]="4",C=0;C<36;C++)m[C]||(y=0|qe.nextRandomNumber()*16,m[C]=f[C===19?y&3|8:y])}return m.join("")};fy.prototype.deleteObject=function(){if(this.entities.remove(this.item),this._points.length>0){for(let o=0;o<this._points.length;o++)this.entities.remove(this._points[o]);this._points=[]}try{this.scene.primitives.remove(this.item)}catch(o){console.log(o)}this.item=void 0};var lJ=fy;function tw(o,A){this._earthCtrl=o,this._coreMap=this._earthCtrl.coreMap,this._show=Ae(A.show,!0),this._lon=Ae(A.lon,121),this._lat=Ae(A.lat,31),this._height=Ae(A.height,10),this._heading=Ae(A.heading,0),this._pitch=Ae(A.pitch,0),this._distance=Ae(A.distance,300),this._position=te.fromDegrees(A.lon,A.lat,A.height),this._horizontalViewAngle=Ae(A.horizontalViewAngle,90),this._verticalViewAngle=Ae(A.verticalViewAngle,60),this._horizontalViewAngle=this.adjustViewRange(this._horizontalViewAngle),this._verticalViewAngle=this.adjustViewRange(this._verticalViewAngle),this._visibleAreaColor=Ae(A.visibleAreaColor,ht.GREEN.withAlpha(.4)),this._invisibleAreaColor=Ae(A.invisibleAreaColor,ht.RED.withAlpha(.4)),this._size=Ae(A.size,10240),this._softShadows=Ae(A.softShadows,!0),this._colorStyle=Ae(A.colorStyle,ht.YELLOW),this._parameter=A,this._lineArray=[],this._visualCone=!0,this.pyramid=void 0,this.updateViewShed()}Object.defineProperties(tw.prototype,{show:{get:function(){return this._show},set:function(o){o!==this._show&&(this._show=o,this.updateViewShed())}},distance:{get:function(){return this._distance}},heading:{get:function(){return this._heading}},pitch:{get:function(){return this._pitch}},horizontalViewAngle:{get:function(){return this._horizontalViewAngle}},verticalViewAngle:{get:function(){return this._verticalViewAngle}},colorStyle:{get:function(){return this._colorStyle},set:function(o){this._colorStyle=o}},invisibleAreaColor:{get:function(){return this._invisibleAreaColor},set:function(o){this._invisibleAreaColor=o}},visibleAreaColor:{get:function(){return this._visibleAreaColor},set:function(o){this._visibleAreaColor=o}},visualCone:{get:function(){return this._visualCone},set:function(o){this._visualCone=o,this.visualConeShow(o)}}});tw.prototype.adjustViewRange=function(o){return o<=0?o=1:o>=180&&(o=179),o};tw.prototype.removeFromMap=function(){let o=this;O(o.viewShedMap)&&(o.viewShedMap.enabled=!1),O(o.pyramid)&&(o._earthCtrl.entities.removeById(o.pyramid.id),o.pyramid=null);for(let A=0;A<o._lineArray.length;A++){let f=o._lineArray[A];o._earthCtrl.entities.remove(f)}o._lineArray=[]};tw.prototype.visualConeShow=function(o){let A=this;O(A.pyramid)&&(A.pyramid.show=o);for(let f=0;f<A._lineArray.length;f++){let m=A._lineArray[f];m.show=o}};tw.prototype.addVisualPyramid=function(){let o=this,A=new AK({radii:new Qn(function(){return new te(o._distance,o._distance,o._distance)},!1),minimumClock:new Qn(function(){return qe.toRadians(90-o._heading-o._horizontalViewAngle/2)},!1),maximumClock:new Qn(function(){return qe.toRadians(90-o._heading+o._horizontalViewAngle/2)},!1),minimumCone:new Qn(function(){return qe.toRadians(90-o._verticalViewAngle/2)},!1),maximumCone:new Qn(function(){return qe.toRadians(90+o._verticalViewAngle/2)},!1),fill:!1,outline:!0,subdivisions:128,slicePartitions:32,stackPartitions:16,outlineColor:new Qn(function(){return o._colorStyle},!1)}),f=new JA({position:new Qn(function(){return o._position},!1),ellipsoid:A});this.pyramid=o._earthCtrl.entities.add(f)};tw.prototype.createLightCamera=function(){O(this.viewShedMap)?this._lightCamera=this.viewShedMap._lightCamera:this._lightCamera=new Ol(this._coreMap.scene),this._lightCamera.position=this._position};tw.prototype.updateParameters=function(o){let A=this,f=A._lightCamera;if(!!O(o)&&(O(o.lon)||O(o.lat)||O(o.height)||O(o.heading)||O(o.pitch)||O(o.roll)||O(o.far)||O(o.distance)||O(o.verticalViewAngle)||O(o.horizontalViewAngle))){let m=this._parameter;for(let v in o)o.hasOwnProperty(v)&&O(m[v])&&(m[v]=o[v]);m.distance>=A.viewShedMap.maximumDistance&&(m.distance=A.viewShedMap.maximumDistance),A._heading=m.heading,A._pitch=m.pitch,A._distance=m.distance,A.viewShedMap._pointLightRadius=m.distance,m.verticalViewAngle=A.adjustViewRange(m.verticalViewAngle),A._verticalViewAngle=m.verticalViewAngle,m.horizontalViewAngle=A.adjustViewRange(m.horizontalViewAngle),A._horizontalViewAngle=m.horizontalViewAngle,A._position=te.fromDegrees(m.lon,m.lat,m.height);let C=qe.toRadians(m.heading);f.setView({destination:A._position,orientation:{heading:C,pitch:0,roll:0}}),f.frustum.far=m.far||1e5;let y=qe.toRadians(A._horizontalViewAngle),x=qe.toRadians(A._verticalViewAngle);f.frustum.aspectRatio=Math.tan(y/2)/Math.tan(x/2),y>x?f.frustum.fov=y:f.frustum.fov=x}};tw.prototype.createShadowMap=function(){if(O(this.viewShedMap)){this.viewShedMap.enabled=!0;return}this.viewShedMap=new JK({context:this._coreMap.scene.context,lightCamera:this._lightCamera,enabled:!0,isPointLight:!0,pointLightRadius:this._distance,cascadesEnabled:!1,size:this._size,softShadows:!0,normalOffset:!1,fromLightSource:!1,visibleAreaColor:this._visibleAreaColor,invisibleAreaColor:this._invisibleAreaColor}),this._earthCtrl.viewShedMapList.push(this.viewShedMap)};var Dx=new te;tw.prototype.drawViewCentrum=function(){let o=this;function A(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=new SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let f=this._earthCtrl.entities.add({polyline:{positions:new Qn(A,!1),material:this._colorStyle}});this._lineArray.push(f);function m(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._minimumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=new SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let C=this._earthCtrl.entities.add({polyline:{positions:new Qn(m,!1),material:this._colorStyle}});this._lineArray.push(C);function y(){let I=o.pyramid._ellipsoid._minimumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=new SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let x=this._earthCtrl.entities.add({polyline:{positions:new Qn(y,!1),material:this._colorStyle}});this._lineArray.push(x);function v(){let I=o.pyramid._ellipsoid._maximumClock.getValue(),w=o.pyramid._ellipsoid._maximumCone.getValue(),Q=o.pyramid._ellipsoid.radii.getValue(),M=Math.sin,B=Math.cos,T=M(w),D=B(w),F=M(I),L=B(I);Dx.x=Q.x*T*L,Dx.y=Q.y*T*F,Dx.z=Q.z*D;let R=SD.changeCartesian3ByScalar(o._position,Dx);return[o._position,R]}let E=this._earthCtrl.entities.add({polyline:{positions:new Qn(v,!1),material:this._colorStyle}});this._lineArray.push(E)};tw.prototype.updateViewShed=function(){this.show?(this.createLightCamera(),this.setCameraParams(),this.createShadowMap(),this.addVisualPyramid(),this.drawViewCentrum()):this.removeFromMap()};tw.prototype.setCameraParams=function(){this._lightCamera.frustum.near=.1,this._lightCamera.frustum.far=this._distance;let o=qe.toRadians(this._horizontalViewAngle),A=qe.toRadians(this._verticalViewAngle);this._lightCamera.frustum.aspectRatio=Math.tan(o/2)/Math.tan(A/2),o>A?this._lightCamera.frustum.fov=o:this._lightCamera.frustum.fov=A,this._lightCamera.setView({destination:this._position,orientation:{heading:qe.toRadians(this._heading),pitch:qe.toRadians(this._pitch),roll:0}})};var Poe=tw;var QIe=Pi.WGS84;function Uf(o){this._cesiumViewer=o,this.coreMap=o.coreMap,this._scene=this.coreMap.scene,this.loading||this.addLoading(),this._tooltip=FRi(this.coreMap.container)}function SIe(o,A){if(o===null||typeof o!="object"||o.constructor!==Object&&o.constructor!==Array)return o;if(o.constructor===Date||o.constructor===RegExp||o.constructor===Function||o.constructor===String||o.constructor===Number||o.constructor===Boolean)return new o.constructor(o);A=A||new o.constructor;for(let f in o)A[f]=typeof A[f]>"u"?SIe(o[f],null):A[f];return A}function Klt(o,A){let f=SIe(o),m;for(m in A)f[m]===void 0&&(f[m]=SIe(A[m]));return f}function FRi(o){let A=function(f){let m=document.createElement("DIV");m.className="twipsy right";let C=document.createElement("DIV");C.className="twipsy-arrow",m.appendChild(C);let y=document.createElement("DIV");y.className="twipsy-inner",m.appendChild(y),this._div=m,this._title=y,f.appendChild(m)};return A.prototype.setVisible=function(f){this._div.style.display=f?"block":"none"},A.prototype.showAt=function(f,m){f&&m&&(this.setVisible(!0),this._title.innerHTML=m,this._div.style.left=`${f.x+30}px`,this._div.style.top=`${f.y-this._div.clientHeight/2-15}px`)},new A(o)}Uf.prototype.addToolbar=function(o,A){return A=Klt(A,{container:o}),new Uf.Toolbar(this,A)};var Ylt={shiftX:0,shiftY:0};Uf.prototype.createBillboardGroup=function(o,A,f){let m=new Uf.BillboardGroup(this,A);return m.addBillboards(o,f),m};Uf.BillboardGroup=function(o,A){this._drawHelper=o,this._scene=o._scene,this._options=Klt(A,Ylt);let f=new k_;this._scene.primitives.add(f),this._billboards=f,this._orderedBillboards=[]};Uf.BillboardGroup.prototype.createBillboard=function(o,A){let f=this._billboards.add({show:!0,position:o,pixelOffset:new wt(this._options.shiftX,this._options.shiftY),eyeOffset:new te(0,0,-1e3),horizontalOrigin:cA.CENTER,verticalOrigin:Bn.CENTER,scale:.3,image:Ae(this._options.iconUrl,`${globalThis.GEOWORLD_BASE_URL}Assets/Images/point.png`),color:new ht(1,1,1,1)});if(A){let y=function(v){C.enableRotate=v},x=function(){let v=0;for(let E=m._orderedBillboards.length;v<E&&m._orderedBillboards[v]!==f;++v);return v},m=this,C=this._scene.screenSpaceCameraController;if(A.dragHandlers){let v=this,E=new zr(v._scene.canvas);setListener(f,"leftDown",function(I){function w(M){f.position=M;for(let B=0,T=v._orderedBillboards.length;B<T&&v._orderedBillboards[B]!==f;++B);A.dragHandlers.onDrag&&A.dragHandlers.onDrag(x(),M)}function Q(M){E.destroy(),y(!0),A.dragHandlers.onDragEnd&&A.dragHandlers.onDragEnd(x(),M)}E.setInputAction(function(M){let B=v._scene.camera.pickEllipsoid(M.endPosition,QIe);B?w(B):Q(B)},Yi.MOUSE_MOVE),E.setInputAction(function(M){Q(v._scene.camera.pickEllipsoid(M.position,QIe))},Yi.LEFT_UP),y(!1),A.dragHandlers.onDragStart&&A.dragHandlers.onDragStart(x(),v._scene.camera.pickEllipsoid(I,QIe))})}A.onDoubleClick&&setListener(f,"leftDoubleClick",function(v){A.onDoubleClick(x())}),A.onClick&&setListener(f,"leftClick",function(v){A.onClick(x())}),A.tooltip&&(setListener(f,"mouseMove",function(v){m._drawHelper._tooltip.showAt(v,A.tooltip())}),setListener(f,"mouseOut",function(v){m._drawHelper._tooltip.setVisible(!1)}))}return f};Uf.BillboardGroup.prototype.insertBillboard=function(o,A,f){this._orderedBillboards.splice(o,0,this.createBillboard(A,f))};Uf.BillboardGroup.prototype.addBillboard=function(o,A){this._orderedBillboards.push(this.createBillboard(o,A))};Uf.BillboardGroup.prototype.addBillboards=function(o,A){let f=0;for(;f<o.length;f++)this.addBillboard(o[f],A)};Uf.BillboardGroup.prototype.updateBillboardsPositions=function(o){let A=0;for(;A<o.length;A++)this.getBillboard(A).position=o[A]};Uf.BillboardGroup.prototype.countBillboards=function(){return this._orderedBillboards.length};Uf.BillboardGroup.prototype.getBillboard=function(o){return this._orderedBillboards[o]};Uf.BillboardGroup.prototype.removeBillboard=function(o){this._billboards.remove(this.getBillboard(o)),this._orderedBillboards.splice(o,1)};Uf.BillboardGroup.prototype.remove=function(){this._billboards=this._billboards&&this._billboards.removeAll()&&this._billboards.destroy()};Uf.BillboardGroup.prototype.setOnTop=function(){this._scene.primitives.raiseToTop(this._billboards)};Uf.prototype.cleanUp=function(){this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1)};Uf.prototype.startDrawing=function(o){let A=this,f=this._scene;f.globe.depthTestAgainstTerrain=!0;let m=this._tooltip,C=3,y=[],x=[],v;this._positions=x;let E=new zr(f.canvas);this._mouseHandler=E;let I=new Uf.BillboardGroup(this,Ylt);this._markers=I,this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),E.setInputAction(function(Q){if(Q.position!==null){let M=f.camera.getPickRay(Q.position),B=f.globe.pick(M,f),T=$t.fromCartesian(B),D=qe.toDegrees(T.longitude),F=qe.toDegrees(T.latitude);if(B){if(y.length===0&&(y.push(D,F),x.push(B),v=B,I.addBillboard(v)),x.length>=4){let L=ml.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(L!==void 0){let R=L.x-Q.position.x,k=L.y-Q.position.y;if(R*R+k*k<16){y.splice(y.length-2,2),x.pop(),this.isLoading(!0),this.stopDrawing(o);return}}}y.push(D,F),x.push(B),I.addBillboard(B),x.length===C&&(A._prevEntity=A._cesiumViewer.factory.createElement({type:"polygon",parameters:{hierarchy:te.fromDegreesArray(y),material:ht.RED.withAlpha(.6),fill:!0}}),A._prevEntity.polygon.hierarchy=w())}}}.bind(this),Yi.LEFT_CLICK),E.setInputAction(function(Q){let M=Q.endPosition;if(M!==null)if(x.length===0)m.showAt(M,"\u70B9\u51FB\u5F00\u59CB\u7ED8\u5236\u7B2C\u4E00\u4E2A\u70B9");else{let B=f.camera.getPickRay(M),T=f.globe.pick(B,f),D=$t.fromCartesian(T),F=qe.toDegrees(D.longitude),L=qe.toDegrees(D.latitude);if(T&&(y.splice(y.length-2,2),x.pop(),y.push(F,L),x.push(T),I.getBillboard(x.length-1).position=T,m.showAt(M,"\u53CC\u51FB\u7ED3\u675F\u7ED8\u5236"),x.length>=3&&x.length>=4)){let R=ml.wgs84ToWindowCoordinates(this._cesiumViewer.coreMap.scene,v);if(R!==void 0){let k=R.x-M.x,G=R.y-M.y;k*k+G*G<16?document.body.style.cursor="pointer":document.body.style.cursor="default"}}}}.bind(this),Yi.MOUSE_MOVE),E.setInputAction(function(Q){x.length<C+2||(this.isLoading(!0),setTimeout(()=>{this.stopDrawing(o)},100))}.bind(this),Yi.LEFT_DOUBLE_CLICK);function w(){return te.fromDegreesArray(y)}};Uf.prototype.stopDrawing=function(o){this._mouseHandler!==void 0&&(this._mouseHandler.destroy(),this._mouseHandler=void 0),this._markers!==void 0&&(this._markers.remove(),this._markers=void 0),this._prevEntity!==void 0&&(this._cesiumViewer.entities.remove(this._prevEntity),this._prevEntity=null),this._volumeLabel!==void 0&&(this._cesiumViewer.entities.remove(this._volumeLabel),this._volumeLabel=void 0),this._tooltip.setVisible(!1),document.body.style.cursor="wait";let A=this.computeCutVolume(),f=A.maxHeight;document.body.style.cursor="default",typeof o=="function"&&o(A.volume);let m={polygon:{hierarchy:{positions:this._positions},extrudedHeight:f,closeTop:!1,closeBottom:!1,material:ht.RED.withAlpha(.5),outline:!0,outlineColor:ht.WHITE,outlineWidth:2}};this._prevEntity=this._cesiumViewer.entities.add(m),this.isLoading(!1)};Uf.prototype.addLoading=function(){let o=document.createElement("div");o.id="cesiumLoading",o.style.cssText="width: 100%;height: 100%;display:none;pointer-events: none;position: absolute;top: 0;left: 0;-moz-box-sizing: border-box;box-sizing: border-box;background-color: unset;z-index: 99999;";let A=document.createElement("img");A.style.cssText="position: relative;width: 110px;height: 110px;margin: auto;top: 50%;left: 50%;margin-top: -55px;margin-left: -55px;",A.src=`${globalThis.GEOWORLD_BASE_URL}Workers/image/loading.gif`,o.appendChild(A),this.loading=o,this.coreMap.container.appendChild(o)};Uf.prototype.isLoading=function(o){o?this.loading.style.display="block":this.loading.style.display="none"};Uf.prototype.removeLoading=function(){this.loading&&this.loading.remove(),this.loading=void 0};function NRi(o){let A=[],f=[];for(let Q=0;Q<o.length;Q++){let M=$t.fromCartesian(o[Q]);A.push(M.longitude),f.push(M.latitude)}let m=0,C=0,y=0,x=0,v=0,E=0,I=0,w=0;for(let Q=0;Q<o.length;Q++)m=A[Q],C=f[Q],Q===o.length-1?(y=A[0],x=f[0]):(y=A[Q+1],x=f[Q+1]),E=m*x-y*C,v+=E,I+=(m+y)*E,w+=(C+x)*E;return v*=.5,I/=6*v,w/=6*v,new $t(I,w)}function kRi(o,A,f){let m=te.distance(o,A),C=te.distance(A,f),y=te.distance(f,o),x=(m+C+y)/2;return Math.sqrt(x*(x-m)*(x-C)*(x-y))}Uf.prototype.computeCutVolume=function(){let o=15e3;for(let k=0;k<this._positions.length;k++){let G=$t.fromCartesian(this._positions[k]),V=this._scene.globe.getHeight(G);o>V&&(o=V)}let A=Math.PI/Math.pow(2,11);A=A/64;let f=new Id.fromPositions({positions:this._positions,vertexFormat:Ya.FLAT_VERTEX_FORMAT,granularity:A}),m=new Id.createGeometry(f),C=0,y=0,x,v,E,I,w,Q,M,B,T,D,F,L;for(let k=0;k<m.indices.length;k+=3)x=m.indices[k],v=m.indices[k+1],E=m.indices[k+2],D=new te(m.attributes.position.values[x*3],m.attributes.position.values[x*3+1],m.attributes.position.values[x*3+2]),F=$t.fromCartesian(D),I=this._scene.globe.getHeight(F),M=te.fromRadians(F.longitude,F.latitude,0),y<I&&(y=I),D=new te(m.attributes.position.values[v*3],m.attributes.position.values[v*3+1],m.attributes.position.values[v*3+2]),F=$t.fromCartesian(D),w=this._scene.globe.getHeight(F),B=te.fromRadians(F.longitude,F.latitude,0),y<w&&(y=w),D=new te(m.attributes.position.values[E*3],m.attributes.position.values[E*3+1],m.attributes.position.values[E*3+2]),F=$t.fromCartesian(D),Q=this._scene.globe.getHeight(F),T=te.fromRadians(F.longitude,F.latitude,0),y<Q&&(y=Q),L=kRi(M,B,T),C=C+L*(I-o+w-o+Q-o)/3;let R=NRi(this._positions);return this._volumeLabel=this._cesiumViewer.entities.add({position:te.fromRadians(R.longitude,R.latitude,y+1e3),label:{text:`${C.toFixed(4)}\u7ACB\u65B9\u7C73`}}),{maxHeight:y,volume:C}};var Roe=Uf;function Jlt(o,A){if(this.mEarthCtrl=o,this._parameter=A,this.coreMap=o.coreMap,this._color=Ae(A.color,new ht(1,0,0,.7)),this._positions=A.positions,this._positions.length<3)throw new Hi("invalid positions length!");this._duration=Ae(A.duration,4e3),this._minHeight=Ae(A.minHeight,0),this._maxHeight=Ae(A.maxHeight,100),this._image=A.image,this._pps=null}function ORi(o,A){let f=$t.fromCartesian(o[0]),m=f.longitude,C=f.latitude,y=m,x=C,v=A;for(let E=1;E<o.length;E++){let I=$t.fromCartesian(o[E]);m>I.longitude?m=I.longitude:y<I.longitude&&(y=I.longitude),C>I.latitude?C=I.latitude:x<I.latitude&&(x=I.latitude)}return new te.fromRadians((m+y)/2,(C+x)/2,v)}function URi(o){if(O(o._pps))return;let A=ORi(o._positions,o._minHeight),f=$t.fromCartesian(A),m=new oi(A.x,A.y,A.z,1),C=new $t(f.longitude,f.latitude,o.maxHeight+100),y=$t.toCartesian(C),x=new oi(y.x,y.y,y.z,1),v=new oi,E=new oi,I=new te,w=o.mEarthCtrl.coreMap.scene.camera,Q=o._positions.length;o._pps=new wa({fragmentShader:HRi(Q),uniforms:{u_floodCenterEC:function(){return Ze.multiplyByVector(w._viewMatrix,m,v)},u_floodPlaneNormalEC:function(){let B=Ze.multiplyByVector(w._viewMatrix,m,v),T=Ze.multiplyByVector(w._viewMatrix,x,E);return I.x=T.x-B.x,I.y=T.y-B.y,I.z=T.z-B.z,te.normalize(I,I),I},u_floodRange:function(){return o._positions},u_minHeight:function(){return o._minHeight},u_maxHeight:function(){return o._maxHeight},u_image:function(){return o.image},u_floodColor:function(){return o._color},u_positionsLength:function(){return o._positions.length}}}),o.mEarthCtrl.coreMap.scene.postProcessStages.add(o._pps)}function GRi(o){O(o._pps)&&(o.mEarthCtrl.coreMap.scene.postProcessStages.remove(o._pps),o._pps=null)}function HRi(o){return`uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
varying vec2 v_textureCoordinates;
uniform vec4 u_floodCenterEC;