cesium_dev_kit 1.0.69 → 1.0.71

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.umd.js CHANGED
@@ -1,5 +1,5 @@
1
- !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("libgif"),require("@turf/turf"),require("dat.gui"),require("echarts")):"function"==typeof define&&define.amd?define(["exports","libgif","@turf/turf","dat.gui","echarts"],e):e((t=t||self).cesium_dev_kit={},t.SuperGif,t.turf,t.dat,t.echarts)}(this,function(R,l,T,c,u){"use strict";l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l,u=u&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u;let o=null;class N{constructor(t){o=t,this.init_data()}init_data(){this.viewer=null}init({containerId:t,viewerConfig:e,extraConfig:i,MapImageryList:n}){let a=new o.SingleTileImageryProvider({url:"https://mapv-data.oss-cn-hangzhou.aliyuncs.com/Cesium-1.82-hawk/background.png"});var r={imageryProvider:a=0!==n.length?this.setOneimageryProvider(n[0]):a,contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:o.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0},r=Object.assign(r,e),e=new o.Viewer(t,r);return i.logo||(e.cesiumWidget.creditContainer.style.display="none"),i.depthTest&&(e.scene.globe.depthTestAgainstTerrain=!0),this.setConfigMapList(e,n),this.removeJagged(e),this.viewer=e}setOneimageryProvider(t){var e;return t.classConfig.customTags&&(t.classConfig.customTags=(e="("+t.classConfig.customTags+")",new Function("return "+e)())),new o[t.type](t.classConfig)}setConfigMapList(n,t){const i=n.imageryLayers;t.some((t,e)=>{if(0===e)return!1;i.addImageryProvider(this.setOneimageryProvider(t))}),t.some((e,t)=>{const i=n.imageryLayers.get(t);e.interfaceConfig&&Object.getOwnPropertyNames(e.interfaceConfig).forEach(function(t){i[t]=e.interfaceConfig[t]}),i.invertColor=e.invertswitch,i.filterRGB=[255,255,255],"#000000"!==e.filterRGB&&"#ffffff"!==e.filterRGB&&(i.filterRGB=function(e){let i=e.toLowerCase();if(/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i)){if(4===i.length){let e="#";for(let t=1;t<4;t+=1)e+=i.slice(t,t+1).concat(i.slice(t,t+1));i=e}const e=[];for(let t=1;t<7;t+=2)e.push(parseInt("0x"+i.slice(t,t+2)));return e}return[]}(e.filterRGB));t=e.offset.split(",");if(2===t.length)try{const n=[parseFloat(t[0]),parseFloat(t[1])];i._imageryProvider._tilingScheme._rectangleNortheastInMeters.x+=n[0],i._imageryProvider._tilingScheme._rectangleNortheastInMeters.y+=n[1]}catch(t){console.log(t)}this.changeImageryProviderColors(n,i)})}removeJagged(e){if(e.scene.postProcessStages.fxaa.enabled=!1,e.scene.fxaa=!1,e.cesiumWidget._supportsImageRenderingPixelated){let t=window.devicePixelRatio;for(;2<=t;)t/=2;e.resolutionScale=t}}changeImageryProviderColors(t,i){var n=t.scene.globe._surfaceShaderSet.baseFragmentShaderSource.sources;for(let e=0;e<n.length;e++){var a=n[e],r="color = czm_saturation(color, textureSaturation);\n#endif\n";let t="color = czm_saturation(color, textureSaturation);\n#endif\n";i.invertColor&&(t=(t+="\n color.r = 1.0 - color.r;\n color.g = 1.0 - color.g;\n color.b = 1.0 - color.b;\n ")+`
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("libgif"),require("dat.gui"),require("echarts")):"function"==typeof define&&define.amd?define(["exports","libgif","dat.gui","echarts"],t):t((e=e||self).cesium_dev_kit={},e.SuperGif,e.dat,e.echarts)}(this,function(e,l,c,p){"use strict";l=l&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l,p=p&&Object.prototype.hasOwnProperty.call(p,"default")?p.default:p;let a=null;class F{constructor(e){a=e,this.init_data()}init_data(){this.viewer=null}init({containerId:e,viewerConfig:t,extraConfig:i,MapImageryList:n}){let o=new a.SingleTileImageryProvider({url:"https://mapv-data.oss-cn-hangzhou.aliyuncs.com/Cesium-1.82-hawk/background.png"});var r={imageryProvider:o=0!==n.length?this.setOneimageryProvider(n[0]):o,contextOptions:{webgl:{alpha:!1}},animation:!1,timeline:!1,fullscreenButton:!1,geocoder:!1,homeButton:!1,selectionIndicator:!1,shadow:!0,sceneMode:a.SceneMode.SCENE3D,infoBox:!1,sceneModePicker:!1,navigationHelpButton:!1,projectionPicker:!1,baseLayerPicker:!1,shouldAnimate:!0,navigation:!1,showRenderLoopErrors:!0},r=Object.assign(r,t),t=new a.Viewer(e,r);return i.logo||(t.cesiumWidget.creditContainer.style.display="none"),i.depthTest&&(t.scene.globe.depthTestAgainstTerrain=!0),this.setConfigMapList(t,n),this.removeJagged(t),this.viewer=t}setOneimageryProvider(e){var t;return e.classConfig.customTags&&(e.classConfig.customTags=(t="("+e.classConfig.customTags+")",new Function("return "+t)())),new a[e.type](e.classConfig)}setConfigMapList(n,e){const i=n.imageryLayers;e.some((e,t)=>{if(0===t)return!1;i.addImageryProvider(this.setOneimageryProvider(e))}),e.some((t,e)=>{const i=n.imageryLayers.get(e);t.interfaceConfig&&Object.getOwnPropertyNames(t.interfaceConfig).forEach(function(e){i[e]=t.interfaceConfig[e]}),i.invertColor=t.invertswitch,i.filterRGB=[255,255,255],"#000000"!==t.filterRGB&&"#ffffff"!==t.filterRGB&&(i.filterRGB=function(t){let i=t.toLowerCase();if(/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/.test(i)){if(4===i.length){let t="#";for(let e=1;e<4;e+=1)t+=i.slice(e,e+1).concat(i.slice(e,e+1));i=t}const t=[];for(let e=1;e<7;e+=2)t.push(parseInt("0x"+i.slice(e,e+2)));return t}return[]}(t.filterRGB));e=t.offset.split(",");if(2===e.length)try{const n=[parseFloat(e[0]),parseFloat(e[1])];i._imageryProvider._tilingScheme._rectangleNortheastInMeters.x+=n[0],i._imageryProvider._tilingScheme._rectangleNortheastInMeters.y+=n[1]}catch(e){console.log(e)}this.changeImageryProviderColors(n,i)})}removeJagged(t){if(t.scene.postProcessStages.fxaa.enabled=!1,t.scene.fxaa=!1,t.cesiumWidget._supportsImageRenderingPixelated){let e=window.devicePixelRatio;for(;2<=e;)e/=2;t.resolutionScale=e}}changeImageryProviderColors(e,i){var n=e.scene.globe._surfaceShaderSet.baseFragmentShaderSource.sources;for(let t=0;t<n.length;t++){var o=n[t],r="color = czm_saturation(color, textureSaturation);\n#endif\n";let e="color = czm_saturation(color, textureSaturation);\n#endif\n";i.invertColor&&(e=(e+="\n color.r = 1.0 - color.r;\n color.g = 1.0 - color.g;\n color.b = 1.0 - color.b;\n ")+`
2
2
  color.r = color.r * ${i.filterRGB[0]}.0/255.0;
3
3
  color.g = color.g * ${i.filterRGB[1]}.0/255.0;
4
4
  color.b = color.b * ${i.filterRGB[2]}.0/255.0;
5
- `),-1!==a.indexOf(r)&&(n[e]=n[e].replace(r,t))}}getCurCenterlonLat(t){t=t.camera.pickEllipsoid(new o.Cartesian2(t.canvas.clientWidth/2,t.canvas.clientHeight/2)),t=o.Ellipsoid.WGS84.cartesianToCartographic(t);return{lon:180*t.longitude/Math.PI,lat:180*t.latitude/Math.PI}}}let x=null;function y(t,e,i){t&&(x=e,this._graphicsLayer=new x.CustomDataSource("graphicsLayer"),t)&&t.dataSources.add(this._graphicsLayer)}y.prototype={getPointGraphics:function(t){if(t=t||{})return new x.PointGraphics({color:t.color||x.Color.GREEN,pixelSize:t.pixelSize||5,outlineColor:t.outlineColor||x.Color.WHITE,outlineWidth:t.outlineWidth||1})},getLineGraphics:function(t){if((t=t||{})&&t.positions)return new x.PolylineGraphics({show:!0,positions:t.positions,material:t.material||x.Color.YELLOW,width:t.width||1,clampToGround:t.clampToGround||!1})},getLineVolumeGraphics:function(a){if((a=a||{})&&a.positions)return new x.PolylineVolumeGraphics({show:!0,positions:new x.Cartesian3.fromDegreesArrayHeights(a.positions),material:a.material||new x.Scene.PolylineFlowWaterMaterialProperty({riverColor:x.Color.SKYBLUE,flowDuration:1e4}),shape:new x.CallbackProperty(function(){for(var t=[],e=0;e<180;e++){var i=a.width*Math.cos(2*Math.PI*e/720),n=.1*Math.sin(2*Math.PI*e/720);t.push(new x.Cartesian2(i,n))}return t},!1),cornerType:a.cornerType||x.CornerType.ROUNDED})},getPolygonGraphics:function(t){if((t=t||{})&&t.positions)return new x.PolygonGraphics({hierarchy:{positions:t.positions},material:t.material||x.Color.RED.withAlpha(.2),clampToGround:t.clampToGround||!1})},getLabelGraphics:function(t){if((t=t||{})&&t.l_text)return new x.LabelGraphics({text:t.l_text,font:t.l_font||"14px sans-serif",fillColor:t.l_fillColor||x.Color.GOLD,style:t.l_style||x.LabelStyle.FILL_AND_OUTLINE,outlineWidth:t.l_outlineWidth||2,showBackground:t.l_showBackground||!1,backgroundColor:t.l_backgroundColor||new x.Color(.165,.165,.165,.8),verticalOrigin:t.l_verticalOrigin||x.VerticalOrigin.BOTTOM,pixelOffset:t.l_pixelOffset||new x.Cartesian2(0,-30)})},getBillboardGraphics:function(t){if((t=t||{})&&t.b_img)return new x.BillboardGraphics({image:t.b_img,width:t.b_width||35,height:t.b_height||35,clampToGround:t.b_clampToGround||!0,scale:t.b_scale||1,pixelOffset:t.b_pixelOffset||new x.Cartesian2(0,-20),scaleByDistance:t.b_scaleByDistance||void 0})},getPathGraphics:function(t){if(t=t||{})return new x.PathGraphics({resolution:t.resolution||1,material:new x.PolylineGlowMaterialProperty({glowPower:t.glowPower||.1,color:t.color||x.Color.YELLOW}),width:t.width||30})},getModelGraphics:function(t){if(t=t||{})return new x.ModelGraphics({uri:t.m_url||t.url,scale:t.m_scale||t.scale||10,clampAnimations:!0})},getEllipseGraphics:function(t){if(t=t||{})return new x.EllipseGraphics({semiMajorAxis:t.e_semiMinorAxis||1e6,semiMinorAxis:t.e_semiMinorAxis||1e6,metarial:t.e_metarial||x.Color.RED.withAlpha(.5),outline:t.e_outline||!0})},getEllipsoidGraphics:function(t){var e;if(t=t||{})return e=t.radii||1e6,new x.EllipsoidGraphics({radii:new x.Cartesian3(e,e,e),maximumCone:t.maximumCone||x.Math.PI_OVER_TWO,stackPartitions:t.stackPartitions||56,slicePartitions:t.slicePartitions||56,outlineWidth:t.outlineWidth||2,outlineColor:t.outlineColor||x.Color.YELLOW,outline:t.outline||!0,fill:t.fill||!0,material:t.material||x.Color.RED.withAlpha(.1)})},getBoxGraphics:function(t){if(t=t||{show:!0,outline:!1,fill:!0})return new x.BoxGraphics({show:t.show,fill:t.fill,dimensions:t.dimensions||new x.Cartesian3(0,0,0),material:t.material,outline:t.outline,outlineColor:t.outlineColor||x.Color.BLACK,distanceDisplayCondition:t.distanceDisplayCondition||void 0})},getPlaneGraphics:function(t){if(t=t||{})return new x.PlaneGraphics({plane:t.plane||new x.Plane(x.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new x.Cartesian2(170,130),material:t.material||x.Color.BLUE})},getCylinderGraphics:function(t){if(t=t||{})return new x.CylinderGraphics({HeightReference:x.HeightReference.RELATIVE_TO_GROUND,length:t.length||250,topRadius:t.topRadius||0,bottomRadius:t.bottomRadius||0,material:t.material||new x.Color(0,1,1,.4),slices:t.slices||128})},createPointsGraphics:function(t){if(t&&t.positions){var e,i=[];for(e in t.positions){var n=t.positions[e],a=this.createGraphics();a.name=t.name||"",a.oid=t.oid||"point",a.position=n,t.point&&(a.point=this.getPointGraphics()),t.billboard&&(a.billboard=this.getBillboardGraphics(t.billboard)),t.label&&(a.label=this.getLabelGraphics(t.label)),i.push(this._graphicsLayer.entities.add(a))}return i}},createLineGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).name=t.name||"",e.oid=t.oid||"line",e.position=t.positions,e.polyline=this.getLineGraphics(t),this._graphicsLayer.entities.add(e)},createLineVolumeGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).name=t.name||"lineVolumeWater",e.oid=t.oid||"lineVolume",e.polylineVolume=this.getLineVolumeGraphics(t),this._graphicsLayer.entities.add(e)},createPolygonGraphics:function(t){var e;if(t=t||{})return(e=this.createGraphics()).polygon=this.getPolygonGraphics(t),e.clampToS3M=t.clampToS3M||!1,this._graphicsLayer.entities.add(e)},createBoxGraphics:function(t){var e;if(t=t||{})return(e=this.createGraphics()).position=t.position,e.name=t.name||"box_graphic",e.box=this.getBoxGraphics(t.box),this._graphicsLayer.entities.add(e)},createModelGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).model=this.getModelGraphics(t),e.position=t.position,this._graphicsLayer.entities.add(e)},craeteCorridorGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).corridor={positions:t.positions,height:t.height||6,width:t.width||15,material:t.material||new x.Scene.WarnLinkMaterialProperty({freely:"cross",color:x.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(e)},craeteDynamicPolyLineGraphics:function(t){var e;if(t&&t.positions)return(e=this.createGraphics()).polyline={show:!0,positions:[],material:t.material||x.Color.CHARTREUSE,width:t.width||5,clampToGround:t.clampToGround||!1},e.polyline.positions=new x.CallbackProperty(function(){return t.positions},!1),this._graphicsLayer.entities.add(e)},craeteDynamicCylinderGraphics:function(t){var i,n,e={};if(t&&t.cylinder)return i=t.entity,t=t.cylinder,e.cylinder=(n=this).getCylinderGraphics(t),e.position=new x.CallbackProperty(function(){var t=i.position.getValue(n._viewer.clock.currentTime),t=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=x.Math.toDegrees(t.latitude),t=x.Math.toDegrees(t.longitude);return x.Cartesian3.fromDegrees(t,e,0)},!1),e.cylinder.length=new x.CallbackProperty(function(){var t=i.position.getValue(n._viewer.clock.currentTime);return 2*n._viewer.scene.globe.ellipsoid.cartesianToCartographic(t).height},!1),e},createFadeCylinderGraphics:function(t){var e;if((t=t||{})&&t.position)return(e=this.createGraphics()).position=t.position,t.material=new x.Scene.CircleFadeMaterialProperty({color:t.color||x.Color.fromCssColorString("#02ff00"),duration:t.duration||2e3}),e.cylinder=this.getCylinderGraphics(t),this._drawLayer.entities.add(e)},craeteRotateCylinderGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).cylinder={HeightReference:x.HeightReference.RELATIVE_TO_GROUND,length:t.length||500,topRadius:t.topRadius||500,bottomRadius:t.bottomRadius||500,material:t.material||new x.ImageMaterialProperty({image:t.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:!0,repeat:{x:1,y:-1}}),slices:t.slices||128},e.position=t.position,this.setGraphicsRotate({entity:e,position:this.transformCartesianToWGS84(t.position),rotateAmount:4}),this._graphicsLayer.entities.add(e)},craeteDynamicBlinkCircleGraphics:function(t){var e,i,n;if(t&&t.position)return e=this.createGraphics(),i=t.alp||1,n=t.flog||!0,e.position=t.position,e.ellipse={semiMinorAxis:t.semiMinorAxis||2e3,semiMajorAxis:t.semiMajorAxis||2e3,height:t.height||10,material:new x.ColorMaterialProperty(new x.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),x.Color.RED.withAlpha(i)},!1))},this._graphicsLayer.entities.add(e)},craeteDynamicCricleGraphics:function(i){if(i&&i.center){var n=this.createGraphics(),a=this,r=i.center,o=i.radius||800,s=i.rotateAmount||.05,l=0,c=i.height||1,h=i.scale||null,d=i.scale2||null,i=i.material||new x.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new x.CallbackProperty(function(){return a.transformWGS84ToCartesian(r)},!1),n.orientation=new x.CallbackProperty(function(){return x.Transforms.headingPitchRollQuaternion(a.transformWGS84ToCartesian(r),new x.HeadingPitchRoll(x.Math.toRadians(0),x.Math.toRadians(0),x.Math.toRadians(0)))},!1);let t=o,e=!1;return n.ellipse={material:i,height:c,semiMajorAxis:new x.CallbackProperty(function(){return o},!1),semiMinorAxis:new x.CallbackProperty(function(){return o},!1),stRotation:new x.CallbackProperty(function(){return 0<s&&360<=(l+=s)&&(l=0),h&&((e=h<=o||o<=t?!e:e)?o+=2:o-=2),d&&(o<=d?o+=2:o=t),l},!1)},this._graphicsLayer.entities.add(n)}},craeteDynamicShadeWallGraphics:function(t){var e,i,n,a,r;if(t&&t.positions)return e=t.alp||1,i=t.num||20,n=t.color||x.Color.RED,a=t.speed||.003,(r=this.createGraphics()).wall={positions:t.positions,material:new x.ImageMaterialProperty({image:t.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new x.CallbackProperty(function(){return i%2==0?e-=a:e+=a,(e<=.1||1<=e)&&i++,n.withAlpha(e)},!1)})},this._graphicsLayer.entities.add(r)},createCustomDefBillboardGraphics:function(e){if(e&&e.position){var i=this,n=document.createElement("img");n.src=e.img||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";n.onload=function(){e.image=n;var t=i._graphicsLayer.entities.add({position:e.position,billboard:{image:function(t){var e,i;if(t.image)return(e=document.createElement("canvas")).width=t.width||150,e.height=t.height||80,(i=e.getContext("2d")).drawImage(t.image,0,0),t=t.text,i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(t,55,36),e}(e),scaleByDistance:new x.NearFarScalar(150,.7,15e6,.5),verticalOrigin:x.VerticalOrigin.BOTTOM,pixelOffset:e.b_pixelOffset||new x.Cartesian2(80,-35),width:140,height:100,scale:e.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof e.callback&&e.callback(t)}}},craeteRotatePlaneGraphics:function(t){var e,i,n,a;if(t&&t.center&&t.positions)return e=this.createGraphics(),i=0,n=t.positions,a=n[0],e.position=new x.CallbackProperty(function(){return 0==i?(a=n[0],i+=1):i<n.length-1?(a=n[i],i+=1):i==n.length-1&&(a=n[i],i=0),a},!1),e.plane={plane:new x.Plane(x.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new x.Cartesian2(200,150),material:new x.ImageMaterialProperty({image:t.image})},this._graphicsLayer.entities.add(e)},createVideoPlaneGraphics:function(t){var e;if(t&&t.position)return(e=this.createGraphics()).position=t.position,e.plane={plane:new x.Plane(t.normal||x.Cartesian3.UNIT_Y,0),dimensions:t.dimensions||new x.Cartesian2(200,150),material:new x.ImageMaterialProperty({image:t.videoElement})},this._graphicsLayer.entities.add(e)},createGifBillboardGraphics:function(t){var e,i,n,a,r,o,s;if(l&&t&&t.position)return i=t.url,n=0,a=i,r=e=[],(o=document.createElement("img")).src=a,o.setAttribute("rel:animated_src",a),o.setAttribute("rel:auto_play","0"),document.body.appendChild(o),s=new l({gif:o}),new Promise(t=>{s.load(()=>{for(let t=1;t<=s.get_length();t++)s.move_to(t),r.push(s.get_canvas().toDataURL());t(r)})}),this._graphicsLayer.entities.add({position:t.position,billboard:{verticalOrigin:x.VerticalOrigin.BASELINE,image:new x.CallbackProperty(function(){return e.length?(n<6*(e.length-1)?n++:n=0,e[Math.floor(n/6)]):i},!1),scale:.2}})},setGraphicsRotate:function(t){var e,i,n,a;t&&t.entity&&t.rotateAmount&&(e=t.entity,i=t.rotateAmount,n=t.position,a=this,n.heading=0,n.pitch=0,n.roll=0,e.position=new x.CallbackProperty(function(){return a.transformWGS84ToCartesian(n)},!1),e.orientation=new x.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),x.Transforms.headingPitchRollQuaternion(a.transformWGS84ToCartesian(n),new x.HeadingPitchRoll(x.Math.toRadians(n.heading),x.Math.toRadians(n.pitch),x.Math.toRadians(n.roll)))},!1))},setGraphicsFloat:function(t){if(t&&t.entity&&t.maxHeiht)try{var e=t.entity,n=t.minHeiht||5,a=t.maxHeiht||100,r=t.cartesians,o=t.speed||.06,s=this,l=n,c=!1;r.length?e.positions=new x.CallbackProperty(function(){var t,e=s.transformCartesianArrayToWGS84Array(r);for(t in e){var i=e[t];(c=a<=n||n<=l?!c:c)?n+=o:n-=o,i.alt=n}return s.transformWGS84ArrayToCartesianArray(e)},!1):e.position=new x.CallbackProperty(function(){var t=s.transformCartesianToWGS84(r);return(c=a<=n||n<=l?!c:c)?n+=o:n-=o,t.alt=n,s.transformWGS84ToCartesian(t)},!1)}catch(t){console.log(t)}},createCanvasGraphics:function(a){a&&a.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:a.positions,material:new x.ImageMaterialProperty({image:new x.CallbackProperty(function(){var t=0,e=document.createElement("canvas"),i=e.getContext("2d"),n=new Image;if(n.src=a.img||"../../images/ysCesium/logo.png",i.clearRect(0,0,a.cwidth,a.cheight),!(t<=a.cwidth))return t=0,t+=3,e;i.drawImage(n,t,0)},!1),transparent:!0})}}),"function"==typeof a.callback)&&a.callback()}};let p=null;function E(t,e,i){t&&(p=e,this._installMaterial())}function Y(){}E.prototype={addMaterialLineGraphics:function(t){var e;if(this._viewer&&t&&t.image)return this._initPolylineCustomMaterialProperty(t),(e=this.createGraphics()).polyline={positions:t.positions,material:new p.PolylineCustomMaterialProperty({color:t.color||p.Color.RED,duration:t.duration||500}),width:t.width},this._viewer.entities.add(e)},getCustomMaterialLine:function(t){if(this._viewer&&t&&t.image)return this._initPolylineCustomMaterialProperty(t)},_initPolylineCustomMaterialProperty(i){if(i){var t=p.Color,e=p.defaultValue,n=p.defined,a=Object.defineProperties,r=p.Event,o=p.createPropertyDescriptor,s=p.Property,l=p.Material,c=t.WHITE,h=i.MaterialType||"wallType"+parseInt(1e3*Math.random());const d=function(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||p.Color.BLUE,this.duration=t.duration||1e3,this._time=void 0};return a(d.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),d.prototype.getType=function(){return h},d.prototype.getValue=function(t,e){return(e=n(e)?e:{}).color=s.getValueOrClonedDefault(this._color,t,c,e.color),e.image=i.image,void 0===this._time&&(this._time=t.secondsOfDay),e.time=1e3*(t.secondsOfDay-this._time)/this.duration,e},d.prototype.equals=function(t){return this===t||t instanceof d&&s.equals(this._color,t._color)},l._materialCache.addMaterial(h,{fabric:{type:h,uniforms:{color:i.color||new p.Color(1,0,0,.5),image:i.image,time:i.color.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new d(i)}},addMaterialWallGraphics:function(t){var e;if(this._viewer&&t&&t.image)return this._initWallCustomMaterialProperty(t),(e=this.createGraphics()).wall={positions:t.positions,material:new p.Scene.WallLinkCustomMaterialProperty({color:t.color||p.Color.RED,duration:t.duration||500}),width:t.width},this._viewer.entities.add(e)},getCustomMaterialWall:function(t){if(this._viewer&&t&&t.image)return this._initWallCustomMaterialProperty(t)},_initWallCustomMaterialProperty(i){var n=p.Color,e=p.defaultValue,a=p.defined,t=Object.defineProperties,r=p.Event,o=p.createPropertyDescriptor,s=p.Property,l=p.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function h(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||n.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()}return t(h.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:o("color")}),h.prototype.getType=function(){return c},h.prototype.getValue=function(t,e){return(e=a(e)?e:{}).color=s.getValueOrClonedDefault(this._color,t,n.WHITE,e.color),e.image=i.image,e.time=((new Date).getTime()-this._time)%this.duration/this.duration,e},h.prototype.equals=function(t){return this===t||t instanceof h&&s.equals(this._color,t._color)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new n(1,0,0,.5),image:i.image,time:0},source:this._getDirectionWallShader({get:!0,count:i.count,freely:i.freely,direction:i.direction})},translucent:function(){return!0}}),new(p.Scene.WallLinkCustomMaterialProperty=h)(i)},_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial()},_installWaveCircleMaterial:function(){var e=p.Color,i=p.defaultValue,t=Object.defineProperties,n=p.Event,a=p.Property,r=p.Material;function o(t){t=t||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=i(t.color,e.fromBytes(0,255,255,255)),this.duration=i(t.duration,45),this.count=Math.max(i(t.count,2),1),this.gradient=i(t.gradient,.1),this.gradient<0?this.gradient=0:1<this.gradient&&(this.gradient=1)}t(o.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),o.prototype.getType=function(){return r.CircleWaveType},o.prototype.getValue=function(t,e){return(e=e||{}).color=a.getValueOrUndefined(this._color,t),e.duration=this._duration,e.count=this.count,e.gradient=this.gradient,e},o.prototype.equals=function(t){return this===t||t instanceof o&&p.Property.equals(this._color,t._color)},t(o.prototype,{color:p.createPropertyDescriptor("color"),duration:p.createPropertyDescriptor("duration")}),p.Scene.CircleWaveMaterialProperty=o,r.CircleWaveType="CircleWave",r._materialCache.addMaterial(r.CircleWaveType,{fabric:{type:r.CircleWaveType,uniforms:{color:new e(1,0,0,.7),duration:45,count:1,gradient:.1},source:this._getDynamicCircleShader({get:!0})},translucent:function(){return!0}})},_installCircleFadeMaterial:function(){var t=p.Color,e=p.defaultValue,i=Object.defineProperties,n=p.Event,a=p.Property,r=p.Material,o=new t(0,0,0,0);function s(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e(t.color,o),this._duration=t.duration||1e3,this._time=void 0}i(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return r.CircleFadeMaterialType},s.prototype.getValue=function(t,e){return(e=e||{}).color=a.getValueOrClonedDefault(this._color,t,o,e.color),void 0===this._time&&(this._time=(new Date).getTime()),e.time=((new Date).getTime()-this._time)/this._duration,e},s.prototype.equals=function(t){return this===t||t instanceof s&&p.Property.equals(this._color,t._color)},i(s.prototype,{color:p.createPropertyDescriptor("color")}),p.Scene.CircleFadeMaterialProperty=s,r.CircleFadeMaterialType="CircleFadeMaterial",r._materialCache.addMaterial(r.CircleFadeMaterialType,{fabric:{type:r.CircleFadeMaterialType,uniforms:{color:new t(1,0,0,1),time:1},source:this._getCircleFadeShader({get:!0})},translucent:function(){return!0}})},_installCityLineMaterial:function(){var t=p.Color,e=p.defaultValue,i=p.defined,n=Object.defineProperties,a=p.Event,r=p.createPropertyDescriptor,o=p.Property,s=p.Material,l=t.WHITE;function c(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||p.Color.BLUE,this.duration=t.duration||1e3,this._time=void 0,this._img=t.imgUrl||s.PolylineCityLinkImage}n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:r("color")}),c.prototype.getType=function(){return s.PolylineCityLinkType},c.prototype.getValue=function(t,e){return(e=i(e)?e:{}).color=o.getValueOrClonedDefault(this._color,t,l,e.color),e.image=this._img,void 0===this._time&&(this._time=t.secondsOfDay),e.time=1e3*(t.secondsOfDay-this._time)/this.duration,e},c.prototype.equals=function(t){return this===t||t instanceof c&&o.equals(this._color,t._color)},p.Scene.PolylineCityLinkMaterialProperty=c,s.PolylineCityLinkType="PolylineCityLink",s.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",s._materialCache.addMaterial(s.PolylineCityLinkType,{fabric:{type:s.PolylineCityLinkType,uniforms:{color:new t(1,0,0,1),image:s.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:!0})},translucent:function(){return!0}})},_installWarnMaterial:function(){var i=p.Color,e=p.defaultValue,n=p.defined,t=Object.defineProperties,a=p.Event,r=p.createPropertyDescriptor,o=p.Property,s=p.Material;function l(t){t=e(t,e.EMPTY_OBJECT),this._definitionChanged=new a,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||i.BLUE,this.duration=t.duration||3e3,this._time=(new Date).getTime()}t(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.prototype.getValue=function(t,e){return(e=n(e)?e:{}).color=o.getValueOrClonedDefault(this._color,t,i.WHITE,e.color),e.image=s.WarnLinkImage,e.time=((new Date).getTime()-this._time)%this.duration/this.duration,e},l.prototype.equals=function(t){return this===t||t instanceof l&&o.equals(this._color,t._color)},t(l.prototype,{color:r("color")}),p.Scene.WarnLinkMaterialProperty=l,s.WarnLinkType="WarnWallLinkType",s.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",s._materialCache.addMaterial(s.WarnLinkType,{fabric:{type:s.WarnLinkType,uniforms:{color:new i(1,0,0,.5),image:s.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:!0,count:10,freely:"cross",direction:"-"})},translucent:function(){return!0}})},_installFlowMaterial:function(){var e=p.Color,i=p.defaultValue,t=Object.defineProperties,n=p.Event,a=p.createPropertyDescriptor,r=p.Property,o=p.Material;function s(t){t=i(t,i.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=t.color||e.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=i(t.duration,45)}t(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return o.PolylineFlowType},s.prototype.getValue=function(t,e){return(e=e||{}).color=r.getValueOrClonedDefault(this._color,t,p.Color.WHITE,e.color),e.duration=this._duration,e},s.prototype.equals=function(t){return this===t||t instanceof s&&r.equals(this._color,t._color)},t(s.prototype,{color:a("color"),duration:a("duration")}),p.Scene.PolylineFlowMaterialProperty=s,o.PolylineFlowType="PolylineFlow",o._materialCache.addMaterial(o.PolylineFlowType,{fabric:{type:o.PolylineFlowType,uniforms:{color:new e(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:!0})},translucent:function(){return!0}})}},Y.prototype={_getFlowLineShader:function(){return"uniform vec4 color;\n uniform float duration;\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float t =fract(czm_frameNumber / duration);\n t *= 1.03;\n float alpha = smoothstep(t- 0.03, t, st.s) * step(-t, -st.s);\n alpha += 0.1;\n vec4 fragColor;\n fragColor.rgb = (color.rgb) / 0.5;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = fragColor.rgb;\n material.alpha = alpha;\n material.emission = fragColor.rgb;\n return material;\n }\n "},_getDynamicLineShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n if(texture(image, vec2(0.0, 0.0)).a == 1.0){\n discard;\n }else{\n material.alpha = texture(image, vec2(1.0 - fract(time - st.s), st.t)).a * color.a;\n }\n \n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n \n return material;\n }\n "},_getDynamicLightLineShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n vec4 colorImage = texture(image, vec2(fract(1.0 *st.s - time), fract(st.t)));\n \n vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getDirectionWallShader:function(t){var e;if(t&&t.get)return e="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ","vertical"==t.freely?e+="vec4 colorImage = texture(image, vec2(fract(float("+t.count+")*st.t "+t.direction+" time), fract(st.s)));\n ":e+="vec4 colorImage = texture(image, vec2(fract(float("+t.count+")*st.s "+t.direction+" time), fract(st.t)));\n ",(e+="vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n ")+" material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getCircleFadeShader:function(t){if(t&&t.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n \n {\n \n czm_material material = czm_getDefaultMaterial(materialInput);\n \n material.diffuse = 1.5 * color.rgb;\n \n vec2 st = materialInput.st;\n \n float dis = distance(st, vec2(0.5, 0.5));\n \n float per = fract(time);\n \n if(dis > per * 0.5){\n \n //material.alpha = 0.0;\n \n discard;\n \n }else {\n \n material.alpha = color.a * dis / per / 2.0;\n \n }\n \n return material;\n \n }"},_getDynamicCircleShader:function(t){if(t&&t.get)return"uniform vec4 color;\n uniform float duration;\n uniform float count;\n uniform float gradient;\n \n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(czm_frameNumber / duration);\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n } else {\n float perDis = 0.5 / count;\n float disNum;\n float bl = .0;\n for (int i = 0; i <= 10; i++) {\n if (float(i) <= count) {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0) {\n if (disNum < perDis) {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl, gradient);\n }\n }\n }\n }\n return material;\n }\n "},_getRadarScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\n out vec4 myOutputColor;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 v01 = testPt - ptOnLine;\n normalize(v01);\n vec3 temp = cross(v01, lineNormal);\n float d = dot(temp, u_scanPlaneNormalEC);\n return d > 0.5;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point -planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\n return length(tempPt - ptOnLine);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n float twou_radius = u_radius * 2.0;\n if(dis < u_radius){\n float f0 = 1.0 -abs(u_radius - dis) / u_radius;\n f0 = pow(f0, 64.0);\n vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\n float f = 0.0;\n if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)){\n float dis1= length(prjOnPlane.xyz - lineEndPt);\n f = abs(twou_radius -dis1) / twou_radius;\n f = pow(f, float("+t.width+"));\n }\n if(float("+t.border+") > 0.0){\n myOutputColor = mix(myOutputColor, u_scanColor, f + f0);\n } else {\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(t){if(t&&t.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform float u_radius;\n out vec4 myOutputColor;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point - planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius){\n float f = 1.0 - abs(u_radius - dis) / u_radius;\n f = pow(f, float("+t.border+"));\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n "}};let _={},r=void 0;function b(t,e,i){t&&(this._viewer=t,_=e,r=i,_.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",this._drawLayer=new _.CustomDataSource("drawLayer"),t&&t.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}b.prototype={createGraphics:function(){return new _.Entity},getDfSt(t){if(r)return t=t.reduce((t,e)=>(t||r)[e],void 0),r.baseService+t},setOneSkyBox:function(){return new _.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})},setTwoSkyBox:function(){return new _.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})},setThreeSkyBox:function(){return new _.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})},setOneGroundSkyBox:function(){return new _.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})},setTwoGroundSkyBox:function(){return new _.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})},setThreeGroundSkyBox:function(){return new _.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})},setDarkEffect:function(t){return t=t||{},this._viewer.scene.postProcessStages.add(new _.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n}\n",uniforms:{scale:1,offset:function(){return t.offset||new _.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(t){if(this._viewer&&t)return this._viewer.scene.postProcessStages.add(new _.PostProcessStage({name:"blur_x_direction",fragmentShader:"uniform float height;\nuniform float width;\nuniform sampler2D colorTexture1;\n\nin vec2 v_textureCoordinates;\n\nconst int SAMPLES = 9;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nfloat wr = float(1.0 / width);\nfloat hr = float(1.0 / height);\nvec4 result = vec4(0.0);\nint count = 0;\nfor(int i = -SAMPLES; i <= SAMPLES; ++i){\nfor(int j = -SAMPLES; j <= SAMPLES; ++j){\nvec2 offset = vec2(float(i) * wr, float(j) * hr);\nresult += texture(colorTexture1, st + offset);\n}\n}\nresult = result / float(count);\nout_FragColor = result;\n}\n",uniforms:{width:t.width,height:t.height,colorTexture1:"Bright"}}))},setRainEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new _.PostProcessStage({name:"rainEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n \n float hash(float x){\n return fract(sin(x*23.3)*13.13);\n }\n \n void main(){\n float time = czm_frameNumber / 60.0;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a=-.4;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*.3+1.;\n float v=1.-sin(hash(floor(uv.x*100.))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n }\n "}))},setSnowEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new _.PostProcessStage({name:"snowEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n float snow(vec2 uv,float scale){\n float time = czm_frameNumber / 60.0;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));\n if(w<.1)return 0.;\n uv+=time/scale;\n uv.y+=time*2./scale;\n uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;\n vec2 s=floor(uv),f=fract(uv),p;\n float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;\n d=length(p);\n k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01);\n return k*w;\n }\n \n void main(){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n \n }\n "}))},setFogEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new _.PostProcessStage({fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nin vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n out_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new _.Cartesian4(10,0,200,.3),fogColor:_.Color.AZURE}}))},setDefSceneConfig:function(){this._viewer&&(this._viewer.scene.sun.show=!1,this._viewer.scene.moon.show=!1,this._viewer.scene.fxaa=!0,this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.undergroundMode=!1,this._viewer.scene.terrainProvider.isCreateSkirt=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.globe.showGroundAtmosphere=!1,this._viewer.scene.globe.enableLighting=!0,this._viewer.scene.fog.enabled=!1,this._viewer.cesiumWidget.creditContainer.style.display="none")},setBloomLightScene:function(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=!0,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=!1,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=!1)},removePostProcessStage:function(t){t&&(Array.isArray(t)?t.forEach(t=>{this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t)}):this._viewer.scene.postProcessStages.contains(t)&&this._viewer.scene.postProcessStages.remove(t))},setView:function(t){var e;this._viewer&&t&&t.position&&(t.distance&&(e=new _.Cartesian3(0,t.distance,window.opt.distance),t.position=_.Cartesian3.add(t.position,e,new _.Cartesian3)),this._viewer.scene.camera.setView({destination:t.position,orientation:t.orientation||{heading:_.Math.toRadians(90),pitch:_.Math.toRadians(90),roll:_.Math.toRadians(0)}}))},flyTo:function(t){var e;this._viewer&&t&&t.position&&(t.distance&&(e=new _.Cartesian3(0,t.distance,t.distance),t.position=_.Cartesian3.add(t.position,e,new _.Cartesian3)),this._viewer.scene.camera.flyTo({destination:t.position,orientation:t.orientation||{heading:_.Math.toRadians(90),pitch:_.Math.toRadians(90),roll:_.Math.toRadians(0)},easingFunction:t.easingFunction||_.EasingFunction.LINEAR_NONE,duration:t.duration||3,complete:t.callback}))},transformCartesianToWGS84:function(t){if(this._viewer&&t)return t=_.Ellipsoid.WGS84.cartesianToCartographic(t),{lng:_.Math.toDegrees(t.longitude),lat:_.Math.toDegrees(t.latitude),alt:t.height}},transformWGS84ArrayToCartesianArray:function(t,e){var i;if(this._viewer&&t)return i=this,t?t.map(function(t){return i.transformWGS84ToCartesian(t,e)}):[]},transformWGS84ToCartesian:function(t,e){if(this._viewer)return t?_.Cartesian3.fromDegrees(t.lng||t.lon,t.lat,t.alt=e||t.alt,_.Ellipsoid.WGS84):_.Cartesian3.ZERO},transformCartesianArrayToWGS84Array:function(t){var e;if(this._viewer)return e=this,t?t.map(function(t){return e.transformCartesianToWGS84(t)}):[]},setCameraEotateHeading(l){if(l){let e=this._viewer,i=_.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=_.Math.toRadians(-30),a=12,r=5e3,t=_.JulianDate.fromDate(new Date),o=(e.clock.startTime=t.clone(),e.clock.currentTime=t.clone(),e.clock.clockRange=_.ClockRange.CLAMPED,e.clock.clockStep=_.ClockStep.SYSTEM_CLOCK,e.camera.heading),s=function(){var t=_.JulianDate.secondsDifference(e.clock.currentTime,e.clock.startTime),t=_.Math.toRadians(t*a)+o;e.scene.camera.setView({destination:i,orientation:{heading:t,pitch:n}}),e.scene.camera.moveBackward(r),0<=_.JulianDate.compare(e.clock.currentTime,e.clock.stopTime)&&e.clock.onTick.removeEventListener(s)};e.clock.onTick.addEventListener(s)}},transformWGS84ToCartographic:function(t){return t?_.Cartographic.fromDegrees(t.lng||t.lon,t.lat,t.alt):_.Cartographic.ZERO},getCatesian3FromPX:function(t){if(this._viewer&&t){var e,i,n=this._viewer.scene.pick(t),a=null,r=!1,o=!1;if((r=n instanceof _.Cesium3DTileFeature?!0:r)&&(a=this._viewer.scene.pickPosition(t))&&((e=_.Cartographic.fromCartesian(a)).height<0&&(e.height=0),s=_.Math.toDegrees(e.longitude),i=_.Math.toDegrees(e.latitude),e=e.height,a=this.transformWGS84ToCartesian({lng:s,lat:i,alt:e})),!n){var s=this._viewer.scene.camera.getPickRay(t);if(!s)return null;a=this._viewer.scene.globe.pick(s,this._viewer.scene),o=!0}return(a=r||o?a:this._viewer.scene.camera.pickEllipsoid(t,this._viewer.scene.globe.ellipsoid))?(i=this.transformCartesianToWGS84(a)).alt<0?this.transformWGS84ToCartesian(i,.1):a:!1}},getCameraPosition:function(){if(this._viewer){var t,e,i,n,a,r,o,s,l,c,h,d=this._viewer.scene.camera.pickEllipsoid(new _.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(d)return t=180*(d=_.Ellipsoid.WGS84.cartesianToCartographic(d)).longitude/Math.PI,d=180*d.latitude/Math.PI,n=this._viewer.camera._direction,e=_.Math.toDegrees(n.x),i=_.Math.toDegrees(n.y),n=_.Math.toDegrees(n.z),a=this._viewer.camera.positionCartographic.height,r=_.Math.toDegrees(this._viewer.camera.heading),o=_.Math.toDegrees(this._viewer.camera.pitch),s=_.Math.toDegrees(this._viewer.camera.roll),c=(l=this._viewer.camera.computeViewRectangle()).west/Math.PI*180,h=l.north/Math.PI*180,c=(c+l.east/Math.PI*180)/2,h=(h+l.south/Math.PI*180)/2,{lon:t,lat:d,height:a,heading:r,pitch:o,roll:s,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:c,y:h},direction:new _.Cartesian3(e,i,n)}}},updateCameraState:function(t){this._viewer.scene._screenSpaceCameraController.enableRotate=t,this._viewer.scene._screenSpaceCameraController.enableTranslate=t,this._viewer.scene._screenSpaceCameraController.enableZoom=t,this._viewer.scene._screenSpaceCameraController.enableTilt=t,this._viewer.scene._screenSpaceCameraController.enableLook=t},bindHandelEvent:function({leftClick:e,mouseMove:i,doubleClick:n,leftDown:a,mouseWheel:r,leftUp:o}){var s;this._viewer&&(s=new _.ScreenSpaceEventHandler(this._viewer.canvas),e&&s.setInputAction(function(t){e(t,s)},_.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(t){i(t,s)},_.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(t){n(t,s)},_.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),a&&s.setInputAction(function(t){a(t,s)},_.ScreenSpaceEventType.LEFT_DOWN),r&&s.setInputAction(function(t){r(t,s)},_.ScreenSpaceEventType.WHEEL),o)&&s.setInputAction(function(t){o(t,s)},_.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(e){var i,n;this._viewer&&(i=new _.ScreenSpaceEventHandler(this._viewer.scene.canvas),n=this,i.setInputAction(function(t){t=n._viewer.scene.camera.pickEllipsoid(t.endPosition,n._viewer.scene.globe.ellipsoid);"function"==typeof e&&e(n.transformCartesianToWGS84(t),i)},_.ScreenSpaceEventType.MOUSE_MOVE))},saveSceneImages:function(){var t,e;this._viewer&&(e=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),t=document.createElement("a"),e=function(t){for(var t=t.split(","),e=t[0].match(/:(.*?);/)[1],i=atob(t[1]),n=i.length,a=new Uint8Array(n);n--;)a[n]=i.charCodeAt(n);return new Blob([a],{type:e})}(e),e=URL.createObjectURL(e),t.download="scene.png",t.href=e,t.click())},_installAmapImageryProvider:function(){_.Scene.AmapImageryProvider=function(t){return t.url="img"===t.style?"https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}":"http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}",t.subdomains||(t.subdomains=["01","02","03","04"]),new _.UrlTemplateImageryProvider(t)}},_installTdtImageryProvider:function(){_.Scene.TdtImageryProvider=function(t){return new _.UrlTemplateImageryProvider({url:"http://t{s}.tianditu.gov.cn/{layer}_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer={layer}&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk={key}".replace(/\{layer\}/g,t.style||"vec").replace(/\{key\}/g,t.key||""),style:"default",format:"tiles",tileMatrixSetID:"c",matrixSet:"c",wrapX:!0,crossOrigin:"anonymous",subdomains:[...Array(6).keys()].map(t=>(t+1).toString()),tileMatrixLabels:[...Array(18).keys()].map(t=>(t+1).toString()),tilingScheme:new _.GeographicTilingScheme,maximumLevel:18})}},_installTencentImageryProvider:function(){_.Scene.TencentImageryProvider=function(t){return t.layer="img",t.url="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",t.subdomains||(t.subdomains=["0","1","2"]),t.customTags={sx:function(t,e,i,n){return e>>4},sy:function(t,e,i,n){return(1<<n)-i>>4}},new _.UrlTemplateImageryProvider(t)}},_installGooGleImageryProvider:function(){_.Scene.GoogleImageryProvider=function(t){return t.url="img"===t.style?"http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali":"ter"===t.style?"http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile":"http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",t.subdomains||(t.subdomains=["1","2","3","4","5"]),new _.UrlTemplateImageryProvider(t)}},_installBaiduImageryProvider:function(){var e="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function t(t){e=t.temp_url||e,this._url=e,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new _.WebMercatorTilingScheme({rectangleSouthwestInMeters:new _.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new _.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=t.style||"normal"}Object.defineProperties(t.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(this.ready)return this._tileWidth;throw new _.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new _.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new _.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new _.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new _.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new _.DeveloperError("rectangle must not be called before the imagery provider is ready.")}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}}}),t.prototype.requestImage=function(t,e,i){var n,a;if(this.ready)return n=this._tilingScheme.getNumberOfXTilesAtLevel(i),a=this._tilingScheme.getNumberOfYTilesAtLevel(i),t=this._url.replace("{x}",t-n/2).replace("{y}",a/2-e-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style),_.ImageryProvider.loadImage(this,t);throw new _.DeveloperError("requestImage must not be called before the imagery provider is ready.")},_.Scene.BaiduImageryProvider=t},_installGroundSkyBox:function(){var o=_.BoxGeometry,s=_.Cartesian3,e=_.defaultValue,l=_.defined,i=_.destroyObject,c=_.DeveloperError,h=_.GeometryPipeline,t=_.Matrix3,d=_.Matrix4,x=_.Transforms,u=_.VertexFormat,p=_.BufferUsage,m=_.CubeMap,n=_.DrawCommand,g=_.loadCubeMap,f=_.RenderState,v=_.VertexArray,y=_.BlendingState,b=_.SceneMode,C=_.ShaderProgram,w=_.ShaderSource;function a(t){this.sources=t.sources,this._sources=void 0,this.show=e(t.show,!0),this._command=new n({modelMatrix:d.clone(d.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(d.getRotation)||(d.getRotation=d.getMatrix3);var I=new t;a.prototype.update=function(t,e){var i=this;if(this.show&&(t.mode===b.SCENE3D||t.mode===b.MORPHING)&&t.passes.render){var n=t.context;if(this._sources!==this.sources){this._sources=this.sources;var a=this.sources;if(!(l(a.positiveX)&&l(a.negativeX)&&l(a.positiveY)&&l(a.negativeY)&&l(a.positiveZ)&&l(a.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof a.positiveX!=typeof a.negativeX||typeof a.positiveX!=typeof a.positiveY||typeof a.positiveX!=typeof a.negativeY||typeof a.positiveX!=typeof a.positiveZ||typeof a.positiveX!=typeof a.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof a.positiveX?g(n,this._sources).then(function(t){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=t}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new m({context:n,source:a}))}var r=this._command;if(r.modelMatrix=x.eastNorthUpToFixedFrame(t.camera._positionWC),l(r.vertexArray)||(r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return d.getRotation(r.modelMatrix,I)}},a=o.createGeometry(o.fromDimensions({dimensions:new s(2,2,2),vertexFormat:u.POSITION_ONLY})),t=this._attributeLocations=h.createAttributeLocations(a),r.vertexArray=v.fromGeometry({context:n,geometry:a,attributeLocations:t,bufferUsage:p._DRAW}),r.renderState=f.fromCache({blending:y.ALPHA_BLEND})),l(r.shaderProgram)&&this._useHdr===e||(a=new w({defines:[e?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),r.shaderProgram=C.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=e),l(this._cubeMap))return r}},a.prototype.isDestroyed=function(){return!1},a.prototype.destroy=function(){var t=this._command;return t.vertexArray=t.vertexArray&&t.vertexArray.destroy(),t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),i(this)},_.Scene.GroundSkyBox=a},removeHandlerByName(t=[]){t.forEach(t=>{this._viewer.screenSpaceEventHandler.removeInputAction(_.ScreenSpaceEventType[t])})}};let I={};function z(t,e){t&&(this._viewer=t,I=e)}z.prototype={splitCartesians3:function(t){for(var e=[],i=0;i<t.length;i+=3){var n=new I.Cartesian3(t[i],t[i+1],t[i+2]);e.push(n)}return e.push(e[0]),e},getLinkedPointList:function(t,e,i,n){if(this._viewer){var a=[],r=I.Cartographic.fromCartesian(t),o=I.Cartographic.fromCartesian(e),s=180*r.longitude/Math.PI,r=180*r.latitude/Math.PI,l=180*o.longitude/Math.PI,o=180*o.latitude/Math.PI,c=Math.sqrt((s-l)*(s-l)+(r-o)*(r-o))*i,h=I.Cartesian3.clone(t),d=I.Cartesian3.clone(e),x=I.Cartesian3.distance(h,I.Cartesian3.ZERO),u=I.Cartesian3.distance(d,I.Cartesian3.ZERO);if(I.Cartesian3.normalize(h,h),I.Cartesian3.normalize(d,d),0!=I.Cartesian3.distance(h,d)){var p=I.Cartesian3.angleBetween(h,d);a.push(t);for(var m=1;m<n-1;m++){var g=+m/(n-1),f=1-g,v=Math.sin(f*p)/Math.sin(p),y=Math.sin(g*p)/Math.sin(p),v=I.Cartesian3.multiplyByScalar(h,v,new I.Cartesian3),y=I.Cartesian3.multiplyByScalar(d,y,new I.Cartesian3),v=I.Cartesian3.add(v,y,new I.Cartesian3),y=g*Math.PI,f=x*f+u*g+Math.sin(y)*c,v=I.Cartesian3.multiplyByScalar(v,f,v);a.push(v)}a.push(e)}return a}},getPositionsAngle:function(t){var e,i,n,a;if(t)return i=t.position1,a=t.position2,n=I.Transforms.eastNorthUpToFixedFrame(i),n=I.Matrix4.inverse(n,new I.Matrix4),i=I.Matrix4.multiplyByPoint(n,i,new I.Cartesian3),n=I.Matrix4.multiplyByPoint(n,a,new I.Cartesian3),"pitch"===t.type?e=Math.atan2(n.z-i.z,n.x-i.x):"heading "===t.type&&(e=Math.atan2(n.y-i.y,n.x-i.x)),(a=e*(180/Math.PI))<0&&(a+=360),a},getPositionsArea:function(n){let t=0;if(n){let e=0,i=I.Ellipsoid.WGS84;n.push(n[0]);for(let t=1;t<n.length;t++){var a=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[t-1])),r=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[t]));e+=a.x*r.y-r.x*a.y}t=Math.abs(e).toFixed(2)}return t},getPolygonArea:function(t){if(this._viewer){for(var e=function(t,e){var i=t.lat*radiansPerDegree,t=t.lon*radiansPerDegree,n=e.lat*radiansPerDegree,e=e.lon*radiansPerDegree,i=-Math.atan2(Math.sin(t-e)*Math.cos(n),Math.cos(i)*Math.sin(n)-Math.sin(i)*Math.cos(n)*Math.cos(t-e));return i<0&&(i+=2*Math.PI),i*degreesPerRadian},i=0,n=0;n<t.length-2;n++){var a=(n+1)%t.length,r=(n+2)%t.length,o=(o=t[n],s=t[a],l=t[r],c=void 0,(c=e(s,o)-e(s,l))<0&&(c+=360),c);i+=this.getPositionsDistance(positions[n],positions[a])*this.getPositionsDistance(positions[a],positions[r])*Math.abs(Math.sin(o))}return(i/1e6).toFixed(4)}var o,s,l,c},getPointDistance:function(t,e){var i;if(this._viewer)return t=I.Cartographic.fromCartesian(t),e=I.Cartographic.fromCartesian(e),(i=new I.EllipsoidGeodesic).setEndPoints(t,e),i=i.surfaceDistance,Math.sqrt(Math.pow(i,2)+Math.pow(e.height-t.height,2))},getPositionDistance:function(e){let i=0;for(let t=0;t<e.length-1;t++){var n=this.transformWGS84ToCartographic(e[t]),a=this.transformWGS84ToCartographic(e[t+1]),r=new I.EllipsoidGeodesic,r=(r.setEndPoints(n,a),r.surfaceDistance),r=Math.sqrt(Math.pow(r,2)+Math.pow(a.height-n.height,2));i+=r}return i.toFixed(3)},getIntersectObj:function(t,e,i=[],n=!1){if(this._viewer)return e=I.Cartesian3.normalize(I.Cartesian3.subtract(e,t,new I.Cartesian3),new I.Cartesian3),t=new I.Ray(t,e),e=[],n?e=this._viewer.scene.drillPickFromRay(t,10,i):(n=this._viewer.scene.pickFromRay(t,i),I.defined(n)&&(e=[n])),e},getPointOnEllipsoid:function(t,e,i,n,a,r,o,s,l,c){var h,d,x,u;if(this._viewer)return h=new I.Cartesian3,d=new I.Cartesian3,x=new I.Quaternion,u=new I.Matrix3,e=t+e,I.Cartesian3.multiplyByScalar(n,Math.cos(e),h),I.Cartesian3.multiplyByScalar(i,Math.sin(e),d),I.Cartesian3.add(h,d,h),n=Math.cos(t),n*=n,i=Math.sin(t),i*=i,e=r/Math.sqrt(o*n+a*i)/s,I.Quaternion.fromAxisAngle(h,e,x),I.Matrix3.fromQuaternion(x,u),I.Matrix3.multiplyByVector(u,l,c),I.Cartesian3.normalize(c,c),I.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(t,e,i){if(this._viewer){for(var n=new I.Cartesian3,a=new I.Cartesian3,r=new I.Cartesian3,o=new I.Cartesian3,s=e.ellipsoid,l=e.height,c=e.extrudedHeight,e=i?t.length/3*2:t.length/3,h=new Float64Array(3*e),d=t.length,x=i?d:0,u=0;u<d;u+=3){var p=u+1,m=u+2,g=I.Cartesian3.fromArray(t,u,n),f=(s.scaleToGeodeticSurface(g,g),I.Cartesian3.clone(g,a)),v=s.geodeticSurfaceNormal(g,o),y=I.Cartesian3.multiplyByScalar(v,l,r);I.Cartesian3.add(g,y,g),i&&(I.Cartesian3.multiplyByScalar(v,c,y),I.Cartesian3.add(f,y,f),h[u+x]=f.x,h[p+x]=f.y,h[m+x]=f.z),h[u]=g.x,h[p]=g.y,h[m]=g.z}return h}},computeEllipseEdgePositions:function(t){if(this._viewer){for(var e=new I.Cartesian3,i=new I.Cartesian3,n=new I.Cartesian3,a=new I.Cartesian3,r=t.semiMinorAxis,o=t.semiMajorAxis,s=t.rotation,l=t.center,t=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180,c=((t=t>Math.PI/12?Math.PI/12:t)<Math.PI/180&&(t=Math.PI/180),r*r),h=o*o,d=o*r,x=I.Cartesian3.magnitude(l),u=I.Cartesian3.normalize(l,e),p=I.Cartesian3.cross(I.Cartesian3.UNIT_Z,l,i),p=I.Cartesian3.normalize(p,p),m=I.Cartesian3.cross(u,p,n),g=Math.ceil(2*I.Math.PI/t),f=t,v=a,y=0,b=[],C=0;C<g;C++)v=this.getPointOnEllipsoid(C*f,s,m,p,c,d,h,x,u,v),b[y++]=v.x,b[y++]=v.y,b[y++]=v.z;o={};return o.numPts=g,o.outerPositions=b,o}},computeSectorEdgePositions:function(t){if(this._viewer){for(var e=new I.Cartesian3,i=new I.Cartesian3,n=new I.Cartesian3,a=new I.Cartesian3,r=t.semiMinorAxis,o=t.semiMajorAxis,s=t.rotation,l=t.angle||2*Math.PI,c=t.center,t=t.granularity&&"number"==typeof t.granularity?t.granularity:Math.PI/180,h=((t=t>Math.PI/12?Math.PI/12:t)<Math.PI/180&&(t=Math.PI/180),r*r),d=o*o,x=o*r,u=I.Cartesian3.magnitude(c),p=I.Cartesian3.normalize(c,e),m=I.Cartesian3.cross(I.Cartesian3.UNIT_Z,c,i),m=I.Cartesian3.normalize(m,m),g=I.Cartesian3.cross(p,m,n),f=Math.ceil(l/t),v=t,y=a,b=0,C=[],w=0;w<f;w++)y=this.getPointOnEllipsoid(w*v,s,g,m,h,x,d,u,p,y),C[b++]=y.x,C[b++]=y.y,C[b++]=y.z;o={};return o.numPts=f,o.outerPositions=C,o}},computeLonlatPointsTerrainData:function(t,e){if(this._viewer){for(var i=[],n=0;n<t.length;n++)i.push(I.Cartographic.fromDegrees(t[n].lon,t[n].lat));this._viewer.scene.clampToHeightMostDetailed(i).then(function(t){e(t)})}},computeCartographicPointsTerrainData:function(t,a){if(this._viewer&&!(t.length<=0)){for(var e=[],i=0;i<t.length;i++)e.push(I.Cartesian3.fromRadians(t[i].longitude,t[i].latitude,t[i].height));var n=this._viewer.scene.clampToHeightMostDetailed(e),r=this;n.then(function(t){for(var e=[],i=r._viewer.scene.globe.ellipsoid,n=0;n<t.length;n++)e.push(i.cartesianToCartographic(t[n]));a(e)}).catch(function(t){console.log(t)})}},_checkLonDegree:function(t){return!(180<t||t<-180)},_checkLatDegree:function(t){return!(90<t||t<-90)},computeInterpolateLineLonlat:function(t,e){if(!t||!e)return null;if(t.lon||!t.lat||!e.lon||!e.lat)return null;if(!(this._checkLonDegree(t.lon)&&this._checkLonDegree(e.lon)&&this._checkLatDegree(t.lat)&&this._checkLatDegree(e.lat)))return null;var i=[],n=(i.push([t.lon,t.lat]),Math.sqrt(Math.pow(e.lon-t.lon,2)+Math.pow(e.lat-t.lat,2)));if(n<=1e-5)i.push([e.lon,e.lat]);else for(var a=n/1e-5,r=(e.lon-t.lon)/a,o=(e.lat-t.lat)/a,s=0;s<a;s++){var l=t.lon+(s+1)*r,c=t.lat+(s+1)*o;i.push([l,c])}return i},computeInterpolateLineCartographic:function(t,e,i){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var n=[],a=(n.push(new I.Cartographic(t.longitude,t.latitude)),Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2))),i=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(a<=i)n.push(new I.Cartographic(e.longitude,e.latitude));else{for(var r=a/i,o=(e.longitude-t.longitude)/r,s=(e.latitude-t.latitude)/r,l=0;l<r;l++){var c=t.longitude+(l+1)*o,h=t.latitude+(l+1)*s;n.push(new I.Cartographic(c,h))}n.push(new I.Cartographic(e.longitude,e.latitude,e.height))}return n},computeInterpolateLineHeightCartographic:function(t,e){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var i=[],n=(i.push(new I.Cartographic(t.longitude,t.latitude,t.height)),Math.sqrt(Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2)));if(!(n<=1e-5*Math.PI/180))for(var a=n/1e-5*Math.PI/180,r=(e.longitude-t.longitude)/a,o=(e.latitude-t.latitude)/a,s=(e.height-t.height)/a,l=0;l<a;l++){var c=t.longitude+(l+1)*r,h=t.latitude+(l+1)*o,d=t.height+(l+1)*s;i.push(new I.Cartographic(c,h,d))}return i.push(new I.Cartographic(e.longitude,e.latitude,e.height)),i},computeInterpolate2IndexLineHeightCartographic:function(t,e,i,n){if(!t||!e)return null;if(!(t.longitude&&t.latitude&&e.longitude&&e.latitude))return null;var a=[];a.push(new I.Cartographic(t.longitude,t.latitude,t.height));for(var r=(e.longitude-t.longitude)/i,o=(e.latitude-t.latitude)/i,s=(e.height-t.height)/i,l=0;l<n;l++){var c=t.longitude+(l+1)*r,h=t.latitude+(l+1)*o,d=t.height+(l+1)*s;a.push(new I.Cartographic(c,h,d))}return a},computeInterpolateIndexLineHeightCartographic:function(t,e,i,n){var a,r;return t&&e&&t.longitude&&t.latitude&&e.longitude&&e.latitude?(a=(e.longitude-t.longitude)/i,r=(e.latitude-t.latitude)/i,e=(e.height-t.height)/i,i=t.longitude+n*a,a=t.latitude+n*r,r=t.height+n*e,new I.Cartographic(i,a,r)):null}};let F=null;function L(t,e,i){t&&(this._viewer=t,F=e,this._installPrimitives())}L.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive(),this._installCustomPrimitive(),this._installFlowWaterPrimitive()},_installCustomPrimitive:function(){},_installTetrahedronPrimitive:function(){try{var i=F.Cartesian3,n=F.ComponentDatatype,o=F.PrimitiveType,a=F.BoundingSphere,r=F.GeometryAttribute,s=F.GeometryPipeline,l=F.Geometry,c=F.defined,h=F.RenderState,d=F.ShaderSource,x=F.ShaderProgram,u=F.DrawCommand,p=F.Pass,m=F.Appearance,g=F.BufferUsage,e=F.Color,f=F.VertexArray,v=(F.buildModuleUrl,F.Matrix4),y=F.Matrix3,b=F.Texture,t=F.Resource,C=F.Transforms,w=F.defaultValue,I=this._viewer,_=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png",A=function(t){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=t.position,this._createCommand=G,this._angle=0,this._distance=w(t.distance,1),this._setInterval=void 0,this._viewer=I,this._speed=w(t.speed,1),this._color=w(t.color,new e(1,1,0,.8)),this._scale=w(t.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=_,this._modelMatrix=V(this),this._height=R(this),Z(this)};A.prototype.update=function(t){this.show&&(c(this._command)||(this._command=this._createCommand(t.context,this)),c(this._command))&&t.commandList.push(this._command)},A.prototype.isDestroyed=function(){return!1},A.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},A.prototype.startAnimate=function(){let e=this;this._setInterval=setInterval(function(){e._angle=e._angle+.01,0<Math.sin(e._angle)?e._height=.01:e._height=-.01;var t=new F.Cartesian3(0,0,e._height),t=(v.multiplyByTranslation(e._modelMatrix,t,e._modelMatrix),v.fromRotationTranslation(y.fromRotationZ(F.Math.toRadians(e._speed))));v.multiply(e._modelMatrix,t,e._modelMatrix)},5)},A.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const G=function(t,e){var i=M(),n=S(),a=m.getDefaultRenderState(!1,!0,void 0),a=h.fromCache(a),i=new d({sources:[i]}),n=new d({sources:[n]}),r={color:function(){return e._color},myImage:function(){return c(e._texture)?e._texture:e._viewer.scene.context.defaultTexture}},i=x.fromCache({context:t,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:{position:0,textureCoordinates:1}});return new u({vertexArray:P(t),primitiveType:o.TRIANGLES,renderState:a,shaderProgram:i,uniformMap:r,owner:this,pass:p.TRANSLUCENT,modelMatrix:e._modelMatrix})},P=function(t){var e=W(),e=new l({attributes:{position:new r({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:e.positions}),textureCoordinates:new r({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:e.sts})},indices:e.indices,primitiveType:o.TRIANGLES,boundingSphere:a.fromVertices(e.positions)}),e=s.computeNormal(e);return f.fromGeometry({context:t,geometry:e,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:g.STATIC_DRAW})},W=function(){var t=new Float64Array(15),e=(t[0]=0,t[1]=1,t[2]=0,t[3]=-1,t[4]=0,t[5]=0,t[6]=0,t[7]=-1,t[8]=0,t[9]=1,t[10]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=-1,new Uint16Array(18));return e[0]=4,e[1]=2,e[2]=3,e[3]=4,e[4]=3,e[5]=0,e[6]=4,e[7]=0,e[8]=1,e[9]=4,e[10]=1,e[11]=2,e[12]=1,e[13]=2,e[14]=3,e[15]=1,e[16]=3,e[17]=0,{indices:e,positions:t,sts:new Float32Array([0,0,1,0,1,1,0,1,.5,.5])}},M=function(){return"#version 300 es\n in vec3 position;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n out vec4 v_pickColor;\n void main()\n {\n v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;\n v_normalEC = czm_normal * normal;\n v_st = st;\n // v_pickColor = czm_batchTable_pickColor(batchId);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},S=function(){return"#version 300 es\n precision mediump float;\n in vec3 v_positionEC;\n in vec3 v_normalEC;\n in vec2 v_st;\n uniform vec4 color;\n in vec4 v_pickColor;\n uniform sampler2D myImage;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n vec2 st = materialInput.st;\n czm_material material = czm_getDefaultMaterial(materialInput);\n float dt_a11 = fract(czm_frameNumber / 100.0) * 3.14159265 * 2.0;\n float dt_a12 = sin(dt_a11);\n float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;\n vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));\n material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;\n material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},Z=function(i){t.createIfNeeded(i._imageUrl).fetchImage().then(function(t){var e=i._viewer.scene.context,e=c(t.internalFormat)?new b({context:e,pixelFormat:t.internalFormat,width:t.naturalWidth,height:t.naturalHeight,source:{arrayBufferView:t.bufferView}}):new b({context:e,source:t});i._texture=e})},V=function(t){var e=C.eastNorthUpToFixedFrame(t._localPosition),i=v.fromScale(t._scale),n=v.multiply(e,i,new v);return t._scaleMatrix=i,t._enuMatrix=e,n},R=function(t){var e=i.fromElements(0,0,t._distance,new F.Cartesian3),e=F.Matrix4.multiplyByPoint(t._enuMatrix,e,new i),e=v.multiplyByPoint(t._viewer.scene.camera._viewMatrix,e,new i),t=v.multiplyByPoint(t._viewer.scene.camera.frustum.projectionMatrix,e,new i);return i.normalize(t,new i).z};F.Scene.TetrahedronPrimitive=A}catch(i){console.log(i)}},_installXyzAxisPrimitive:function(){function t(t){this._viewer=t.viewer,this._model=t.model,this._matrix=t.matrix,this._radius=void 0,this._layer=new F.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new F.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=!1,this._xyzPid=void 0,this._builds()}t.prototype={_builds(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(t=>{var e=F.Matrix4.getTranslation(t.modelMatrix,new F.Cartesian3),t=t.boundingSphere,i=t.radius,n=new F.ArrowPolylinePrimitive({id:"axisZ",color:F.Color.RED,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),a=new F.ArrowPolylinePrimitive({id:"axisX",color:F.Color.GREEN,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),e=new F.ArrowPolylinePrimitive({id:"axisY",color:F.Color.BLUE,position:e,width:3,headWidth:5,length:2*i+50,headLength:10}),i=F.Matrix3.fromRotationY(F.Math.toRadians(90)),i=(this._rotationX=F.Matrix4.fromRotationTranslation(i),F.Matrix4.multiply(a.geometryInstances[0].modelMatrix,this._rotationX,a.geometryInstances[0].modelMatrix),F.Matrix4.multiply(a.geometryInstances[1].modelMatrix,this._rotationX,a.geometryInstances[1].modelMatrix),F.Matrix3.fromRotationX(F.Math.toRadians(90)));this._rotationY=F.Matrix4.fromRotationTranslation(i),F.Matrix4.multiply(e.geometryInstances[0].modelMatrix,this._rotationY,e.geometryInstances[0].modelMatrix),F.Matrix4.multiply(e.geometryInstances[1].modelMatrix,this._rotationY,e.geometryInstances[1].modelMatrix),this._layer._primitives.add(n),this._layer._primitives.add(a),this._layer._primitives.add(e),this._radius=t.radius,this._createAxisSphere()})},_createAxisSphere:function(){var e=[];for(let t=0;t<=360;t+=3){const i=Math.sin(F.Math.toRadians(t)),n=Math.cos(F.Math.toRadians(t)),a=this._radius*n,r=this._radius*i;e.push(new F.Cartesian3(a,r,0))}var t=this._createAxisSpheres("axisSphereZ",e,this._matrix,F.Color.RED);this._layer._primitives.add(t);const i=this._createAxisSpheres("axisSphereY",e,this._matrix,F.Color.GREEN),n=(this._layer._primitives.add(i),F.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",e,this._matrix,F.Color.BLUE));this._layer._primitives.add(n),F.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(t,e,i,n){e=new F.PolylineGeometry({positions:e,width:10}),e=new F.GeometryInstance({geometry:e,id:t,attributes:{color:F.ColorGeometryInstanceAttribute.fromColor(n)}});return new F.Primitive({geometryInstances:e,appearance:new F.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(i){if(this._layer){var n=this._layer._primitives._primitives;for(let t=1,e=n.length;t<e;t++){var a=n[t],r=F.Matrix4.fromTranslation(new F.Cartesian3(i.x,i.y,i.z));F.Matrix4.multiply(a.modelMatrix,r,a.modelMatrix)}}var t=F.Matrix4.fromTranslation(new F.Cartesian3(i.x,i.y,i.z));F.Matrix4.multiply(this._model.modelMatrix,t,this._model.modelMatrix)},_updateAxisSphere(i){if(this._layer){var n=this._layer._primitives._primitives;for(let t=1,e=n.length;t<e;t++){var a=n[t],r=F.Matrix4.fromRotationTranslation(i);F.Matrix4.multiply(a.modelMatrix,r,a.modelMatrix)}}var t=F.Matrix4.fromRotationTranslation(i);F.Matrix4.multiply(this._model.modelMatrix,t,this._model.modelMatrix)},_bindHandler(){this._handler.setInputAction(t=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case"axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case"axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case"axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case"axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case"axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case"axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case"axisSphereX":this._updateAxisSphere(F.Matrix3.fromRotationX(F.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(F.Matrix3.fromRotationY(F.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(F.Matrix3.fromRotationZ(F.Math.toRadians(1)))}},F.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(t=>{t=viewer.scene.pick(t.position);t&&t.id&&(this._xyzPid=t.id,this._xyzState=!0)},F.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},F.ScreenSpaceEventType.LEFT_UP)}},F.Scene.XyzAxisPrimitive=t},_installArrowPolylinePrimitive:function(){F.Scene.ArrowPolylinePrimitive=function(t={}){this._color=t.color||F.Color.RED,this._width=t.width||3,this._headWidth=t.headWidth||2*this._width,this._length=t.length||300,this._headLength=t.headLength||10,this._inverse=t.inverse||!1,this.position=t.position;var t=t.id,e=F.CylinderGeometry.createGeometry(new F.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=F.CylinderGeometry.createGeometry(new F.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let n=(this._length+this._headLength)/2;this._inverse&&(n=-n);var a=i,r=[0,0,n],o=new F.Cartesian3;r.length?(o.x=r[0],o.y=r[1],o.z=r[2]):F.Cartesian3.clone(r,o);for(let t=0;t<a.attributes.position.values.length;t+=3)a.attributes.position.values[t]+=o.x,a.attributes.position.values[t+1]+=o.y,a.attributes.position.values[t+2]+=o.z;return new F.Primitive({modelMatrix:F.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new F.GeometryInstance({id:t+"-line",geometry:e}),new F.GeometryInstance({id:t+"-arrow",geometry:i})],appearance:new F.MaterialAppearance({material:F.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){function t(t){var e=(t=F.defaultValue(t,F.defaultValue.EMPTY_OBJECT)).scene;if(!F.defined(e))throw new F.DeveloperError("scene is required.");var i=(this._scene=e)._context;if(!F.defined(i))throw new F.DeveloperError("context is required.");if(!F.defined(t.viewerPosition))throw new F.DeveloperError("this view position is required.");this._viewerPosition=t.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new F.Camera(e),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=F.defaultValue(t.horizontalFov,60),this._verticalFov=F.defaultValue(t.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();e=new F.Cartesian3(0,0,100),t=F.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);F.Matrix4.multiplyByPoint(t,e,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new F.Matrix4,this._shadowMap=new F.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=F.Color.RED,this._visiblyColor=F.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:F.Color.RED,visibly:F.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var t=this._indices,e=0;t[e++]=0,t[e++]=1,t[e++]=0,t[e++]=21,t[e++]=0,t[e++]=85,t[e++]=0,t[e++]=105;for(var i=0,n=0;n<5;++n){i++;for(var a=0;a<20;++a)t[e++]=i++,t[e++]=i}i++;for(var r=0;r<20;++r)for(var o=0;o<5;++o)t[e++]=i,t[e++]=5+i++;this._initialized=!0},this._debugLightFrustum=void 0,this._debugShow=!0}Object.defineProperties(t.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(t){this.shadowMap.debugShow=t,this._debugShow=t}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(t){this._invisiblyColor=t,this.shadowMap._customColor.invisibly=t}},visiblyColor:{get:function(){return this._visiblyColor},set:function(t){this._visiblyColor=t,this.shadowMap._customColor.visibly=t}},viewerPosition:{get:function(){return this._viewerPosition},set:function(t){this._viewerPosition=t,this._cameraUpdated=!1}},direction:{get:function(){return this._direction},set:function(t){this._direction=t,this._cameraUpdated=!1}},pitch:{get:function(){return this._pitch},set:function(t){this._pitch=t,this._cameraUpdated=!1}},horizontalFov:{get:function(){return this._horizontalFov},set:function(t){this._horizontalFov=t,this._cameraUpdated=!1,this._hintLineUpdated=!1}},verticalFov:{get:function(){return this._verticalFov},set:function(t){this._verticalFov=t,this._cameraUpdated=!1,this._hintLineUpdated=!1}},distance:{get:function(){return this._distance},set:function(t){this._distance=t,this._cameraUpdated=!1}}}),t.prototype.setDebugFrustumEffect=function(e,i){var t,n;this.debugShow&&(t=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives,t.forEach(function(t){t.show=e}),n.forEach(function(t){t.show=i}))},t.prototype.update=function(t){var e;this.show&&(this._cameraUpdated||(this._updateCamera(),this.debugShow&&!F.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new F.DebugCameraPrimitive({camera:this._depthCamera,color:F.Color.YELLOW,updateOnChange:!0}),this.setDebugFrustumEffect(!1,!0))),e=t.frustumSplits[1],t.frustumSplits[1]=this._distance,this._debugLightFrustum.update(t),t.frustumSplits[1]=e,t.shadowMaps.push(this.shadowMap))},t.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=F.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:F.Math.toRadians(this._direction),pitch:F.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},t.prototype.setPoseByTargetPoint=function(t){this.distance=F.Cartesian3.distance(this._viewerPosition,t);var e=new F.Cartesian3,i=F.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);F.Matrix4.inverse(i,i),F.Matrix4.multiplyByPoint(i,t,e),F.Cartesian3.normalize(e,e),this.direction=F.Math.toDegrees(Math.atan2(e.x,e.y)),this.pitch=F.Math.toDegrees(Math.asin(e.z))},t.prototype._updateHintLine=function(t){var e,i=this._positions,n=F.Math.toRadians(this._horizontalFov),a=F.Math.toRadians(this._verticalFov),r=Math.tan(.5*n),a=Math.tan(.5*a),o=-(r=this._distance*r),a=-(e=this._distance*a),o=new F.Cartesian3(o,a,-this._distance),a=new F.Cartesian3(r,e,0),r=(F.Matrix4.multiplyByPoint(this._modelMatrix,o,o),F.Matrix4.multiplyByPoint(this._modelMatrix,a,a),F.BoundingSphere.fromCornerPoints(o,a));if(t.cullingVolume.computeVisibility(r)!==Intersect.OUTSIDE){this._valid=!0;var s=0;i[s++]=0,i[s++]=0,i[s++]=0;for(var l,c=Math.PI-.5*n,h=n/4,d=0;d<5;++d)for(var x=c+d*h,u=e/(this._distance/Math.cos(x)),p=-(v=Math.atan(u)),m=v/10,g=0;g<21;++g)l=p+g*m,i[s++]=this._distance*Math.cos(l)*Math.sin(x),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(x);for(var h=n/20,f=0;f<21;++f){x=c+f*h;for(var v,u=e/(this._distance/Math.cos(x)),p=-(v=Math.atan(u)),m=v/2,y=0;y<5;++y)l=p+y*m,i[s++]=this._distance*Math.cos(l)*Math.sin(x),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(x)}var b,C=t.context,o=F.Buffer.createIndexBuffer({context:C,typedArray:new Uint32Array(this._indices),usage:F.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),a=F.Buffer.createVertexBuffer({context:C,typedArray:F.ComponentDatatype.createTypedArray(F.ComponentDatatype.FLOAT,this._positions),usage:F.BufferUsage.STATIC_DRAW}),n=[],t=(n.push({index:0,vertexBuffer:a,componentDatatype:F.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new F.VertexArray({context:C,attributes:n,indexBuffer:o}));F.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=t,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=r):(a=F.ShaderProgram.fromCache({context:C,vertexShaderSource:"in vec3 position;\n uniform mat4 u_modelViewMatrix;\n void main()\n {\n gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);\n }\n ",fragmentShaderSource:"uniform vec4 u_bgColor;\n void main()\n {\n out_FragColor = u_bgColor;\n }\n "}),n=F.RenderState.fromCache({depthTest:{enabled:!0}}),o={u_bgColor:function(){return b._lineColor},u_modelViewMatrix:function(){return C.uniformState.modelView}},(b=this)._drawLineCommand=new F.DrawCommand({boundingVolume:r,modelMatrix:b._modelMatrix,primitiveType:F.PrimitiveType.LINES,vertexArray:t,shaderProgram:a,castShadows:!1,receiveShadows:!1,uniformMap:o,renderState:n,pass:F.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},F.Scene.ShadowPrimitive=t},_installPointsPrimitive:function(){function t(t){t&&t.viewer&&t.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=t.viewer,this.build(t))}t.prototype={build:function(t){if(t.Cartesians&&2<=t.Cartesians.length){var e=[],i=[],n=[];if(t.Colors&&t.Colors.length===4*t.Cartesians.length){for(var a=0;a<t.Cartesians.length;a++)e.push(t.Cartesians[a].x),e.push(t.Cartesians[a].y),e.push(t.Cartesians[a].z);i=t.Colors}else for(var r=0;r<t.Cartesians.length;r++)e.push(t.Cartesians[r].x),e.push(t.Cartesians[r].y),e.push(t.Cartesians[r].z),i.push(0),i.push(0),i.push(1),i.push(1);for(var o=0;o<t.Cartesians.length;o++)n.push(o);this.positionArr=new Float64Array(e),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(n)}else{var s=F.Cartesian3.fromDegrees(0,0,-10),l=F.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([s.x,s.y,s.z,l.x,l.y,l.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new F.Primitive({geometryInstances:new F.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},getVSPolylie:function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return"in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(t,e){return new F.Appearance({renderState:{blending:F.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:t,vertexShaderSource:e})},createGeometry:function(t,e,i){return new F.Geometry({attributes:{position:new F.GeometryAttribute({componentDatatype:F.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),color:new F.GeometryAttribute({componentDatatype:F.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:e})},indices:i,primitiveType:F.PrimitiveType.POINTS,boundingSphere:F.BoundingSphere.fromVertices(t)})},remove:function(){null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null)},updateCartesianPosition:function(t){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(t&&t.length<2))){if(t.length===this.positionArr.length/3){var e=t[0],i=t[1];this.positionArr=new Float64Array([e.x,e.y,e.z,i.x,i.y,i.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var n=[],a=[],r=[],o=0;o<t.length;o++)n.push(t[o].x),n.push(t[o].y),n.push(t[o].z),a.push(0),a.push(0),a.push(1),a.push(1);for(var s=0;s<t.length;s++)r.push(s);this.positionArr=new Float64Array(n),this.colorArr=new Float32Array(a),this.indiceArr=new Uint16Array(r),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=this._viewer.scene.primitives.add(new F.Primitive({geometryInstances:new F.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}},updateCartesianPositionColor:function(t,e){if(e.length===4*t.length&&null!=this.primitive&&(viewer.scene.primitives.remove(this.primitive),!(t&&t.length<2))){if(t.length===this.positionArr.length/3){var i=t[0],n=t[1];this.positionArr=new Float64Array([i.x,i.y,i.z,n.x,n.y,n.z]),this.colorArr=new Float32Array(e),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var a=[],r=[],o=0;o<t.length;o++)a.push(t[o].x),a.push(t[o].y),a.push(t[o].z);for(o=0;o<t.length;o++)r.push(o);this.positionArr=new Float64Array(a),this.colorArr=new Float32Array(e),this.indiceArr=new Uint16Array(r),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=viewer.scene.primitives.add(new F.Primitive({geometryInstances:new F.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},F.Scene.PointsPrimitive=t},_installWaterPrimitive:function(){let e=this;function t(t){this._positions=t.positions,this._url=t.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=t.frequency||1e3,this._animationSpeed=t.animationSpeed||.01,this._amplitude=t.amplitude||10,this._extrudedHeight=t.extrudedHeight||0,this._viewer=e._viewer,this._fs=this.getFS()}t.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new F.Primitive({allowPicking:!1,geometryInstances:new F.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},t.prototype._createAppearence=function(){return new F.EllipsoidSurfaceAppearance({material:new F.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},t.prototype._createGeometry=function(){return new F.PolygonGeometry({polygonHierarchy:new F.PolygonHierarchy(F.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:!0})},t.prototype.getFS=function(){return"\n precision highp float;\n struct Light {\n vec3 position;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n };\n in vec3 position;\n in vec2 textureCoord;\n\n uniform vec3 viewPos;\n uniform Light light;\n\n uniform sampler2D normalSampler;\n uniform samplerCube skybox;\n uniform float detalX;\n\n void main() {\n\n float z = gl_FragCoord.z / gl_FragCoord.w;\n const float LOG2 = 1.442695;\n float density = 0.005;\n float normalFactor = exp( -density * density * z * z * LOG2 );\n normalFactor = clamp(normalFactor, 0.0, 1.0);\n\n vec4 normalTex1 = texture(normalSampler, vec2(textureCoord.s + detalX/1024.0, textureCoord.t - detalX/1024.0));\n vec3 normalTex2 = texture(normalSampler, vec2(textureCoord.t, textureCoord.s)).rgb;\n vec3 normal1 = normalize(vec3(normalTex1.r * 2.0 - 1.0, normalTex1.b,normalTex1.g*2.0-1.0));\n vec3 normal2 = normalize(vec3(normalTex2.r * 2.0 - 1.0, normalTex2.b,normalTex2.g*2.0-1.0));\n\n vec3 normal = mix(normal1,normal2,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,normalFactor);\n\n vec3 viewDir = normalize(viewPos - position);\n\n vec3 I = normalize(position - viewPos);\n vec3 R = reflect(I, normal);\n vec3 reflection = texture(skybox, R).rgb;\n\n float ratio = 1.00 / 1.33;\n vec3 Rr = refract(I, normal , ratio);\n vec3 refraction = texture(skybox, Rr).rgb;\n\n float reflectivity = 0.02;\n float theta = max( dot( viewDir, normal ), 0.0 );\n float reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 2.0 );\n\n vec3 reflectanceColor = mix( refraction, reflection, reflectance );\n\n out_FragColor = vec4(reflectanceColor,1.0);\n\n }\n "},t.prototype.getVS=function(){return" in vec3 normal;in vec2 st;in float batchId; out vec3 v_normalEC;uniform mat4 u_modelViewMatrix;uniform mat4 u_invWorldViewMatrix;uniform int u_clampToGroud;uniform vec3 u_camPos;uniform vec3 u_scale;out vec3 vToEye;out vec2 vUv;out vec4 vCoord;void main(void){v_normalEC = czm_normal * normal;if (u_clampToGroud == 1){} else {vCoord = gl_Position;}vUv = st;}"},t.prototype.getFS2=function(){return"in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n \n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n out_FragColor.a = 0.5;\n #endif\n }\n "},L.prototype.updateDegreesPosition=function(t,e){null==this.primitive||(this._viewer.scene.primitives.remove(this.primitive),t&&t.length<3)||(t=this._createGeometry(t,e||0),this.primitive=this._viewer.scene.primitives.add(new F.Primitive({allowPicking:!1,geometryInstances:new F.GeometryInstance({geometry:t}),appearance:this._appearance,asynchronous:!1})))},F.Scene.WaterPrimitive=t},_installFlowWaterPrimitive:function(){const n=this.getDfSt(["primitive","WaterPrimitive"]),e=F.Property;function i({riverColor:t,flowDuration:e,riverImg:i}){this._definitionChanged=new F.Event,this._color=void 0,this._colorSubscription=void 0,this.color=t,this.duration=e,this._time=(new Date).getTime(),this._url=i||n||"static/data/images/Textures/movingRiver.png"}Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:F.createPropertyDescriptor("color")}),i.prototype.getType=function(t){return"PolylineTrailLink"},i.prototype.getValue=function(t,e){return(e=F.defined(e)?e:{}).color=F.Property.getValueOrClonedDefault(this._color,t,F.Color.WHITE,e.color),e.image=F.Material.PolylineTrailLinkImage,e.time=((new Date).getTime()-this._time)%this.duration/this.duration,e},i.prototype.equals=function(t){return this===t||t instanceof i&&e.equals(this._color,t._color)},F.Scene.PolylineFlowWaterMaterialProperty=i,F.Material.PolylineTrailLinkType="PolylineTrailLink",F.Material.PolylineTrailLinkImage=n||"static/data/images/Textures/movingRiver.png",F.Material.PolylineTrailLinkSource=" uniform vec4 color;\n uniform float time;\n uniform sampler2D image;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image, vec2(fract(st.s*5.0-time*1.0), st.t));\n material.alpha = 0.5;\n material.diffuse = colorImage.rgb;\n return material;\n }",F.Material._materialCache.addMaterial(F.Material.PolylineTrailLinkType,{fabric:{type:F.Material.PolylineTrailLinkType,uniforms:{color:new F.Color(1,0,0,.5),image:F.Material.PolylineTrailLinkImage,time:0,repeat:1},source:F.Material.PolylineTrailLinkSource},translucent:function(t){return!0}})},_installTexturePrimitive:function(){function t(t){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=t.url,this._cartesians=t.cartesians,this._id=t.id||""}t.prototype.build=function(){for(var t=[],e=0;e<this._cartesians.length;e++)t.push(this._cartesians[e].x),t.push(this._cartesians[e].y),t.push(this._cartesians[e].z);this._positionArr=new Float32Array(t),this._sts=new Uint8Array([0,0,1,0,1,1,0,1]),this._indiceArr=new Uint16Array([0,1,2,0,2,3]),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new F.Primitive({geometryInstances:new F.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},t.prototype._createGeometry=function(){var t=new F.GeometryAttribute({componentDatatype:F.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new F.Geometry({attributes:{position:new F.GeometryAttribute({componentDatatype:F.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:t},indices:this._indices,primitiveType:F.PrimitiveType.TRIANGLES,boundingSphere:F.BoundingSphere.fromVertices(positions)})},t.prototype._createAppearence=function(){return new F.Appearance({material:new F.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:F.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},t.prototype.getVS=function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},t.prototype.getFS=function(){return"in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},t.prototype.getMS=function(){return"czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},F.Scene.TexturePrimitive=t},_installProbingPrimitive:function(){var e={color:new F.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:F.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},i=this._viewer;function t(t){this._viewer=i,this._length=t.length||e.length,this._center=t.center||e.center,this._color=t.color||e.color,this._repeat=t.repeat||e.repeat,this._offset=t.offset||e.offset,this._thickness=t.thickness||e.thickness,this._bottom=t.bottom||e.bottom,this._top=t.top||e.top,this._radar=void 0,this.build()}t.prototype.build=function(){var t=new F.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:F.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),t=new F.GeometryInstance({geometry:t,modelMatrix:this.getModelMatrix()}),e=new F.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new F.Primitive({geometryInstances:[t],appearance:e})),this._viewer.scene.preUpdate.addEventListener(function(){var t=i._radar.appearance.material.uniforms.offset;1<(t-=.001)&&(t=0),i._radar.appearance.material.uniforms.offset=t})},t.prototype.getModelMatrix=function(){return F.Matrix4.multiplyByTranslation(F.Transforms.eastNorthUpToFixedFrame(this._center),new F.Cartesian3(0,0,.5*this._length),new F.Matrix4)},t.prototype.updateModelMatrix=function(){},t.prototype.getMaterial=function(){return new F.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:"uniform vec4 color; \n uniform float repeat; \n uniform float offset; \n uniform float thickness;\n\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m); \n\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n return material;\n }"},translucent:!1})},t.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},F.Scene.ProbingPrimitive=t}};let d=null;function U(t,e,i){t&&(d=e,this._drawLayer=new d.CustomDataSource("drawLayer"),this.$graphics=new y(t,e),t)&&t.dataSources.add(this._drawLayer)}U.prototype={drawPointGraphics:function(e){var i,n,t,a,r,o;(e=e||{}).style=e.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:!0,scale:1,pixelOffset:new d.Cartesian2(0,-20)},this._viewer&&e&&(t=new d.Entity,a=[],r=this,(o=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(t){t=r._viewer.scene.camera.pickEllipsoid(t.position,r._viewer.scene.globe.ellipsoid);t&&t.x&&(i=t,a.push(t))},d.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(t){o.destroy(),o=null,"function"==typeof e.callback&&e.callback(r.transformCartesianArrayToWGS84Array(a),n)},d.ScreenSpaceEventType.RIGHT_CLICK),t.billboard=e.style,t.position=new d.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(t))},drawLineGraphics:function(e){if(e=e||{},this._viewer&&e){var i,n=[],t=new d.Entity,a=this,r=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);r.setInputAction(function(t){t=a.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length&&n.push(t.clone()),e.measure&&o(t),2==n.length&&"straightLine"===e.type&&(r.destroy(),r=null,"function"==typeof e.callback)&&e.callback(a.transformCartesianArrayToWGS84Array(n),i),n.push(t))},d.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(t){t=a.getCatesian3FromPX(t.endPosition);2<=n.length&&t&&t.x&&(n.pop(),n.push(t))},d.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(t){r.destroy(),r=null;t=a.getCatesian3FromPX(t.position);e.measure&&o(t),"function"==typeof e.callback&&e.callback(a.transformCartesianArrayToWGS84Array(n),i)},d.ScreenSpaceEventType.RIGHT_CLICK),t.polyline={width:e.width||5,material:e.material||d.Color.BLUE.withAlpha(.8),clampToGround:e.clampToGround||!1,clampToS3M:e.clampToS3M||!1},t.polyline.positions=new d.CallbackProperty(function(){return n},!1),i=this._drawLayer.entities.add(t);const o=function(t){var e=new d.Entity;e.position=t,e.point={pixelSize:10,outlineColor:d.Color.BLUE,outlineWidth:5},e.label={text:(a.getPositionDistance(a.transformCartesianArrayToWGS84Array(n))/1e3).toFixed(4)+"公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(-20,-80)},a._drawLayer.entities.add(e)}}},drawPolygonGraphics:function(i){if((i=i||{}).style=i.style||{width:3,material:d.Color.BLUE.withAlpha(.8),clampToGround:!0},this._viewer&&i){var n=[],e=new d.PolygonHierarchy,a=new d.Entity,r=this,o=null,s=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);s.setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length&&(e.positions.push(t.clone()),n.push(t.clone())),n.push(t.clone()),e.positions.push(t.clone()),o||(a.polyline=i.style,a.polyline.positions=new d.CallbackProperty(function(){return n},!1),a.polygon={hierarchy:new d.CallbackProperty(function(){return e},!1),material:d.Color.WHITE.withAlpha(.1),clampToGround:i.clampToGround||!1},a.clampToS3M=!0,o=r._drawLayer.entities.add(a)))},d.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(t){t=r.getCatesian3FromPX(t.endPosition);2<=n.length&&t&&t.x&&(n.pop(),n.push(t),e.positions.pop(),e.positions.push(t))},d.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(function(){var t,e;s.destroy(),n.push(n[0]),i.height&&(a.polygon.extrudedHeight=i.height,a.polygon.material=d.Color.BLUE.withAlpha(.5)),i.measure&&(t=n[0],(e=new d.Entity).position=t,e.point={pixelSize:10,outlineColor:d.Color.BLUE,outlineWidth:5},e.label={text:(r.getPositionsArea(r.transformCartesianArrayToWGS84Array(n))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(-20,-50)},r._drawLayer.entities.add(e)),"function"==typeof i.callback&&i.callback(r.transformCartesianArrayToWGS84Array(n),o)},d.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(e){var i,n,t,a,r,o;(e=e||{}).style=e.style||{width:3,material:d.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&e&&(n=[],t=new d.Entity,a=new d.Rectangle,r=this,(o=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(0==n.length?n.push(t.clone()):(o.destroy(),n.push(t.clone()),a=d.Rectangle.fromCartesianArray([...n,t],d.Ellipsoid.WGS84),"function"==typeof e.callback&&e.callback(r.transformCartesianArrayToWGS84Array(n),i)))},d.ScreenSpaceEventType.LEFT_CLICK),o.setInputAction(function(t){t=r.getCatesian3FromPX(t.endPosition);t&&(a=d.Rectangle.fromCartesianArray([...n,t],d.Ellipsoid.WGS84))},d.ScreenSpaceEventType.MOUSE_MOVE),t.rectangle=e.style,e.height&&(t.rectangle.extrudedHeight=e.height),t.rectangle.coordinates=new d.CallbackProperty(function(){return a},!1),i=this._drawLayer.entities.add(t))},drawCircleGraphics:function(e){if((e=e||{}).style=e.style||{width:3,material:d.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&e){var i,n=void 0,a=new d.Entity,r=this,o=1,s=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);const l=function(t,e){var t=d.Cartographic.fromCartesian(t),e=d.Cartographic.fromCartesian(e),i=new d.EllipsoidGeodesic,i=(i.setEndPoints(t,e),i.surfaceDistance);o=Math.sqrt(Math.pow(i,2)+Math.pow(e.height-t.height,2))};s.setInputAction(function(t){t=r.getCatesian3FromPX(t.position);t&&t.x&&(n?(l(n,t),s.destroy(),"function"==typeof e.callback&&e.callback({center:n,radius:o},i)):(n=t,a.ellipse=e.style,a.ellipse.semiMajorAxis=new d.CallbackProperty(function(){return o},!1),a.ellipse.semiMinorAxis=new d.CallbackProperty(function(){return o},!1),a.position=new d.CallbackProperty(function(){return n},!1),a.point={pixelSize:5,outlineColor:d.Color.RED,outlineWidth:3},e.height&&(a.ellipse.extrudedHeight=e.height),i=r._drawLayer.entities.add(a)))},d.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(t){t=r._viewer.scene.camera.pickEllipsoid(t.endPosition,r._viewer.scene.globe.ellipsoid);n&&t&&t.x&&l(n,t)},d.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(e){if((e=e||{}).style=e.style||{width:3,material:d.Color.BLUE.withAlpha(.5)},this._viewer&&e){var i=new d.Entity,n=new d.Entity,a=new d.Entity,r=[],o=[],s=[],l=this,c=new d.ScreenSpaceEventHandler(this._viewer.scene.canvas);c.setInputAction(function(t){t=l.getCatesian3FromPX(t.position);if(!t)return!1;0==r.length?(r.push(t.clone()),r.push(t.clone()),o.push(t.clone()),o.push(t.clone())):(c.destroy(),"function"==typeof e.callback&&e.callback({e:i,e2:n,e3:a}))},d.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(t){var e,i,t=l.getCatesian3FromPX(t.endPosition);t&&0<r.length&&(r.pop(),r.push(t.clone()),e=r,i=d.Cartographic.fromCartesian(e[0]),e=d.Cartographic.fromCartesian(e[1]),i=d.Cartesian3.fromDegrees(d.Math.toDegrees(i.longitude),d.Math.toDegrees(i.latitude),e.height),o.pop(),o.push(i.clone()),s.pop(),s.pop(),s.push(t.clone()),s.push(i.clone()))},d.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new d.CallbackProperty(function(){return r},!1),...e.style},i.position=new d.CallbackProperty(function(){return r[0]},!1),i.point={pixelSize:5,outlineColor:d.Color.BLUE,outlineWidth:5},i.label={text:new d.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(r))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(50,-100)},n.polyline={positions:new d.CallbackProperty(function(){return o},!1),...e.style},n.position=new d.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:d.Color.BLUE,outlineWidth:5},n.label={text:new d.CallbackProperty(function(){return"高度:"+(e=o[1],!(t=o[0])&&!e||d.Cartesian3.equals(t,e)?0:(t=d.Cartographic.fromCartesian(t),(d.Cartographic.fromCartesian(e).height-t.height).toFixed(2)))+"米";var t,e},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(-20,100)},a.polyline={positions:new d.CallbackProperty(function(){return s},!1),...e.style},a.position=new d.CallbackProperty(function(){return r[1]},!1),a.point={pixelSize:5,outlineColor:d.Color.BLUE,outlineWidth:5},a.label={text:new d.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:d.HorizontalOrigin.LEFT,verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:new d.Cartesian2(-150,-20)},this._drawLayer.entities.add(a),this._drawLayer.entities.add(n),this._drawLayer.entities.add(i)}},drawWallGraphics:function(n){var a;(n=n||{}).style=n.style||{material:d.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:d.Color.WHITE},this._viewer&&n&&(a=this).drawPolygonGraphics({callback:function(t,e){var i=a._drawLayer.entities.add({wall:{positions:a.transformWGS84ArrayToCartesianArray(t),...n.style}});"function"==typeof n.callback&&n.callback(t,i)}})},drawEllipsoidGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawCircleGraphics({callback:function(t,e){var i=a.createGraphics(),e=(i.ellipsoid=a.$graphics.getEllipsoidGraphics({radii:t.radius}),i.position=t.center,a._drawLayer.entities.remove(e),a._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback({center:t.center,radius:t.radius},e)}})},drawCylinderGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawCircleGraphics({callback:function(t,e){var i=a._drawLayer.entities.add({position:t.center,cylinder:{length:2*t.radius||n.length,topRadius:n.topRadius||t.radius,bottomRadius:n.bottomRadius||t.radius,material:d.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:d.Color.WHITE}});a._drawLayer.entities.remove(e),"function"==typeof n.callback&&n.callback({center:t.center,radius:t.radius},i)}})},drawCorridorGraphics:function(n){var a;(n=n||{}).style=n.style||{},this._viewer&&n&&(a=this).drawLineGraphics({callback:function(t,e){var i=a.createGraphics(),e=(i.corridor={positions:a.transformWGS84ArrayToCartesianArray(t),height:n.height||1,width:n.width||100,cornerType:d.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:d.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:d.Color.WHITE},a._drawLayer.entities.remove(e),a._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback(t,e)}})},drawPolylineVolumeGraphics:function(a){(a=a||{}).style=a.style||{};const r=a.circleRadius||20,o=a.arms||7,s=a.rOuter||150,l=a.rInner||75;var c;this._viewer&&a&&(c=this).drawLineGraphics({callback:function(t,e){var i=c.createGraphics(),n="fivePoint"===a.shape?c.computeStar2d(o,s,l):c.computeCircleShap(r),n=(i.polylineVolume={positions:c.transformWGS84ArrayToCartesianArray(t),shape:n,cornerType:d.CornerType.MITERED,material:a.color||d.Color.RED},c._drawLayer.entities.remove(e),c._drawLayer.entities.add(i));"function"==typeof a.callback&&a.callback(t,n)}})},removeAll(){this._drawLayer.entities.removeAll()}};let H={};function Q(t,e){t&&(this._viewer=t,H=e)}Q.prototype={mathDistance2d:function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))},getCirclePoints2d:function(t,e,i,n){for(var a=[],r=Math.PI/180*Math.round(360/n),o=0;o<n;o++){var s=e+t*Math.sin(r*o),l=i+t*Math.cos(r*o);a.unshift({x:s,y:l})}return a},wholeDistance2d:function(i){let n=0;return i&&Array.isArray(i)&&0<i.length&&i.forEach((t,e)=>{e<i.length-1&&(n+=this.mathDistance2d(t,i[e+1]))}),n},getBaseLength2d:function(t){return Math.pow(this.wholeDistance2d(t),.99)},computeStar2d(t,e,i){for(var n=Math.PI/t,a=2*t,r=new Array(a),o=0;o<a;o++){var s=o%2==0?e:i;r[o]=new H.Cartesian2(Math.cos(o*n)*s,Math.sin(o*n)*s)}return r},computeCircleShap(e){var i=[];for(let t=0;t<360;t++){var n=H.Math.toRadians(t);i.push(new H.Cartesian2(e*Math.cos(n),e*Math.sin(n)))}return i},mid2d:function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},getCircleCenterOfThreePoints2d:function(t,e,i){var n=[(t[0]+e[0])/2,(t[1]+e[1])/2],e=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],a=[(t[0]+i[0])/2,(t[1]+i[1])/2],t=[a[0]-t[1]+i[1],a[1]+t[0]-i[0]];return this.getIntersectPoint2d(n,e,a,t)},getIntersectPoint2d:function(t,e,i,n){return t[1]===e[1]?[(n[0]-i[0])/(n[1]-i[1])*(t[1]-i[1])+i[0],t[1]]:i[1]===n[1]?[(e[0]-t[0])/(e[1]-t[1])*(i[1]-t[1])+t[0],i[1]]:(e=(e[0]-t[0])/(e[1]-t[1]),n=(n[0]-i[0])/(n[1]-i[1]),[e*(i=(e*t[1]-t[0]-n*i[1]+i[0])/(e-n))-e*t[1]+t[0],i])},getAzimuth2d:function(t,e){let i,n=Math.asin(Math.abs(e[1]-t[1])/this.mathDistance2d(t,e));return e[1]>=t[1]&&e[0]>=t[0]?i=n+Math.PI:e[1]>=t[1]&&e[0]<t[0]?i=2*Math.PI-n:e[1]<t[1]&&e[0]<t[0]?i=n:e[1]<t[1]&&e[0]>=t[0]&&(i=Math.PI-n),i},getAngleOfThreePoints2d:function(t,e,i){t=this.getAzimuth2d(e,t)-this.getAzimuth2d(e,i);return t<0?t+2*Math.PI:t},isClockWise2d:function(t,e,i){return(i[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(i[0]-t[0])},getPointOnLine2d:function(t,e,i){return[e[0]+t*(i[0]-e[0]),e[1]+t*(i[1]-e[1])]},getCubicValue2d:function(t,e,i,n,a){var[r,o]=[1-(t=Math.max(Math.min(t,1),0)),t*t],s=o*t,l=r*r,c=l*r;return[c*e[0]+3*l*t*i[0]+3*r*o*n[0]+s*a[0],c*e[1]+3*l*t*i[1]+3*r*o*n[1]+s*a[1]]},getThirdPoint2d:function(t,e,i,n,a){t=this.getAzimuth2d(t,e),a=a?t+i:t-i,t=n*Math.cos(a),i=n*Math.sin(a);return[e[0]+t,e[1]+i]},inherits2d:function(t,a){function e(){}e.prototype=a.prototype,t.superClass_=a.prototype,t.prototype=new e,(t.prototype.constructor=t).base=function(t,e,i){var n=Array.prototype.slice.call(arguments,2);return a.prototype[e].apply(t,n)}},getArcPoints2d:function(e,i,n,t){var[a,r,o,s]=[null,null,[],t-n],s=s<0?s+2*Math.PI:s;for(let t=0;t<=100;t++){var l=n+s*t/100,a=e[0]+i*Math.cos(l),r=e[1]+i*Math.sin(l);o.push([a,r])}return o},getBisectorNormals2d:function(t,e,i,n){let a=this.getNormal2d(e,i,n),[r,o,s,l,c]=[null,null,null,null,null],h=Math.sqrt(a[0]*a[0]+a[1]*a[1]),d=a[0]/h,x=a[1]/h,u=this.mathDistance2d(e,i),p=this.mathDistance2d(i,n);return o=(c=1e-4<h?this.isClockWise(e,i,n)?(s=t*u,l=i[0]-s*x,c=i[1]+s*d,r=[l,c],s=t*p,l=i[0]+s*x,i[1]-s*d):(s=t*u,l=i[0]+s*x,c=i[1]-s*d,r=[l,c],s=t*p,l=i[0]-s*x,i[1]+s*d):(l=i[0]+t*(e[0]-i[0]),c=i[1]+t*(e[1]-i[1]),r=[l,c],l=i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])),[l,c]),[r,o]},getNormal2d:function(t,e,i){var n=t[0]-e[0],t=t[1]-e[1],a=Math.sqrt(n*n+t*t),a=(n/=a,t/=a,i[0]-e[0]),i=i[1]-e[1],e=Math.sqrt(a*a+i*i);return[n+(a/=e),t+(i/=e)]},getLeftMostControlPoint2d:function(t,e){let[i,n,a,r,o]=[t[0],t[1],t[2],null,null],s=this.getBisectorNormals2d(0,i,n,a)[0],l=this.getNormal2d(i,n,a);var c,h,d,x,u;return o=1e-4<Math.sqrt(l[0]*l[0]+l[1]*l[1])?(t=this.mid2d(i,n),d=i[0]-t[0],c=i[1]-t[1],d=2*(c=-(h=2/this.mathDistance2d(i,n))*c)*(h=h*d),x=s[0]-t[0],u=s[1]-t[1],r=t[0]+(c*c-h*h)*x+d*u,t[1]+d*x+(h*h-c*c)*u):(r=i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])),[r,o]},getRightMostControlPoint2d:function(t,e){let i=t.length,n=t[i-3],a=t[i-2],r=t[i-1],o=this.getBisectorNormals2d(0,n,a,r)[1],s=this.getNormal2d(n,a,r),l=Math.sqrt(s[0]*s[0]+s[1]*s[1]),[c,h]=[null,null];var d,x,u,p,m;return h=1e-4<l?(t=this.mid2d(a,r),u=r[0]-t[0],d=r[1]-t[1],u=2*(d=-(x=2/this.mathDistance2d(a,r))*d)*(x=x*u),p=o[0]-t[0],m=o[1]-t[1],c=t[0]+(d*d-x*x)*p+u*m,t[1]+u*p+(x*x-d*d)*m):(c=r[0]+e*(a[0]-r[0]),r[1]+e*(a[1]-r[1])),[c,h]},getCurvePoints2d:function(e,i){let t=this.getLeftMostControlPoint2d(i,e),[n,a,r,o,s]=[null,null,null,[t],[]];for(let t=0;t<i.length-2;t++){[n,a,r]=[i[t],i[t+1],i[t+2]];var l=this.getBisectorNormals2d(e,n,a,r);o=o.concat(l)}var c=this.getRightMostControlPoint2d(i,e);c&&o.push(c);for(let e=0;e<i.length-1;e++){n=i[e],a=i[e+1],s.push(n);for(let t=0;t<100;t++){var h=this.getCubicValue2d(t/100,n,o[2*e],o[2*e+1],a);s.push(h)}s.push(a)}return s},getBezierPoints2d:function(a){if(a.length<=2)return a;var t=[],r=a.length-1;for(let n=0;n<=1;n+=.01){let[e,i]=[0,0];for(let t=0;t<=r;t++){var o=this.getBinomialFactor2d(r,t),s=Math.pow(n,t),l=Math.pow(1-n,r-t);e+=o*s*l*a[t][0],i+=o*s*l*a[t][1]}t.push([e,i])}return t.push(a[r]),t},getFactorial2d:function(e){let i=1;switch(e){case e<=1:i=1;break;case 2===e:i=2;break;case 3===e:i=6;break;case 24===e:i=24;break;case 5===e:i=120;break;default:for(let t=1;t<=e;t++)i*=t}return i},getBinomialFactor2d:function(t,e){return this.getFactorial2d(t)/(this.getFactorial2d(e)*this.getFactorial2d(t-e))},getQBSplinePoints2d:function(r){if(r.length<=2)return r;var[o,t]=[2,[]],e=r.length-o-1;t.push(r[0]);for(let a=0;a<=e;a++)for(let n=0;n<=1;n+=.05){let[e,i]=[0,0];for(let t=0;t<=o;t++){var s=this.getQuadricBSplineFactor2d(t,n);e+=s*r[a+t][0],i+=s*r[a+t][1]}t.push([e,i])}return t.push(r[r.length-1]),t},getQuadricBSplineFactor2d:function(t,e){let i=0;return 0===t?i=Math.pow(e-1,2)/2:1===t?i=(-2*Math.pow(e,2)+2*e+1)/2:2===t&&(i=Math.pow(e,2)/2),i}};let C=null;function J(t,e){t&&(this._viewer=t,C=e)}J.prototype={setCircleScanEffect:function(t){var e,i,n,a,r,o,s,l,c,h,d;if(t&&t.position)return e=t.id||"CircleScan"+parseInt(1e3*Math.random()),l=t.position,i=t.radius,n=t.color||C.Color.RED,a=t.duration||1500,r=this,o=t.circleMode||"CircleScan",t=t.border||4,d=l,s=new C.Cartesian4(d.x,d.y,d.z,1),d=this.transformCartesianToWGS84(l),l=this.transformWGS84ToCartesian({lng:d.lng,lat:d.lat,alt:d.alt+500}),c=new C.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),d=new C.PostProcessStage({name:e,fragmentShader:this._getCircleScanShader({get:!0,border:t}),uniforms:{u_scanCenterEC:function(){return C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new C.Cartesian4)},u_scanPlaneNormalEC:function(){var t=C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new C.Cartesian4),e=C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,c,new C.Cartesian4),i=new C.Cartesian3;return i.x=e.x-t.x,i.y=e.y-t.y,i.z=e.z-t.z,C.Cartesian3.normalize(i,i),i},u_radius:function(){return"CircleScan"==o?i*(((new Date).getTime()-h)%a)/a:i},u_scanColor:n}}),this._viewer.scene.postProcessStages.add(d),d},setRadarScanEffect:function(t){var e,i,n,a,r,o,s,l,c,h,d,x,u,p,m,g,f,v,y;if(t&&t.position)return e=t.id||"radarScan"+parseInt(1e3*Math.random()),c=t.position,i=t.radius,n=t.color||C.Color.RED,a=t.duration||1500,r=this,o=t.border||1,t=t.width||3,y=c,s=new C.Cartesian4(y.x,y.y,y.z,1),y=this.transformCartesianToWGS84(c),c=this.transformWGS84ToCartesian({lng:y.lng,lat:y.lat,alt:y.alt+500}),l=new C.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:y.lng+.001,lat:y.lat,alt:y.alt}),h=new C.Cartesian4(c.x,c.y,c.z,1),d=(new Date).getTime(),x=new C.Quaternion,u=new C.Matrix3,p=new C.Cartesian4,m=new C.Cartesian4,g=new C.Cartesian4,f=new C.Cartesian3,v=new C.Cartesian3,y=new C.PostProcessStage({name:e,fragmentShader:this._getRadarScanShader({border:o,width:t,get:!0}),uniforms:{u_scanCenterEC:function(){return C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,p)},u_scanPlaneNormalEC:function(){var t=C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,p),e=C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,m);return f.x=e.x-t.x,f.y=e.y-t.y,f.z=e.z-t.z,C.Cartesian3.normalize(f,f),f},u_scanLineNormalEC:function(){var t=C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,p),e=C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,m),i=C.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,h,g),e=(f.x=e.x-t.x,f.y=e.y-t.y,f.z=e.z-t.z,C.Cartesian3.normalize(f,f),v.x=i.x-t.x,v.y=i.y-t.y,v.z=i.z-t.z,((new Date).getTime()-d)%a/a);return C.Quaternion.fromAxisAngle(f,e*C.Math.PI*2,x),C.Matrix3.fromQuaternion(x,u),C.Matrix3.multiplyByVector(u,v,v),C.Cartesian3.normalize(v,v),v},u_radius:i,u_scanColor:n}}),this._viewer.scene.postProcessStages.add(y),y},lighitCentrumScanEffect:function(e){var i=this.createLightScan_getCirclePoints(e.circle[0],e.circle[1],e.circle[2],e.circle[3]),n=this.createLightScan_entityCList(this._viewer,i,e);for(let t=0;t<n.length;t++)t!==n.length-1?this.createLightScan_changeOnePosition(e,n[t],[i[t].x,i[t].y,i[t+1].x,i[t+1].y]):this.createLightScan_changeOnePosition(e,n[t],[i[t].x,i[t].y,i[0].x,i[0].y]);return n},createLightScan_getCirclePoints:function(t,e,i,n){let a=[],r=Math.PI/180*Math.round(360/n),o=0;for(;o<n;o++){var s=e+t*Math.sin(r*o),l=i+t*Math.cos(r*o);a.unshift({x:s,y:l})}return a},createLightScan_changeOnePosition:function(e,t,i){const n=e.positionList;let a,r,o,s,l,c,h=0,d=0;function x(t){a=n[t+1][0]-n[t][0],r=n[t+1][1]-n[t][1],o=a/e.number,s=r/e.number,d=0}x(h),t.polygon.hierarchy=new C.CallbackProperty(function(){return Math.abs(l)>=Math.abs(a)&&Math.abs(c)>=Math.abs(r)&&((h+=1)===n.length-1&&(h=0),i[0]=i[0]+l,i[1]=i[1]+c,i[2]=i[2]+l,i[3]=i[3]+c,x(h)),l=d*o,c=d*s,d++,new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights([e.observer[0],e.observer[1],e.observer[2],i[0]+l,i[1]+c,0,i[2]+l,i[3]+c,0]))},!1)},createLightScan_entityCList:function(e,i,n){var a=n.observer[0],r=n.observer[1],o=n.observer[2],s=[];for(let t=0;t<i.length;t++){var l=t===i.length-1?new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights([a,r,o,i[t].x,i[t].y,0,i[0].x,i[0].y,0])):new C.PolygonHierarchy(C.Cartesian3.fromDegreesArrayHeights([a,r,o,i[t].x,i[t].y,0,i[t+1].x,i[t+1].y,0])),l=e.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:n.material}});s.push(l)}return s}};for(var O=["RGVwdGhGdW5jdGlvbg==","TEVTUw==","Q3VsbEZhY2U=","QkFDSw==","dW5pZm9ybU1hcA==","cHJvamVjdGlvbk1hdHJpeA==","dW5pZm9ybVN0YXRl","cHJvamVjdGlvbg==","bW9kZWxWaWV3TWF0cml4","bW9kZWxWaWV3","c2hpbmluZXNz","ZW1pc3Npb24=","c3BlY3VsYXI=","aXNMaW5l","cGlja2Vk","cGlja2VkQ29sb3I=","bm9ybWFsTWF0cml4","Z2xvd1Bvd2Vy","ZXh0ZW5kMkNhcnRlc2lhbkFycmF5","UmFkYXJQcmltaXRpdmU=","X2FuZ2xl","YW5nbGU=","X3JhZGl1cw==","X3RvcFNob3c=","dG9w","X3RvcE91dGxpbmU=","dG9wT3V0bGluZQ==","dXBkYXRlR3JvdW5kQ2lyY2xlUmFkaXVz","X2dyb3VuZF9yYWRpdXM=","X3RyYWNrZWRFbnRpdHlQb3NpdGlvbg==","ZGlzdGFuY2U=","UG9seWxpbmVEYXNoTWF0ZXJpYWxQcm9wZXJ0eQ==","Q1lBTg==","bWF0cml4","Z2V0SGVhZGluZ1BpdGNoUm9sbEZvckxpbmU=","Z2V0VG9wR2VvbWV0cnk=","Z2V0VG9wT3V0bGluZUdlb21ldHJ5","X3RvcEdlb21ldHJ5","X3RvcE91dGxpbmVHZW9tZXRyeQ==","ZWxsaXBzZQ==","CnZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uOwp2YXJ5aW5nIHZlYzMgdl9ub3JtYWw7CnVuaWZvcm0gZmxvYXQgcGlja2VkOwp1bmlmb3JtIHZlYzQgIHBpY2tlZENvbG9yOwp1bmlmb3JtIHZlYzQgIGRlZmF1bHRDb2xvcjsKdW5pZm9ybSBmbG9hdCBzcGVjdWxhcjsKdW5pZm9ybSBmbG9hdCBzaGluaW5lc3M7CnVuaWZvcm0gdmVjMyAgZW1pc3Npb247CnZhcnlpbmcgdmVjMiB2X3N0Owp1bmlmb3JtIGJvb2wgaXNMaW5lOwp1bmlmb3JtIGZsb2F0IGdsb3dQb3dlcjsKdm9pZCBtYWluKCkgewogICAgdmVjMyBwb3NpdGlvblRvRXllRUM9IC12X3Bvc2l0aW9uOyAKICAgIHZlYzMgbm9ybWFsRUMgPW5vcm1hbGl6ZSh2X25vcm1hbCk7CiAgICB2ZWM0IGNvbG9yPWRlZmF1bHRDb2xvcjsKICAgIGlmKHBpY2tlZCE9MC4wKXsKICAgICAgICBjb2xvciA9IHBpY2tlZENvbG9yOwogICAgfQogICAgLy9pZih2X3N0Lng8MC41KXsKICAgIC8vICAgIGNvbG9yLmEgPTAuNzUtdl9zdC54OyAKICAgIC8vfQogICAgLy9lbHNlICB7CiAgICAvLyAgICBjb2xvci5hID12X3N0LngtMC4yNTsgCiAgICAvL30KICAgIGN6bV9tYXRlcmlhbCBtYXRlcmlhbDsKICAgIG1hdGVyaWFsLnNwZWN1bGFyID0gc3BlY3VsYXI7CiAgICBtYXRlcmlhbC5zaGluaW5lc3MgPSBzaGluaW5lc3M7CiAgICBtYXRlcmlhbC5ub3JtYWwgPSAgbm9ybWFsRUM7CiAgICBtYXRlcmlhbC5lbWlzc2lvbiA9ZW1pc3Npb247Ly92ZWMzKDAuMiwwLjIsMC4yKTsKICAgIG1hdGVyaWFsLmRpZmZ1c2UgPSBjb2xvci5yZ2IgOwogICAgaWYoaXNMaW5lKXsKICAgICAgICBtYXRlcmlhbC5hbHBoYSA9IDEuMDsgCiAgICB9CiAgICBlbHNlewogICAgICAgIG1hdGVyaWFsLmFscGhhID0gIGNvbG9yLmE7IAogICAgfQogICAgICAgIC8vZmxvYXQgZ2xvdyA9IGdsb3dQb3dlciAvIGFicyh2X3N0LnQgICkgLSAoZ2xvd1Bvd2VyIC8gMC41KTsgCiAgICAgICAgLy8gCiAgICAgICAgLy9tYXRlcmlhbC5lbWlzc2lvbiA9IG1heCh2ZWMzKGdsb3cgLSAxLjAgKyBjb2xvci5yZ2IpLCBjb2xvci5yZ2IpOyAKICAgICAgICAvL2lmKGlzTGluZSkKICAgICAgICAvLyAgICBtYXRlcmlhbC5hbHBoYSA9IGNsYW1wKDAuMCwgMS4wLCBnbG93KSAqIGNvbG9yLmE7IAogICAgICAgICAKICAgIGlmKHZfc3QueD09MC4wKXsgCiAgICAgICAgICBnbF9GcmFnQ29sb3IgPWNvbG9yIDsKICAgIH1lbHNlIHsgCiAgICAgICAgZ2xfRnJhZ0NvbG9yID0gY3ptX3Bob25nKG5vcm1hbGl6ZShwb3NpdGlvblRvRXllRUMpLCBtYXRlcmlhbCxjem1fbGlnaHREaXJlY3Rpb25FQykgOyAKICAgIH0gCn0=","CiNpZmRlZiBHTF9FUwogICBwcmVjaXNpb24gaGlnaHAgZmxvYXQ7CiNlbmRpZgoKYXR0cmlidXRlIHZlYzMgcG9zaXRpb247CmF0dHJpYnV0ZSB2ZWMyIHN0OwphdHRyaWJ1dGUgdmVjMyBub3JtYWw7CnVuaWZvcm0gbWF0NCBtb2RlbFZpZXdNYXRyaXg7CnVuaWZvcm0gbWF0MyBub3JtYWxNYXRyaXg7CnVuaWZvcm0gbWF0NCBwcm9qZWN0aW9uTWF0cml4Owp2YXJ5aW5nIHZlYzMgdl9wb3NpdGlvbjsKdmFyeWluZyB2ZWMzIHZfbm9ybWFsOwp2YXJ5aW5nIHZlYzIgdl9zdDsKCnZhcnlpbmcgdmVjMyB2X2xpZ2h0MERpcmVjdGlvbjsKCnZvaWQgbWFpbih2b2lkKSAKewogICAgdmVjNCBwb3MgPSAgbW9kZWxWaWV3TWF0cml4ICogdmVjNCggcG9zaXRpb24sMS4wKTsKICAgIHZfbm9ybWFsID0gIG5vcm1hbE1hdHJpeCAqICBub3JtYWw7CiAgICB2X3N0ID0gc3Q7CiAgICB2X3Bvc2l0aW9uID0gcG9zLnh5ejsKICAgIHZfbGlnaHQwRGlyZWN0aW9uID0gbWF0MyggbW9kZWxWaWV3TWF0cml4KSAqIHZlYzMoMS4wLDEuMCwxLjApOwogICAgZ2xfUG9zaXRpb24gPSAgcHJvamVjdGlvbk1hdHJpeCAqIHBvczsKfQ==","VFJBTlNMVUNFTlQ=","TElORV9TVFJJUA==","UmVjdGFuZ3VsYXJTZW5zb3JQcmltaXRpdmU=","b2JqZWN0","ZXhwb3J0cw==","YW1k","Q2VzaXVtR2VvbWV0cnk=","Y2FsbA==","ZGVmYXVsdA==","Y29tYmluZQ==","ZGVzdHJveU9iamVjdA==","RGV2ZWxvcGVyRXJyb3I=","QnVmZmVy","U2hhZGVyU291cmNl","TWF0ZXJpYWw=","VmVydGV4Rm9ybWF0","SnVsaWFuRGF0ZQ==","Qm94R2VvbWV0cnk=","RWxsaXBzb2lkR2VvbWV0cnk=","YXRhbg==","YXNpbg==","RU1QVFlfT0JKRUNU","c2xpY2U=","bW9kZWxNYXRyaXg=","X2NvbXB1dGVkTW9kZWxNYXRyaXg=","X2NvbXB1dGVkU2NhblBsYW5lTW9kZWxNYXRyaXg=","UE9TSVRJVkVfSU5GSU5JVFk=","eEhhbGZBbmdsZQ==","X3hIYWxmQW5nbGU=","eUhhbGZBbmdsZQ==","X3lIYWxmQW5nbGU=","V0hJVEU=","c2hvd1NlY3RvckxpbmVz","c2hvd1NlY3RvclNlZ21lbnRMaW5lcw==","c2hvd0xhdGVyYWxTdXJmYWNlcw==","bWF0ZXJpYWw=","ZnJvbVR5cGU=","Q29sb3JUeXBl","X21hdGVyaWFs","X3RyYW5zbHVjZW50","bGF0ZXJhbFN1cmZhY2VNYXRlcmlhbA==","X2xhdGVyYWxTdXJmYWNlTWF0ZXJpYWw=","X2xhdGVyYWxTdXJmYWNlVHJhbnNsdWNlbnQ=","c2hvd0RvbWVTdXJmYWNlcw==","ZG9tZVN1cmZhY2VNYXRlcmlhbA==","X2RvbWVTdXJmYWNlTWF0ZXJpYWw=","c2hvd0RvbWVMaW5lcw==","c2hvd0ludGVyc2VjdGlvbg==","aW50ZXJzZWN0aW9uQ29sb3I=","aW50ZXJzZWN0aW9uV2lkdGg=","c2hvd1Rocm91Z2hFbGxpcHNvaWQ=","X3Nob3dUaHJvdWdoRWxsaXBzb2lk","c2hvd1NjYW5QbGFuZQ==","c2NhblBsYW5lQ29sb3I=","c2NhblBsYW5lTW9kZQ==","aG9yaXpvbnRhbA==","c2NhblBsYW5lUmF0ZQ==","X3NjYW5lUGxhbmVYSGFsZkFuZ2xl","X3NjYW5lUGxhbmVZSGFsZkFuZ2xl","X3RpbWU=","bm93","X2JvdW5kaW5nU3BoZXJl","X2JvdW5kaW5nU3BoZXJlV0M=","X3NlY3RvckZyb250Q29tbWFuZA==","X3NlY3RvckJhY2tDb21tYW5k","X3NlY3RvclZB","X3NlY3RvckxpbmVDb21tYW5k","X3NlY3RvckxpbmVWQQ==","X3NlY3RvclNlZ21lbnRMaW5lQ29tbWFuZA==","X3NlY3RvclNlZ21lbnRMaW5lVkE=","X2RvbWVGcm9udENvbW1hbmQ=","X2RvbWVCYWNrQ29tbWFuZA==","X2RvbWVWQQ==","X2RvbWVMaW5lQ29tbWFuZA==","X2RvbWVMaW5lVkE=","X3NjYW5QbGFuZUZyb250Q29tbWFuZA==","X3NjYW5QbGFuZUJhY2tDb21tYW5k","X3NjYW5SYWRpYWxDb21tYW5k","X2NvbG9yQ29tbWFuZHM=","X2Zyb250RmFjZVJT","X2JhY2tGYWNlUlM=","X3Nw","X3VuaWZvcm1z","X3NjYW5Vbmlmb3Jtcw==","aGFsZkFuZ2xlIG11c3QgYmUgZ3JlYXRlciB0aGFuIG9yIGVxdWFsIHRvIHplcm8u","dGhpcy5yYWRpdXMgbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdG8gemVyby4=","bXVsdGlwbHlCeVVuaWZvcm1TY2FsZQ==","dHJhbnNmb3Jt","aXNUcmFuc2x1Y2VudA==","c2Vjb25kc0RpZmZlcmVuY2U=","bWF4","ZnJvbVJvdGF0aW9uWA==","ZnJvbVJvdGF0aW9uWQ==","bXVsdGlwbHlCeU1hdHJpeDM=","cGFzc2Vz","cmVuZGVy","em95","em94","bWFw","bXVsdGlwbHlCeVZlY3Rvcg==","cmV2ZXJzZQ==","Y29uY2F0","YXBwbHk=","Y3JlYXRlVmVydGV4QnVmZmVy","QllURVNfUEVSX0VMRU1FTlQ=","UE9TSVRJT05fT05MWQ==","RWxsaXBzb2lkT3V0bGluZUdlb21ldHJ5","UElfT1ZFUl9UV08=","X3NjYW5QbGFuZVZB","c2hhZGVyU291cmNl","dW5pZm9ybQ==","X3BpY2tTUA==","X3NjYW5lUGxhbmVTUA==","RlJPTlQ=","X3BpY2tSUw==","dV9ub3JtYWxEaXJlY3Rpb24=","cGFzcw==","dV90eXBl","Q2hlY2s=","R2VvbWV0cnlBdHRyaWJ1dGVz","SW5kZXhEYXRhdHlwZQ==","cm91bmQ=","c3RhY2tQYXJ0aXRpb25z","c2xpY2VQYXJ0aXRpb25z","dHlwZU9m","bnVtYmVy","dmVydGV4Rm9ybWF0","REVGQVVMVA==","X3N0YWNrUGFydGl0aW9ucw==","X3NsaWNlUGFydGl0aW9ucw==","X3ZlcnRleEZvcm1hdA==","ZnJvbURpbWVuc2lvbnM=","Z3JlYXRlclRoYW5PckVxdWFscw==","Y3JlYXRlVHlwZWRBcnJheQ==","VFdPX1BJ","dGltZUVuZA==","Q29uaWNBcmNTZW5zb3JHZW9tZXRyeQ==","c3ViZGl2aXNpb25z","b3B0aW9ucy5zdGFja1BhcnRpdGlvbnMgY2Fubm90IGJlIGxlc3MgdGhhbiAx","b3B0aW9ucy5zbGljZVBhcnRpdGlvbnMgY2Fubm90IGJlIGxlc3MgdGhhbiAw","b3B0aW9ucy5zdWJkaXZpc2lvbnMgbXVzdCBiZSBncmVhdGVyIHRoYW4gb3IgZXF1YWwgdG8gemVyby4=","X3N1YmRpdmlzaW9ucw==","Q29uaWNBcmNTZW5zb3JPdXRsaW5lR2VvbWV0cnk=","RXZlbnQ=","Y3JlYXRlTWF0ZXJpYWxQcm9wZXJ0eURlc2NyaXB0b3I=","Y3JlYXRlUHJvcGVydHlEZXNjcmlwdG9y","X2FuZ2xlU3Vic2NyaXB0aW9u","X3JhZGl1c1N1YnNjcmlwdGlvbg==","X3N0YWNr","X3N0YWNrU3Vic2NyaXB0aW9u","X3NsaWNl","X3NsaWNlU3Vic2NyaXB0aW9u","X2NvbG9y","X2NvbG9yU3Vic2NyaXB0aW9u","X3Nob3dTdWJzY3JpcHRpb24=","X2ZpbGw=","X2ZpbGxTdWJzY3JpcHRpb24=","X21hdGVyaWFsU3Vic2NyaXB0aW9u","X291dGxpbmVTdWJzY3JpcHRpb24=","X291dGxpbmVDb2xvcg==","X291dGxpbmVDb2xvclN1YnNjcmlwdGlvbg==","X291dGxpbmVXaWR0aA==","X291dGxpbmVXaWR0aFN1YnNjcmlwdGlvbg==","X3NoYWRvd3M=","X3NoYWRvd3NTdWJzY3JpcHRpb24=","X2Rpc3RhbmNlRGlzcGxheUNvbmRpdGlvbg==","X2Rpc3RhbmNlRGlzcGxheUNvbmRpdGlvblN1YnNjcmlwdGlvbg==","X2RlZmluaXRpb25DaGFuZ2Vk","X2dhemU=","X2dhemVTdWJzY3JpcHRpb24=","bWVyZ2U=","c3RhY2s=","ZmlsbA==","b3V0bGluZUNvbG9y","b3V0bGluZVdpZHRo","c2hhZG93cw==","ZGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9u","Z2F6ZQ==","c291cmNlIGlzIHJlcXVpcmVkLg==","Q29uaWNBcmNTZW5zb3JHcmFwaGljcw==","a2V5cw==","UmVjdGFuZ3VsYXJTZW5zb3JHcmFwaGljcw==","UmVjdGFuZ3VsYXJTZW5zb3JWaXN1YWxpemVy","Q29uaWNBcmNTZW5zb3JDb2xsZWN0aW9u","RGF0YVNvdXJjZURpc3BsYXk=","ZGVmYXVsdFZpc3VhbGl6ZXJzQ2FsbGJhY2s=","YXR0cmlidXRlIHZlYzQgcG9zaXRpb247DQphdHRyaWJ1dGUgdmVjMyBub3JtYWw7DQoNCnZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uOw0KdmFyeWluZyB2ZWMzIHZfcG9zaXRpb25XQzsNCnZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uRUM7DQp2YXJ5aW5nIHZlYzMgdl9ub3JtYWxFQzsNCg0Kdm9pZCBtYWluKCkNCnsNCiAgICBnbF9Qb3NpdGlvbiA9IGN6bV9tb2RlbFZpZXdQcm9qZWN0aW9uICogcG9zaXRpb247DQogICAgdl9wb3NpdGlvbiA9IHZlYzMocG9zaXRpb24pOw0KICAgIHZfcG9zaXRpb25XQyA9IChjem1fbW9kZWwgKiBwb3NpdGlvbikueHl6Ow0KICAgIHZfcG9zaXRpb25FQyA9IChjem1fbW9kZWxWaWV3ICogcG9zaXRpb24pLnh5ejsNCiAgICB2X25vcm1hbEVDID0gY3ptX25vcm1hbCAqIG5vcm1hbDsNCn0=","I2lmZGVmIEdMX09FU19zdGFuZGFyZF9kZXJpdmF0aXZlcw0KI2V4dGVuc2lvbiBHTF9PRVNfc3RhbmRhcmRfZGVyaXZhdGl2ZXMgOiBlbmFibGUNCiNlbmRpZg0KDQp1bmlmb3JtIGJvb2wgdV9zaG93SW50ZXJzZWN0aW9uOw0KdW5pZm9ybSBib29sIHVfc2hvd1Rocm91Z2hFbGxpcHNvaWQ7DQoNCnVuaWZvcm0gZmxvYXQgdV9yYWRpdXM7DQp1bmlmb3JtIGZsb2F0IHVfeEhhbGZBbmdsZTsNCnVuaWZvcm0gZmxvYXQgdV95SGFsZkFuZ2xlOw0KdW5pZm9ybSBmbG9hdCB1X25vcm1hbERpcmVjdGlvbjsNCnVuaWZvcm0gZmxvYXQgdV90eXBlOw0KDQp2YXJ5aW5nIHZlYzMgdl9wb3NpdGlvbjsNCnZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uV0M7DQp2YXJ5aW5nIHZlYzMgdl9wb3NpdGlvbkVDOw0KdmFyeWluZyB2ZWMzIHZfbm9ybWFsRUM7DQoNCnZlYzQgZ2V0Q29sb3IoZmxvYXQgc2Vuc29yUmFkaXVzLCB2ZWMzIHBvaW50RUMpDQp7DQogICAgY3ptX21hdGVyaWFsSW5wdXQgbWF0ZXJpYWxJbnB1dDsNCg0KICAgIHZlYzMgcG9pbnRNQyA9IChjem1faW52ZXJzZU1vZGVsVmlldyAqIHZlYzQocG9pbnRFQywgMS4wKSkueHl6Ow0KICAgIG1hdGVyaWFsSW5wdXQuc3QgPSBzZW5zb3IyZFRleHR1cmVDb29yZGluYXRlcyhzZW5zb3JSYWRpdXMsIHBvaW50TUMpOw0KICAgIG1hdGVyaWFsSW5wdXQuc3RyID0gcG9pbnRNQyAvIHNlbnNvclJhZGl1czsNCg0KICAgIHZlYzMgcG9zaXRpb25Ub0V5ZUVDID0gLXZfcG9zaXRpb25FQzsNCiAgICBtYXRlcmlhbElucHV0LnBvc2l0aW9uVG9FeWVFQyA9IHBvc2l0aW9uVG9FeWVFQzsNCg0KICAgIHZlYzMgbm9ybWFsRUMgPSBub3JtYWxpemUodl9ub3JtYWxFQyk7DQogICAgbWF0ZXJpYWxJbnB1dC5ub3JtYWxFQyA9IHVfbm9ybWFsRGlyZWN0aW9uICogbm9ybWFsRUM7DQoNCiAgICBjem1fbWF0ZXJpYWwgbWF0ZXJpYWwgPSBjem1fZ2V0TWF0ZXJpYWwobWF0ZXJpYWxJbnB1dCk7DQoNCiAgICByZXR1cm4gbWl4KGN6bV9waG9uZyhub3JtYWxpemUocG9zaXRpb25Ub0V5ZUVDKSwgbWF0ZXJpYWwsY3ptX2xpZ2h0RGlyZWN0aW9uRUMpLCB2ZWM0KG1hdGVyaWFsLmRpZmZ1c2UsIG1hdGVyaWFsLmFscGhhKSwgMC40KTsNCg0KfQ0KDQpib29sIGlzT25Cb3VuZGFyeShmbG9hdCB2YWx1ZSwgZmxvYXQgZXBzaWxvbikNCnsNCiAgICBmbG9hdCB3aWR0aCA9IGdldEludGVyc2VjdGlvbldpZHRoKCk7DQogICAgZmxvYXQgdG9sZXJhbmNlID0gd2lkdGggKiBlcHNpbG9uOw0KDQojaWZkZWYgR0xfT0VTX3N0YW5kYXJkX2Rlcml2YXRpdmVzDQogICAgZmxvYXQgZGVsdGEgPSBtYXgoYWJzKGRGZHgodmFsdWUpKSwgYWJzKGRGZHkodmFsdWUpKSk7DQogICAgZmxvYXQgcGl4ZWxzID0gd2lkdGggKiBkZWx0YTsNCiAgICBmbG9hdCB0ZW1wID0gYWJzKHZhbHVlKTsNCiAgICAvLyBUaGVyZSBhcmUgYSBjb3VwbGUgdGhpbmdzIGdvaW5nIG9uIGhlcmUuDQogICAgLy8gRmlyc3Qgd2UgdGVzdCB0aGUgdmFsdWUgYXQgdGhlIGN1cnJlbnQgZnJhZ21lbnQgdG8gc2VlIGlmIGl0IGlzIHdpdGhpbiB0aGUgdG9sZXJhbmNlLg0KICAgIC8vIFdlIGFsc28gd2FudCB0byBjaGVjayBpZiB0aGUgdmFsdWUgb2YgYW4gYWRqYWNlbnQgcGl4ZWwgaXMgd2l0aGluIHRoZSB0b2xlcmFuY2UsDQogICAgLy8gYnV0IHdlIGRvbid0IHdhbnQgdG8gYWRtaXQgcG9pbnRzIHRoYXQgYXJlIG9idmlvdXNseSBub3Qgb24gdGhlIHN1cmZhY2UuDQogICAgLy8gRm9yIGV4YW1wbGUsIGlmIHdlIGFyZSBsb29raW5nIGZvciAidmFsdWUiIHRvIGJlIGNsb3NlIHRvIDAsIGJ1dCB2YWx1ZSBpcyAxIGFuZCB0aGUgYWRqYWNlbnQgdmFsdWUgaXMgMiwNCiAgICAvLyB0aGVuIHRoZSBkZWx0YSB3b3VsZCBiZSAxIGFuZCAidGVtcCAtIGRlbHRhIiB3b3VsZCBiZSAiMSAtIDEiIHdoaWNoIGlzIHplcm8gZXZlbiB0aG91Z2ggbmVpdGhlciBvZg0KICAgIC8vIHRoZSBwb2ludHMgaXMgY2xvc2UgdG8gemVyby4NCiAgICByZXR1cm4gdGVtcCA8IHRvbGVyYW5jZSAmJiB0ZW1wIDwgcGl4ZWxzIHx8IChkZWx0YSA8IDEwLjAgKiB0b2xlcmFuY2UgJiYgdGVtcCAtIGRlbHRhIDwgdG9sZXJhbmNlICYmIHRlbXAgPCBwaXhlbHMpOw0KI2Vsc2UNCiAgICByZXR1cm4gYWJzKHZhbHVlKSA8IHRvbGVyYW5jZTsNCiNlbmRpZg0KfQ0KDQp2ZWM0IHNoYWRlKGJvb2wgaXNPbkJvdW5kYXJ5KQ0Kew0KICAgIGlmICh1X3Nob3dJbnRlcnNlY3Rpb24gJiYgaXNPbkJvdW5kYXJ5KQ0KICAgIHsNCiAgICAgICAgcmV0dXJuIGdldEludGVyc2VjdGlvbkNvbG9yKCk7DQogICAgfQ0KICAgIGlmKHVfdHlwZSA9PSAxLjApew0KICAgICAgICByZXR1cm4gZ2V0TGluZUNvbG9yKCk7DQogICAgfQ0KICAgIHJldHVybiBnZXRDb2xvcih1X3JhZGl1cywgdl9wb3NpdGlvbkVDKTsNCn0NCg0KZmxvYXQgZWxsaXBzb2lkU3VyZmFjZUZ1bmN0aW9uKHZlYzMgcG9pbnQpDQp7DQogICAgdmVjMyBzY2FsZWQgPSBjem1fZWxsaXBzb2lkSW52ZXJzZVJhZGlpICogcG9pbnQ7DQogICAgcmV0dXJuIGRvdChzY2FsZWQsIHNjYWxlZCkgLSAxLjA7DQp9DQoNCnZvaWQgbWFpbigpDQp7DQogICAgdmVjMyBzZW5zb3JWZXJ0ZXhXQyA9IGN6bV9tb2RlbFszXS54eXo7ICAgICAgLy8gKDAuMCwgMC4wLCAwLjApIGluIG1vZGVsIGNvb3JkaW5hdGVzDQogICAgdmVjMyBzZW5zb3JWZXJ0ZXhFQyA9IGN6bV9tb2RlbFZpZXdbM10ueHl6OyAgLy8gKDAuMCwgMC4wLCAwLjApIGluIG1vZGVsIGNvb3JkaW5hdGVzDQoNCiAgICAvL3ZlYzMgcGl4RGlyID0gbm9ybWFsaXplKHZfcG9zaXRpb24pOw0KICAgIGZsb2F0IHBvc2l0aW9uWCA9IHZfcG9zaXRpb24ueDsNCiAgICBmbG9hdCBwb3NpdGlvblkgPSB2X3Bvc2l0aW9uLnk7DQogICAgZmxvYXQgcG9zaXRpb25aID0gdl9wb3NpdGlvbi56Ow0KDQogICAgdmVjMyB6RGlyID0gdmVjMygwLjAsIDAuMCwgMS4wKTsNCiAgICB2ZWMzIGxpbmVYID0gdmVjMyhwb3NpdGlvblgsIDAgLHBvc2l0aW9uWik7DQogICAgdmVjMyBsaW5lWSA9IHZlYzMoMCwgcG9zaXRpb25ZLCBwb3NpdGlvblopOw0KICAgIGZsb2F0IHJlc1ggPSBkb3Qobm9ybWFsaXplKGxpbmVYKSwgekRpcik7DQogICAgaWYocmVzWCA8IGNvcyh1X3hIYWxmQW5nbGUpLTAuMDAwMDEpew0KICAgICAgICBkaXNjYXJkOw0KICAgIH0NCiAgICBmbG9hdCByZXNZID0gZG90KG5vcm1hbGl6ZShsaW5lWSksIHpEaXIpOw0KICAgIGlmKHJlc1kgPCBjb3ModV95SGFsZkFuZ2xlKS0wLjAwMDAxKXsNCiAgICAgICAgZGlzY2FyZDsNCiAgICB9DQoNCiAgICBmbG9hdCBlbGxpcHNvaWRWYWx1ZSA9IGVsbGlwc29pZFN1cmZhY2VGdW5jdGlvbih2X3Bvc2l0aW9uV0MpOw0KDQogICAgLy8gT2NjbHVkZWQgYnkgdGhlIGVsbGlwc29pZD8NCglpZiAoIXVfc2hvd1Rocm91Z2hFbGxpcHNvaWQpDQoJew0KCSAgICAvLyBEaXNjYXJkIGlmIGluIHRoZSBlbGxpcHNvaWQNCgkgICAgLy8gUEVSRk9STUFOQ0VfSURFQTogQSBjb2Fyc2UgY2hlY2sgZm9yIGVsbGlwc29pZCBpbnRlcnNlY3Rpb24gY291bGQgYmUgZG9uZSBvbiB0aGUgQ1BVIGZpcnN0Lg0KCSAgICBpZiAoZWxsaXBzb2lkVmFsdWUgPCAwLjApDQoJICAgIHsNCiAgICAgICAgICAgIGRpc2NhcmQ7DQoJICAgIH0NCg0KCSAgICAvLyBEaXNjYXJkIGlmIGluIHRoZSBzZW5zb3IncyBzaGFkb3cNCgkgICAgaWYgKGluU2Vuc29yU2hhZG93KHNlbnNvclZlcnRleFdDLCB2X3Bvc2l0aW9uV0MpKQ0KCSAgICB7DQoJICAgICAgICBkaXNjYXJkOw0KCSAgICB9DQogICAgfQ0KDQogICAgLy8gTm90ZXM6IEVhY2ggc3VyZmFjZSBmdW5jdGlvbnMgc2hvdWxkIGhhdmUgYW4gYXNzb2NpYXRlZCB0b2xlcmFuY2UgYmFzZWQgb24gdGhlIGZsb2F0aW5nIHBvaW50IGVycm9yLg0KICAgIGJvb2wgaXNPbkVsbGlwc29pZCA9IGlzT25Cb3VuZGFyeShlbGxpcHNvaWRWYWx1ZSwgY3ptX2Vwc2lsb24zKTsNCiAgICAvL2lzT25FbGxpcHNvaWQgPSBmYWxzZTsNCiAgICAvL2lmKChyZXNYID49IDAuOCAmJiByZXNYIDw9IDAuODEpfHwocmVzWSA+PSAwLjggJiYgcmVzWSA8PSAwLjgxKSl7DQogICAgLyppZihmYWxzZSl7DQogICAgICAgIGdsX0ZyYWdDb2xvciA9IHZlYzQoMS4wLDAuMCwwLjAsMS4wKTsNCiAgICB9ZWxzZXsNCiAgICAgICAgZ2xfRnJhZ0NvbG9yID0gc2hhZGUoaXNPbkVsbGlwc29pZCk7DQogICAgfQ0KKi8NCiAgICBnbF9GcmFnQ29sb3IgPSBzaGFkZShpc09uRWxsaXBzb2lkKTsNCg0KfQ==","dW5pZm9ybSB2ZWM0IHVfaW50ZXJzZWN0aW9uQ29sb3I7CnVuaWZvcm0gZmxvYXQgdV9pbnRlcnNlY3Rpb25XaWR0aDsKdW5pZm9ybSB2ZWM0IHVfbGluZUNvbG9yOwoKYm9vbCBpblNlbnNvclNoYWRvdyh2ZWMzIGNvbmVWZXJ0ZXhXQywgdmVjMyBwb2ludFdDKQp7CiAgICAvLyBEaWFnb25hbCBtYXRyaXggZnJvbSB0aGUgdW5zY2FsZWQgZWxsaXBzb2lkIHNwYWNlIHRvIHRoZSBzY2FsZWQgc3BhY2UuICAgIAogICAgdmVjMyBEID0gY3ptX2VsbGlwc29pZEludmVyc2VSYWRpaTsKCiAgICAvLyBTZW5zb3IgdmVydGV4IGluIHRoZSBzY2FsZWQgZWxsaXBzb2lkIHNwYWNlCiAgICB2ZWMzIHEgPSBEICogY29uZVZlcnRleFdDOwogICAgZmxvYXQgcU1hZ25pdHVkZVNxdWFyZWQgPSBkb3QocSwgcSk7CiAgICBmbG9hdCB0ZXN0ID0gcU1hZ25pdHVkZVNxdWFyZWQgLSAxLjA7CiAgICAKICAgIC8vIFNlbnNvciB2ZXJ0ZXggdG8gZnJhZ21lbnQgdmVjdG9yIGluIHRoZSBlbGxpcHNvaWQncyBzY2FsZWQgc3BhY2UKICAgIHZlYzMgdGVtcCA9IEQgKiBwb2ludFdDIC0gcTsKICAgIGZsb2F0IGQgPSBkb3QodGVtcCwgcSk7CiAgICAKICAgIC8vIEJlaGluZCBzaWxob3VldHRlIHBsYW5lIGFuZCBpbnNpZGUgc2lsaG91ZXR0ZSBjb25lCiAgICByZXR1cm4gKGQgPCAtdGVzdCkgJiYgKGQgLyBsZW5ndGgodGVtcCkgPCAtc3FydCh0ZXN0KSk7Cn0KCi8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8vLy8KCnZlYzQgZ2V0TGluZUNvbG9yKCkKewogICAgcmV0dXJuIHVfbGluZUNvbG9yOwp9Cgp2ZWM0IGdldEludGVyc2VjdGlvbkNvbG9yKCkKewogICAgcmV0dXJuIHVfaW50ZXJzZWN0aW9uQ29sb3I7Cn0KCmZsb2F0IGdldEludGVyc2VjdGlvbldpZHRoKCkKewogICAgcmV0dXJuIHVfaW50ZXJzZWN0aW9uV2lkdGg7Cn0KCnZlYzIgc2Vuc29yMmRUZXh0dXJlQ29vcmRpbmF0ZXMoZmxvYXQgc2Vuc29yUmFkaXVzLCB2ZWMzIHBvaW50TUMpCnsKICAgIC8vIChzLCB0KSBib3RoIGluIHRoZSByYW5nZSBbMCwgMV0KICAgIGZsb2F0IHQgPSBwb2ludE1DLnogLyBzZW5zb3JSYWRpdXM7CiAgICBmbG9hdCBzID0gMS4wICsgKGF0YW4ocG9pbnRNQy55LCBwb2ludE1DLngpIC8gY3ptX3R3b1BpKTsKICAgIHMgPSBzIC0gZmxvb3Iocyk7CiAgICAKICAgIHJldHVybiB2ZWMyKHMsIHQpOwp9Cg==","I2lmZGVmIEdMX09FU19zdGFuZGFyZF9kZXJpdmF0aXZlcw0KI2V4dGVuc2lvbiBHTF9PRVNfc3RhbmRhcmRfZGVyaXZhdGl2ZXMgOiBlbmFibGUNCiNlbmRpZg0KDQp1bmlmb3JtIGJvb2wgdV9zaG93SW50ZXJzZWN0aW9uOw0KdW5pZm9ybSBib29sIHVfc2hvd1Rocm91Z2hFbGxpcHNvaWQ7DQoNCnVuaWZvcm0gZmxvYXQgdV9yYWRpdXM7DQp1bmlmb3JtIGZsb2F0IHVfeEhhbGZBbmdsZTsNCnVuaWZvcm0gZmxvYXQgdV95SGFsZkFuZ2xlOw0KdW5pZm9ybSBmbG9hdCB1X25vcm1hbERpcmVjdGlvbjsNCnVuaWZvcm0gdmVjNCB1X2NvbG9yOw0KDQp2YXJ5aW5nIHZlYzMgdl9wb3NpdGlvbjsNCnZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uV0M7DQp2YXJ5aW5nIHZlYzMgdl9wb3NpdGlvbkVDOw0KdmFyeWluZyB2ZWMzIHZfbm9ybWFsRUM7DQoNCnZlYzQgZ2V0Q29sb3IoZmxvYXQgc2Vuc29yUmFkaXVzLCB2ZWMzIHBvaW50RUMpDQp7DQogICAgY3ptX21hdGVyaWFsSW5wdXQgbWF0ZXJpYWxJbnB1dDsNCg0KICAgIHZlYzMgcG9pbnRNQyA9IChjem1faW52ZXJzZU1vZGVsVmlldyAqIHZlYzQocG9pbnRFQywgMS4wKSkueHl6Ow0KICAgIG1hdGVyaWFsSW5wdXQuc3QgPSBzZW5zb3IyZFRleHR1cmVDb29yZGluYXRlcyhzZW5zb3JSYWRpdXMsIHBvaW50TUMpOw0KICAgIG1hdGVyaWFsSW5wdXQuc3RyID0gcG9pbnRNQyAvIHNlbnNvclJhZGl1czsNCg0KICAgIHZlYzMgcG9zaXRpb25Ub0V5ZUVDID0gLXZfcG9zaXRpb25FQzsNCiAgICBtYXRlcmlhbElucHV0LnBvc2l0aW9uVG9FeWVFQyA9IHBvc2l0aW9uVG9FeWVFQzsNCg0KICAgIHZlYzMgbm9ybWFsRUMgPSBub3JtYWxpemUodl9ub3JtYWxFQyk7DQogICAgbWF0ZXJpYWxJbnB1dC5ub3JtYWxFQyA9IHVfbm9ybWFsRGlyZWN0aW9uICogbm9ybWFsRUM7DQoNCiAgICBjem1fbWF0ZXJpYWwgbWF0ZXJpYWwgPSBjem1fZ2V0TWF0ZXJpYWwobWF0ZXJpYWxJbnB1dCk7DQoNCiAgICBtYXRlcmlhbC5kaWZmdXNlID0gdV9jb2xvci5yZ2I7DQogICAgbWF0ZXJpYWwuYWxwaGEgPSB1X2NvbG9yLmE7DQoNCiAgICByZXR1cm4gbWl4KGN6bV9waG9uZyhub3JtYWxpemUocG9zaXRpb25Ub0V5ZUVDKSwgbWF0ZXJpYWwsY3ptX2xpZ2h0RGlyZWN0aW9uRUMpLCB2ZWM0KG1hdGVyaWFsLmRpZmZ1c2UsIG1hdGVyaWFsLmFscGhhKSwgMC40KTsNCg0KfQ0KDQpib29sIGlzT25Cb3VuZGFyeShmbG9hdCB2YWx1ZSwgZmxvYXQgZXBzaWxvbikNCnsNCiAgICBmbG9hdCB3aWR0aCA9IGdldEludGVyc2VjdGlvbldpZHRoKCk7DQogICAgZmxvYXQgdG9sZXJhbmNlID0gd2lkdGggKiBlcHNpbG9uOw0KDQojaWZkZWYgR0xfT0VTX3N0YW5kYXJkX2Rlcml2YXRpdmVzDQogICAgZmxvYXQgZGVsdGEgPSBtYXgoYWJzKGRGZHgodmFsdWUpKSwgYWJzKGRGZHkodmFsdWUpKSk7DQogICAgZmxvYXQgcGl4ZWxzID0gd2lkdGggKiBkZWx0YTsNCiAgICBmbG9hdCB0ZW1wID0gYWJzKHZhbHVlKTsNCiAgICAvLyBUaGVyZSBhcmUgYSBjb3VwbGUgdGhpbmdzIGdvaW5nIG9uIGhlcmUuDQogICAgLy8gRmlyc3Qgd2UgdGVzdCB0aGUgdmFsdWUgYXQgdGhlIGN1cnJlbnQgZnJhZ21lbnQgdG8gc2VlIGlmIGl0IGlzIHdpdGhpbiB0aGUgdG9sZXJhbmNlLg0KICAgIC8vIFdlIGFsc28gd2FudCB0byBjaGVjayBpZiB0aGUgdmFsdWUgb2YgYW4gYWRqYWNlbnQgcGl4ZWwgaXMgd2l0aGluIHRoZSB0b2xlcmFuY2UsDQogICAgLy8gYnV0IHdlIGRvbid0IHdhbnQgdG8gYWRtaXQgcG9pbnRzIHRoYXQgYXJlIG9idmlvdXNseSBub3Qgb24gdGhlIHN1cmZhY2UuDQogICAgLy8gRm9yIGV4YW1wbGUsIGlmIHdlIGFyZSBsb29raW5nIGZvciAidmFsdWUiIHRvIGJlIGNsb3NlIHRvIDAsIGJ1dCB2YWx1ZSBpcyAxIGFuZCB0aGUgYWRqYWNlbnQgdmFsdWUgaXMgMiwNCiAgICAvLyB0aGVuIHRoZSBkZWx0YSB3b3VsZCBiZSAxIGFuZCAidGVtcCAtIGRlbHRhIiB3b3VsZCBiZSAiMSAtIDEiIHdoaWNoIGlzIHplcm8gZXZlbiB0aG91Z2ggbmVpdGhlciBvZg0KICAgIC8vIHRoZSBwb2ludHMgaXMgY2xvc2UgdG8gemVyby4NCiAgICByZXR1cm4gdGVtcCA8IHRvbGVyYW5jZSAmJiB0ZW1wIDwgcGl4ZWxzIHx8IChkZWx0YSA8IDEwLjAgKiB0b2xlcmFuY2UgJiYgdGVtcCAtIGRlbHRhIDwgdG9sZXJhbmNlICYmIHRlbXAgPCBwaXhlbHMpOw0KI2Vsc2UNCiAgICByZXR1cm4gYWJzKHZhbHVlKSA8IHRvbGVyYW5jZTsNCiNlbmRpZg0KfQ0KDQp2ZWM0IHNoYWRlKGJvb2wgaXNPbkJvdW5kYXJ5KQ0Kew0KICAgIGlmICh1X3Nob3dJbnRlcnNlY3Rpb24gJiYgaXNPbkJvdW5kYXJ5KQ0KICAgIHsNCiAgICAgICAgcmV0dXJuIGdldEludGVyc2VjdGlvbkNvbG9yKCk7DQogICAgfQ0KICAgIHJldHVybiBnZXRDb2xvcih1X3JhZGl1cywgdl9wb3NpdGlvbkVDKTsNCn0NCg0KZmxvYXQgZWxsaXBzb2lkU3VyZmFjZUZ1bmN0aW9uKHZlYzMgcG9pbnQpDQp7DQogICAgdmVjMyBzY2FsZWQgPSBjem1fZWxsaXBzb2lkSW52ZXJzZVJhZGlpICogcG9pbnQ7DQogICAgcmV0dXJuIGRvdChzY2FsZWQsIHNjYWxlZCkgLSAxLjA7DQp9DQoNCnZvaWQgbWFpbigpDQp7DQogICAgdmVjMyBzZW5zb3JWZXJ0ZXhXQyA9IGN6bV9tb2RlbFszXS54eXo7ICAgICAgLy8gKDAuMCwgMC4wLCAwLjApIGluIG1vZGVsIGNvb3JkaW5hdGVzDQogICAgdmVjMyBzZW5zb3JWZXJ0ZXhFQyA9IGN6bV9tb2RlbFZpZXdbM10ueHl6OyAgLy8gKDAuMCwgMC4wLCAwLjApIGluIG1vZGVsIGNvb3JkaW5hdGVzDQoNCiAgICAvL3ZlYzMgcGl4RGlyID0gbm9ybWFsaXplKHZfcG9zaXRpb24pOw0KICAgIGZsb2F0IHBvc2l0aW9uWCA9IHZfcG9zaXRpb24ueDsNCiAgICBmbG9hdCBwb3NpdGlvblkgPSB2X3Bvc2l0aW9uLnk7DQogICAgZmxvYXQgcG9zaXRpb25aID0gdl9wb3NpdGlvbi56Ow0KDQogICAgdmVjMyB6RGlyID0gdmVjMygwLjAsIDAuMCwgMS4wKTsNCiAgICB2ZWMzIGxpbmVYID0gdmVjMyhwb3NpdGlvblgsIDAgLHBvc2l0aW9uWik7DQogICAgdmVjMyBsaW5lWSA9IHZlYzMoMCwgcG9zaXRpb25ZLCBwb3NpdGlvblopOw0KICAgIGZsb2F0IHJlc1ggPSBkb3Qobm9ybWFsaXplKGxpbmVYKSwgekRpcik7DQogICAgaWYocmVzWCA8IGNvcyh1X3hIYWxmQW5nbGUpIC0gMC4wMDAxKXsNCiAgICAgICAgZGlzY2FyZDsNCiAgICB9DQogICAgZmxvYXQgcmVzWSA9IGRvdChub3JtYWxpemUobGluZVkpLCB6RGlyKTsNCiAgICBpZihyZXNZIDwgY29zKHVfeUhhbGZBbmdsZSktIDAuMDAwMSl7DQogICAgICAgIGRpc2NhcmQ7DQogICAgfQ0KDQogICAgZmxvYXQgZWxsaXBzb2lkVmFsdWUgPSBlbGxpcHNvaWRTdXJmYWNlRnVuY3Rpb24odl9wb3NpdGlvbldDKTsNCg0KICAgIC8vIE9jY2x1ZGVkIGJ5IHRoZSBlbGxpcHNvaWQ/DQoJaWYgKCF1X3Nob3dUaHJvdWdoRWxsaXBzb2lkKQ0KCXsNCgkgICAgLy8gRGlzY2FyZCBpZiBpbiB0aGUgZWxsaXBzb2lkDQoJICAgIC8vIFBFUkZPUk1BTkNFX0lERUE6IEEgY29hcnNlIGNoZWNrIGZvciBlbGxpcHNvaWQgaW50ZXJzZWN0aW9uIGNvdWxkIGJlIGRvbmUgb24gdGhlIENQVSBmaXJzdC4NCgkgICAgaWYgKGVsbGlwc29pZFZhbHVlIDwgMC4wKQ0KCSAgICB7DQogICAgICAgICAgICBkaXNjYXJkOw0KCSAgICB9DQoNCgkgICAgLy8gRGlzY2FyZCBpZiBpbiB0aGUgc2Vuc29yJ3Mgc2hhZG93DQoJICAgIGlmIChpblNlbnNvclNoYWRvdyhzZW5zb3JWZXJ0ZXhXQywgdl9wb3NpdGlvbldDKSkNCgkgICAgew0KCSAgICAgICAgZGlzY2FyZDsNCgkgICAgfQ0KICAgIH0NCg0KICAgIC8vIE5vdGVzOiBFYWNoIHN1cmZhY2UgZnVuY3Rpb25zIHNob3VsZCBoYXZlIGFuIGFzc29jaWF0ZWQgdG9sZXJhbmNlIGJhc2VkIG9uIHRoZSBmbG9hdGluZyBwb2ludCBlcnJvci4NCiAgICBib29sIGlzT25FbGxpcHNvaWQgPSBpc09uQm91bmRhcnkoZWxsaXBzb2lkVmFsdWUsIGN6bV9lcHNpbG9uMyk7DQogICAgZ2xfRnJhZ0NvbG9yID0gc2hhZGUoaXNPbkVsbGlwc29pZCk7DQoNCn0=","X2xpbmVDb2xvcg==","X3Nob3dTZWN0b3JMaW5lcw==","X3Nob3dTZWN0b3JTZWdtZW50TGluZXM=","X3Nob3dMYXRlcmFsU3VyZmFjZXM=","X3Nob3dEb21lU3VyZmFjZXM=","X3Nob3dEb21lTGluZXM=","X3Nob3dJbnRlcnNlY3Rpb24=","X2ludGVyc2VjdGlvbkNvbG9y","X2ludGVyc2VjdGlvbldpZHRo","X3Nob3dTY2FuUGxhbmU=","X3NjYW5QbGFuZUNvbG9y","X3NjYW5QbGFuZU1vZGU=","X3NjYW5QbGFuZVJhdGU=","c2hvd0RvbWVMaW5lcyA=","QXNzb2NpYXRpdmVBcnJheQ==","TWF0ZXJpYWxQcm9wZXJ0eQ==","aXNEZXN0cm95ZWQ=","c2NlbmUgaXMgcmVxdWlyZWQu","ZW50aXR5Q29sbGVjdGlvbiBpcyByZXF1aXJlZC4=","Y29sbGVjdGlvbkNoYW5nZWQ=","YWRkRXZlbnRMaXN0ZW5lcg==","X29uQ29sbGVjdGlvbkNoYW5nZWQ=","X3NjZW5l","X3ByaW1pdGl2ZXM=","X2VudGl0eUNvbGxlY3Rpb24=","X2hhc2g=","X2VudGl0aWVzVG9WaXN1YWxpemU=","dGltZSBpcyByZXF1aXJlZC4=","X3JlY3Rhbmd1bGFyU2Vuc29y","aXNTaG93aW5n","aXNBdmFpbGFibGU=","Z2V0VmFsdWVPckRlZmF1bHQ=","X29yaWVudGF0aW9u","YW5nbGVCZXR3ZWVu","VU5JVF9a","ZnJvbUF4aXNBbmdsZQ==","c2V0","Vmlld2Vy","Q29sb3JHZW9tZXRyeUluc3RhbmNlQXR0cmlidXRl","UHJpbWl0aXZl","UGVySW5zdGFuY2VDb2xvckFwcGVhcmFuY2U=","RGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9u","RGlzdGFuY2VEaXNwbGF5Q29uZGl0aW9uR2VvbWV0cnlJbnN0YW5jZUF0dHJpYnV0ZQ==","dmlld2VyIGlzIHJlcXVpcmVkLg==","X3ZpZXdlcg==","Y2xvY2s=","X2Nsb2Nr","X3ByaW1pdGl2ZQ==","X291dGxpbmVQcmltaXRpdmU=","X2NvbmljQXJjU2Vuc29yQ29sbGVjdGlvbg==","b25UaWNr","Q29uaWNBcmNTZW5zb3I=","aW5kZXhPZg==","cmVtb3ZlQWxs","Y3VycmVudFRpbWU=","cmVtb3ZlQW5kRGVzdHJveQ==","X2NvbmljQXJjU2Vuc29y","bXVsdGlwbHlCeVNjYWxhcg==","UE9TSVRJT05fQU5EX05PUk1BTA==","R2VvbWV0cnlJbnN0YW5jZQ==","ZnJvbUNvbG9y","Y2xhbXBMaW5lV2lkdGg=","RW50aXR5","Q29uc3RhbnRQb3NpdGlvblByb3BlcnR5","Y29uaWNBcmNTZW5zb3I=","Z2F6ZUF0","ZmluZEluZGV4","Zm92","aW5uZXJGb3ZSYWRpdXNQYWlycw==","b3V0ZXJGb3ZSYWRpdXNQYWlycw==","c3RhcnRSYWRpdXM=","c3RhcnRGb3ZI","ZW5kRm92SA==","c3RhcnRGb3ZW","ZW5kRm92Vg==","c2VnbWVudEg=","c2VnbWVudFY=","c3ViU2VnbWVudEg=","c3ViU2VnbWVudFY=","ZmFjZUNvbG9y","X3N0YXJ0Rm92SA==","X2VuZEZvdkg=","X3N0YXJ0Rm92Vg==","X2VuZEZvdlY=","X3NlZ21lbnRI","X3NlZ21lbnRW","X3N1YlNlZ21lbnRI","X3N1YlNlZ21lbnRW","X2luaXRCb3VuZGluZ1NwaGVyZQ==","X2NvbW1hbmQ=","X2NyZWF0ZU91dGVyQ3VydmVDb21tYW5k","X291dGVyRm92UmFkaXVzUGFpcnM=","X2NyZWF0ZVJhd0NvbW1hbmQ=","X2NyZWF0ZUlubmVyQ3VydmVDb21tYW5k","X2lubmVyRm92UmFkaXVzUGFpcnM=","X2NyZWF0ZUxlZnRDcm9zc1NlY3Rpb25Db21tYW5k","X2NyZWF0ZVJpZ2h0Q3Jvc3NTZWN0aW9uQ29tbWFuZA==","QXBwZWFyYW5jZQ==","Z2V0RGVmYXVsdFJlbmRlclN0YXRl","CiAgICAgICAgICAgIC8vIG11eWFvIOS9v+eUqGRvdWJsZeexu+Wei+eahHBvc2l0aW9u6L+b6KGM6K6h566XCiAgICAgICAgICAgIC8vIGF0dHJpYnV0ZSB2ZWMzIHBvc2l0aW9uM0RIaWdoOwogICAgICAgICAgICAvLyBhdHRyaWJ1dGUgdmVjMyBwb3NpdGlvbjNETG93OwogICAgICAgICAgICBhdHRyaWJ1dGUgdmVjMyBwb3NpdGlvbjsKICAgICAgICAgICAgYXR0cmlidXRlIHZlYzMgbm9ybWFsOwogICAgICAgICAgICAvLyBhdHRyaWJ1dGUgdmVjMiBzdDsKICAgICAgICAgICAgLy8gYXR0cmlidXRlIGZsb2F0IGJhdGNoSWQ7CgogICAgICAgICAgICB2YXJ5aW5nIHZlYzMgdl9wb3NpdGlvbkVDOwogICAgICAgICAgICB2YXJ5aW5nIHZlYzMgdl9ub3JtYWxFQzsKICAgICAgICAgICAgLy8gdmFyeWluZyB2ZWMyIHZfc3Q7CgogICAgICAgICAgICB2b2lkIG1haW4oKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAvLyBtdXlhbyDkvb/nlKhkb3VibGXnsbvlnovnmoRwb3NpdGlvbui/m+ihjOiuoeeulwogICAgICAgICAgICAgICAgLy8gdmVjNCBwID0gY3ptX3RyYW5zbGF0ZVJlbGF0aXZlVG9FeWUocG9zaXRpb24zREhpZ2gsIHBvc2l0aW9uM0RMb3cpOwogICAgICAgICAgICAgICAgLy8gdl9wb3NpdGlvbkVDID0gKGN6bV9tb2RlbFZpZXdSZWxhdGl2ZVRvRXllICogcCkueHl6OyAgICAgIC8vIHBvc2l0aW9uIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9ub3JtYWxFQyA9IGN6bV9ub3JtYWwgKiBub3JtYWw7ICAgICAgICAgICAgICAgICAgICAgICAgIC8vIG5vcm1hbCBpbiBleWUgY29vcmRpbmF0ZXMKICAgICAgICAgICAgICAgIC8vIHZfc3QgPSBzdDsKICAgICAgICAgICAgICAgIC8vIGdsX1Bvc2l0aW9uID0gY3ptX21vZGVsVmlld1Byb2plY3Rpb25SZWxhdGl2ZVRvRXllICogcDsKCiAgICAgICAgICAgICAgICB2X3Bvc2l0aW9uRUMgPSAoY3ptX21vZGVsVmlldyAqIHZlYzQocG9zaXRpb24sIDEuMCkpLnh5ejsgICAgICAgLy8gcG9zaXRpb24gaW4gZXllIGNvb3JkaW5hdGVzCiAgICAgICAgICAgICAgICB2X25vcm1hbEVDID0gY3ptX25vcm1hbCAqIG5vcm1hbDsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gbm9ybWFsIGluIGV5ZSBjb29yZGluYXRlcwogICAgICAgICAgICAgICAgLy8gdl9zdCA9IHN0OwogICAgICAgICAgICAgICAgZ2xfUG9zaXRpb24gPSBjem1fbW9kZWxWaWV3UHJvamVjdGlvbiAqIHZlYzQocG9zaXRpb24sIDEuMCk7CiAgICAgICAgICAgIH0KICAgICAgICAgICAg","CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X3Bvc2l0aW9uRUM7CiAgICAgICAgICAgIHZhcnlpbmcgdmVjMyB2X25vcm1hbEVDOwogICAgICAgICAgICAvLyB2YXJ5aW5nIHZlYzIgdl9zdDsKCiAgICAgICAgICAgIC8vIHVuaWZvcm0gc2FtcGxlcjJEIG15SW1hZ2U7CiAgICAgICAgICAgIHVuaWZvcm0gdmVjNCB4YnNqQ29sb3I7CgogICAgICAgICAgICB2b2lkIG1haW4oKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICB2ZWMzIHBvc2l0aW9uVG9FeWVFQyA9IC12X3Bvc2l0aW9uRUM7CgogICAgICAgICAgICAgICAgdmVjMyBub3JtYWxFQyA9IG5vcm1hbGl6ZSh2X25vcm1hbEVDKTsKICAgICAgICAgICAgI2lmZGVmIEZBQ0VfRk9SV0FSRAogICAgICAgICAgICAgICAgbm9ybWFsRUMgPSBmYWNlZm9yd2FyZChub3JtYWxFQywgdmVjMygwLjAsIDAuMCwgMS4wKSwgLW5vcm1hbEVDKTsKICAgICAgICAgICAgI2VuZGlmCgogICAgICAgICAgICAgICAgY3ptX21hdGVyaWFsSW5wdXQgbWF0ZXJpYWxJbnB1dDsKICAgICAgICAgICAgICAgIG1hdGVyaWFsSW5wdXQubm9ybWFsRUMgPSBub3JtYWxFQzsKICAgICAgICAgICAgICAgIG1hdGVyaWFsSW5wdXQucG9zaXRpb25Ub0V5ZUVDID0gcG9zaXRpb25Ub0V5ZUVDOwogICAgICAgICAgICAgICAgLy8gbWF0ZXJpYWxJbnB1dC5zdCA9IHZfc3Q7CgogICAgICAgICAgICAgICAgLy9jem1fbWF0ZXJpYWwgbWF0ZXJpYWwgPSBjem1fZ2V0TWF0ZXJpYWwobWF0ZXJpYWxJbnB1dCk7CiAgICAgICAgICAgICAgICBjem1fbWF0ZXJpYWwgbWF0ZXJpYWwgPSBjem1fZ2V0RGVmYXVsdE1hdGVyaWFsKG1hdGVyaWFsSW5wdXQpOwogICAgICAgICAgICAgICAgLy8gbWF0ZXJpYWwuZGlmZnVzZSA9IHRleHR1cmUyRChteUltYWdlLCBtYXRlcmlhbElucHV0LnN0KS5yZ2I7CiAgICAgICAgICAgICAgICBtYXRlcmlhbC5kaWZmdXNlID0geGJzakNvbG9yLnJnYjsKICAgICAgICAgICAgICAgIG1hdGVyaWFsLmFscGhhID0geGJzakNvbG9yLmE7CgogICAgICAgICAgICAjaWZkZWYgRkxBVAogICAgICAgICAgICAgICAgZ2xfRnJhZ0NvbG9yID0gdmVjNChtYXRlcmlhbC5kaWZmdXNlICsgbWF0ZXJpYWwuZW1pc3Npb24sIG1hdGVyaWFsLmFscGhhKTsKICAgICAgICAgICAgI2Vsc2UKICAgICAgICAgICAgICAgIGdsX0ZyYWdDb2xvciA9IGN6bV9waG9uZyhub3JtYWxpemUocG9zaXRpb25Ub0V5ZUVDKSwgbWF0ZXJpYWwsY3ptX2xpZ2h0RGlyZWN0aW9uRUMpOwogICAgICAgICAgICAjZW5kaWYKICAgICAgICAgICAgfQogICAgICAgICAgICA=","Y3JlYXRlSW5kZXhCdWZmZXI=","VU5TSUdORURfU0hPUlQ=","X2Rlc3Ryb3lDb21tYW5kcw==","X2NvbW1hbmRz","Y29tbWFuZA==","Ym91bmRpbmdWb2x1bWU=","aW5pdEJvdW5kaW5nU3BoZXJl","bGluZUNvbW1hbmQ=","X3N0YXJ0UmFkaXVz","Q2FtYmVyUmFkYXJQcmltaXRpdmU=","X2luc3RhbGxDdXN0b21DZXNpdW1QbHVnaW4=","aW5kaWNlcw==","YXR0cmlidXRlcw==","bGVuZ3Ro","cG9zaXRpb24=","dmFsdWVz","bm9ybWFs","R2VvbWV0cnlBdHRyaWJ1dGU=","Q29tcG9uZW50RGF0YXR5cGU=","RkxPQVQ=","Q2FydGVzaWFuMw==","ZnJvbUFycmF5","c3VidHJhY3Q=","Y3Jvc3M=","bmVlZHNVcGRhdGU=","c3FydA==","RWxsaXBzb2lk","V0dTODQ=","TWF0cml4NA==","bXVsdGlwbHlCeVBvaW50","b3JpZ2lu","ZGlyZWN0aW9u","bm9ybWFsaXpl","SW50ZXJzZWN0aW9uVGVzdHM=","cmF5RWxsaXBzb2lk","UmF5","Z2V0UG9pbnQ=","c3RhcnQ=","Q2FydG9ncmFwaGlj","ZnJvbUNhcnRlc2lhbg==","ZGVmaW5lUHJvcGVydHk=","X19lc01vZHVsZQ==","Y29tcHV0ZVZlcnRleE5vcm1hbHM=","ZXh0ZW5kMkVhcnRo","ZnJvbVJvdGF0aW9uVHJhbnNsYXRpb24=","TWF0cml4Mw==","ZnJvbVF1YXRlcm5pb24=","VHJhbnNmb3Jtcw==","ZWFzdE5vcnRoVXBUb0ZpeGVkRnJhbWU=","bXVsdGlwbHk=","aW52ZXJzZQ==","Z2V0Um90YXRpb24=","UXVhdGVybmlvbg==","ZnJvbVJvdGF0aW9uTWF0cml4","SGVhZGluZ1BpdGNoUm9sbA==","Z2V0SGVhZGluZ1BpdGNoUm9sbEJ5T3JpZW50YXRpb24=","ZGVmaW5lZA==","X25vTW91c2VQb3NpdGlvbg==","cHJpbWl0aXZl","cGljaw==","cGlja1Bvc2l0aW9uU3VwcG9ydGVk","cGlja1Bvc2l0aW9u","aGVpZ2h0","bW9kZQ==","U2NlbmVNb2Rl","U0NFTkUzRA==","Y2FtZXJh","Z2V0UGlja1JheQ==","Z2xvYmU=","cGlja0VsbGlwc29pZA==","ZWxsaXBzb2lk","Z2V0Q3VycmVudE1vdXNlUG9zaXRpb24=","X2JvdHRvbVdpZHRo","Ym90dG9tV2lkdGg=","X2JvdHRvbUhlaWdodA==","Ym90dG9tSGVpZ2h0","X3RvcFdpZHRo","dG9wV2lkdGg=","X3RvcEhlaWdodA==","dG9wSGVpZ2h0","X2xlbmd0aA==","X3pSZXZlcnNl","elJldmVyc2U=","X3NsaWNlcw==","c2xpY2Vz","Rm91clByaXNtR2VvbWV0cnk=","X2NyZWF0ZUdlb21ldHJ5","cHVzaA==","RE9VQkxF","Qm91bmRpbmdTcGhlcmU=","ZnJvbVZlcnRpY2Vz","R2VvbWV0cnk=","UHJpbWl0aXZlVHlwZQ==","VFJJQU5HTEVT","R2VvbWV0cnlQaXBlbGluZQ==","Y29tcHV0ZU5vcm1hbA==","Y3JlYXRlR2VvbWV0cnk=","WkVSTw==","Y2xvbmU=","Y3JlYXRlT3V0bGluZUdlb21ldHJ5","TElORVM=","Y3JlYXRlT3V0bGluZUdlb21ldHJ5Mg==","dG9XaXJlZnJhbWU=","ZnJvbUFuZ2xlc0xlbmd0aA==","TWF0aA==","dG9SYWRpYW5z","dGFu","Q3ZDeWxpbmRlckdlb21ldHJ5","dG9wUmFkaXVz","Ym90dG9tUmFkaXVz","Q2FydGVzaWFuMg==","YXRhbjI=","c2lu","Y29z","ZnJvbUFuZ2xlQW5kTGVuZ3Ro","dW5kZWZpbmVk","U2F0ZWxsaXRlQ292ZXJhZ2VTaW11bGF0aW9u","c2NlbmU=","X2dlb21ldHJ5","X2FyZWFUeXBl","YXJlYVR5cGU=","QXJlYVR5cGU=","Rm91clByaXNt","X2FuZ2xlMQ==","YW5nbGUx","X2FuZ2xlMg==","YW5nbGUy","X3Bvc2l0aW9u","YXV0b0FuZ2xl","X3JvdGF0aW9u","cm90YXRpb24=","X3Nob3c=","ZGVmYXVsdFZhbHVl","c2hvdw==","X291dGxpbmU=","b3V0bGluZQ==","X2dyb3VuZEFyZWE=","Z3JvdW5kQXJlYQ==","X2dyb3VuZE91dExpbmU=","Z3JvdW5kT3V0TGluZQ==","ZGVmYXVsdENvbG9y","Y29sb3I=","Q29sb3I=","WUVMTE9X","ZGVmYXVsdExpbmVDb2xvcg==","bGluZUNvbG9y","X2dyb3VuZEFyZWFDb2xvcg==","Z3JvdW5kQXJlYUNvbG9y","X2dyb3VuZE91dExpbmVDb2xvcg==","Z3JvdW5kT3V0TGluZUNvbG9y","X21vZGVsTWF0cml4","SURFTlRJVFk=","X3F1YXRlcm5pb24=","X3RyYW5zbGF0aW9u","X3NjYWxl","X21hdHJpeA==","X2ludmVyc2VNYXRyaXg=","X3Bvc2l0aW9uQ2FydG9ncmFwaGlj","X3Bvc2l0aW9uQ2FydGVzaWFu","X2RyYXdDb21tYW5kcw==","X291dGxpbmVQb3NpdGlvbnM=","X2ltYWdpbmdBcmVhUG9zaXRpb25z","X3RyYWNrZWRFbnRpdHk=","dHJhY2tlZEVudGl0eQ==","X3RyYWNrUG9zaXRpb25z","X3RyYWNrR2VvbWV0cmllcw==","X3RyYWNr","dmlld2Vy","cHJpbWl0aXZlcw==","YWRk","YWRkR3JvdW5kQXJlYUVudGl0eQ==","aGFzT3duUHJvcGVydHk=","bWlu","dW5wYWNr","ZGVmaW5lUHJvcGVydGllcw==","cHJvdG90eXBl","Y2xlYXJDb21tYW5kcw==","aGVhZGluZw==","cGl0Y2g=","cm9sbA==","Z3JvdW5kQXJlYUVudGl0eQ==","UG9seWdvbkhpZXJhcmNoeQ==","ZW50aXRpZXM=","Q2FsbGJhY2tQcm9wZXJ0eQ==","cG9zaXRpb25z","Zm9yRWFjaA==","dmVydGV4QXJyYXk=","ZGVzdHJveQ==","bWVyZ2VHZW9tZXRyaWVz","57y65bCRZ2VvbWV0cmllc+WPguaVsA==","cHJpbWl0aXZlVHlwZQ==","5b6F5ZCI5bm255qE5Yeg5L2V5L2T5LitcHJpbWl0aXZlVHlwZeWxnuaAp+S4jeWujOWFqOS4gOiHtA==","5b6F5ZCI5bm255qE5Yeg5L2V5L2T5Lit5bGe5oCn5pWw6YeP5ZKM5ZKM5ZCN56ew5LiN5a6M5YWo5LiA6Ie0","ZnJvbQ==","Y29uc3RydWN0b3I=","dXBkYXRlSW1hZ2luZ0FyZWFHZW9tZXRyeQ==","bGFzdGVzdEZyYW1l","ZXF1YWxz","dXBkYXRlSW1hZ2luZ0FyZWFHZW9tZXRyeTI=","Z2VvbWV0cnk=","Y29tcHV0ZU1hdHJpeA==","ZnVuY3Rpb24=","Z2V0VmFsdWU=","X3ZhbHVl","b3JpZW50YXRpb24=","UHJvcGVydHk=","Z2V0VmFsdWVPclVuZGVmaW5lZA==","ZnJvbUhlYWRpbmdQaXRjaFJvbGw=","ZnJvbVRyYW5zbGF0aW9uUXVhdGVybmlvblJvdGF0aW9uU2NhbGU=","bXVsdGlwbHlUcmFuc2Zvcm1hdGlvbg==","aW52ZXJzZVRyYW5zZm9ybWF0aW9u","ZXhwb3J0SW1hZ2luZ0FyZWE=","X3Bvc2l0aW9ucw==","dG9EZWdyZWVz","bG9uZ2l0dWRl","bGF0aXR1ZGU=","dG9GaXhlZA==","cG9pbnQ=","ZmVhdHVyZUNvbGxlY3Rpb24=","Y29udmV4","Z2V0Q29vcmRz","cmVtb3Zl","X291dGxpbmVHZW9tZXRyeQ==","YWRkVG9TY2VuZQ==","dXBkYXRlR2VvbWV0cnk=","Q29uZQ==","Q3lsaW5kZXJHZW9tZXRyeQ==","dXBkYXRlVm9sdW1lR2VvbWV0cnk=","X3ZvbHVtZUdlb21ldHJ5","X3ZvbHVtZU91dGxpbmVHZW9tZXRyeQ==","dXBkYXRl","dGltZQ==","c3BsaWNl","ZnJvbURlZ3JlZXM=","X3ZvbHVtZUNvbW1hbmQ=","Y3JlYXRlRHJhd0NvbW1hbmQ=","Y29tbWFuZExpc3Q=","X3ZvbHVtZU91dGxpbmVDb21tYW5k","cG9seWdvbg==","cG9seWxpbmU=","X2RyYXdDb21tYW5k","Z2V0RnJhZ21lbnRTaGFkZXJTb3VyY2U=","I2RlZmluZSBGQUNFX0ZPUldBUkQKdmFyeWluZyB2ZWMzIHZfcG9zaXRpb247CnZhcnlpbmcgdmVjMyB2X25vcm1hbDsKdW5pZm9ybSBmbG9hdCBwaWNrZWQ7CnVuaWZvcm0gdmVjNCAgcGlja2VkQ29sb3I7CnVuaWZvcm0gdmVjNCAgZGVmYXVsdENvbG9yOwp1bmlmb3JtIGZsb2F0IHNwZWN1bGFyOwp1bmlmb3JtIGZsb2F0IHNoaW5pbmVzczsKdW5pZm9ybSB2ZWMzICBlbWlzc2lvbjsKdmFyeWluZyB2ZWMyIHZfc3Q7CnVuaWZvcm0gYm9vbCBpc0xpbmU7CnVuaWZvcm0gZmxvYXQgZ2xvd1Bvd2VyOwp2b2lkIG1haW4oKSB7CiAgICB2ZWMzIHBvc2l0aW9uVG9FeWVFQyA9IC12X3Bvc2l0aW9uOyAKICAgIHZlYzMgbm9ybWFsRUMgPW5vcm1hbGl6ZSh2X25vcm1hbCk7CiAgICBub3JtYWxFQyA9IGZhY2Vmb3J3YXJkKG5vcm1hbEVDLCB2ZWMzKDAuMCwgMC4wLCAxLjApLCAtbm9ybWFsRUMpOwogICAgdmVjNCBjb2xvcj1kZWZhdWx0Q29sb3I7CiAgICBpZihwaWNrZWQhPTAuMCl7CiAgICAgICAgY29sb3IgPSBwaWNrZWRDb2xvcjsKICAgIH0KICAgIGlmKHZfc3QueDwwLjUpewogICAgICAgIGNvbG9yLmEgPSBjb2xvci5hKiggMC43NS12X3N0LngpOyAKICAgIH0KICAgIGVsc2UgIHsKICAgICAgICBjb2xvci5hID1jb2xvci5hKih2X3N0LngtMC4yNSk7IAogICAgfQogICAgY3ptX21hdGVyaWFsIG1hdGVyaWFsOwogICAgbWF0ZXJpYWwuc3BlY3VsYXIgPSBzcGVjdWxhcjsKICAgIG1hdGVyaWFsLnNoaW5pbmVzcyA9IHNoaW5pbmVzczsKICAgIG1hdGVyaWFsLm5vcm1hbCA9ICBub3JtYWxFQzsKICAgIG1hdGVyaWFsLmVtaXNzaW9uID1lbWlzc2lvbjsvL3ZlYzMoMC4yLDAuMiwwLjIpOwogICAgbWF0ZXJpYWwuZGlmZnVzZSA9IGNvbG9yLnJnYiA7CiAgICBpZihpc0xpbmUpewogICAgICAgIG1hdGVyaWFsLmFscGhhID0gMS4wOyAKICAgIH0KICAgIGVsc2V7CiAgICAgICAgbWF0ZXJpYWwuYWxwaGEgPSBjb2xvci5hOyAKICAgIH0KICAgICAgICAvL2Zsb2F0IGdsb3cgPSBnbG93UG93ZXIgLyBhYnModl9zdC50ICApIC0gKGdsb3dQb3dlciAvIDAuNSk7IAogICAgICAgIC8vIAogICAgICAgIC8vbWF0ZXJpYWwuZW1pc3Npb24gPSBtYXgodmVjMyhnbG93IC0gMS4wICsgY29sb3IucmdiKSwgY29sb3IucmdiKTsgCiAgICAgICAgLy9pZihpc0xpbmUpCiAgICAgICAgLy8gICAgbWF0ZXJpYWwuYWxwaGEgPSBjbGFtcCgwLjAsIDEuMCwgZ2xvdykgKiBjb2xvci5hOyAKICAgICAgICAgCiAgICBpZih2X3N0Lng9PTAuMCl7IAogICAgICAgICAgZ2xfRnJhZ0NvbG9yID1jb2xvciA7CiAgICB9ZWxzZSB7IAogICAgICAgIGdsX0ZyYWdDb2xvciA9ICAgY3ptX3Bob25nKG5vcm1hbGl6ZShwb3NpdGlvblRvRXllRUMpLCBtYXRlcmlhbCxjem1fbGlnaHREaXJlY3Rpb25FQykgOyAKICAgIH0gCn0=","Z2V0VmVydGV4U2hhZGVyU291cmNl","CiNpZmRlZiBHTF9FUwogICAgcHJlY2lzaW9uIGhpZ2hwIGZsb2F0OwojZW5kaWYKCmF0dHJpYnV0ZSB2ZWMzIHBvc2l0aW9uOwphdHRyaWJ1dGUgdmVjMiBzdDsKYXR0cmlidXRlIHZlYzMgbm9ybWFsOwp1bmlmb3JtIG1hdDQgbW9kZWxWaWV3TWF0cml4Owp1bmlmb3JtIG1hdDMgbm9ybWFsTWF0cml4Owp1bmlmb3JtIG1hdDQgcHJvamVjdGlvbk1hdHJpeDsKdmFyeWluZyB2ZWMzIHZfcG9zaXRpb247CnZhcnlpbmcgdmVjMyB2X25vcm1hbDsKdmFyeWluZyB2ZWMyIHZfc3Q7Cgp2YXJ5aW5nIHZlYzMgdl9saWdodDBEaXJlY3Rpb247Cgp2b2lkIG1haW4odm9pZCkgCnsKICAgIHZlYzQgcG9zID0gIG1vZGVsVmlld01hdHJpeCAqIHZlYzQoIHBvc2l0aW9uLDEuMCk7CiAgICB2X25vcm1hbCA9ICBub3JtYWxNYXRyaXggKiAgbm9ybWFsOwogICAgdl9zdCA9IHN0OwogICAgdl9wb3NpdGlvbiA9IHBvcy54eXo7CiAgICB2X2xpZ2h0MERpcmVjdGlvbiA9IG1hdDMoIG1vZGVsVmlld01hdHJpeCkgKiB2ZWMzKDEuMCwxLjAsMS4wKTsKICAgIGdsX1Bvc2l0aW9uID0gIHByb2plY3Rpb25NYXRyaXggKiBwb3M7Cn0=","Y29udGV4dA==","Ym91bmRpbmdTcGhlcmU=","Y2VudGVy","cmFkaXVz","RHJhd0NvbW1hbmQ=","UGFzcw==","T1BBUVVF","Y3JlYXRlQXR0cmlidXRlTG9jYXRpb25z","VmVydGV4QXJyYXk=","ZnJvbUdlb21ldHJ5","QnVmZmVyVXNhZ2U=","U1RBVElDX0RSQVc=","X2F0dHJpYnV0ZUxvY2F0aW9ucw==","c2hhZGVyUHJvZ3JhbQ==","U2hhZGVyUHJvZ3JhbQ==","cmVwbGFjZUNhY2hl","cmVuZGVyU3RhdGU=","UmVuZGVyU3RhdGU=","ZnJvbUNhY2hl","QmxlbmRpbmdTdGF0ZQ==","QUxQSEFfQkxFTkQ="],j=O,K=345;--K;)j.push(j.shift());var tt=function(t,e){var i=O[t-=0];if(void 0===tt.hPWhUV){try{n=Function('return (function() {}.constructor("return this")( ));')()}catch(t){n=window}n.atob||(n.atob=function(t){for(var e,i,n=String(t).replace(/=+$/,""),a=0,r=0,o="";i=n.charAt(r++);~i&&(e=a%4?64*e+i:i,a++%4)&&(o+=String.fromCharCode(255&e>>(-2*a&6))))i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(i);return o}),tt.gwHlNX=function(t){for(var e=atob(t),i=[],n=0,a=e.length;n<a;n++)i+="%"+("00"+e.charCodeAt(n).toString(16)).slice(-2);return decodeURIComponent(i)},tt.dLwPgH={},tt.hPWhUV=!0}var n=tt.dLwPgH[t];return void 0===n?(i=tt.gwHlNX(i),tt.dLwPgH[t]=i):i=n,i};function q(t,$){function x(t,e){var i=Math[tt("0x66")],n=Math[tt("0x65")];return[i(-t)*i(e),n(-t)*i(e),n(e)]}function u(t,e,i,n){return t+n/i*(e-t)}function p(e,t){var i,n=t[tt("0x229")](function(t){return t[tt("0x22a")]>e});if(0<n)return i=t[n-1],t=t[n],n=(e-i[tt("0x22a")])/(t[tt("0x22a")]-i[tt("0x22a")]),i[tt("0xed")]*(1-n)+t[tt("0xed")]*n}function r(t,e,i,n,a,r,o){for(var s=new Float32Array((a+1)*(r+1)*3),l=0;l<a+1;++l)for(var c=0;c<r+1;++c){var h=u(i,n,r,c),d=x(u(t,e,a,l),h),h=o?p(h,o):1;s[3*(c*(a+1)+l)+0]=d[0]*h,s[3*(c*(a+1)+l)+1]=d[1]*h,s[3*(c*(a+1)+l)+2]=d[2]*h}return s}function o(t,e,i,n,a,r,o){for(var s=new Float32Array((n+1)*(a+1)*3),l=0;l<n+1;++l)for(var c=0;c<a+1;++c){var h=u(e,i,a,c),d=x(t,h),h=u(r?p(h,r):1,o?p(h,o):1,n,l);s[3*(c*(n+1)+l)+0]=d[0]*h,s[3*(c*(n+1)+l)+1]=d[1]*h,s[3*(c*(n+1)+l)+2]=d[2]*h}return s}function s(t,e){for(var i=new Uint16Array(t*e*6),n=0;n<t;++n)for(var a=0;a<e;++a){var r=a*(t+1)+n,o=a*(t+1)+n+1,s=(a+1)*(t+1)+n,l=(a+1)*(t+1)+n+1,c=6*(a*t+n);i[0+c]=r,i[1+c]=o,i[2+c]=l,i[3+c]=r,i[4+c]=l,i[5+c]=s}return i}function l(t,e,i,n){for(var a=t*i,r=e*n,o=new Uint16Array((t+1)*(2*r)+(e+1)*(2*a)+8),s=0;s<t+1;++s)for(var l=0;l<r;++l){var c=s*i;o[2*(s*r+l)+0]=l*(1+a)+c,o[2*(s*r+l)+1]=(l+1)*(1+a)+c}for(var h=(t+1)*(2*r),d=0;d<e+1;++d)for(var x=0;x<a;++x){var u=d*n;o[h+2*(x+d*a)]=u*(1+a)+x,o[h+2*(x+d*a)+1]=u*(1+a)+x+1}return o}function e(t){this[tt("0x22b")]=t[tt("0x22b")],this[tt("0x22c")]=t[tt("0x22c")],this[tt("0xed")]=t[tt("0xed")],this[tt("0x22d")]=t[tt("0x22d")],this[tt("0x140")]=$[tt("0x79")](t[tt("0x140")],$[tt("0x11")][tt("0x8c")]),this[tt("0x22e")]=$[tt("0x79")](t[tt("0x22e")],$[tt("0x5d")][tt("0x5e")](-50)),this[tt("0x22f")]=$[tt("0x79")](t[tt("0x22f")],$[tt("0x5d")][tt("0x5e")](50)),this[tt("0x230")]=$[tt("0x79")](t[tt("0x230")],$[tt("0x5d")][tt("0x5e")](5)),this[tt("0x231")]=$[tt("0x79")](t[tt("0x231")],$[tt("0x5d")][tt("0x5e")](85)),this[tt("0x232")]=$[tt("0x79")](t[tt("0x232")],20),this[tt("0x233")]=$[tt("0x79")](t[tt("0x233")],20),this[tt("0x234")]=$[tt("0x79")](t[tt("0x234")],3),this[tt("0x235")]=$[tt("0x79")](t[tt("0x235")],3),this[tt("0x236")]=$[tt("0x79")](t[tt("0x236")],new $[tt("0x83")](1,1,0,.5)),this[tt("0x86")]=$[tt("0x79")](t[tt("0x86")],new $[tt("0x83")](1,0,0)),this[tt("0x7a")]=$[tt("0x79")](t[tt("0x7a")],!0),this[tt("0x8b")]=$[tt("0x11")][tt("0x57")]($[tt("0x11")][tt("0x8c")]),this[tt("0x237")]=0,this[tt("0x238")]=0,this[tt("0x239")]=0,this[tt("0x23a")]=0,this[tt("0x23b")]=1,this[tt("0x23c")]=1,this[tt("0x23d")]=1,this[tt("0x23e")]=1,this[tt("0x166")]=new $[tt("0x4e")],this[tt("0x23f")]=void 0,this[tt("0x240")]=void 0}function i(t,e){e=e||{},n=t[tt("0x6a")][tt("0x39")][tt("0x3b")],this[tt("0x6b")]=null,this[tt("0x113")]=e[tt("0x114")],this[tt("0x115")]=e[tt("0xed")]?e[tt("0xed")]:5,this[tt("0x74")]=e[tt("0x3")],this[tt("0x76")]=e[tt("0x77")]?e[tt("0x77")]:{heading:0,pitch:0,roll:0},this[tt("0x97")]=e[tt("0x98")],this[tt("0x81")]=e[tt("0x82")]?e[tt("0x82")]:$[tt("0x83")][tt("0x84")],this[tt("0x85")]=e[tt("0x86")]?e[tt("0x86")]:this[tt("0x81")],this[tt("0x78")]=$[tt("0x79")](e[tt("0x7a")],!0),this[tt("0x7b")]=$[tt("0x79")](e[tt("0x7c")],!1),this[tt("0x116")]=$[tt("0x79")](e[tt("0x117")],!0),this[tt("0x118")]=$[tt("0x79")](e[tt("0x119")],!0),this[tt("0x8b")]=$[tt("0x11")][tt("0x57")]($[tt("0x11")][tt("0x8c")]),this[tt("0x8d")]=new $[tt("0x29")],this[tt("0x8e")]=new $[tt("0x9")],this[tt("0x8f")]=new $[tt("0x9")](1,1,1),this[tt("0x90")]=new $[tt("0x11")],this[tt("0x91")]=new $[tt("0x11")],this[tt("0x92")]=new $[tt("0x1b")],this[tt("0x93")]=null,this[tt("0x94")]=[],this[tt("0x95")]=[],this[tt("0x9c")]=t,this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0x9e")](this),this[tt("0xd5")](),this[tt("0x7d")]=$[tt("0x79")](e[tt("0x7e")],!1),this[tt("0x9f")](this[tt("0x7d")])}var n,c,d,m,g,v,y,b,C,G,_,A,P,W,w,I;function M(t,e){e=e||{},d=t[tt("0x6a")][tt("0x39")][tt("0x3b")],this[tt("0x6b")]=null,this[tt("0x6c")]=e[tt("0x6d")]?e[tt("0x6d")]:M[tt("0x6e")][tt("0x6f")],this[tt("0x70")]=e[tt("0x71")]?e[tt("0x71")]:10,this[tt("0x72")]=e[tt("0x73")]?e[tt("0x73")]:10,this[tt("0x45")]=e[tt("0x2")]?e[tt("0x2")]:1e6,this[tt("0x74")]=e[tt("0x3")],this[tt("0x75")]=e[tt("0x75")],this[tt("0x76")]=e[tt("0x77")]?e[tt("0x77")]:{heading:0,pitch:0,roll:0},this[tt("0x78")]=$[tt("0x79")](e[tt("0x7a")],!0),this[tt("0x7b")]=$[tt("0x79")](e[tt("0x7c")],!1),this[tt("0x7d")]=$[tt("0x79")](e[tt("0x7e")],!1),this[tt("0x7f")]=$[tt("0x79")](e[tt("0x80")],!1),this[tt("0x81")]=e[tt("0x82")]?e[tt("0x82")]:$[tt("0x83")][tt("0x84")],this[tt("0x85")]=e[tt("0x86")],this[tt("0x87")]=e[tt("0x88")],this[tt("0x89")]=e[tt("0x8a")],this[tt("0x8b")]=$[tt("0x11")][tt("0x57")]($[tt("0x11")][tt("0x8c")]),this[tt("0x8d")]=new $[tt("0x29")],this[tt("0x8e")]=new $[tt("0x9")],this[tt("0x8f")]=new $[tt("0x9")](1,1,1),this[tt("0x90")]=new $[tt("0x11")],this[tt("0x91")]=new $[tt("0x11")],this[tt("0x92")]=new $[tt("0x1b")],this[tt("0x93")]=null,this[tt("0x94")]=[],this[tt("0x95")]=[],this[tt("0x96")]=[],this[tt("0x97")]=e[tt("0x98")],this[tt("0x99")]=[],this[tt("0x9a")]=[],this[tt("0x9b")]={geometry:null,needsUpdate:!1,lastestFrame:null},this[tt("0x9c")]=t,this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0x9e")](this),this[tt("0x9f")](this[tt("0x7d")]||this[tt("0x7f")])}function S(t,e,i,n,a,r,o){a=a||$[tt("0xf")][tt("0x10")],r=r||[],$[tt("0x11")][tt("0x27")](e,m),$[tt("0x11")][tt("0x12")](e,$[tt("0x9")][tt("0x56")],v),v[tt("0x57")](y[tt("0x13")]);var s=0;n=Math[tt("0xa1")](t[tt("0x2")],i+n);for(var l=i;l<n;l+=3){$[tt("0x9")][tt("0xa2")](t,l,g),$[tt("0x11")][tt("0x12")](e,g,v),$[tt("0x9")][tt("0xb")](v,y[tt("0x13")],y[tt("0x14")]),$[tt("0x9")][tt("0x15")](y[tt("0x14")],y[tt("0x14")]);var c=$[tt("0x16")][tt("0x17")](y,a),h=null;(h=c?$[tt("0x18")][tt("0x19")](y,c[tt("0x1a")]):h)&&(h[tt("0x57")](v),r[s]=v[tt("0x57")](r[s]),o)&&o instanceof Float32Array&&($[tt("0x11")][tt("0x12")](m,v,v),o[i+3*s]=v.x,o[i+3*s+1]=v.y,o[i+3*s+2]=v.z),s++}return r}function Z(t){this[tt("0x2")]=t[tt("0x2")],this[tt("0x61")]=t[tt("0x61")],this[tt("0x62")]=t[tt("0x62")],this[tt("0x49")]=t[tt("0x49")]?t[tt("0x49")]:64,this[tt("0x47")]=t[tt("0x47")]}function V(t){this[tt("0x3d")]=t[tt("0x3e")],this[tt("0x3f")]=t[tt("0x40")],this[tt("0x41")]=t[tt("0x42")],this[tt("0x43")]=t[tt("0x44")],this[tt("0x45")]=t[tt("0x2")],this[tt("0x46")]=t[tt("0x47")],this[tt("0x48")]=t[tt("0x49")]?t[tt("0x49")]:8}$.Scene[tt("0x3c")]=function(t,e,i){var n=t[tt("0x30")](e);if(t[tt("0x31")]&&$[tt("0x2d")](n)&&function(t,e){if($[tt("0x2d")](t.id)){var i=t.id;if(i[tt("0x2e")])return;if(e&&i==e)return}if($[tt("0x2d")](t[tt("0x2f")])){i=t[tt("0x2f")];if(i[tt("0x2e")])return;if(e&&i==e)return}return 1}(n,i)){var a=t[tt("0x32")](e);if($[tt("0x2d")](a)){i=$[tt("0x1b")][tt("0x1c")](a)[tt("0x33")];if(0<=i)return a;if(!$[tt("0x2d")](n.id)&&-500<=i)return a}}return a=t[tt("0x34")]===$[tt("0x35")][tt("0x36")]?(n=t[tt("0x37")][tt("0x38")](e),t[tt("0x39")][tt("0x30")](n,t)):t[tt("0x37")][tt("0x3a")](e,t[tt("0x39")][tt("0x3b")])},$[tt("0x11")][tt("0x2c")]=function(t,e){var i=t,e=$[tt("0x11")][tt("0x21")]($[tt("0x22")][tt("0x23")](e,h),t,f);return i=$[tt("0x24")][tt("0x25")](i,$[tt("0xf")][tt("0x10")],new $[tt("0x11")]),i=$[tt("0x11")][tt("0x26")]($[tt("0x11")][tt("0x27")](i,new $[tt("0x11")]),e,new $[tt("0x11")]),e=$[tt("0x11")][tt("0x28")](i,new $[tt("0x22")]),i=$[tt("0x29")][tt("0x2a")](e),$[tt("0x2b")][tt("0x23")](i)},Object[tt("0x1d")]($.Scene,tt("0x1e"),{value:!0}),w=new $[tt("0x9")],new $[tt("0x18")],I=new $[tt("0x1b")],$.Scene[tt("0x1f")]=function(t){var e=t[tt("0x0")],i=t[tt("0x1")],n=e[tt("0x2")];if(i[tt("0x3")]){var a=i[tt("0x3")][tt("0x4")];if(void 0===i[tt("0x5")])i[tt("0x5")]=new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:3,values:new Float32Array(a[tt("0x2")])});else for(var r=i[tt("0x5")][tt("0x4")],o=0;o<n;o++)r[o]=0;for(var s,l,c,h=i[tt("0x5")][tt("0x4")],d=new $[tt("0x9")],x=new $[tt("0x9")],u=new $[tt("0x9")],p=new $[tt("0x9")],m=new $[tt("0x9")],o=0;o<n;o+=3)s=3*e[o+0],l=3*e[o+1],c=3*e[o+2],$[tt("0x9")][tt("0xa")](a,s,d),$[tt("0x9")][tt("0xa")](a,l,x),$[tt("0x9")][tt("0xa")](a,c,u),$[tt("0x9")][tt("0xb")](u,x,p),$[tt("0x9")][tt("0xb")](d,x,m),$[tt("0x9")][tt("0xc")](p,m,p),h[s]+=p.x,h[1+s]+=p.y,h[2+s]+=p.z,h[l]+=p.x,h[1+l]+=p.y,h[2+l]+=p.z,h[c]+=p.x,h[1+c]+=p.y,h[2+c]+=p.z;for(var g,f,v,y,b=t[tt("0x1")][tt("0x5")][tt("0x4")],C=0;C<b[tt("0x2")];C+=3)g=b[C],f=b[C+1],v=b[C+2],y=1/Math[tt("0xe")](g*g+f*f+v*v),b[C]=g*y,b[C+1]=f*y,b[C+2]=v*y;i[tt("0x5")][tt("0xd")]=!0}return t},$.Scene[tt("0x20")]=function(t,e,i,n){n=n||$[tt("0xf")][tt("0x10")],$[tt("0x11")][tt("0x12")](e,t,w),$[tt("0x9")][tt("0xb")](w,i[tt("0x13")],i[tt("0x14")]),$[tt("0x9")][tt("0x15")](i[tt("0x14")],i[tt("0x14")]);e=$[tt("0x16")][tt("0x17")](i,n),t=null;if(t=e?$[tt("0x18")][tt("0x19")](i,e[tt("0x1a")]):t)try{$[tt("0x1b")][tt("0x1c")](t,null,I)}catch(t){return null}return t},Object[tt("0x1d")]($.Scene,tt("0x1e"),{value:!0}),$.Scene[tt("0x4a")]=void 0,P=new $[tt("0x9")],W=new $[tt("0x18")],V[tt("0x4b")]=function(t){for(var e=t[tt("0x3d")],i=t[tt("0x3f")],n=t[tt("0x41")],a=t[tt("0x43")],t=(t[tt("0x46")]?-1:1)*t[tt("0x45")],r=new Float32Array(24),o=[],s=[],l=[0,t],c=[e,n],h=[i,a],d=0,x=0;x<2;x++)r[3*d]=-c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=-c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,d++;o[tt("0x4c")](0,1,3),o[tt("0x4c")](1,2,3),o[tt("0x4c")](0,4,5),o[tt("0x4c")](0,5,1),o[tt("0x4c")](1,2,6),o[tt("0x4c")](1,6,5),o[tt("0x4c")](2,3,7),o[tt("0x4c")](7,6,2),o[tt("0x4c")](0,3,7),o[tt("0x4c")](7,4,0),o[tt("0x4c")](4,5,6),o[tt("0x4c")](6,7,4);o=new Int16Array(o),s=new Float32Array(s),t={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:r}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:s})},e=$[tt("0x4e")][tt("0x4f")](r),n=new $[tt("0x50")]({attributes:t,indices:o,primitiveType:$[tt("0x51")][tt("0x52")],boundingSphere:e}),r=[];return o=[],$[tt("0x53")][tt("0x54")](n)},V[tt("0x55")]=function(t,e){if(!e)return V[tt("0x4b")](cylinderGeometry);$[tt("0x11")][tt("0x12")](e,$[tt("0x9")][tt("0x56")],P),P[tt("0x57")](W[tt("0x13")]);var i=t[tt("0x48")],n=(t[tt("0x3d")],t[tt("0x3f")],t[tt("0x41")]),a=t[tt("0x43")],r=(t[tt("0x46")]?-1:1)*t[tt("0x45")],o=[],s=[],l=n/2,c=a/2,h=i,d=i,x=0;(G=[])[tt("0x4c")](0,0,0),s[tt("0x4c")](1,1),x++;for(var u=new $[tt("0x9")],p=[],m=-d;m<d;m++){for(var g=[],f=-h;f<h;f++){var v=c*m/d,y=l*f/h;u.x=y,u.y=v,u.z=r,(0,$.Scene[tt("0x20")])(u,e,W)?(G[tt("0x4c")](y,v,r),s[tt("0x4c")](1,1),g[tt("0x4c")](x),x++):(g[tt("0x4c")](-1),0)}p[tt("0x4c")](g)}for(var b,C,w=[0,p[tt("0x2")]-1],I=0;I<w[tt("0x2")];I++)for(m=w[I],f=1;f<p[m][tt("0x2")];f++)b=p[m][f-1],C=p[m][f],0<=b&&0<=C&&o[tt("0x4c")](0,b,C);for(var _=[0,p[0][tt("0x2")]-1],A=0;A<_[tt("0x2")];A++)for(f=_[A],m=1;m<p[tt("0x2")];m++)b=p[m-1][f],C=p[m][f],0<=b&&0<=C&&o[tt("0x4c")](0,b,C);var G=new Float32Array(G),o=new Int32Array(o),s=new Float32Array(s),t={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:G}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:s})},n=$[tt("0x4e")][tt("0x4f")](G),a=new $[tt("0x50")]({attributes:t,indices:o,primitiveType:$[tt("0x51")][tt("0x52")],boundingSphere:n});return(0,$.Scene[tt("0x1f")])(a),G=[],o=[],a},V[tt("0x58")]=function(t){for(var e=t[tt("0x3d")],i=t[tt("0x3f")],n=t[tt("0x41")],a=t[tt("0x43")],t=(t[tt("0x46")]?-1:1)*t[tt("0x45")],r=new Float32Array(24),o=[],s=[],l=[0,t],c=[e,n],h=[i,a],d=0,x=0;x<2;x++)r[3*d]=-c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=-c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,r[3*++d]=c[x]/2,r[3*d+1]=-h[x]/2,r[3*d+2]=l[x],s[2*d]=x,s[2*d+1]=0,d++;o[tt("0x4c")](0,1,1,2),o[tt("0x4c")](2,3,3,0),o[tt("0x4c")](0,4),o[tt("0x4c")](1,5),o[tt("0x4c")](2,6),o[tt("0x4c")](3,7),o[tt("0x4c")](4,5,5,6),o[tt("0x4c")](6,7,7,4);o=new Int16Array(o),s=new Float32Array(s),t={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:r}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:s})},e=$[tt("0x4e")][tt("0x4f")](r),n=new $[tt("0x50")]({attributes:t,indices:o,primitiveType:$[tt("0x51")][tt("0x59")],boundingSphere:e}),r=[];return o=[],n},V[tt("0x5a")]=function(t){t[tt("0x3d")],t[tt("0x3f")];var e=t[tt("0x41")],i=t[tt("0x43")],n=(t[tt("0x46")]?-1:1)*t[tt("0x45")],r=[],o=[],s=e/2,l=i/2,c=0;(w=[])[tt("0x4c")](0,0,0),o[tt("0x4c")](1,1),c++;for(var h=[],d=-16;d<16;d++){for(var x=[],u=-16;u<16;u++){x[tt("0x4c")](c);var p=l*d/16,m=s*u/16;w[tt("0x4c")](m,p,n),o[tt("0x4c")](1,1),c++}h[tt("0x4c")](x)}for(var g,f,v=[0,h[tt("0x2")]-1],y=0;y<v[tt("0x2")];y++)for(d=v[y],u=1;u<h[d][tt("0x2")];u++)g=h[d][u-1],f=h[d][u],r[tt("0x4c")](0,g,f);for(var b=[0,h[0][tt("0x2")]-1],C=0;C<b[tt("0x2")];C++)for(u=b[C],d=1;d<h[tt("0x2")];d++)g=h[d-1][u],f=h[d][u],r[tt("0x4c")](0,g,f);var w=new Float32Array(w),r=new Int16Array(r),o=new Float32Array(o),t={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:w}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:o})},e=$[tt("0x4e")][tt("0x4f")](w),i=new $[tt("0x50")]({attributes:t,indices:r,primitiveType:$[tt("0x51")][tt("0x52")],boundingSphere:e});return(0,a[tt("0x1f")])(i),$[tt("0x53")][tt("0x5b")](i),w=[],r=[],i},V[tt("0x5c")]=function(t,e,i,n){var a={length:i,zReverse:n,bottomHeight:i,bottomWidth:i,topHeight:i,topWidth:i};return t=$[tt("0x5d")][tt("0x5e")](t),e=$[tt("0x5d")][tt("0x5e")](e),n?(a[tt("0x40")]=0,a[tt("0x3e")]=0,a[tt("0x44")]=i*Math[tt("0x5f")](t),a[tt("0x42")]=i*Math[tt("0x5f")](e)):(a[tt("0x44")]=0,a[tt("0x42")]=0,a[tt("0x40")]=i*Math[tt("0x5f")](t),a[tt("0x3e")]=i*Math[tt("0x5f")](e)),new V(a)},$.Scene[tt("0x4a")]=V,$[tt("0x60")]||(Object[tt("0x1d")]($.Scene,tt("0x1e"),{value:!0}),$.Scene[tt("0x60")]=void 0,G=new $[tt("0x63")],_=new $[tt("0x9")],A=new $[tt("0x18")],Z[tt("0x4b")]=function(t){var e=t[tt("0x2")],i=t[tt("0x61")],n=t[tt("0x62")],a=t[tt("0x49")],r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t[tt("0x47")]?-e:e],x=0,t=Math[tt("0x64")](n-i,e),u=G;u.z=Math[tt("0x65")](t);for(var p=Math[tt("0x66")](t),m=0;m<d[tt("0x2")];m++){c[m]=[];for(var g=h[m],f=0;f<a;f++){c[m][tt("0x4c")](x++);var v=r*f,y=g*Math[tt("0x66")](v),b=g*Math[tt("0x65")](v);o[tt("0x4c")](y,b,d[m]),y=p*Math[tt("0x66")](v),b=p*Math[tt("0x65")](v),s[tt("0x4c")](y,b,u.z),l[tt("0x4c")](m/(d[tt("0x2")]-1),0)}}for(var C=[],m=1;m<d[tt("0x2")];m++)for(f=1;f<a;f++){var w=c[m-1][f-1],I=c[m][f-1],_=c[m][f],A=c[m-1][f];C[tt("0x4c")](_),C[tt("0x4c")](A),C[tt("0x4c")](w),C[tt("0x4c")](_),C[tt("0x4c")](w),C[tt("0x4c")](I),f==c[m][tt("0x2")]-1&&(w=c[m-1][f],I=c[m][f],_=c[m][0],A=c[m-1][0],C[tt("0x4c")](_),C[tt("0x4c")](A),C[tt("0x4c")](w),C[tt("0x4c")](_),C[tt("0x4c")](w),C[tt("0x4c")](I))}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:o}),normal:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:3,values:s}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:l})},i=$[tt("0x4e")][tt("0x4f")](o),e=new $[tt("0x50")]({attributes:n,indices:C,primitiveType:$[tt("0x51")][tt("0x52")],boundingSphere:i});return o=[],C=[],l=[],e},Z[tt("0x55")]=function(t,e){if(!e)return Z[tt("0x4b")](t);$[tt("0x11")][tt("0x12")](e,$[tt("0x9")][tt("0x56")],_),_[tt("0x57")](A[tt("0x13")]);var i=t[tt("0x2")],n=t[tt("0x61")],a=(t[tt("0x62")],t[tt("0x49")]),r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[0,t[tt("0x47")]?-i:i],d=0,d=0;o[tt("0x4c")](0,0,0),s[tt("0x4c")](1,1),d++;for(var x=new $[tt("0x9")],u=n/15,p=0;p<16;p++){for(var m=u*p,g=[],f=0;f<a;f++){var v=r*f,y=m*Math[tt("0x66")](v),v=m*Math[tt("0x65")](v);x.x=y,x.y=v,x.z=h[1],(0,$[tt("0x20")])(x,e,A)?(g[tt("0x4c")](d),o[tt("0x4c")](y,v,h[1]),s[tt("0x4c")](p/15,1),d++):g[tt("0x4c")](-1)}c[tt("0x4c")](g)}for(var b,C,w=[0,c[tt("0x2")]-1],I=0;I<w[tt("0x2")];I++)for(p=w[I],f=1;f<c[p][tt("0x2")];f++)b=c[p][f-1],C=c[p][f],0<=b&&0<=C&&l[tt("0x4c")](0,b,C);o=new Float32Array(o),l=new Int32Array(l),s=new Float32Array(s),t={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:o}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:s})},i=$[tt("0x4e")][tt("0x4f")](o),n=new $[tt("0x50")]({attributes:t,indices:l,primitiveType:$[tt("0x51")][tt("0x52")],boundingSphere:i});return(0,$.Scene[tt("0x1f")])(n),o=[],l=[],n},Z[tt("0x58")]=function(t){var e=t[tt("0x2")],i=t[tt("0x61")],n=t[tt("0x62")],a=t[tt("0x49")],r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t[tt("0x47")]?-e:e],x=0,t=Math[tt("0x64")](n-i,e),u=G;u.z=Math[tt("0x65")](t);for(var p=Math[tt("0x66")](t),m=0;m<d[tt("0x2")];m++){c[m]=[];for(var g=h[m],f=0;f<a;f++){c[m][tt("0x4c")](x++);var v=r*f,y=g*Math[tt("0x66")](v),b=g*Math[tt("0x65")](v);o[tt("0x4c")](y,b,d[m]),y=p*Math[tt("0x66")](v),b=p*Math[tt("0x65")](v),s[tt("0x4c")](y,b,u.z),l[tt("0x4c")](m/(d[tt("0x2")]-1),0)}}for(var C=[],m=1;m<d[tt("0x2")];m++)for(f=1;f<a;f+=1){var w=c[m-1][f-1],I=c[m][f-1];c[m][f],c[m-1][f],f%8==1&&C[tt("0x4c")](w,I)}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:o}),normal:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:3,values:s}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:l})},i=$[tt("0x4e")][tt("0x4f")](o),e=new $[tt("0x50")]({attributes:n,indices:C,primitiveType:$[tt("0x51")][tt("0x59")],boundingSphere:i});return o=[],C=[],l=[],e},Z[tt("0x67")]=function(t,e,i){return t=$[tt("0x5d")][tt("0x5e")](t),new Z({topRadius:Math[tt("0x5f")](t)*e/2,bottomRadius:0,length:e,zReverse:i})},$.Scene[tt("0x60")]=Z),typeof T===tt("0x68")||$[tt("0x69")]||($.Scene[tt("0x69")]=void 0,m=new $[tt("0x11")],g=new $[tt("0x9")],v=new $[tt("0x9")],y=new $[tt("0x18")],b=new $[tt("0x1b")],M[tt("0x6e")]={Cone:1,FourPrism:2},Object[tt("0xa3")](M[tt("0xa4")],{color:{get:function(){return this[tt("0x81")]},set:function(t){this[tt("0x81")]=t}},lineColor:{get:function(){return this[tt("0x85")]},set:function(t){this[tt("0x85")]=t}},trackedEntity:{get:function(){return this[tt("0x97")]},set:function(t){t!=this[tt("0x97")]&&(this[tt("0x3")]=t[tt("0x3")]),this[tt("0x97")]=t}},show:{get:function(){return this[tt("0x78")]},set:function(t){this[tt("0x78")]=t}},outline:{get:function(){return this[tt("0x7b")]},set:function(t){this[tt("0x7b")]=t}},angle1:{get:function(){return this[tt("0x70")]},set:function(t){this[tt("0x70")]=t,this[tt("0xa5")](),this[tt("0x6b")]=null}},angle2:{get:function(){return this[tt("0x72")]},set:function(t){this[tt("0x72")]=t,this[tt("0xa5")](),this[tt("0x6b")]=null}},areaType:{get:function(){return this[tt("0x6c")]},set:function(t){this[tt("0x6c")]=t,this[tt("0xa5")](),this[tt("0x6b")]=null}},rotation:{get:function(){return this[tt("0x76")]},set:function(t){this[tt("0x76")]=t,this[tt("0xa5")](),this[tt("0x6b")]=null}},heading:{get:function(){return this[tt("0x76")][tt("0xa6")]},set:function(t){this[tt("0x76")][tt("0xa6")]=t,this[tt("0xa5")](),this[tt("0x6b")]=null}},pitch:{get:function(){return this[tt("0x76")][tt("0xa7")]},set:function(t){this[tt("0x76")][tt("0xa7")]=t,this[tt("0xa5")](),this[tt("0x6b")]=null}},roll:{get:function(){return this[tt("0x76")][tt("0xa8")]},set:function(t){this[tt("0x76")][tt("0xa8")]=t,this[tt("0xa5")](),this[tt("0x6b")]=null}},position:{get:function(){return this[tt("0x74")]},set:function(t){this[tt("0x74")]=t,this[tt("0x6b")]=null,this[tt("0x94")]=[]}}}),M[tt("0xa4")][tt("0x9f")]=function(t){var e,i;t&&!this[tt("0xa9")]&&(e=this,i=new $[tt("0xaa")],this[tt("0xa9")]=this[tt("0x9c")][tt("0xab")][tt("0x9e")]({polygon:{show:this[tt("0x7d")],material:this[tt("0x87")]||this[tt("0x81")],hierarchy:new $[tt("0xac")](function(t){return i[tt("0xad")]=e[tt("0x96")],i},!1)},polyline:{show:this[tt("0x7f")],material:this[tt("0x89")]||this[tt("0x87")]||this[tt("0x81")],width:1.5,positions:new $[tt("0xac")](function(t){return e[tt("0x96")]},!1)}}))},M[tt("0xa4")][tt("0xa5")]=function(){this[tt("0x94")][tt("0xae")](function(t){t[tt("0xaf")][tt("0xb0")]()}),this[tt("0x94")]=[]},M[tt("0xa4")][tt("0xb1")]=function(t,e){if(!t||!t[tt("0x2")])throw new Error(tt("0xb2"));for(var i=[],n=!1,a=!1,r=t[0][tt("0xb3")],o=0;o<t[tt("0x2")];o++){if(i[o]=function(t){var e,i=[];for(e in t[tt("0x1")])t[tt("0x1")][tt("0xa0")](e)&&t[tt("0x1")][e]&&i[tt("0x4c")](e);return i}(t[o]),0<o){if(r!=t[o][tt("0xb3")]){a=!0;break}var s=i[o-1];if(!(n=s[tt("0x2")]!=i[o][tt("0x2")]))for(var l=0;l<s[tt("0x2")];l++)if(s[l]!=i[o][l]){n=!0;break}}if(r=t[o][tt("0xb3")],n||a)break}if(a)throw new Error(tt("0xb4"));if(n)throw new Error(tt("0xb5"));for(var c={},h=i[0],o=0;o<h[tt("0x2")];o++){var d,x=h[o],u=t[0];for(d in c[x]={},u[tt("0x1")][x])u[tt("0x1")][x][tt("0xa0")](d)&&(c[x][d]=u[tt("0x1")][x][d]);for(var p=Array[tt("0xb6")](c[x][tt("0x4")]),l=1;l<t[tt("0x2")];l++)for(var u=t[l],m=0;m<u[tt("0x1")][x][tt("0x4")][tt("0x2")];m++)p[tt("0x4c")](u[tt("0x1")][x][tt("0x4")][m]);c[x][tt("0x4")]=new c[x][tt("0x4")][tt("0xb7")](p)}var g=[],f=0;for(l=0;l<t[tt("0x2")];l++){for(u=t[0],o=0;o<u[tt("0x0")][tt("0x2")];o++)g[tt("0x4c")](u[tt("0x0")][o]+f);f+=u[tt("0x1")][tt("0x3")][tt("0x4")][tt("0x2")]/3}var v=$[tt("0x4e")][tt("0x4f")](c[tt("0x3")][tt("0x4")]);return new $[tt("0x50")]({attributes:c,indices:new Int32Array(g),primitiveType:t[0][tt("0xb3")],boundingSphere:v})},M[tt("0xa4")][tt("0xb8")]=function(t){if(this[tt("0x9b")][tt("0xb9")]){var e=this[tt("0x9b")][tt("0xb9")][tt("0x2")]!=this[tt("0x95")][tt("0x2")];if(!e)for(var i=0;i<this[tt("0x9b")][tt("0xb9")][tt("0x2")];i++)if(!this[tt("0x9b")][tt("0xb9")][i][tt("0xba")](this[tt("0x95")][i])){e=!0;break}if(!e)return}if(this[tt("0x9b")][tt("0xb9")]&&this[tt("0x9b")][tt("0xb9")][tt("0x2")]==this[tt("0x95")][tt("0x2")])for(i=0;i<this[tt("0x95")][tt("0x2")];i++)this[tt("0x95")][i][tt("0x57")](this[tt("0x9b")][tt("0xb9")][i]);else for(this[tt("0x9b")][tt("0xb9")]=[],i=0;i<this[tt("0x95")][tt("0x2")];i++)this[tt("0x9b")][tt("0xb9")][tt("0x4c")](this[tt("0x95")][i][tt("0x57")]());t=this[tt("0xbb")](t);if(this[tt("0x9a")][tt("0x4c")](t),this[tt("0x9b")][tt("0xbc")]){var n=this[tt("0x9b")][tt("0xbc")][tt("0x1")];for(i in n)n[tt("0xa0")](i)&&delete n[i];for(i in this[tt("0x9b")][tt("0xbc")])this[tt("0x9b")][tt("0xbc")][tt("0xa0")](i)&&delete this[tt("0x9b")][tt("0xbc")][i]}this[tt("0x9b")][tt("0xbc")]=this[tt("0xb1")](this[tt("0x9a")]),this[tt("0x9b")][tt("0xd")]=!0},C=new $[tt("0x29")],M[tt("0xa4")][tt("0xbd")]=function(t,e){return this[tt("0x93")]||(this[tt("0x93")]=new $[tt("0x9")]),this[tt("0x3")]instanceof $[tt("0x9")]?this[tt("0x93")]=this[tt("0x3")]:tt("0xbe")==typeof this[tt("0x3")][tt("0xbf")]?this[tt("0x93")]=this[tt("0x3")][tt("0xbf")](t):this[tt("0x3")][tt("0xc0")]&&this[tt("0x3")][tt("0xc0")]instanceof $[tt("0x9")]&&(this[tt("0x93")]=this[tt("0x3")][tt("0xc0")]),this[tt("0x93")]&&(this[tt("0x8b")]=$[tt("0x24")][tt("0x25")](this[tt("0x93")],d,this[tt("0x8b")]),this[tt("0x92")]=$[tt("0x1b")][tt("0x1c")](this[tt("0x93")],d,this[tt("0x92")]),$[tt("0x24")][tt("0x25")](this[tt("0x93")],d,this[tt("0x8b")]),this[tt("0x75")]&&this[tt("0x97")]&&this[tt("0x97")][tt("0xc1")]&&(t=$[tt("0xc2")][tt("0xc3")](this[tt("0x97")][tt("0xc1")],t,C),t=$[tt("0x11")][tt("0x2c")](this[tt("0x93")],t),this[tt("0x76")][tt("0xa6")]=t[tt("0xa6")]),$[tt("0x29")][tt("0xc4")](this[tt("0x76")],this[tt("0x8d")]),this[tt("0x90")]=$[tt("0x11")][tt("0xc5")](this[tt("0x8e")],this[tt("0x8d")],this[tt("0x8f")],this[tt("0x90")]),$[tt("0x11")][tt("0xc6")](this[tt("0x8b")],this[tt("0x90")],this[tt("0x90")]),$[tt("0x11")][tt("0xc7")](this[tt("0x90")],this[tt("0x91")])),this[tt("0x90")]},M[tt("0xa4")][tt("0xc8")]=function(t,e){var i=this[tt("0x95")];if(e){if(this[tt("0xbd")](e),!this[tt("0x93")])return;i=S(this[tt("0xc9")],this[tt("0x90")],3,this[tt("0xc9")][tt("0x2")]-3,d,null,this[tt("0x6b")][tt("0x1")][tt("0x3")][tt("0x4")])}for(var n=[],a=0;a<i[tt("0x2")];a++){var r=i[a],r=($[tt("0x1b")][tt("0x1c")](r,void 0,b),[$[tt("0x5d")][tt("0xca")](b[tt("0xcb")]),$[tt("0x5d")][tt("0xca")](b[tt("0xcc")])]);t&&(r[0]=parseFloat(r[0][tt("0xcd")](t)),r[1]=parseFloat(r[1][tt("0xcd")](t))),n[tt("0x4c")](T[tt("0xce")](r))}var o,e=[];return e=0<n[tt("0x2")]&&(n=T[tt("0xcf")](n),o=T[tt("0xd0")](n))&&(o=T[tt("0xd1")](o))&&0<o[tt("0x2")]?o[0]:e},M[tt("0xa4")][tt("0xbb")]=function(t){for(var e=[],i=[],n=0,a=0;a<this[tt("0x95")][tt("0x2")];a+=2){var r=this[tt("0x95")][0];e[tt("0x4c")](r.x,r.y,r.z),i[tt("0x4c")](n++)}return e=new Float32Array(e),i=new Int32Array(i),new $[tt("0x50")]({attributes:{position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:e})},primitiveType:$[tt("0x51")][tt("0x59")],indices:i,boundingSphere:$[tt("0x4e")][tt("0x4f")](e)})},M[tt("0xa4")][tt("0xd2")]=function(){this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0xd2")](this),this[tt("0xa9")]&&this[tt("0x9c")][tt("0xab")][tt("0xd2")](this[tt("0xa9")])},M[tt("0xa4")][tt("0xb0")]=function(t){if(t){for(var e in this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0xd2")](this),this[tt("0xa9")]&&this[tt("0x9c")][tt("0xab")][tt("0xd2")](this[tt("0xa9")]),this[tt("0x94")][tt("0xae")](function(t){t[tt("0xaf")]=t[tt("0xaf")]&&t[tt("0xaf")][tt("0xb0")]()}),this[tt("0x94")]=[],this[tt("0xd3")][tt("0x1")])this[tt("0xd3")][tt("0x1")][tt("0xa0")](e)&&delete this[tt("0xd3")][tt("0x1")][e];for(var e in this[tt("0x6b")][tt("0x1")])this[tt("0x6b")][tt("0x1")][tt("0xa0")](e)&&delete this[tt("0x6b")][tt("0x1")][e];delete this[tt("0xd3")],delete this[tt("0x6b")],delete this[tt("0x93")],delete this[tt("0x74")],this[tt("0x95")]=[]}},M[tt("0xa4")][tt("0xd4")]=function(){this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0x9e")](this),this[tt("0xa9")]&&this[tt("0x9c")][tt("0xab")][tt("0x9e")](this[tt("0xa9")])},M[tt("0xa4")][tt("0xd5")]=function(){this[tt("0x6c")]==M[tt("0x6e")][tt("0xd6")]?(this[tt("0x6b")]=$[tt("0xd7")][tt("0x55")]($[tt("0xd7")][tt("0x67")](this[tt("0x70")],this[tt("0x45")],!0),this[tt("0x90")]),this[tt("0xd3")]=$[tt("0xd7")][tt("0x58")]($[tt("0xd7")][tt("0x67")](this[tt("0x70")],this[tt("0x45")],!0))):(this[tt("0x6b")]=$.Scene[tt("0x4a")][tt("0x55")]($.Scene[tt("0x4a")][tt("0x5c")](this[tt("0x70")],this[tt("0x72")],this[tt("0x45")],!0),this[tt("0x90")]),this[tt("0xd3")]=$.Scene[tt("0x4a")][tt("0x58")]($.Scene[tt("0x4a")][tt("0x5c")](this[tt("0x70")],this[tt("0x72")],this[tt("0x45")],!0))),this[tt("0xc9")]=new Float32Array(this[tt("0x6b")][tt("0x1")][tt("0x3")][tt("0x4")][tt("0x2")]);for(var t=0;t<this[tt("0xc9")][tt("0x2")];t++)this[tt("0xc9")][t]=this[tt("0x6b")][tt("0x1")][tt("0x3")][tt("0x4")][t];this[tt("0x95")]=[]},M[tt("0xa4")][tt("0xd8")]=function(){var t=1+this[tt("0x96")][tt("0x2")],e=new Float32Array(3+3*this[tt("0x96")][tt("0x2")]),i=0;e[i++]=this[tt("0x93")].x,e[i++]=this[tt("0x93")].y,e[i++]=this[tt("0x93")].z;for(var n=0;n<this[tt("0x96")][tt("0x2")];n++)e[i++]=this[tt("0x96")][n].x,e[i++]=this[tt("0x96")][n].y,e[i++]=this[tt("0x96")][n].z;for(var a=[],r=[],n=1;n<t-1;n++)a[tt("0x4c")](0,n,n+1),r[tt("0x4c")](0,n);var a=new(65535<=t?Uint32Array:Uint16Array)(a),o={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:e})},s=$[tt("0x4e")][tt("0x4f")](e),l=new $[tt("0x50")]({attributes:o,indices:a,primitiveType:$[tt("0x51")][tt("0x52")],boundingSphere:s}),o=new $[tt("0x50")]({attributes:o,indices:new Uint32Array(r),primitiveType:$[tt("0x51")][tt("0x59")],boundingSphere:s});(0,$.Scene[tt("0x1f")])(l),this[tt("0xd9")]=l,this[tt("0xda")]=o},M[tt("0xa4")][tt("0xdb")]=function(t){if(this[tt("0x78")]&&(this[tt("0xbd")](t[tt("0xdc")]),this[tt("0x93")])){this[tt("0x6b")]||this[tt("0xd5")](),this[tt("0x95")]=S(this[tt("0xc9")],this[tt("0x90")],3,this[tt("0xc9")][tt("0x2")]-3,d,this[tt("0x95")],this[tt("0x6b")][tt("0x1")][tt("0x3")][tt("0x4")]),this[tt("0x96")][tt("0xdd")](0,this[tt("0x96")][tt("0x2")]);var e=this[tt("0xc8")]();if(e&&e[tt("0x2")]){for(var i=0;i<e[tt("0x2")];i++){var n=e[i];this[tt("0x96")][tt("0x4c")]($[tt("0x9")][tt("0xde")](n[0],n[1]))}t[tt("0x34")]===$[tt("0x35")][tt("0x36")]?(this[tt("0xd8")](),this[tt("0xd9")]&&(this[tt("0xdf")]&&(this[tt("0xdf")][tt("0xaf")]=this[tt("0xdf")][tt("0xaf")]&&this[tt("0xdf")][tt("0xaf")][tt("0xb0")](),this[tt("0xdf")]=null),this[tt("0xdf")]=this[tt("0xe0")](this[tt("0xd9")],t,$[tt("0x11")][tt("0x8c")][tt("0x57")]()),t[tt("0xe1")][tt("0x4c")](this[tt("0xdf")]),this[tt("0x7b")])&&(this[tt("0xe2")]&&(this[tt("0xe2")][tt("0xaf")]=this[tt("0xe2")][tt("0xaf")]&&this[tt("0xe2")][tt("0xaf")][tt("0xb0")](),this[tt("0xe2")]=null),this[tt("0xe2")]=this[tt("0xe0")](this[tt("0xda")],t,$[tt("0x11")][tt("0x8c")][tt("0x57")]()),t[tt("0xe1")][tt("0x4c")](this[tt("0xe2")])),this[tt("0xa9")]&&(this[tt("0xa9")][tt("0xe3")][tt("0x7a")]=this[tt("0x7d")]&&this[tt("0x78")],this[tt("0xa9")][tt("0xe4")][tt("0x7a")]=this[tt("0x7f")]&&this[tt("0x78")])):(this[tt("0xa9")]||this[tt("0x9f")](!0),this[tt("0xa9")][tt("0xe3")][tt("0x7a")]=!0)}else this[tt("0x7b")]&&(this[tt("0xd3")][tt("0xe5")]||(this[tt("0xd3")][tt("0xe5")]=this[tt("0xe0")](this[tt("0xd3")],t)),t[tt("0xe1")][tt("0x4c")](this[tt("0xd3")][tt("0xe5")])),this[tt("0xa9")]&&(this[tt("0xa9")][tt("0xe3")][tt("0x7a")]=!1,this[tt("0xa9")][tt("0xe4")][tt("0x7a")]=!1)}},M[tt("0xa4")][tt("0xe6")]=function(t){return tt("0xe7")},M[tt("0xa4")][tt("0xe8")]=function(t){return tt("0xe9")},M[tt("0xa4")][tt("0xe0")]=function(t,e,i){var n=e[tt("0xea")],a=new $[tt("0x9")],a=($[tt("0x11")][tt("0x12")](this[tt("0x90")],t[tt("0xeb")][tt("0xec")],a),new $[tt("0x4e")](a,t[tt("0xeb")][tt("0xed")]),new $[tt("0xee")]({modelMatrix:i||this[tt("0x90")],owner:this,primitiveType:t[tt("0xb3")],pass:$[tt("0xef")][tt("0xf0")]})),r=this,i=$[tt("0x53")][tt("0xf1")](t);return a[tt("0xaf")]=$[tt("0xf2")][tt("0xf3")]({context:n,geometry:t,attributeLocations:i,bufferUsage:$[tt("0xf4")][tt("0xf5")]}),a[tt("0xaf")][tt("0xf6")]=i,a[tt("0xf7")]=$[tt("0xf8")][tt("0xf9")]({context:n,vertexShaderSource:this[tt("0xe8")](t),fragmentShaderSource:this[tt("0xe6")](t),attributeLocations:i}),a[tt("0xfa")]=$[tt("0xfb")][tt("0xfc")]({blending:$[tt("0xfd")][tt("0xfe")],depthTest:{enabled:!0,func:$[tt("0xff")][tt("0x100")]},cull:{enabled:!1,face:$[tt("0x101")][tt("0x102")]},depthMask:!1}),a[tt("0x103")]={},a[tt("0x103")][tt("0x104")]=function(){return e[tt("0xea")][tt("0x105")][tt("0x106")]},a[tt("0x103")][tt("0x107")]=function(){return e[tt("0xea")][tt("0x105")][tt("0x108")]},a[tt("0x103")][tt("0x109")]=function(){return r[tt("0x109")]||(r[tt("0x109")]=0),r[tt("0x109")]},a[tt("0x103")][tt("0x10a")]=function(){return r[tt("0x10a")]||(r[tt("0x10a")]=new $[tt("0x9")](.2,.2,.2)),r[tt("0x10a")]},a[tt("0x103")][tt("0x10b")]=function(){return r[tt("0x10b")]||(r[tt("0x10b")]=0),r[tt("0x10b")]},a[tt("0x103")][tt("0x10c")]=function(){return t[tt("0xb3")]==$[tt("0x51")][tt("0x59")]},a[tt("0x103")][tt("0x81")]=function(){return t[tt("0x82")]?t[tt("0x82")]:t[tt("0xb3")]==$[tt("0x51")][tt("0x59")]?r[tt("0x85")]||r[tt("0x81")]||new $[tt("0x83")](1,1,0,.5):r[tt("0x81")]||new $[tt("0x83")](1,0,0,1)},a[tt("0x103")][tt("0x10d")]=function(){return r[tt("0x10d")]||(r[tt("0x10d")]=0),r[tt("0x10d")]},a[tt("0x103")][tt("0x10e")]=function(){return r[tt("0x10e")]||(r[tt("0x10e")]=new $[tt("0x83")](1,1,0,1)),r[tt("0x10e")]},a[tt("0x103")][tt("0x10f")]=function(){return e[tt("0xea")][tt("0x105")][tt("0x5")]},a[tt("0x103")][tt("0x110")]=function(){return.25},a},$.Scene[tt("0x111")]=S,$.Scene[tt("0x69")]=M),$[tt("0x112")]||($.Scene[tt("0x112")]=void 0,Object[tt("0xa3")](i[tt("0xa4")],{trackedEntity:{get:function(){return this[tt("0x97")]},set:function(t){this[tt("0x97")]=t}},color:{get:function(){return this[tt("0x81")]},set:function(t){this[tt("0x81")]=t}},lineColor:{get:function(){return this[tt("0x85")]},set:function(t){this[tt("0x85")]=t}},show:{get:function(){return this[tt("0x78")]},set:function(t){this[tt("0x78")]=t}},outline:{get:function(){return this[tt("0x7b")]},set:function(t){this[tt("0x7b")]=t,this[tt("0xd5")]()}},top:{get:function(){return this[tt("0x116")]},set:function(t){this[tt("0x116")]=t,this[tt("0xd5")]()}},topOutline:{get:function(){return this[tt("0x118")]},set:function(t){this[tt("0x118")]=t,this[tt("0xd5")]()}},groundArea:{get:function(){return this[tt("0x7d")]},set:function(t){this[tt("0x7d")]=t,this[tt("0x9f")](this[tt("0x7d")])}},angle:{get:function(){return this[tt("0x113")]},set:function(t){this[tt("0x113")]=t,this[tt("0x11a")](),this[tt("0xd5")]()}},radius:{get:function(){return this[tt("0x115")]},set:function(t){this[tt("0x115")]=t,this[tt("0x11a")](),this[tt("0xd5")]()}},heading:{get:function(){return this[tt("0x76")][tt("0xa6")]},set:function(t){this[tt("0x76")][tt("0xa6")]=t}},pitch:{get:function(){return this[tt("0x76")][tt("0xa7")]},set:function(t){this[tt("0x76")][tt("0xa7")]=t}},roll:{get:function(){return this[tt("0x76")][tt("0xa8")]},set:function(t){this[tt("0x76")][tt("0xa8")]=t}},position:{get:function(){return this[tt("0x74")]},set:function(t){this[tt("0x74")]=t}}}),i[tt("0xa4")][tt("0x11a")]=function(){this[tt("0x11b")]=this[tt("0x115")]*Math[tt("0x66")]($[tt("0x5d")][tt("0x5e")](this[tt("0x113")]))},i[tt("0xa4")][tt("0x9f")]=function(t){var e;t&&!this[tt("0xa9")]&&((e=this)[tt("0x11a")](),this[tt("0xa9")]=viewer[tt("0xab")][tt("0x9e")]({position:this[tt("0x74")],ellipse:{show:0===this[tt("0x76")][tt("0xa7")]&&0===this[tt("0x76")][tt("0xa8")],semiMinorAxis:new $[tt("0xac")](function(t){return e[tt("0x11b")]},!1),semiMajorAxis:new $[tt("0xac")](function(t){return e[tt("0x11b")]},!1),material:this[tt("0x81")]},polyline:{show:this[tt("0x11c")]&&(0!==this[tt("0x76")][tt("0xa7")]||0!==this[tt("0x76")][tt("0xa8")]),positions:new $[tt("0xac")](function(t){return!e[tt("0x11c")]||$[tt("0x9")][tt("0x11d")](e[tt("0x74")],e[tt("0x11c")])>e[tt("0x115")]?[]:[e[tt("0x74")],e[tt("0x11c")]]},!1),followSurface:!1,material:new $[tt("0x11e")]({color:$[tt("0x83")][tt("0x11f")]}),width:1}}))},c=new $[tt("0x9")],i[tt("0xa4")][tt("0xbd")]=function(t,e){var i;return this[tt("0x93")]||(this[tt("0x93")]=new $[tt("0x9")]),this[tt("0x3")]instanceof $[tt("0x9")]?this[tt("0x93")]=this[tt("0x3")]:tt("0xbe")==typeof this[tt("0x3")][tt("0xbf")]?this[tt("0x93")]=this[tt("0x3")][tt("0xbf")](t):this[tt("0x3")][tt("0xc0")]&&this[tt("0x3")][tt("0xc0")]instanceof $[tt("0x9")]&&(this[tt("0x93")]=this[tt("0x3")][tt("0xc0")]),this[tt("0x97")]&&this[tt("0x97")][tt("0x3")]&&(i=this[tt("0x93")],t=$[tt("0xc2")][tt("0xc3")](this[tt("0x97")][tt("0x3")],t,c))&&(this[tt("0x11c")]=t,i=mars3d[tt("0x120")][tt("0x121")](i,t,n),this[tt("0x76")][tt("0xa6")]=i[tt("0xa6")],this[tt("0x76")][tt("0xa7")]=i[tt("0xa7")],this[tt("0x76")][tt("0xa8")]=i[tt("0xa8")]),this[tt("0x8b")]=$[tt("0x24")][tt("0x25")](this[tt("0x93")],n,this[tt("0x8b")]),this[tt("0x92")]=$[tt("0x1b")][tt("0x1c")](this[tt("0x93")],n,this[tt("0x92")]),$[tt("0x24")][tt("0x25")](this[tt("0x93")],n,this[tt("0x8b")]),$[tt("0x29")][tt("0xc4")](this[tt("0x76")],this[tt("0x8d")]),this[tt("0x90")]=$[tt("0x11")][tt("0xc5")](this[tt("0x8e")],this[tt("0x8d")],this[tt("0x8f")],this[tt("0x90")]),$[tt("0x11")][tt("0xc6")](this[tt("0x8b")],this[tt("0x90")],this[tt("0x90")]),$[tt("0x11")][tt("0xc7")](this[tt("0x90")],this[tt("0x91")]),this[tt("0x90")]},i[tt("0xa4")][tt("0x122")]=function(){for(var t=this[tt("0xed")],e=[],i=[],n=[],a=[],r=90-parseInt(this[tt("0x114")]),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this[tt("0x114")];c<91;c+=o){for(var h=$[tt("0x5d")][tt("0x5e")](c<90?c:90),h=Math[tt("0x66")](h)*t,d=[],x=0;x<128;x++){var u=s*x,p=h*Math[tt("0x66")](u),u=h*Math[tt("0x65")](u),m=Math[tt("0xe")](t*t-p*p-u*u);e[tt("0x4c")](p,u,m),i[tt("0x4c")](1,1),d[tt("0x4c")](l++)}a[tt("0x4c")](d)}for(c=1;c<a[tt("0x2")];c++)for(x=1;x<a[c][tt("0x2")];x++){var g=a[c-1][x-1],f=a[c][x-1],v=a[c][x],y=a[c-1][x];n[tt("0x4c")](g,f,v),n[tt("0x4c")](g,v,y)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:e}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:i})},b=$[tt("0x4e")][tt("0x4f")](e),r=new $[tt("0x50")]({attributes:r,indices:n,primitiveType:$[tt("0x51")][tt("0x52")],boundingSphere:b});return(0,$.Scene[tt("0x1f")])(r),r},i[tt("0xa4")][tt("0x123")]=function(){for(var t=this[tt("0xed")],e=[],i=[],n=[],a=[],r=90-parseInt(this[tt("0x114")]),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this[tt("0x114")];c<91;c+=o){for(var h=$[tt("0x5d")][tt("0x5e")](c<90?c:90),h=Math[tt("0x66")](h)*t,d=[],x=0;x<128;x++){var u=s*x,p=h*Math[tt("0x66")](u),u=h*Math[tt("0x65")](u),m=Math[tt("0xe")](t*t-p*p-u*u);e[tt("0x4c")](p,u,m),i[tt("0x4c")](1,1),d[tt("0x4c")](l++)}a[tt("0x4c")](d)}for(c=1;c<a[tt("0x2")];c++)for(x=1;x<a[c][tt("0x2")];x++){var g=a[c-1][x-1],f=a[c][x-1],v=a[c][x];a[c-1][x],x%8==1&&n[tt("0x4c")](g,f),c%8==1&&n[tt("0x4c")](f,v)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x4d")],componentsPerAttribute:3,values:e}),st:new $[tt("0x6")]({componentDatatype:$[tt("0x7")][tt("0x8")],componentsPerAttribute:2,values:i})},y=$[tt("0x4e")][tt("0x4f")](e),r=new $[tt("0x50")]({attributes:r,indices:n,primitiveType:$[tt("0x51")][tt("0x59")],boundingSphere:y});return(0,$.Scene[tt("0x1f")])(r),r},i[tt("0xa4")][tt("0xd5")]=function(){this[tt("0x6b")]=$.Scene[tt("0x60")][tt("0x55")](new $.Scene[tt("0x60")]({topRadius:this[tt("0x115")]*Math[tt("0x66")]($[tt("0x5d")][tt("0x5e")](this[tt("0x114")])),bottomRadius:0,length:this[tt("0x115")]*Math[tt("0x65")]($[tt("0x5d")][tt("0x5e")](this[tt("0x114")]))})),this[tt("0x124")]=this[tt("0x122")](),this[tt("0x125")]=this[tt("0x123")](),this[tt("0xd3")]=$.Scene[tt("0x60")][tt("0x58")](new $.Scene[tt("0x60")]({topRadius:this[tt("0x115")]*Math[tt("0x66")]($[tt("0x5d")][tt("0x5e")](this[tt("0x114")])),bottomRadius:0,slices:128,length:this[tt("0x115")]*Math[tt("0x65")]($[tt("0x5d")][tt("0x5e")](this[tt("0x114")]))})),this[tt("0xc9")]=new Float32Array(this[tt("0x6b")][tt("0x1")][tt("0x3")][tt("0x4")][tt("0x2")]);for(var t=0;t<this[tt("0xc9")][tt("0x2")];t++)this[tt("0xc9")][t]=this[tt("0x6b")][tt("0x1")][tt("0x3")][tt("0x4")][t];this[tt("0x94")]&&this[tt("0x94")][tt("0x2")]&&(this[tt("0x94")][tt("0xae")](function(t){t[tt("0xaf")]=t[tt("0xaf")]&&t[tt("0xaf")][tt("0xb0")]()}),this[tt("0x94")][tt("0xdd")](0,this[tt("0x94")][tt("0x2")]))},i[tt("0xa4")][tt("0xdb")]=function(e){this[tt("0x78")]&&(this[tt("0xbd")](e[tt("0xdc")]),e[tt("0x34")]===$[tt("0x35")][tt("0x36")]?(this[tt("0x6b")][tt("0xeb")]=$[tt("0x4e")][tt("0x4f")](this[tt("0x6b")][tt("0x1")][tt("0x3")][tt("0x4")]),this[tt("0x94")]&&this[tt("0x94")][tt("0x2")]||(this[tt("0x94")][tt("0x4c")](this[tt("0xe0")](this[tt("0x6b")],e)),this[tt("0x7b")]&&this[tt("0x94")][tt("0x4c")](this[tt("0xe0")](this[tt("0xd3")],e)),this[tt("0x116")]&&(this[tt("0x94")][tt("0x4c")](this[tt("0xe0")](this[tt("0x124")],e)),this[tt("0x118")])&&this[tt("0x94")][tt("0x4c")](this[tt("0xe0")](this[tt("0x125")],e))),this[tt("0x94")][tt("0xae")](function(t){e[tt("0xe1")][tt("0x4c")](t)}),this[tt("0xa9")]&&(this[tt("0xa9")][tt("0x126")][tt("0x7a")]=this[tt("0x7d")]&&0===this[tt("0x76")][tt("0xa7")]&&0===this[tt("0x76")][tt("0xa8")],this[tt("0xa9")][tt("0xe4")][tt("0x7a")]=!1)):(this[tt("0xa9")]||this[tt("0x9f")](!0),this[tt("0xa9")][tt("0x126")][tt("0x7a")]=0===this[tt("0x76")][tt("0xa7")]&&0===this[tt("0x76")][tt("0xa8")],this[tt("0xa9")][tt("0xe4")][tt("0x7a")]=this[tt("0x11c")]&&(0!==this[tt("0x76")][tt("0xa7")]||0!==this[tt("0x76")][tt("0xa8")])))},i[tt("0xa4")][tt("0xe6")]=function(t){return tt("0x127")},i[tt("0xa4")][tt("0xe8")]=function(t){return tt("0x128")},i[tt("0xa4")][tt("0xe0")]=function(t,e,i){var n=e[tt("0xea")],a=new $[tt("0x9")],a=($[tt("0x11")][tt("0x12")](this[tt("0x90")],t[tt("0xeb")][tt("0xec")],a),new $[tt("0x4e")](a,t[tt("0xeb")][tt("0xed")])),i=new $[tt("0xee")]({modelMatrix:i||this[tt("0x90")],owner:this,primitiveType:t[tt("0xb3")],pass:$[tt("0xef")][tt("0x129")],boundingVolume:a}),r=this,a=$[tt("0x53")][tt("0xf1")](t);return i[tt("0xaf")]=$[tt("0xf2")][tt("0xf3")]({context:n,geometry:t,attributeLocations:a,bufferUsage:$[tt("0xf4")][tt("0xf5")]}),i[tt("0xaf")][tt("0xf6")]=a,i[tt("0xf7")]=$[tt("0xf8")][tt("0xf9")]({context:n,vertexShaderSource:this[tt("0xe8")](t),fragmentShaderSource:this[tt("0xe6")](t),attributeLocations:a}),i[tt("0xfa")]=$[tt("0xfb")][tt("0xfc")]({blending:$[tt("0xfd")][tt("0xfe")],depthTest:{enabled:!0,func:$[tt("0xff")][tt("0x100")]},cull:{enabled:!1,face:$[tt("0x101")][tt("0x102")]}}),i[tt("0x103")]={},i[tt("0x103")][tt("0x104")]=function(){return e[tt("0xea")][tt("0x105")][tt("0x106")]},i[tt("0x103")][tt("0x107")]=function(){return e[tt("0xea")][tt("0x105")][tt("0x108")]},i[tt("0x103")][tt("0x109")]=function(){return r[tt("0x109")]||(r[tt("0x109")]=0),r[tt("0x109")]},i[tt("0x103")][tt("0x10a")]=function(){return r[tt("0x10a")]||(r[tt("0x10a")]=new $[tt("0x9")](.2,.2,.2)),r[tt("0x10a")]},i[tt("0x103")][tt("0x10b")]=function(){return r[tt("0x10b")]||(r[tt("0x10b")]=0),r[tt("0x10b")]},i[tt("0x103")][tt("0x10c")]=function(){return t[tt("0xb3")]==$[tt("0x51")][tt("0x59")]||t[tt("0xb3")]==$[tt("0x51")][tt("0x12a")]},i[tt("0x103")][tt("0x81")]=function(){return t[tt("0xb3")]==$[tt("0x51")][tt("0x59")]||t[tt("0xb3")]==$[tt("0x51")][tt("0x12a")]?(r[tt("0x85")]||(r[tt("0x85")]=new $[tt("0x83")](1,1,0,1)),r[tt("0x85")]):(r[tt("0x81")]||(r[tt("0x81")]=new $[tt("0x83")](1,0,0,1)),r[tt("0x81")])},i[tt("0x103")][tt("0x10d")]=function(){return r[tt("0x10d")]||(r[tt("0x10d")]=0),r[tt("0x10d")]},i[tt("0x103")][tt("0x10e")]=function(){return r[tt("0x10e")]||(r[tt("0x10e")]=new $[tt("0x83")](1,1,0,1)),r[tt("0x10e")]},i[tt("0x103")][tt("0x10f")]=function(){return e[tt("0xea")][tt("0x105")][tt("0x5")]},i[tt("0x103")][tt("0x110")]=function(){return.25},i},i[tt("0xa4")][tt("0xd2")]=function(){this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0xd2")](this),this[tt("0xa9")]&&this[tt("0x9c")][tt("0xab")][tt("0xd2")](this[tt("0xa9")])},i[tt("0xa4")][tt("0xd4")]=function(){this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0x9e")](this),this[tt("0xa9")]&&this[tt("0x9c")][tt("0xab")][tt("0x9e")](this[tt("0xa9")])},i[tt("0xa4")][tt("0xb0")]=function(t){t&&(this[tt("0x9c")][tt("0x6a")][tt("0x9d")][tt("0xd2")](this),this[tt("0xa9")]&&this[tt("0x9c")][tt("0xab")][tt("0xd2")](this[tt("0xa9")]),this[tt("0x94")][tt("0xae")](function(t){t[tt("0xaf")]=t[tt("0xaf")]&&t[tt("0xaf")][tt("0xb0")]()}),this[tt("0x94")]=[])},$.Scene[tt("0x112")]=i),e[tt("0xa4")][tt("0x241")]=function(t){var e=this[tt("0x23d")]*this[tt("0x23b")],i=this[tt("0x23e")]*this[tt("0x23c")],n=r(this[tt("0x237")],this[tt("0x238")],this[tt("0x239")],this[tt("0x23a")],e,i,this[tt("0x242")]),a=r(this[tt("0x237")],this[tt("0x238")],this[tt("0x239")],this[tt("0x23a")],e,i,this[tt("0x242")]),e=s(e,i),i=l(this[tt("0x23b")],this[tt("0x23c")],this[tt("0x23d")],this[tt("0x23e")]);return this[tt("0x243")](t,n,a,e,i)},e[tt("0xa4")][tt("0x244")]=function(t){var e=this[tt("0x23d")]*this[tt("0x23b")],i=this[tt("0x23e")]*this[tt("0x23c")],n=r(this[tt("0x237")],this[tt("0x238")],this[tt("0x239")],this[tt("0x23a")],e,i,this[tt("0x245")]),a=r(this[tt("0x237")],this[tt("0x238")],this[tt("0x239")],this[tt("0x23a")],e,i,this[tt("0x245")]),e=s(e,i),i=l(this[tt("0x23b")],this[tt("0x23c")],this[tt("0x23d")],this[tt("0x23e")]);return this[tt("0x243")](t,n,a,e,i)},e[tt("0xa4")][tt("0x246")]=function(t){var e=this[tt("0x23e")]*this[tt("0x23c")],i=o(this[tt("0x237")],this[tt("0x239")],this[tt("0x23a")],10,e,this[tt("0x245")],this[tt("0x242")]),n=o(this[tt("0x237")],this[tt("0x239")],this[tt("0x23a")],10,e,this[tt("0x245")],this[tt("0x242")]),e=s(10,e),a=l(10,this[tt("0x23c")],1,this[tt("0x23e")]);return this[tt("0x243")](t,i,n,e,a)},e[tt("0xa4")][tt("0x247")]=function(t){var e=this[tt("0x23e")]*this[tt("0x23c")],i=o(this[tt("0x238")],this[tt("0x239")],this[tt("0x23a")],10,e,this[tt("0x245")],this[tt("0x242")]),n=o(this[tt("0x238")],this[tt("0x239")],this[tt("0x23a")],10,e,this[tt("0x245")],this[tt("0x242")]),e=s(10,e),a=l(10,this[tt("0x23c")],1,this[tt("0x23e")]);return this[tt("0x243")](t,i,n,e,a)},e[tt("0xa4")][tt("0x243")]=function(t,e,i,n,a){var r=this,o=$[tt("0x248")][tt("0x249")](!0,!1,void 0),o=$[tt("0xfb")][tt("0xfc")](o),s=new $[tt("0x136")]({sources:[tt("0x24a")]}),l=new $[tt("0x136")]({sources:[tt("0x24b")]}),c={xbsjColor:function(){return r[tt("0x236")]}},h={xbsjColor:function(){return r[tt("0x86")]}},s=$[tt("0xf8")][tt("0xfc")]({context:t,vertexShaderSource:s,fragmentShaderSource:l,attributeLocations:{position:0,normal:1}}),l=$[tt("0x135")][tt("0x190")]({context:t,typedArray:e,usage:$[tt("0xf4")][tt("0xf5")]}),i=$[tt("0x135")][tt("0x190")]({context:t,typedArray:i,usage:$[tt("0xf4")][tt("0xf5")]}),n=$[tt("0x135")][tt("0x24c")]({context:t,typedArray:n,usage:$[tt("0xf4")][tt("0xf5")],indexDatatype:$[tt("0x1a1")][tt("0x24d")]}),a=$[tt("0x135")][tt("0x24c")]({context:t,typedArray:a,usage:$[tt("0xf4")][tt("0xf5")],indexDatatype:$[tt("0x1a1")][tt("0x24d")]}),n=new $[tt("0xf2")]({context:t,attributes:[{index:0,vertexBuffer:l,componentsPerAttribute:3,componentDatatype:$[tt("0x7")][tt("0x8")]},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:$[tt("0x7")][tt("0x8")]}],indexBuffer:n}),t=new $[tt("0xf2")]({context:t,attributes:[{index:0,vertexBuffer:l,componentsPerAttribute:3,componentDatatype:$[tt("0x7")][tt("0x8")]},{index:1,vertexBuffer:i,componentsPerAttribute:3,componentDatatype:$[tt("0x7")][tt("0x8")]}],indexBuffer:a}),l=$[tt("0x4e")][tt("0x4f")](e);return{command:new $[tt("0xee")]({vertexArray:n,primitiveType:$[tt("0x51")][tt("0x52")],renderState:o,shaderProgram:s,uniformMap:c,owner:this,pass:$[tt("0xef")][tt("0x129")],modelMatrix:new $[tt("0x11")],boundingVolume:new $[tt("0x4e")],cull:!0}),lineCommand:new $[tt("0xee")]({vertexArray:t,primitiveType:$[tt("0x51")][tt("0x59")],renderState:o,shaderProgram:s,uniformMap:h,owner:this,pass:$[tt("0xef")][tt("0x129")],modelMatrix:new $[tt("0x11")],boundingVolume:new $[tt("0x4e")],cull:!0}),initBoundingSphere:l}},e[tt("0xa4")][tt("0xdb")]=function(e){var i=this;this[tt("0x7a")]&&(this[tt("0x22b")]===this[tt("0x245")]&&this[tt("0x22c")]===this[tt("0x242")]&&this[tt("0x22e")]===this[tt("0x237")]&&this[tt("0x22f")]===this[tt("0x238")]&&this[tt("0x230")]===this[tt("0x239")]&&this[tt("0x231")]===this[tt("0x23a")]&&this[tt("0x232")]===this[tt("0x23b")]&&this[tt("0x233")]===this[tt("0x23c")]&&this[tt("0x234")]===this[tt("0x23d")]&&this[tt("0x235")]===this[tt("0x23e")]||(this[tt("0x245")]=this[tt("0x22b")],this[tt("0x242")]=this[tt("0x22c")],this[tt("0x237")]=this[tt("0x22e")],this[tt("0x238")]=this[tt("0x22f")],this[tt("0x239")]=this[tt("0x230")],this[tt("0x23a")]=this[tt("0x231")],this[tt("0x23b")]=this[tt("0x232")],this[tt("0x23c")]=this[tt("0x233")],this[tt("0x23d")]=this[tt("0x234")],this[tt("0x23e")]=this[tt("0x235")],this[tt("0x8b")]=$[tt("0x57")]($[tt("0x11")][tt("0x8c")]),this[tt("0x24e")]()),$[tt("0x2d")](this[tt("0x24f")])&&0!==this[tt("0x24f")][tt("0x2")]||(this[tt("0x24f")]||(this[tt("0x24f")]=[]),this[tt("0x24f")][tt("0x4c")](this[tt("0x241")](e[tt("0xea")])),this[tt("0x24f")][tt("0x4c")](this[tt("0x246")](e[tt("0xea")])),this[tt("0x24f")][tt("0x4c")](this[tt("0x247")](e[tt("0xea")])),this[tt("0x24f")][tt("0x4c")](this[tt("0x244")](e[tt("0xea")]))),$[tt("0x11")][tt("0xba")](this[tt("0x140")],this[tt("0x8b")])||($[tt("0x11")][tt("0x57")](this[tt("0x140")],this[tt("0x8b")]),this[tt("0x24f")][tt("0xae")](function(t){t[tt("0x250")][tt("0x140")]=$[tt("0x11")][tt("0x8c")],t[tt("0x250")][tt("0x140")]=i[tt("0x8b")],t[tt("0x250")][tt("0x251")]=$[tt("0x4e")][tt("0x180")](t[tt("0x252")],i[tt("0x8b")],i[tt("0x166")]),t[tt("0x253")][tt("0x140")]=$[tt("0x11")][tt("0x8c")],t[tt("0x253")][tt("0x140")]=i[tt("0x8b")],t[tt("0x253")][tt("0x251")]=$[tt("0x4e")][tt("0x180")](t[tt("0x252")],i[tt("0x8b")],i[tt("0x166")])})),this[tt("0x24f")][tt("0xae")](function(t){t[tt("0x250")]&&e[tt("0xe1")][tt("0x4c")](t[tt("0x250")]),t[tt("0x253")]&&e[tt("0xe1")][tt("0x4c")](t[tt("0x253")])}))},e[tt("0xa4")][tt("0x1f7")]=function(){return!1},e[tt("0xa4")][tt("0x24e")]=function(){this[tt("0x24f")]&&this[tt("0x24f")][tt("0xae")](function(t){$[tt("0x2d")](t[tt("0x250")])&&(t[tt("0x250")][tt("0xf7")]=t[tt("0x250")][tt("0xf7")]&&t[tt("0x250")][tt("0xf7")][tt("0xb0")](),t[tt("0x250")][tt("0xaf")]=t[tt("0x250")][tt("0xaf")]&&t[tt("0x250")][tt("0xaf")][tt("0xb0")](),t[tt("0x250")]=void 0),$[tt("0x2d")](t[tt("0x253")])&&(t[tt("0x253")][tt("0xf7")]=t[tt("0x253")][tt("0xf7")]&&t[tt("0x253")][tt("0xf7")][tt("0xb0")](),t[tt("0x253")][tt("0xaf")]=t[tt("0x253")][tt("0xaf")]&&t[tt("0x253")][tt("0xaf")][tt("0xb0")](),t[tt("0x253")]=void 0)}),this[tt("0x24f")]&&(this[tt("0x24f")][tt("0x2")]=0)},e[tt("0xa4")][tt("0xb0")]=function(){return this[tt("0x24e")](),$[tt("0x133")](this)},Object[tt("0xa3")](e[tt("0xa4")],{startRadius:{get:function(){return this[tt("0x254")]},set:function(t){this[tt("0x254")]=t,this[tt("0x22b")]=[{fov:$[tt("0x5d")][tt("0x5e")](0),radius:t},{fov:$[tt("0x5d")][tt("0x5e")](10),radius:.9*t},{fov:$[tt("0x5d")][tt("0x5e")](20),radius:.8*t},{fov:$[tt("0x5d")][tt("0x5e")](30),radius:.7*t},{fov:$[tt("0x5d")][tt("0x5e")](40),radius:.6*t},{fov:$[tt("0x5d")][tt("0x5e")](50),radius:.5*t},{fov:$[tt("0x5d")][tt("0x5e")](60),radius:.4*t},{fov:$[tt("0x5d")][tt("0x5e")](70),radius:.3*t},{fov:$[tt("0x5d")][tt("0x5e")](80),radius:.1*t},{fov:$[tt("0x5d")][tt("0x5e")](90),radius:.01*t}]}},radius:{get:function(){return this[tt("0x115")]},set:function(t){this[tt("0x115")]=t,this[tt("0x22c")]=[{fov:$[tt("0x5d")][tt("0x5e")](0),radius:t},{fov:$[tt("0x5d")][tt("0x5e")](10),radius:.9*t},{fov:$[tt("0x5d")][tt("0x5e")](20),radius:.8*t},{fov:$[tt("0x5d")][tt("0x5e")](30),radius:.7*t},{fov:$[tt("0x5d")][tt("0x5e")](40),radius:.6*t},{fov:$[tt("0x5d")][tt("0x5e")](50),radius:.5*t},{fov:$[tt("0x5d")][tt("0x5e")](60),radius:.4*t},{fov:$[tt("0x5d")][tt("0x5e")](70),radius:.3*t},{fov:$[tt("0x5d")][tt("0x5e")](80),radius:.1*t},{fov:$[tt("0x5d")][tt("0x5e")](90),radius:.01*t}]}}}),$.Scene[tt("0x255")]=e,function(){var t,e;$[tt("0x12b")]||(t=typeof self!==tt("0x68")?self:this,e=function(){return i=[function(c,t,e){Object[tt("0x1d")](t,tt("0x1e"),{value:!0}),t[tt("0x12b")]=void 0;var C=i(e(6)),w=i(e(7)),I=i(e(8)),Q=i(e(9));function i(t){return t&&t[tt("0x1e")]?t:{default:t}}var _=$[tt("0x4e")],A=$[tt("0x9")],n=$[tt("0x83")],x=$[tt("0x132")],G=$[tt("0x7")],a=$[tt("0x79")],r=$[tt("0x2d")],P=(Object[tt("0xa3")],$[tt("0x133")],$[tt("0x134")]),W=$[tt("0x11")],o=$[tt("0x51")],M=$[tt("0x135")],S=$[tt("0xf4")],s=$[tt("0xee")],Z=$[tt("0xef")],V=$[tt("0xfb")],R=$[tt("0xf8")],T=$[tt("0x136")],F=$[tt("0xf2")],X=$[tt("0xfd")],B=$[tt("0x101")],l=$[tt("0x137")],J=$[tt("0x35")],O=$[tt("0x138")],j=$[tt("0x5d")],D=$[tt("0x22")],k=(W=$[tt("0x11")],$[tt("0x139")]),d=($[tt("0x13a")],$[tt("0x13b")],Math[tt("0x65")]),N=Math[tt("0x66")],E=Math[tt("0x5f")],Y=Math[tt("0x13c")],z=(Math[tt("0x13d")],{position:0,normal:1});function h(t){var e=this;t=a(t,a[tt("0x13e")]),this[tt("0x7a")]=a(t[tt("0x7a")],!0),this[tt("0x13f")]=a(t[tt("0x13f")],32),this[tt("0x140")]=W[tt("0x57")](t[tt("0x140")],new W),this[tt("0x8b")]=new W,this[tt("0x141")]=new W,this[tt("0x142")]=new W,this[tt("0xed")]=a(t[tt("0xed")],Number[tt("0x143")]),this[tt("0x115")]=void 0,this[tt("0x144")]=a(t[tt("0x144")],0),this[tt("0x145")]=void 0,this[tt("0x146")]=a(t[tt("0x146")],0),this[tt("0x147")]=void 0,this[tt("0x86")]=a(t[tt("0x86")],n[tt("0x148")]),this[tt("0x149")]=a(t[tt("0x149")],!0),this[tt("0x14a")]=a(t[tt("0x14a")],!0),this[tt("0x14b")]=a(t[tt("0x14b")],!0),this[tt("0x14c")]=r(t[tt("0x14c")])?t[tt("0x14c")]:l[tt("0x14d")](l[tt("0x14e")]),this[tt("0x14f")]=void 0,this[tt("0x150")]=void 0,this[tt("0x151")]=r(t[tt("0x151")])?t[tt("0x151")]:l[tt("0x14d")](l[tt("0x14e")]),this[tt("0x152")]=void 0,this[tt("0x153")]=void 0,this[tt("0x154")]=a(t[tt("0x154")],!0),this[tt("0x155")]=r(t[tt("0x155")])?t[tt("0x155")]:l[tt("0x14d")](l[tt("0x14e")]),this[tt("0x156")]=void 0,this[tt("0x157")]=a(t[tt("0x157")],!0),this[tt("0x158")]=a(t[tt("0x158")],!0),this[tt("0x159")]=a(t[tt("0x159")],n[tt("0x148")]),this[tt("0x15a")]=a(t[tt("0x15a")],5),this[tt("0x15b")]=a(t[tt("0x15b")],!1),this[tt("0x15c")]=void 0,this[tt("0x15d")]=a(t[tt("0x15d")],!0),this[tt("0x15e")]=a(t[tt("0x15e")],n[tt("0x148")]),this[tt("0x15f")]=a(t[tt("0x15f")],tt("0x160")),this[tt("0x161")]=a(t[tt("0x161")],10),this[tt("0x162")]=0,this[tt("0x163")]=0,this[tt("0x164")]=k[tt("0x165")](),this[tt("0x166")]=new _,this[tt("0x167")]=new _,this[tt("0x168")]=new s({owner:this,primitiveType:o[tt("0x52")],boundingVolume:this[tt("0x167")]}),this[tt("0x169")]=new s({owner:this,primitiveType:o[tt("0x52")],boundingVolume:this[tt("0x167")]}),this[tt("0x16a")]=void 0,this[tt("0x16b")]=new s({owner:this,primitiveType:o[tt("0x59")],boundingVolume:this[tt("0x167")]}),this[tt("0x16c")]=void 0,this[tt("0x16d")]=new s({owner:this,primitiveType:o[tt("0x59")],boundingVolume:this[tt("0x167")]}),this[tt("0x16e")]=void 0,this[tt("0x16f")]=new s({owner:this,primitiveType:o[tt("0x52")],boundingVolume:this[tt("0x167")]}),this[tt("0x170")]=new s({owner:this,primitiveType:o[tt("0x52")],boundingVolume:this[tt("0x167")]}),this[tt("0x171")]=void 0,this[tt("0x172")]=new s({owner:this,primitiveType:o[tt("0x59")],boundingVolume:this[tt("0x167")]}),this[tt("0x173")]=void 0,this[tt("0x174")]=new s({owner:this,primitiveType:o[tt("0x52")],boundingVolume:this[tt("0x167")]}),this[tt("0x175")]=new s({owner:this,primitiveType:o[tt("0x52")],boundingVolume:this[tt("0x167")]}),this[tt("0x176")]=void 0,this[tt("0x177")]=[],this[tt("0x178")]=void 0,this[tt("0x179")]=void 0,this[tt("0x17a")]=void 0,this[tt("0x17b")]={u_type:function(){return 0},u_xHalfAngle:function(){return e[tt("0x144")]},u_yHalfAngle:function(){return e[tt("0x146")]},u_radius:function(){return e[tt("0xed")]},u_showThroughEllipsoid:function(){return e[tt("0x15b")]},u_showIntersection:function(){return e[tt("0x158")]},u_intersectionColor:function(){return e[tt("0x159")]},u_intersectionWidth:function(){return e[tt("0x15a")]},u_normalDirection:function(){return 1},u_lineColor:function(){return e[tt("0x86")]}},this[tt("0x17c")]={u_xHalfAngle:function(){return e[tt("0x162")]},u_yHalfAngle:function(){return e[tt("0x163")]},u_radius:function(){return e[tt("0xed")]},u_color:function(){return e[tt("0x15e")]},u_showThroughEllipsoid:function(){return e[tt("0x15b")]},u_showIntersection:function(){return e[tt("0x158")]},u_intersectionColor:function(){return e[tt("0x159")]},u_intersectionWidth:function(){return e[tt("0x15a")]},u_normalDirection:function(){return 1},u_lineColor:function(){return e[tt("0x86")]}}}h[tt("0xa4")][tt("0xdb")]=function(t){var e,i=t[tt("0x34")];if(this[tt("0x7a")]&&i===J[tt("0x36")]){var i=!1,n=!1,a=!1,r=this[tt("0x144")],o=this[tt("0x146")];if(r<0||o<0)throw new P(tt("0x17d"));if(0!=r&&0!=o){this[tt("0x145")]===r&&this[tt("0x147")]===o||(this[tt("0x145")]=r,this[tt("0x147")]=o,i=!0);var s=this[tt("0xed")];if(s<0)throw new P(tt("0x17e"));var l=!1,s=(this[tt("0x115")]!==s&&(l=!0,this[tt("0x115")]=s,this[tt("0x166")]=new _(A[tt("0x56")],this[tt("0xed")])),W[tt("0xba")](this[tt("0x140")],this[tt("0x8b")])&&!l||(W[tt("0x57")](this[tt("0x140")],this[tt("0x8b")]),W[tt("0x17f")](this[tt("0x140")],this[tt("0xed")],this[tt("0x141")]),_[tt("0x180")](this[tt("0x166")],this[tt("0x140")],this[tt("0x167")])),this[tt("0x15b")]),l=(this[tt("0x15c")]!==this[tt("0x15b")]&&(this[tt("0x15c")]=s,n=!0),this[tt("0x14c")]);this[tt("0x14f")]!==l&&(this[tt("0x14f")]=l,a=n=!0);var c,h,d,x,u,p,m=l[tt("0x181")](),g=(this[tt("0x150")]!==m&&(this[tt("0x150")]=m,n=!0),this[tt("0x15d")]&&(p=t[tt("0xdc")],(u=k[tt("0x182")](p,this[tt("0x164")]))<0&&(this[tt("0x164")]=k[tt("0x57")](p,this[tt("0x164")])),p=Math[tt("0x183")](u%this[tt("0x161")]/this[tt("0x161")],0),this[tt("0x15f")]==tt("0x160")?(u=N(d=2*o*p-o),x=E(r),u=Y(u*x),this[tt("0x162")]=u,this[tt("0x163")]=d,$[tt("0x22")][tt("0x184")](this[tt("0x163")],L)):(d=2*r*p-r,x=E(o),u=N(d),p=Y(u*x),this[tt("0x162")]=d,this[tt("0x163")]=p,$[tt("0x22")][tt("0x185")](this[tt("0x162")],L)),$[tt("0x11")][tt("0x186")](this[tt("0x140")],L,this[tt("0x142")]),W[tt("0x17f")](this[tt("0x142")],this[tt("0xed")],this[tt("0x142")])),i&&(r=this,o=t[tt("0xea")],u=U(r,r[tt("0x144")],r[tt("0x146")]),d=(x=r)[tt("0x144")],x=x[tt("0x146")],p=u[tt("0x189")],u=u[tt("0x18a")],i=[],e=D[tt("0x185")](d,L),i[tt("0x4c")](p[tt("0x18b")](function(t){return D[tt("0x18c")](e,t,new $[tt("0x9")])})),e=D[tt("0x184")](-x,L),i[tt("0x4c")](u[tt("0x18b")](function(t){return D[tt("0x18c")](e,t,new $[tt("0x9")])})[tt("0x18d")]()),e=D[tt("0x185")](-d,L),i[tt("0x4c")](p[tt("0x18b")](function(t){return D[tt("0x18c")](e,t,new $[tt("0x9")])})[tt("0x18d")]()),e=D[tt("0x184")](x,L),i[tt("0x4c")](u[tt("0x18b")](function(t){return D[tt("0x18c")](e,t,new $[tt("0x9")])})),d=i,r[tt("0x14b")]&&(r[tt("0x16a")]=function(t,e){for(var i=Array[tt("0xa4")][tt("0x18e")][tt("0x18f")]([],e)[tt("0x2")]-e[tt("0x2")],n=new Float32Array(18*i),a=0,r=0,o=e[tt("0x2")];r<o;r++)for(var s=e[r],l=A[tt("0x15")](A[tt("0xc")](s[0],s[s[tt("0x2")]-1],K),K),c=0,i=s[tt("0x2")]-1;c<i;c++)n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z,n[a++]=s[c].x,n[a++]=s[c].y,n[a++]=s[c].z,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z,n[a++]=s[c+1].x,n[a++]=s[c+1].y,n[a++]=s[c+1].z,n[a++]=-l.x,n[a++]=-l.y,n[a++]=-l.z;var h=M[tt("0x190")]({context:t,typedArray:n,usage:S[tt("0xf5")]}),d=6*Float32Array[tt("0x191")],h=[{index:z[tt("0x3")],vertexBuffer:h,componentsPerAttribute:3,componentDatatype:G[tt("0x8")],offsetInBytes:0,strideInBytes:d},{index:z[tt("0x5")],vertexBuffer:h,componentsPerAttribute:3,componentDatatype:G[tt("0x8")],offsetInBytes:3*Float32Array[tt("0x191")],strideInBytes:d}];return new F({context:t,attributes:h})}(o,d)),r[tt("0x149")]&&(r[tt("0x16c")]=function(t,e){for(var i=e[tt("0x2")],n=new Float32Array(9*i),a=0,r=0,o=e[tt("0x2")];r<o;r++){var s=e[r];n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=s[0].x,n[a++]=s[0].y,n[a++]=s[0].z}var i=M[tt("0x190")]({context:t,typedArray:n,usage:S[tt("0xf5")]}),l=3*Float32Array[tt("0x191")],i=[{index:z[tt("0x3")],vertexBuffer:i,componentsPerAttribute:3,componentDatatype:G[tt("0x8")],offsetInBytes:0,strideInBytes:l}];return new F({context:t,attributes:i})}(o,d)),r[tt("0x14a")]&&(r[tt("0x16e")]=function(t,e){for(var i=Array[tt("0xa4")][tt("0x18e")][tt("0x18f")]([],e)[tt("0x2")]-e[tt("0x2")],n=new Float32Array(9*i),a=0,r=0,o=e[tt("0x2")];r<o;r++)for(var s=e[r],l=0,i=s[tt("0x2")]-1;l<i;l++)n[a++]=s[l].x,n[a++]=s[l].y,n[a++]=s[l].z,n[a++]=s[l+1].x,n[a++]=s[l+1].y,n[a++]=s[l+1].z;var c=M[tt("0x190")]({context:t,typedArray:n,usage:S[tt("0xf5")]}),h=3*Float32Array[tt("0x191")],c=[{index:z[tt("0x3")],vertexBuffer:c,componentsPerAttribute:3,componentDatatype:G[tt("0x8")],offsetInBytes:0,strideInBytes:h}];return new F({context:t,attributes:c})}(o,d)),r[tt("0x154")]&&(r[tt("0x171")]=(p=o,x=$[tt("0x13b")][tt("0x55")](new $[tt("0x13b")]({vertexFormat:O[tt("0x192")],stackPartitions:32,slicePartitions:32})),F[tt("0xf3")]({context:p,geometry:x,attributeLocations:z,bufferUsage:S[tt("0xf5")],interleave:!1}))),r[tt("0x157")]&&(r[tt("0x173")]=(u=o,i=$[tt("0x193")][tt("0x55")](new $[tt("0x193")]({vertexFormat:O[tt("0x192")],stackPartitions:32,slicePartitions:32})),F[tt("0xf3")]({context:u,geometry:i,attributeLocations:z,bufferUsage:S[tt("0xf5")],interleave:!1}))),r[tt("0x15d")])&&(r[tt("0x15f")]==tt("0x160")?(c=U(r,j[tt("0x194")],0),r[tt("0x195")]=q(o,c[tt("0x18a")])):(c=U(r,0,j[tt("0x194")]),r[tt("0x195")]=q(o,c[tt("0x189")]))),n&&(i=this,r=s,m?(i[tt("0x178")]=V[tt("0xfc")]({depthTest:{enabled:!r},depthMask:!1,blending:X[tt("0xfe")],cull:{enabled:!0,face:B[tt("0x102")]}}),i[tt("0x179")]=V[tt("0xfc")]({depthTest:{enabled:!r},depthMask:!1,blending:X[tt("0xfe")],cull:{enabled:!0,face:B[tt("0x19a")]}}),i[tt("0x19b")]=V[tt("0xfc")]({depthTest:{enabled:!r},depthMask:!1,blending:X[tt("0xfe")]})):(i[tt("0x178")]=V[tt("0xfc")]({depthTest:{enabled:!r},depthMask:!0}),i[tt("0x19b")]=V[tt("0xfc")]({depthTest:{enabled:!0},depthMask:!0}))),a&&(o=this,s=c=l,i=(r=t)[tt("0xea")],l=C[tt("0x131")],h=new T({sources:[I[tt("0x131")],s[tt("0x196")],w[tt("0x131")]]}),o[tt("0x17a")]=R[tt("0xf9")]({context:i,shaderProgram:o[tt("0x17a")],vertexShaderSource:l,fragmentShaderSource:h,attributeLocations:z}),h=new T({sources:[I[tt("0x131")],s[tt("0x196")],w[tt("0x131")]],pickColorQualifier:tt("0x197")}),o[tt("0x198")]=R[tt("0xf9")]({context:i,shaderProgram:o[tt("0x198")],vertexShaderSource:l,fragmentShaderSource:h,attributeLocations:z}),this[tt("0x15d")])&&(s=this,i=c,o=r[tt("0xea")],l=C[tt("0x131")],h=new T({sources:[I[tt("0x131")],i[tt("0x196")],Q[tt("0x131")]]}),s[tt("0x199")]=R[tt("0xf9")]({context:o,shaderProgram:s[tt("0x199")],vertexShaderSource:l,fragmentShaderSource:h,attributeLocations:z})),(n||a)&&(r=m,(i=this)[tt("0x177")][tt("0x2")]=0,o=r?Z[tt("0x129")]:Z[tt("0xf0")],i[tt("0x14b")]&&H(i,i[tt("0x168")],i[tt("0x169")],i[tt("0x178")],i[tt("0x179")],i[tt("0x17a")],i[tt("0x16a")],i[tt("0x17b")],i[tt("0x141")],r,o),i[tt("0x149")]&&H(i,i[tt("0x16b")],void 0,i[tt("0x178")],i[tt("0x179")],i[tt("0x17a")],i[tt("0x16c")],i[tt("0x17b")],i[tt("0x141")],r,o,!0),i[tt("0x14a")]&&H(i,i[tt("0x16d")],void 0,i[tt("0x178")],i[tt("0x179")],i[tt("0x17a")],i[tt("0x16e")],i[tt("0x17b")],i[tt("0x141")],r,o,!0),i[tt("0x154")]&&H(i,i[tt("0x16f")],i[tt("0x170")],i[tt("0x178")],i[tt("0x179")],i[tt("0x17a")],i[tt("0x171")],i[tt("0x17b")],i[tt("0x141")],r,o),i[tt("0x157")]&&H(i,i[tt("0x172")],void 0,i[tt("0x178")],i[tt("0x179")],i[tt("0x17a")],i[tt("0x173")],i[tt("0x17b")],i[tt("0x141")],r,o,!0),i[tt("0x15d")])&&H(i,i[tt("0x174")],i[tt("0x175")],i[tt("0x178")],i[tt("0x179")],i[tt("0x199")],i[tt("0x195")],i[tt("0x17c")],i[tt("0x142")],r,o),t[tt("0xe1")]),s=t[tt("0x187")],f=this[tt("0x177")];if(s[tt("0x188")])for(var v=0,y=f[tt("0x2")];v<y;v++){var b=f[v];g[tt("0x4c")](b)}}}};var L=new D,K=new A;function U(t,e,i){for(var n=t[tt("0x13f")],t=N(i),i=E(i),a=N(e),e=E(e),r=Y(a*i),o=Y(t*e),s=[],l=0;l<n;l++){var c=2*r*l/(n-1)-r;s[tt("0x4c")](new A(0,d(c),N(c)))}for(var h=[],l=0;l<n;l++)c=2*o*l/(n-1)-o,h[tt("0x4c")](new A(d(c),0,N(c)));return{zoy:s,zox:h}}function q(t,e){for(var i=e[tt("0x2")]-1,n=new Float32Array(9*i),a=0,r=0;r<i;r++)n[a++]=0,n[a++]=0,n[a++]=0,n[a++]=e[r].x,n[a++]=e[r].y,n[a++]=e[r].z,n[a++]=e[r+1].x,n[a++]=e[r+1].y,n[a++]=e[r+1].z;var o=M[tt("0x190")]({context:t,typedArray:n,usage:S[tt("0xf5")]}),s=3*Float32Array[tt("0x191")],o=[{index:z[tt("0x3")],vertexBuffer:o,componentsPerAttribute:3,componentDatatype:G[tt("0x8")],offsetInBytes:0,strideInBytes:s}];return new F({context:t,attributes:o})}function H(t,e,i,n,a,r,o,s,l,c,h,d){c&&i&&(i[tt("0xaf")]=o,i[tt("0xfa")]=a,i[tt("0xf7")]=r,i[tt("0x103")]=x(s,t[tt("0x14f")][tt("0x17b")]),i[tt("0x103")][tt("0x19c")]=function(){return-1},i[tt("0x19d")]=h,i[tt("0x140")]=l,t[tt("0x177")][tt("0x4c")](i)),e[tt("0xaf")]=o,e[tt("0xfa")]=n,e[tt("0xf7")]=r,e[tt("0x103")]=x(s,t[tt("0x14f")][tt("0x17b")]),d&&(e[tt("0x103")][tt("0x19e")]=function(){return 1}),e[tt("0x19d")]=h,e[tt("0x140")]=l,t[tt("0x177")][tt("0x4c")](e)}t[tt("0x12b")]=h},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0});var G=$[tt("0x4e")],P=$[tt("0x9")],r=$[tt("0x19f")],W=$[tt("0x7")],o=$[tt("0x79")],M=($[tt("0x2d")],$[tt("0x50")]),S=$[tt("0x6")],Z=$[tt("0x1a0")],V=$[tt("0x51")],s=$[tt("0x138")],R=$[tt("0x5d")],T=$[tt("0x53")],F=$[tt("0x1a1")],X=($[tt("0xf")],Math[tt("0x66")]),B=Math[tt("0x65")];function l(t){var e=(t=o(t,o[tt("0x13e")]))[tt("0x114")],i=t[tt("0xed")],n=Math[tt("0x1a2")](o(t[tt("0x1a3")],12)),a=Math[tt("0x1a2")](o(t[tt("0x1a4")],64)),t=(r[tt("0x1a5")][tt("0x1a6")](tt("0x114"),e),r[tt("0x1a5")][tt("0x1a6")](tt("0xed"),i),o(t[tt("0x1a7")],s[tt("0x1a8")]));this[tt("0x113")]=e,this[tt("0x115")]=i,this[tt("0x1a9")]=n,this[tt("0x1aa")]=a,this[tt("0x1ab")]=t}l[tt("0x1ac")]=function(t){var e=(t=o(t,o[tt("0x13e")]))[tt("0x114")],i=t[tt("0xed")],n=t[tt("0x1a3")],a=t[tt("0x1a4")];return r[tt("0x1a5")][tt("0x1a6")](tt("0x114"),e),r[tt("0x1a5")][tt("0x1a6")](tt("0xed"),i),r[tt("0x1a5")][tt("0x1a6")][tt("0x1ad")](tt("0x114"),e,0),r[tt("0x1a5")][tt("0x1a6")][tt("0x1ad")](tt("0x33"),height,0),new l({angle:e,radius:i,stackPartitions:n,slicePartitions:a,vertexFormat:t[tt("0x1a7")]})},l[tt("0x55")]=function(t){console[tt("0xdc")](tt("0x55"));var e,i=t[tt("0x113")],n=t[tt("0x115")],a=t[tt("0x1a9")]+1,r=t[tt("0x1aa")]+1,t=t[tt("0x1ab")],o=new Z,s=3*(r-1)+6*(r-1)*(a-2)+3*(r-1),l=a*r,c=F[tt("0x1ae")](l,s),h=new Float64Array(3*l+3*(r-1)*3);if(t[tt("0x3")]){for(var d=0,x=new Array(r),u=new Array(r),p=0;p<r;p++){var m=R[tt("0x1af")]*p/(r-1);x[p]=X(m),u[p]=B(m),h[d++]=0,h[d++]=0,h[d++]=-n}for(p=1;p<a;p++)for(var g=i*p/(a-1),f=B(g),v=n*f,y=n*f,b=n*X(g),C=0;C<r;C++)h[d++]=x[C]*v,h[d++]=u[C]*y,h[d++]=-b;for(e=d,p=0;p<r-1;p++)h[d++]=0,h[d++]=0,h[d++]=0,h[d++]=h[e-3*(r-p-1)],h[d++]=h[e-3*(r-p-1)+1],h[d++]=h[e-3*(r-p-1)+2],h[d++]=h[e-3*(r-p)],h[d++]=h[e-3*(r-p)+1],h[d++]=h[e-3*(r-p)+2];o[tt("0x3")]=new S({componentDatatype:W[tt("0x4d")],componentsPerAttribute:3,values:h})}for(var w,I,_=0,C=0;C<r-1;C++)c[_++]=r+C,c[_++]=r+C+1,c[_++]=C+1;for(p=1;p<a-1;p++)for(w=p*r,I=(p+1)*r,C=0;C<r-1;C++)c[_++]=I+C,c[_++]=I+C+1,c[_++]=w+C+1,c[_++]=I+C,c[_++]=w+C+1,c[_++]=w+C;for(var p=0,A=3*(r-1);p<A;p++)c[_++]=p+e/3;s=new M({attributes:o,indices:c,primitiveType:V[tt("0x52")],boundingSphere:new G(P[tt("0x56")],n)}),s=T[tt("0x54")](s);return console[tt("0x1b0")](tt("0x55")),s},e[tt("0x1b1")]=l},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0});var w=$[tt("0x4e")],I=$[tt("0x9")],_=$[tt("0x7")],r=$[tt("0x79")],o=($[tt("0x2d")],$[tt("0x134")]),A=($[tt("0xf")],$[tt("0x50")]),G=$[tt("0x6")],P=$[tt("0x1a0")],W=$[tt("0x1a1")],M=$[tt("0x5d")],S=$[tt("0x51")],Z=(new I(1,1,1),Math[tt("0x66")]),V=Math[tt("0x65")];function n(t){var e=(t=r(t,r[tt("0x13e")]))[tt("0x114")],i=t[tt("0xed")],n=Math[tt("0x1a2")](r(t[tt("0x1a3")],10)),a=Math[tt("0x1a2")](r(t[tt("0x1a4")],8)),t=Math[tt("0x1a2")](r(t[tt("0x1b2")],128));if(n<1)throw new o(tt("0x1b3"));if(a<0)throw new o(tt("0x1b4"));if(t<0)throw new o(tt("0x1b5"));this[tt("0x113")]=e,this[tt("0x115")]=i,this[tt("0x1a9")]=n,this[tt("0x1aa")]=a,this[tt("0x1b6")]=t}n[tt("0x55")]=function(t){var e=t[tt("0x113")],i=t[tt("0x115")];if(!(i<=0||e<=0)){for(var n,a,r,o,s=t[tt("0x1a9")],l=t[tt("0x1aa")],c=t[tt("0x1b6")],t=c*(s+l-1),h=t-l+2,d=new Float64Array(3*h),x=W[tt("0x1ae")](h,2*t),u=0,p=new Array(c),m=new Array(c),g=0;g<c;g++)n=M[tt("0x1af")]*g/c,p[g]=Z(n),m[g]=V(n);for(g=1;g<s;g++)for(r=Z(a=e*g/(s-1)),o=V(a),v=0;v<c;v++)d[u++]=i*p[v]*o,d[u++]=i*m[v]*o,d[u++]=-i*r;for(p[tt("0x2")]=l,m[tt("0x2")]=l,g=0;g<l;g++)n=M[tt("0x1af")]*g/l,p[g]=Z(n),m[g]=V(n);for(d[u++]=0,d[u++]=0,d[u++]=-i,g=1;g<c;g++)for(r=Z(a=e*g/c),o=V(a),v=0;v<l;v++)d[u++]=i*p[v]*o,d[u++]=i*m[v]*o,d[u++]=-i*r;for(g=u=0;g<s-1;++g){for(var f=g*c,v=0;v<c-1;++v)x[u++]=f+v,x[u++]=f+v+1;x[u++]=f+c-1,x[u++]=f}var y=c*(s-1);for(v=1;v<l+1;++v)x[u++]=y,x[u++]=y+v;for(g=0;g<c-2;++g){var b=g*l+1+y,C=(g+1)*l+1+y;for(v=0;v<l-1;++v)x[u++]=C+v,x[u++]=b+v;x[u++]=C+l-1,x[u++]=b+l-1}h=new P({position:new G({componentDatatype:_[tt("0x4d")],componentsPerAttribute:3,values:d})});return new A({attributes:h,indices:x,primitiveType:S[tt("0x59")],boundingSphere:new w(I[tt("0x56")],i)})}},e[tt("0x1b7")]=n},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0});var n=$[tt("0x79")],a=$[tt("0x2d")],r=Object[tt("0xa3")],o=$[tt("0x134")],s=$[tt("0x1b8")],l=$[tt("0x1b9")],c=$[tt("0x1ba")];function h(t){this[tt("0x113")]=void 0,this[tt("0x1bb")]=void 0,this[tt("0x115")]=void 0,this[tt("0x1bc")]=void 0,this[tt("0x1bd")]=void 0,this[tt("0x1be")]=void 0,this[tt("0x1bf")]=void 0,this[tt("0x1c0")]=void 0,this[tt("0x1c1")]=void 0,this[tt("0x1c2")]=void 0,this[tt("0x78")]=void 0,this[tt("0x1c3")]=void 0,this[tt("0x1c4")]=void 0,this[tt("0x1c5")]=void 0,this[tt("0x1c1")]=void 0,this[tt("0x1c2")]=void 0,this[tt("0x14f")]=void 0,this[tt("0x1c6")]=void 0,this[tt("0x7b")]=void 0,this[tt("0x1c7")]=void 0,this[tt("0x1c8")]=void 0,this[tt("0x1c9")]=void 0,this[tt("0x1ca")]=void 0,this[tt("0x1cb")]=void 0,this[tt("0x1cc")]=void 0,this[tt("0x1cd")]=void 0,this[tt("0x1ce")]=void 0,this[tt("0x1cf")]=void 0,this[tt("0x1d0")]=new s,this[tt("0x1d1")]=void 0,this[tt("0x1d2")]=void 0,this[tt("0x1d3")](n(t,n[tt("0x13e")]))}r(h[tt("0xa4")],{definitionChanged:{get:function(){return this[tt("0x1d0")]}},show:c(tt("0x7a")),angle:c(tt("0x114")),radius:c(tt("0xed")),stack:c(tt("0x1d4")),slice:c(tt("0x13f")),color:c(tt("0x82")),material:l(tt("0x14c")),fill:c(tt("0x1d5")),outline:c(tt("0x7c")),outlineColor:c(tt("0x1d6")),outlineWidth:c(tt("0x1d7")),shadows:c(tt("0x1d8")),distanceDisplayCondition:c(tt("0x1d9"))}),h[tt("0xa4")][tt("0x57")]=function(t){return a(t)?(t[tt("0x114")]=this[tt("0x114")],t[tt("0xed")]=this[tt("0xed")],t[tt("0x1d4")]=this[tt("0x1d4")],t[tt("0x13f")]=this[tt("0x13f")],t[tt("0x7a")]=this[tt("0x7a")],t[tt("0x14c")]=this[tt("0x14c")],t[tt("0x82")]=this[tt("0x82")],t[tt("0x1d5")]=this[tt("0x1d5")],t[tt("0x7c")]=this[tt("0x7c")],t[tt("0x1d6")]=this[tt("0x1d6")],t[tt("0x1d7")]=this[tt("0x1d7")],t[tt("0x1d8")]=this[tt("0x1d8")],t[tt("0x1d9")]=this[tt("0x1d9")],t[tt("0x1da")]=this[tt("0x1da")],t):new h(this)},h[tt("0xa4")][tt("0x1d3")]=function(t){if(!a(t))throw new o(tt("0x1db"));this[tt("0x114")]=n(this[tt("0x114")],t[tt("0x114")]),this[tt("0xed")]=n(this[tt("0xed")],t[tt("0xed")]),this[tt("0x1d4")]=n(this[tt("0x1d4")],t[tt("0x1d4")]),this[tt("0x13f")]=n(this[tt("0x13f")],t[tt("0x13f")]),this[tt("0x7a")]=n(this[tt("0x7a")],t[tt("0x7a")]),this[tt("0x82")]=n(this[tt("0x82")],t[tt("0x82")]),this[tt("0x14c")]=n(this[tt("0x14c")],t[tt("0x14c")]),this[tt("0x1d5")]=n(this[tt("0x1d5")],t[tt("0x1d5")]),this[tt("0x7c")]=n(this[tt("0x7c")],t[tt("0x7c")]),this[tt("0x1d6")]=n(this[tt("0x1d6")],t[tt("0x1d6")]),this[tt("0x1d7")]=n(this[tt("0x1d7")],t[tt("0x1d7")]),this[tt("0x1d8")]=n(this[tt("0x1d8")],t[tt("0x1d8")]),this[tt("0x1d9")]=n(this[tt("0x1d9")],t[tt("0x1d9")]),this[tt("0x1da")]=n(this[tt("0x1da")],t[tt("0x1da")])},e[tt("0x1dc")]=h},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0});var n=i(5);Object[tt("0x1dd")](n)[tt("0xae")](function(t){t!==tt("0x131")&&t!==tt("0x1e")&&Object[tt("0x1d")](e,t,{enumerable:!0,get:function(){return n[t]}})})},function(t,e,i){var n=i(0),a=i(10),r=i(11),o=i(1),s=i(2),l=i(3),i=i(12),n=($.Scene[tt("0x12b")]=n[tt("0x12b")],$.Scene[tt("0x1de")]=a[tt("0x1de")],$.Scene[tt("0x1df")]=r[tt("0x1df")],$.Scene[tt("0x1b1")]=o[tt("0x1b1")],$.Scene[tt("0x1b7")]=s[tt("0x1b7")],$.Scene[tt("0x1dc")]=l[tt("0x1dc")],$.Scene[tt("0x1e0")]=i[tt("0x1e0")],$[tt("0x1e1")]),c=n[tt("0x1e2")];n[tt("0x1e2")]=function(t,e,i){var n=i[tt("0xab")];return c(t,e,i)[tt("0x18e")]([new r[tt("0x1df")](t,n)])}},function(t,e){t[tt("0x12d")]=tt("0x1e3")},function(t,e){t[tt("0x12d")]=tt("0x1e4")},function(t,e){t[tt("0x12d")]=tt("0x1e5")},function(t,e){t[tt("0x12d")]=tt("0x1e6")},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0});var n=$[tt("0x79")],a=$[tt("0x2d")],r=Object[tt("0xa3")],o=$[tt("0x134")],s=$[tt("0x1b8")],l=$[tt("0x1b9")],c=$[tt("0x1ba")];function h(t){this[tt("0x78")]=void 0,this[tt("0x115")]=void 0,this[tt("0x145")]=void 0,this[tt("0x147")]=void 0,this[tt("0x1e7")]=void 0,this[tt("0x1e8")]=void 0,this[tt("0x1e9")]=void 0,this[tt("0x1ea")]=void 0,this[tt("0x14f")]=void 0,this[tt("0x1eb")]=void 0,this[tt("0x1ec")]=void 0,this[tt("0x1ed")]=void 0,this[tt("0x1ee")]=void 0,this[tt("0x1ef")]=void 0,this[tt("0x15c")]=void 0,this[tt("0x1d1")]=void 0,this[tt("0x1f0")]=void 0,this[tt("0x1f1")]=void 0,this[tt("0x1f2")]=void 0,this[tt("0x1f3")]=void 0,this[tt("0x1d0")]=new s,this[tt("0x1d3")](n(t,n[tt("0x13e")]))}r(h[tt("0xa4")],{definitionChanged:{get:function(){return this[tt("0x1d0")]}},show:c(tt("0x7a")),radius:c(tt("0xed")),xHalfAngle:c(tt("0x144")),yHalfAngle:c(tt("0x146")),lineColor:c(tt("0x86")),showSectorLines:c(tt("0x149")),showSectorSegmentLines:c(tt("0x14a")),showLateralSurfaces:c(tt("0x14b")),material:l(tt("0x14c")),showDomeSurfaces:c(tt("0x154")),showDomeLines:c(tt("0x1f4")),showIntersection:c(tt("0x158")),intersectionColor:c(tt("0x159")),intersectionWidth:c(tt("0x15a")),showThroughEllipsoid:c(tt("0x15b")),gaze:c(tt("0x1da")),showScanPlane:c(tt("0x15d")),scanPlaneColor:c(tt("0x15e")),scanPlaneMode:c(tt("0x15f")),scanPlaneRate:c(tt("0x161"))}),h[tt("0xa4")][tt("0x57")]=function(t){return(t=a(t)?t:new h)[tt("0x7a")]=this[tt("0x7a")],t[tt("0xed")]=this[tt("0xed")],t[tt("0x144")]=this[tt("0x144")],t[tt("0x146")]=this[tt("0x146")],t[tt("0x86")]=this[tt("0x86")],t[tt("0x149")]=this[tt("0x149")],t[tt("0x14a")]=this[tt("0x14a")],t[tt("0x14b")]=this[tt("0x14b")],t[tt("0x14c")]=this[tt("0x14c")],t[tt("0x154")]=this[tt("0x154")],t[tt("0x157")]=this[tt("0x157")],t[tt("0x158")]=this[tt("0x158")],t[tt("0x159")]=this[tt("0x159")],t[tt("0x15a")]=this[tt("0x15a")],t[tt("0x15b")]=this[tt("0x15b")],t[tt("0x1da")]=this[tt("0x1da")],t[tt("0x15d")]=this[tt("0x15d")],t[tt("0x15e")]=this[tt("0x15e")],t[tt("0x15f")]=this[tt("0x15f")],t[tt("0x161")]=this[tt("0x161")],t},h[tt("0xa4")][tt("0x1d3")]=function(t){if(!a(t))throw new o(tt("0x1db"));this[tt("0x7a")]=n(this[tt("0x7a")],t[tt("0x7a")]),this[tt("0xed")]=n(this[tt("0xed")],t[tt("0xed")]),this[tt("0x144")]=n(this[tt("0x144")],t[tt("0x144")]),this[tt("0x146")]=n(this[tt("0x146")],t[tt("0x146")]),this[tt("0x86")]=n(this[tt("0x86")],t[tt("0x86")]),this[tt("0x149")]=n(this[tt("0x149")],t[tt("0x149")]),this[tt("0x14a")]=n(this[tt("0x14a")],t[tt("0x14a")]),this[tt("0x14b")]=n(this[tt("0x14b")],t[tt("0x14b")]),this[tt("0x14c")]=n(this[tt("0x14c")],t[tt("0x14c")]),this[tt("0x154")]=n(this[tt("0x154")],t[tt("0x154")]),this[tt("0x157")]=n(this[tt("0x157")],t[tt("0x157")]),this[tt("0x158")]=n(this[tt("0x158")],t[tt("0x158")]),this[tt("0x159")]=n(this[tt("0x159")],t[tt("0x159")]),this[tt("0x15a")]=n(this[tt("0x15a")],t[tt("0x15a")]),this[tt("0x15b")]=n(this[tt("0x15b")],t[tt("0x15b")]),this[tt("0x1da")]=n(this[tt("0x1da")],t[tt("0x1da")]),this[tt("0x15d")]=n(this[tt("0x15d")],t[tt("0x15d")]),this[tt("0x15e")]=n(this[tt("0x15e")],t[tt("0x15e")]),this[tt("0x15f")]=n(this[tt("0x15f")],t[tt("0x15f")]),this[tt("0x161")]=n(this[tt("0x161")],t[tt("0x161")])},e[tt("0x1de")]=h},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0}),e[tt("0x1df")]=void 0;var v=i(0),n=$[tt("0x1f5")],y=$[tt("0x9")],b=$[tt("0x83")],C=$[tt("0x2d")],a=$[tt("0x133")],w=$[tt("0x134")],I=$[tt("0x22")],_=$[tt("0x11")],A=$[tt("0x29")],G=$[tt("0x1f6")],P=$[tt("0xc2")],W=new I,M=(new _,new y),S=new y,Z=new A,V=new y,R=new A;function c(t,e,i){var n=e[t.id];C(n)&&(n=n[tt("0x2f")],i[tt("0xd2")](n),n[tt("0x1f7")]()||n[tt("0xb0")](),delete e[t.id])}function r(t,e){if(!C(t))throw new w(tt("0x1f8"));if(!C(e))throw new w(tt("0x1f9"));e[tt("0x1fa")][tt("0x1fb")](r[tt("0xa4")][tt("0x1fc")],this),this[tt("0x1fd")]=t,this[tt("0x1fe")]=t[tt("0x9d")],this[tt("0x1ff")]=e,this[tt("0x200")]={},this[tt("0x201")]=new n,this[tt("0x1fc")](e,e[tt("0x4")],[],[])}r[tt("0xa4")][tt("0xdb")]=function(t){if(!C(t))throw new w(tt("0x202"));for(var e=this[tt("0x201")][tt("0x4")],i=this[tt("0x200")],n=this[tt("0x1fe")],a=0,r=e[tt("0x2")];a<r;a++){var o,s,l,c=e[a],h=c[tt("0x203")],d=i[c.id],x=c[tt("0x204")]&&c[tt("0x205")](t)&&P[tt("0x206")](h[tt("0x78")],t,!0);if(x&&(o=P[tt("0xc3")](c[tt("0x74")],t,M),g=P[tt("0xc3")](c[tt("0x207")],t,Z),f=P[tt("0xc3")](h[tt("0x115")],t),s=P[tt("0xc3")](h[tt("0x145")],t),l=P[tt("0xc3")](h[tt("0x147")],t),x=C(o)&&C(s)&&C(l)),x){x=C(d)?d[tt("0x2f")]:void 0,c=(C(x)||((x=new v[tt("0x12b")]).id=c,n[tt("0x9e")](x),i[c.id]=d={primitive:x,position:void 0,orientation:void 0}),P[tt("0xc3")](h[tt("0x1d1")],t));if(C(c)){var u=P[tt("0xc3")](c[tt("0x74")],t,S);if(!C(o)||!C(u))continue;var p=y[tt("0xb")](o,u,V),m=y[tt("0x208")]($[tt("0x9")][tt("0x209")],p),p=y[tt("0xc")]($[tt("0x9")][tt("0x209")],p,V),g=A[tt("0x20a")](p,m-Math.PI,R),f=y[tt("0x11d")](o,u);x[tt("0x140")]=_[tt("0x21")](I[tt("0x23")](g,W),o,x[tt("0x140")])}else y[tt("0xba")](o,d[tt("0x3")])&&A[tt("0xba")](g,d[tt("0xc1")])||(C(g)?(x[tt("0x140")]=_[tt("0x21")](I[tt("0x23")](g,W),o,x[tt("0x140")]),d[tt("0x3")]=y[tt("0x57")](o,d[tt("0x3")]),d[tt("0xc1")]=A[tt("0x57")](g,d[tt("0xc1")])):(x[tt("0x140")]=$[tt("0x24")][tt("0x25")](o),d[tt("0x3")]=y[tt("0x57")](o,d[tt("0x3")])));x[tt("0x7a")]=!0,x[tt("0x1da")]=c,x[tt("0xed")]=f,x[tt("0x144")]=s,x[tt("0x146")]=l,x[tt("0x86")]=P[tt("0x206")](h[tt("0x1e7")],t,b[tt("0x148")]),x[tt("0x149")]=P[tt("0x206")](h[tt("0x1e8")],t,!0),x[tt("0x14a")]=P[tt("0x206")](h[tt("0x1e9")],t,!0),x[tt("0x14b")]=P[tt("0x206")](h[tt("0x1ea")],t,!0),x[tt("0x14c")]=G[tt("0xbf")](t,h[tt("0x14f")],x[tt("0x14c")]),x[tt("0x154")]=P[tt("0x206")](h[tt("0x1eb")],t,!0),x[tt("0x157")]=P[tt("0x206")](h[tt("0x1ec")],t,!0),x[tt("0x158")]=P[tt("0x206")](h[tt("0x1ed")],t,!0),x[tt("0x159")]=P[tt("0x206")](h[tt("0x1ee")],t,b[tt("0x148")]),x[tt("0x15a")]=P[tt("0x206")](h[tt("0x1ef")],t,1),x[tt("0x15b")]=P[tt("0x206")](h[tt("0x15c")],t,!0),x[tt("0x15f")]=P[tt("0x206")](h[tt("0x1f2")],t),x[tt("0x15e")]=P[tt("0x206")](h[tt("0x1f1")],t,b[tt("0x148")]),x[tt("0x15d")]=P[tt("0x206")](h[tt("0x1f0")],t,!0),x[tt("0x161")]=P[tt("0x206")](h[tt("0x1f3")],t,1)}else C(d)&&(d[tt("0x2f")][tt("0x7a")]=!1)}return!0},r[tt("0xa4")][tt("0x1f7")]=function(){return!1},r[tt("0xa4")][tt("0xb0")]=function(){for(var t=this[tt("0x201")][tt("0x4")],e=this[tt("0x200")],i=this[tt("0x1fe")],n=t[tt("0x2")]-1;-1<n;n--)c(t[n],e,i);return a(this)},r[tt("0xa4")][tt("0x1fc")]=function(t,e,i,n){for(var a,r=this[tt("0x201")],o=this[tt("0x200")],s=this[tt("0x1fe")],l=e[tt("0x2")]-1;-1<l;l--)a=e[l],C(a[tt("0x203")])&&C(a[tt("0x74")])&&r[tt("0x20b")](a.id,a);for(l=n[tt("0x2")]-1;-1<l;l--)a=n[l],C(a[tt("0x203")])&&C(a[tt("0x74")])?r[tt("0x20b")](a.id,a):(c(a,o,s),r[tt("0xd2")](a.id));for(l=i[tt("0x2")]-1;-1<l;l--)c(a=i[l],o,s),r[tt("0xd2")](a.id)},e[tt("0x1df")]=r},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0}),e[tt("0x1e0")]=void 0;var b=i(1),C=i(2),n=i(13),w=($[tt("0x79")],$[tt("0x2d")]),I=($[tt("0x20c")],$[tt("0x24")]),a=$[tt("0x134")],_=($[tt("0x20d")],$[tt("0x83")]),A=$[tt("0x20e")],G=$[tt("0x20f")],P=$[tt("0x9")],W=($[tt("0x138")],$[tt("0x29")]),M=$[tt("0x22")],S=$[tt("0x11")],Z=$[tt("0xc2")];function r(t){var e=this;if(!w(t))throw new a(tt("0x212"));var i=(this[tt("0x213")]=t)[tt("0x6a")],t=(this[tt("0x1fd")]=i,t[tt("0x214")]);this[tt("0x215")]=t,this[tt("0x1fe")]=i[tt("0x9d")],this[tt("0x216")]=void 0,this[tt("0x217")]=void 0,this[tt("0x218")]=[],t[tt("0x219")][tt("0x1fb")](function(){e[tt("0xdb")]()})}$[tt("0x1b8")],$[tt("0x210")],$[tt("0x211")];var V=new M,R=new S,T=new P,F=new P,X=new P,B=new W;r[tt("0xa4")][tt("0x9e")]=function(t){return t instanceof n[tt("0x21a")]||(t=new n[tt("0x21a")](t)),this[tt("0x218")][tt("0x4c")](t),t},r[tt("0xa4")][tt("0xd2")]=function(t){t=this[tt("0x218")][tt("0x21b")](t);-1!==t&&this[tt("0x218")][tt("0xdd")](t,1)},r[tt("0xa4")][tt("0x21c")]=function(){this[tt("0x218")][tt("0x2")]=0},r[tt("0xa4")][tt("0xdb")]=function(){var t=this[tt("0x215")][tt("0x21d")],e=this[tt("0x218")],i=this[tt("0x1fe")],n=this[tt("0x216")],a=this[tt("0x217")],r=[],o=[];w(n)&&i[tt("0x21e")](n),w(a)&&i[tt("0x21e")](a);for(var s=0,l=e[tt("0x2")];s<l;s++){var c=e[s],h=c[tt("0x21f")];if(Z[tt("0x206")](h[tt("0x7a")],t,!0)){var d=h[tt("0x114")],x=h[tt("0xed")],u=h[tt("0x1d4")],p=h[tt("0x13f")];if(w(d)&&Z[tt("0x206")](c[tt("0x7a")],t,!0)){var m=Z[tt("0xc3")](c[tt("0x3")],t,T);if(w(m)){var g,f=h[tt("0x1da")];if(w(f)){var f=Z[tt("0xc3")](f[tt("0x3")],t,F);if(!w(m)||!w(f))continue;var v=P[tt("0xb")](m,f,X),y=P[tt("0x208")]($[tt("0x9")][tt("0x209")],v),v=P[tt("0xc")]($[tt("0x9")][tt("0x209")],v,X),v=W[tt("0x20a")](v,y,B),y=P[tt("0x11d")](m,f),x=1,y=S[tt("0x21")]($[tt("0x22")][tt("0x220")](M[tt("0x23")](v,V),y,V),m,R)}else v=Z[tt("0xc3")](c[tt("0xc1")],t,B),y=w(v)?S[tt("0x21")](M[tt("0x23")](v,V),m,R):I[tt("0x25")](m,void 0,R);w(y)&&(f=c[tt("0x6b")],w(f)||(m=new b[tt("0x1b1")]({vertexFormat:$[tt("0x138")][tt("0x221")],angle:d,radius:x,stackPartitions:u,slicePartitions:p}),c[tt("0x6b")]=b[tt("0x1b1")][tt("0x55")](m),f=c[tt("0x6b")]),u=h[tt("0x82")],p=h[tt("0x7c")],g=h[tt("0x1d7")],w(g)||(g=1),m=h[tt("0x1d6")],w(m)||(m=_[tt("0x148")]),h=new $[tt("0x222")]({geometry:f,modelMatrix:y,attributes:{color:$[tt("0x20d")][tt("0x223")](u)}}),r[tt("0x4c")](h),p)&&(f=c[tt("0xd3")],w(f)||(u=new C[tt("0x1b7")]({vertexFormat:$[tt("0x138")][tt("0x192")],angle:d,radius:x}),c[tt("0xd3")]=C[tt("0x1b7")][tt("0x55")](u),f=c[tt("0xd3")]),h=new $[tt("0x222")]({geometry:f,modelMatrix:y,attributes:{color:$[tt("0x20d")][tt("0x223")](m)}}),o[tt("0x4c")](h))}}}}0<r[tt("0x2")]&&(this[tt("0x216")]=this[tt("0x1fe")][tt("0x9e")](new A({asynchronous:!1,geometryInstances:r,appearance:new G({flat:!1,translucent:!0,closed:!0})}))),0<o[tt("0x2")]&&(this[tt("0x217")]=this[tt("0x1fe")][tt("0x9e")](new A({asynchronous:!1,geometryInstances:o,appearance:new G({flat:!0,translucent:!0,renderState:{lineWidth:this[tt("0x1fd")][tt("0x224")](g)}})})))},e[tt("0x1e0")]=r},function(t,e,i){Object[tt("0x1d")](e,tt("0x1e"),{value:!0}),e[tt("0x21a")]=void 0;var n=i(3),a=$[tt("0x225")],r=$[tt("0x1b8")],o=$[tt("0x226")],i=$[tt("0x1ba")],s=$[tt("0x210")];function l(t){t=t||{},this[tt("0x74")]=void 0,this[tt("0x207")]=void 0,this[tt("0x78")]=void 0;var e=t[tt("0x227")];e instanceof n[tt("0x1dc")]||(e=new n[tt("0x1dc")](e)),this[tt("0x21f")]=e,this[tt("0x1ce")]=new s,this[tt("0x6b")]=void 0,this[tt("0xd3")]=void 0,this[tt("0x1d0")]=new r,this[tt("0x1d3")](t)}$[tt("0x211")],Object[tt("0xa3")](l[tt("0xa4")],{position:i(tt("0x3"),void 0,function(t){return new o(t)}),orientation:i(tt("0xc1")),show:i(tt("0x7a"))}),l[tt("0xa4")][tt("0x1d3")]=function(t){this[tt("0x3")]=t[tt("0x3")],this[tt("0xc1")]=t[tt("0xc1")],this[tt("0x7a")]=t[tt("0x7a")]},l[tt("0xa4")][tt("0x228")]=function(t){t instanceof a&&(this[tt("0x21f")][tt("0x1da")]=t)},e[tt("0x21a")]=l}],a={},n.m=i,n.c=a,n.d=function(t,e,i){n.o(t,e)||Object[tt("0x1d")](t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t[tt("0x1e")]?function(){return t[tt("0x131")]}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object[tt("0xa4")][tt("0xa0")][tt("0x130")](t,e)},n.p="",n(n.s=4);function n(t){var e;return(a[t]||(e=a[t]={i:t,l:!1,exports:{}},i[t][tt("0x130")](e[tt("0x12d")],e,e[tt("0x12d")],n),e.l=!0,e))[tt("0x12d")]}var i,a},typeof R===tt("0x12c")&&typeof module===tt("0x12c")?module[tt("0x12d")]=e():typeof define===tt("0xbe")&&define[tt("0x12e")]?define([],e):typeof R===tt("0x12c")?R[tt("0x12f")]=e():t[tt("0x12f")]=e())}(),t[tt("0x256")]=!0}let n=null;function $(t,e){t&&(this._viewer=t,n=e,q(Window,n),this._customPluginLayer=new n.CustomDataSource("_customPluginLayer"),t)&&t.dataSources.add(this._customPluginLayer)}$.prototype={createRectangularSensorGraphics:function(t){var e,i;if(this._customPluginLayer&&t)return e=new n.HeadingPitchRoll(n.Math.toRadians(t.heading||90),n.Math.toRadians(t.pitch||0),n.Math.toRadians(t.roll||0)),i=t.position,this._customPluginLayer.entities.add({position:i,orientation:n.Transforms.headingPitchRollQuaternion(i,e),rectangularSensor:new n.Scene.RectangularSensorGraphics({radius:t.radius||1e5,xHalfAngle:n.Math.toRadians(t.xHalfAngle||45),yHalfAngle:n.Math.toRadians(t.yHalfAngle||45),material:t.material||new n.Color(1,0,1,.4),lineColor:t.lineColor||new n.Color(1,0,1,1),showScanPlane:t.showScanPlane||!0,scanPlaneColor:t.scanPlaneColor||new n.Color(1,0,1,1),scanPlaneMode:t.scanPlaneMode||"vertical",scanPlaneRate:t.scanPlaneRate||3,showThroughEllipsoid:t.showThroughEllipsoid||!1,show:!0})})},createSatelliteCoverageSimulationGraphics:function(t){if(t)return new n.Scene.SatelliteCoverageSimulation(this._viewer,{position:t.position,angle1:t.angle1||30,angle2:t.angle2||45,areaType:t.areaType||2,rotation:{heading:n.Math.toRadians(t.heading||0),pitch:n.Math.toRadians(t.pitch||0),roll:n.Math.toRadians(t.roll||0)},color:t.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(t){if(t)return new n.Scene.RadarPrimitiveRight(this._viewer,{position:t.position,angle:t.angle||80,radius:t.radius||7e5,rotation:{heading:n.Math.toRadians(t.heading||0),pitch:n.Math.toRadians(t.pitch||40),roll:n.Math.toRadians(t.roll||0)},color:t.color||{red:1,green:0,blue:0,alpha:.4},lineColor:t.lineColor||{red:1,green:1,blue:1,alpha:.9}})}};let s,m,g=null,v={},w="move",A=null;function et(t,e){t&&(this._viewer=t,A=t,g=e,this._installFileDragDropHandler())}et.prototype={_installFileDragDropHandler(){function i(t,e){var i=document.createElement("div");i.id="fileDragDrop",i.classList.add("filedragdrop"),i.innerHTML="请将Json文件拖拽到此区域",this._dragBox=i,this._viewer=e,(this._parentDiv=t).appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}i.prototype.startuploadfile=function(){var i=this,t=i._dragBox,e=null;document.ondragover=function(){clearTimeout(e),e=setTimeout(function(){t.innerHTML="请将文件拖拽到此区域"},200)},t.ondragenter=function(){t.innerHTML="请释放鼠标"},t.ondragover=function(){return!1},t.ondragleave=function(){t.innerHTML="请将文件拖拽到此区域"},t.ondrop=function(t){t.preventDefault();var t=t.dataTransfer.files[0],e=new FileReader;return e.readAsText(t,"UTF-8"),e.onload=function(){var t=JSON.parse(this.result);i.fileDragDropCallBack&&i.fileDragDropCallBack(i.callBackParms,t,i._viewer)},e.onloadstart=function(){},e.onloadend=function(){},e.onabort=function(){alert("读取数据中断")},!(e.onerror=function(){alert("读取数据失败")})}},g.Scene.FileDragDropMixin=function(t){var e=new i(document.querySelector(".cesium-viewer"),t);Object.defineProperties(t,{fileDragDropMixin:{get:function(){return e}}})}},showLoadDataToScenePanel(t){if(t=t||{}){let t=new c.GUI,a=this._viewer,e=t.addFolder("加载数据文件"),i=t=>{let e=document.createElement("input");e.type="file",e.className="datgui_upload",e.onchange=function(){"function"==typeof t&&e.files.length&&t(URL.createObjectURL(e.files[0]))},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(e),e.click()},n={point:()=>{i(t=>{g.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.point={color:g.Color.BLUE}}a.flyTo(t)})})},polyline:()=>{i(t=>{g.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.polyline.width=5,n.polyline.material=new g.PolylineGlowMaterialProperty({glowPower:.1,color:g.Color.ORANGERED.withAlpha(.9)})}a.flyTo(t)})})},polygon:()=>{i(t=>{g.GeoJsonDataSource.load(t).then(function(t){a.dataSources.add(t);for(var e=t.entities.values,i=0;i<e.length;i++){var n=e[i];n.nameID=i,n.polygon.width=10,n.polygon.material=g.Color.BLUE.withAlpha(.9)}a.flyTo(t)})})},model:()=>{i(t=>{a.flyTo(d3kit.createModelGraphics({position:g.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:t}))})},czml:()=>{i(t=>{a.flyTo(a.dataSources.add(g.CzmlDataSource.load(t)))})},"3dtilset":()=>{i(t=>{a.flyTo(a.scene.primitives.add(new g.Cesium3DTileset({url:t})))})}};e.add(n,"point"),e.add(n,"polyline"),e.add(n,"polygon"),e.add(n,"model"),e.add(n,"czml"),e.add(n,"3dtilset"),e.open()}},showPostProcessStagesPanel(t){t=t||{};let e=null,i=new function(){this.blackAndWhiteShow=!1,this.blackAndWhiteGradations=5,this.brightnessShow=!1,this.brightnessValue=.5,this.nightVisionShow=!1,this.silhouette=!1},n=(t&&t.elementId?(e=new c.GUI({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new c.GUI,this._viewer.scene.postProcessStages),a=n.add(g.PostProcessStageLibrary.createSilhouetteStage()),r=n.add(g.PostProcessStageLibrary.createBlackAndWhiteStage()),o=n.add(g.PostProcessStageLibrary.createBrightnessStage()),s=n.add(g.PostProcessStageLibrary.createNightVisionStage());a.uniforms.color=t.silhouetteColor||g.Color.YELLOW,a.enabled=!1,r.enabled=!1,r.uniforms.gradations=5,o.enabled=!1,o.uniforms.brightness=.5,s.enabled=!1,e.add(i,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(t){r.enabled=t}),e.add(i,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(t){r.uniforms.gradations=t}),e.add(i,"brightnessShow").name("brightnessShow").onChange(function(t){o.enabled=t}),e.add(i,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(t){o.uniforms.brightness=t}),e.add(i,"nightVisionShow").name("nightVisionShow").onChange(function(t){s.enabled=t}),e.add(i,"silhouette").name("silhouette").onChange(function(t){a.enabled=t})},showSceneBloomPanel(t){let e=null,i=new function(){this.contrast=128,this.brightness=-.3,this.delta=1,this.gamma=3.5,this.enabled=!1,this.highDynamicRange=!1,this.shadows=!1,this.glowOnly=!1,this.sigma=1,this.stepSize=5},n=(t&&t.elementId?(e=new c.GUI({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new c.GUI,this._viewer),a=(e.__closeButton.innerHTML="收缩面板",n.scene.postProcessStages.bloom);e.add(i,"enabled").name("bloom").onChange(function(t){a.enabled=t}),e.add(i,"glowOnly").name("发光").onChange(function(t){a.uniforms.glowOnly=t}),e.add(i,"enabled").name("启用模糊").onChange(function(t){a.enabled=t}),e.add(i,"contrast",-255,255,.01).name("对比度").onChange(function(t){a.uniforms.contrast=t}),e.add(i,"brightness",-1,1,.01).name("光泽亮度").onChange(function(t){a.uniforms.brightness=t}),e.add(i,"delta",1,5,.01).name("因子").onChange(function(t){a.uniforms.delta=t}),e.add(i,"sigma",1,10,.01).name("sigma").onChange(function(t){a.uniforms.sigma=t}),e.add(i,"stepSize",.1,10).name("stepSize").onChange(function(t){a.uniforms.stepSize=t}),e.add(i,"shadows").name("启用阴影").onChange(function(t){n.shadows=t}),e.add(i,"highDynamicRange").name("高动态范围").onChange(function(t){n.scene.highDynamicRange=t}),e.add(i,"gamma",1,10,.01).name("伽马亮度").onChange(function(t){n.scene.gamma=t})},showPrimitiveMatrixPanel(e){let i=e.primitives._delegate||e.primitives,n=e.primitives,t=(this._viewer,null);e&&e.elementId?(t=new c.GUI({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new c.GUI;var a=t.addFolder("离地高度"),a=(a.add({height:100},"height",0,1e3,1).onChange(function(t){var e=n.boundingSphere,e=g.Cartographic.fromCartesian(e.center),i=g.Cartesian3.fromRadians(e.longitude,e.latitude,0),e=g.Cartesian3.fromRadians(e.longitude,e.latitude,t),t=g.Cartesian3.subtract(e,i,new g.Cartesian3);n.modelMatrix=g.Matrix4.fromTranslation(t)}),a.open(),t.addFolder("缩放大小")),r={"m+Scale":()=>{i.readyPromise.then(t=>{var e=t.root.transform;g.Matrix4.multiplyByUniformScale(e,1.2,e),t.root.transform=e})},"m-Scale":()=>{i.readyPromise.then(t=>{var e=t.root.transform;g.Matrix4.multiplyByUniformScale(e,.8,e),t.root.transform=e})}},r=(a.add(r,"m+Scale"),a.add(r,"m-Scale"),a.open(),{"x+Axis":()=>{var t=g.Matrix4.fromTranslation(new g.Cartesian3(20,0,0));g.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"x-Axis":()=>{var t=g.Matrix4.fromTranslation(new g.Cartesian3(-20,0,0));g.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"y+Axis":()=>{var t=g.Matrix4.fromTranslation(new g.Cartesian3(0,20,0));g.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"y-Axis":()=>{var t=g.Matrix4.fromTranslation(new g.Cartesian3(0,-20,0));g.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"z+Axis":()=>{var t=g.Matrix4.fromTranslation(new g.Cartesian3(0,0,20));g.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)},"z-Axis":()=>{var t=g.Matrix4.fromTranslation(new g.Cartesian3(0,0,-20));g.Matrix4.multiply(i.modelMatrix,t,i.modelMatrix)}}),a=t.addFolder("矩阵平移");a.add(r,"x+Axis"),a.add(r,"x-Axis"),a.add(r,"y+Axis"),a.add(r,"y-Axis"),a.add(r,"z+Axis"),a.add(r,"z-Axis"),a.open();let o={x:0,y:0,z:0},s={"x+Axis":()=>{o.x+=15,i.readyPromise.then(t=>{var e=g.Matrix3.fromRotationX(g.Math.toRadians(o.x)),e=g.Matrix4.fromRotationTranslation(e),i=g.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);g.Matrix4.multiply(i,e,i),t._root.transform=i})},"x-Axis":()=>{o.x-=15,i.readyPromise.then(t=>{var e=g.Matrix3.fromRotationX(g.Math.toRadians(o.x)),e=g.Matrix4.fromRotationTranslation(e),i=g.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);g.Matrix4.multiply(i,e,i),t._root.transform=i})},"y+Axis":()=>{o.y+=15,i.readyPromise.then(t=>{var e=g.Matrix3.fromRotationY(g.Math.toRadians(o.y)),e=g.Matrix4.fromRotationTranslation(e),i=g.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);g.Matrix4.multiply(i,e,i),t._root.transform=i})},"y-Axis":()=>{o.y-=15,i.readyPromise.then(t=>{var e=g.Matrix3.fromRotationY(g.Math.toRadians(o.y)),e=g.Matrix4.fromRotationTranslation(e),i=g.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);g.Matrix4.multiply(i,e,i),t._root.transform=i})},"z+Axis":()=>{o.z+=15,i.readyPromise.then(t=>{var e=g.Matrix3.fromRotationZ(g.Math.toRadians(o.z)),e=g.Matrix4.fromRotationTranslation(e),i=g.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);g.Matrix4.multiply(i,e,i),t._root.transform=i})},"z-Axis":()=>{o.z-=15,i.readyPromise.then(t=>{var e=g.Matrix3.fromRotationZ(g.Math.toRadians(o.z)),e=g.Matrix4.fromRotationTranslation(e),i=g.Transforms.eastNorthUpToFixedFrame(t.boundingSphere.center);g.Matrix4.multiply(i,e,i),t._root.transform=i})}},l=t.addFolder("旋转矩阵");l.add(s,"x+Axis"),l.add(s,"x-Axis"),l.add(s,"y+Axis"),l.add(s,"y-Axis"),l.add(s,"z+Axis"),l.add(s,"z-Axis"),l.open(),e.cb&&((r=t.addFolder("获取调整后的模型矩阵")).add({getModelMaterix:()=>{i.readyPromise.then(t=>{t=t.root.transform;e.cb({modelTransformMatrix:t,modelMatrix:n.modelMatrix})})}},"getModelMaterix").name("获取模型矩阵"),r.open()),t.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(e,i){if(e){let t=null;i&&i.elementId?(t=new c.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new c.GUI;var i=new function(){this.alpha=e.alpha,this.brightness=e.brightness,this.contrast=e.contrast,this.gamma=e.gamma,this.hue=e.hue,this.dayAlpha=e.dayAlpha,this.nightAlpha=e.nightAlpha,this.saturation=e.saturation},n=t.addFolder("图层调整");n.add(i,"alpha",0,1,.05).name("透明度").onChange(function(t){e.alpha=t}),n.add(i,"brightness",0,5,.05).name("亮度").onChange(function(t){e.brightness=t}),n.add(i,"contrast",0,5,.05).name("对比").onChange(function(t){e.contrast=t}),n.add(i,"gamma",0,5,.05).name("伽马").onChange(function(t){e.gamma=t}),n.add(i,"hue",0,5,.05).name("色调").onChange(function(t){e.hue=t}),n.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange(function(t){e.dayAlpha=t}),n.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(t){e.nightAlpha=t}),n.add(i,"saturation",0,5,.05).name("饱和").onChange(function(t){e.saturation=t}),n.open()}},showLayerSwitchPanel:function(e,i){if(e&&e.length){let t=null;i&&i.elementId?(t=new c.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new c.GUI;var n=new function(){e.forEach(t=>{this[t.id]=t.show})},a=t.addFolder("图层切换"),r=(e.forEach(e=>{a.add(n,e.id).name(e.name).onChange(function(t){e.show=t})}),new function(){e.forEach(t=>{this[t.id]=t.alpha})}),o=t.addFolder("透明度");e.forEach(e=>{o.add(r,e.id,0,1,.05).name(e.name).onChange(function(t){e.alpha=t})}),a.open(),o.open()}},showSceneEffectEditPanel:function(t){var e,i,n;t=t||{},c.GUI&&this._viewer.scene.colorCorrection&&(n=new c.GUI,(e=this._viewer).scene.lightSource.ambientLightColor=t.ambientLightColor||new g.Color(.3,.3,.3,1),e.scene.colorCorrection.show=t.colorCorrection||!1,e.scene.colorCorrection.saturation=t.saturation||3.1,e.scene.colorCorrection.brightness=t.brightness||1.8,e.scene.colorCorrection.contrast=t.contrast||1.2,e.scene.colorCorrection.hue=t.hue||0,e.scene.bloomEffect.show=t.bloomEffect||!1,e.scene.hdrEnabled=t.hdrEnabled||!0,e.scene.bloomEffect.threshold=t.threshold||1,e.scene.bloomEffect.bloomIntensity=t.bloomIntensity||2,i=new function(){this.bloomEffectShow=t.bloomEffect||!1,this.bloomThreshold=t.threshold||1,this.bloomIntensity=t.bloomIntensity||2,this.ambientLightColor=t.ambientLightColor||.3,this.hdrEnabled=t.hdrEnabled||!0,this.colorCorrectionShow=!1,this.colorCorrectionSaturation=t.saturation||3.1,this.colorCorrectionBrightness=t.brightness||1.8,this.colorCorrectionContrast=t.contrast||1.2,this.colorCorrectionHue=t.hue||0},n=n.addFolder("场景效果"),console.log("sceneEffect:",i),n.add(i,"bloomEffectShow").name("泛光开关").onChange(function(t){e.scene.bloomEffect.show=t,e.scene.bloomEffect.threshold=i.bloomThreshold,e.scene.bloomEffect.bloomIntensity=i.bloomIntensity}),n.add(i,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(t){e.scene.bloomEffect.threshold=t}),n.add(i,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(t){e.scene.bloomEffect.bloomIntensity=t}),n.add(i,"hdrEnabled").name("HDR开关").onChange(function(t){e.scene.hdrEnabled=t}),n.add(i,"colorCorrectionShow").name("颜色校正").onChange(function(t){e.scene.colorCorrection.show=t}),n.add(i,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(t){e.scene.colorCorrection.saturation=t}),n.add(i,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(t){e.scene.colorCorrection.brightness=t}),n.add(i,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(t){e.scene.colorCorrection.contrast=t}),n.add(i,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(t){e.scene.hdrEnabled=t}),n.add(i,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(t){e.scene.lightSource.ambientLightColor=new g.Color(t,t,t,1)}),n.open())},showEntityOrientationEditPanel:function(i={}){if(i.entity){let e=i.entity;var t=new c.GUI,n=(i&&i.elementId?(t=new c.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(t.domElement)):t=new c.GUI,new function(){this.heading=360,this.pitch=1,this.roll=1}),t=t.addFolder("实体姿态调整"),a=this;t.add(n,"heading",0,360,1).name("角度").onChange(function(t){n.heading=t;t=g.Transforms.headingPitchRollQuaternion(e.position.getValue(a._viewer.clock.currentTime),new g.HeadingPitchRoll(g.Math.toRadians(n.heading),g.Math.toRadians(n.pitch),g.Math.toRadians(n.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.add(n,"pitch",0,360,1).name("航向").onChange(function(t){n.pitch=t;t=g.Transforms.headingPitchRollQuaternion(e.position.getValue(a._viewer.clock.currentTime),new g.HeadingPitchRoll(g.Math.toRadians(n.heading),g.Math.toRadians(n.pitch),g.Math.toRadians(n.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.add(n,"roll",0,360,1).name("翻转").onChange(function(t){n.roll=t;t=g.Transforms.headingPitchRollQuaternion(e.position.getValue(a._viewer.clock.currentTime),new g.HeadingPitchRoll(g.Math.toRadians(n.heading),g.Math.toRadians(n.pitch),g.Math.toRadians(n.roll)));e.orientation=t,i.cb&&i.cb({orientation:t})}),t.open()}},definedMouseEvent({targetEntity:t,ctrlFlag:e}){m=t,v=e,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(e){if(v.leftDown&&s){let t=A.camera.getPickRay(e.endPosition),a=A.scene.globe.pick(t,A.scene);if(document.body.style.cursor="pointer",s&&s.id&&"move"===w){let t=g.JulianDate.fromDate(new Date),e=m.position.getValue(t),i=g.Cartographic.fromCartesian(e),n=Number(i.height.toFixed(3));m.position=new g.CallbackProperty(()=>{var t=A.scene.globe.ellipsoid.cartesianToCartographic(a),e=g.Math.toDegrees(t.longitude),t=g.Math.toDegrees(t.latitude);return g.Cartesian3.fromDegrees(e,t,n)},!1)}else{var i,n,r;s&&s.id&&"rotate"===w&&(n=g.JulianDate.fromDate(new Date),n=m.position.getValue(n),r=A.scene.camera.pickEllipsoid(e.startPosition),e=A.scene.camera.pickEllipsoid(e.endPosition),i=g.Cartesian3.subtract(n,e,new g.Cartesian3),i=g.Cartesian3.normalize(i,new g.Cartesian3),r=g.Cartesian3.subtract(r,n,new g.Cartesian3),e=g.Cartesian3.subtract(e,n,new g.Cartesian3),n=g.Cartesian3.angleBetween(r,e),r=g.Quaternion.fromAxisAngle(i,100*n),m.orientation=r)}}},defLeftDown(t){s=A.scene.pick(t.position),g.defined(s)&&w?(v.selected=!0,v.leftDown=!0):v.selected=!1},defMouseWheel(n){if(s&&s.id&&"scale"===w){let t=g.JulianDate.fromDate(new Date),e=m.box.dimensions.getValue(t),i=0<n?2:.5;m.box.dimensions=new g.CallbackProperty(()=>g.Cartesian3.multiplyByScalar(e,i,new g.Cartesian3),!1)}},defLeftUp(t){v.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(t){w=t,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(t){w=t,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(t){w=t,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let G=null;function it(t,e,i){t&&(this._viewer=t,G=e,this._pluginLayer=new G.CustomDataSource("pluginLayer"),t&&t.dataSources.add(this._pluginLayer),this._installPlugin())}it.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan()},_installTerrainClipPlan:function(){function t(t,e){this.viewer=t,this.options=e||{},this._positions=e.positions,this._height=this.options.height||0,this.bottomImg=e.bottomImg,this.wallImg=e.wallImg,this.splitNum=G.defaultValue(e.splitNum,50),this._positions&&0<this._positions.length&&this.updateData(this._positions)}Object.defineProperties(t.prototype,{show:{get:function(){return this._show},set:function(t){this._show=t,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=t),this._switchExcavate(t)}},height:{get:function(){return this._height},set:function(t){this._height=t,this._updateExcavateDepth(t)}}}),t.prototype.updateData=function(t){var e=[],i=t.length-1,n=new G.Cartesian3,a=0<G.Cartesian3.subtract(t[0],t[1],n).x;this.excavateMinHeight=9999;for(var r=0;r<i;r++){var o=(r+1)%i,s=G.Cartesian3.midpoint(t[r],t[o],new G.Cartesian3),l=G.Cartographic.fromCartesian(t[r]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=G.Cartesian3.normalize(s,new G.Cartesian3),o=a?G.Cartesian3.subtract(t[r],s,new G.Cartesian3):G.Cartesian3.subtract(t[o],s,new G.Cartesian3),o=(o=G.Cartesian3.normalize(o,o),G.Cartesian3.cross(o,l,new G.Cartesian3)),o=G.Cartesian3.normalize(o,o),l=new G.Plane(o,0),l=G.Plane.getPointDistance(l,s);e.push(new G.ClippingPlane(o,l))}this.viewer.scene.globe.clippingPlanes=new G.ClippingPlaneCollection({planes:e,edgeWidth:1,edgeColor:G.Color.WHITE,enabled:!0}),this._prepareWell(t),this._createWell(this.wellData)},t.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()},t.prototype._prepareWell=function(t){var e=this.splitNum,i=t.length;if(0!=i){for(var n=this.excavateMinHeight-this.height,a=[],r=[],o=[],s=0;s<i;s++){var l=s==i-1?0:s+1,c=G.Cartographic.fromCartesian(t[s]),l=G.Cartographic.fromCartesian(t[l]),h=[c.longitude,c.latitude],d=[l.longitude,l.latitude];0==s&&(o.push(new G.Cartographic(h[0],h[1])),r.push(G.Cartesian3.fromRadians(h[0],h[1],n)),a.push(G.Cartesian3.fromRadians(h[0],h[1],0)));for(var x=1;x<=e;x++){var u=G.Math.lerp(h[0],d[0],x/e),p=G.Math.lerp(h[1],d[1],x/e);s==i-1&&x==e||(o.push(new G.Cartographic(u,p)),r.push(G.Cartesian3.fromRadians(u,p,n)),a.push(G.Cartesian3.fromRadians(u,p,0)))}}this.wellData={lerp_pos:o,bottom_pos:r,no_height_top:a}}},t.prototype._createWell=function(r){var o,t;this.viewer.terrainProvider._layers?((o=this)._createBottomSurface(r.bottom_pos),t=G.sampleTerrainMostDetailed(this.viewer.terrainProvider,r.lerp_pos),G.when(t,function(t){for(var e=t.length,i=[],n=0;n<e;n++){var a=G.Cartesian3.fromRadians(t[n].longitude,t[n].latitude,t[n].height);i.push(a)}o._createWellWall(r.bottom_pos,i)})):(this._createBottomSurface(r.bottom_pos),this._createWellWall(r.bottom_pos,r.no_height_top))},t.prototype._getMinHeight=function(e){let i=5e6,n=null;for(let t=0;t<e.length;t++){var a=e[t].z;a<i&&(i=a,n=this._ellipsoidToLonLat(e[t]))}return n.altitude},t.prototype._ellipsoidToLonLat=function(t){var e=this.viewer.scene.globe.ellipsoid,t=new G.Cartesian3(t.x,t.y,t.z),e=e.cartesianToCartographic(t),t=G.Math.toDegrees(e.latitude);return{longitude:G.Math.toDegrees(e.longitude),latitude:t,altitude:e.height}},t.prototype._createBottomSurface=function(e){if(e.length){var i=this._getMinHeight(e),n=[];for(let t=0;t<e.length;t++){var a=this._ellipsoidToLonLat(e[t]);n.push(a.longitude),n.push(a.latitude),n.push(i)}var t=new G.PolygonGeometry({polygonHierarchy:new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),t=G.PolygonGeometry.createGeometry(t),r=new G.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),r=new G.MaterialAppearance({translucent:!1,flat:!0,material:r});this.bottomSurface=new G.Primitive({geometryInstances:new G.GeometryInstance({geometry:t}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},t.prototype._createWellWall=function(t,e){var i=this._getMinHeight(t),n=[],a=[];for(let t=0;t<e.length;t++)n.push(this._ellipsoidToLonLat(e[t]).altitude),a.push(i);var t=new G.WallGeometry({positions:e,maximumHeights:n,minimumHeights:a}),t=G.WallGeometry.createGeometry(t),r=new G.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),r=new G.MaterialAppearance({translucent:!1,flat:!0,material:r});this.wellWall=new G.Primitive({geometryInstances:new G.GeometryInstance({geometry:t,attributes:{color:G.ColorGeometryInstanceAttribute.fromColor(G.Color.GREY)},id:"PitWall"}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},t.prototype._switchExcavate=function(t){t?(this.viewer.scene.globe.material=G.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)},t.prototype._updateExcavateDepth=function(t){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var e=this.wellData.lerp_pos,i=[],n=e.length,a=0;a<n;a++)i.push(G.Cartesian3.fromRadians(e[a].longitude,e[a].latitude,this.excavateMinHeight-t));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)},G.Scene.TerrainClipPlan=t},buildLightScanGraphics:function(t){if(this._viewer&&t){for(var l=this,e=function(e,t,i){var n,a,r,o,s,l,c=e.positionList,h=0,d=0;function x(t){n=c[t+1][0]-c[t][0],a=c[t+1][1]-c[t][1],r=n/e.number,o=a/e.number,d=0}x(h),t.polygon.hierarchy=new G.CallbackProperty(function(){return Math.abs(s)>=Math.abs(n)&&Math.abs(l)>=Math.abs(a)&&((h+=1)===c.length-1&&(h=0),i[0]=i[0]+s,i[1]=i[1]+l,i[2]=i[2]+s,i[3]=i[3]+l,x(h)),s=d*r,l=d*o,d++,new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([e.observer[0],e.observer[1],e.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))},!1)},i=l._getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),n=function(t,e){for(var i=e.observer[0],n=e.observer[1],a=e.observer[2],r=[],o=0;o<t.length;o++){var s=o===t.length-1?new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([i,n,a,t[o].x,t[o].y,0,t[0].x,t[0].y,0])):new G.PolygonHierarchy(G.Cartesian3.fromDegreesArrayHeights([i,n,a,t[o].x,t[o].y,0,t[o+1].x,t[o+1].y,0])),s=l._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:s,outline:!1,perPositionHeight:!0,material:e.material}});r.push(s)}return r}(i,t),a=0;a<n.length;a++)a!==n.length-1?e(t,n[a],[i[a].x,i[a].y,i[a+1].x,i[a+1].y]):e(t,n[a],[i[a].x,i[a].y,i[0].x,i[0].y]);return n}},buildPathRoaming:function(t){if(this._viewer&&t&&t.paths){for(var e=t.paths,i=this.createGraphics(),n=[],a=0;a<e.length;a++){var r=G.Cartesian3.fromDegrees(Number(e[a].lng),Number(e[a].lat),Number(e[a].alt));n.push(r)}if(i.position=this._createSampledPosition(n),i.name=t.name||"路径漫游",i.availability=new G.TimeIntervalCollection([new G.TimeInterval({start:this.startTime,stop:this.stopTime})]),i.orientation=this._sampleOrientation(),t.polyline){const{width:e,material:a,clampToGround:r,...o}=t.polyline;i.polyline={positions:new G.CallbackProperty(function(){return n},!1),width:e||10,material:a||new G.PolylineGlowMaterialProperty({glowPower:1,color:G.Color.RED}),clampToGround:r||!0,resOpt:o}}return t.model&&(i.model=this.getModelGraphics(t.model)),t.label&&(i.label=this.getLabelGraphics(t)),t.billboard&&(i.billboard=this.getBillboardGraphics(t)),this.droneEntity=i,this._beginRoamTrace(t),this._viewer.entities.add(i)}},_beginRoamTrace(i){this._viewer.clock.onTick.addEventListener(()=>{var t,e;this._viewer.clock.shouldAnimate&&(e=this._viewer.clock.currentTime,t=this.droneEntity.position.getValue(e),e=this.droneEntity.orientation.getValue(e),t)&&e&&(e=G.Matrix4.fromRotationTranslation(G.Matrix3.fromQuaternion(e),t),this._viewer.camera.lookAtTransform(e,i.cameraOffset()))})},_createSampledPosition(e){this.startTime=G.JulianDate.now(),this.stopTime=G.JulianDate.addSeconds(this.startTime,60*e.length,new G.JulianDate),this._viewer.clock.startTime=this.startTime.clone(),this._viewer.clock.stopTime=this.stopTime.clone(),this._viewer.clock.currentTime=this.startTime.clone(),this._viewer.clock.clockRange=G.ClockRange.CLAMPED;var i=new G.SampledPositionProperty;for(let t=0;t<e.length;t++){var n=G.JulianDate.addSeconds(this.startTime,60*t,new G.JulianDate),a=e[t];i.addSample(n,a)}return i},_sampleOrientation(){let a,r,o;return new G.CallbackProperty(t=>{var e=this.droneEntity.position.getValue(t);if(r=this.droneEntity.position.getValue(G.JulianDate.addSeconds(t,1/60,new G.JulianDate)),e&&r){a=e;const t=G.Cartesian3.subtract(r,a,new G.Cartesian3),i=G.Cartesian3.normalize(t,new G.Cartesian3),n=G.Transforms.rotationMatrixFromPositionVelocity(a,i,G.Ellipsoid.WGS84);o=G.Quaternion.fromRotationMatrix(n)}return o},!1)},_installCss3Renderer:function(){function t(t,e){this._scratch=new G.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=t,this._isBackHide=e,this.init()}var i;this._viewer&&(i=this._viewer,t.prototype.init=function(){var a=document.createElement("div"),r=(a.className="ys-css3-container",document.getElementById("info-warp").appendChild(a),this._container=a,this._elements.forEach(function(t){a.insertAdjacentHTML("beforeend",t.element)}),this);this._scene.preRender.addEventListener(function(){for(var t=0;t<a.children.length;t++){var e,i=G.Cartesian3.fromDegrees(r._elements[t].position[0],r._elements[t].position[1],r._elements[t].position[2]||0),n=r._scene.cartesianToCanvasCoordinates(i,r._scratch);G.defined(n)&&(a.children[t].style.left=parseFloat(n.x)+parseFloat(r._elements[t].offset[0])+"px",a.children[t].style.top=parseFloat(n.y)+parseFloat(r._elements[t].offset[1])+"px",r._isBackHide)&&(n=r._camera.position,e=r._scene.globe.ellipsoid.cartesianToCartographic(n).height,e+=+r._scene.globe.ellipsoid.maximumRadius,G.Cartesian3.distance(n,i)>e?a.children[t].style.display="none":a.children[t].style.display="block")}})},t.prototype.remove=function(t){this._elements=this._elements.filter(function(t){t.id}),this._container.removeChild(document.getElementById(t))},t.prototype.append=function(t){this._elements.push(t),this._container.insertAdjacentHTML("beforeend",t.element)},t.prototype.removeEntityLayer=function(t){this._viewer.entities.removeById(t+"_1"),this._viewer.entities.removeById(t+"_2"),this._viewer.entities.removeById(t+"_3"),this.remove(t)},t.prototype.addEntityLayer=function(t){var e=t.position[0],i=t.position[1],n=this,a=(setTimeout(function(t){},300),G.Math.toRadians(30)),r=G.Math.toRadians(30),o=t.boxHeight||300,s=t.boxHeightMax||400,l=t.boxHeightDif||10,c=!0;t.boxShow?this._viewer.entities.add({id:t.id+"_1",name:"立方体盒子",position:new G.CallbackProperty(function(){return(o+=l)>=s&&(o=s),G.Cartesian3.fromDegrees(e,i,o/2)},!1),box:{dimensions:new G.CallbackProperty(function(){return(o+=l)>=s&&(o=s,c)&&(c=!1,n.append(t,!0)),new G.Cartesian3(t.boxSide||100,t.boxSide||100,o)},!1),material:t.boxMaterial||G.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){n.append(t,!0)},100),t.circleShow&&(t.circleSize=t.circleSize||120,this._viewer.entities.add({id:t.id+"_2",name:"椭圆",position:G.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new G.CallbackProperty(function(){return.001},!1),semiMajorAxis:new G.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new G.CallbackProperty(function(){return a+=.05},!1),stRotation:new G.CallbackProperty(function(){return a+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:t.id+"_3",name:"椭圆",position:G.Cartesian3.fromDegrees(e,i),ellipse:{semiMinorAxis:new G.CallbackProperty(function(){return.001},!1),semiMajorAxis:new G.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new G.CallbackProperty(function(){return r-=.03},!1),stRotation:new G.CallbackProperty(function(){return r-=.03},!1),zIndex:3}}))},G.Scene.Css3Renderer=t)}};let P=null;function nt(t,e,i){t&&(P=e,this._analysisLayer=new P.CustomDataSource("analysisLayer"),this.$math3d=new z(t,e),this.$graphics=new y(t,e),t)&&t.dataSources.add(this._analysisLayer)}function at(t){if(t&&t.positions){var e=t.positions,i=t.that,n=[],t=[],a=[],r=i.transformWGS84ToCartesian(e[0]),e=i.transformWGS84ToCartesian(e[1]),n=i.$graphics.createPointsGraphics({point:!0,positions:[r,e]}),o=i.$math3d.getIntersectObj(r,e,n,!0);if(0===o.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;for(let t=o.length-1;0<=t;t--){const l=o[t];P.defined(l.position)||o.splice(t,1)}if(!P.defined(o[0].position))throw new P.DeveloperError("position is undefined");var s=o[0].position,l=P.Cartesian3.distance(s,e)<5,s=[r,o[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:P.ArcType.NONE,material:new P.PolylineArrowMaterialProperty(P.Color.GREEN)}});t.push(s),l||(s=[o[0].position,e],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:P.ArcType.NONE,material:new P.PolylineArrowMaterialProperty(P.Color.RED)}}),t.push(s));for(let t=0;t<o.length;++t){var c,h=o[t].object;h&&(h instanceof P.Cesium3DTileFeature?(a.push(h),h.oldColor=h.color.clone(),h.color=P.Color.fromAlpha(P.Color.YELLOW,h.color.alpha)):h.id instanceof P.Entity&&(c=(h=h.id).polygon||h.polyline,a.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=P.Color.fromAlpha(P.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:o[t].position,ellipsoid:{radii:new P.Cartesian3(.8,.8,.8),material:P.Color.RED}}))}var s=P.Cartographic.fromCartesian(r),t=P.Cartographic.fromCartesian(e),s={longitude:s.longitude/Math.PI*180,latitude:s.latitude/Math.PI*180,height:s.height},t={longitude:t.longitude/Math.PI*180,latitude:t.latitude/Math.PI*180,height:t.height},r=Math.sqrt(Math.pow(r.x-e.x,2)+Math.pow(r.y-e.y,2)+Math.pow(r.z-e.z,2)),e=Math.abs(t.height-s.height),d=Math.sqrt(Math.pow(r,2)+Math.pow(e,2)),l=l?"是":"否",s="起点坐标: ("+s.longitude.toFixed(6)+"°,"+s.latitude.toFixed(6)+"°,"+s.height.toFixed(2)+")\n终点坐标: ("+t.longitude.toFixed(6)+"°,"+t.latitude.toFixed(6)+"°,"+t.height.toFixed(2)+")\n垂直距离: "+e.toFixed(2)+"m\n水平距离: "+r.toFixed(2)+"m\n空间距离: "+d.toFixed(2)+"m\n是否可视: "+l;n&&n[0]&&(n[0].label={text:s,showBackground:!0,font:"14px monospace",fillColor:P.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:P.VerticalOrigin.BOTTOM,horizontalOrigin:P.HorizontalOrigin.LEFT})}at.prototype.remove=function(){}}function rt(t){if(!t&&!t.center&&!t.radius&&t.that)return alert("没有获取到分析参数"),!1;var l=t.that,e=this;if(!l._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var c=t.viewHeight||10,i=P.Cartographic.fromCartesian(t.center);try{var n=t.radius,a={},r=(a.semiMinorAxis=n,a.semiMajorAxis=n,a.rotation=0,a.center=t.center,a.granularity=Math.PI/45,l.computeEllipseEdgePositions(a));for(let t=0;t<r.outerPositions.length;t+=3){var o=new P.Cartesian3(r.outerPositions[t],r.outerPositions[t+1],r.outerPositions[t+2]),s=P.Cartographic.fromCartesian(o),h=5e-5*Math.PI/180,d=l.computeInterpolateLineCartographic(i,s,h);l.computeCartographicPointsTerrainData(d,function(r){if(0<r.length){let i=!0,n=[],a=[];for(let t=1;t<r.length;t++){let e=!0;if(1<t){var o=new P.Cartographic(r[0].longitude,r[0].latitude,r[0].height+c);if(i)e=l.computeInterpolateIndexLineHeightCartographic(o,r[t],t,t-1).height>=r[t-1].height?i=!0:i=!1;else{var s=l.computeInterpolateIndexLineHeightCartographic(o,r[t],t,t-1);for(let t=0;t<s.length;t++){if(!(s[t].height>=r[t].height)){i=!1,e=!1;break}i=!0,e=!0}}}o=P.Cartesian3.fromRadians(r[t].longitude,r[t].latitude,r[t].height+1);n.push(o),e?(a.push(0),a.push(0),a.push(1)):(a.push(1),a.push(0),a.push(0)),a.push(1)}e._pointsKSYResult=new P.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:a})}else alert("高程异常!")})}}catch(t){console.log(t)}rt.prototype.remove=function(){}}function ot(t){if(t&&t.positions){for(var e=t.positions,i=t.that,n=i.transformWGS84ToCartesian(e[0]),a=i.transformWGS84ToCartesian(e[1]),r=[P.Cartographic.fromCartesian(n)],o=new P.Cartesian3,s=[0],l=[0],c=1;c<=10;c++){P.Cartesian3.lerp(n,a,c/10,o);var h=P.Cartographic.fromCartesian(o),d=i._viewer.scene.globe.getHeight(h),d=(h.height=d,r.push(h),r[c-1]),x=P.Cartesian3.distance(P.Cartographic.toCartesian(d),P.Cartographic.toCartesian(h));l.push(l[c-1]+x),h=Math.asin((h.height-d.height)/x),s.push(100*Math.tan(h))}t=document.createElement("div");t.className="echart-viewer",i._viewer.container.appendChild(t,"dark",{renderer:"canvas",width:640,height:480}),t.style.position="absolute",t.style.left="20px",t.style.bottom="20px",t.style.height="300px",t.style.width="640px",t.style.overflow="hidden",t.style.zIndex="9999",t.style.opacity=.9,u.init(t).setOption({title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!1,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0,xAxis:[{type:"category",name:"长度(米)",boundaryGap:!1,data:l,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"坡度(%)",axisLabel:{formatter:function(t){return t.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"坡度",type:"line",areaStyle:{},smooth:!0,data:s,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]})}}function st(t){if(t&&t.positions&&t.that){var e=t.that,i=t.positions,t=this,n=e._viewer.terrainProvider.availability;if(n){for(var a=15e3,r=0;r<i.length;r++){var o=P.Cartographic.fromCartesian(i[r]),s=e._viewer.scene.globe.getHeight(o);s<a&&(a=s),n.computeMaximumLevelAtPosition(o)}var l=Math.PI/Math.pow(2,11);l/=64;for(var c,h,d,x,u,p,m,g,l=new P.PolygonGeometry.fromPositions({positions:i,vertexFormat:P.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:l}),f=new P.PolygonGeometry.createGeometry(l),v=0,y=0,b=new P.Cartesian3,r=0;r<f.indices.length;r+=3){c=f.indices[r],h=f.indices[r+1],u=f.indices[r+2],p=f.attributes.position.values,b.x=p[3*c],b.y=p[3*c+1],b.z=p[3*c+2],o=P.Cartographic.fromCartesian(b),c=e._viewer.scene.globe.getHeight(o),d=P.Cartesian3.fromRadians(o.longitude,o.latitude,c),m=P.Cartesian3.fromRadians(o.longitude,o.latitude,0),y<c&&(y=c),b.x=p[3*h],b.y=p[3*h+1],b.z=p[3*h+2],o=P.Cartographic.fromCartesian(b),h=e._viewer.scene.globe.getHeight(o),x=P.Cartesian3.fromRadians(o.longitude,o.latitude,h),w=P.Cartesian3.fromRadians(o.longitude,o.latitude,0),y<h&&(y=h),b.x=p[3*u],b.y=p[3*u+1],b.z=p[3*u+2],o=P.Cartographic.fromCartesian(b),p=e._viewer.scene.globe.getHeight(o),u=P.Cartesian3.fromRadians(o.longitude,o.latitude,p),g=P.Cartesian3.fromRadians(o.longitude,o.latitude,0),y<p&&(y=p),m=m,w=w,g=g,C=void 0,C=P.Cartesian3.distance(m,w),w=P.Cartesian3.distance(w,g),g=P.Cartesian3.distance(g,m),m=(C+w+g)/2,v+=Math.sqrt(m*(m-C)*(m-w)*(m-g))*(c-a+h-a+p-a)/3;var C=[],w=(C.push(d),C.push(x),C.push(u),{polygon:{hierarchy:{positions:C},extrudedHeight:0,perPositionHeight:!0,material:P.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:P.Color.WHITE,outlineWidth:2}});e._analysisLayer.entities.add(w)}l=function(t){for(var e=[],i=[],n=0;n<t.length;n++){var a=P.Cartographic.fromCartesian(t[n]);e.push(a.longitude),i.push(a.latitude)}for(var r,o,s,l=0,c=0,h=0,d=0,x=0,n=0;n<t.length;n++)h+=s=(r=e[n])*(c=n==t.length-1?(l=e[0],i[0]):(l=e[n+1],i[n+1]))-l*(o=i[n]),d+=(r+l)*s,x+=(o+c)*s;return d/=6*(h*=.5),x/=6*h,new P.Cartographic(d,x)}(i),t._volumeLabel=e._analysisLayer.entities.add({position:P.Cartesian3.fromRadians(l.longitude,l.latitude,y+1e3),label:{text:"Cut Volume "+v.toString()+"m3"}})}else alert("未获取到地形")}}nt.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(t,e){t=new at({positions:t,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(e),"function"==typeof i.callback&&i.callback(t)}})},createLookAroundAnalysis:function(i){var n;i=i||{},this._viewer&&i&&(n=this).drawCircleGraphics({callback:function(t,e){n._drawLayer.entities.remove(e);e=new rt({that:n,radius:t.radius,center:t.center});"function"==typeof i.callback&&i.callback(e)}})},createVisualFieldAnalysis:function(t){var i,n;t=t||{},this._viewer&&t&&(n=null,(i=this).bindHandelEvent({leftClick:function(t,e){t=i._viewer.scene.pickPosition(t.position);if(!t)return!1;P.defined(n)?e.destroy():(n=new P.Scene.ShadowPrimitive({scene:i._viewer.scene,viewerPosition:t}),i._analysisLayer._primitives.add(n))},mouseMove:function(t){t=i._viewer.scene.pickPosition(t.endPosition);if(!t)return!1;n&&n.setPoseByTargetPoint(t)}}))},createClipPlanAnalysis:function(i){var n,a,r,o,s;i=i||{},this._viewer&&i&&(n=this,a=i.height||30,r=i.splitNum||50,o=i.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",s=i.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg",n.drawPolygonGraphics({callback:function(t,e){n._drawLayer.entities.remove(e);e=new P.Scene.TerrainClipPlan(n._viewer,{height:a,splitNum:r,wallImg:o,bottomImg:s}),t=n.transformWGS84ArrayToCartesianArray(t);e.updateData(t),"function"==typeof i.callback&&i.callback(e)}}))},createSubmergedAnalysis:function(t){var e,n,a,r,o;t=t||{},this._viewer&&t&&(n=t.maxH||15,a=t.speed||1,r=t.interval||10,o=(e=this).getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png",e.drawPolygonGraphics({height:1,callback:function(t,i){if(!e._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;i&&setTimeout(()=>{i.polygon.heightReference="CLAMP_TO_GROUND",i.polygon.material=o;var t=0,e=(i.polygon.extrudedHeight=t,setInterval(function(){(t+=a)>=n&&(t=n,clearTimeout(e)),i.polygon.extrudedHeight=t},r))},2e3)}}))},createSlopeAnalysis:function(i){if(i=i||{},!u)return alert("需要引入echarts库"),!1;var n=this;this._viewer&&i&&n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(t,e){t=new ot({positions:t,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(e),"function"==typeof i.callback&&i.callback(t)}})},createCutVolumeAnalysis:function(e){var i;e=e||{},this._viewer&&e&&(i=this).drawWallGraphics({callback:function(t){t=new st({positions:i.transformWGS84ArrayToCartesianArray(t,100),that:i});"function"==typeof e.callback&&e.callback(t)}})}};var W={version:"1.0.0",PlotUtils:{}},M=(W.PlotUtils.distance=function(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2))},W.PlotUtils.wholeDistance=function(t){for(var e=0,i=0;i<t.length-1;i++)e+=W.PlotUtils.distance(t[i],t[i+1]);return e},W.PlotUtils.getBaseLength=function(t){return Math.pow(W.PlotUtils.wholeDistance(t),.99)},W.PlotUtils.mid=function(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]},W.PlotUtils.getCircleCenterOfThreePoints=function(t,e,i){var n=[(t[0]+e[0])/2,(t[1]+e[1])/2],e=[n[0]-t[1]+e[1],n[1]+t[0]-e[0]],a=[(t[0]+i[0])/2,(t[1]+i[1])/2],t=[a[0]-t[1]+i[1],a[1]+t[0]-i[0]];return W.PlotUtils.getIntersectPoint(n,e,a,t)},W.PlotUtils.getIntersectPoint=function(t,e,i,n){var a,r,o;return t[1]==e[1]?[(a=(n[0]-i[0])/(n[1]-i[1]))*(t[1]-i[1])+i[0],r=t[1]]:i[1]==n[1]?[(o=(e[0]-t[0])/(e[1]-t[1]))*(i[1]-t[1])+t[0],r=i[1]]:(o=(e[0]-t[0])/(e[1]-t[1]),a=(n[0]-i[0])/(n[1]-i[1]),[o*(r=(o*t[1]-t[0]-a*i[1]+i[0])/(o-a))-o*t[1]+t[0],r])},W.PlotUtils.getAzimuth=function(t,e){var i,n=Math.asin(Math.abs(e[1]-t[1])/W.PlotUtils.distance(t,e));return e[1]>=t[1]&&e[0]>=t[0]?i=n+Math.PI:e[1]>=t[1]&&e[0]<t[0]?i=W.Constants.TWO_PI-n:e[1]<t[1]&&e[0]<t[0]?i=n:e[1]<t[1]&&e[0]>=t[0]&&(i=Math.PI-n),i},W.PlotUtils.getAngleOfThreePoints=function(t,e,i){t=W.PlotUtils.getAzimuth(e,t)-W.PlotUtils.getAzimuth(e,i);return t<0?t+W.Constants.TWO_PI:t},W.PlotUtils.isClockWise=function(t,e,i){return(i[1]-t[1])*(e[0]-t[0])>(e[1]-t[1])*(i[0]-t[0])},W.PlotUtils.getPointOnLine=function(t,e,i){return[e[0]+t*(i[0]-e[0]),e[1]+t*(i[1]-e[1])]},W.PlotUtils.getCubicValue=function(t,e,i,n,a){var r=1-(t=Math.max(Math.min(t,1),0)),o=t*t,s=o*t,l=r*r,c=l*r;return[c*e[0]+3*l*t*i[0]+3*r*o*n[0]+s*a[0],c*e[1]+3*l*t*i[1]+3*r*o*n[1]+s*a[1]]},W.PlotUtils.getThirdPoint=function(t,e,i,n,a){t=W.PlotUtils.getAzimuth(t,e),a=a?t+i:t-i,t=n*Math.cos(a),i=n*Math.sin(a);return[e[0]+t,e[1]+i]},W.PlotUtils.getArcPoints=function(t,e,i,n){for(var a=[],r=(r=n-i)<0?r+W.Constants.TWO_PI:r,o=0;o<=W.Constants.FITTING_COUNT;o++){var s=i+r*o/W.Constants.FITTING_COUNT,l=t[0]+e*Math.cos(s),s=t[1]+e*Math.sin(s);a.push([l,s])}return a},W.PlotUtils.getBisectorNormals=function(t,e,i,n){var a,r,o=W.PlotUtils.getNormal(e,i,n),s=Math.sqrt(o[0]*o[0]+o[1]*o[1]),l=o[0]/s,o=o[1]/s,c=W.PlotUtils.distance(e,i),h=W.PlotUtils.distance(i,n),s=s>W.Constants.ZERO_TOLERANCE?W.PlotUtils.isClockWise(e,i,n)?(a=[i[0]-(r=t*c)*o,i[1]+r*l],[i[0]+(r=t*h)*o,i[1]-r*l]):(a=[i[0]+(r=t*c)*o,i[1]-r*l],[i[0]-(r=t*h)*o,i[1]+r*l]):(a=[i[0]+t*(e[0]-i[0]),i[1]+t*(e[1]-i[1])],[i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])]);return[a,s]},W.PlotUtils.getNormal=function(t,e,i){var n=t[0]-e[0],t=t[1]-e[1],a=Math.sqrt(n*n+t*t),a=(n/=a,t/=a,i[0]-e[0]),i=i[1]-e[1],e=Math.sqrt(a*a+i*i);return[n+(a/=e),t+(i/=e)]},W.PlotUtils.getCurvePoints=function(t,e){for(var i=[W.PlotUtils.getLeftMostControlPoint(e)],n=0;n<e.length-2;n++)var a=e[n],r=e[n+1],o=e[n+2],o=W.PlotUtils.getBisectorNormals(t,a,r,o),i=i.concat(o);for(var s=W.PlotUtils.getRightMostControlPoint(e),l=(i.push(s),[]),n=0;n<e.length-1;n++){for(a=e[n],r=e[n+1],l.push(a),t=0;t<W.Constants.FITTING_COUNT;t++){var c=W.PlotUtils.getCubicValue(t/W.Constants.FITTING_COUNT,a,i[2*n],i[2*n+1],r);l.push(c)}l.push(r)}return l},W.PlotUtils.getLeftMostControlPoint=function(e){var i,n,a,r,o,s=e[0],l=e[1],e=e[2],c=W.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=W.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>W.Constants.ZERO_TOLERANCE?(e=W.PlotUtils.mid(s,l),a=s[0]-e[0],i=s[1]-e[1],n=2/W.PlotUtils.distance(s,l),r=c[0]-e[0],c=c[1]-e[1],o=e[0]+((i=-n*i)*i-(n=n*a)*n)*r+(a=2*i*n)*c,e[1]+a*r+(n*n-i*i)*c):(o=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[o,e]},W.PlotUtils.getRightMostControlPoint=function(e){var i,n,a,r,o,s=e.length,l=e[s-3],c=e[s-2],e=e[s-1],s=W.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=W.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>W.Constants.ZERO_TOLERANCE?(l=W.PlotUtils.mid(c,e),a=e[0]-l[0],i=e[1]-l[1],n=2/W.PlotUtils.distance(c,e),r=s[0]-l[0],s=s[1]-l[1],o=l[0]+((i=-n*i)*i-(n=n*a)*n)*r+(a=2*i*n)*s,l[1]+a*r+(n*n-i*i)*s):(o=e[0]+t*(c[0]-e[0]),e[1]+t*(c[1]-e[1]));return[o,l]},W.PlotUtils.getBezierPoints=function(t){if(t.length<=2)return t;for(var e=[],i=t.length-1,n=0;n<=1;n+=.01){for(var a=0,r=0,o=0;o<=i;o++){var s=W.PlotUtils.getBinomialFactor(i,o),l=Math.pow(n,o),c=Math.pow(1-n,i-o);a+=s*l*c*t[o][0],r+=s*l*c*t[o][1]}e.push([a,r])}return e.push(t[i]),e},W.PlotUtils.getBinomialFactor=function(t,e){return W.PlotUtils.getFactorial(t)/(W.PlotUtils.getFactorial(e)*W.PlotUtils.getFactorial(t-e))},W.PlotUtils.getFactorial=function(t){if(t<=1)return 1;if(2==t)return 2;if(3==t)return 6;if(4==t)return 24;if(5==t)return 120;for(var e=1,i=1;i<=t;i++)e*=i;return e},W.PlotUtils.getQBSplinePoints=function(t){if(t.length<=2)return t;var e=[],i=t.length-2-1;e.push(t[0]);for(var n=0;n<=i;n++)for(var a=0;a<=1;a+=.05){for(var r=0,o=0,s=0;s<=2;s++){var l=W.PlotUtils.getQuadricBSplineFactor(s,a);r+=l*t[n+s][0],o+=l*t[n+s][1]}e.push([r,o])}return e.push(t[t.length-1]),e},W.PlotUtils.getQuadricBSplineFactor=function(t,e){return 0==t?Math.pow(e-1,2)/2:1==t?(-2*Math.pow(e,2)+2*e+1)/2:2==t?Math.pow(e,2)/2:0},W.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},{version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"}),lt="doublearrow",ct={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},ht={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};M.algorithm={},M.algorithm.doubleArrow=function(t,e){this.connPoint=null;var i={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((o=(this.points=t).length)<2)){if(2==o)return t;var n=this.points[0],a=this.points[1],r=this.points[2],o=t.length,o=(this.tempPoint4=3==o?M.algorithm.getTempPoint4(n,a,r):this.points[3],this.connPoint=3==o||4==o?W.PlotUtils.mid(n,a):this.points[4],t=W.PlotUtils.isClockWise(n,a,r)?(h=M.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),M.algorithm.getArrowPoints(this.connPoint,a,r,!0)):(h=M.algorithm.getArrowPoints(a,this.connPoint,r,!1),M.algorithm.getArrowPoints(this.connPoint,n,this.tempPoint4,!0)),h.length),s=(o-5)/2,l=h.slice(0,s),c=h.slice(s,5+s),h=h.slice(5+s,o),d=t.slice(0,s),x=t.slice(s,5+s),t=t.slice(5+s,o),d=W.PlotUtils.getBezierPoints(d),s=W.PlotUtils.getBezierPoints(t.concat(l.slice(1))),h=W.PlotUtils.getBezierPoints(h),o=d.concat(x,s,c,h),t=M.algorithm.array2Dto1D(o);i.controlPoint=[n,a,r,this.tempPoint4,this.connPoint],i.polygonalPoint=e.Cartesian3.fromDegreesArray(t)}return i},M.algorithm.threeArrow=function(t){this.connPoint=null,this.tempPoint4=null;var e={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(r=(this.points=t).length)){if(2==r)return t;var i=this.points[0],n=this.points[1],a=this.points[2],r=(3==(r=t.length)?(this.tempPoint4=M.algorithm.getTempPoint4(i,n,a),this.tempPoint5=W.PlotUtils.mid(a,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=r<6?W.PlotUtils.mid(i,n):this.points[5],t=W.PlotUtils.isClockWise(i,n,a)?(c=M.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),M.algorithm.getArrowPoints(this.connPoint,n,a,!0)):(c=M.algorithm.getArrowPoints(n,this.connPoint,a,!1),M.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),o=(r-5)/2,s=c.slice(0,o),l=c.slice(o,5+o),c=c.slice(5+o,r),h=t.slice(0,o),d=t.slice(o,5+o),t=t.slice(5+o,r),h=W.PlotUtils.getBezierPoints(h),o=W.PlotUtils.getBezierPoints(t.concat(s.slice(1))),c=W.PlotUtils.getBezierPoints(c),r=h.concat(d,o,l,c),t=M.algorithm.array2Dto1D(r);e.controlPoint=[i,n,a,this.tempPoint4,this.tempPoint5,this.connPoint],e.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(t)}return e},M.algorithm.array2Dto1D=function(t){var e=[];return t.forEach(function(t){e.push(t[0]),e.push(t[1])}),e},M.algorithm.getArrowPoints=function(t,e,i,n){this.type=lt,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var a=W.PlotUtils.mid(t,e),r=W.PlotUtils.distance(a,i),o=W.PlotUtils.getThirdPoint(i,a,0,.3*r,!0),s=W.PlotUtils.getThirdPoint(i,a,0,.5*r,!0),o=[a,W.PlotUtils.getThirdPoint(a,o,W.Constants.HALF_PI,r/5,n),W.PlotUtils.getThirdPoint(a,s,W.Constants.HALF_PI,r/4,n),i],a=M.algorithm.getArrowHeadPoints(o,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=a[0],r=a[4],n=W.PlotUtils.distance(t,e)/W.PlotUtils.getBaseLength(o)/2,i=M.algorithm.getArrowBodyPoints(o,s,r,n),o=i.length,n=i.slice(0,o/2),i=i.slice(o/2,o);return n.push(s),i.push(r),(n=n.reverse()).push(e),(i=i.reverse()).push(t),n.reverse().concat(a,i)},M.algorithm.getArrowHeadPoints=function(t,e,i){this.type=lt,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var n=W.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],e=(W.PlotUtils.distance(e,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,r=n*this.neckHeightFactor,n=W.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),t=W.PlotUtils.getThirdPoint(t[t.length-2],a,0,r,!0),r=W.PlotUtils.getThirdPoint(a,n,W.Constants.HALF_PI,e,!1),n=W.PlotUtils.getThirdPoint(a,n,W.Constants.HALF_PI,e,!0);return[W.PlotUtils.getThirdPoint(a,t,W.Constants.HALF_PI,i,!1),r,a,n,W.PlotUtils.getThirdPoint(a,t,W.Constants.HALF_PI,i,!0)]},M.algorithm.getArrowBodyPoints=function(t,e,i,n){for(var a=W.PlotUtils.wholeDistance(t),r=W.PlotUtils.getBaseLength(t)*n,o=(r-W.PlotUtils.distance(e,i))/2,s=0,l=[],c=[],h=1;h<t.length-1;h++){var d=W.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,x=(r/2-(s+=W.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(d),u=W.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-d,x,!0),d=W.PlotUtils.getThirdPoint(t[h-1],t[h],d,x,!1);l.push(u),c.push(d)}return l.concat(c)},M.algorithm.getTempPoint4=function(t,e,i){var n,a,r,e=W.PlotUtils.mid(t,e),o=W.PlotUtils.distance(e,i),i=W.PlotUtils.getAngleOfThreePoints(t,e,i),o=i<W.Constants.HALF_PI?(n=o*Math.sin(i),a=o*Math.cos(i),r=W.PlotUtils.getThirdPoint(t,e,W.Constants.HALF_PI,n,!1),W.PlotUtils.getThirdPoint(e,r,W.Constants.HALF_PI,a,!0)):i>=W.Constants.HALF_PI&&i<Math.PI?(n=o*Math.sin(Math.PI-i),a=o*Math.cos(Math.PI-i),r=W.PlotUtils.getThirdPoint(t,e,W.Constants.HALF_PI,n,!1),W.PlotUtils.getThirdPoint(e,r,W.Constants.HALF_PI,a,!1)):i>=Math.PI&&i<1.5*Math.PI?(n=o*Math.sin(i-Math.PI),a=o*Math.cos(i-Math.PI),r=W.PlotUtils.getThirdPoint(t,e,W.Constants.HALF_PI,n,!0),W.PlotUtils.getThirdPoint(e,r,W.Constants.HALF_PI,a,!0)):(n=o*Math.sin(2*Math.PI-i),a=o*Math.cos(2*Math.PI-i),r=W.PlotUtils.getThirdPoint(t,e,W.Constants.HALF_PI,n,!0),W.PlotUtils.getThirdPoint(e,r,W.Constants.HALF_PI,a,!1));return o},M.algorithm.tailedAttackArrow=function(t,e){t=M.algorithm.dereplication(t),this.tailWidthFactor=ct.tailWidthFactor,this.swallowTailFactor=ct.swallowTailFactor,this.swallowTailPnt=ct.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(!((i.controlPoint=t).length<2)){if(2==t.length)return i.polygonalPoint=t,i;var n=t[0],a=t[1],t=(W.PlotUtils.isClockWise(t[0],t[1],t[2])&&(n=t[1],a=t[0]),[W.PlotUtils.mid(n,a)].concat(t.slice(2))),r=M.algorithm.getAttackArrowHeadPoints(t,n,a,ct),o=r[0],s=r[4],l=W.PlotUtils.distance(n,a),c=W.PlotUtils.getBaseLength(t),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=W.PlotUtils.getThirdPoint(t[1],t[0],0,h,!0);h=M.algorithm.getAttackArrowBodyPoints(t,o,s,l/c),t=h.length,l=[n].concat(h.slice(0,t/2));l.push(o);c=[a].concat(h.slice(t/2,t));c.push(s),l=W.PlotUtils.getQBSplinePoints(l),c=W.PlotUtils.getQBSplinePoints(c),n=M.algorithm.array2Dto1D(l.concat(r,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=e.Cartesian3.fromDegreesArray(n)}return i},M.algorithm.getAttackArrowHeadPoints=function(t,e,i,n){this.headHeightFactor=n.headHeightFactor,this.headTailFactor=n.headTailFactor,this.headWidthFactor=n.headWidthFactor,this.neckWidthFactor=n.neckWidthFactor,this.neckHeightFactor=n.neckHeightFactor;var n=W.PlotUtils.getBaseLength(t)*this.headHeightFactor,a=t[t.length-1],r=W.PlotUtils.distance(a,t[t.length-2]),e=W.PlotUtils.distance(e,i),i=(n=n>e*this.headTailFactor?e*this.headTailFactor:n)*this.headWidthFactor,e=n*this.neckWidthFactor,r=(n=r<n?r:n)*this.neckHeightFactor,n=W.PlotUtils.getThirdPoint(t[t.length-2],a,0,n,!0),t=W.PlotUtils.getThirdPoint(t[t.length-2],a,0,r,!0),r=W.PlotUtils.getThirdPoint(a,n,W.Constants.HALF_PI,i,!1),n=W.PlotUtils.getThirdPoint(a,n,W.Constants.HALF_PI,i,!0);return[W.PlotUtils.getThirdPoint(a,t,W.Constants.HALF_PI,e,!1),r,a,n,W.PlotUtils.getThirdPoint(a,t,W.Constants.HALF_PI,e,!0)]},M.algorithm.getAttackArrowBodyPoints=function(t,e,i,n){for(var a=W.PlotUtils.wholeDistance(t),r=W.PlotUtils.getBaseLength(t)*n,o=(r-W.PlotUtils.distance(e,i))/2,s=0,l=[],c=[],h=1;h<t.length-1;h++){var d=W.PlotUtils.getAngleOfThreePoints(t[h-1],t[h],t[h+1])/2,x=(r/2-(s+=W.PlotUtils.distance(t[h-1],t[h]))/a*o)/Math.sin(d),u=W.PlotUtils.getThirdPoint(t[h-1],t[h],Math.PI-d,x,!0),d=W.PlotUtils.getThirdPoint(t[h-1],t[h],d,x,!1);l.push(u),c.push(d)}return l.concat(c)},M.algorithm.dereplication=function(t){var e=t[t.length-1],i=!1,n=[],n=t.filter(function(t){if(t[0]!=e[0]&&t[1]!=e[1])return t;i=!0});return i&&n.push(e),n},M.algorithm.fineArrow=function(t,e,i){var n,a,r,o,s,l,c;if(!(t.length<2||e.length<2))return n=ht.tailWidthFactor,c=ht.neckWidthFactor,s=ht.headWidthFactor,o=ht.headAngle,l=ht.neckAngle,(a=[])[0]=t,a[1]=e,t=a[0],e=a[1],c=(a=W.PlotUtils.getBaseLength(a))*c,s=a*s,n=W.PlotUtils.getThirdPoint(e,t,W.Constants.HALF_PI,a=a*n,!0),a=W.PlotUtils.getThirdPoint(e,t,W.Constants.HALF_PI,a,!1),r=W.PlotUtils.getThirdPoint(t,e,o,s,!1),o=W.PlotUtils.getThirdPoint(t,e,o,s,!0),s=W.PlotUtils.getThirdPoint(t,e,l,c,!1),l=W.PlotUtils.getThirdPoint(t,e,l,c,!0),(c=[]).push(n[0],n[1],s[0],s[1],r[0],r[1],e[0],e[1],o[0],o[1],l[0],l[1],a[0],a[1],t[0],t[1]),c.some(t=>isNaN(t))?"":i.Cartesian3.fromDegreesArray(c)};let dt=null;function i(t,e){this.viewer=t,dt=e,this.handler=new dt.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=dt.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=M}i.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},i.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new dt.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let S=null;function Z(t,e){i.call(this,t,e),S=e,this.type="AttackArrow",this.fillMaterial=S.Color.RED.withAlpha(.5)}function xt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}Z.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new S.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var t=0;t<this.pointArr.length;t++)this.pointArr[t]&&this.viewer.entities.remove(this.pointArr[t]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new S.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(t){(t=xt(t.position,i.viewer))&&(0==i.positions.length&&(i.floatPoint=i.creatPoint(t),i.floatPoint.wz=-1),i.positions.push(t),t=i.creatPoint(t),2<i.positions.length?t.wz=i.positions.length-1:t.wz=i.positions.length,i.pointArr.push(t))},S.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){!i.floatPoint||i.positions.length<2||(t=xt(t.endPosition,i.viewer))&&(i.floatPoint.position.setValue(t),2<=i.positions.length)&&(S.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(t)):(i.positions.push(t),i.arrowEntity=i.showArrowOnMap(i.positions),i.arrowEntity.objId=i.objId,e&&e(i.objId)))},S.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){if(t=xt(t.position,i.viewer)){for(var e=0;e<i.pointArr.length;e++)i.pointArr[e].show=!1;i.floatPoint.show=!1,i.viewer.entities.remove(i.floatPoint),i.floatPoint=null;t=i.creatPoint(t);t.show=!1,t.wz=i.positions.length,i.pointArr.push(t),i.positions=[],i.pointArr=[],i.arrowEntity=null}},S.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(t){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var e=[],i=0;i<t.length;i++){var n=S.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}for(this.positions=e,i=0;i<this.positions.length;i++){var a=this.creatPoint(this.positions[i]);a.show=!1,a.wz=i+1,this.pointArr.push(a)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!0;this.modifyHandler||(this.modifyHandler=new S.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=n.viewer.scene.pick(t.position);if(S.defined(e)&&e.id)n.clickStep++,e.id.objId||(n.selectPoint=e.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,e=xt(t.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.selectPoint=null)},S.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){(t=xt(t.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.positions[n.selectPoint.wz-1]=t)},S.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){t=this.viewer.entities.add({position:t,point:{pixelSize:10,color:S.Color.YELLOW}});return t.attr="editPoint",t},showArrowOnMap:function(r){var o=this;return this.viewer.entities.add({id:o.objId,polygon:new S.PolygonGraphics({hierarchy:new S.CallbackProperty(function(){if(r.length<3)return null;for(var t=[],e=0;e<r.length;e++){var i=o.cartesianToLatlng(r[e]);t.push(i)}var n=o.xp.algorithm.tailedAttackArrow(t,S),a=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(a=n.polygonalPoint),new S.PolygonHierarchy(a)},!1),show:!0,fill:!0,material:o.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=S.Math.toDegrees(t.latitude);return[S.Math.toDegrees(t.longitude),e]}},(Z.prototype=Object.create(Object.assign({},Z.prototype,i.prototype))).constructor=Z;let V=null;function X(t,e){i.call(this,t,e),V=e,this.type="StraightArrow",this.fillMaterial=V.Color.fromCssColorString("#0000FF").withAlpha(.8)}function ut(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}X.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new V.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler.setInputAction(function(t){(t=ut(t.position,i.viewer))&&(0==i.positions.length&&(i.firstPoint=i.creatPoint(t),i.firstPoint.type="firstPoint",i.floatPoint=i.creatPoint(t),i.floatPoint.type="floatPoint",i.positions.push(t)),i.firstPoint.position.setValue(t),i.firstPoint.show=!0,i.positions&&3==i.positions.length&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null),i.positions.push(t.clone()))},V.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){i.positions.length<1||(t=ut(t.endPosition,i.viewer))&&(i.floatPoint.position.setValue(t),2<=i.positions.length)&&(V.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(t)):(i.positions.push(t),i.arrowEntity=i.showArrowOnMap(i.positions),e&&e(i.objId)))},V.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){(t=ut(t.position,i.viewer))&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null,i.positions.push(t.clone()))},V.ScreenSpaceEventType.RIGHT_CLICK)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var i=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new V.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=i.viewer.scene.pick(t.position);V.defined(e)&&e.id?(i.clickStep++,e.id.objId||(i.selectPoint=e.id)):(i.modifyHandler.destroy(),i.modifyHandler=null,i.firstPoint.show=!1,i.floatPoint.show=!1,i.state=-1),2==i.clickStep&&(i.clickStep=0,e=ut(t.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(e),i.selectPoint=null)},V.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){i.selectPoint&&(t=ut(t.endPosition,i.viewer))&&(i.selectPoint.position.setValue(t),"firstPoint"==i.selectPoint.type&&(i.positions[1]=t),"floatPoint"==i.selectPoint.type)&&(i.positions[2]=t)},V.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(t){this.state=-1,this.positions=[];for(var e=[],i=0;i<t.length;i++){var n=V.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}this.positions=e,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){t=this.viewer.entities.add({position:t,point:{pixelSize:10,color:V.Color.YELLOW}});return t.attr="editPoint",t},showArrowOnMap:function(o){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new V.PolygonGraphics({hierarchy:new V.CallbackProperty(function(){if(o.length<2)return null;var t=o[1],e=o[2],t=s.cartesianToLatlng(t),e=s.cartesianToLatlng(e),i=[],n=s.xp.algorithm.fineArrow([t[0],t[1]],[e[0],e[1]],V);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var a=0;a<n.length;a++){var r=new V.Cartesian3(n[a].x,n[a].y,n[a].z);i.push(r)}return new V.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=V.Math.toDegrees(t.latitude);return[V.Math.toDegrees(t.longitude),e]}},(X.prototype=Object.create(Object.assign({},X.prototype,i.prototype))).constructor=X;let B=null;function D(t,e){i.call(this,t,e),B=e,this.type="PincerArrow",this.fillMaterial=B.Color.YELLOW.withAlpha(.8)}function pt(t,e){t=e.camera.getPickRay(t);return t?e.scene.globe.pick(t,e.scene):null}D.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new B.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var t=0;t<this.pointArr.length;t++)this.pointArr[t]&&this.viewer.entities.remove(this.pointArr[t]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(e){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=this;this.state=1,this.handler.setInputAction(function(t){if(t=pt(t.position,n.viewer))if(0==n.positions.length&&(n.floatPoint=n.creatPoint(t)),4<n.positions.length){(i=n.creatPoint(t)).wz=n.positions.length,n.pointArr.push(i);for(var e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!1;n.floatPoint&&(n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null),n.positions=[],n.pointArr=[],n.arrowEntity=null}else{n.positions.push(t);var i=n.creatPoint(t);2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},B.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(t){!n.floatPoint||n.positions.length<2||(t=pt(t.endPosition,n.viewer))&&(n.floatPoint.position.setValue(t),2<=n.positions.length)&&(B.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(t)):(n.positions.push(t),n.arrowEntity=n.showArrowOnMap(n.positions),n.arrowEntity.objId=n.objId,e&&e(n.objId)))},B.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(t){if(4<=n.positions.length&&(t=pt(t.position,n.viewer))){for(var e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!1;n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;t=n.creatPoint(t);t.show=!1,t.wz=n.positions.length,n.pointArr.push(t),n.positions=[],n.pointArr=[],n.arrowEntity=null}},B.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(t){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var e=[],i=0;i<t.length;i++){var n=B.Cartesian3.fromDegrees(t[i][0],t[i][1]);e.push(n)}for(this.positions=e,i=0;i<this.positions.length;i++){var a=this.creatPoint(this.positions[i]);a.show=!1,a.wz=i+1,this.pointArr.push(a)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!0;this.modifyHandler||(this.modifyHandler=new B.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(t){var e=n.viewer.scene.pick(t.position);if(B.defined(e)&&e.id)n.clickStep++,e.id.objId||(n.selectPoint=e.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,e=pt(t.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.selectPoint=null)},B.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(t){(t=pt(t.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.positions[n.selectPoint.wz-1]=t)},B.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var t=[],e=0;e<this.positions.length;e++){var i=this.cartesianToLatlng(this.positions[e]);t.push(i)}return t},getPositions:function(){return this.positions},creatPoint:function(t){return this.viewer.entities.add({position:t,point:{pixelSize:10,color:B.Color.YELLOW}})},showArrowOnMap:function(r){var o=this;return this.viewer.entities.add({id:o.objId,polygon:new B.PolygonGraphics({hierarchy:new B.CallbackProperty(function(){if(r.length<3)return null;for(var t=[],e=0;e<r.length;e++){var i=o.cartesianToLatlng(r[e]);t.push(i)}var n=o.xp.algorithm.doubleArrow(t,B),a=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(a=n.polygonalPoint),new B.PolygonHierarchy(a)},!1),show:!0,fill:!0,material:o.fillMaterial})})},cartesianToLatlng:function(t){var t=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(t),e=B.Math.toDegrees(t.latitude);return[B.Math.toDegrees(t.longitude),e]}},(D.prototype=Object.create(Object.assign({},D.prototype,i.prototype))).constructor=D;let k=null;function mt(t,e,i){t&&(this._viewer=t,k=e,this._installPlugin())}mt.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive()},_installCylinderGeometry:function(){function _(t){this.length=t.length,this.topRadius=t.topRadius,this.bottomRadius=t.bottomRadius,this.slices=t.slices||64,this.zReverse=t.zReverse}var G=new k.Cartesian2,A=new k.Cartesian3,P=new k.Ray;_._createGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,a=t.slices,r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t.zReverse?-e:e],x=0,t=Math.atan2(n-i,e),u=G;u.z=Math.sin(t);for(var p=Math.cos(t),m=0;m<d.length;m++){c[m]=[];for(var g=h[m],f=0;f<a;f++){c[m].push(x++);var v=r*f,y=g*Math.cos(v),b=g*Math.sin(v);o.push(y,b,d[m]),y=p*Math.cos(v),b=p*Math.sin(v),s.push(y,b,u.z),l.push(m/(d.length-1),0)}}for(var C=[],m=1;m<d.length;m++)for(f=1;f<a;f++){var w=c[m-1][f-1],I=c[m][f-1],_=c[m][f],A=c[m-1][f];C.push(_),C.push(A),C.push(w),C.push(_),C.push(w),C.push(I),f==c[m].length-1&&(w=c[m-1][f],I=c[m][f],_=c[m][0],A=c[m-1][0],C.push(_),C.push(A),C.push(w),C.push(_),C.push(w),C.push(I))}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),normal:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=k.BoundingSphere.fromVertices(o),e=new k.Geometry({attributes:n,indices:C,primitiveType:k.PrimitiveType.TRIANGLES,boundingSphere:i});return o=[],C=[],l=[],e},_.createGeometry=function(t,e){if(!e)return _._createGeometry(t);k.Matrix4.multiplyByPoint(e,k.Cartesian3.ZERO,A),A.clone(P.origin);var i=t.length,n=t.topRadius,a=(t.bottomRadius,t.slices),r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[0,t.zReverse?-i:i],d=0,d=0;o.push(0,0,0),s.push(1,1),d++;for(var x=new k.Cartesian3,u=n/15,p=0;p<16;p++){for(var m=u*p,g=[],f=0;f<a;f++){var v=r*f,y=m*Math.cos(v),v=m*Math.sin(v);x.x=y,x.y=v,x.z=h[1],(0,k.Scene.extend2Earth)(x,e,P)?(g.push(d),o.push(y,v,h[1]),s.push(p/15,1),d++):g.push(-1)}c.push(g)}for(var b,C,w=[0,c.length-1],I=0;I<w.length;I++)for(p=w[I],f=1;f<c[p].length;f++)b=c[p][f-1],C=c[p][f],0<=b&&0<=C&&l.push(0,b,C);o=new Float32Array(o),l=new Int32Array(l),s=new Float32Array(s),t={position:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),st:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=k.BoundingSphere.fromVertices(o),n=new k.Geometry({attributes:t,indices:l,primitiveType:k.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,k.Scene.computeVertexNormals)(n),o=[],l=[],n},_.createOutlineGeometry=function(t){var e=t.length,i=t.topRadius,n=t.bottomRadius,a=t.slices,r=2*Math.PI/(a-1),o=[],s=[],l=[],c=[],h=[n,i],d=[0,t.zReverse?-e:e],x=0,t=Math.atan2(n-i,e),u=G;u.z=Math.sin(t);for(var p=Math.cos(t),m=0;m<d.length;m++){c[m]=[];for(var g=h[m],f=0;f<a;f++){c[m].push(x++);var v=r*f,y=g*Math.cos(v),b=g*Math.sin(v);o.push(y,b,d[m]),y=p*Math.cos(v),b=p*Math.sin(v),s.push(y,b,u.z),l.push(m/(d.length-1),0)}}for(var C=[],m=1;m<d.length;m++)for(f=1;f<a;f+=1){var w=c[m-1][f-1],I=c[m][f-1];c[m][f],c[m-1][f],f%8==1&&C.push(w,I)}C=new Int16Array(C),o=new Float32Array(o),s=new Float32Array(s),l=new Float32Array(l),n={position:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:o}),normal:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=k.BoundingSphere.fromVertices(o),e=new k.Geometry({attributes:n,indices:C,primitiveType:k.PrimitiveType.LINES,boundingSphere:i});return o=[],C=[],l=[],e},_.fromAngleAndLength=function(t,e,i){return t=k.Math.toRadians(t),new _({topRadius:Math.tan(t)*e/2,bottomRadius:0,length:e,zReverse:i})},k.Scene.CylinderGeometry=_},_installRadarPrimitive:function(){var i;function t(t,e){e=e||{},i=t.scene.globe.ellipsoid,this._geometry=null,this._angle=e.angle,this._radius=e.radius||5,this._position=e.position,this._rotation=e.rotation||{heading:0,pitch:0,roll:0},this._trackedEntity=e.trackedEntity,this.defaultColor=e.color||k.Color.YELLOW,this.defaultLineColor=e.lineColor||this.defaultColor,this._show=k.defaultValue(e.show,!0),this._outline=k.defaultValue(e.outline,!1),this._topShow=k.defaultValue(e.top,!0),this._topOutline=k.defaultValue(e.topOutline,!0),this._modelMatrix=k.Matrix4.clone(k.Matrix4.IDENTITY),this._quaternion=new k.Quaternion,this._translation=new k.Cartesian3,this._scale=new k.Cartesian3(1,1,1),this._matrix=new k.Matrix4,this._inverseMatrix=new k.Matrix4,this._positionCartographic=new k.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=t,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=k.defaultValue(e.groundArea,!1),this.addGroundAreaEntity(this._groundArea)}Object.defineProperties(t.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(t){this._trackedEntity=t}},color:{get:function(){return this.defaultColor},set:function(t){this.defaultColor=t}},lineColor:{get:function(){return this.defaultLineColor},set:function(t){this.defaultLineColor=t}},show:{get:function(){return this._show},set:function(t){this._show=t}},outline:{get:function(){return this._outline},set:function(t){this._outline=t,this.updateGeometry()}},top:{get:function(){return this._topShow},set:function(t){this._topShow=t,this.updateGeometry()}},topOutline:{get:function(){return this._topOutline},set:function(t){this._topOutline=t,this.updateGeometry()}},groundArea:{get:function(){return this._groundArea},set:function(t){this._groundArea=t,this.addGroundAreaEntity(this._groundArea)}},angle:{get:function(){return this._angle},set:function(t){this._angle=t,this.updateGroundCircleRadius(),this.updateGeometry()}},radius:{get:function(){return this._radius},set:function(t){this._radius=t,this.updateGroundCircleRadius(),this.updateGeometry()}},heading:{get:function(){return this._rotation.heading},set:function(t){this._rotation.heading=t}},pitch:{get:function(){return this._rotation.pitch},set:function(t){this._rotation.pitch=t}},roll:{get:function(){return this._rotation.roll},set:function(t){this._rotation.roll=t}},position:{get:function(){return this._position},set:function(t){this._position=t}}}),t.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(k.Math.toRadians(this._angle))},t.prototype.addGroundAreaEntity=function(t){var e;t&&!this.groundAreaEntity&&((e=this).updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:0===this._rotation.pitch&&0===this._rotation.roll,semiMinorAxis:new k.CallbackProperty(function(t){return e._ground_radius},!1),semiMajorAxis:new k.CallbackProperty(function(t){return e._ground_radius},!1),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll),positions:new k.CallbackProperty(function(t){return!e._trackedEntityPosition||k.Cartesian3.distance(e._position,e._trackedEntityPosition)>e._radius?[]:[e._position,e._trackedEntityPosition]},!1),followSurface:!1,material:new k.PolylineDashMaterialProperty({color:k.Color.CYAN}),width:1}}))};var n=new k.Cartesian3;t.prototype.computeMatrix=function(t,e){return this._positionCartesian||(this._positionCartesian=new k.Cartesian3),this.position instanceof k.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(t):this.position._value&&this.position._value instanceof k.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,t=k.Property.getValueOrUndefined(this._trackedEntity.position,t,n))&&(this._trackedEntityPosition=t,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=k.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),this._positionCartographic=k.Cartographic.fromCartesian(this._positionCartesian,i,this._positionCartographic),k.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),k.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=k.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),k.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),k.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},t.prototype.getTopGeometry=function(){for(var t=this.radius,e=[],i=[],n=[],a=[],r=90-parseInt(this.angle),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=o){for(var h=k.Math.toRadians(c<90?c:90),h=Math.cos(h)*t,d=[],x=0;x<128;x++){var u=s*x,p=h*Math.cos(u),u=h*Math.sin(u),m=Math.sqrt(t*t-p*p-u*u);e.push(p,u,m),i.push(1,1),d.push(l++)}a.push(d)}for(c=1;c<a.length;c++)for(x=1;x<a[c].length;x++){var g=a[c-1][x-1],f=a[c][x-1],v=a[c][x],y=a[c-1][x];n.push(g,f,v),n.push(g,v,y)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},b=k.BoundingSphere.fromVertices(e),r=new k.Geometry({attributes:r,indices:n,primitiveType:k.PrimitiveType.TRIANGLES,boundingSphere:b});return(0,k.Scene.computeVertexNormals)(r),r},t.prototype.getTopOutlineGeometry=function(){for(var t=this.radius,e=[],i=[],n=[],a=[],r=90-parseInt(this.angle),o=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=o){for(var h=k.Math.toRadians(c<90?c:90),h=Math.cos(h)*t,d=[],x=0;x<128;x++){var u=s*x,p=h*Math.cos(u),u=h*Math.sin(u),m=Math.sqrt(t*t-p*p-u*u);e.push(p,u,m),i.push(1,1),d.push(l++)}a.push(d)}for(c=1;c<a.length;c++)for(x=1;x<a[c].length;x++){var g=a[c-1][x-1],f=a[c][x-1],v=a[c][x];a[c-1][x],x%8==1&&n.push(g,f),c%8==1&&n.push(f,v)}var e=new Float32Array(e),n=new Int32Array(n),i=new Float32Array(i),r={position:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),st:new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},y=k.BoundingSphere.fromVertices(e),r=new k.Geometry({attributes:r,indices:n,primitiveType:k.PrimitiveType.LINES,boundingSphere:y});return(0,k.Scene.computeVertexNormals)(r),r},t.prototype.updateGeometry=function(){this._geometry=k.Scene.CylinderGeometry.createGeometry(new k.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(k.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(k.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=k.Scene.CylinderGeometry.createOutlineGeometry(new k.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(k.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(k.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var t=0;t<this._positions.length;t++)this._positions[t]=this._geometry.attributes.position.values[t];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))},t.prototype.update=function(e){this._show&&(this.computeMatrix(e.time),e.mode===k.SceneMode.SCENE3D?(this._geometry.boundingSphere=k.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,e)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,e)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,e)),this._topOutline)&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,e))),this._drawCommands.forEach(function(t){e.commandList.push(t)}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=!1)):(this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.ellipse.show=0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll)))},t.prototype.getFragmentShaderSource=function(t){return"#version 300 es\n in vec3 v_position;\n in vec3 v_normal; \n uniform float picked; \n uniform vec4 pickedColor; \n uniform vec4 defaultColor; \n uniform float specular; \n uniform float shininess; \n uniform vec3 emission; \n in vec2 v_st; \n uniform bool isLine; \n uniform float glowPower; \n void main() { \n vec3 positionToEyeEC = -v_position; \n vec3 normalEC = normalize(v_normal); \n vec4 color = defaultColor; \n if (picked != 0.0) { \n color = pickedColor; \n } \n czm_material material; \n material.specular = specular; \n material.shininess = shininess; \n material.normal = normalEC; \n material.emission = emission;//vec3(0.2,0.2,0.2);\n material.diffuse = color.rgb ;\n if(isLine){\n material.alpha = 1.0; \n }\n else{ \n material.alpha = color.a; \n }\n if(v_st.x==0.0){ \n out_FragColor =color ;\n }else { \n out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ; \n } \n }"},t.prototype.getVertexShaderSource=function(t){return"#version 300 es\n #ifdef GL_ES\n precision highp float;\n #endif\n\n in vec3 position;\n in vec2 st;\n in vec3 normal;\n uniform mat4 modelViewMatrix;\n uniform mat3 normalMatrix;\n uniform mat4 projectionMatrix;\n out vec3 v_position;\n out vec3 v_normal;\n out vec2 v_st;\n\n out vec3 v_light0Direction;\n\n void main(void) \n {\n vec4 pos = modelViewMatrix * vec4( position,1.0);\n v_normal = normalMatrix * normal;\n v_st = st;\n v_position = pos.xyz;\n v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n gl_Position = projectionMatrix * pos;\n }"},t.prototype.createDrawCommand=function(t,e,i){var n=e.context,a=new k.Cartesian3,a=(k.Matrix4.multiplyByPoint(this._matrix,t.boundingSphere.center,a),new k.BoundingSphere(a,t.boundingSphere.radius)),i=new k.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:t.primitiveType,pass:k.Pass.TRANSLUCENT,boundingVolume:a}),r=this,a=k.GeometryPipeline.createAttributeLocations(t);return i.vertexArray=k.VertexArray.fromGeometry({context:n,geometry:t,attributeLocations:a,bufferUsage:k.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=a,i.shaderProgram=k.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(t),fragmentShaderSource:this.getFragmentShaderSource(t),attributeLocations:a}),i.renderState=k.RenderState.fromCache({blending:k.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:k.DepthFunction.LESS},cull:{enabled:!1,face:k.CullFace.BACK}}),i.uniformMap={},i.uniformMap.projectionMatrix=function(){return e.context.uniformState.projection},i.uniformMap.modelViewMatrix=function(){return e.context.uniformState.modelView},i.uniformMap.shininess=function(){return r.shininess||(r.shininess=0),r.shininess},i.uniformMap.emission=function(){return r.emission||(r.emission=new k.Cartesian3(.2,.2,.2)),r.emission},i.uniformMap.specular=function(){return r.specular||(r.specular=0),r.specular},i.uniformMap.isLine=function(){return t.primitiveType==k.PrimitiveType.LINES||t.primitiveType==k.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return t.primitiveType==k.PrimitiveType.LINES||t.primitiveType==k.PrimitiveType.LINE_STRIP?(r.defaultLineColor||(r.defaultLineColor=new k.Color(1,1,0,1)),r.defaultLineColor):(r.defaultColor||(r.defaultColor=new k.Color(1,0,0,1)),r.defaultColor)},i.uniformMap.picked=function(){return r.picked||(r.picked=0),r.picked},i.uniformMap.pickedColor=function(){return r.pickedColor||(r.pickedColor=new k.Color(1,1,0,1)),r.pickedColor},i.uniformMap.normalMatrix=function(){return e.context.uniformState.normal},i.uniformMap.glowPower=function(){return.25},i},t.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity)},t.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity)},t.prototype.destroy=function(t){t&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(t){t.vertexArray=t.vertexArray&&t.vertexArray.destroy()}),this._drawCommands=[])},k.Scene.RadarPrimitiveRight=t},_installCounputeVertex:function(){var a=new k.Cartesian3,r=(new k.Ray,new k.Cartographic);k.Scene.computeVertexNormals=function(t){var e=t.indices,i=t.attributes,n=e.length;if(i.position){var a=i.position.values;if(void 0===i.normal)i.normal=new k.GeometryAttribute({componentDatatype:k.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(a.length)});else for(var r=i.normal.values,o=0;o<n;o++)r[o]=0;for(var s,l,c,h=i.normal.values,d=new k.Cartesian3,x=new k.Cartesian3,u=new k.Cartesian3,p=new k.Cartesian3,m=new k.Cartesian3,o=0;o<n;o+=3)s=3*e[o+0],l=3*e[o+1],c=3*e[o+2],k.Cartesian3.fromArray(a,s,d),k.Cartesian3.fromArray(a,l,x),k.Cartesian3.fromArray(a,c,u),k.Cartesian3.subtract(u,x,p),k.Cartesian3.subtract(d,x,m),k.Cartesian3.cross(p,m,p),h[s]+=p.x,h[1+s]+=p.y,h[2+s]+=p.z,h[l]+=p.x,h[1+l]+=p.y,h[2+l]+=p.z,h[c]+=p.x,h[1+c]+=p.y,h[2+c]+=p.z;for(var g,f,v,y,b=t.attributes.normal.values,C=0;C<b.length;C+=3)g=b[C],f=b[C+1],v=b[C+2],y=1/Math.sqrt(g*g+f*f+v*v),b[C]=g*y,b[C+1]=f*y,b[C+2]=v*y;i.normal.needsUpdate=!0}return t},k.Scene.extend2Earth=function(t,e,i,n){n=n||k.Ellipsoid.WGS84,k.Matrix4.multiplyByPoint(e,t,a),k.Cartesian3.subtract(a,i.origin,i.direction),k.Cartesian3.normalize(i.direction,i.direction);e=k.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=e?k.Ray.getPoint(i,e.start):n)try{k.Cartographic.fromCartesian(n,null,r)}catch(t){return null}return n}}};class e{constructor(t){return this.init(t)}init({cesiumGlobal:t,containerId:e,viewerConfig:i={},extraConfig:n={},MapImageryList:a=[],defaultStatic:r,baseExtendsCom:o=[],extendsCom:s,extendsComName:l}){if(!t)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";if(e)return{viewer:e=new N(t).init({containerId:e,viewerConfig:i,extraConfig:n,MapImageryList:a}),[l]:this.prototypeExtends(e,t,r)(o,s)};throw"Missing containerId parameter, please check the calling function initCesium."}prototypeExtends(n,r,o){return function(t,a){var e=null;function i(t){for(var e=Object.keys(t.prototype),i=0,n=e.length;i<n;i++)a.prototype[e[i]]=t.prototype[e[i]]}return Array.isArray(t)?(t.forEach(t=>{i(t)}),e=new a(n,r,o),t.forEach(t=>{t.call(e,n,r,o)})):(i(t),e=new a(n,r,o),t.call(e,n,r,o)),e}}}class gt extends e{constructor(t){return super({...t,baseExtendsCom:[b,z,Q],extendsCom:U,extendsComName:"draw"})}}class ft extends e{constructor(t){return super({...t,baseExtendsCom:b,extendsCom:$,extendsComName:"customCesiumPlugin"})}}R.Analysis=class extends e{constructor(t){return super({...t,baseExtendsCom:[b,U,it],extendsCom:nt,extendsComName:"analysis"})}},R.CustomCesiumPlugin=class{constructor(t){var e=new ft(t);return this._initInter(e,t)}_initInter(t,e){return new mt(t.viewer,e.cesiumGlobal,e.defaultStatic),t}},R.Draw=class{constructor(t){var e=new gt(t);return this._initCurrMeasure(t,e)}_initCurrMeasure(t,e){var i=new Z(e.viewer,t.cesiumGlobal),n=new X(e.viewer,t.cesiumGlobal),t=new D(e.viewer,t.cesiumGlobal);return{...e,attackArrowObj:i,straightArrowObj:n,pincerArrowObj:t}}},R.Graphics=class extends e{constructor(t){return super({...t,baseExtendsCom:b,extendsCom:y,extendsComName:"graphics"})}},R.Material=class extends e{constructor(t){return super({...t,baseExtendsCom:[b,Y],extendsCom:E,extendsComName:"material"})}},R.PassEffect=class extends e{constructor(t){return super({...t,baseExtendsCom:[b,Y],extendsCom:J,extendsComName:"passEffect"})}},R.Plugin=class extends e{constructor(t){return super({...t,baseExtendsCom:[b,y],extendsCom:it,extendsComName:"plugin"})}},R.Primitive=class extends e{constructor(t){return super({...t,baseExtendsCom:b,extendsCom:L,extendsComName:"primitive"})}},R.initCesium=function({cesiumGlobal:t,containerId:e,viewerConfig:i={},extraConfig:n={},MapImageryList:a=[],defaultStatic:r}){if(!t)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";var o,s,l,c,h,d,x,u,p,m,g,f,v;if(e)return e=new N(t).init({containerId:e,viewerConfig:i,extraConfig:n,MapImageryList:a}),g=e,f=t,v=r,n=(i=function(t,a){var e=null;function i(t){for(var e=Object.keys(t.prototype),i=0,n=e.length;i<n;i++)a.prototype[e[i]]=t.prototype[e[i]]}return Array.isArray(t)?(t.forEach(t=>{i(t)}),e=new a(g,f,v),t.forEach(t=>{t.call(e,g,f,v)})):(i(t),e=new a(g,f,v),t.call(e,g,f,v)),e})([b,Y],E),a=i(b,y),r=i(b,z),o=i(b,L),s=i([b,z,Q],U),l=i([b,Y],J),c=i(b,$),h=i(b,et),d=i([b,y],it),x=new b(e,t),i=i([b,U,it],nt),u=new Z(e,t),p=new X(e,t),m=new D(e,t),new mt(e,t),{viewer:e,material:n,graphics:a,math3d:r,primitive:o,draw:s,passEffect:l,customCesiumPlugin:c,control:h,plugin:d,base:x,analysis:i,attackArrowObj:u,straightArrowObj:p,pincerArrowObj:m};throw"Missing containerId parameter, please check the calling function initCesium."},Object.defineProperty(R,"__esModule",{value:!0})});
5
+ `),-1!==o.indexOf(r)&&(n[t]=n[t].replace(r,e))}}getCurCenterlonLat(e){e=e.camera.pickEllipsoid(new a.Cartesian2(e.canvas.clientWidth/2,e.canvas.clientHeight/2)),e=a.Ellipsoid.WGS84.cartesianToCartographic(e);return{lon:180*e.longitude/Math.PI,lat:180*e.latitude/Math.PI}}}let d=null;function h(e,t,i){e&&(d=t,this._graphicsLayer=new d.CustomDataSource("graphicsLayer"),e)&&e.dataSources.add(this._graphicsLayer)}h.prototype={getPointGraphics:function(e){if(e=e||{})return new d.PointGraphics({color:e.color||d.Color.GREEN,pixelSize:e.pixelSize||5,outlineColor:e.outlineColor||d.Color.WHITE,outlineWidth:e.outlineWidth||1})},getLineGraphics:function(e){if((e=e||{})&&e.positions)return new d.PolylineGraphics({show:!0,positions:e.positions,material:e.material||d.Color.YELLOW,width:e.width||1,clampToGround:e.clampToGround||!1})},getLineVolumeGraphics:function(o){if((o=o||{})&&o.positions)return new d.PolylineVolumeGraphics({show:!0,positions:new d.Cartesian3.fromDegreesArrayHeights(o.positions),material:o.material||new d.Scene.PolylineFlowWaterMaterialProperty({riverColor:d.Color.SKYBLUE,flowDuration:1e4}),shape:new d.CallbackProperty(function(){for(var e=[],t=0;t<180;t++){var i=o.width*Math.cos(2*Math.PI*t/720),n=.1*Math.sin(2*Math.PI*t/720);e.push(new d.Cartesian2(i,n))}return e},!1),cornerType:o.cornerType||d.CornerType.ROUNDED})},getPolygonGraphics:function(e){if((e=e||{})&&e.positions)return new d.PolygonGraphics({hierarchy:{positions:e.positions},material:e.material||d.Color.RED.withAlpha(.2),clampToGround:e.clampToGround||!1})},getLabelGraphics:function(e){if((e=e||{})&&e.l_text)return new d.LabelGraphics({text:e.l_text,font:e.l_font||"14px sans-serif",fillColor:e.l_fillColor||d.Color.GOLD,style:e.l_style||d.LabelStyle.FILL_AND_OUTLINE,outlineWidth:e.l_outlineWidth||2,showBackground:e.l_showBackground||!1,backgroundColor:e.l_backgroundColor||new d.Color(.165,.165,.165,.8),verticalOrigin:e.l_verticalOrigin||d.VerticalOrigin.BOTTOM,pixelOffset:e.l_pixelOffset||new d.Cartesian2(0,-30)})},getBillboardGraphics:function(e){if((e=e||{})&&e.b_img)return new d.BillboardGraphics({image:e.b_img,width:e.b_width||35,height:e.b_height||35,clampToGround:e.b_clampToGround||!0,scale:e.b_scale||1,pixelOffset:e.b_pixelOffset||new d.Cartesian2(0,-20),scaleByDistance:e.b_scaleByDistance||void 0})},getPathGraphics:function(e){if(e=e||{})return new d.PathGraphics({resolution:e.resolution||1,material:new d.PolylineGlowMaterialProperty({glowPower:e.glowPower||.1,color:e.color||d.Color.YELLOW}),width:e.width||30})},getModelGraphics:function(e){if(e=e||{})return new d.ModelGraphics({uri:e.m_url||e.url,scale:e.m_scale||e.scale||10,clampAnimations:!0})},getEllipseGraphics:function(e){if(e=e||{})return new d.EllipseGraphics({semiMajorAxis:e.e_semiMinorAxis||1e6,semiMinorAxis:e.e_semiMinorAxis||1e6,metarial:e.e_metarial||d.Color.RED.withAlpha(.5),outline:e.e_outline||!0})},getEllipsoidGraphics:function(e){var t;if(e=e||{})return t=e.radii||1e6,new d.EllipsoidGraphics({radii:new d.Cartesian3(t,t,t),maximumCone:e.maximumCone||d.Math.PI_OVER_TWO,stackPartitions:e.stackPartitions||56,slicePartitions:e.slicePartitions||56,outlineWidth:e.outlineWidth||2,outlineColor:e.outlineColor||d.Color.YELLOW,outline:e.outline||!0,fill:e.fill||!0,material:e.material||d.Color.RED.withAlpha(.1)})},getBoxGraphics:function(e){if(e=e||{show:!0,outline:!1,fill:!0})return new d.BoxGraphics({show:e.show,fill:e.fill,dimensions:e.dimensions||new d.Cartesian3(0,0,0),material:e.material,outline:e.outline,outlineColor:e.outlineColor||d.Color.BLACK,distanceDisplayCondition:e.distanceDisplayCondition||void 0})},getPlaneGraphics:function(e){if(e=e||{})return new d.PlaneGraphics({plane:e.plane||new d.Plane(d.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new d.Cartesian2(170,130),material:e.material||d.Color.BLUE})},getCylinderGraphics:function(e){if(e=e||{})return new d.CylinderGraphics({HeightReference:d.HeightReference.RELATIVE_TO_GROUND,length:e.length||250,topRadius:e.topRadius||0,bottomRadius:e.bottomRadius||0,material:e.material||new d.Color(0,1,1,.4),slices:e.slices||128})},createPointsGraphics:function(e){if(e&&e.positions){var t,i=[];for(t in e.positions){var n=e.positions[t],o=this.createGraphics();o.name=e.name||"",o.oid=e.oid||"point",o.position=n,e.point&&(o.point=this.getPointGraphics()),e.billboard&&(o.billboard=this.getBillboardGraphics(e.billboard)),e.label&&(o.label=this.getLabelGraphics(e.label)),i.push(this._graphicsLayer.entities.add(o))}return i}},createLineGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).name=e.name||"",t.oid=e.oid||"line",t.position=e.positions,t.polyline=this.getLineGraphics(e),this._graphicsLayer.entities.add(t)},createLineVolumeGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).name=e.name||"lineVolumeWater",t.oid=e.oid||"lineVolume",t.polylineVolume=this.getLineVolumeGraphics(e),this._graphicsLayer.entities.add(t)},createPolygonGraphics:function(e){var t;if(e=e||{})return(t=this.createGraphics()).polygon=this.getPolygonGraphics(e),t.clampToS3M=e.clampToS3M||!1,this._graphicsLayer.entities.add(t)},createBoxGraphics:function(e){var t;if(e=e||{})return(t=this.createGraphics()).position=e.position,t.name=e.name||"box_graphic",t.box=this.getBoxGraphics(e.box),this._graphicsLayer.entities.add(t)},createModelGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).model=this.getModelGraphics(e),t.position=e.position,this._graphicsLayer.entities.add(t)},craeteCorridorGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).corridor={positions:e.positions,height:e.height||6,width:e.width||15,material:e.material||new d.Scene.WarnLinkMaterialProperty({freely:"cross",color:d.Color.YELLOW,duration:1e3,count:1,direction:"+"})},this._graphicsLayer.entities.add(t)},craeteDynamicPolyLineGraphics:function(e){var t;if(e&&e.positions)return(t=this.createGraphics()).polyline={show:!0,positions:[],material:e.material||d.Color.CHARTREUSE,width:e.width||5,clampToGround:e.clampToGround||!1},t.polyline.positions=new d.CallbackProperty(function(){return e.positions},!1),this._graphicsLayer.entities.add(t)},craeteDynamicCylinderGraphics:function(e){var i,n,t={};if(e&&e.cylinder)return i=e.entity,e=e.cylinder,t.cylinder=(n=this).getCylinderGraphics(e),t.position=new d.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime),e=n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=d.Math.toDegrees(e.latitude),e=d.Math.toDegrees(e.longitude);return d.Cartesian3.fromDegrees(e,t,0)},!1),t.cylinder.length=new d.CallbackProperty(function(){var e=i.position.getValue(n._viewer.clock.currentTime);return 2*n._viewer.scene.globe.ellipsoid.cartesianToCartographic(e).height},!1),t},createFadeCylinderGraphics:function(e){var t;if((e=e||{})&&e.position)return(t=this.createGraphics()).position=e.position,e.material=new d.Scene.CircleFadeMaterialProperty({color:e.color||d.Color.fromCssColorString("#02ff00"),duration:e.duration||2e3}),t.cylinder=this.getCylinderGraphics(e),this._drawLayer.entities.add(t)},craeteRotateCylinderGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).cylinder={HeightReference:d.HeightReference.RELATIVE_TO_GROUND,length:e.length||500,topRadius:e.topRadius||500,bottomRadius:e.bottomRadius||500,material:e.material||new d.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteRotateCylinderGraphics"])||"static/data/images/file/cc2.png",transparent:!0,repeat:{x:1,y:-1}}),slices:e.slices||128},t.position=e.position,this.setGraphicsRotate({entity:t,position:this.transformCartesianToWGS84(e.position),rotateAmount:4}),this._graphicsLayer.entities.add(t)},craeteDynamicBlinkCircleGraphics:function(e){var t,i,n;if(e&&e.position)return t=this.createGraphics(),i=e.alp||1,n=e.flog||!0,t.position=e.position,t.ellipse={semiMinorAxis:e.semiMinorAxis||2e3,semiMajorAxis:e.semiMajorAxis||2e3,height:e.height||10,material:new d.ColorMaterialProperty(new d.CallbackProperty(function(){return n?(i-=.05)<=0&&(n=!1):1<=(i+=.05)&&(n=!0),d.Color.RED.withAlpha(i)},!1))},this._graphicsLayer.entities.add(t)},craeteDynamicCricleGraphics:function(i){if(i&&i.center){var n=this.createGraphics(),o=this,r=i.center,a=i.radius||800,s=i.rotateAmount||.05,l=0,c=i.height||1,h=i.scale||null,u=i.scale2||null,i=i.material||new d.ImageMaterialProperty({image:i.imge||this.getDfSt(["graphic","craeteDynamicCricleGraphics"])||"static/data/images/Textures/circle_bg.png",transparent:!0});n.position=new d.CallbackProperty(function(){return o.transformWGS84ToCartesian(r)},!1),n.orientation=new d.CallbackProperty(function(){return d.Transforms.headingPitchRollQuaternion(o.transformWGS84ToCartesian(r),new d.HeadingPitchRoll(d.Math.toRadians(0),d.Math.toRadians(0),d.Math.toRadians(0)))},!1);let e=a,t=!1;return n.ellipse={material:i,height:c,semiMajorAxis:new d.CallbackProperty(function(){return a},!1),semiMinorAxis:new d.CallbackProperty(function(){return a},!1),stRotation:new d.CallbackProperty(function(){return 0<s&&360<=(l+=s)&&(l=0),h&&((t=h<=a||a<=e?!t:t)?a+=2:a-=2),u&&(a<=u?a+=2:a=e),l},!1)},this._graphicsLayer.entities.add(n)}},craeteDynamicShadeWallGraphics:function(e){var t,i,n,o,r;if(e&&e.positions)return t=e.alp||1,i=e.num||20,n=e.color||d.Color.RED,o=e.speed||.003,(r=this.createGraphics()).wall={positions:e.positions,material:new d.ImageMaterialProperty({image:e.img||this.getDfSt(["graphic","craeteDynamicShadeWallGraphics"])||"static/data/images/Textures/fence.png",transparent:!0,color:new d.CallbackProperty(function(){return i%2==0?t-=o:t+=o,(t<=.1||1<=t)&&i++,n.withAlpha(t)},!1)})},this._graphicsLayer.entities.add(r)},createCustomDefBillboardGraphics:function(t){if(t&&t.position){var i=this,n=document.createElement("img");n.src=t.img||this.getDfSt(["graphic","createCustomDefBillboardGraphics"])||"static/data/images/file/div1.png";n.onload=function(){t.image=n;var e=i._graphicsLayer.entities.add({position:t.position,billboard:{image:function(e){var t,i;if(e.image)return(t=document.createElement("canvas")).width=e.width||150,t.height=e.height||80,(i=t.getContext("2d")).drawImage(e.image,0,0),e=e.text,i.font="15px bold 宋体",i.fillStyle="#f4fff0",i.fillText(e,55,36),t}(t),scaleByDistance:new d.NearFarScalar(150,.7,15e6,.5),verticalOrigin:d.VerticalOrigin.BOTTOM,pixelOffset:t.b_pixelOffset||new d.Cartesian2(80,-35),width:140,height:100,scale:t.b_scale||1.5,disableDepthTestDistance:Number.POSITIVE_INFINITY,imageSubRegion:{x:0,y:0,width:200,height:150}}});"function"==typeof t.callback&&t.callback(e)}}},craeteRotatePlaneGraphics:function(e){var t,i,n,o;if(e&&e.center&&e.positions)return t=this.createGraphics(),i=0,n=e.positions,o=n[0],t.position=new d.CallbackProperty(function(){return 0==i?(o=n[0],i+=1):i<n.length-1?(o=n[i],i+=1):i==n.length-1&&(o=n[i],i=0),o},!1),t.plane={plane:new d.Plane(d.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new d.Cartesian2(200,150),material:new d.ImageMaterialProperty({image:e.image})},this._graphicsLayer.entities.add(t)},createVideoPlaneGraphics:function(e){var t;if(e&&e.position)return(t=this.createGraphics()).position=e.position,t.plane={plane:new d.Plane(e.normal||d.Cartesian3.UNIT_Y,0),dimensions:e.dimensions||new d.Cartesian2(200,150),material:new d.ImageMaterialProperty({image:e.videoElement})},this._graphicsLayer.entities.add(t)},createGifBillboardGraphics:function(e){var t,i,n,o,r,a,s;if(l&&e&&e.position)return i=e.url,n=0,o=i,r=t=[],(a=document.createElement("img")).src=o,a.setAttribute("rel:animated_src",o),a.setAttribute("rel:auto_play","0"),document.body.appendChild(a),s=new l({gif:a}),new Promise(e=>{s.load(()=>{for(let e=1;e<=s.get_length();e++)s.move_to(e),r.push(s.get_canvas().toDataURL());e(r)})}),this._graphicsLayer.entities.add({position:e.position,billboard:{verticalOrigin:d.VerticalOrigin.BASELINE,image:new d.CallbackProperty(function(){return t.length?(n<6*(t.length-1)?n++:n=0,t[Math.floor(n/6)]):i},!1),scale:.2}})},setGraphicsRotate:function(e){var t,i,n,o;e&&e.entity&&e.rotateAmount&&(t=e.entity,i=e.rotateAmount,n=e.position,o=this,n.heading=0,n.pitch=0,n.roll=0,t.position=new d.CallbackProperty(function(){return o.transformWGS84ToCartesian(n)},!1),t.orientation=new d.CallbackProperty(function(){return 0<i&&(n.heading+=i,360===n.heading)&&(n.heading=0),d.Transforms.headingPitchRollQuaternion(o.transformWGS84ToCartesian(n),new d.HeadingPitchRoll(d.Math.toRadians(n.heading),d.Math.toRadians(n.pitch),d.Math.toRadians(n.roll)))},!1))},setGraphicsFloat:function(e){if(e&&e.entity&&e.maxHeiht)try{var t=e.entity,n=e.minHeiht||5,o=e.maxHeiht||100,r=e.cartesians,a=e.speed||.06,s=this,l=n,c=!1;r.length?t.positions=new d.CallbackProperty(function(){var e,t=s.transformCartesianArrayToWGS84Array(r);for(e in t){var i=t[e];(c=o<=n||n<=l?!c:c)?n+=a:n-=a,i.alt=n}return s.transformWGS84ArrayToCartesianArray(t)},!1):t.position=new d.CallbackProperty(function(){var e=s.transformCartesianToWGS84(r);return(c=o<=n||n<=l?!c:c)?n+=a:n-=a,e.alt=n,s.transformWGS84ToCartesian(e)},!1)}catch(e){console.log(e)}},createCanvasGraphics:function(o){o&&o.positions&&(this._graphicsLayer.entities.add({rectangle:{coordinates:o.positions,material:new d.ImageMaterialProperty({image:new d.CallbackProperty(function(){var e=0,t=document.createElement("canvas"),i=t.getContext("2d"),n=new Image;if(n.src=o.img||"../../images/ysCesium/logo.png",i.clearRect(0,0,o.cwidth,o.cheight),!(e<=o.cwidth))return e=0,e+=3,t;i.drawImage(n,e,0)},!1),transparent:!0})}}),"function"==typeof o.callback)&&o.callback()},createFanShape:function({viewer:e,longitude:t,latitude:i,alt:n,custMaterial:o,speed:r=0,direction:a="+"}){var s,l,c;if(e)return s=this.createGraphics(),l=0,c=this._calcPoints(t,i,n,l),s.wall={positions:new d.CallbackProperty(()=>d.Cartesian3.fromDegreesArrayHeights(c),!1),material:o||d.Color.AQUAMARINE.withAlpha(.5)},e.clock.onTick.addEventListener(()=>{0<r&&(l+=r,c=this._calcPoints(t,i,n,a+l))}),this._graphicsLayer.entities.add(s)},_computeCirclularFlight(t,i,n,o,r,a){var s=[],l=(s.push(t),s.push(i),s.push(0),d.Cartesian3.distance(d.Cartesian3.fromDegrees(t,i),d.Cartesian3.fromDegrees(n,o)));for(let e=r;e<=r+a;e++){var c=l*Math.sin(e*Math.PI/180),h=Math.cos(e*Math.PI/180),u=(o-i)*h+i;s.push((n-t)*h+t),s.push(u),s.push(c)}return s},_calcPoints(e,t,i,n){var o=d.Transforms.eastNorthUpToFixedFrame(d.Cartesian3.fromDegrees(e,t)),r=i*Math.cos(n*Math.PI/180),i=i*Math.sin(n*Math.PI/180),n=d.Cartesian3.fromElements(r,i,0),r=d.Matrix4.multiplyByPoint(o,n,new d.Cartesian3),i=d.Cartographic.fromCartesian(r),o=d.Math.toDegrees(i.longitude),n=d.Math.toDegrees(i.latitude);return this._computeCirclularFlight(e,t,o,n,0,90)}};let m=null;function G(e,t,i){e&&(m=t,this._installMaterial())}function O(){}G.prototype={addMaterialLineGraphics:function(e){var t;if(this._viewer&&e&&e.image)return this._initPolylineCustomMaterialProperty(e),(t=this.createGraphics()).polyline={positions:e.positions,material:new m.PolylineCustomMaterialProperty({color:e.color||m.Color.RED,duration:e.duration||500}),width:e.width},this._viewer.entities.add(t)},getCustomMaterialLine:function(e){if(this._viewer&&e&&e.image)return this._initPolylineCustomMaterialProperty(e)},_initPolylineCustomMaterialProperty(i){if(i){var e=m.Color,t=m.defaultValue,n=m.defined,o=Object.defineProperties,r=m.Event,a=m.createPropertyDescriptor,s=m.Property,l=m.Material,c=e.WHITE,h=i.MaterialType||"wallType"+parseInt(1e3*Math.random());const u=function(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||m.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0};return o(u.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),u.prototype.getType=function(){return h},u.prototype.getValue=function(e,t){return(t=n(t)?t:{}).color=s.getValueOrClonedDefault(this._color,e,c,t.color),t.image=i.image,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},u.prototype.equals=function(e){return this===e||e instanceof u&&s.equals(this._color,e._color)},l._materialCache.addMaterial(h,{fabric:{type:h,uniforms:{color:i.color||new m.Color(1,0,0,.5),image:i.image,time:i.color.time||0},source:this._getDynamicLineShader({get:!0})},translucent:function(){return!0}}),new u(i)}},addMaterialWallGraphics:function(e){var t;if(this._viewer&&e&&e.image)return this._initWallCustomMaterialProperty(e),(t=this.createGraphics()).wall={positions:e.positions,material:new m.Scene.WallLinkCustomMaterialProperty({color:e.color||m.Color.RED,duration:e.duration||500}),width:e.width},this._viewer.entities.add(t)},getCustomMaterialWall:function(e){if(this._viewer&&e&&e.image)return this._initWallCustomMaterialProperty(e)},_initWallCustomMaterialProperty(i){var n=m.Color,t=m.defaultValue,o=m.defined,e=Object.defineProperties,r=m.Event,a=m.createPropertyDescriptor,s=m.Property,l=m.Material,c=i.MaterialType||"wallType"+parseInt(1e3*Math.random());function h(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new r,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||n.BLUE,this.duration=e.duration||3e3,this._time=(new Date).getTime()}return e(h.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:a("color")}),h.prototype.getType=function(){return c},h.prototype.getValue=function(e,t){return(t=o(t)?t:{}).color=s.getValueOrClonedDefault(this._color,e,n.WHITE,t.color),t.image=i.image,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},h.prototype.equals=function(e){return this===e||e instanceof h&&s.equals(this._color,e._color)},l._materialCache.addMaterial(c,{fabric:{type:c,uniforms:{color:new n(1,0,0,.5),image:i.image,time:0},source:this._getDirectionWallShader({get:!0,count:i.count,freely:i.freely,direction:i.direction})},translucent:function(){return!0}}),new(m.Scene.WallLinkCustomMaterialProperty=h)(i)},_installMaterial:function(){this._installWaveCircleMaterial(),this._installCircleFadeMaterial(),this._installCityLineMaterial(),this._installWarnMaterial(),this._installFlowMaterial()},_installWaveCircleMaterial:function(){var t=m.Color,i=m.defaultValue,e=Object.defineProperties,n=m.Event,o=m.Property,r=m.Material;function a(e){e=e||{},this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this._duration=void 0,this._durationSubscription=void 0,this.color=i(e.color,t.fromBytes(0,255,255,255)),this.duration=i(e.duration,45),this.count=Math.max(i(e.count,2),1),this.gradient=i(e.gradient,.1),this.gradient<0?this.gradient=0:1<this.gradient&&(this.gradient=1)}e(a.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),a.prototype.getType=function(){return r.CircleWaveType},a.prototype.getValue=function(e,t){return(t=t||{}).color=o.getValueOrUndefined(this._color,e),t.duration=this._duration,t.count=this.count,t.gradient=this.gradient,t},a.prototype.equals=function(e){return this===e||e instanceof a&&m.Property.equals(this._color,e._color)},e(a.prototype,{color:m.createPropertyDescriptor("color"),duration:m.createPropertyDescriptor("duration")}),m.Scene.CircleWaveMaterialProperty=a,r.CircleWaveType="CircleWave",r._materialCache.addMaterial(r.CircleWaveType,{fabric:{type:r.CircleWaveType,uniforms:{color:new t(1,0,0,.7),duration:45,count:1,gradient:.1},source:this._getDynamicCircleShader({get:!0})},translucent:function(){return!0}})},_installCircleFadeMaterial:function(){var e=m.Color,t=m.defaultValue,i=Object.defineProperties,n=m.Event,o=m.Property,r=m.Material,a=new e(0,0,0,0);function s(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=t(e.color,a),this._duration=e.duration||1e3,this._time=void 0}i(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return r.CircleFadeMaterialType},s.prototype.getValue=function(e,t){return(t=t||{}).color=o.getValueOrClonedDefault(this._color,e,a,t.color),void 0===this._time&&(this._time=(new Date).getTime()),t.time=((new Date).getTime()-this._time)/this._duration,t},s.prototype.equals=function(e){return this===e||e instanceof s&&m.Property.equals(this._color,e._color)},i(s.prototype,{color:m.createPropertyDescriptor("color")}),m.Scene.CircleFadeMaterialProperty=s,r.CircleFadeMaterialType="CircleFadeMaterial",r._materialCache.addMaterial(r.CircleFadeMaterialType,{fabric:{type:r.CircleFadeMaterialType,uniforms:{color:new e(1,0,0,1),time:1},source:this._getCircleFadeShader({get:!0})},translucent:function(){return!0}})},_installCityLineMaterial:function(){var e=m.Color,t=m.defaultValue,i=m.defined,n=Object.defineProperties,o=m.Event,r=m.createPropertyDescriptor,a=m.Property,s=m.Material,l=e.WHITE;function c(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||m.Color.BLUE,this.duration=e.duration||1e3,this._time=void 0,this._img=e.imgUrl||s.PolylineCityLinkImage}n(c.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:r("color")}),c.prototype.getType=function(){return s.PolylineCityLinkType},c.prototype.getValue=function(e,t){return(t=i(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,l,t.color),t.image=this._img,void 0===this._time&&(this._time=e.secondsOfDay),t.time=1e3*(e.secondsOfDay-this._time)/this.duration,t},c.prototype.equals=function(e){return this===e||e instanceof c&&a.equals(this._color,e._color)},m.Scene.PolylineCityLinkMaterialProperty=c,s.PolylineCityLinkType="PolylineCityLink",s.PolylineCityLinkImage=this.getDfSt(["material","PolylineCityLinkMaterialProperty"])||"static/data/images/Textures/meteor_01.png",s._materialCache.addMaterial(s.PolylineCityLinkType,{fabric:{type:s.PolylineCityLinkType,uniforms:{color:new e(1,0,0,1),image:s.PolylineCityLinkImage,time:0},source:this._getDynamicLightLineShader({get:!0})},translucent:function(){return!0}})},_installWarnMaterial:function(){var i=m.Color,t=m.defaultValue,n=m.defined,e=Object.defineProperties,o=m.Event,r=m.createPropertyDescriptor,a=m.Property,s=m.Material;function l(e){e=t(e,t.EMPTY_OBJECT),this._definitionChanged=new o,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||i.BLUE,this.duration=e.duration||3e3,this._time=(new Date).getTime()}e(l.prototype,{isvarant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),l.prototype.getType=function(){return s.WarnLinkType},l.prototype.getValue=function(e,t){return(t=n(t)?t:{}).color=a.getValueOrClonedDefault(this._color,e,i.WHITE,t.color),t.image=s.WarnLinkImage,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},l.prototype.equals=function(e){return this===e||e instanceof l&&a.equals(this._color,e._color)},e(l.prototype,{color:r("color")}),m.Scene.WarnLinkMaterialProperty=l,s.WarnLinkType="WarnWallLinkType",s.WarnLinkImage=this.getDfSt(["material","WarnLinkMaterialProperty"])||"static/data/images/Textures/jsx2.png",s._materialCache.addMaterial(s.WarnLinkType,{fabric:{type:s.WarnLinkType,uniforms:{color:new i(1,0,0,.5),image:s.WarnLinkImage,time:0},source:this._getDirectionWallShader({get:!0,count:10,freely:"cross",direction:"-"})},translucent:function(){return!0}})},_installFlowMaterial:function(){var t=m.Color,i=m.defaultValue,e=Object.defineProperties,n=m.Event,o=m.createPropertyDescriptor,r=m.Property,a=m.Material;function s(e){e=i(e,i.EMPTY_OBJECT),this._definitionChanged=new n,this._color=void 0,this._colorSubscription=void 0,this.color=e.color||t.fromBytes(0,255,255,255),this._duration=void 0,this._durationSubscription=void 0,this.duration=i(e.duration,45)}e(s.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}}),s.prototype.getType=function(){return a.PolylineFlowType},s.prototype.getValue=function(e,t){return(t=t||{}).color=r.getValueOrClonedDefault(this._color,e,m.Color.WHITE,t.color),t.duration=this._duration,t},s.prototype.equals=function(e){return this===e||e instanceof s&&r.equals(this._color,e._color)},e(s.prototype,{color:o("color"),duration:o("duration")}),m.Scene.PolylineFlowMaterialProperty=s,a.PolylineFlowType="PolylineFlow",a._materialCache.addMaterial(a.PolylineFlowType,{fabric:{type:a.PolylineFlowType,uniforms:{color:new t(1,1,2,.7),duration:45},source:this._getFlowLineShader({get:!0})},translucent:function(){return!0}})}},O.prototype={_getFlowLineShader:function(){return"uniform vec4 color;\n uniform float duration;\n \n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n float t =fract(czm_frameNumber / duration);\n t *= 1.03;\n float alpha = smoothstep(t- 0.03, t, st.s) * step(-t, -st.s);\n alpha += 0.1;\n vec4 fragColor;\n fragColor.rgb = (color.rgb) / 0.5;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = fragColor.rgb;\n material.alpha = alpha;\n material.emission = fragColor.rgb;\n return material;\n }\n "},_getDynamicLineShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n if(texture(image, vec2(0.0, 0.0)).a == 1.0){\n discard;\n }else{\n material.alpha = texture(image, vec2(1.0 - fract(time - st.s), st.t)).a * color.a;\n }\n \n material.diffuse = max(color.rgb * material.alpha * 3.0, color.rgb);\n \n return material;\n }\n "},_getDynamicLightLineShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n vec4 colorImage = texture(image, vec2(fract(1.0 *st.s - time), fract(st.t)));\n \n vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getDirectionWallShader:function(e){var t;if(e&&e.get)return t="czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n \n ","vertical"==e.freely?t+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.t "+e.direction+" time), fract(st.s)));\n ":t+="vec4 colorImage = texture(image, vec2(fract(float("+e.count+")*st.s "+e.direction+" time), fract(st.t)));\n ",(t+="vec4 fragColor;\n fragColor.rgb = (colorImage.rgb+color.rgb) / 1.0;\n fragColor = czm_gammaCorrect(fragColor);\n ")+" material.diffuse = colorImage.rgb;\n material.alpha = colorImage.a;\n material.emission = fragColor.rgb;\n \n return material;\n }\n "},_getCircleFadeShader:function(e){if(e&&e.get)return"czm_material czm_getMaterial(czm_materialInput materialInput)\n \n {\n \n czm_material material = czm_getDefaultMaterial(materialInput);\n \n material.diffuse = 1.5 * color.rgb;\n \n vec2 st = materialInput.st;\n \n float dis = distance(st, vec2(0.5, 0.5));\n \n float per = fract(time);\n \n if(dis > per * 0.5){\n \n //material.alpha = 0.0;\n \n discard;\n \n }else {\n \n material.alpha = color.a * dis / per / 2.0;\n \n }\n \n return material;\n \n }"},_getDynamicCircleShader:function(e){if(e&&e.get)return"uniform vec4 color;\n uniform float duration;\n uniform float count;\n uniform float gradient;\n \n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n material.diffuse = 1.5 * color.rgb;\n vec2 st = materialInput.st;\n vec3 str = materialInput.str;\n float dis = distance(st, vec2(0.5, 0.5));\n float per = fract(czm_frameNumber / duration);\n if(abs(str.z) > 0.001){\n discard;\n }\n if(dis > 0.5){\n discard;\n } else {\n float perDis = 0.5 / count;\n float disNum;\n float bl = .0;\n for (int i = 0; i <= 10; i++) {\n if (float(i) <= count) {\n disNum = perDis * float(i) - dis + per / count;\n if (disNum > 0.0) {\n if (disNum < perDis) {\n bl = 1.0 - disNum / perDis;\n } else if (disNum - perDis < perDis) {\n bl = 1.0 - abs(1.0 - disNum / perDis);\n }\n material.alpha = pow(bl, gradient);\n }\n }\n }\n }\n return material;\n }\n "},_getRadarScanShader:function(e){if(e&&e.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform vec3 u_scanLineNormalEC;\n out vec4 myOutputColor;\n uniform float u_radius;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera =czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n bool isPointOnLineRight(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 v01 = testPt - ptOnLine;\n normalize(v01);\n vec3 temp = cross(v01, lineNormal);\n float d = dot(temp, u_scanPlaneNormalEC);\n return d > 0.5;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point -planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float distancePointToLine(in vec3 ptOnLine, in vec3 lineNormal, in vec3 testPt){\n vec3 tempPt = pointProjectOnPlane(lineNormal, ptOnLine, testPt);\n return length(tempPt - ptOnLine);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth( texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n float twou_radius = u_radius * 2.0;\n if(dis < u_radius){\n float f0 = 1.0 -abs(u_radius - dis) / u_radius;\n f0 = pow(f0, 64.0);\n vec3 lineEndPt = vec3(u_scanCenterEC.xyz) + u_scanLineNormalEC * u_radius;\n float f = 0.0;\n if(isPointOnLineRight(u_scanCenterEC.xyz, u_scanLineNormalEC.xyz, prjOnPlane.xyz)){\n float dis1= length(prjOnPlane.xyz - lineEndPt);\n f = abs(twou_radius -dis1) / twou_radius;\n f = pow(f, float("+e.width+"));\n }\n if(float("+e.border+") > 0.0){\n myOutputColor = mix(myOutputColor, u_scanColor, f + f0);\n } else {\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n }\n "},_getCircleScanShader:function(e){if(e&&e.get)return"uniform sampler2D colorTexture;\n uniform sampler2D depthTexture;\n in vec2 v_textureCoordinates;\n uniform vec4 u_scanCenterEC;\n uniform vec3 u_scanPlaneNormalEC;\n uniform float u_radius;\n out vec4 myOutputColor;\n uniform vec4 u_scanColor;\n \n vec4 toEye(in vec2 uv, in float depth){\n vec2 xy = vec2((uv.x * 2.0 - 1.0),(uv.y * 2.0 - 1.0));\n vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);\n posInCamera =posInCamera / posInCamera.w;\n return posInCamera;\n }\n \n vec3 pointProjectOnPlane(in vec3 planeNormal, in vec3 planeOrigin, in vec3 point){\n vec3 v01 = point - planeOrigin;\n float d = dot(planeNormal, v01) ;\n return (point - planeNormal * d);\n }\n \n float getDepth(in vec4 depth){\n float z_window = czm_unpackDepth(depth);\n z_window = czm_reverseLogDepth(z_window);\n float n_range = czm_depthRange.near;\n float f_range = czm_depthRange.far;\n return (2.0 * z_window - n_range - f_range) / (f_range - n_range);\n }\n \n void main(){\n myOutputColor = texture(colorTexture, v_textureCoordinates);\n float depth = getDepth(texture(depthTexture, v_textureCoordinates));\n vec4 viewPos = toEye(v_textureCoordinates, depth);\n vec3 prjOnPlane = pointProjectOnPlane(u_scanPlaneNormalEC.xyz, u_scanCenterEC.xyz, viewPos.xyz);\n float dis = length(prjOnPlane.xyz - u_scanCenterEC.xyz);\n if(dis < u_radius){\n float f = 1.0 - abs(u_radius - dis) / u_radius;\n f = pow(f, float("+e.border+"));\n myOutputColor = mix(myOutputColor, u_scanColor, f);\n }\n }\n "}};let S={},B=void 0;function u(e,t,i){e&&(this._viewer=e,S=t,B=i,S.Ion.defaultAccessToken="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJmYzkwZWEwYy1mMmIwLTQwYjctOWJlOC00OWU4ZWU1YTZhOTkiLCJpZCI6MTIxODIsInNjb3BlcyI6WyJhc3IiLCJnYyJdLCJpYXQiOjE1NjA0OTUyNDN9.wagvw7GxUjxvHXO6m2jjX5Jh9lN0UyTJhNGEcSm2pgE",this._drawLayer=new S.CustomDataSource("drawLayer"),e&&e.dataSources.add(this._drawLayer),this.myname="BASE",this._installBaiduImageryProvider(),this._installGooGleImageryProvider(),this._installAmapImageryProvider(),this._installTencentImageryProvider(),this._installTdtImageryProvider(),this._installGroundSkyBox())}u.prototype={createGraphics:function(){return new S.Entity},getDfSt(e){if(B)return e=e.reduce((e,t)=>(e||B)[t],void 0),B.baseService+e},setOneSkyBox:function(){return new S.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","one","positiveX"])||"static/data/images/SkyBox/00h+00.jpg",negativeX:this.getDfSt(["skyBox","one","negativeX"])||"static/data/images/SkyBox/12h+00.jpg",positiveY:this.getDfSt(["skyBox","one","positiveY"])||"static/data/images/SkyBox/06h+00.jpg",negativeY:this.getDfSt(["skyBox","one","negativeY"])||"static/data/images/SkyBox/18h+00.jpg",positiveZ:this.getDfSt(["skyBox","one","positiveZ"])||"static/data/images/SkyBox/06h+90.jpg",negativeZ:this.getDfSt(["skyBox","one","negativeZ"])||"static/data/images/SkyBox/06h-90.jpg"}})},setTwoSkyBox:function(){return new S.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_px.jpg",negativeX:this.getDfSt(["skyBox","two","negativeX"])||"static/data/images/SkyBox/Version2_dark_mx.jpg",positiveY:this.getDfSt(["skyBox","two","positiveY"])||"static/data/images/SkyBox/Version2_dark_py.jpg",negativeY:this.getDfSt(["skyBox","two","negativeY"])||"static/data/images/SkyBox/Version2_dark_my.jpg",positiveZ:this.getDfSt(["skyBox","two","positiveZ"])||"static/data/images/SkyBox/Version2_dark_pz.jpg",negativeZ:this.getDfSt(["skyBox","two","negativeZ"])||"static/data/images/SkyBox/Version2_dark_mz.jpg"}})},setThreeSkyBox:function(){return new S.SkyBox({sources:{positiveX:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_pxs.jpg",negativeX:this.getDfSt(["skyBox","three","negativeX"])||"static/data/images/SkyBox/tycho2t3_80_mxs.jpg",positiveY:this.getDfSt(["skyBox","three","positiveY"])||"static/data/images/SkyBox/tycho2t3_80_pys.jpg",negativeY:this.getDfSt(["skyBox","three","negativeY"])||"static/data/images/SkyBox/tycho2t3_80_mys.jpg",positiveZ:this.getDfSt(["skyBox","three","positiveZ"])||"static/data/images/SkyBox/tycho2t3_80_pzs.jpg",negativeZ:this.getDfSt(["skyBox","three","negativeZ"])||"static/data/images/SkyBox/tycho2t3_80_mzs.jpg"}})},setOneGroundSkyBox:function(){return new S.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearOne","positiveX"])||"static/data/images/SkyBox/rightav9.jpg",negativeX:this.getDfSt(["skyBox","nearOne","negativeX"])||"static/data/images/SkyBox/leftav9.jpg",positiveY:this.getDfSt(["skyBox","nearOne","positiveY"])||"static/data/images/SkyBox/frontav9.jpg",negativeY:this.getDfSt(["skyBox","nearOne","negativeY"])||"static/data/images/SkyBox/backav9.jpg",positiveZ:this.getDfSt(["skyBox","nearOne","positiveZ"])||"static/data/images/SkyBox/topav9.jpg",negativeZ:this.getDfSt(["skyBox","nearOne","negativeZ"])||"static/data/images/SkyBox/bottomav9.jpg"}})},setTwoGroundSkyBox:function(){return new S.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearTwo","positiveX"])||"static/data/images/SkyBox/SunSetRight.png",negativeX:this.getDfSt(["skyBox","nearTwo","negativeX"])||"static/data/images/SkyBox/SunSetLeft.png",positiveY:this.getDfSt(["skyBox","nearTwo","positiveY"])||"static/data/images/SkyBox/SunSetFront.png",negativeY:this.getDfSt(["skyBox","nearTwo","negativeY"])||"static/data/images/SkyBox/SunSetBack.png",positiveZ:this.getDfSt(["skyBox","nearTwo","positiveZ"])||"static/data/images/SkyBox/SunSetUp.png",negativeZ:this.getDfSt(["skyBox","nearTwo","negativeZ"])||"static/data/images/SkyBox/SunSetDown.png"}})},setThreeGroundSkyBox:function(){return new S.Scene.GroundSkyBox({sources:{positiveX:this.getDfSt(["skyBox","nearThree","positiveX"])||"static/data/images/SkyBox/Right.jpg",negativeX:this.getDfSt(["skyBox","nearThree","negativeX"])||"static/data/images/SkyBox/Left.jpg",positiveY:this.getDfSt(["skyBox","nearThree","positiveY"])||"static/data/images/SkyBox/Front.jpg",negativeY:this.getDfSt(["skyBox","nearThree","negativeY"])||"static/data/images/SkyBox/Back.jpg",positiveZ:this.getDfSt(["skyBox","nearThree","positiveZ"])||"static/data/images/SkyBox/Up.jpg",negativeZ:this.getDfSt(["skyBox","nearThree","negativeZ"])||"static/data/images/SkyBox/Down.jpg"}})},setDarkEffect:function(e){return e=e||{},this._viewer.scene.postProcessStages.add(new S.PostProcessStage({name:"darkEffect",fragmentShader:"uniform sampler2D colorTexture;\nin vec2 v_textureCoordinates;\nuniform float scale;\nuniform vec3 offset;\nvoid main() {\n vec4 color = texture(colorTexture, v_textureCoordinates);\n out_FragColor = vec4(color.r*0.2,color.g * 0.4,color.b*0.6, 1.0);\n}\n",uniforms:{scale:1,offset:function(){return e.offset||new S.Cartesian3(.1,.2,.3)}}}))},setBlurBloom:function(e){if(this._viewer&&e)return this._viewer.scene.postProcessStages.add(new S.PostProcessStage({name:"blur_x_direction",fragmentShader:"uniform float height;\nuniform float width;\nuniform sampler2D colorTexture1;\n\nin vec2 v_textureCoordinates;\n\nconst int SAMPLES = 9;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nfloat wr = float(1.0 / width);\nfloat hr = float(1.0 / height);\nvec4 result = vec4(0.0);\nint count = 0;\nfor(int i = -SAMPLES; i <= SAMPLES; ++i){\nfor(int j = -SAMPLES; j <= SAMPLES; ++j){\nvec2 offset = vec2(float(i) * wr, float(j) * hr);\nresult += texture(colorTexture1, st + offset);\n}\n}\nresult = result / float(count);\nout_FragColor = result;\n}\n",uniforms:{width:e.width,height:e.height,colorTexture1:"Bright"}}))},setRainEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new S.PostProcessStage({name:"rainEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n \n float hash(float x){\n return fract(sin(x*23.3)*13.13);\n }\n \n void main(){\n float time = czm_frameNumber / 60.0;\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 c=vec3(.6,.7,.8);\n float a=-.4;\n float si=sin(a),co=cos(a);\n uv*=mat2(co,-si,si,co);\n uv*=length(uv+vec2(0,4.9))*.3+1.;\n float v=1.-sin(hash(floor(uv.x*100.))*2.);\n float b=clamp(abs(sin(20.*time*v+uv.y*(5./(2.+v))))-.95,0.,1.)*20.;\n c*=v*b;\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(c, 1), 0.2);\n }\n "}))},setSnowEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new S.PostProcessStage({name:"snowEffect",fragmentShader:"uniform sampler2D colorTexture;\n in vec2 v_textureCoordinates;\n float snow(vec2 uv,float scale){\n float time = czm_frameNumber / 60.0;\n float w=smoothstep(1.,0.,-uv.y*(scale/10.));\n if(w<.1)return 0.;\n uv+=time/scale;\n uv.y+=time*2./scale;\n uv.x+=sin(uv.y+time*.5)/scale;\n uv*=scale;\n vec2 s=floor(uv),f=fract(uv),p;\n float k=3.,d;\n p=.5+.35*sin(11.*fract(sin((s+p+scale)*mat2(7,3,6,5))*5.))-f;\n d=length(p);\n k=min(d,k);\n k=smoothstep(0.,k,sin(f.x+f.y)*0.01);\n return k*w;\n }\n \n void main(){\n vec2 resolution = czm_viewport.zw;\n vec2 uv=(gl_FragCoord.xy*2.-resolution.xy)/min(resolution.x,resolution.y);\n vec3 finalColor=vec3(0);\n float c = 0.0;\n c+=snow(uv,30.)*.0;\n c+=snow(uv,20.)*.0;\n c+=snow(uv,15.)*.0;\n c+=snow(uv,10.);\n c+=snow(uv,8.);\n c+=snow(uv,6.);\n c+=snow(uv,5.);\n finalColor=(vec3(c));\n out_FragColor = mix(texture(colorTexture, v_textureCoordinates), vec4(finalColor,1), 0.3);\n \n }\n "}))},setFogEffect:function(){if(this._viewer)return this._viewer.scene.postProcessStages.add(new S.PostProcessStage({fragmentShader:"float getDistance(sampler2D depthTexture, vec2 texCoords) \n{ \n float depth = czm_unpackDepth(texture(depthTexture, texCoords)); \n if (depth == 0.0) { \n return czm_infinity; \n } \n vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depth); \n return -eyeCoordinate.z / eyeCoordinate.w; \n} \nfloat interpolateByDistance(vec4 nearFarScalar, float distance) \n{ \n float startDistance = nearFarScalar.x; \n float startValue = nearFarScalar.y; \n float endDistance = nearFarScalar.z; \n float endValue = nearFarScalar.w; \n float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0); \n return mix(startValue, endValue, t); \n} \nvec4 alphaBlend(vec4 sourceColor, vec4 destinationColor) \n{ \n return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a); \n} \nuniform sampler2D colorTexture; \nuniform sampler2D depthTexture; \nuniform vec4 fogByDistance; \nuniform vec4 fogColor; \nin vec2 v_textureCoordinates; \nvoid main(void) \n{ \n float distance = getDistance(depthTexture, v_textureCoordinates); \n vec4 sceneColor = texture(colorTexture, v_textureCoordinates); \n float blendAmount = interpolateByDistance(fogByDistance, distance); \n vec4 finalFogColor = vec4(fogColor.rgb, fogColor.a * blendAmount); \n out_FragColor = alphaBlend(finalFogColor, sceneColor); \n} \n",uniforms:{fogByDistance:new S.Cartesian4(10,0,200,.3),fogColor:S.Color.AZURE}}))},setDefSceneConfig:function(){this._viewer&&(this._viewer.scene.sun.show=!1,this._viewer.scene.moon.show=!1,this._viewer.scene.fxaa=!0,this._viewer.scene.globe.depthTestAgainstTerrain=!0,this._viewer.scene.undergroundMode=!1,this._viewer.scene.terrainProvider.isCreateSkirt=!1,this._viewer.scene.skyAtmosphere.show=!1,this._viewer.scene.globe.showGroundAtmosphere=!1,this._viewer.scene.globe.enableLighting=!0,this._viewer.scene.fog.enabled=!1,this._viewer.cesiumWidget.creditContainer.style.display="none")},setBloomLightScene:function(){this._viewer&&(this._viewer.scene.postProcessStages.bloom.enabled=!0,this._viewer.scene.postProcessStages.bloom.uniforms.contrast=119,this._viewer.scene.postProcessStages.bloom.uniforms.brightness=-.4,this._viewer.scene.postProcessStages.bloom.uniforms.glowOnly=!1,this._viewer.scene.postProcessStages.bloom.uniforms.delta=.9,this._viewer.scene.postProcessStages.bloom.uniforms.sigma=3.78,this._viewer.scene.postProcessStages.bloom.uniforms.stepSize=5,this._viewer.scene.postProcessStages.bloom.uniforms.isSelected=!1)},removePostProcessStage:function(e){e&&(Array.isArray(e)?e.forEach(e=>{this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e)}):this._viewer.scene.postProcessStages.contains(e)&&this._viewer.scene.postProcessStages.remove(e))},setView:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new S.Cartesian3(0,e.distance,window.opt.distance),e.position=S.Cartesian3.add(e.position,t,new S.Cartesian3)),this._viewer.scene.camera.setView({destination:e.position,orientation:e.orientation||{heading:S.Math.toRadians(90),pitch:S.Math.toRadians(90),roll:S.Math.toRadians(0)}}))},flyTo:function(e){var t;this._viewer&&e&&e.position&&(e.distance&&(t=new S.Cartesian3(0,e.distance,e.distance),e.position=S.Cartesian3.add(e.position,t,new S.Cartesian3)),this._viewer.scene.camera.flyTo({destination:e.position,orientation:e.orientation||{heading:S.Math.toRadians(90),pitch:S.Math.toRadians(90),roll:S.Math.toRadians(0)},easingFunction:e.easingFunction||S.EasingFunction.LINEAR_NONE,duration:e.duration||3,complete:e.callback}))},transformCartesianToWGS84:function(e){if(this._viewer&&e)return e=S.Ellipsoid.WGS84.cartesianToCartographic(e),{lng:S.Math.toDegrees(e.longitude),lat:S.Math.toDegrees(e.latitude),alt:e.height}},transformWGS84ArrayToCartesianArray:function(e,t){var i;if(this._viewer&&e)return i=this,e?e.map(function(e){return i.transformWGS84ToCartesian(e,t)}):[]},transformWGS84ToCartesian:function(e,t){if(this._viewer)return e?S.Cartesian3.fromDegrees(e.lng||e.lon,e.lat,e.alt=t||e.alt,S.Ellipsoid.WGS84):S.Cartesian3.ZERO},transformCartesianArrayToWGS84Array:function(e){var t;if(this._viewer)return t=this,e?e.map(function(e){return t.transformCartesianToWGS84(e)}):[]},setCameraEotateHeading(l){if(l){let t=this._viewer,i=S.Cartesian3.fromDegrees(l.lng,l.lat,l.height),n=S.Math.toRadians(-30),o=12,r=5e3,e=S.JulianDate.fromDate(new Date),a=(t.clock.startTime=e.clone(),t.clock.currentTime=e.clone(),t.clock.clockRange=S.ClockRange.CLAMPED,t.clock.clockStep=S.ClockStep.SYSTEM_CLOCK,t.camera.heading),s=function(){var e=S.JulianDate.secondsDifference(t.clock.currentTime,t.clock.startTime),e=S.Math.toRadians(e*o)+a;t.scene.camera.setView({destination:i,orientation:{heading:e,pitch:n}}),t.scene.camera.moveBackward(r),0<=S.JulianDate.compare(t.clock.currentTime,t.clock.stopTime)&&t.clock.onTick.removeEventListener(s)};t.clock.onTick.addEventListener(s)}},transformWGS84ToCartographic:function(e){return e?S.Cartographic.fromDegrees(e.lng||e.lon,e.lat,e.alt):S.Cartographic.ZERO},getCatesian3FromPX:function(e){if(this._viewer&&e){var t,i,n=this._viewer.scene.pick(e),o=null,r=!1,a=!1;if((r=n instanceof S.Cesium3DTileFeature?!0:r)&&(o=this._viewer.scene.pickPosition(e))&&((t=S.Cartographic.fromCartesian(o)).height<0&&(t.height=0),s=S.Math.toDegrees(t.longitude),i=S.Math.toDegrees(t.latitude),t=t.height,o=this.transformWGS84ToCartesian({lng:s,lat:i,alt:t})),!n){var s=this._viewer.scene.camera.getPickRay(e);if(!s)return null;o=this._viewer.scene.globe.pick(s,this._viewer.scene),a=!0}return(o=r||a?o:this._viewer.scene.camera.pickEllipsoid(e,this._viewer.scene.globe.ellipsoid))?(i=this.transformCartesianToWGS84(o)).alt<0?this.transformWGS84ToCartesian(i,.1):o:!1}},getCameraPosition:function(){if(this._viewer){var e,t,i,n,o,r,a,s,l,c,h,u=this._viewer.scene.camera.pickEllipsoid(new S.Cartesian2(this._viewer.canvas.clientWidth/2,this._viewer.canvas.clientHeight/2));if(u)return e=180*(u=S.Ellipsoid.WGS84.cartesianToCartographic(u)).longitude/Math.PI,u=180*u.latitude/Math.PI,n=this._viewer.camera._direction,t=S.Math.toDegrees(n.x),i=S.Math.toDegrees(n.y),n=S.Math.toDegrees(n.z),o=this._viewer.camera.positionCartographic.height,r=S.Math.toDegrees(this._viewer.camera.heading),a=S.Math.toDegrees(this._viewer.camera.pitch),s=S.Math.toDegrees(this._viewer.camera.roll),c=(l=this._viewer.camera.computeViewRectangle()).west/Math.PI*180,h=l.north/Math.PI*180,c=(c+l.east/Math.PI*180)/2,h=(h+l.south/Math.PI*180)/2,{lon:e,lat:u,height:o,heading:r,pitch:a,roll:s,position:this._viewer.camera.position,cameraHeading:this._viewer.camera.heading,cameraPitch:this._viewer.camera.pitch,cameraRoll:this._viewer.camera.roll,center:{x:c,y:h},direction:new S.Cartesian3(t,i,n)}}},updateCameraState:function(e){this._viewer.scene._screenSpaceCameraController.enableRotate=e,this._viewer.scene._screenSpaceCameraController.enableTranslate=e,this._viewer.scene._screenSpaceCameraController.enableZoom=e,this._viewer.scene._screenSpaceCameraController.enableTilt=e,this._viewer.scene._screenSpaceCameraController.enableLook=e},bindHandelEvent:function({leftClick:t,mouseMove:i,doubleClick:n,leftDown:o,mouseWheel:r,leftUp:a}){var s;this._viewer&&(s=new S.ScreenSpaceEventHandler(this._viewer.canvas),t&&s.setInputAction(function(e){t(e,s)},S.ScreenSpaceEventType.LEFT_CLICK),i&&s.setInputAction(function(e){i(e,s)},S.ScreenSpaceEventType.MOUSE_MOVE),n&&s.setInputAction(function(e){n(e,s)},S.ScreenSpaceEventType.LEFT_DOUBLE_CLICK),o&&s.setInputAction(function(e){o(e,s)},S.ScreenSpaceEventType.LEFT_DOWN),r&&s.setInputAction(function(e){r(e,s)},S.ScreenSpaceEventType.WHEEL),a)&&s.setInputAction(function(e){a(e,s)},S.ScreenSpaceEventType.LEFT_UP)},getHandelPosition:function(t){var i,n;this._viewer&&(i=new S.ScreenSpaceEventHandler(this._viewer.scene.canvas),n=this,i.setInputAction(function(e){e=n._viewer.scene.camera.pickEllipsoid(e.endPosition,n._viewer.scene.globe.ellipsoid);"function"==typeof t&&t(n.transformCartesianToWGS84(e),i)},S.ScreenSpaceEventType.MOUSE_MOVE))},saveSceneImages:function(){var e,t;this._viewer&&(t=this._viewer.scene.canvas.toDataURL("image/png").replace("image/png","image/octet-stream"),e=document.createElement("a"),t=function(e){for(var e=e.split(","),t=e[0].match(/:(.*?);/)[1],i=atob(e[1]),n=i.length,o=new Uint8Array(n);n--;)o[n]=i.charCodeAt(n);return new Blob([o],{type:t})}(t),t=URL.createObjectURL(t),e.download="scene.png",e.href=t,e.click())},_installAmapImageryProvider:function(){S.Scene.AmapImageryProvider=function(e){return e.url="img"===e.style?"https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}":"http://webrd{s}.is.autonavi.com/appmaptile?lang=zh_cn&size=1&scale=1&style=7&x={x}&y={y}&z={z}",e.subdomains||(e.subdomains=["01","02","03","04"]),new S.UrlTemplateImageryProvider(e)}},_installTdtImageryProvider:function(){S.Scene.TdtImageryProvider=function(e){return new S.UrlTemplateImageryProvider({url:"http://t{s}.tianditu.gov.cn/{layer}_c/wmts?service=WMTS&version=1.0.0&request=GetTile&tilematrix={TileMatrix}&layer={layer}&style={style}&tilerow={TileRow}&tilecol={TileCol}&tilematrixset={TileMatrixSet}&format=tiles&tk={key}".replace(/\{layer\}/g,e.style||"vec").replace(/\{key\}/g,e.key||""),style:"default",format:"tiles",tileMatrixSetID:"c",matrixSet:"c",wrapX:!0,crossOrigin:"anonymous",subdomains:[...Array(6).keys()].map(e=>(e+1).toString()),tileMatrixLabels:[...Array(18).keys()].map(e=>(e+1).toString()),tilingScheme:new S.GeographicTilingScheme,maximumLevel:18})}},_installTencentImageryProvider:function(){S.Scene.TencentImageryProvider=function(e){return e.layer="img",e.url="https://p2.map.gtimg.com/sateTiles/{z}/{sx}/{sy}/{x}_{reverseY}.jpg?version=229",e.subdomains||(e.subdomains=["0","1","2"]),e.customTags={sx:function(e,t,i,n){return t>>4},sy:function(e,t,i,n){return(1<<n)-i>>4}},new S.UrlTemplateImageryProvider(e)}},_installGooGleImageryProvider:function(){S.Scene.GoogleImageryProvider=function(e){return e.url="img"===e.style?"http://mt{s}.google.cn/vt/lyrs=s&hl=zh-CN&x={x}&y={y}&z={z}&s=Gali":"ter"===e.style?"http://mt{s}.google.cn/vt/lyrs=t@131,r@227000000&hl=zh-CN&gl=cn&x={x}&y={y}&z={z}&s=Galile":"http://mt{s}.google.cn/vt/lyrs=m@207000000&hl=zh-CN&gl=CN&src=app&x={x}&y={y}&z={z}&s=Galile",e.subdomains||(e.subdomains=["1","2","3","4","5"]),new S.UrlTemplateImageryProvider(e)}},_installBaiduImageryProvider:function(){var t="http://api{s}.map.bdimg.com/customimage/tile?&x={x}&y={y}&z={z}&scale=1&customid={style}";function e(e){t=e.temp_url||t,this._url=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=18,this._minimumLevel=1,this._tilingScheme=new S.WebMercatorTilingScheme({rectangleSouthwestInMeters:new S.Cartesian2(-33554054,-33746824),rectangleNortheastInMeters:new S.Cartesian2(33554054,33746824)}),this._rectangle=this._tilingScheme.rectangle,this._credit=void 0,this._style=e.style||"normal"}Object.defineProperties(e.prototype,{url:{get:function(){return this._url}},token:{get:function(){return this._token}},tileWidth:{get:function(){if(this.ready)return this._tileWidth;throw new S.DeveloperError("tileWidth must not be called before the imagery provider is ready.")}},tileHeight:{get:function(){if(this.ready)return this._tileHeight;throw new S.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},maximumLevel:{get:function(){if(this.ready)return this._tileHeight;throw new S.DeveloperError("tileHeight must not be called before the imagery provider is ready.")}},minimumLevel:{get:function(){if(this.ready)return 0;throw new S.DeveloperError("minimumLevel must not be called before the imagery provider is ready.")}},tilingScheme:{get:function(){if(this.ready)return this._tilingScheme;throw new S.DeveloperError("tilingScheme must not be called before the imagery provider is ready.")}},rectangle:{get:function(){if(this.ready)return this._rectangle;throw new S.DeveloperError("rectangle must not be called before the imagery provider is ready.")}},ready:{get:function(){return!!this._url}},credit:{get:function(){return this._credit}}}),e.prototype.requestImage=function(e,t,i){var n,o;if(this.ready)return n=this._tilingScheme.getNumberOfXTilesAtLevel(i),o=this._tilingScheme.getNumberOfYTilesAtLevel(i),e=this._url.replace("{x}",e-n/2).replace("{y}",o/2-t-1).replace("{z}",i).replace("{s}",1).replace("{style}",this._style),S.ImageryProvider.loadImage(this,e);throw new S.DeveloperError("requestImage must not be called before the imagery provider is ready.")},S.Scene.BaiduImageryProvider=e},_installGroundSkyBox:function(){var a=S.BoxGeometry,s=S.Cartesian3,t=S.defaultValue,l=S.defined,i=S.destroyObject,c=S.DeveloperError,h=S.GeometryPipeline,e=S.Matrix3,u=S.Matrix4,d=S.Transforms,p=S.VertexFormat,m=S.BufferUsage,f=S.CubeMap,n=S.DrawCommand,g=S.loadCubeMap,v=S.RenderState,y=S.VertexArray,_=S.BlendingState,w=S.SceneMode,C=S.ShaderProgram,P=S.ShaderSource;function o(e){this.sources=e.sources,this._sources=void 0,this.show=t(e.show,!0),this._command=new n({modelMatrix:u.clone(u.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0}l(u.getRotation)||(u.getRotation=u.getMatrix3);var x=new e;o.prototype.update=function(e,t){var i=this;if(this.show&&(e.mode===w.SCENE3D||e.mode===w.MORPHING)&&e.passes.render){var n=e.context;if(this._sources!==this.sources){this._sources=this.sources;var o=this.sources;if(!(l(o.positiveX)&&l(o.negativeX)&&l(o.positiveY)&&l(o.negativeY)&&l(o.positiveZ)&&l(o.negativeZ)))throw new c("this.sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");if(typeof o.positiveX!=typeof o.negativeX||typeof o.positiveX!=typeof o.positiveY||typeof o.positiveX!=typeof o.negativeY||typeof o.positiveX!=typeof o.positiveZ||typeof o.positiveX!=typeof o.negativeZ)throw new c("this.sources properties must all be the same type.");"string"==typeof o.positiveX?g(n,this._sources).then(function(e){i._cubeMap=i._cubeMap&&i._cubeMap.destroy(),i._cubeMap=e}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new f({context:n,source:o}))}var r=this._command;if(r.modelMatrix=d.eastNorthUpToFixedFrame(e.camera._positionWC),l(r.vertexArray)||(r.uniformMap={u_cubeMap:function(){return i._cubeMap},u_rotateMatrix:function(){return u.getRotation(r.modelMatrix,x)}},o=a.createGeometry(a.fromDimensions({dimensions:new s(2,2,2),vertexFormat:p.POSITION_ONLY})),e=this._attributeLocations=h.createAttributeLocations(o),r.vertexArray=y.fromGeometry({context:n,geometry:o,attributeLocations:e,bufferUsage:m._DRAW}),r.renderState=v.fromCache({blending:_.ALPHA_BLEND})),l(r.shaderProgram)&&this._useHdr===t||(o=new P({defines:[t?"HDR":""],sources:["uniform samplerCube u_cubeMap;\n in vec3 v_texCoord;\n void main()\n {\n vec4 color = texture(u_cubeMap, normalize(v_texCoord));\n out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);\n }\n "]}),r.shaderProgram=C.fromCache({context:n,vertexShaderSource:"in vec3 position;\n out vec3 v_texCoord;\n uniform mat3 u_rotateMatrix;\n void main()\n {\n vec3 p = czm_viewRotation * u_rotateMatrix * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\n gl_Position = czm_projection * vec4(p, 1.0);\n v_texCoord = position.xyz;\n }\n ",fragmentShaderSource:o,attributeLocations:this._attributeLocations}),this._useHdr=t),l(this._cubeMap))return r}},o.prototype.isDestroyed=function(){return!1},o.prototype.destroy=function(){var e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),i(this)},S.Scene.GroundSkyBox=o},removeHandlerByName(e=[]){e.forEach(e=>{this._viewer.screenSpaceEventHandler.removeInputAction(S.ScreenSpaceEventType[e])})}};let x={};function H(e,t){e&&(this._viewer=e,x=t)}H.prototype={splitCartesians3:function(e){for(var t=[],i=0;i<e.length;i+=3){var n=new x.Cartesian3(e[i],e[i+1],e[i+2]);t.push(n)}return t.push(t[0]),t},getLinkedPointList:function(e,t,i,n){if(this._viewer){var o=[],r=x.Cartographic.fromCartesian(e),a=x.Cartographic.fromCartesian(t),s=180*r.longitude/Math.PI,r=180*r.latitude/Math.PI,l=180*a.longitude/Math.PI,a=180*a.latitude/Math.PI,c=Math.sqrt((s-l)*(s-l)+(r-a)*(r-a))*i,h=x.Cartesian3.clone(e),u=x.Cartesian3.clone(t),d=x.Cartesian3.distance(h,x.Cartesian3.ZERO),p=x.Cartesian3.distance(u,x.Cartesian3.ZERO);if(x.Cartesian3.normalize(h,h),x.Cartesian3.normalize(u,u),0!=x.Cartesian3.distance(h,u)){var m=x.Cartesian3.angleBetween(h,u);o.push(e);for(var f=1;f<n-1;f++){var g=+f/(n-1),v=1-g,y=Math.sin(v*m)/Math.sin(m),_=Math.sin(g*m)/Math.sin(m),y=x.Cartesian3.multiplyByScalar(h,y,new x.Cartesian3),_=x.Cartesian3.multiplyByScalar(u,_,new x.Cartesian3),y=x.Cartesian3.add(y,_,new x.Cartesian3),_=g*Math.PI,v=d*v+p*g+Math.sin(_)*c,y=x.Cartesian3.multiplyByScalar(y,v,y);o.push(y)}o.push(t)}return o}},getPositionsAngle:function(e){var t,i,n,o;if(e)return i=e.position1,o=e.position2,n=x.Transforms.eastNorthUpToFixedFrame(i),n=x.Matrix4.inverse(n,new x.Matrix4),i=x.Matrix4.multiplyByPoint(n,i,new x.Cartesian3),n=x.Matrix4.multiplyByPoint(n,o,new x.Cartesian3),"pitch"===e.type?t=Math.atan2(n.z-i.z,n.x-i.x):"heading "===e.type&&(t=Math.atan2(n.y-i.y,n.x-i.x)),(o=t*(180/Math.PI))<0&&(o+=360),o},getPositionsArea:function(n){let e=0;if(n){let t=0,i=x.Ellipsoid.WGS84;n.push(n[0]);for(let e=1;e<n.length;e++){var o=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[e-1])),r=i.cartographicToCartesian(this.transformWGS84ToCartographic(n[e]));t+=o.x*r.y-r.x*o.y}e=Math.abs(t).toFixed(2)}return e},getPolygonArea:function(e){if(this._viewer){for(var t=function(e,t){var i=e.lat*radiansPerDegree,e=e.lon*radiansPerDegree,n=t.lat*radiansPerDegree,t=t.lon*radiansPerDegree,i=-Math.atan2(Math.sin(e-t)*Math.cos(n),Math.cos(i)*Math.sin(n)-Math.sin(i)*Math.cos(n)*Math.cos(e-t));return i<0&&(i+=2*Math.PI),i*degreesPerRadian},i=0,n=0;n<e.length-2;n++){var o=(n+1)%e.length,r=(n+2)%e.length,a=(a=e[n],s=e[o],l=e[r],c=void 0,(c=t(s,a)-t(s,l))<0&&(c+=360),c);i+=this.getPositionsDistance(positions[n],positions[o])*this.getPositionsDistance(positions[o],positions[r])*Math.abs(Math.sin(a))}return(i/1e6).toFixed(4)}var a,s,l,c},getPointDistance:function(e,t){var i;if(this._viewer)return e=x.Cartographic.fromCartesian(e),t=x.Cartographic.fromCartesian(t),(i=new x.EllipsoidGeodesic).setEndPoints(e,t),i=i.surfaceDistance,Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2))},getPositionDistance:function(t){let i=0;for(let e=0;e<t.length-1;e++){var n=this.transformWGS84ToCartographic(t[e]),o=this.transformWGS84ToCartographic(t[e+1]),r=new x.EllipsoidGeodesic,r=(r.setEndPoints(n,o),r.surfaceDistance),r=Math.sqrt(Math.pow(r,2)+Math.pow(o.height-n.height,2));i+=r}return i.toFixed(3)},getIntersectObj:function(e,t,i=[],n=!1){if(this._viewer)return t=x.Cartesian3.normalize(x.Cartesian3.subtract(t,e,new x.Cartesian3),new x.Cartesian3),e=new x.Ray(e,t),t=[],n?t=this._viewer.scene.drillPickFromRay(e,10,i):(n=this._viewer.scene.pickFromRay(e,i),x.defined(n)&&(t=[n])),t},getPointOnEllipsoid:function(e,t,i,n,o,r,a,s,l,c){var h,u,d,p;if(this._viewer)return h=new x.Cartesian3,u=new x.Cartesian3,d=new x.Quaternion,p=new x.Matrix3,t=e+t,x.Cartesian3.multiplyByScalar(n,Math.cos(t),h),x.Cartesian3.multiplyByScalar(i,Math.sin(t),u),x.Cartesian3.add(h,u,h),n=Math.cos(e),n*=n,i=Math.sin(e),i*=i,t=r/Math.sqrt(a*n+o*i)/s,x.Quaternion.fromAxisAngle(h,t,d),x.Matrix3.fromQuaternion(d,p),x.Matrix3.multiplyByVector(p,l,c),x.Cartesian3.normalize(c,c),x.Cartesian3.multiplyByScalar(c,s,c),c},raisePositionsToHeight:function(e,t,i){if(this._viewer){for(var n=new x.Cartesian3,o=new x.Cartesian3,r=new x.Cartesian3,a=new x.Cartesian3,s=t.ellipsoid,l=t.height,c=t.extrudedHeight,t=i?e.length/3*2:e.length/3,h=new Float64Array(3*t),u=e.length,d=i?u:0,p=0;p<u;p+=3){var m=p+1,f=p+2,g=x.Cartesian3.fromArray(e,p,n),v=(s.scaleToGeodeticSurface(g,g),x.Cartesian3.clone(g,o)),y=s.geodeticSurfaceNormal(g,a),_=x.Cartesian3.multiplyByScalar(y,l,r);x.Cartesian3.add(g,_,g),i&&(x.Cartesian3.multiplyByScalar(y,c,_),x.Cartesian3.add(v,_,v),h[p+d]=v.x,h[m+d]=v.y,h[f+d]=v.z),h[p]=g.x,h[m]=g.y,h[f]=g.z}return h}},computeEllipseEdgePositions:function(e){if(this._viewer){for(var t=new x.Cartesian3,i=new x.Cartesian3,n=new x.Cartesian3,o=new x.Cartesian3,r=e.semiMinorAxis,a=e.semiMajorAxis,s=e.rotation,l=e.center,e=e.granularity&&"number"==typeof e.granularity?e.granularity:Math.PI/180,c=((e=e>Math.PI/12?Math.PI/12:e)<Math.PI/180&&(e=Math.PI/180),r*r),h=a*a,u=a*r,d=x.Cartesian3.magnitude(l),p=x.Cartesian3.normalize(l,t),m=x.Cartesian3.cross(x.Cartesian3.UNIT_Z,l,i),m=x.Cartesian3.normalize(m,m),f=x.Cartesian3.cross(p,m,n),g=Math.ceil(2*x.Math.PI/e),v=e,y=o,_=0,w=[],C=0;C<g;C++)y=this.getPointOnEllipsoid(C*v,s,f,m,c,u,h,d,p,y),w[_++]=y.x,w[_++]=y.y,w[_++]=y.z;a={};return a.numPts=g,a.outerPositions=w,a}},computeSectorEdgePositions:function(e){if(this._viewer){for(var t=new x.Cartesian3,i=new x.Cartesian3,n=new x.Cartesian3,o=new x.Cartesian3,r=e.semiMinorAxis,a=e.semiMajorAxis,s=e.rotation,l=e.angle||2*Math.PI,c=e.center,e=e.granularity&&"number"==typeof e.granularity?e.granularity:Math.PI/180,h=((e=e>Math.PI/12?Math.PI/12:e)<Math.PI/180&&(e=Math.PI/180),r*r),u=a*a,d=a*r,p=x.Cartesian3.magnitude(c),m=x.Cartesian3.normalize(c,t),f=x.Cartesian3.cross(x.Cartesian3.UNIT_Z,c,i),f=x.Cartesian3.normalize(f,f),g=x.Cartesian3.cross(m,f,n),v=Math.ceil(l/e),y=e,_=o,w=0,C=[],P=0;P<v;P++)_=this.getPointOnEllipsoid(P*y,s,g,f,h,d,u,p,m,_),C[w++]=_.x,C[w++]=_.y,C[w++]=_.z;a={};return a.numPts=v,a.outerPositions=C,a}},computeLonlatPointsTerrainData:function(e,t){if(this._viewer){for(var i=[],n=0;n<e.length;n++)i.push(x.Cartographic.fromDegrees(e[n].lon,e[n].lat));this._viewer.scene.clampToHeightMostDetailed(i).then(function(e){t(e)})}},computeCartographicPointsTerrainData:function(e,o){if(this._viewer&&!(e.length<=0)){for(var t=[],i=0;i<e.length;i++)t.push(x.Cartesian3.fromRadians(e[i].longitude,e[i].latitude,e[i].height));var n=this._viewer.scene.clampToHeightMostDetailed(t),r=this;n.then(function(e){for(var t=[],i=r._viewer.scene.globe.ellipsoid,n=0;n<e.length;n++)t.push(i.cartesianToCartographic(e[n]));o(t)}).catch(function(e){console.log(e)})}},_checkLonDegree:function(e){return!(180<e||e<-180)},_checkLatDegree:function(e){return!(90<e||e<-90)},computeInterpolateLineLonlat:function(e,t){if(!e||!t)return null;if(e.lon||!e.lat||!t.lon||!t.lat)return null;if(!(this._checkLonDegree(e.lon)&&this._checkLonDegree(t.lon)&&this._checkLatDegree(e.lat)&&this._checkLatDegree(t.lat)))return null;var i=[],n=(i.push([e.lon,e.lat]),Math.sqrt(Math.pow(t.lon-e.lon,2)+Math.pow(t.lat-e.lat,2)));if(n<=1e-5)i.push([t.lon,t.lat]);else for(var o=n/1e-5,r=(t.lon-e.lon)/o,a=(t.lat-e.lat)/o,s=0;s<o;s++){var l=e.lon+(s+1)*r,c=e.lat+(s+1)*a;i.push([l,c])}return i},computeInterpolateLineCartographic:function(e,t,i){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var n=[],o=(n.push(new x.Cartographic(e.longitude,e.latitude)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2))),i=i&&"number"==typeof i?i:1e-5*Math.PI/180;if(o<=i)n.push(new x.Cartographic(t.longitude,t.latitude));else{for(var r=o/i,a=(t.longitude-e.longitude)/r,s=(t.latitude-e.latitude)/r,l=0;l<r;l++){var c=e.longitude+(l+1)*a,h=e.latitude+(l+1)*s;n.push(new x.Cartographic(c,h))}n.push(new x.Cartographic(t.longitude,t.latitude,t.height))}return n},computeInterpolateLineHeightCartographic:function(e,t){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var i=[],n=(i.push(new x.Cartographic(e.longitude,e.latitude,e.height)),Math.sqrt(Math.pow(t.longitude-e.longitude,2)+Math.pow(t.latitude-e.latitude,2)));if(!(n<=1e-5*Math.PI/180))for(var o=n/1e-5*Math.PI/180,r=(t.longitude-e.longitude)/o,a=(t.latitude-e.latitude)/o,s=(t.height-e.height)/o,l=0;l<o;l++){var c=e.longitude+(l+1)*r,h=e.latitude+(l+1)*a,u=e.height+(l+1)*s;i.push(new x.Cartographic(c,h,u))}return i.push(new x.Cartographic(t.longitude,t.latitude,t.height)),i},computeInterpolate2IndexLineHeightCartographic:function(e,t,i,n){if(!e||!t)return null;if(!(e.longitude&&e.latitude&&t.longitude&&t.latitude))return null;var o=[];o.push(new x.Cartographic(e.longitude,e.latitude,e.height));for(var r=(t.longitude-e.longitude)/i,a=(t.latitude-e.latitude)/i,s=(t.height-e.height)/i,l=0;l<n;l++){var c=e.longitude+(l+1)*r,h=e.latitude+(l+1)*a,u=e.height+(l+1)*s;o.push(new x.Cartographic(c,h,u))}return o},computeInterpolateIndexLineHeightCartographic:function(e,t,i,n){var o,r;return e&&t&&e.longitude&&e.latitude&&t.longitude&&t.latitude?(o=(t.longitude-e.longitude)/i,r=(t.latitude-e.latitude)/i,t=(t.height-e.height)/i,i=e.longitude+n*o,o=e.latitude+n*r,r=e.height+n*t,new x.Cartographic(i,o,r)):null}};let z=null;function U(e,t,i){e&&(this._viewer=e,z=t,this._installPrimitives())}U.prototype={_installPrimitives:function(){this._installProbingPrimitive(),this._installTexturePrimitive(),this._installWaterPrimitive(),this._installPointsPrimitive(),this._installShadowPrimitive(),this._installArrowPolylinePrimitive(),this._installXyzAxisPrimitive(),this._installTetrahedronPrimitive(),this._installCustomPrimitive(),this._installFlowWaterPrimitive()},_installCustomPrimitive:function(){},_installTetrahedronPrimitive:function(){try{var i=z.Cartesian3,n=z.ComponentDatatype,a=z.PrimitiveType,o=z.BoundingSphere,r=z.GeometryAttribute,s=z.GeometryPipeline,l=z.Geometry,c=z.defined,h=z.RenderState,u=z.ShaderSource,d=z.ShaderProgram,p=z.DrawCommand,m=z.Pass,f=z.Appearance,g=z.BufferUsage,t=z.Color,v=z.VertexArray,y=(z.buildModuleUrl,z.Matrix4),_=z.Matrix3,w=z.Texture,e=z.Resource,C=z.Transforms,P=z.defaultValue,x=this._viewer,S=this.getDfSt(["primitive","TetrahedronPrimitive"])||"static/data/images/Textures/fence.png",M=function(e){this.show=!0,this._command=void 0,this._enuMatrix=void 0,this._scaleMatrix=void 0,this._localPosition=e.position,this._createCommand=b,this._angle=0,this._distance=P(e.distance,1),this._setInterval=void 0,this._viewer=x,this._speed=P(e.speed,1),this._color=P(e.color,new t(1,1,0,.8)),this._scale=P(e.scale,new i(10,10,15)),this._texture=void 0,this._imageUrl=S,this._modelMatrix=D(this),this._height=k(this),L(this)};M.prototype.update=function(e){this.show&&(c(this._command)||(this._command=this._createCommand(e.context,this)),c(this._command))&&e.commandList.push(this._command)},M.prototype.isDestroyed=function(){return!1},M.prototype.destroy=function(){return c(this._command)&&(this._command.shaderProgram=this._command.shaderProgram&&this._command.shaderProgram.destroy()),destroyObject(this)},M.prototype.startAnimate=function(){let t=this;this._setInterval=setInterval(function(){t._angle=t._angle+.01,0<Math.sin(t._angle)?t._height=.01:t._height=-.01;var e=new z.Cartesian3(0,0,t._height),e=(y.multiplyByTranslation(t._modelMatrix,e,t._modelMatrix),y.fromRotationTranslation(_.fromRotationZ(z.Math.toRadians(t._speed))));y.multiply(t._modelMatrix,e,t._modelMatrix)},5)},M.prototype.closeAnimate=function(){clearInterval(this._setInterval)};const b=function(e,t){var i=E(),n=I(),o=f.getDefaultRenderState(!1,!0,void 0),o=h.fromCache(o),i=new u({sources:[i]}),n=new u({sources:[n]}),r={color:function(){return t._color},myImage:function(){return c(t._texture)?t._texture:t._viewer.scene.context.defaultTexture}},i=d.fromCache({context:e,vertexShaderSource:i,fragmentShaderSource:n,attributeLocations:{position:0,textureCoordinates:1}});return new p({vertexArray:T(e),primitiveType:a.TRIANGLES,renderState:o,shaderProgram:i,uniformMap:r,owner:this,pass:m.TRANSLUCENT,modelMatrix:t._modelMatrix})},T=function(e){var t=A(),t=new l({attributes:{position:new r({componentDatatype:n.FLOAT,componentsPerAttribute:3,values:t.positions}),textureCoordinates:new r({componentDatatype:n.FLOAT,componentsPerAttribute:2,values:t.sts})},indices:t.indices,primitiveType:a.TRIANGLES,boundingSphere:o.fromVertices(t.positions)}),t=s.computeNormal(t);return v.fromGeometry({context:e,geometry:t,attributeLocations:{position:0,textureCoordinates:1},bufferUsage:g.STATIC_DRAW})},A=function(){var e=new Float64Array(15),t=(e[0]=0,e[1]=1,e[2]=0,e[3]=-1,e[4]=0,e[5]=0,e[6]=0,e[7]=-1,e[8]=0,e[9]=1,e[10]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=-1,new Uint16Array(18));return t[0]=4,t[1]=2,t[2]=3,t[3]=4,t[4]=3,t[5]=0,t[6]=4,t[7]=0,t[8]=1,t[9]=4,t[10]=1,t[11]=2,t[12]=1,t[13]=2,t[14]=3,t[15]=1,t[16]=3,t[17]=0,{indices:t,positions:e,sts:new Float32Array([0,0,1,0,1,1,0,1,.5,.5])}},E=function(){return"#version 300 es\n in vec3 position;\n in vec3 normal;\n in vec2 st;\n in float batchId;\n out vec3 v_positionEC;\n out vec3 v_normalEC;\n out vec2 v_st;\n out vec4 v_pickColor;\n void main()\n {\n v_positionEC = (czm_modelView * vec4(position, 1.0)).xyz;\n v_normalEC = czm_normal * normal;\n v_st = st;\n // v_pickColor = czm_batchTable_pickColor(batchId);\n gl_Position = czm_modelViewProjection * vec4(position, 1.0);\n }\n "},I=function(){return"#version 300 es\n precision mediump float;\n in vec3 v_positionEC;\n in vec3 v_normalEC;\n in vec2 v_st;\n uniform vec4 color;\n in vec4 v_pickColor;\n uniform sampler2D myImage;\n void main()\n {\n vec3 positionToEyeEC = -v_positionEC;\n vec3 normalEC = normalize(v_normalEC);\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n czm_materialInput materialInput;\n materialInput.normalEC = normalEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n materialInput.st = v_st;\n vec2 st = materialInput.st;\n czm_material material = czm_getDefaultMaterial(materialInput);\n float dt_a11 = fract(czm_frameNumber / 100.0) * 3.14159265 * 2.0;\n float dt_a12 = sin(dt_a11);\n float vst=smoothstep(0.7, 1.0, dt_a12)+0.4;\n vec4 colorImage = texture(myImage, vec2(fract(st.s- czm_frameNumber*0.003), st.t));\n material.alpha =mix(0.1,1.0,clamp((1.0-st.t) * color.a,0.0,1.0)) +(1.0-sign(st.t-czm_frameNumber*0.001))*0.2*(1.0-colorImage.r)+0.4;\n material.diffuse =(1.0-colorImage.a)*vec3(1.0,2.0,1.0)+colorImage.rgb*vec3(1.0,2.0,1.0);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n #endif\n }\n "},L=function(i){e.createIfNeeded(i._imageUrl).fetchImage().then(function(e){var t=i._viewer.scene.context,t=c(e.internalFormat)?new w({context:t,pixelFormat:e.internalFormat,width:e.naturalWidth,height:e.naturalHeight,source:{arrayBufferView:e.bufferView}}):new w({context:t,source:e});i._texture=t})},D=function(e){var t=C.eastNorthUpToFixedFrame(e._localPosition),i=y.fromScale(e._scale),n=y.multiply(t,i,new y);return e._scaleMatrix=i,e._enuMatrix=t,n},k=function(e){var t=i.fromElements(0,0,e._distance,new z.Cartesian3),t=z.Matrix4.multiplyByPoint(e._enuMatrix,t,new i),t=y.multiplyByPoint(e._viewer.scene.camera._viewMatrix,t,new i),e=y.multiplyByPoint(e._viewer.scene.camera.frustum.projectionMatrix,t,new i);return i.normalize(e,new i).z};z.Scene.TetrahedronPrimitive=M}catch(i){console.log(i)}},_installXyzAxisPrimitive:function(){function e(e){this._viewer=e.viewer,this._model=e.model,this._matrix=e.matrix,this._radius=void 0,this._layer=new z.CustomDataSource("xyz-axis"),this._viewer.dataSources.add(this._layer),this._handler=new z.ScreenSpaceEventHandler(this._viewer.scene.canvas),this._xyzState=!1,this._xyzPid=void 0,this._builds()}e.prototype={_builds(){this._createAxisXYZ(),this._bindHandler()},remove(){this._layer._primitives.removeAll(),this._handler.distory()},_createAxisXYZ:function(){this._model.readyPromise.then(e=>{var t=z.Matrix4.getTranslation(e.modelMatrix,new z.Cartesian3),e=e.boundingSphere,i=e.radius,n=new z.ArrowPolylinePrimitive({id:"axisZ",color:z.Color.RED,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),o=new z.ArrowPolylinePrimitive({id:"axisX",color:z.Color.GREEN,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),t=new z.ArrowPolylinePrimitive({id:"axisY",color:z.Color.BLUE,position:t,width:3,headWidth:5,length:2*i+50,headLength:10}),i=z.Matrix3.fromRotationY(z.Math.toRadians(90)),i=(this._rotationX=z.Matrix4.fromRotationTranslation(i),z.Matrix4.multiply(o.geometryInstances[0].modelMatrix,this._rotationX,o.geometryInstances[0].modelMatrix),z.Matrix4.multiply(o.geometryInstances[1].modelMatrix,this._rotationX,o.geometryInstances[1].modelMatrix),z.Matrix3.fromRotationX(z.Math.toRadians(90)));this._rotationY=z.Matrix4.fromRotationTranslation(i),z.Matrix4.multiply(t.geometryInstances[0].modelMatrix,this._rotationY,t.geometryInstances[0].modelMatrix),z.Matrix4.multiply(t.geometryInstances[1].modelMatrix,this._rotationY,t.geometryInstances[1].modelMatrix),this._layer._primitives.add(n),this._layer._primitives.add(o),this._layer._primitives.add(t),this._radius=e.radius,this._createAxisSphere()})},_createAxisSphere:function(){var t=[];for(let e=0;e<=360;e+=3){const i=Math.sin(z.Math.toRadians(e)),n=Math.cos(z.Math.toRadians(e)),o=this._radius*n,r=this._radius*i;t.push(new z.Cartesian3(o,r,0))}var e=this._createAxisSpheres("axisSphereZ",t,this._matrix,z.Color.RED);this._layer._primitives.add(e);const i=this._createAxisSpheres("axisSphereY",t,this._matrix,z.Color.GREEN),n=(this._layer._primitives.add(i),z.Matrix4.multiply(i.geometryInstances.modelMatrix,this._rotationY,i.geometryInstances.modelMatrix),this._createAxisSpheres("axisSphereX",t,this._matrix,z.Color.BLUE));this._layer._primitives.add(n),z.Matrix4.multiply(n.geometryInstances.modelMatrix,this._rotationX,n.geometryInstances.modelMatrix)},_createAxisSpheres:function(e,t,i,n){t=new z.PolylineGeometry({positions:t,width:10}),t=new z.GeometryInstance({geometry:t,id:e,attributes:{color:z.ColorGeometryInstanceAttribute.fromColor(n)}});return new z.Primitive({geometryInstances:t,appearance:new z.PolylineColorAppearance({translucent:!1}),modelMatrix:i})},_updateAxis(i){if(this._layer){var n=this._layer._primitives._primitives;for(let e=1,t=n.length;e<t;e++){var o=n[e],r=z.Matrix4.fromTranslation(new z.Cartesian3(i.x,i.y,i.z));z.Matrix4.multiply(o.modelMatrix,r,o.modelMatrix)}}var e=z.Matrix4.fromTranslation(new z.Cartesian3(i.x,i.y,i.z));z.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_updateAxisSphere(i){if(this._layer){var n=this._layer._primitives._primitives;for(let e=1,t=n.length;e<t;e++){var o=n[e],r=z.Matrix4.fromRotationTranslation(i);z.Matrix4.multiply(o.modelMatrix,r,o.modelMatrix)}}var e=z.Matrix4.fromRotationTranslation(i);z.Matrix4.multiply(this._model.modelMatrix,e,this._model.modelMatrix)},_bindHandler(){this._handler.setInputAction(e=>{if(this._xyzState&&this._xyzPid)switch(this._xyzPid){case"axisX-line":this._updateAxis({x:-1,y:0,z:0});break;case"axisY-line":this._updateAxis({x:0,y:-1,z:0});break;case"axisZ-line":this._updateAxis({x:0,y:0,z:-1});break;case"axisX-arrow":this._updateAxis({x:1,y:0,z:0});break;case"axisY-arrow":this._updateAxis({x:0,y:1,z:0});break;case"axisZ-arrow":this._updateAxis({x:0,y:0,z:1});break;case"axisSphereX":this._updateAxisSphere(z.Matrix3.fromRotationX(z.Math.toRadians(1)));break;case"axisSphereY":this._updateAxisSphere(z.Matrix3.fromRotationY(z.Math.toRadians(1)));break;case"axisSphereZ":this._updateAxisSphere(z.Matrix3.fromRotationZ(z.Math.toRadians(1)))}},z.ScreenSpaceEventType.MOUSE_MOVE),this._handler.setInputAction(e=>{e=viewer.scene.pick(e.position);e&&e.id&&(this._xyzPid=e.id,this._xyzState=!0)},z.ScreenSpaceEventType.LEFT_DOWN),this._handler.setInputAction(()=>{this._xyzState=!1,this._xyzPid=void 0},z.ScreenSpaceEventType.LEFT_UP)}},z.Scene.XyzAxisPrimitive=e},_installArrowPolylinePrimitive:function(){z.Scene.ArrowPolylinePrimitive=function(e={}){this._color=e.color||z.Color.RED,this._width=e.width||3,this._headWidth=e.headWidth||2*this._width,this._length=e.length||300,this._headLength=e.headLength||10,this._inverse=e.inverse||!1,this.position=e.position;var e=e.id,t=z.CylinderGeometry.createGeometry(new z.CylinderGeometry({length:this._length,topRadius:this._width,bottomRadius:this._width})),i=z.CylinderGeometry.createGeometry(new z.CylinderGeometry({length:this._headLength,topRadius:0,bottomRadius:this._headWidth}));let n=(this._length+this._headLength)/2;this._inverse&&(n=-n);var o=i,r=[0,0,n],a=new z.Cartesian3;r.length?(a.x=r[0],a.y=r[1],a.z=r[2]):z.Cartesian3.clone(r,a);for(let e=0;e<o.attributes.position.values.length;e+=3)o.attributes.position.values[e]+=a.x,o.attributes.position.values[e+1]+=a.y,o.attributes.position.values[e+2]+=a.z;return new z.Primitive({modelMatrix:z.Transforms.eastNorthUpToFixedFrame(this.position),geometryInstances:[new z.GeometryInstance({id:e+"-line",geometry:t}),new z.GeometryInstance({id:e+"-arrow",geometry:i})],appearance:new z.MaterialAppearance({material:z.Material.fromType("Color",{color:this._color})})})}},_installShadowPrimitive:function(){function e(e){var t=(e=z.defaultValue(e,z.defaultValue.EMPTY_OBJECT)).scene;if(!z.defined(t))throw new z.DeveloperError("scene is required.");var i=(this._scene=t)._context;if(!z.defined(i))throw new z.DeveloperError("context is required.");if(!z.defined(e.viewerPosition))throw new z.DeveloperError("this view position is required.");this._viewerPosition=e.viewerPosition,this._positions=void 0,this._indices=void 0,this._drawLineCommand=void 0,this._depthCamera=new z.Camera(t),this._depthCamera.position=this._viewerPosition,this._direction=0,this._pitch=0,this._horizontalFov=z.defaultValue(e.horizontalFov,60),this._verticalFov=z.defaultValue(e.verticalFov,45),this._cameraUpdated=!1,this._targetPoint=this._viewerPosition.clone();t=new z.Cartesian3(0,0,100),e=z.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);z.Matrix4.multiplyByPoint(e,t,this._targetPoint),this._distance=100,this._cameraUpdated=!1,this._modelMatrix=new z.Matrix4,this._shadowMap=new z.ShadowMap({context:i,enabled:!0,lightCamera:this._depthCamera,cascadesEnabled:!1}),this.show=!0,this._invisiblyColor=z.Color.RED,this._visiblyColor=z.Color.GREEN,this._shadowMap.useCustomColor=!0,this.shadowMap._customColor={invisibly:z.Color.RED,visibly:z.Color.GREEN},this._initialize=function(){this._positions=new Float32Array(633),this._indices=new Uint16Array(408);var e=this._indices,t=0;e[t++]=0,e[t++]=1,e[t++]=0,e[t++]=21,e[t++]=0,e[t++]=85,e[t++]=0,e[t++]=105;for(var i=0,n=0;n<5;++n){i++;for(var o=0;o<20;++o)e[t++]=i++,e[t++]=i}i++;for(var r=0;r<20;++r)for(var a=0;a<5;++a)e[t++]=i,e[t++]=5+i++;this._initialized=!0},this._debugLightFrustum=void 0,this._debugShow=!0}Object.defineProperties(e.prototype,{shadowMap:{get:function(){return this._shadowMap}},debugLightFrustum:{get:function(){return this._debugLightFrustum}},debugShow:{get:function(){return this._debugShow},set:function(e){this.shadowMap.debugShow=e,this._debugShow=e}},invisiblyColor:{get:function(){return this._invisiblyColor},set:function(e){this._invisiblyColor=e,this.shadowMap._customColor.invisibly=e}},visiblyColor:{get:function(){return this._visiblyColor},set:function(e){this._visiblyColor=e,this.shadowMap._customColor.visibly=e}},viewerPosition:{get:function(){return this._viewerPosition},set:function(e){this._viewerPosition=e,this._cameraUpdated=!1}},direction:{get:function(){return this._direction},set:function(e){this._direction=e,this._cameraUpdated=!1}},pitch:{get:function(){return this._pitch},set:function(e){this._pitch=e,this._cameraUpdated=!1}},horizontalFov:{get:function(){return this._horizontalFov},set:function(e){this._horizontalFov=e,this._cameraUpdated=!1,this._hintLineUpdated=!1}},verticalFov:{get:function(){return this._verticalFov},set:function(e){this._verticalFov=e,this._cameraUpdated=!1,this._hintLineUpdated=!1}},distance:{get:function(){return this._distance},set:function(e){this._distance=e,this._cameraUpdated=!1}}}),e.prototype.setDebugFrustumEffect=function(t,i){var e,n;this.debugShow&&(e=this.debugLightFrustum._planesPrimitives,n=this.debugLightFrustum._outlinePrimitives,e.forEach(function(e){e.show=t}),n.forEach(function(e){e.show=i}))},e.prototype.update=function(e){var t;this.show&&(this._cameraUpdated||(this._updateCamera(),this.debugShow&&!z.defined(this.debugLightFrustum)&&(this._debugLightFrustum=new z.DebugCameraPrimitive({camera:this._depthCamera,color:z.Color.YELLOW,updateOnChange:!0}),this.setDebugFrustumEffect(!1,!0))),t=e.frustumSplits[1],e.frustumSplits[1]=this._distance,this._debugLightFrustum.update(e),e.frustumSplits[1]=t,e.shadowMaps.push(this.shadowMap))},e.prototype._updateCamera=function(){this._depthCamera.frustum.near=.001*this._distance,this._depthCamera.frustum.far=this._distance,this._depthCamera.frustum.fov=z.Math.toRadians(Math.max(this._horizontalFov,this._verticalFov)),this._depthCamera.frustum.aspectRatio=this._horizontalFov/this._verticalFov,this._depthCamera.setView({destination:this._viewerPosition,orientation:{heading:z.Math.toRadians(this._direction),pitch:z.Math.toRadians(this._pitch)}}),this._modelMatrix=this._depthCamera.inverseViewMatrix,this._cameraUpdated=!0},e.prototype.setPoseByTargetPoint=function(e){this.distance=z.Cartesian3.distance(this._viewerPosition,e);var t=new z.Cartesian3,i=z.Transforms.eastNorthUpToFixedFrame(this._viewerPosition);z.Matrix4.inverse(i,i),z.Matrix4.multiplyByPoint(i,e,t),z.Cartesian3.normalize(t,t),this.direction=z.Math.toDegrees(Math.atan2(t.x,t.y)),this.pitch=z.Math.toDegrees(Math.asin(t.z))},e.prototype._updateHintLine=function(e){var t,i=this._positions,n=z.Math.toRadians(this._horizontalFov),o=z.Math.toRadians(this._verticalFov),r=Math.tan(.5*n),o=Math.tan(.5*o),a=-(r=this._distance*r),o=-(t=this._distance*o),a=new z.Cartesian3(a,o,-this._distance),o=new z.Cartesian3(r,t,0),r=(z.Matrix4.multiplyByPoint(this._modelMatrix,a,a),z.Matrix4.multiplyByPoint(this._modelMatrix,o,o),z.BoundingSphere.fromCornerPoints(a,o));if(e.cullingVolume.computeVisibility(r)!==Intersect.OUTSIDE){this._valid=!0;var s=0;i[s++]=0,i[s++]=0,i[s++]=0;for(var l,c=Math.PI-.5*n,h=n/4,u=0;u<5;++u)for(var d=c+u*h,p=t/(this._distance/Math.cos(d)),m=-(y=Math.atan(p)),f=y/10,g=0;g<21;++g)l=m+g*f,i[s++]=this._distance*Math.cos(l)*Math.sin(d),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(d);for(var h=n/20,v=0;v<21;++v){d=c+v*h;for(var y,p=t/(this._distance/Math.cos(d)),m=-(y=Math.atan(p)),f=y/2,_=0;_<5;++_)l=m+_*f,i[s++]=this._distance*Math.cos(l)*Math.sin(d),i[s++]=this._distance*Math.sin(l),i[s++]=this._distance*Math.cos(l)*Math.cos(d)}var w,C=e.context,a=z.Buffer.createIndexBuffer({context:C,typedArray:new Uint32Array(this._indices),usage:z.BufferUsage.STATIC_DRAW,indexDatatype:IndexDatatype.UNSIGNED_INT}),o=z.Buffer.createVertexBuffer({context:C,typedArray:z.ComponentDatatype.createTypedArray(z.ComponentDatatype.FLOAT,this._positions),usage:z.BufferUsage.STATIC_DRAW}),n=[],e=(n.push({index:0,vertexBuffer:o,componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:3,normalize:!1}),new z.VertexArray({context:C,attributes:n,indexBuffer:a}));z.defined(this._drawLineCommand)?(this._drawLineCommand.vertexArray.destroy(),this._drawLineCommand.vertexArray=e,this._drawLineCommand.modelMatrix=this._modelMatrix,this._drawLineCommand.boundingVolume=r):(o=z.ShaderProgram.fromCache({context:C,vertexShaderSource:"in vec3 position;\n uniform mat4 u_modelViewMatrix;\n void main()\n {\n gl_Position = czm_projection* u_modelViewMatrix* vec4(position.xyz,1.0);\n }\n ",fragmentShaderSource:"uniform vec4 u_bgColor;\n void main()\n {\n out_FragColor = u_bgColor;\n }\n "}),n=z.RenderState.fromCache({depthTest:{enabled:!0}}),a={u_bgColor:function(){return w._lineColor},u_modelViewMatrix:function(){return C.uniformState.modelView}},(w=this)._drawLineCommand=new z.DrawCommand({boundingVolume:r,modelMatrix:w._modelMatrix,primitiveType:z.PrimitiveType.LINES,vertexArray:e,shaderProgram:o,castShadows:!1,receiveShadows:!1,uniformMap:a,renderState:n,pass:z.Pass.OPAQUE})),this._hintLineUpdated=!0}else this._valid=!1},z.Scene.ShadowPrimitive=e},_installPointsPrimitive:function(){function e(e){e&&e.viewer&&e.Cartesians&&(this._vertexShader=this.getVSPolylie(),this._fragmentShader=this.getFSPolyline(),this._geometry=null,this._appearance=null,this._viewer=e.viewer,this.build(e))}e.prototype={build:function(e){if(e.Cartesians&&2<=e.Cartesians.length){var t=[],i=[],n=[];if(e.Colors&&e.Colors.length===4*e.Cartesians.length){for(var o=0;o<e.Cartesians.length;o++)t.push(e.Cartesians[o].x),t.push(e.Cartesians[o].y),t.push(e.Cartesians[o].z);i=e.Colors}else for(var r=0;r<e.Cartesians.length;r++)t.push(e.Cartesians[r].x),t.push(e.Cartesians[r].y),t.push(e.Cartesians[r].z),i.push(0),i.push(0),i.push(1),i.push(1);for(var a=0;a<e.Cartesians.length;a++)n.push(a);this.positionArr=new Float64Array(t),this.colorArr=new Float32Array(i),this.indiceArr=new Uint16Array(n)}else{var s=z.Cartesian3.fromDegrees(0,0,-10),l=z.Cartesian3.fromDegrees(0,.001,-10);this.positionArr=new Float64Array([s.x,s.y,s.z,l.x,l.y,l.z]),this.colorArr=new Float32Array([0,0,1,1,0,0,1,1]),this.indiceArr=new Uint16Array([0,1])}this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader),this.primitive=this._viewer.scene.primitives.add(new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},getVSPolylie:function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec4 color; out vec4 v_color; in float batchId; void main() { vec4 p = czm_computePosition(); v_color =color; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; gl_PointSize=4.0; } "},getFSPolyline:function(){return"in vec4 v_color; void main() { float d = distance(gl_PointCoord, vec2(0.5,0.5)); if(d < 0.5){ out_FragColor = v_color; }else{ discard; } } "},createAppearence:function(e,t){return new z.Appearance({renderState:{blending:z.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:e,vertexShaderSource:t})},createGeometry:function(e,t,i){return new z.Geometry({attributes:{position:new z.GeometryAttribute({componentDatatype:z.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:e}),color:new z.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:4,values:t})},indices:i,primitiveType:z.PrimitiveType.POINTS,boundingSphere:z.BoundingSphere.fromVertices(e)})},remove:function(){null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),this.primitive=null)},updateCartesianPosition:function(e){if(null!=this.primitive&&(this._viewer.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var t=e[0],i=e[1];this.positionArr=new Float64Array([t.x,t.y,t.z,i.x,i.y,i.z]),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var n=[],o=[],r=[],a=0;a<e.length;a++)n.push(e[a].x),n.push(e[a].y),n.push(e[a].z),o.push(0),o.push(0),o.push(1),o.push(1);for(var s=0;s<e.length;s++)r.push(s);this.positionArr=new Float64Array(n),this.colorArr=new Float32Array(o),this.indiceArr=new Uint16Array(r),geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=this._viewer.scene.primitives.add(new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}},updateCartesianPositionColor:function(e,t){if(t.length===4*e.length&&null!=this.primitive&&(viewer.scene.primitives.remove(this.primitive),!(e&&e.length<2))){if(e.length===this.positionArr.length/3){var i=e[0],n=e[1];this.positionArr=new Float64Array([i.x,i.y,i.z,n.x,n.y,n.z]),this.colorArr=new Float32Array(t),geometry=CreateGeometry(this.positionArr,this.colorArr,this.indiceArr)}else{for(var o=[],r=[],a=0;a<e.length;a++)o.push(e[a].x),o.push(e[a].y),o.push(e[a].z);for(a=0;a<e.length;a++)r.push(a);this.positionArr=new Float64Array(o),this.colorArr=new Float32Array(t),this.indiceArr=new Uint16Array(r),this._geometry=this.createGeometry(this.positionArr,this.colorArr,this.indiceArr),this._appearance=this.createAppearence(this._fragmentShader,this._vertexShader)}this.primitive=viewer.scene.primitives.add(new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))}}},z.Scene.PointsPrimitive=e},_installWaterPrimitive:function(){let t=this;function e(e){this._positions=e.positions,this._url=e.img||this.getDfSt(["primitive","WaterPrimitive"])||"static/data/images/Textures/waterNormals.jpg",this._frequency=e.frequency||1e3,this._animationSpeed=e.animationSpeed||.01,this._amplitude=e.amplitude||10,this._extrudedHeight=e.extrudedHeight||0,this._viewer=t._viewer,this._fs=this.getFS()}e.prototype.build=function(){this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new z.Primitive({allowPicking:!1,geometryInstances:new z.GeometryInstance({geometry:this._geometry}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createAppearence=function(){return new z.EllipsoidSurfaceAppearance({material:new z.Material({fabric:{type:"Water",uniforms:{normalMap:this._url,frequency:this._frequency,animationSpeed:this._animationSpeed,amplitude:this._amplitude}}}),fragmentShaderSource:this._fs})},e.prototype._createGeometry=function(){return new z.PolygonGeometry({polygonHierarchy:new z.PolygonHierarchy(z.Cartesian3.fromDegreesArray(this._positions)),extrudedHeight:this._extrudedHeight,perPositionHeight:!0})},e.prototype.getFS=function(){return"\n precision highp float;\n struct Light {\n vec3 position;\n vec3 ambient;\n vec3 diffuse;\n vec3 specular;\n };\n in vec3 position;\n in vec2 textureCoord;\n\n uniform vec3 viewPos;\n uniform Light light;\n\n uniform sampler2D normalSampler;\n uniform samplerCube skybox;\n uniform float detalX;\n\n void main() {\n\n float z = gl_FragCoord.z / gl_FragCoord.w;\n const float LOG2 = 1.442695;\n float density = 0.005;\n float normalFactor = exp( -density * density * z * z * LOG2 );\n normalFactor = clamp(normalFactor, 0.0, 1.0);\n\n vec4 normalTex1 = texture(normalSampler, vec2(textureCoord.s + detalX/1024.0, textureCoord.t - detalX/1024.0));\n vec3 normalTex2 = texture(normalSampler, vec2(textureCoord.t, textureCoord.s)).rgb;\n vec3 normal1 = normalize(vec3(normalTex1.r * 2.0 - 1.0, normalTex1.b,normalTex1.g*2.0-1.0));\n vec3 normal2 = normalize(vec3(normalTex2.r * 2.0 - 1.0, normalTex2.b,normalTex2.g*2.0-1.0));\n\n vec3 normal = mix(normal1,normal2,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,0.2);\n\n normal = mix(vec3(0.0,1.0,0.0),normal,normalFactor);\n\n vec3 viewDir = normalize(viewPos - position);\n\n vec3 I = normalize(position - viewPos);\n vec3 R = reflect(I, normal);\n vec3 reflection = texture(skybox, R).rgb;\n\n float ratio = 1.00 / 1.33;\n vec3 Rr = refract(I, normal , ratio);\n vec3 refraction = texture(skybox, Rr).rgb;\n\n float reflectivity = 0.02;\n float theta = max( dot( viewDir, normal ), 0.0 );\n float reflectance = reflectivity + ( 1.0 - reflectivity ) * pow( ( 1.0 - theta ), 2.0 );\n\n vec3 reflectanceColor = mix( refraction, reflection, reflectance );\n\n out_FragColor = vec4(reflectanceColor,1.0);\n\n }\n "},e.prototype.getVS=function(){return" in vec3 normal;in vec2 st;in float batchId; out vec3 v_normalEC;uniform mat4 u_modelViewMatrix;uniform mat4 u_invWorldViewMatrix;uniform int u_clampToGroud;uniform vec3 u_camPos;uniform vec3 u_scale;out vec3 vToEye;out vec2 vUv;out vec4 vCoord;void main(void){v_normalEC = czm_normal * normal;if (u_clampToGroud == 1){} else {vCoord = gl_Position;}vUv = st;}"},e.prototype.getFS2=function(){return"in vec3 v_positionMC;\n in vec3 v_positionEC;\n in vec2 v_st;\n \n void main()\n {\n czm_materialInput materialInput;\n vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\n #ifdef FACE_FORWARD\n normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);\n #endif\n materialInput.s = v_st.s;\n materialInput.st = v_st;\n materialInput.str = vec3(v_st, 0.0);\n materialInput.normalEC = normalEC;\n materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n czm_material material = czm_getMaterial(materialInput);\n #ifdef FLAT\n out_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n #else\n out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);\n out_FragColor.a = 0.5;\n #endif\n }\n "},U.prototype.updateDegreesPosition=function(e,t){null==this.primitive||(this._viewer.scene.primitives.remove(this.primitive),e&&e.length<3)||(e=this._createGeometry(e,t||0),this.primitive=this._viewer.scene.primitives.add(new z.Primitive({allowPicking:!1,geometryInstances:new z.GeometryInstance({geometry:e}),appearance:this._appearance,asynchronous:!1})))},z.Scene.WaterPrimitive=e},_installFlowWaterPrimitive:function(){const n=this.getDfSt(["primitive","WaterPrimitive"]),t=z.Property;function i({riverColor:e,flowDuration:t,riverImg:i}){this._definitionChanged=new z.Event,this._color=void 0,this._colorSubscription=void 0,this.color=e,this.duration=t,this._time=(new Date).getTime(),this._url=i||n||"static/data/images/Textures/movingRiver.png"}Object.defineProperties(i.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}},color:z.createPropertyDescriptor("color")}),i.prototype.getType=function(e){return"PolylineTrailLink"},i.prototype.getValue=function(e,t){return(t=z.defined(t)?t:{}).color=z.Property.getValueOrClonedDefault(this._color,e,z.Color.WHITE,t.color),t.image=z.Material.PolylineTrailLinkImage,t.time=((new Date).getTime()-this._time)%this.duration/this.duration,t},i.prototype.equals=function(e){return this===e||e instanceof i&&t.equals(this._color,e._color)},z.Scene.PolylineFlowWaterMaterialProperty=i,z.Material.PolylineTrailLinkType="PolylineTrailLink",z.Material.PolylineTrailLinkImage=n||"static/data/images/Textures/movingRiver.png",z.Material.PolylineTrailLinkSource=" uniform vec4 color;\n uniform float time;\n uniform sampler2D image;\n czm_material czm_getMaterial(czm_materialInput materialInput)\n {\n czm_material material = czm_getDefaultMaterial(materialInput);\n vec2 st = materialInput.st;\n vec4 colorImage = texture(image, vec2(fract(st.s*5.0-time*1.0), st.t));\n material.alpha = 0.5;\n material.diffuse = colorImage.rgb;\n return material;\n }",z.Material._materialCache.addMaterial(z.Material.PolylineTrailLinkType,{fabric:{type:z.Material.PolylineTrailLinkType,uniforms:{color:new z.Color(1,0,0,.5),image:z.Material.PolylineTrailLinkImage,time:0,repeat:1},source:z.Material.PolylineTrailLinkSource},translucent:function(e){return!0}})},_installTexturePrimitive:function(){function e(e){this._vertexShader=this.getVS(),this._fragmentShader=this.getFS(),this._materialShader=this.getMS(),this._url=e.url,this._cartesians=e.cartesians,this._id=e.id||""}e.prototype.build=function(){for(var e=[],t=0;t<this._cartesians.length;t++)e.push(this._cartesians[t].x),e.push(this._cartesians[t].y),e.push(this._cartesians[t].z);this._positionArr=new Float32Array(e),this._sts=new Uint8Array([0,0,1,0,1,1,0,1]),this._indiceArr=new Uint16Array([0,1,2,0,2,3]),this._geometry=this._createGeometry(),this._appearance=this._createAppearence(),this.primitive=this._viewer.scene.primitives.add(new z.Primitive({geometryInstances:new z.GeometryInstance({geometry:this._geometry,id:this._id}),appearance:this._appearance,asynchronous:!1}))},e.prototype._createGeometry=function(){var e=new z.GeometryAttribute({componentDatatype:z.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:this._sts});return new z.Geometry({attributes:{position:new z.GeometryAttribute({componentDatatype:z.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:this._positions}),st:e},indices:this._indices,primitiveType:z.PrimitiveType.TRIANGLES,boundingSphere:z.BoundingSphere.fromVertices(positions)})},e.prototype._createAppearence=function(){return new z.Appearance({material:new z.Material({fabric:{uniforms:{image:this._url},source:this._materialShader}}),aboveGround:!0,faceForward:!0,flat:!0,translucent:!1,renderState:{blending:z.BlendingState.PRE_MULTIPLIED_ALPHA_BLEND,depthTest:{enabled:!0},depthMask:!0},fragmentShaderSource:this._fragmentShader,vertexShaderSource:this._vertexShader})},e.prototype.getVS=function(){return"in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; out vec2 v_st; void main() { vec4 p = czm_computePosition(); v_st=st; p = czm_modelViewProjectionRelativeToEye * p; gl_Position = p; } "},e.prototype.getFS=function(){return"in vec2 v_st; void main() { czm_materialInput materialInput; czm_material material=czm_getMaterial(materialInput,v_st); vec4 color=vec4(material.diffuse + material.emission,material.alpha); if(color.x==1.0&&color.y==1.0&&color.z==1.0&&color.w==1.0) color=vec4(vec3(0.0,0.0,0.0),0.0); out_FragColor =color; } "},e.prototype.getMS=function(){return"czm_material czm_getMaterial(czm_materialInput materialInput,vec2 v_st) { vec4 color = texture(image, v_st); czm_material material = czm_getDefaultMaterial(materialInput); material.diffuse= color.rgb; material.alpha=color.a; return material; } "},z.Scene.TexturePrimitive=e},_installProbingPrimitive:function(){var t={color:new z.Color(1,0,1,.8),repeat:30,offset:0,thickness:.3,center:z.Cartesian3.fromDegrees(116.39,39.9),length:4e5,bottom:1e3,top:0},i=this._viewer;function e(e){this._viewer=i,this._length=e.length||t.length,this._center=e.center||t.center,this._color=e.color||t.color,this._repeat=e.repeat||t.repeat,this._offset=e.offset||t.offset,this._thickness=e.thickness||t.thickness,this._bottom=e.bottom||t.bottom,this._top=e.top||t.top,this._radar=void 0,this.build()}e.prototype.build=function(){var e=new z.CylinderGeometry({length:this._length,topRadius:this._top,bottomRadius:this._bottom,vertexFormat:z.MaterialAppearance.MaterialSupport.TEXTURED.vertexFormat}),e=new z.GeometryInstance({geometry:e,modelMatrix:this.getModelMatrix()}),t=new z.MaterialAppearance({material:this.getMaterial(),faceForward:!1,closed:!0}),i=this;this._radar=this._viewer.scene.primitives.add(new z.Primitive({geometryInstances:[e],appearance:t})),this._viewer.scene.preUpdate.addEventListener(function(){var e=i._radar.appearance.material.uniforms.offset;1<(e-=.001)&&(e=0),i._radar.appearance.material.uniforms.offset=e})},e.prototype.getModelMatrix=function(){return z.Matrix4.multiplyByTranslation(z.Transforms.eastNorthUpToFixedFrame(this._center),new z.Cartesian3(0,0,.5*this._length),new z.Matrix4)},e.prototype.updateModelMatrix=function(){},e.prototype.getMaterial=function(){return new z.Material({fabric:{type:"radarPrimitive",uniforms:{color:this._color,repeat:this._repeat,offset:this._offset,thickness:this._thickness},source:"uniform vec4 color; \n uniform float repeat; \n uniform float offset; \n uniform float thickness;\n\n czm_material czm_getMaterial(czm_materialInput materialInput){\n czm_material material = czm_getDefaultMaterial(materialInput);\n float sp = 1.0/repeat;\n vec2 st = materialInput.st;\n float dis = distance(st, vec2(0.5));\n float m = mod(dis + offset, sp);\n float a = step(sp*(1.0-thickness), m); \n\n material.diffuse = color.rgb;\n material.alpha = a * color.a;\n return material;\n }"},translucent:!1})},e.prototype.remove=function(){this._radar&&this._viewer.scene.primitives.remove(this._radar)},z.Scene.ProbingPrimitive=e}};let f=null;function W(e,t,i){e&&(f=t,this._drawLayer=new f.CustomDataSource("drawLayer"),this.$graphics=new h(e,t),e)&&e.dataSources.add(this._drawLayer)}W.prototype={drawPointGraphics:function(t){var i,n,e,o,r,a;(t=t||{}).style=t.style||{image:this.getDfSt(["drawPointGraphics"])||"static/data/images/file/location4.png",width:35,height:40,clampToGround:!0,scale:1,pixelOffset:new f.Cartesian2(0,-20)},this._viewer&&t&&(e=new f.Entity,o=[],r=this,(a=new f.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(e){e=r._viewer.scene.camera.pickEllipsoid(e.position,r._viewer.scene.globe.ellipsoid);e&&e.x&&(i=e,o.push(e))},f.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){a.destroy(),a=null,"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(o),n)},f.ScreenSpaceEventType.RIGHT_CLICK),e.billboard=t.style,e.position=new f.CallbackProperty(function(){return i},!1),n=this._drawLayer.entities.add(e))},drawLineGraphics:function(t){if(t=t||{},this._viewer&&t){var i,n=[],e=new f.Entity,o=this,r=new f.ScreenSpaceEventHandler(this._viewer.scene.canvas);r.setInputAction(function(e){e=o.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length&&n.push(e.clone()),t.measure&&a(e),2==n.length&&"straightLine"===t.type&&(r.destroy(),r=null,"function"==typeof t.callback)&&t.callback(o.transformCartesianArrayToWGS84Array(n),i),n.push(e))},f.ScreenSpaceEventType.LEFT_CLICK),r.setInputAction(function(e){e=o.getCatesian3FromPX(e.endPosition);2<=n.length&&e&&e.x&&(n.pop(),n.push(e))},f.ScreenSpaceEventType.MOUSE_MOVE),r.setInputAction(function(e){r.destroy(),r=null;e=o.getCatesian3FromPX(e.position);t.measure&&a(e),"function"==typeof t.callback&&t.callback(o.transformCartesianArrayToWGS84Array(n),i)},f.ScreenSpaceEventType.RIGHT_CLICK),e.polyline={width:t.width||5,material:t.material||f.Color.BLUE.withAlpha(.8),clampToGround:t.clampToGround||!1,clampToS3M:t.clampToS3M||!1},e.polyline.positions=new f.CallbackProperty(function(){return n},!1),i=this._drawLayer.entities.add(e);const a=function(e){var t=new f.Entity;t.position=e,t.point={pixelSize:10,outlineColor:f.Color.BLUE,outlineWidth:5},t.label={text:(o.getPositionDistance(o.transformCartesianArrayToWGS84Array(n))/1e3).toFixed(4)+"公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:f.HorizontalOrigin.LEFT,verticalOrigin:f.VerticalOrigin.BOTTOM,pixelOffset:new f.Cartesian2(-20,-80)},o._drawLayer.entities.add(t)}}},drawPolygonGraphics:function(i){if((i=i||{}).style=i.style||{width:3,material:f.Color.BLUE.withAlpha(.8),clampToGround:!0},this._viewer&&i){var n=[],t=new f.PolygonHierarchy,o=new f.Entity,r=this,a=null,s=new f.ScreenSpaceEventHandler(this._viewer.scene.canvas);s.setInputAction(function(e){e=r.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length&&(t.positions.push(e.clone()),n.push(e.clone())),n.push(e.clone()),t.positions.push(e.clone()),a||(o.polyline=i.style,o.polyline.positions=new f.CallbackProperty(function(){return n},!1),o.polygon={hierarchy:new f.CallbackProperty(function(){return t},!1),material:f.Color.WHITE.withAlpha(.1),clampToGround:i.clampToGround||!1},o.clampToS3M=!0,a=r._drawLayer.entities.add(o)))},f.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(e){e=r.getCatesian3FromPX(e.endPosition);2<=n.length&&e&&e.x&&(n.pop(),n.push(e),t.positions.pop(),t.positions.push(e))},f.ScreenSpaceEventType.MOUSE_MOVE),s.setInputAction(function(){var e,t;s.destroy(),n.push(n[0]),i.height&&(o.polygon.extrudedHeight=i.height,o.polygon.material=f.Color.BLUE.withAlpha(.5)),i.measure&&(e=n[0],(t=new f.Entity).position=e,t.point={pixelSize:10,outlineColor:f.Color.BLUE,outlineWidth:5},t.label={text:(r.getPositionsArea(r.transformCartesianArrayToWGS84Array(n))/1e6).toFixed(4)+"平方公里",show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:f.HorizontalOrigin.LEFT,verticalOrigin:f.VerticalOrigin.BOTTOM,pixelOffset:new f.Cartesian2(-20,-50)},r._drawLayer.entities.add(t)),"function"==typeof i.callback&&i.callback(r.transformCartesianArrayToWGS84Array(n),a)},f.ScreenSpaceEventType.RIGHT_CLICK)}},drawRectangleGraphics:function(t){var i,n,e,o,r,a;(t=t||{}).style=t.style||{width:3,material:f.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t&&(n=[],e=new f.Entity,o=new f.Rectangle,r=this,(a=new f.ScreenSpaceEventHandler(this._viewer.scene.canvas)).setInputAction(function(e){e=r.getCatesian3FromPX(e.position);e&&e.x&&(0==n.length?n.push(e.clone()):(a.destroy(),n.push(e.clone()),o=f.Rectangle.fromCartesianArray([...n,e],f.Ellipsoid.WGS84),"function"==typeof t.callback&&t.callback(r.transformCartesianArrayToWGS84Array(n),i)))},f.ScreenSpaceEventType.LEFT_CLICK),a.setInputAction(function(e){e=r.getCatesian3FromPX(e.endPosition);e&&(o=f.Rectangle.fromCartesianArray([...n,e],f.Ellipsoid.WGS84))},f.ScreenSpaceEventType.MOUSE_MOVE),e.rectangle=t.style,t.height&&(e.rectangle.extrudedHeight=t.height),e.rectangle.coordinates=new f.CallbackProperty(function(){return o},!1),i=this._drawLayer.entities.add(e))},drawCircleGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:f.Color.BLUE.withAlpha(.5),clampToGround:!0},this._viewer&&t){var i,n=void 0,o=new f.Entity,r=this,a=1,s=new f.ScreenSpaceEventHandler(this._viewer.scene.canvas);const l=function(e,t){var e=f.Cartographic.fromCartesian(e),t=f.Cartographic.fromCartesian(t),i=new f.EllipsoidGeodesic,i=(i.setEndPoints(e,t),i.surfaceDistance);a=Math.sqrt(Math.pow(i,2)+Math.pow(t.height-e.height,2))};s.setInputAction(function(e){e=r.getCatesian3FromPX(e.position);e&&e.x&&(n?(l(n,e),s.destroy(),"function"==typeof t.callback&&t.callback({center:n,radius:a},i)):(n=e,o.ellipse=t.style,o.ellipse.semiMajorAxis=new f.CallbackProperty(function(){return a},!1),o.ellipse.semiMinorAxis=new f.CallbackProperty(function(){return a},!1),o.position=new f.CallbackProperty(function(){return n},!1),o.point={pixelSize:5,outlineColor:f.Color.RED,outlineWidth:3},t.height&&(o.ellipse.extrudedHeight=t.height),i=r._drawLayer.entities.add(o)))},f.ScreenSpaceEventType.LEFT_CLICK),s.setInputAction(function(e){e=r._viewer.scene.camera.pickEllipsoid(e.endPosition,r._viewer.scene.globe.ellipsoid);n&&e&&e.x&&l(n,e)},f.ScreenSpaceEventType.MOUSE_MOVE)}},drawTrianglesGraphics:function(t){if((t=t||{}).style=t.style||{width:3,material:f.Color.BLUE.withAlpha(.5)},this._viewer&&t){var i=new f.Entity,n=new f.Entity,o=new f.Entity,r=[],a=[],s=[],l=this,c=new f.ScreenSpaceEventHandler(this._viewer.scene.canvas);c.setInputAction(function(e){e=l.getCatesian3FromPX(e.position);if(!e)return!1;0==r.length?(r.push(e.clone()),r.push(e.clone()),a.push(e.clone()),a.push(e.clone())):(c.destroy(),"function"==typeof t.callback&&t.callback({e:i,e2:n,e3:o}))},f.ScreenSpaceEventType.LEFT_CLICK),c.setInputAction(function(e){var t,i,e=l.getCatesian3FromPX(e.endPosition);e&&0<r.length&&(r.pop(),r.push(e.clone()),t=r,i=f.Cartographic.fromCartesian(t[0]),t=f.Cartographic.fromCartesian(t[1]),i=f.Cartesian3.fromDegrees(f.Math.toDegrees(i.longitude),f.Math.toDegrees(i.latitude),t.height),a.pop(),a.push(i.clone()),s.pop(),s.pop(),s.push(e.clone()),s.push(i.clone()))},f.ScreenSpaceEventType.MOUSE_MOVE),i.polyline={positions:new f.CallbackProperty(function(){return r},!1),...t.style},i.position=new f.CallbackProperty(function(){return r[0]},!1),i.point={pixelSize:5,outlineColor:f.Color.BLUE,outlineWidth:5},i.label={text:new f.CallbackProperty(function(){return"直线:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(r))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:f.HorizontalOrigin.LEFT,verticalOrigin:f.VerticalOrigin.BOTTOM,pixelOffset:new f.Cartesian2(50,-100)},n.polyline={positions:new f.CallbackProperty(function(){return a},!1),...t.style},n.position=new f.CallbackProperty(function(){return s[1]},!1),n.point={pixelSize:5,outlineColor:f.Color.BLUE,outlineWidth:5},n.label={text:new f.CallbackProperty(function(){return"高度:"+(t=a[1],!(e=a[0])&&!t||f.Cartesian3.equals(e,t)?0:(e=f.Cartographic.fromCartesian(e),(f.Cartographic.fromCartesian(t).height-e.height).toFixed(2)))+"米";var e,t},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:f.HorizontalOrigin.LEFT,verticalOrigin:f.VerticalOrigin.BOTTOM,pixelOffset:new f.Cartesian2(-20,100)},o.polyline={positions:new f.CallbackProperty(function(){return s},!1),...t.style},o.position=new f.CallbackProperty(function(){return r[1]},!1),o.point={pixelSize:5,outlineColor:f.Color.BLUE,outlineWidth:5},o.label={text:new f.CallbackProperty(function(){return"水平距离:"+l.getPositionDistance(l.transformCartesianArrayToWGS84Array(s))+"米"},!1),show:!0,showBackground:!0,font:"14px monospace",horizontalOrigin:f.HorizontalOrigin.LEFT,verticalOrigin:f.VerticalOrigin.BOTTOM,pixelOffset:new f.Cartesian2(-150,-20)},this._drawLayer.entities.add(o),this._drawLayer.entities.add(n),this._drawLayer.entities.add(i)}},drawWallGraphics:function(n){var o;(n=n||{}).style=n.style||{material:f.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:f.Color.WHITE},this._viewer&&n&&(o=this).drawPolygonGraphics({callback:function(e,t){var i=o._drawLayer.entities.add({wall:{positions:o.transformWGS84ArrayToCartesianArray(e),...n.style}});"function"==typeof n.callback&&n.callback(e,i)}})},drawEllipsoidGraphics:function(n){var o;(n=n||{}).style=n.style||{},this._viewer&&n&&(o=this).drawCircleGraphics({callback:function(e,t){var i=o.createGraphics(),t=(i.ellipsoid=o.$graphics.getEllipsoidGraphics({radii:e.radius}),i.position=e.center,o._drawLayer.entities.remove(t),o._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback({center:e.center,radius:e.radius},t)}})},drawCylinderGraphics:function(n){var o;(n=n||{}).style=n.style||{},this._viewer&&n&&(o=this).drawCircleGraphics({callback:function(e,t){var i=o._drawLayer.entities.add({position:e.center,cylinder:{length:2*e.radius||n.length,topRadius:n.topRadius||e.radius,bottomRadius:n.bottomRadius||e.radius,material:f.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:f.Color.WHITE}});o._drawLayer.entities.remove(t),"function"==typeof n.callback&&n.callback({center:e.center,radius:e.radius},i)}})},drawCorridorGraphics:function(n){var o;(n=n||{}).style=n.style||{},this._viewer&&n&&(o=this).drawLineGraphics({callback:function(e,t){var i=o.createGraphics(),t=(i.corridor={positions:o.transformWGS84ArrayToCartesianArray(e),height:n.height||1,width:n.width||100,cornerType:f.CornerType.BEVELED,extrudedHeight:n.extrudedHeight||1,material:f.Color.BLUE.withAlpha(.5),outline:!0,outlineColor:f.Color.WHITE},o._drawLayer.entities.remove(t),o._drawLayer.entities.add(i));"function"==typeof n.callback&&n.callback(e,t)}})},drawPolylineVolumeGraphics:function(o){(o=o||{}).style=o.style||{};const r=o.circleRadius||20,a=o.arms||7,s=o.rOuter||150,l=o.rInner||75;var c;this._viewer&&o&&(c=this).drawLineGraphics({callback:function(e,t){var i=c.createGraphics(),n="fivePoint"===o.shape?c.computeStar2d(a,s,l):c.computeCircleShap(r),n=(i.polylineVolume={positions:c.transformWGS84ArrayToCartesianArray(e),shape:n,cornerType:f.CornerType.MITERED,material:o.color||f.Color.RED},c._drawLayer.entities.remove(t),c._drawLayer.entities.add(i));"function"==typeof o.callback&&o.callback(e,n)}})},removeAll(){this._drawLayer.entities.removeAll()}};let V={};function N(e,t){e&&(this._viewer=e,V=t)}N.prototype={mathDistance2d:function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},getCirclePoints2d:function(e,t,i,n){for(var o=[],r=Math.PI/180*Math.round(360/n),a=0;a<n;a++){var s=t+e*Math.sin(r*a),l=i+e*Math.cos(r*a);o.unshift({x:s,y:l})}return o},wholeDistance2d:function(i){let n=0;return i&&Array.isArray(i)&&0<i.length&&i.forEach((e,t)=>{t<i.length-1&&(n+=this.mathDistance2d(e,i[t+1]))}),n},getBaseLength2d:function(e){return Math.pow(this.wholeDistance2d(e),.99)},computeStar2d(e,t,i){for(var n=Math.PI/e,o=2*e,r=new Array(o),a=0;a<o;a++){var s=a%2==0?t:i;r[a]=new V.Cartesian2(Math.cos(a*n)*s,Math.sin(a*n)*s)}return r},computeCircleShap(t){var i=[];for(let e=0;e<360;e++){var n=V.Math.toRadians(e);i.push(new V.Cartesian2(t*Math.cos(n),t*Math.sin(n)))}return i},mid2d:function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},getCircleCenterOfThreePoints2d:function(e,t,i){var n=[(e[0]+t[0])/2,(e[1]+t[1])/2],t=[n[0]-e[1]+t[1],n[1]+e[0]-t[0]],o=[(e[0]+i[0])/2,(e[1]+i[1])/2],e=[o[0]-e[1]+i[1],o[1]+e[0]-i[0]];return this.getIntersectPoint2d(n,t,o,e)},getIntersectPoint2d:function(e,t,i,n){return e[1]===t[1]?[(n[0]-i[0])/(n[1]-i[1])*(e[1]-i[1])+i[0],e[1]]:i[1]===n[1]?[(t[0]-e[0])/(t[1]-e[1])*(i[1]-e[1])+e[0],i[1]]:(t=(t[0]-e[0])/(t[1]-e[1]),n=(n[0]-i[0])/(n[1]-i[1]),[t*(i=(t*e[1]-e[0]-n*i[1]+i[0])/(t-n))-t*e[1]+e[0],i])},getAzimuth2d:function(e,t){let i,n=Math.asin(Math.abs(t[1]-e[1])/this.mathDistance2d(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=n+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=2*Math.PI-n:t[1]<e[1]&&t[0]<e[0]?i=n:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-n),i},getAngleOfThreePoints2d:function(e,t,i){e=this.getAzimuth2d(t,e)-this.getAzimuth2d(t,i);return e<0?e+2*Math.PI:e},isClockWise2d:function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},getPointOnLine2d:function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},getCubicValue2d:function(e,t,i,n,o){var[r,a]=[1-(e=Math.max(Math.min(e,1),0)),e*e],s=a*e,l=r*r,c=l*r;return[c*t[0]+3*l*e*i[0]+3*r*a*n[0]+s*o[0],c*t[1]+3*l*e*i[1]+3*r*a*n[1]+s*o[1]]},getThirdPoint2d:function(e,t,i,n,o){e=this.getAzimuth2d(e,t),o=o?e+i:e-i,e=n*Math.cos(o),i=n*Math.sin(o);return[t[0]+e,t[1]+i]},inherits2d:function(e,o){function t(){}t.prototype=o.prototype,e.superClass_=o.prototype,e.prototype=new t,(e.prototype.constructor=e).base=function(e,t,i){var n=Array.prototype.slice.call(arguments,2);return o.prototype[t].apply(e,n)}},getArcPoints2d:function(t,i,n,e){var[o,r,a,s]=[null,null,[],e-n],s=s<0?s+2*Math.PI:s;for(let e=0;e<=100;e++){var l=n+s*e/100,o=t[0]+i*Math.cos(l),r=t[1]+i*Math.sin(l);a.push([o,r])}return a},getBisectorNormals2d:function(e,t,i,n){let o=this.getNormal2d(t,i,n),[r,a,s,l,c]=[null,null,null,null,null],h=Math.sqrt(o[0]*o[0]+o[1]*o[1]),u=o[0]/h,d=o[1]/h,p=this.mathDistance2d(t,i),m=this.mathDistance2d(i,n);return a=(c=1e-4<h?this.isClockWise(t,i,n)?(s=e*p,l=i[0]-s*d,c=i[1]+s*u,r=[l,c],s=e*m,l=i[0]+s*d,i[1]-s*u):(s=e*p,l=i[0]+s*d,c=i[1]-s*u,r=[l,c],s=e*m,l=i[0]-s*d,i[1]+s*u):(l=i[0]+e*(t[0]-i[0]),c=i[1]+e*(t[1]-i[1]),r=[l,c],l=i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])),[l,c]),[r,a]},getNormal2d:function(e,t,i){var n=e[0]-t[0],e=e[1]-t[1],o=Math.sqrt(n*n+e*e),o=(n/=o,e/=o,i[0]-t[0]),i=i[1]-t[1],t=Math.sqrt(o*o+i*i);return[n+(o/=t),e+(i/=t)]},getLeftMostControlPoint2d:function(e,t){let[i,n,o,r,a]=[e[0],e[1],e[2],null,null],s=this.getBisectorNormals2d(0,i,n,o)[0],l=this.getNormal2d(i,n,o);var c,h,u,d,p;return a=1e-4<Math.sqrt(l[0]*l[0]+l[1]*l[1])?(e=this.mid2d(i,n),u=i[0]-e[0],c=i[1]-e[1],u=2*(c=-(h=2/this.mathDistance2d(i,n))*c)*(h=h*u),d=s[0]-e[0],p=s[1]-e[1],r=e[0]+(c*c-h*h)*d+u*p,e[1]+u*d+(h*h-c*c)*p):(r=i[0]+t*(n[0]-i[0]),i[1]+t*(n[1]-i[1])),[r,a]},getRightMostControlPoint2d:function(e,t){let i=e.length,n=e[i-3],o=e[i-2],r=e[i-1],a=this.getBisectorNormals2d(0,n,o,r)[1],s=this.getNormal2d(n,o,r),l=Math.sqrt(s[0]*s[0]+s[1]*s[1]),[c,h]=[null,null];var u,d,p,m,f;return h=1e-4<l?(e=this.mid2d(o,r),p=r[0]-e[0],u=r[1]-e[1],p=2*(u=-(d=2/this.mathDistance2d(o,r))*u)*(d=d*p),m=a[0]-e[0],f=a[1]-e[1],c=e[0]+(u*u-d*d)*m+p*f,e[1]+p*m+(d*d-u*u)*f):(c=r[0]+t*(o[0]-r[0]),r[1]+t*(o[1]-r[1])),[c,h]},getCurvePoints2d:function(t,i){let e=this.getLeftMostControlPoint2d(i,t),[n,o,r,a,s]=[null,null,null,[e],[]];for(let e=0;e<i.length-2;e++){[n,o,r]=[i[e],i[e+1],i[e+2]];var l=this.getBisectorNormals2d(t,n,o,r);a=a.concat(l)}var c=this.getRightMostControlPoint2d(i,t);c&&a.push(c);for(let t=0;t<i.length-1;t++){n=i[t],o=i[t+1],s.push(n);for(let e=0;e<100;e++){var h=this.getCubicValue2d(e/100,n,a[2*t],a[2*t+1],o);s.push(h)}s.push(o)}return s},getBezierPoints2d:function(o){if(o.length<=2)return o;var e=[],r=o.length-1;for(let n=0;n<=1;n+=.01){let[t,i]=[0,0];for(let e=0;e<=r;e++){var a=this.getBinomialFactor2d(r,e),s=Math.pow(n,e),l=Math.pow(1-n,r-e);t+=a*s*l*o[e][0],i+=a*s*l*o[e][1]}e.push([t,i])}return e.push(o[r]),e},getFactorial2d:function(t){let i=1;switch(t){case t<=1:i=1;break;case 2===t:i=2;break;case 3===t:i=6;break;case 24===t:i=24;break;case 5===t:i=120;break;default:for(let e=1;e<=t;e++)i*=e}return i},getBinomialFactor2d:function(e,t){return this.getFactorial2d(e)/(this.getFactorial2d(t)*this.getFactorial2d(e-t))},getQBSplinePoints2d:function(r){if(r.length<=2)return r;var[a,e]=[2,[]],t=r.length-a-1;e.push(r[0]);for(let o=0;o<=t;o++)for(let n=0;n<=1;n+=.05){let[t,i]=[0,0];for(let e=0;e<=a;e++){var s=this.getQuadricBSplineFactor2d(e,n);t+=s*r[o+e][0],i+=s*r[o+e][1]}e.push([t,i])}return e.push(r[r.length-1]),e},getQuadricBSplineFactor2d:function(e,t){let i=0;return 0===e?i=Math.pow(t-1,2)/2:1===e?i=(-2*Math.pow(t,2)+2*t+1)/2:2===e&&(i=Math.pow(t,2)/2),i}};let w=null;function j(e,t){e&&(this._viewer=e,w=t)}j.prototype={setCircleScanEffect:function(e){var t,i,n,o,r,a,s,l,c,h,u;if(e&&e.position)return t=e.id||"CircleScan"+parseInt(1e3*Math.random()),l=e.position,i=e.radius,n=e.color||w.Color.RED,o=e.duration||1500,r=this,a=e.circleMode||"CircleScan",e=e.border||4,u=l,s=new w.Cartesian4(u.x,u.y,u.z,1),u=this.transformCartesianToWGS84(l),l=this.transformWGS84ToCartesian({lng:u.lng,lat:u.lat,alt:u.alt+500}),c=new w.Cartesian4(l.x,l.y,l.z,1),h=(new Date).getTime(),u=new w.PostProcessStage({name:t,fragmentShader:this._getCircleScanShader({get:!0,border:e}),uniforms:{u_scanCenterEC:function(){return w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new w.Cartesian4)},u_scanPlaneNormalEC:function(){var e=w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,new w.Cartesian4),t=w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,c,new w.Cartesian4),i=new w.Cartesian3;return i.x=t.x-e.x,i.y=t.y-e.y,i.z=t.z-e.z,w.Cartesian3.normalize(i,i),i},u_radius:function(){return"CircleScan"==a?i*(((new Date).getTime()-h)%o)/o:i},u_scanColor:n}}),this._viewer.scene.postProcessStages.add(u),u},setRadarScanEffect:function(e){var t,i,n,o,r,a,s,l,c,h,u,d,p,m,f,g,v,y,_;if(e&&e.position)return t=e.id||"radarScan"+parseInt(1e3*Math.random()),c=e.position,i=e.radius,n=e.color||w.Color.RED,o=e.duration||1500,r=this,a=e.border||1,e=e.width||3,_=c,s=new w.Cartesian4(_.x,_.y,_.z,1),_=this.transformCartesianToWGS84(c),c=this.transformWGS84ToCartesian({lng:_.lng,lat:_.lat,alt:_.alt+500}),l=new w.Cartesian4(c.x,c.y,c.z,1),c=this.transformWGS84ToCartesian({lng:_.lng+.001,lat:_.lat,alt:_.alt}),h=new w.Cartesian4(c.x,c.y,c.z,1),u=(new Date).getTime(),d=new w.Quaternion,p=new w.Matrix3,m=new w.Cartesian4,f=new w.Cartesian4,g=new w.Cartesian4,v=new w.Cartesian3,y=new w.Cartesian3,_=new w.PostProcessStage({name:t,fragmentShader:this._getRadarScanShader({border:a,width:e,get:!0}),uniforms:{u_scanCenterEC:function(){return w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,m)},u_scanPlaneNormalEC:function(){var e=w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,m),t=w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,f);return v.x=t.x-e.x,v.y=t.y-e.y,v.z=t.z-e.z,w.Cartesian3.normalize(v,v),v},u_scanLineNormalEC:function(){var e=w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,s,m),t=w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,l,f),i=w.Matrix4.multiplyByVector(r._viewer.camera._viewMatrix,h,g),t=(v.x=t.x-e.x,v.y=t.y-e.y,v.z=t.z-e.z,w.Cartesian3.normalize(v,v),y.x=i.x-e.x,y.y=i.y-e.y,y.z=i.z-e.z,((new Date).getTime()-u)%o/o);return w.Quaternion.fromAxisAngle(v,t*w.Math.PI*2,d),w.Matrix3.fromQuaternion(d,p),w.Matrix3.multiplyByVector(p,y,y),w.Cartesian3.normalize(y,y),y},u_radius:i,u_scanColor:n}}),this._viewer.scene.postProcessStages.add(_),_},lighitCentrumScanEffect:function(t){var i=this.createLightScan_getCirclePoints(t.circle[0],t.circle[1],t.circle[2],t.circle[3]),n=this.createLightScan_entityCList(this._viewer,i,t);for(let e=0;e<n.length;e++)e!==n.length-1?this.createLightScan_changeOnePosition(t,n[e],[i[e].x,i[e].y,i[e+1].x,i[e+1].y]):this.createLightScan_changeOnePosition(t,n[e],[i[e].x,i[e].y,i[0].x,i[0].y]);return n},createLightScan_getCirclePoints:function(e,t,i,n){let o=[],r=Math.PI/180*Math.round(360/n),a=0;for(;a<n;a++){var s=t+e*Math.sin(r*a),l=i+e*Math.cos(r*a);o.unshift({x:s,y:l})}return o},createLightScan_changeOnePosition:function(t,e,i){const n=t.positionList;let o,r,a,s,l,c,h=0,u=0;function d(e){o=n[e+1][0]-n[e][0],r=n[e+1][1]-n[e][1],a=o/t.number,s=r/t.number,u=0}d(h),e.polygon.hierarchy=new w.CallbackProperty(function(){return Math.abs(l)>=Math.abs(o)&&Math.abs(c)>=Math.abs(r)&&((h+=1)===n.length-1&&(h=0),i[0]=i[0]+l,i[1]=i[1]+c,i[2]=i[2]+l,i[3]=i[3]+c,d(h)),l=u*a,c=u*s,u++,new w.PolygonHierarchy(w.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+l,i[1]+c,0,i[2]+l,i[3]+c,0]))},!1)},createLightScan_entityCList:function(t,i,n){var o=n.observer[0],r=n.observer[1],a=n.observer[2],s=[];for(let e=0;e<i.length;e++){var l=e===i.length-1?new w.PolygonHierarchy(w.Cartesian3.fromDegreesArrayHeights([o,r,a,i[e].x,i[e].y,0,i[0].x,i[0].y,0])):new w.PolygonHierarchy(w.Cartesian3.fromDegreesArrayHeights([o,r,a,i[e].x,i[e].y,0,i[e+1].x,i[e+1].y,0])),l=t.entities.add({name:"三角形",polygon:{hierarchy:l,outline:!1,perPositionHeight:!0,material:n.material}});s.push(l)}return s}};const Q="in vec4 position;\nin vec3 normal;\n\nout vec3 v_position;\nout vec3 v_positionWC;\nout vec3 v_positionEC;\nout vec3 v_normalEC;\n\nvoid main() {\n gl_Position = czm_modelViewProjection * position;\n v_position = vec3(position);\n v_positionWC = (czm_model * position).xyz;\n v_positionEC = (czm_modelView * position).xyz;\n v_normalEC = czm_normal * normal;\n}",K="uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nuniform vec4 u_lineColor;\n\nbool inSensorShadow(vec3 coneVertexWC, vec3 inverseRadii, vec3 pointWC) {\n // Diagonal matrix from the unscaled ellipsoid space to the scaled space.\n vec3 D = inverseRadii;\n\n // Sensor vertex in the scaled ellipsoid space\n vec3 q = D * coneVertexWC;\n float qMagnitudeSquared = dot(q, q);\n float test = qMagnitudeSquared - 1.0;\n\n // Sensor vertex to fragment vector in the ellipsoid's scaled space\n vec3 temp = D * pointWC - q;\n float d = dot(temp, q);\n\n // Behind silhouette plane and inside silhouette cone\n return (d < -test) && (d / length(temp) < -sqrt(test));\n}\n\n///////////////////////////////////////////////////////////////////////////////\n\nvec4 getLineColor() { return u_lineColor; }\n\nvec4 getIntersectionColor() { return u_intersectionColor; }\n\nfloat getIntersectionWidth() { return u_intersectionWidth; }\n\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC) {\n // (s, t) both in the range [0, 1]\n float t = pointMC.z / sensorRadius;\n float s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\n s = s - floor(s);\n\n return vec2(s, t);\n}",$='#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n uniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\n\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform float u_type;\n\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\n\nvec4 getColor(float sensorRadius, vec3 pointEC) {\n czm_materialInput materialInput;\n\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n\n czm_material material = czm_getMaterial(materialInput);\n\n return mix(\n czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),\n vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon) {\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the\n // tolerance. We also want to check if the value of an adjacent pixel is\n // within the tolerance, but we don\'t want to admit points that are obviously\n // not on the surface. For example, if we are looking for "value" to be close\n // to 0, but value is 1 and the adjacent value is 2, then the delta would be 1\n // and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels ||\n (delta < 10.0 * tolerance && temp - delta < tolerance &&\n temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\n\nvec4 shade(bool isOnBoundary) {\n if (u_showIntersection && isOnBoundary) {\n return getIntersectionColor();\n }\n if (u_type == 1.0) {\n return getLineColor();\n }\n return getColor(u_radius, v_positionEC);\n}\n\nfloat ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {\n vec3 scaled = inverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main() {\n vec3 sensorVertexWC =\n czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC =\n czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n\n // vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0, positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if (resX < cos(u_xHalfAngle) - 0.00001) {\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if (resY < cos(u_yHalfAngle) - 0.00001) {\n discard;\n }\n\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue =\n ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);\n\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid) {\n // Discard if in the ellipsoid\n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done\n // on the CPU first.\n if (ellipsoidValue < 0.0) {\n discard;\n }\n\n // Discard if in the sensor\'s shadow\n if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,\n v_positionWC)) {\n discard;\n }\n }\n\n // Notes: Each surface functions should have an associated tolerance based on\n // the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n // isOnEllipsoid = false;\n // if((resX >= 0.8 && resX <= 0.81)||(resY >= 0.8 && resY <= 0.81)){\n /*if(false){\n out_FragColor = vec4(1.0,0.0,0.0,1.0);\n }else{\n out_FragColor = shade(isOnEllipsoid);\n }\n*/\nout_FragColor = shade(isOnEllipsoid);\n}';let J={};function Y(t){var P=(J=t).BoundingSphere,x=J.Cartesian3,i=J.Color,d=J.combine,S=J.ComponentDatatype,n=J.defaultValue,o=J.defined,M=(J.destroyObject,J.DeveloperError),b=J.Matrix4,r=J.PrimitiveType,T=J.Buffer,A=J.BufferUsage,a=J.DrawCommand,E=J.Pass,I=J.RenderState,L=J.ShaderProgram,D=J.ShaderSource,k=J.VertexArray,z=J.BlendingState,R=J.CullFace,s=J.Material,Z=J.SceneMode,F=J.VertexFormat,G=J.Math,O=J.Matrix3,B=(b=J.Matrix4,J.JulianDate),u=(J.BoxGeometry,J.EllipsoidGeometry,Math.sin),H=Math.cos,U=Math.tan,W=Math.atan,V={position:0,normal:1};function e(e){var t=this;e=n(e,n.EMPTY_OBJECT),this.show=n(e.show,!0),this.slice=n(e.slice,32),this.modelMatrix=b.clone(e.modelMatrix,new b),this._modelMatrix=new b,this._computedModelMatrix=new b,this._computedScanPlaneModelMatrix=new b,this.radius=n(e.radius,Number.POSITIVE_INFINITY),this._radius=void 0,this.xHalfAngle=n(e.xHalfAngle,0),this._xHalfAngle=void 0,this.yHalfAngle=n(e.yHalfAngle,0),this._yHalfAngle=void 0,this.lineColor=n(e.lineColor,i.WHITE),this.showSectorLines=n(e.showSectorLines,!0),this.showSectorSegmentLines=n(e.showSectorSegmentLines,!0),this.showLateralSurfaces=n(e.showLateralSurfaces,!0),this.material=o(e.material)?e.material:s.fromType(s.ColorType),this._material=void 0,this._translucent=void 0,this.lateralSurfaceMaterial=o(e.lateralSurfaceMaterial)?e.lateralSurfaceMaterial:s.fromType(s.ColorType),this._lateralSurfaceMaterial=void 0,this._lateralSurfaceTranslucent=void 0,this.showDomeSurfaces=n(e.showDomeSurfaces,!0),this.domeSurfaceMaterial=o(e.domeSurfaceMaterial)?e.domeSurfaceMaterial:s.fromType(s.ColorType),this._domeSurfaceMaterial=void 0,this.showDomeLines=n(e.showDomeLines,!0),this.showIntersection=n(e.showIntersection,!0),this.intersectionColor=n(e.intersectionColor,i.WHITE),this.intersectionWidth=n(e.intersectionWidth,5),this.showThroughEllipsoid=n(e.showThroughEllipsoid,!1),this._showThroughEllipsoid=void 0,this.showScanPlane=n(e.showScanPlane,!0),this.scanPlaneColor=n(e.scanPlaneColor,i.WHITE),this.scanPlaneMode=n(e.scanPlaneMode,"horizontal"),this.scanPlaneRate=n(e.scanPlaneRate,10),this._scanePlaneXHalfAngle=0,this._scanePlaneYHalfAngle=0,this._time=B.now(),this._boundingSphere=new P,this._boundingSphereWC=new P,this._sectorFrontCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorBackCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._sectorVA=void 0,this._sectorLineCommand=new a({owner:this,primitiveType:r.LINES,boundingVolume:this._boundingSphereWC}),this._sectorLineVA=void 0,this._sectorSegmentLineCommand=new a({owner:this,primitiveType:r.LINES,boundingVolume:this._boundingSphereWC}),this._sectorSegmentLineVA=void 0,this._domeFrontCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeBackCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._domeVA=void 0,this._domeLineCommand=new a({owner:this,primitiveType:r.LINES,boundingVolume:this._boundingSphereWC}),this._domeLineVA=void 0,this._scanPlaneFrontCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanPlaneBackCommand=new a({owner:this,primitiveType:r.TRIANGLES,boundingVolume:this._boundingSphereWC}),this._scanRadialCommand=void 0,this._colorCommands=[],this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._uniforms={u_type:function(){return 0},u_xHalfAngle:function(){return t.xHalfAngle},u_yHalfAngle:function(){return t.yHalfAngle},u_radius:function(){return t.radius},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}},this._scanUniforms={u_xHalfAngle:function(){return t._scanePlaneXHalfAngle},u_yHalfAngle:function(){return t._scanePlaneYHalfAngle},u_radius:function(){return t.radius},u_color:function(){return t.scanPlaneColor},u_showThroughEllipsoid:function(){return t.showThroughEllipsoid},u_showIntersection:function(){return t.showIntersection},u_intersectionColor:function(){return t.intersectionColor},u_intersectionWidth:function(){return t.intersectionWidth},u_normalDirection:function(){return 1},u_lineColor:function(){return t.lineColor}}}e.prototype.update=function(e){var t,i,n,o,r=e.mode;if(this.show&&r===Z.SCENE3D){var r=!1,a=!1,s=!1,l=this.xHalfAngle,c=this.yHalfAngle;if(l<0||c<0)throw new M("halfAngle must be greater than or equal to zero.");if(0!=l&&0!=c){this._xHalfAngle===l&&this._yHalfAngle===c||(this._xHalfAngle=l,this._yHalfAngle=c,r=!0);var h=this.radius;if(h<0)throw new M("this.radius must be greater than or equal to zero.");var u,d,p,m,f=!1,h=(this._radius!==h&&(f=!0,this._radius=h,this._boundingSphere=new P(x.ZERO,this.radius)),b.equals(this.modelMatrix,this._modelMatrix)&&!f||(b.clone(this.modelMatrix,this._modelMatrix),b.multiplyByUniformScale(this.modelMatrix,this.radius,this._computedModelMatrix),P.transform(this._boundingSphere,this.modelMatrix,this._boundingSphereWC)),this.showThroughEllipsoid),f=(this._showThroughEllipsoid!==this.showThroughEllipsoid&&(this._showThroughEllipsoid=h,a=!0),this.material),g=(this._material!==f&&(this._material=f,s=a=!0),f.isTranslucent()),v=(this._translucent!==g&&(this._translucent=g,a=!0),this.showScanPlane&&(m=e.time,(p=B.secondsDifference(m,this._time))<0&&(this._time=B.clone(m,this._time)),m=Math.max(p%this.scanPlaneRate/this.scanPlaneRate,0),"horizontal"==this.scanPlaneMode?(p=H(u=2*c*m-c),d=U(l),p=W(p*d),this._scanePlaneXHalfAngle=p,this._scanePlaneYHalfAngle=u,J.Matrix3.fromRotationX(this._scanePlaneYHalfAngle,N)):(u=2*l*m-l,d=U(c),p=H(u),m=W(p*d),this._scanePlaneXHalfAngle=u,this._scanePlaneYHalfAngle=m,J.Matrix3.fromRotationY(this._scanePlaneXHalfAngle,N)),J.Matrix4.multiplyByMatrix3(this.modelMatrix,N,this._computedScanPlaneModelMatrix),b.multiplyByUniformScale(this._computedScanPlaneModelMatrix,this.radius,this._computedScanPlaneModelMatrix)),r&&(l=this,c=e.context,p=Y(l,l.xHalfAngle,l.yHalfAngle),d=l.xHalfAngle,u=l.yHalfAngle,m=p.zoy,p=p.zox,r=[],n=O.fromRotationY(d,N),r.push(m.map(function(e){return O.multiplyByVector(n,e,new J.Cartesian3)})),n=O.fromRotationX(-u,N),r.push(p.map(function(e){return O.multiplyByVector(n,e,new J.Cartesian3)}).reverse()),n=O.fromRotationY(-d,N),r.push(m.map(function(e){return O.multiplyByVector(n,e,new J.Cartesian3)}).reverse()),n=O.fromRotationX(u,N),r.push(p.map(function(e){return O.multiplyByVector(n,e,new J.Cartesian3)})),d=r,l.showLateralSurfaces&&(l._sectorVA=function(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,n=new Float32Array(18*i),o=0,r=0,a=t.length;r<a;r++)for(var s=t[r],l=x.normalize(x.cross(s[0],s[s.length-1],j),j),c=0,i=s.length-1;c<i;c++)n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=-l.x,n[o++]=-l.y,n[o++]=-l.z,n[o++]=s[c].x,n[o++]=s[c].y,n[o++]=s[c].z,n[o++]=-l.x,n[o++]=-l.y,n[o++]=-l.z,n[o++]=s[c+1].x,n[o++]=s[c+1].y,n[o++]=s[c+1].z,n[o++]=-l.x,n[o++]=-l.y,n[o++]=-l.z;var h=T.createVertexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW}),u=6*Float32Array.BYTES_PER_ELEMENT,h=[{index:V.position,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:S.FLOAT,offsetInBytes:0,strideInBytes:u},{index:V.normal,vertexBuffer:h,componentsPerAttribute:3,componentDatatype:S.FLOAT,offsetInBytes:3*Float32Array.BYTES_PER_ELEMENT,strideInBytes:u}];return new k({context:e,attributes:h})}(c,d)),l.showSectorLines&&(l._sectorLineVA=function(e,t){for(var i=new Float32Array(9*t.length),n=0,o=0,r=t.length;o<r;o++){var a=t[o];i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=a[0].x,i[n++]=a[0].y,i[n++]=a[0].z}var s=T.createVertexBuffer({context:e,typedArray:i,usage:A.STATIC_DRAW}),l=3*Float32Array.BYTES_PER_ELEMENT,s=[{index:V.position,vertexBuffer:s,componentsPerAttribute:3,componentDatatype:S.FLOAT,offsetInBytes:0,strideInBytes:l}];return new k({context:e,attributes:s})}(c,d)),l.showSectorSegmentLines&&(l._sectorSegmentLineVA=function(e,t){for(var i=Array.prototype.concat.apply([],t).length-t.length,n=new Float32Array(9*i),o=0,r=0,a=t.length;r<a;r++)for(var s=t[r],l=0,i=s.length-1;l<i;l++)n[o++]=s[l].x,n[o++]=s[l].y,n[o++]=s[l].z,n[o++]=s[l+1].x,n[o++]=s[l+1].y,n[o++]=s[l+1].z;var c=T.createVertexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW}),h=3*Float32Array.BYTES_PER_ELEMENT,c=[{index:V.position,vertexBuffer:c,componentsPerAttribute:3,componentDatatype:S.FLOAT,offsetInBytes:0,strideInBytes:h}];return new k({context:e,attributes:c})}(c,d)),l.showDomeSurfaces&&(l._domeVA=(m=c,u=J.EllipsoidGeometry.createGeometry(new J.EllipsoidGeometry({vertexFormat:F.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),k.fromGeometry({context:m,geometry:u,attributeLocations:V,bufferUsage:A.STATIC_DRAW,interleave:!1}))),l.showDomeLines&&(l._domeLineVA=(p=c,r=J.EllipsoidOutlineGeometry.createGeometry(new J.EllipsoidOutlineGeometry({vertexFormat:F.POSITION_ONLY,stackPartitions:32,slicePartitions:32})),k.fromGeometry({context:p,geometry:r,attributeLocations:V,bufferUsage:A.STATIC_DRAW,interleave:!1}))),l.showScanPlane)&&("horizontal"==l.scanPlaneMode?(o=Y(l,G.PI_OVER_TWO,0),l._scanPlaneVA=X(c,o.zox)):(o=Y(l,0,G.PI_OVER_TWO),l._scanPlaneVA=X(c,o.zoy))),a&&(r=this,l=h,g?(r._frontFaceRS=I.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:z.ALPHA_BLEND,cull:{enabled:!0,face:R.BACK}}),r._backFaceRS=I.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:z.ALPHA_BLEND,cull:{enabled:!0,face:R.FRONT}}),r._pickRS=I.fromCache({depthTest:{enabled:!l},depthMask:!1,blending:z.ALPHA_BLEND})):(r._frontFaceRS=I.fromCache({depthTest:{enabled:!l},depthMask:!0}),r._pickRS=I.fromCache({depthTest:{enabled:!0},depthMask:!0}))),s&&(o=c=this,l=h=f,f=(r=e).context,t=Q,i=new D({sources:[K,l.shaderSource,$]}),o._sp=L.replaceCache({context:f,shaderProgram:o._sp,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:V}),i=new D({sources:[K,l.shaderSource,$],pickColorQualifier:"uniform"}),o._pickSP=L.replaceCache({context:f,shaderProgram:o._pickSP,vertexShaderSource:t,fragmentShaderSource:i,attributeLocations:V}),c.showScanPlane)&&(l=c,f=h,o=r.context,f=new D({sources:[K,f.shaderSource,'#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n uniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\n\nuniform float u_radius;\nuniform float u_xHalfAngle;\nuniform float u_yHalfAngle;\nuniform float u_normalDirection;\nuniform vec4 u_color;\n\nin vec3 v_position;\nin vec3 v_positionWC;\nin vec3 v_positionEC;\nin vec3 v_normalEC;\n\nvec4 getColor(float sensorRadius, vec3 pointEC) {\n czm_materialInput materialInput;\n\n vec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\n materialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\n materialInput.str = pointMC / sensorRadius;\n\n vec3 positionToEyeEC = -v_positionEC;\n materialInput.positionToEyeEC = positionToEyeEC;\n\n vec3 normalEC = normalize(v_normalEC);\n materialInput.normalEC = u_normalDirection * normalEC;\n\n czm_material material = czm_getMaterial(materialInput);\n\n material.diffuse = u_color.rgb;\n material.alpha = u_color.a;\n\n return mix(\n czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC),\n vec4(material.diffuse, material.alpha), 0.4);\n}\n\nbool isOnBoundary(float value, float epsilon) {\n float width = getIntersectionWidth();\n float tolerance = width * epsilon;\n\n#ifdef GL_OES_standard_derivatives\n float delta = max(abs(dFdx(value)), abs(dFdy(value)));\n float pixels = width * delta;\n float temp = abs(value);\n // There are a couple things going on here.\n // First we test the value at the current fragment to see if it is within the\n // tolerance. We also want to check if the value of an adjacent pixel is\n // within the tolerance, but we don\'t want to admit points that are obviously\n // not on the surface. For example, if we are looking for "value" to be close\n // to 0, but value is 1 and the adjacent value is 2, then the delta would be 1\n // and "temp - delta" would be "1 - 1" which is zero even though neither of\n // the points is close to zero.\n return temp < tolerance && temp < pixels ||\n (delta < 10.0 * tolerance && temp - delta < tolerance &&\n temp < pixels);\n#else\n return abs(value) < tolerance;\n#endif\n}\n\nvec4 shade(bool isOnBoundary) {\n if (u_showIntersection && isOnBoundary) {\n return getIntersectionColor();\n }\n return getColor(u_radius, v_positionEC);\n}\n\nfloat ellipsoidSurfaceFunction(vec3 inverseRadii, vec3 point) {\n vec3 scaled = inverseRadii * point;\n return dot(scaled, scaled) - 1.0;\n}\n\nvoid main() {\n vec3 sensorVertexWC =\n czm_model[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n vec3 sensorVertexEC =\n czm_modelView[3].xyz; // (0.0, 0.0, 0.0) in model coordinates\n\n // vec3 pixDir = normalize(v_position);\n float positionX = v_position.x;\n float positionY = v_position.y;\n float positionZ = v_position.z;\n\n vec3 zDir = vec3(0.0, 0.0, 1.0);\n vec3 lineX = vec3(positionX, 0, positionZ);\n vec3 lineY = vec3(0, positionY, positionZ);\n float resX = dot(normalize(lineX), zDir);\n if (resX < cos(u_xHalfAngle) - 0.0001) {\n discard;\n }\n float resY = dot(normalize(lineY), zDir);\n if (resY < cos(u_yHalfAngle) - 0.0001) {\n discard;\n }\n\n // czm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\n float ellipsoidValue =\n ellipsoidSurfaceFunction(czm_ellipsoidInverseRadii, v_positionWC);\n\n // Occluded by the ellipsoid?\n if (!u_showThroughEllipsoid) {\n // Discard if in the ellipsoid\n // PERFORMANCE_IDEA: A coarse check for ellipsoid intersection could be done\n // on the CPU first.\n if (ellipsoidValue < 0.0) {\n discard;\n }\n\n // Discard if in the sensor\'s shadow\n if (inSensorShadow(sensorVertexWC, czm_ellipsoidInverseRadii,\n v_positionWC)) {\n discard;\n }\n }\n\n // Notes: Each surface functions should have an associated tolerance based on\n // the floating point error.\n bool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\n out_FragColor = shade(isOnEllipsoid);\n}']}),l._scanePlaneSP=L.replaceCache({context:o,shaderProgram:l._scanePlaneSP,vertexShaderSource:"in vec4 position;\nin vec3 normal;\n\nout vec3 v_position;\nout vec3 v_positionWC;\nout vec3 v_positionEC;\nout vec3 v_normalEC;\n\nvoid main() {\n gl_Position = czm_modelViewProjection * position;\n v_position = vec3(position);\n v_positionWC = (czm_model * position).xyz;\n v_positionEC = (czm_modelView * position).xyz;\n v_normalEC = czm_normal * normal;\n}",fragmentShaderSource:f,attributeLocations:V})),(a||s)&&(t=g,(i=this)._colorCommands.length=0,c=t?E.TRANSLUCENT:E.OPAQUE,i.showLateralSurfaces&&q(i,i._sectorFrontCommand,i._sectorBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorVA,i._uniforms,i._computedModelMatrix,t,c),i.showSectorLines&&q(i,i._sectorLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showSectorSegmentLines&&q(i,i._sectorSegmentLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._sectorSegmentLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showDomeSurfaces&&q(i,i._domeFrontCommand,i._domeBackCommand,i._frontFaceRS,i._backFaceRS,i._sp,i._domeVA,i._uniforms,i._computedModelMatrix,t,c),i.showDomeLines&&q(i,i._domeLineCommand,void 0,i._frontFaceRS,i._backFaceRS,i._sp,i._domeLineVA,i._uniforms,i._computedModelMatrix,t,c,!0),i.showScanPlane)&&q(i,i._scanPlaneFrontCommand,i._scanPlaneBackCommand,i._frontFaceRS,i._backFaceRS,i._scanePlaneSP,i._scanPlaneVA,i._scanUniforms,i._computedScanPlaneModelMatrix,t,c),e.commandList),h=e.passes,y=this._colorCommands;if(h.render)for(var _=0,w=y.length;_<w;_++){var C=y[_];v.push(C)}}}};var N=new O,j=new x;function Y(e,t,i){for(var n=e.slice,e=H(i),i=U(i),o=H(t),t=U(t),r=W(o*i),a=W(e*t),s=[],l=0;l<n;l++){var c=2*r*l/(n-1)-r;s.push(new x(0,u(c),H(c)))}for(var h=[],l=0;l<n;l++)h.push(new x(u(c=2*a*l/(n-1)-a),0,H(c)));return{zoy:s,zox:h}}function X(e,t){for(var i=t.length-1,n=new Float32Array(9*i),o=0,r=0;r<i;r++)n[o++]=0,n[o++]=0,n[o++]=0,n[o++]=t[r].x,n[o++]=t[r].y,n[o++]=t[r].z,n[o++]=t[r+1].x,n[o++]=t[r+1].y,n[o++]=t[r+1].z;var a=T.createVertexBuffer({context:e,typedArray:n,usage:A.STATIC_DRAW}),s=3*Float32Array.BYTES_PER_ELEMENT,a=[{index:V.position,vertexBuffer:a,componentsPerAttribute:3,componentDatatype:S.FLOAT,offsetInBytes:0,strideInBytes:s}];return new k({context:e,attributes:a})}function q(e,t,i,n,o,r,a,s,l,c,h,u){c&&i&&(i.vertexArray=a,i.renderState=o,i.shaderProgram=r,i.uniformMap=d(s,e._material._uniforms),i.uniformMap.u_normalDirection=function(){return-1},i.pass=h,i.modelMatrix=l,e._colorCommands.push(i)),t.vertexArray=a,t.renderState=n,t.shaderProgram=r,t.uniformMap=d(s,e._material._uniforms),u&&(t.uniformMap.u_type=function(){return 1}),t.pass=h,t.modelMatrix=l,e._colorCommands.push(t)}return e}let g={};function X(e){var t=(g=e).defaultValue,i=g.defined,e=Object.defineProperties,n=g.DeveloperError,o=g.Event,r=g.createMaterialPropertyDescriptor,a=g.createPropertyDescriptor;function s(e){this._show=void 0,this._radius=void 0,this._xHalfAngle=void 0,this._yHalfAngle=void 0,this._lineColor=void 0,this._showSectorLines=void 0,this._showSectorSegmentLines=void 0,this._showLateralSurfaces=void 0,this._material=void 0,this._showDomeSurfaces=void 0,this._showDomeLines=void 0,this._showIntersection=void 0,this._intersectionColor=void 0,this._intersectionWidth=void 0,this._showThroughEllipsoid=void 0,this._gaze=void 0,this._showScanPlane=void 0,this._scanPlaneColor=void 0,this._scanPlaneMode=void 0,this._scanPlaneRate=void 0,this._definitionChanged=new o,this.merge(t(e,t.EMPTY_OBJECT))}return e(s.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:a("show"),radius:a("radius"),xHalfAngle:a("xHalfAngle"),yHalfAngle:a("yHalfAngle"),lineColor:a("lineColor"),showSectorLines:a("showSectorLines"),showSectorSegmentLines:a("showSectorSegmentLines"),showLateralSurfaces:a("showLateralSurfaces"),material:r("material"),showDomeSurfaces:a("showDomeSurfaces"),showDomeLines:a("showDomeLines "),showIntersection:a("showIntersection"),intersectionColor:a("intersectionColor"),intersectionWidth:a("intersectionWidth"),showThroughEllipsoid:a("showThroughEllipsoid"),gaze:a("gaze"),showScanPlane:a("showScanPlane"),scanPlaneColor:a("scanPlaneColor"),scanPlaneMode:a("scanPlaneMode"),scanPlaneRate:a("scanPlaneRate")}),s.prototype.clone=function(e){return(e=i(e)?e:new s).show=this.show,e.radius=this.radius,e.xHalfAngle=this.xHalfAngle,e.yHalfAngle=this.yHalfAngle,e.lineColor=this.lineColor,e.showSectorLines=this.showSectorLines,e.showSectorSegmentLines=this.showSectorSegmentLines,e.showLateralSurfaces=this.showLateralSurfaces,e.material=this.material,e.showDomeSurfaces=this.showDomeSurfaces,e.showDomeLines=this.showDomeLines,e.showIntersection=this.showIntersection,e.intersectionColor=this.intersectionColor,e.intersectionWidth=this.intersectionWidth,e.showThroughEllipsoid=this.showThroughEllipsoid,e.gaze=this.gaze,e.showScanPlane=this.showScanPlane,e.scanPlaneColor=this.scanPlaneColor,e.scanPlaneMode=this.scanPlaneMode,e.scanPlaneRate=this.scanPlaneRate,e},s.prototype.merge=function(e){if(!i(e))throw new n("source is required.");this.show=t(this.show,e.show),this.radius=t(this.radius,e.radius),this.xHalfAngle=t(this.xHalfAngle,e.xHalfAngle),this.yHalfAngle=t(this.yHalfAngle,e.yHalfAngle),this.lineColor=t(this.lineColor,e.lineColor),this.showSectorLines=t(this.showSectorLines,e.showSectorLines),this.showSectorSegmentLines=t(this.showSectorSegmentLines,e.showSectorSegmentLines),this.showLateralSurfaces=t(this.showLateralSurfaces,e.showLateralSurfaces),this.material=t(this.material,e.material),this.showDomeSurfaces=t(this.showDomeSurfaces,e.showDomeSurfaces),this.showDomeLines=t(this.showDomeLines,e.showDomeLines),this.showIntersection=t(this.showIntersection,e.showIntersection),this.intersectionColor=t(this.intersectionColor,e.intersectionColor),this.intersectionWidth=t(this.intersectionWidth,e.intersectionWidth),this.showThroughEllipsoid=t(this.showThroughEllipsoid,e.showThroughEllipsoid),this.gaze=t(this.gaze,e.gaze),this.showScanPlane=t(this.showScanPlane,e.showScanPlane),this.scanPlaneColor=t(this.scanPlaneColor,e.scanPlaneColor),this.scanPlaneMode=t(this.scanPlaneMode,e.scanPlaneMode),this.scanPlaneRate=t(this.scanPlaneRate,e.scanPlaneRate)},s}let R={};function q(e,y){function c(e,t,i){var n=t[e.id];C(n)&&(n=n.primitive,i.remove(n),n.isDestroyed()||n.destroy(),delete t[e.id])}var i,_,w,C,o,P,x,S,M,b,T,A,E,I,L,D,k,n;if(e)return i=(R=e).AssociativeArray,_=R.Cartesian3,w=R.Color,C=R.defined,o=R.destroyObject,P=R.DeveloperError,x=R.Matrix3,S=R.Matrix4,M=R.Quaternion,b=R.MaterialProperty,T=R.Property,A=new x,new S,E=new _,I=new _,L=new M,D=new _,k=new M,(n=function(e,t){if(!C(e))throw new P("scene is required.");if(!C(t))throw new P("entityCollection is required.");t.collectionChanged.addEventListener(n.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._hash={},this._entitiesToVisualize=new i,this._onCollectionChanged(t,t.values,[],[])}).prototype.update=function(e){if(!C(e))throw new P("time is required.");for(var t=this._entitiesToVisualize.values,i=this._hash,n=this._primitives,o=0,r=t.length;o<r;o++){var a,s,l,c=t[o],h=c._rectangularSensor,u=i[c.id],d=c.isShowing&&c.isAvailable(e)&&T.getValueOrDefault(h._show,e,!0);if(d&&(a=T.getValueOrUndefined(c._position,e,E),g=T.getValueOrUndefined(c._orientation,e,L),v=T.getValueOrUndefined(h._radius,e),s=T.getValueOrUndefined(h._xHalfAngle,e),l=T.getValueOrUndefined(h._yHalfAngle,e),d=C(a)&&C(s)&&C(l)),d){d=C(u)?u.primitive:void 0,c=(C(d)||((d=new y).id=c,n.add(d),i[c.id]=u={primitive:d,position:void 0,orientation:void 0}),T.getValueOrUndefined(h._gaze,e));if(C(c)){var p=T.getValueOrUndefined(c._position,e,I);if(!C(a)||!C(p))continue;var m=_.subtract(a,p,D),f=_.angleBetween(R.Cartesian3.UNIT_Z,m),m=_.cross(R.Cartesian3.UNIT_Z,m,D),g=M.fromAxisAngle(m,f-Math.PI,k),v=_.distance(a,p);d.modelMatrix=S.fromRotationTranslation(x.fromQuaternion(g,A),a,d.modelMatrix)}else _.equals(a,u.position)&&M.equals(g,u.orientation)||(C(g)?(d.modelMatrix=S.fromRotationTranslation(x.fromQuaternion(g,A),a,d.modelMatrix),u.position=_.clone(a,u.position),u.orientation=M.clone(g,u.orientation)):(d.modelMatrix=R.Transforms.eastNorthUpToFixedFrame(a),u.position=_.clone(a,u.position)));d.show=!0,d.gaze=c,d.radius=v,d.xHalfAngle=s,d.yHalfAngle=l,d.lineColor=T.getValueOrDefault(h._lineColor,e,w.WHITE),d.showSectorLines=T.getValueOrDefault(h._showSectorLines,e,!0),d.showSectorSegmentLines=T.getValueOrDefault(h._showSectorSegmentLines,e,!0),d.showLateralSurfaces=T.getValueOrDefault(h._showLateralSurfaces,e,!0),d.material=b.getValue(e,h._material,d.material),d.showDomeSurfaces=T.getValueOrDefault(h._showDomeSurfaces,e,!0),d.showDomeLines=T.getValueOrDefault(h._showDomeLines,e,!0),d.showIntersection=T.getValueOrDefault(h._showIntersection,e,!0),d.intersectionColor=T.getValueOrDefault(h._intersectionColor,e,w.WHITE),d.intersectionWidth=T.getValueOrDefault(h._intersectionWidth,e,1),d.showThroughEllipsoid=T.getValueOrDefault(h._showThroughEllipsoid,e,!0),d.scanPlaneMode=T.getValueOrDefault(h._scanPlaneMode,e),d.scanPlaneColor=T.getValueOrDefault(h._scanPlaneColor,e,w.WHITE),d.showScanPlane=T.getValueOrDefault(h._showScanPlane,e,!0),d.scanPlaneRate=T.getValueOrDefault(h._scanPlaneRate,e,1)}else C(u)&&(u.primitive.show=!1)}return!0},n.prototype.isDestroyed=function(){return!1},n.prototype.destroy=function(){for(var e=this._entitiesToVisualize.values,t=this._hash,i=this._primitives,n=e.length-1;-1<n;n--)c(e[n],t,i);return o(this)},n.prototype._onCollectionChanged=function(e,t,i,n){for(var o,r=this._entitiesToVisualize,a=this._hash,s=this._primitives,l=t.length-1;-1<l;l--)o=t[l],C(o._rectangularSensor)&&C(o._position)&&r.set(o.id,o);for(l=n.length-1;-1<l;l--)o=n[l],C(o._rectangularSensor)&&C(o._position)?r.set(o.id,o):(c(o,a,s),r.remove(o.id));for(l=i.length-1;-1<l;l--)c(o=i[l],a,s),r.remove(o.id)},n}let A=null;function Z(e,t){e&&(this.viewer=e,A=t,this._installPlugin())}Z.prototype={_installPlugin:function(){this._installCounputeVertex(),this._installCylinderGeometry(),this._installRadarPrimitive()},_installCylinderGeometry:function(){function S(e){this.length=e.length,this.topRadius=e.topRadius,this.bottomRadius=e.bottomRadius,this.slices=e.slices||64,this.zReverse=e.zReverse}var b=new A.Cartesian2,M=new A.Cartesian3,T=new A.Ray;S._createGeometry=function(e){var t=e.length,i=e.topRadius,n=e.bottomRadius,o=e.slices,r=2*Math.PI/(o-1),a=[],s=[],l=[],c=[],h=[n,i],u=[0,e.zReverse?-t:t],d=0,e=Math.atan2(n-i,t),p=b;p.z=Math.sin(e);for(var m=Math.cos(e),f=0;f<u.length;f++){c[f]=[];for(var g=h[f],v=0;v<o;v++){c[f].push(d++);var y=r*v,_=g*Math.cos(y),w=g*Math.sin(y);a.push(_,w,u[f]),_=m*Math.cos(y),w=m*Math.sin(y),s.push(_,w,p.z),l.push(f/(u.length-1),0)}}for(var C=[],f=1;f<u.length;f++)for(v=1;v<o;v++){var P=c[f-1][v-1],x=c[f][v-1],S=c[f][v],M=c[f-1][v];C.push(S),C.push(M),C.push(P),C.push(S),C.push(P),C.push(x),v==c[f].length-1&&(P=c[f-1][v],x=c[f][v],S=c[f][0],M=c[f-1][0],C.push(S),C.push(M),C.push(P),C.push(S),C.push(P),C.push(x))}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=A.BoundingSphere.fromVertices(a),t=new A.Geometry({attributes:n,indices:C,primitiveType:A.PrimitiveType.TRIANGLES,boundingSphere:i});return a=[],C=[],l=[],t},S.createGeometry=function(e,t){if(!t)return S._createGeometry(e);A.Matrix4.multiplyByPoint(t,A.Cartesian3.ZERO,M),M.clone(T.origin);var i=e.length,n=e.topRadius,o=(e.bottomRadius,e.slices),r=2*Math.PI/(o-1),a=[],s=[],l=[],c=[],h=[0,e.zReverse?-i:i],u=0,u=0;a.push(0,0,0),s.push(1,1),u++;for(var d=new A.Cartesian3,p=n/15,m=0;m<16;m++){for(var f=p*m,g=[],v=0;v<o;v++){var y=r*v,_=f*Math.cos(y),y=f*Math.sin(y);d.x=_,d.y=y,d.z=h[1],(0,A.Scene.extend2Earth)(d,t,T)?(g.push(u),a.push(_,y,h[1]),s.push(m/15,1),u++):g.push(-1)}c.push(g)}for(var w,C,P=[0,c.length-1],x=0;x<P.length;x++)for(m=P[x],v=1;v<c[m].length;v++)w=c[m][v-1],C=c[m][v],0<=w&&0<=C&&l.push(0,w,C);a=new Float32Array(a),l=new Int32Array(l),s=new Float32Array(s),e={position:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),st:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:s})},i=A.BoundingSphere.fromVertices(a),n=new A.Geometry({attributes:e,indices:l,primitiveType:A.PrimitiveType.TRIANGLES,boundingSphere:i});return(0,A.Scene.computeVertexNormals)(n),a=[],l=[],n},S.createOutlineGeometry=function(e){var t=e.length,i=e.topRadius,n=e.bottomRadius,o=e.slices,r=2*Math.PI/(o-1),a=[],s=[],l=[],c=[],h=[n,i],u=[0,e.zReverse?-t:t],d=0,e=Math.atan2(n-i,t),p=b;p.z=Math.sin(e);for(var m=Math.cos(e),f=0;f<u.length;f++){c[f]=[];for(var g=h[f],v=0;v<o;v++){c[f].push(d++);var y=r*v,_=g*Math.cos(y),w=g*Math.sin(y);a.push(_,w,u[f]),_=m*Math.cos(y),w=m*Math.sin(y),s.push(_,w,p.z),l.push(f/(u.length-1),0)}}for(var C=[],f=1;f<u.length;f++)for(v=1;v<o;v+=1){var P=c[f-1][v-1],x=c[f][v-1];c[f][v],c[f-1][v],v%8==1&&C.push(P,x)}C=new Int16Array(C),a=new Float32Array(a),s=new Float32Array(s),l=new Float32Array(l),n={position:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:a}),normal:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:s}),st:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:l})},i=A.BoundingSphere.fromVertices(a),t=new A.Geometry({attributes:n,indices:C,primitiveType:A.PrimitiveType.LINES,boundingSphere:i});return a=[],C=[],l=[],t},S.fromAngleAndLength=function(e,t,i){return e=A.Math.toRadians(e),new S({topRadius:Math.tan(e)*t/2,bottomRadius:0,length:t,zReverse:i})},A.Scene.CylinderGeometry=S},_installRadarPrimitive:function(){var i;function e(e,t){t=t||{},i=e.scene.globe.ellipsoid,this._geometry=null,this._angle=t.angle,this._radius=t.radius||5,this._position=t.position,this._rotation=t.rotation||{heading:0,pitch:0,roll:0},this._trackedEntity=t.trackedEntity,this.defaultColor=t.color||A.Color.YELLOW,this.defaultLineColor=t.lineColor||this.defaultColor,this._show=A.defaultValue(t.show,!0),this._outline=A.defaultValue(t.outline,!1),this._topShow=A.defaultValue(t.top,!0),this._topOutline=A.defaultValue(t.topOutline,!0),this._modelMatrix=A.Matrix4.clone(A.Matrix4.IDENTITY),this._quaternion=new A.Quaternion,this._translation=new A.Cartesian3,this._scale=new A.Cartesian3(1,1,1),this._matrix=new A.Matrix4,this._inverseMatrix=new A.Matrix4,this._positionCartographic=new A.Cartographic,this._positionCartesian=null,this._drawCommands=[],this._outlinePositions=[],this.viewer=e,this.viewer.scene.primitives.add(this),this.updateGeometry(),this._groundArea=A.defaultValue(t.groundArea,!1),this.addGroundAreaEntity(this._groundArea)}Object.defineProperties(e.prototype,{trackedEntity:{get:function(){return this._trackedEntity},set:function(e){this._trackedEntity=e}},color:{get:function(){return this.defaultColor},set:function(e){this.defaultColor=e}},lineColor:{get:function(){return this.defaultLineColor},set:function(e){this.defaultLineColor=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},outline:{get:function(){return this._outline},set:function(e){this._outline=e,this.updateGeometry()}},top:{get:function(){return this._topShow},set:function(e){this._topShow=e,this.updateGeometry()}},topOutline:{get:function(){return this._topOutline},set:function(e){this._topOutline=e,this.updateGeometry()}},groundArea:{get:function(){return this._groundArea},set:function(e){this._groundArea=e,this.addGroundAreaEntity(this._groundArea)}},angle:{get:function(){return this._angle},set:function(e){this._angle=e,this.updateGroundCircleRadius(),this.updateGeometry()}},radius:{get:function(){return this._radius},set:function(e){this._radius=e,this.updateGroundCircleRadius(),this.updateGeometry()}},heading:{get:function(){return this._rotation.heading},set:function(e){this._rotation.heading=e}},pitch:{get:function(){return this._rotation.pitch},set:function(e){this._rotation.pitch=e}},roll:{get:function(){return this._rotation.roll},set:function(e){this._rotation.roll=e}},position:{get:function(){return this._position},set:function(e){this._position=e}}}),e.prototype.updateGroundCircleRadius=function(){this._ground_radius=this._radius*Math.cos(A.Math.toRadians(this._angle))},e.prototype.addGroundAreaEntity=function(e){var t;e&&!this.groundAreaEntity&&((t=this).updateGroundCircleRadius(),this.groundAreaEntity=viewer.entities.add({position:this._position,ellipse:{show:0===this._rotation.pitch&&0===this._rotation.roll,semiMinorAxis:new A.CallbackProperty(function(e){return t._ground_radius},!1),semiMajorAxis:new A.CallbackProperty(function(e){return t._ground_radius},!1),material:this.defaultColor},polyline:{show:this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll),positions:new A.CallbackProperty(function(e){return!t._trackedEntityPosition||A.Cartesian3.distance(t._position,t._trackedEntityPosition)>t._radius?[]:[t._position,t._trackedEntityPosition]},!1),followSurface:!1,material:new A.PolylineDashMaterialProperty({color:A.Color.CYAN}),width:1}}))};var n=new A.Cartesian3;e.prototype.computeMatrix=function(e,t){return this._positionCartesian||(this._positionCartesian=new A.Cartesian3),this.position instanceof A.Cartesian3?this._positionCartesian=this.position:"function"==typeof this.position.getValue?this._positionCartesian=this.position.getValue(e):this.position._value&&this.position._value instanceof A.Cartesian3&&(this._positionCartesian=this.position._value),this._trackedEntity&&this._trackedEntity.position&&(this._positionCartesian,e=A.Property.getValueOrUndefined(this._trackedEntity.position,e,n))&&(this._trackedEntityPosition=e,this._rotation.heading=0,this._rotation.pitch=40,this._rotation.roll=0),this._modelMatrix=A.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),this._positionCartographic=A.Cartographic.fromCartesian(this._positionCartesian,i,this._positionCartographic),A.Transforms.eastNorthUpToFixedFrame(this._positionCartesian,i,this._modelMatrix),A.Quaternion.fromHeadingPitchRoll(this._rotation,this._quaternion),this._matrix=A.Matrix4.fromTranslationQuaternionRotationScale(this._translation,this._quaternion,this._scale,this._matrix),A.Matrix4.multiplyTransformation(this._modelMatrix,this._matrix,this._matrix),A.Matrix4.inverseTransformation(this._matrix,this._inverseMatrix),this._matrix},e.prototype.getTopGeometry=function(){for(var e=this.radius,t=[],i=[],n=[],o=[],r=90-parseInt(this.angle),a=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=a){for(var h=A.Math.toRadians(c<90?c:90),h=Math.cos(h)*e,u=[],d=0;d<128;d++){var p=s*d,m=h*Math.cos(p),p=h*Math.sin(p),f=Math.sqrt(e*e-m*m-p*p);t.push(m,p,f),i.push(1,1),u.push(l++)}o.push(u)}for(c=1;c<o.length;c++)for(d=1;d<o[c].length;d++){var g=o[c-1][d-1],v=o[c][d-1],y=o[c][d],_=o[c-1][d];n.push(g,v,y),n.push(g,y,_)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),r={position:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},w=A.BoundingSphere.fromVertices(t),r=new A.Geometry({attributes:r,indices:n,primitiveType:A.PrimitiveType.TRIANGLES,boundingSphere:w});return(0,A.Scene.computeVertexNormals)(r),r},e.prototype.getTopOutlineGeometry=function(){for(var e=this.radius,t=[],i=[],n=[],o=[],r=90-parseInt(this.angle),a=r<1?r/8:1,s=2*Math.PI/127,l=0,c=this.angle;c<91;c+=a){for(var h=A.Math.toRadians(c<90?c:90),h=Math.cos(h)*e,u=[],d=0;d<128;d++){var p=s*d,m=h*Math.cos(p),p=h*Math.sin(p),f=Math.sqrt(e*e-m*m-p*p);t.push(m,p,f),i.push(1,1),u.push(l++)}o.push(u)}for(c=1;c<o.length;c++)for(d=1;d<o[c].length;d++){var g=o[c-1][d-1],v=o[c][d-1],y=o[c][d];o[c-1][d],d%8==1&&n.push(g,v),c%8==1&&n.push(v,y)}var t=new Float32Array(t),n=new Int32Array(n),i=new Float32Array(i),r={position:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.DOUBLE,componentsPerAttribute:3,values:t}),st:new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:2,values:i})},_=A.BoundingSphere.fromVertices(t),r=new A.Geometry({attributes:r,indices:n,primitiveType:A.PrimitiveType.LINES,boundingSphere:_});return(0,A.Scene.computeVertexNormals)(r),r},e.prototype.updateGeometry=function(){this._geometry=A.Scene.CylinderGeometry.createGeometry(new A.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(A.Math.toRadians(this.angle)),bottomRadius:0,length:this._radius*Math.sin(A.Math.toRadians(this.angle))})),this._topGeometry=this.getTopGeometry(),this._topOutlineGeometry=this.getTopOutlineGeometry(),this._outlineGeometry=A.Scene.CylinderGeometry.createOutlineGeometry(new A.Scene.CylinderGeometry({topRadius:this._radius*Math.cos(A.Math.toRadians(this.angle)),bottomRadius:0,slices:128,length:this._radius*Math.sin(A.Math.toRadians(this.angle))})),this._positions=new Float32Array(this._geometry.attributes.position.values.length);for(var e=0;e<this._positions.length;e++)this._positions[e]=this._geometry.attributes.position.values[e];this._drawCommands&&this._drawCommands.length&&(this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy()}),this._drawCommands.splice(0,this._drawCommands.length))},e.prototype.update=function(t){this._show&&(this.computeMatrix(t.time),t.mode===A.SceneMode.SCENE3D?(this._geometry.boundingSphere=A.BoundingSphere.fromVertices(this._geometry.attributes.position.values),this._drawCommands&&this._drawCommands.length||(this._drawCommands.push(this.createDrawCommand(this._geometry,t)),this._outline&&this._drawCommands.push(this.createDrawCommand(this._outlineGeometry,t)),this._topShow&&(this._drawCommands.push(this.createDrawCommand(this._topGeometry,t)),this._topOutline)&&this._drawCommands.push(this.createDrawCommand(this._topOutlineGeometry,t))),this._drawCommands.forEach(function(e){t.commandList.push(e)}),this.groundAreaEntity&&(this.groundAreaEntity.ellipse.show=this._groundArea&&0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=!1)):(this.groundAreaEntity||this.addGroundAreaEntity(!0),this.groundAreaEntity.ellipse.show=0===this._rotation.pitch&&0===this._rotation.roll,this.groundAreaEntity.polyline.show=this._trackedEntityPosition&&(0!==this._rotation.pitch||0!==this._rotation.roll)))},e.prototype.getFragmentShaderSource=function(e){return"#version 300 es\n in vec3 v_position;\n in vec3 v_normal; \n uniform float picked; \n uniform vec4 pickedColor; \n uniform vec4 defaultColor; \n uniform float specular; \n uniform float shininess; \n uniform vec3 emission; \n in vec2 v_st; \n uniform bool isLine; \n uniform float glowPower; \n void main() { \n vec3 positionToEyeEC = -v_position; \n vec3 normalEC = normalize(v_normal); \n vec4 color = defaultColor; \n if (picked != 0.0) { \n color = pickedColor; \n } \n czm_material material; \n material.specular = specular; \n material.shininess = shininess; \n material.normal = normalEC; \n material.emission = emission;//vec3(0.2,0.2,0.2);\n material.diffuse = color.rgb ;\n if(isLine){\n material.alpha = 1.0; \n }\n else{ \n material.alpha = color.a; \n }\n if(v_st.x==0.0){ \n out_FragColor =color ;\n }else { \n out_FragColor = czm_phong(normalize(positionToEyeEC), material,czm_lightDirectionEC) ; \n } \n }"},e.prototype.getVertexShaderSource=function(e){return"#version 300 es\n #ifdef GL_ES\n precision highp float;\n #endif\n\n in vec3 position;\n in vec2 st;\n in vec3 normal;\n uniform mat4 modelViewMatrix;\n uniform mat3 normalMatrix;\n uniform mat4 projectionMatrix;\n out vec3 v_position;\n out vec3 v_normal;\n out vec2 v_st;\n\n out vec3 v_light0Direction;\n\n void main(void) \n {\n vec4 pos = modelViewMatrix * vec4( position,1.0);\n v_normal = normalMatrix * normal;\n v_st = st;\n v_position = pos.xyz;\n v_light0Direction = mat3( modelViewMatrix) * vec3(1.0,1.0,1.0);\n gl_Position = projectionMatrix * pos;\n }"},e.prototype.createDrawCommand=function(e,t,i){var n=t.context,o=new A.Cartesian3,o=(A.Matrix4.multiplyByPoint(this._matrix,e.boundingSphere.center,o),new A.BoundingSphere(o,e.boundingSphere.radius)),i=new A.DrawCommand({modelMatrix:i||this._matrix,owner:this,primitiveType:e.primitiveType,pass:A.Pass.TRANSLUCENT,boundingVolume:o}),r=this,o=A.GeometryPipeline.createAttributeLocations(e);return i.vertexArray=A.VertexArray.fromGeometry({context:n,geometry:e,attributeLocations:o,bufferUsage:A.BufferUsage.STATIC_DRAW}),i.vertexArray._attributeLocations=o,i.shaderProgram=A.ShaderProgram.replaceCache({context:n,vertexShaderSource:this.getVertexShaderSource(e),fragmentShaderSource:this.getFragmentShaderSource(e),attributeLocations:o}),i.renderState=A.RenderState.fromCache({blending:A.BlendingState.ALPHA_BLEND,depthTest:{enabled:!0,func:A.DepthFunction.LESS},cull:{enabled:!1,face:A.CullFace.BACK}}),i.uniformMap={},i.uniformMap.projectionMatrix=function(){return t.context.uniformState.projection},i.uniformMap.modelViewMatrix=function(){return t.context.uniformState.modelView},i.uniformMap.shininess=function(){return r.shininess||(r.shininess=0),r.shininess},i.uniformMap.emission=function(){return r.emission||(r.emission=new A.Cartesian3(.2,.2,.2)),r.emission},i.uniformMap.specular=function(){return r.specular||(r.specular=0),r.specular},i.uniformMap.isLine=function(){return e.primitiveType==A.PrimitiveType.LINES||e.primitiveType==A.PrimitiveType.LINE_STRIP},i.uniformMap.defaultColor=function(){return e.primitiveType==A.PrimitiveType.LINES||e.primitiveType==A.PrimitiveType.LINE_STRIP?(r.defaultLineColor||(r.defaultLineColor=new A.Color(1,1,0,1)),r.defaultLineColor):(r.defaultColor||(r.defaultColor=new A.Color(1,0,0,1)),r.defaultColor)},i.uniformMap.picked=function(){return r.picked||(r.picked=0),r.picked},i.uniformMap.pickedColor=function(){return r.pickedColor||(r.pickedColor=new A.Color(1,1,0,1)),r.pickedColor},i.uniformMap.normalMatrix=function(){return t.context.uniformState.normal},i.uniformMap.glowPower=function(){return.25},i},e.prototype.remove=function(){this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity)},e.prototype.addToScene=function(){this.viewer.scene.primitives.add(this),this.groundAreaEntity&&this.viewer.entities.add(this.groundAreaEntity)},e.prototype.destroy=function(e){e&&(this.viewer.scene.primitives.remove(this),this.groundAreaEntity&&this.viewer.entities.remove(this.groundAreaEntity),this._drawCommands.forEach(function(e){e.vertexArray=e.vertexArray&&e.vertexArray.destroy()}),this._drawCommands=[])},A.Scene.ConeSensorPrimitive=e},_installCounputeVertex:function(){var o=new A.Cartesian3,r=(new A.Ray,new A.Cartographic);A.Scene.computeVertexNormals=function(e){var t=e.indices,i=e.attributes,n=t.length;if(i.position){var o=i.position.values;if(void 0===i.normal)i.normal=new A.GeometryAttribute({componentDatatype:A.ComponentDatatype.FLOAT,componentsPerAttribute:3,values:new Float32Array(o.length)});else for(var r=i.normal.values,a=0;a<n;a++)r[a]=0;for(var s,l,c,h=i.normal.values,u=new A.Cartesian3,d=new A.Cartesian3,p=new A.Cartesian3,m=new A.Cartesian3,f=new A.Cartesian3,a=0;a<n;a+=3)s=3*t[a+0],l=3*t[a+1],c=3*t[a+2],A.Cartesian3.fromArray(o,s,u),A.Cartesian3.fromArray(o,l,d),A.Cartesian3.fromArray(o,c,p),A.Cartesian3.subtract(p,d,m),A.Cartesian3.subtract(u,d,f),A.Cartesian3.cross(m,f,m),h[s]+=m.x,h[1+s]+=m.y,h[2+s]+=m.z,h[l]+=m.x,h[1+l]+=m.y,h[2+l]+=m.z,h[c]+=m.x,h[1+c]+=m.y,h[2+c]+=m.z;for(var g,v,y,_,w=e.attributes.normal.values,C=0;C<w.length;C+=3)g=w[C],v=w[C+1],y=w[C+2],_=1/Math.sqrt(g*g+v*v+y*y),w[C]=g*_,w[C+1]=v*_,w[C+2]=y*_;i.normal.needsUpdate=!0}return e},A.Scene.extend2Earth=function(e,t,i,n){n=n||A.Ellipsoid.WGS84,A.Matrix4.multiplyByPoint(t,e,o),A.Cartesian3.subtract(o,i.origin,i.direction),A.Cartesian3.normalize(i.direction,i.direction);t=A.IntersectionTests.rayEllipsoid(i,n),n=null;if(n=t?A.Ray.getPoint(i,t.start):n)try{A.Cartographic.fromCartesian(n,null,r)}catch(e){return null}return n}}};let ee={};function te(e,t){if(t){new Z(e,ee=t);const i=new Y(t),n=new X(t),r=new q(t,i);ee.Scene.RectangularSensorPrimitive=i,ee.Scene.RectangularSensorGraphics=n,ee.Scene.RectangularSensorVisualizer=r;var e=ee.DataSourceDisplay,o=e.defaultVisualizersCallback;e.defaultVisualizersCallback=function(e,t,i){var n=i.entities;return o(e,t,i).concat([new r(e,n)])}}}let n=null;function ie(e,t){e&&(this._viewer=e,n=t,this._customPluginLayer=new n.CustomDataSource("_customPluginLayer"),te(e,t),e)&&e.dataSources.add(this._customPluginLayer)}ie.prototype={createRectangularSensorGraphics:function(e){var t,i;if(this._customPluginLayer&&e)return t=new n.HeadingPitchRoll(n.Math.toRadians(e.heading||90),n.Math.toRadians(e.pitch||0),n.Math.toRadians(e.roll||0)),i=e.position,this._customPluginLayer.entities.add({position:i,orientation:n.Transforms.headingPitchRollQuaternion(i,t),rectangularSensor:new n.Scene.RectangularSensorGraphics({radius:e.radius||1e5,xHalfAngle:n.Math.toRadians(e.xHalfAngle||45),yHalfAngle:n.Math.toRadians(e.yHalfAngle||45),material:e.material||new n.Color(1,0,1,.4),lineColor:e.lineColor||new n.Color(1,0,1,1),showScanPlane:e.showScanPlane||!0,scanPlaneColor:e.scanPlaneColor||new n.Color(1,0,1,1),scanPlaneMode:e.scanPlaneMode||"vertical",scanPlaneRate:e.scanPlaneRate||3,showThroughEllipsoid:e.showThroughEllipsoid||!1,show:!0})})},createSatelliteCoverageSimulationGraphics:function(e){if(e)return new n.Scene.SatelliteCoverageSimulation(this._viewer,{position:e.position,angle1:e.angle1||30,angle2:e.angle2||45,areaType:e.areaType||2,rotation:{heading:n.Math.toRadians(e.heading||0),pitch:n.Math.toRadians(e.pitch||0),roll:n.Math.toRadians(e.roll||0)},color:e.color||{red:.43137254901960786,green:.9607843137254902,blue:0,alpha:.8}})},createRadarPrimitive:function(e){if(e)return new n.Scene.ConeSensorPrimitive(this._viewer,{position:e.position,angle:e.angle||80,radius:e.radius||7e5,rotation:{heading:n.Math.toRadians(e.heading||0),pitch:n.Math.toRadians(e.pitch||40),roll:n.Math.toRadians(e.roll||0)},color:e.color||{red:1,green:0,blue:0,alpha:.4},lineColor:e.lineColor||{red:1,green:1,blue:1,alpha:.9}})}};let s,v,y=null,o={},_="move",C=null;function ne(e,t){e&&(this._viewer=e,C=e,y=t,this._installFileDragDropHandler())}ne.prototype={_installFileDragDropHandler(){function i(e,t){var i=document.createElement("div");i.id="fileDragDrop",i.classList.add("filedragdrop"),i.innerHTML="请将Json文件拖拽到此区域",this._dragBox=i,this._viewer=t,(this._parentDiv=e).appendChild(i),this.fileDragDropCallBack=void 0,this.callBackParms=void 0}i.prototype.startuploadfile=function(){var i=this,e=i._dragBox,t=null;document.ondragover=function(){clearTimeout(t),t=setTimeout(function(){e.innerHTML="请将文件拖拽到此区域"},200)},e.ondragenter=function(){e.innerHTML="请释放鼠标"},e.ondragover=function(){return!1},e.ondragleave=function(){e.innerHTML="请将文件拖拽到此区域"},e.ondrop=function(e){e.preventDefault();var e=e.dataTransfer.files[0],t=new FileReader;return t.readAsText(e,"UTF-8"),t.onload=function(){var e=JSON.parse(this.result);i.fileDragDropCallBack&&i.fileDragDropCallBack(i.callBackParms,e,i._viewer)},t.onloadstart=function(){},t.onloadend=function(){},t.onabort=function(){alert("读取数据中断")},!(t.onerror=function(){alert("读取数据失败")})}},y.Scene.FileDragDropMixin=function(e){var t=new i(document.querySelector(".cesium-viewer"),e);Object.defineProperties(e,{fileDragDropMixin:{get:function(){return t}}})}},showLoadDataToScenePanel(e){if(e=e||{}){let e=new c.GUI,o=this._viewer,t=e.addFolder("加载数据文件"),i=e=>{let t=document.createElement("input");t.type="file",t.className="datgui_upload",t.onchange=function(){"function"==typeof e&&t.files.length&&e(URL.createObjectURL(t.files[0]))},document.getElementsByTagName("body")&&document.getElementsByTagName("body")[0].appendChild(t),t.click()},n={point:()=>{i(e=>{y.GeoJsonDataSource.load(e).then(function(e){o.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.point={color:y.Color.BLUE}}o.flyTo(e)})})},polyline:()=>{i(e=>{y.GeoJsonDataSource.load(e).then(function(e){o.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.polyline.width=5,n.polyline.material=new y.PolylineGlowMaterialProperty({glowPower:.1,color:y.Color.ORANGERED.withAlpha(.9)})}o.flyTo(e)})})},polygon:()=>{i(e=>{y.GeoJsonDataSource.load(e).then(function(e){o.dataSources.add(e);for(var t=e.entities.values,i=0;i<t.length;i++){var n=t[i];n.nameID=i,n.polygon.width=10,n.polygon.material=y.Color.BLUE.withAlpha(.9)}o.flyTo(e)})})},model:()=>{i(e=>{o.flyTo(d3kit.createModelGraphics({position:y.Cartesian3.fromDegrees(120.38105869,31.10115627),m_url:e}))})},czml:()=>{i(e=>{o.flyTo(o.dataSources.add(y.CzmlDataSource.load(e)))})},"3dtilset":()=>{i(e=>{o.flyTo(o.scene.primitives.add(new y.Cesium3DTileset({url:e})))})}};t.add(n,"point"),t.add(n,"polyline"),t.add(n,"polygon"),t.add(n,"model"),t.add(n,"czml"),t.add(n,"3dtilset"),t.open()}},showPostProcessStagesPanel(e){e=e||{};let t=null,i=new function(){this.blackAndWhiteShow=!1,this.blackAndWhiteGradations=5,this.brightnessShow=!1,this.brightnessValue=.5,this.nightVisionShow=!1,this.silhouette=!1},n=(e&&e.elementId?(t=new c.GUI({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new c.GUI,this._viewer.scene.postProcessStages),o=n.add(y.PostProcessStageLibrary.createSilhouetteStage()),r=n.add(y.PostProcessStageLibrary.createBlackAndWhiteStage()),a=n.add(y.PostProcessStageLibrary.createBrightnessStage()),s=n.add(y.PostProcessStageLibrary.createNightVisionStage());o.uniforms.color=e.silhouetteColor||y.Color.YELLOW,o.enabled=!1,r.enabled=!1,r.uniforms.gradations=5,a.enabled=!1,a.uniforms.brightness=.5,s.enabled=!1,t.add(i,"blackAndWhiteShow").name("blackAndWhiteShow").onChange(function(e){r.enabled=e}),t.add(i,"blackAndWhiteGradations",0,10,.1).name("blackAndWhiteGradations").onChange(function(e){r.uniforms.gradations=e}),t.add(i,"brightnessShow").name("brightnessShow").onChange(function(e){a.enabled=e}),t.add(i,"brightnessValue",0,10,.1).name("brightnessValue").onChange(function(e){a.uniforms.brightness=e}),t.add(i,"nightVisionShow").name("nightVisionShow").onChange(function(e){s.enabled=e}),t.add(i,"silhouette").name("silhouette").onChange(function(e){o.enabled=e})},showSceneBloomPanel(e){let t=null,i=new function(){this.contrast=128,this.brightness=-.3,this.delta=1,this.gamma=3.5,this.enabled=!1,this.highDynamicRange=!1,this.shadows=!1,this.glowOnly=!1,this.sigma=1,this.stepSize=5},n=(e&&e.elementId?(t=new c.GUI({autoPlace:!1}),document.getElementById(e.elementId).appendChild(t.domElement)):t=new c.GUI,this._viewer),o=(t.__closeButton.innerHTML="收缩面板",n.scene.postProcessStages.bloom);t.add(i,"enabled").name("bloom").onChange(function(e){o.enabled=e}),t.add(i,"glowOnly").name("发光").onChange(function(e){o.uniforms.glowOnly=e}),t.add(i,"enabled").name("启用模糊").onChange(function(e){o.enabled=e}),t.add(i,"contrast",-255,255,.01).name("对比度").onChange(function(e){o.uniforms.contrast=e}),t.add(i,"brightness",-1,1,.01).name("光泽亮度").onChange(function(e){o.uniforms.brightness=e}),t.add(i,"delta",1,5,.01).name("因子").onChange(function(e){o.uniforms.delta=e}),t.add(i,"sigma",1,10,.01).name("sigma").onChange(function(e){o.uniforms.sigma=e}),t.add(i,"stepSize",.1,10).name("stepSize").onChange(function(e){o.uniforms.stepSize=e}),t.add(i,"shadows").name("启用阴影").onChange(function(e){n.shadows=e}),t.add(i,"highDynamicRange").name("高动态范围").onChange(function(e){n.scene.highDynamicRange=e}),t.add(i,"gamma",1,10,.01).name("伽马亮度").onChange(function(e){n.scene.gamma=e})},showPrimitiveMatrixPanel(t){let i=t.primitives._delegate||t.primitives,n=t.primitives,e=(this._viewer,null);t&&t.elementId?(e=new c.GUI({autoPlace:!1}),document.getElementById(t.elementId).appendChild(e.domElement)):e=new c.GUI;var o=e.addFolder("离地高度"),o=(o.add({height:100},"height",0,1e3,1).onChange(function(e){var t=n.boundingSphere,t=y.Cartographic.fromCartesian(t.center),i=y.Cartesian3.fromRadians(t.longitude,t.latitude,0),t=y.Cartesian3.fromRadians(t.longitude,t.latitude,e),e=y.Cartesian3.subtract(t,i,new y.Cartesian3);n.modelMatrix=y.Matrix4.fromTranslation(e)}),o.open(),e.addFolder("缩放大小")),r={"m+Scale":()=>{i.readyPromise.then(e=>{var t=e.root.transform;y.Matrix4.multiplyByUniformScale(t,1.2,t),e.root.transform=t})},"m-Scale":()=>{i.readyPromise.then(e=>{var t=e.root.transform;y.Matrix4.multiplyByUniformScale(t,.8,t),e.root.transform=t})}},r=(o.add(r,"m+Scale"),o.add(r,"m-Scale"),o.open(),{"x+Axis":()=>{var e=y.Matrix4.fromTranslation(new y.Cartesian3(20,0,0));y.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"x-Axis":()=>{var e=y.Matrix4.fromTranslation(new y.Cartesian3(-20,0,0));y.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"y+Axis":()=>{var e=y.Matrix4.fromTranslation(new y.Cartesian3(0,20,0));y.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"y-Axis":()=>{var e=y.Matrix4.fromTranslation(new y.Cartesian3(0,-20,0));y.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"z+Axis":()=>{var e=y.Matrix4.fromTranslation(new y.Cartesian3(0,0,20));y.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)},"z-Axis":()=>{var e=y.Matrix4.fromTranslation(new y.Cartesian3(0,0,-20));y.Matrix4.multiply(i.modelMatrix,e,i.modelMatrix)}}),o=e.addFolder("矩阵平移");o.add(r,"x+Axis"),o.add(r,"x-Axis"),o.add(r,"y+Axis"),o.add(r,"y-Axis"),o.add(r,"z+Axis"),o.add(r,"z-Axis"),o.open();let a={x:0,y:0,z:0},s={"x+Axis":()=>{a.x+=15,i.readyPromise.then(e=>{var t=y.Matrix3.fromRotationX(y.Math.toRadians(a.x)),t=y.Matrix4.fromRotationTranslation(t),i=y.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);y.Matrix4.multiply(i,t,i),e._root.transform=i})},"x-Axis":()=>{a.x-=15,i.readyPromise.then(e=>{var t=y.Matrix3.fromRotationX(y.Math.toRadians(a.x)),t=y.Matrix4.fromRotationTranslation(t),i=y.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);y.Matrix4.multiply(i,t,i),e._root.transform=i})},"y+Axis":()=>{a.y+=15,i.readyPromise.then(e=>{var t=y.Matrix3.fromRotationY(y.Math.toRadians(a.y)),t=y.Matrix4.fromRotationTranslation(t),i=y.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);y.Matrix4.multiply(i,t,i),e._root.transform=i})},"y-Axis":()=>{a.y-=15,i.readyPromise.then(e=>{var t=y.Matrix3.fromRotationY(y.Math.toRadians(a.y)),t=y.Matrix4.fromRotationTranslation(t),i=y.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);y.Matrix4.multiply(i,t,i),e._root.transform=i})},"z+Axis":()=>{a.z+=15,i.readyPromise.then(e=>{var t=y.Matrix3.fromRotationZ(y.Math.toRadians(a.z)),t=y.Matrix4.fromRotationTranslation(t),i=y.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);y.Matrix4.multiply(i,t,i),e._root.transform=i})},"z-Axis":()=>{a.z-=15,i.readyPromise.then(e=>{var t=y.Matrix3.fromRotationZ(y.Math.toRadians(a.z)),t=y.Matrix4.fromRotationTranslation(t),i=y.Transforms.eastNorthUpToFixedFrame(e.boundingSphere.center);y.Matrix4.multiply(i,t,i),e._root.transform=i})}},l=e.addFolder("旋转矩阵");l.add(s,"x+Axis"),l.add(s,"x-Axis"),l.add(s,"y+Axis"),l.add(s,"y-Axis"),l.add(s,"z+Axis"),l.add(s,"z-Axis"),l.open(),t.cb&&((r=e.addFolder("获取调整后的模型矩阵")).add({getModelMaterix:()=>{i.readyPromise.then(e=>{e=e.root.transform;t.cb({modelTransformMatrix:e,modelMatrix:n.modelMatrix})})}},"getModelMaterix").name("获取模型矩阵"),r.open()),e.__closeButton.innerHTML="收缩面板"},showLayerParamPanel:function(t,i){if(t){let e=null;i&&i.elementId?(e=new c.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new c.GUI;var i=new function(){this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.gamma=t.gamma,this.hue=t.hue,this.dayAlpha=t.dayAlpha,this.nightAlpha=t.nightAlpha,this.saturation=t.saturation},n=e.addFolder("图层调整");n.add(i,"alpha",0,1,.05).name("透明度").onChange(function(e){t.alpha=e}),n.add(i,"brightness",0,5,.05).name("亮度").onChange(function(e){t.brightness=e}),n.add(i,"contrast",0,5,.05).name("对比").onChange(function(e){t.contrast=e}),n.add(i,"gamma",0,5,.05).name("伽马").onChange(function(e){t.gamma=e}),n.add(i,"hue",0,5,.05).name("色调").onChange(function(e){t.hue=e}),n.add(i,"dayAlpha",0,1,.05).name("白天透明").onChange(function(e){t.dayAlpha=e}),n.add(i,"nightAlpha",0,1,.05).name("夜晚透明").onChange(function(e){t.nightAlpha=e}),n.add(i,"saturation",0,5,.05).name("饱和").onChange(function(e){t.saturation=e}),n.open()}},showLayerSwitchPanel:function(t,i){if(t&&t.length){let e=null;i&&i.elementId?(e=new c.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new c.GUI;var n=new function(){t.forEach(e=>{this[e.id]=e.show})},o=e.addFolder("图层切换"),r=(t.forEach(t=>{o.add(n,t.id).name(t.name).onChange(function(e){t.show=e})}),new function(){t.forEach(e=>{this[e.id]=e.alpha})}),a=e.addFolder("透明度");t.forEach(t=>{a.add(r,t.id,0,1,.05).name(t.name).onChange(function(e){t.alpha=e})}),o.open(),a.open()}},showSceneEffectEditPanel:function(e){var t,i,n;e=e||{},c.GUI&&this._viewer.scene.colorCorrection&&(n=new c.GUI,(t=this._viewer).scene.lightSource.ambientLightColor=e.ambientLightColor||new y.Color(.3,.3,.3,1),t.scene.colorCorrection.show=e.colorCorrection||!1,t.scene.colorCorrection.saturation=e.saturation||3.1,t.scene.colorCorrection.brightness=e.brightness||1.8,t.scene.colorCorrection.contrast=e.contrast||1.2,t.scene.colorCorrection.hue=e.hue||0,t.scene.bloomEffect.show=e.bloomEffect||!1,t.scene.hdrEnabled=e.hdrEnabled||!0,t.scene.bloomEffect.threshold=e.threshold||1,t.scene.bloomEffect.bloomIntensity=e.bloomIntensity||2,i=new function(){this.bloomEffectShow=e.bloomEffect||!1,this.bloomThreshold=e.threshold||1,this.bloomIntensity=e.bloomIntensity||2,this.ambientLightColor=e.ambientLightColor||.3,this.hdrEnabled=e.hdrEnabled||!0,this.colorCorrectionShow=!1,this.colorCorrectionSaturation=e.saturation||3.1,this.colorCorrectionBrightness=e.brightness||1.8,this.colorCorrectionContrast=e.contrast||1.2,this.colorCorrectionHue=e.hue||0},n=n.addFolder("场景效果"),console.log("sceneEffect:",i),n.add(i,"bloomEffectShow").name("泛光开关").onChange(function(e){t.scene.bloomEffect.show=e,t.scene.bloomEffect.threshold=i.bloomThreshold,t.scene.bloomEffect.bloomIntensity=i.bloomIntensity}),n.add(i,"bloomThreshold",0,1,.1).name("泛光阈值").onChange(function(e){t.scene.bloomEffect.threshold=e}),n.add(i,"bloomIntensity",0,10,.1).name("泛光强度").onChange(function(e){t.scene.bloomEffect.bloomIntensity=e}),n.add(i,"hdrEnabled").name("HDR开关").onChange(function(e){t.scene.hdrEnabled=e}),n.add(i,"colorCorrectionShow").name("颜色校正").onChange(function(e){t.scene.colorCorrection.show=e}),n.add(i,"colorCorrectionSaturation",0,5,.1).name("饱和度").onChange(function(e){t.scene.colorCorrection.saturation=e}),n.add(i,"colorCorrectionBrightness",0,5,.1).name("亮度").onChange(function(e){t.scene.colorCorrection.brightness=e}),n.add(i,"colorCorrectionContrast",0,5,.1).name("对比度").onChange(function(e){t.scene.colorCorrection.contrast=e}),n.add(i,"colorCorrectionHue",0,5,.1).name("色调").onChange(function(e){t.scene.hdrEnabled=e}),n.add(i,"colorCorrectionHue",0,1,.1).name("环境光").onChange(function(e){t.scene.lightSource.ambientLightColor=new y.Color(e,e,e,1)}),n.open())},showEntityOrientationEditPanel:function(i={}){if(i.entity){let t=i.entity;var e=new c.GUI,n=(i&&i.elementId?(e=new c.GUI({autoPlace:!1}),document.getElementById(i.elementId).appendChild(e.domElement)):e=new c.GUI,new function(){this.heading=360,this.pitch=1,this.roll=1}),e=e.addFolder("实体姿态调整"),o=this;e.add(n,"heading",0,360,1).name("角度").onChange(function(e){n.heading=e;e=y.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new y.HeadingPitchRoll(y.Math.toRadians(n.heading),y.Math.toRadians(n.pitch),y.Math.toRadians(n.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.add(n,"pitch",0,360,1).name("航向").onChange(function(e){n.pitch=e;e=y.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new y.HeadingPitchRoll(y.Math.toRadians(n.heading),y.Math.toRadians(n.pitch),y.Math.toRadians(n.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.add(n,"roll",0,360,1).name("翻转").onChange(function(e){n.roll=e;e=y.Transforms.headingPitchRollQuaternion(t.position.getValue(o._viewer.clock.currentTime),new y.HeadingPitchRoll(y.Math.toRadians(n.heading),y.Math.toRadians(n.pitch),y.Math.toRadians(n.roll)));t.orientation=e,i.cb&&i.cb({orientation:e})}),e.open()}},definedMouseEvent({targetEntity:e,ctrlFlag:t}){v=e,o=t,this.bindHandelEvent({leftDown:this.defLeftDown,mouseMove:this.defMouseMove,mouseWheel:this.defMouseWheel,leftUp:this.defLeftUp})},defMouseMove(t){if(o.leftDown&&s){let e=C.camera.getPickRay(t.endPosition),o=C.scene.globe.pick(e,C.scene);if(document.body.style.cursor="pointer",s&&s.id&&"move"===_){let e=y.JulianDate.fromDate(new Date),t=v.position.getValue(e),i=y.Cartographic.fromCartesian(t),n=Number(i.height.toFixed(3));v.position=new y.CallbackProperty(()=>{var e=C.scene.globe.ellipsoid.cartesianToCartographic(o),t=y.Math.toDegrees(e.longitude),e=y.Math.toDegrees(e.latitude);return y.Cartesian3.fromDegrees(t,e,n)},!1)}else{var i,n,r;s&&s.id&&"rotate"===_&&(n=y.JulianDate.fromDate(new Date),n=v.position.getValue(n),r=C.scene.camera.pickEllipsoid(t.startPosition),t=C.scene.camera.pickEllipsoid(t.endPosition),i=y.Cartesian3.subtract(n,t,new y.Cartesian3),i=y.Cartesian3.normalize(i,new y.Cartesian3),r=y.Cartesian3.subtract(r,n,new y.Cartesian3),t=y.Cartesian3.subtract(t,n,new y.Cartesian3),n=y.Cartesian3.angleBetween(r,t),r=y.Quaternion.fromAxisAngle(i,100*n),v.orientation=r)}}},defLeftDown(e){s=C.scene.pick(e.position),y.defined(s)&&_?(o.selected=!0,o.leftDown=!0):o.selected=!1},defMouseWheel(n){if(s&&s.id&&"scale"===_){let e=y.JulianDate.fromDate(new Date),t=v.box.dimensions.getValue(e),i=0<n?2:.5;v.box.dimensions=new y.CallbackProperty(()=>y.Cartesian3.multiplyByScalar(t,i,new y.Cartesian3),!1)}},defLeftUp(e){o.leftDown=!1,document.body.style.cursor="default"},manualMoveModel:function(e){_=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualRotateModel:function(e){_=e,this._viewer.scene.screenSpaceCameraController.enableRotate=!1,this._viewer.scene.screenSpaceCameraController.enableZoom=!0},manualScaleModel:function(e){_=e,this._viewer.scene.screenSpaceCameraController.enableZoom=!1}};let P=null;function oe(e,t,i){e&&(this._viewer=e,P=t,this._pluginLayer=new P.CustomDataSource("pluginLayer"),e&&e.dataSources.add(this._pluginLayer),this._installPlugin())}oe.prototype={_installPlugin:function(){this._installCss3Renderer(),this._installTerrainClipPlan()},_installTerrainClipPlan:function(){function e(e,t){this.viewer=e,this.options=t||{},this._positions=t.positions,this._height=this.options.height||0,this.bottomImg=t.bottomImg,this.wallImg=t.wallImg,this.splitNum=P.defaultValue(t.splitNum,50),this._positions&&0<this._positions.length&&this.updateData(this._positions)}Object.defineProperties(e.prototype,{show:{get:function(){return this._show},set:function(e){this._show=e,this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=e),this._switchExcavate(e)}},height:{get:function(){return this._height},set:function(e){this._height=e,this._updateExcavateDepth(e)}}}),e.prototype.updateData=function(e){var t=[],i=e.length-1,n=new P.Cartesian3,o=0<P.Cartesian3.subtract(e[0],e[1],n).x;this.excavateMinHeight=9999;for(var r=0;r<i;r++){var a=(r+1)%i,s=P.Cartesian3.midpoint(e[r],e[a],new P.Cartesian3),l=P.Cartographic.fromCartesian(e[r]),l=this.viewer.scene.globe.getHeight(l)||l.height;l<this.excavateMinHeight&&(this.excavateMinHeight=l);l=P.Cartesian3.normalize(s,new P.Cartesian3),a=o?P.Cartesian3.subtract(e[r],s,new P.Cartesian3):P.Cartesian3.subtract(e[a],s,new P.Cartesian3),a=(a=P.Cartesian3.normalize(a,a),P.Cartesian3.cross(a,l,new P.Cartesian3)),a=P.Cartesian3.normalize(a,a),l=new P.Plane(a,0),l=P.Plane.getPointDistance(l,s);t.push(new P.ClippingPlane(a,l))}this.viewer.scene.globe.clippingPlanes=new P.ClippingPlaneCollection({planes:t,edgeWidth:1,edgeColor:P.Color.WHITE,enabled:!0}),this._prepareWell(e),this._createWell(this.wellData)},e.prototype.clear=function(){this.viewer.scene.globe.clippingPlanes&&(this.viewer.scene.globe.clippingPlanes.enabled=!1,this.viewer.scene.globe.clippingPlanes.removeAll(),this.viewer.scene.globe.clippingPlanes.isDestroyed()||this.viewer.scene.globe.clippingPlanes.destroy()),this.viewer.scene.globe.clippingPlanes=void 0,this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall),delete this.bottomSurface,delete this.wellWall,this.viewer.scene.render()},e.prototype._prepareWell=function(e){var t=this.splitNum,i=e.length;if(0!=i){for(var n=this.excavateMinHeight-this.height,o=[],r=[],a=[],s=0;s<i;s++){var l=s==i-1?0:s+1,c=P.Cartographic.fromCartesian(e[s]),l=P.Cartographic.fromCartesian(e[l]),h=[c.longitude,c.latitude],u=[l.longitude,l.latitude];0==s&&(a.push(new P.Cartographic(h[0],h[1])),r.push(P.Cartesian3.fromRadians(h[0],h[1],n)),o.push(P.Cartesian3.fromRadians(h[0],h[1],0)));for(var d=1;d<=t;d++){var p=P.Math.lerp(h[0],u[0],d/t),m=P.Math.lerp(h[1],u[1],d/t);s==i-1&&d==t||(a.push(new P.Cartographic(p,m)),r.push(P.Cartesian3.fromRadians(p,m,n)),o.push(P.Cartesian3.fromRadians(p,m,0)))}}this.wellData={lerp_pos:a,bottom_pos:r,no_height_top:o}}},e.prototype._createWell=function(r){var a,e;this.viewer.terrainProvider._layers?((a=this)._createBottomSurface(r.bottom_pos),e=P.sampleTerrainMostDetailed(this.viewer.terrainProvider,r.lerp_pos),P.when(e,function(e){for(var t=e.length,i=[],n=0;n<t;n++){var o=P.Cartesian3.fromRadians(e[n].longitude,e[n].latitude,e[n].height);i.push(o)}a._createWellWall(r.bottom_pos,i)})):(this._createBottomSurface(r.bottom_pos),this._createWellWall(r.bottom_pos,r.no_height_top))},e.prototype._getMinHeight=function(t){let i=5e6,n=null;for(let e=0;e<t.length;e++){var o=t[e].z;o<i&&(i=o,n=this._ellipsoidToLonLat(t[e]))}return n.altitude},e.prototype._ellipsoidToLonLat=function(e){var t=this.viewer.scene.globe.ellipsoid,e=new P.Cartesian3(e.x,e.y,e.z),t=t.cartesianToCartographic(e),e=P.Math.toDegrees(t.latitude);return{longitude:P.Math.toDegrees(t.longitude),latitude:e,altitude:t.height}},e.prototype._createBottomSurface=function(t){if(t.length){var i=this._getMinHeight(t),n=[];for(let e=0;e<t.length;e++){var o=this._ellipsoidToLonLat(t[e]);n.push(o.longitude),n.push(o.latitude),n.push(i)}var e=new P.PolygonGeometry({polygonHierarchy:new P.PolygonHierarchy(P.Cartesian3.fromDegreesArrayHeights(n)),perPositionHeight:!0}),e=P.PolygonGeometry.createGeometry(e),r=new P.Material({fabric:{type:"Image",uniforms:{image:this.bottomImg}}}),r=new P.MaterialAppearance({translucent:!1,flat:!0,material:r});this.bottomSurface=new P.Primitive({geometryInstances:new P.GeometryInstance({geometry:e}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.bottomSurface)}},e.prototype._createWellWall=function(e,t){var i=this._getMinHeight(e),n=[],o=[];for(let e=0;e<t.length;e++)n.push(this._ellipsoidToLonLat(t[e]).altitude),o.push(i);var e=new P.WallGeometry({positions:t,maximumHeights:n,minimumHeights:o}),e=P.WallGeometry.createGeometry(e),r=new P.Material({fabric:{type:"Image",uniforms:{image:this.wallImg}}}),r=new P.MaterialAppearance({translucent:!1,flat:!0,material:r});this.wellWall=new P.Primitive({geometryInstances:new P.GeometryInstance({geometry:e,attributes:{color:P.ColorGeometryInstanceAttribute.fromColor(P.Color.GREY)},id:"PitWall"}),appearance:r,asynchronous:!1}),this.viewer.scene.primitives.add(this.wellWall)},e.prototype._switchExcavate=function(e){e?(this.viewer.scene.globe.material=P.Material.fromType("WaJue"),this.wellWall.show=!0,this.bottomSurface.show=!0):(this.viewer.scene.globe.material=null,this.wellWall.show=!1,this.bottomSurface.show=!1)},e.prototype._updateExcavateDepth=function(e){this.bottomSurface&&this.viewer.scene.primitives.remove(this.bottomSurface),this.wellWall&&this.viewer.scene.primitives.remove(this.wellWall);for(var t=this.wellData.lerp_pos,i=[],n=t.length,o=0;o<n;o++)i.push(P.Cartesian3.fromRadians(t[o].longitude,t[o].latitude,this.excavateMinHeight-e));this.wellData.bottom_pos=i,this._createWell(this.wellData),this.viewer.scene.primitives.add(this.bottomSurface),this.viewer.scene.primitives.add(this.wellWall)},P.Scene.TerrainClipPlan=e},buildLightScanGraphics:function(e){if(this._viewer&&e){for(var l=this,t=function(t,e,i){var n,o,r,a,s,l,c=t.positionList,h=0,u=0;function d(e){n=c[e+1][0]-c[e][0],o=c[e+1][1]-c[e][1],r=n/t.number,a=o/t.number,u=0}d(h),e.polygon.hierarchy=new P.CallbackProperty(function(){return Math.abs(s)>=Math.abs(n)&&Math.abs(l)>=Math.abs(o)&&((h+=1)===c.length-1&&(h=0),i[0]=i[0]+s,i[1]=i[1]+l,i[2]=i[2]+s,i[3]=i[3]+l,d(h)),s=u*r,l=u*a,u++,new P.PolygonHierarchy(P.Cartesian3.fromDegreesArrayHeights([t.observer[0],t.observer[1],t.observer[2],i[0]+s,i[1]+l,0,i[2]+s,i[3]+l,0]))},!1)},i=l._getCirclePoints(e.circle[0],e.circle[1],e.circle[2],e.circle[3]),n=function(e,t){for(var i=t.observer[0],n=t.observer[1],o=t.observer[2],r=[],a=0;a<e.length;a++){var s=a===e.length-1?new P.PolygonHierarchy(P.Cartesian3.fromDegreesArrayHeights([i,n,o,e[a].x,e[a].y,0,e[0].x,e[0].y,0])):new P.PolygonHierarchy(P.Cartesian3.fromDegreesArrayHeights([i,n,o,e[a].x,e[a].y,0,e[a+1].x,e[a+1].y,0])),s=l._pluginLayer.entities.add({name:"三角形",polygon:{hierarchy:s,outline:!1,perPositionHeight:!0,material:t.material}});r.push(s)}return r}(i,e),o=0;o<n.length;o++)o!==n.length-1?t(e,n[o],[i[o].x,i[o].y,i[o+1].x,i[o+1].y]):t(e,n[o],[i[o].x,i[o].y,i[0].x,i[0].y]);return n}},buildPathRoaming:function(e){if(this._viewer&&e&&e.paths){for(var t=e.paths,i=this.createGraphics(),n=[],o=0;o<t.length;o++){var r=P.Cartesian3.fromDegrees(Number(t[o].lng),Number(t[o].lat),Number(t[o].alt));n.push(r)}if(i.position=this._createSampledPosition(n),i.name=e.name||"路径漫游",i.availability=new P.TimeIntervalCollection([new P.TimeInterval({start:this.startTime,stop:this.stopTime})]),i.orientation=this._sampleOrientation(),e.polyline){const{width:t,material:o,clampToGround:r,...a}=e.polyline;i.polyline={positions:new P.CallbackProperty(function(){return n},!1),width:t||10,material:o||new P.PolylineGlowMaterialProperty({glowPower:1,color:P.Color.RED}),clampToGround:r||!0,resOpt:a}}return e.model&&(i.model=this.getModelGraphics(e.model)),e.label&&(i.label=this.getLabelGraphics(e)),e.billboard&&(i.billboard=this.getBillboardGraphics(e)),this.droneEntity=i,this._beginRoamTrace(e),this._viewer.entities.add(i)}},_beginRoamTrace(i){this._viewer.clock.onTick.addEventListener(()=>{var e,t;this._viewer.clock.shouldAnimate&&(t=this._viewer.clock.currentTime,e=this.droneEntity.position.getValue(t),t=this.droneEntity.orientation.getValue(t),e)&&t&&(t=P.Matrix4.fromRotationTranslation(P.Matrix3.fromQuaternion(t),e),this._viewer.camera.lookAtTransform(t,i.cameraOffset()))})},_createSampledPosition(t){this.startTime=P.JulianDate.now(),this.stopTime=P.JulianDate.addSeconds(this.startTime,60*t.length,new P.JulianDate),this._viewer.clock.startTime=this.startTime.clone(),this._viewer.clock.stopTime=this.stopTime.clone(),this._viewer.clock.currentTime=this.startTime.clone(),this._viewer.clock.clockRange=P.ClockRange.CLAMPED;var i=new P.SampledPositionProperty;for(let e=0;e<t.length;e++){var n=P.JulianDate.addSeconds(this.startTime,60*e,new P.JulianDate),o=t[e];i.addSample(n,o)}return i},_sampleOrientation(){let o,r,a;return new P.CallbackProperty(e=>{var t=this.droneEntity.position.getValue(e);if(r=this.droneEntity.position.getValue(P.JulianDate.addSeconds(e,1/60,new P.JulianDate)),t&&r){o=t;const e=P.Cartesian3.subtract(r,o,new P.Cartesian3),i=P.Cartesian3.normalize(e,new P.Cartesian3),n=P.Transforms.rotationMatrixFromPositionVelocity(o,i,P.Ellipsoid.WGS84);a=P.Quaternion.fromRotationMatrix(n)}return a},!1)},_installCss3Renderer:function(){function e(e,t){this._scratch=new P.Cartesian2,this._viewer=i,this._scene=i.scene,this._camera=i.camera,this._container=null,this._elements=e,this._isBackHide=t,this.init()}var i;this._viewer&&(i=this._viewer,e.prototype.init=function(){var o=document.createElement("div"),r=(o.className="ys-css3-container",document.getElementById("info-warp").appendChild(o),this._container=o,this._elements.forEach(function(e){o.insertAdjacentHTML("beforeend",e.element)}),this);this._scene.preRender.addEventListener(function(){for(var e=0;e<o.children.length;e++){var t,i=P.Cartesian3.fromDegrees(r._elements[e].position[0],r._elements[e].position[1],r._elements[e].position[2]||0),n=r._scene.cartesianToCanvasCoordinates(i,r._scratch);P.defined(n)&&(o.children[e].style.left=parseFloat(n.x)+parseFloat(r._elements[e].offset[0])+"px",o.children[e].style.top=parseFloat(n.y)+parseFloat(r._elements[e].offset[1])+"px",r._isBackHide)&&(n=r._camera.position,t=r._scene.globe.ellipsoid.cartesianToCartographic(n).height,t+=+r._scene.globe.ellipsoid.maximumRadius,P.Cartesian3.distance(n,i)>t?o.children[e].style.display="none":o.children[e].style.display="block")}})},e.prototype.remove=function(e){this._elements=this._elements.filter(function(e){e.id}),this._container.removeChild(document.getElementById(e))},e.prototype.append=function(e){this._elements.push(e),this._container.insertAdjacentHTML("beforeend",e.element)},e.prototype.removeEntityLayer=function(e){this._viewer.entities.removeById(e+"_1"),this._viewer.entities.removeById(e+"_2"),this._viewer.entities.removeById(e+"_3"),this.remove(e)},e.prototype.addEntityLayer=function(e){var t=e.position[0],i=e.position[1],n=this,o=(setTimeout(function(e){},300),P.Math.toRadians(30)),r=P.Math.toRadians(30),a=e.boxHeight||300,s=e.boxHeightMax||400,l=e.boxHeightDif||10,c=!0;e.boxShow?this._viewer.entities.add({id:e.id+"_1",name:"立方体盒子",position:new P.CallbackProperty(function(){return(a+=l)>=s&&(a=s),P.Cartesian3.fromDegrees(t,i,a/2)},!1),box:{dimensions:new P.CallbackProperty(function(){return(a+=l)>=s&&(a=s,c)&&(c=!1,n.append(e,!0)),new P.Cartesian3(e.boxSide||100,e.boxSide||100,a)},!1),material:e.boxMaterial||P.Color.DEEPSKYBLUE.withAlpha(.5)}}):setTimeout(function(){n.append(e,!0)},100),e.circleShow&&(e.circleSize=e.circleSize||120,this._viewer.entities.add({id:e.id+"_2",name:"椭圆",position:P.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new P.CallbackProperty(function(){return.001},!1),semiMajorAxis:new P.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_one"])||"static/data/images/Textures/circle2.png",rotation:new P.CallbackProperty(function(){return o+=.05},!1),stRotation:new P.CallbackProperty(function(){return o+=.05},!1),zIndex:2}}),this._viewer.entities.add({id:e.id+"_3",name:"椭圆",position:P.Cartesian3.fromDegrees(t,i),ellipse:{semiMinorAxis:new P.CallbackProperty(function(){return.001},!1),semiMajorAxis:new P.CallbackProperty(function(){return.001},!1),material:this.getDfSt(["plugin","Css3Renderer_two"])||"static/data/images/Textures/circle1.png",rotation:new P.CallbackProperty(function(){return r-=.03},!1),stRotation:new P.CallbackProperty(function(){return r-=.03},!1),zIndex:3}}))},P.Scene.Css3Renderer=e)}};let M=null;function re(e,t,i){e&&(M=t,this._analysisLayer=new M.CustomDataSource("analysisLayer"),this.$math3d=new H(e,t),this.$graphics=new h(e,t),e)&&e.dataSources.add(this._analysisLayer)}function ae(e){if(e&&e.positions){var t=e.positions,i=e.that,n=[],e=[],o=[],r=i.transformWGS84ToCartesian(t[0]),t=i.transformWGS84ToCartesian(t[1]),n=i.$graphics.createPointsGraphics({point:!0,positions:[r,t]}),a=i.$math3d.getIntersectObj(r,t,n,!0);if(0===a.length)return alert("没有取到相交点 , 请检查是否开启深度检测。"),!1;for(let e=a.length-1;0<=e;e--){const l=a[e];M.defined(l.position)||a.splice(e,1)}if(!M.defined(a[0].position))throw new M.DeveloperError("position is undefined");var s=a[0].position,l=M.Cartesian3.distance(s,t)<5,s=[r,a[0].position],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:M.ArcType.NONE,material:new M.PolylineArrowMaterialProperty(M.Color.GREEN)}});e.push(s),l||(s=[a[0].position,t],s=i._analysisLayer.entities.add({polyline:{positions:s,width:10,arcType:M.ArcType.NONE,material:new M.PolylineArrowMaterialProperty(M.Color.RED)}}),e.push(s));for(let e=0;e<a.length;++e){var c,h=a[e].object;h&&(h instanceof M.Cesium3DTileFeature?(o.push(h),h.oldColor=h.color.clone(),h.color=M.Color.fromAlpha(M.Color.YELLOW,h.color.alpha)):h.id instanceof M.Entity&&(c=(h=h.id).polygon||h.polyline,o.push(h),h=c.material.color.getValue(),c.oldColor=h.clone(),c.material=M.Color.fromAlpha(M.Color.YELLOW,h.alpha))),n.push(i._analysisLayer.entities.add({position:a[e].position,ellipsoid:{radii:new M.Cartesian3(.8,.8,.8),material:M.Color.RED}}))}var s=M.Cartographic.fromCartesian(r),e=M.Cartographic.fromCartesian(t),s={longitude:s.longitude/Math.PI*180,latitude:s.latitude/Math.PI*180,height:s.height},e={longitude:e.longitude/Math.PI*180,latitude:e.latitude/Math.PI*180,height:e.height},r=Math.sqrt(Math.pow(r.x-t.x,2)+Math.pow(r.y-t.y,2)+Math.pow(r.z-t.z,2)),t=Math.abs(e.height-s.height),u=Math.sqrt(Math.pow(r,2)+Math.pow(t,2)),l=l?"是":"否",s="起点坐标: ("+s.longitude.toFixed(6)+"°,"+s.latitude.toFixed(6)+"°,"+s.height.toFixed(2)+")\n终点坐标: ("+e.longitude.toFixed(6)+"°,"+e.latitude.toFixed(6)+"°,"+e.height.toFixed(2)+")\n垂直距离: "+t.toFixed(2)+"m\n水平距离: "+r.toFixed(2)+"m\n空间距离: "+u.toFixed(2)+"m\n是否可视: "+l;n&&n[0]&&(n[0].label={text:s,showBackground:!0,font:"14px monospace",fillColor:M.Color.YELLOW,pixelOffset:{x:0,y:-20},verticalOrigin:M.VerticalOrigin.BOTTOM,horizontalOrigin:M.HorizontalOrigin.LEFT})}ae.prototype.remove=function(){}}function se(e){if(!e&&!e.center&&!e.radius&&e.that)return alert("没有获取到分析参数"),!1;var l=e.that,t=this;if(!l._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;var c=e.viewHeight||10,i=M.Cartographic.fromCartesian(e.center);try{var n=e.radius,o={},r=(o.semiMinorAxis=n,o.semiMajorAxis=n,o.rotation=0,o.center=e.center,o.granularity=Math.PI/45,l.computeEllipseEdgePositions(o));for(let e=0;e<r.outerPositions.length;e+=3){var a=new M.Cartesian3(r.outerPositions[e],r.outerPositions[e+1],r.outerPositions[e+2]),s=M.Cartographic.fromCartesian(a),h=5e-5*Math.PI/180,u=l.computeInterpolateLineCartographic(i,s,h);l.computeCartographicPointsTerrainData(u,function(r){if(0<r.length){let i=!0,n=[],o=[];for(let e=1;e<r.length;e++){let t=!0;if(1<e){var a=new M.Cartographic(r[0].longitude,r[0].latitude,r[0].height+c);if(i)t=l.computeInterpolateIndexLineHeightCartographic(a,r[e],e,e-1).height>=r[e-1].height?i=!0:i=!1;else{var s=l.computeInterpolateIndexLineHeightCartographic(a,r[e],e,e-1);for(let e=0;e<s.length;e++){if(!(s[e].height>=r[e].height)){i=!1,t=!1;break}i=!0,t=!0}}}a=M.Cartesian3.fromRadians(r[e].longitude,r[e].latitude,r[e].height+1);n.push(a),t?(o.push(0),o.push(0),o.push(1)):(o.push(1),o.push(0),o.push(0)),o.push(1)}t._pointsKSYResult=new M.Scene.PointsPrimitive({viewer:l._viewer,Cartesians:n,Colors:o})}else alert("高程异常!")})}}catch(e){console.log(e)}se.prototype.remove=function(){}}function le(e){if(e&&e.positions){for(var t=e.positions,i=e.that,n=i.transformWGS84ToCartesian(t[0]),o=i.transformWGS84ToCartesian(t[1]),r=[M.Cartographic.fromCartesian(n)],a=new M.Cartesian3,s=[0],l=[0],c=1;c<=10;c++){M.Cartesian3.lerp(n,o,c/10,a);var h=M.Cartographic.fromCartesian(a),u=i._viewer.scene.globe.getHeight(h),u=(h.height=u,r.push(h),r[c-1]),d=M.Cartesian3.distance(M.Cartographic.toCartesian(u),M.Cartographic.toCartesian(h));l.push(l[c-1]+d),h=Math.asin((h.height-u.height)/d),s.push(100*Math.tan(h))}e=document.createElement("div");e.className="echart-viewer",i._viewer.container.appendChild(e,"dark",{renderer:"canvas",width:640,height:480}),e.style.position="absolute",e.style.left="20px",e.style.bottom="20px",e.style.height="300px",e.style.width="640px",e.style.overflow="hidden",e.style.zIndex="9999",e.style.opacity=.9,p.init(e).setOption({title:{text:"剖面示意图",left:"center",subtext:"",textStyle:{color:"white",fontSize:15}},tooltip:{trigger:"axis"},legend:{data:[""]},toolbox:{show:!1,feature:{mark:{show:!0},dataView:{show:!0,readOnly:!1},magicType:{show:!0,type:["line","bar"]},restore:{show:!0},saveAsImage:{show:!0}}},calculable:!0,xAxis:[{type:"category",name:"长度(米)",boundaryGap:!1,data:l,axisLabel:{textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],yAxis:[{type:"value",name:"坡度(%)",axisLabel:{formatter:function(e){return e.toFixed(2)+"%"},textStyle:{color:"white"}},axisLine:{lineStyle:{color:"white"}}}],series:[{name:"坡度",type:"line",areaStyle:{},smooth:!0,data:s,markPoint:{data:[{type:"max",name:"最大值"},{type:"min",name:"最小值"}]},markLine:{data:[{type:"average",name:"平均值"}]}}]})}}function ce(e){if(e&&e.positions&&e.that){var t=e.that,i=e.positions,e=this,n=t._viewer.terrainProvider.availability;if(n){for(var o=15e3,r=0;r<i.length;r++){var a=M.Cartographic.fromCartesian(i[r]),s=t._viewer.scene.globe.getHeight(a);s<o&&(o=s),n.computeMaximumLevelAtPosition(a)}var l=Math.PI/Math.pow(2,11);l/=64;for(var c,h,u,d,p,m,f,g,l=new M.PolygonGeometry.fromPositions({positions:i,vertexFormat:M.PerInstanceColorAppearance.FLAT_VERTEX_FORMAT,granularity:l}),v=new M.PolygonGeometry.createGeometry(l),y=0,_=0,w=new M.Cartesian3,r=0;r<v.indices.length;r+=3){c=v.indices[r],h=v.indices[r+1],p=v.indices[r+2],m=v.attributes.position.values,w.x=m[3*c],w.y=m[3*c+1],w.z=m[3*c+2],a=M.Cartographic.fromCartesian(w),c=t._viewer.scene.globe.getHeight(a),u=M.Cartesian3.fromRadians(a.longitude,a.latitude,c),g=M.Cartesian3.fromRadians(a.longitude,a.latitude,0),_<c&&(_=c),w.x=m[3*h],w.y=m[3*h+1],w.z=m[3*h+2],a=M.Cartographic.fromCartesian(w),h=t._viewer.scene.globe.getHeight(a),d=M.Cartesian3.fromRadians(a.longitude,a.latitude,h),P=M.Cartesian3.fromRadians(a.longitude,a.latitude,0),_<h&&(_=h),w.x=m[3*p],w.y=m[3*p+1],w.z=m[3*p+2],a=M.Cartographic.fromCartesian(w),m=t._viewer.scene.globe.getHeight(a),p=M.Cartesian3.fromRadians(a.longitude,a.latitude,m),_<m&&(_=m),g=g,P=P,f=M.Cartesian3.fromRadians(a.longitude,a.latitude,0),0,g=((C=M.Cartesian3.distance(g,P))+(P=M.Cartesian3.distance(P,f))+(f=M.Cartesian3.distance(f,g)))/2,y+=Math.sqrt(g*(g-C)*(g-P)*(g-f))*(c-o+h-o+m-o)/3;var C=[],P=(C.push(u),C.push(d),C.push(p),{polygon:{hierarchy:{positions:C},extrudedHeight:0,perPositionHeight:!0,material:M.Color.fromRandom().withAlpha(.5),outline:!0,closeTop:!0,closeBottom:!0,outlineColor:M.Color.WHITE,outlineWidth:2}});t._analysisLayer.entities.add(P)}l=function(e){for(var t=[],i=[],n=0;n<e.length;n++){var o=M.Cartographic.fromCartesian(e[n]);t.push(o.longitude),i.push(o.latitude)}for(var r,a,s,l=0,c=0,h=0,u=0,d=0,n=0;n<e.length;n++)h+=s=(r=t[n])*(c=n==e.length-1?(l=t[0],i[0]):(l=t[n+1],i[n+1]))-l*(a=i[n]),u+=(r+l)*s,d+=(a+c)*s;return u/=6*(h*=.5),d/=6*h,new M.Cartographic(u,d)}(i),e._volumeLabel=t._analysisLayer.entities.add({position:M.Cartesian3.fromRadians(l.longitude,l.latitude,_+1e3),label:{text:"Cut Volume "+y.toString()+"m3"}})}else alert("未获取到地形")}}re.prototype={createVisibilityAnalysis:function(i){i=i||{};var n=this;n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new ae({positions:e,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(t),"function"==typeof i.callback&&i.callback(e)}})},createLookAroundAnalysis:function(i){var n;i=i||{},this._viewer&&i&&(n=this).drawCircleGraphics({callback:function(e,t){n._drawLayer.entities.remove(t);t=new se({that:n,radius:e.radius,center:e.center});"function"==typeof i.callback&&i.callback(t)}})},createVisualFieldAnalysis:function(e){var i,n;e=e||{},this._viewer&&e&&(n=null,(i=this).bindHandelEvent({leftClick:function(e,t){e=i._viewer.scene.pickPosition(e.position);if(!e)return!1;M.defined(n)?t.destroy():(n=new M.Scene.ShadowPrimitive({scene:i._viewer.scene,viewerPosition:e}),i._analysisLayer._primitives.add(n))},mouseMove:function(e){e=i._viewer.scene.pickPosition(e.endPosition);if(!e)return!1;n&&n.setPoseByTargetPoint(e)}}))},createClipPlanAnalysis:function(i){var n,o,r,a,s;i=i||{},this._viewer&&i&&(n=this,o=i.height||30,r=i.splitNum||50,a=i.wallImg||this.getDfSt(["amalysis","createClipPlanAnalysis_wallImg"])||"static/data/images/file/excavate_side_min.jpg",s=i.bottomImg||this.getDfSt(["amalysis","createClipPlanAnalysis_bottomImg"])||"static/data/images/file/excavate_bottom_min.jpg",n.drawPolygonGraphics({callback:function(e,t){n._drawLayer.entities.remove(t);t=new M.Scene.TerrainClipPlan(n._viewer,{height:o,splitNum:r,wallImg:a,bottomImg:s}),e=n.transformWGS84ArrayToCartesianArray(e);t.updateData(e),"function"==typeof i.callback&&i.callback(t)}}))},createSubmergedAnalysis:function(e){var t,n,o,r,a;e=e||{},this._viewer&&e&&(n=e.maxH||15,o=e.speed||1,r=e.interval||10,a=(t=this).getDfSt(["amalysis","createSubmergedAnalysis"])||"static/data/images/file/water.png",t.drawPolygonGraphics({height:1,callback:function(e,i){if(!t._viewer.scene.globe.depthTestAgainstTerrain)return alert("请开启深度检测"),!1;i&&setTimeout(()=>{i.polygon.heightReference="CLAMP_TO_GROUND",i.polygon.material=a;var e=0,t=(i.polygon.extrudedHeight=e,setInterval(function(){(e+=o)>=n&&(e=n,clearTimeout(t)),i.polygon.extrudedHeight=e},r))},2e3)}}))},createSlopeAnalysis:function(i){if(i=i||{},!p)return alert("需要引入echarts库"),!1;var n=this;this._viewer&&i&&n.drawLineGraphics({type:"straightLine",clampToGround:!1,callback:function(e,t){e=new le({positions:e,that:n});n._graphicsLayer&&n._graphicsLayer.entities.remove(t),"function"==typeof i.callback&&i.callback(e)}})},createCutVolumeAnalysis:function(t){var i;t=t||{},this._viewer&&t&&(i=this).drawWallGraphics({callback:function(e){e=new ce({positions:i.transformWGS84ArrayToCartesianArray(e,100),that:i});"function"==typeof t.callback&&t.callback(e)}})}};var b={version:"1.0.0",PlotUtils:{}},T=(b.PlotUtils.distance=function(e,t){return Math.sqrt(Math.pow(e[0]-t[0],2)+Math.pow(e[1]-t[1],2))},b.PlotUtils.wholeDistance=function(e){for(var t=0,i=0;i<e.length-1;i++)t+=b.PlotUtils.distance(e[i],e[i+1]);return t},b.PlotUtils.getBaseLength=function(e){return Math.pow(b.PlotUtils.wholeDistance(e),.99)},b.PlotUtils.mid=function(e,t){return[(e[0]+t[0])/2,(e[1]+t[1])/2]},b.PlotUtils.getCircleCenterOfThreePoints=function(e,t,i){var n=[(e[0]+t[0])/2,(e[1]+t[1])/2],t=[n[0]-e[1]+t[1],n[1]+e[0]-t[0]],o=[(e[0]+i[0])/2,(e[1]+i[1])/2],e=[o[0]-e[1]+i[1],o[1]+e[0]-i[0]];return b.PlotUtils.getIntersectPoint(n,t,o,e)},b.PlotUtils.getIntersectPoint=function(e,t,i,n){var o,r,a;return e[1]==t[1]?[(o=(n[0]-i[0])/(n[1]-i[1]))*(e[1]-i[1])+i[0],r=e[1]]:i[1]==n[1]?[(a=(t[0]-e[0])/(t[1]-e[1]))*(i[1]-e[1])+e[0],r=i[1]]:(a=(t[0]-e[0])/(t[1]-e[1]),o=(n[0]-i[0])/(n[1]-i[1]),[a*(r=(a*e[1]-e[0]-o*i[1]+i[0])/(a-o))-a*e[1]+e[0],r])},b.PlotUtils.getAzimuth=function(e,t){var i,n=Math.asin(Math.abs(t[1]-e[1])/b.PlotUtils.distance(e,t));return t[1]>=e[1]&&t[0]>=e[0]?i=n+Math.PI:t[1]>=e[1]&&t[0]<e[0]?i=b.Constants.TWO_PI-n:t[1]<e[1]&&t[0]<e[0]?i=n:t[1]<e[1]&&t[0]>=e[0]&&(i=Math.PI-n),i},b.PlotUtils.getAngleOfThreePoints=function(e,t,i){e=b.PlotUtils.getAzimuth(t,e)-b.PlotUtils.getAzimuth(t,i);return e<0?e+b.Constants.TWO_PI:e},b.PlotUtils.isClockWise=function(e,t,i){return(i[1]-e[1])*(t[0]-e[0])>(t[1]-e[1])*(i[0]-e[0])},b.PlotUtils.getPointOnLine=function(e,t,i){return[t[0]+e*(i[0]-t[0]),t[1]+e*(i[1]-t[1])]},b.PlotUtils.getCubicValue=function(e,t,i,n,o){var r=1-(e=Math.max(Math.min(e,1),0)),a=e*e,s=a*e,l=r*r,c=l*r;return[c*t[0]+3*l*e*i[0]+3*r*a*n[0]+s*o[0],c*t[1]+3*l*e*i[1]+3*r*a*n[1]+s*o[1]]},b.PlotUtils.getThirdPoint=function(e,t,i,n,o){e=b.PlotUtils.getAzimuth(e,t),o=o?e+i:e-i,e=n*Math.cos(o),i=n*Math.sin(o);return[t[0]+e,t[1]+i]},b.PlotUtils.getArcPoints=function(e,t,i,n){for(var o=[],r=(r=n-i)<0?r+b.Constants.TWO_PI:r,a=0;a<=b.Constants.FITTING_COUNT;a++){var s=i+r*a/b.Constants.FITTING_COUNT,l=e[0]+t*Math.cos(s),s=e[1]+t*Math.sin(s);o.push([l,s])}return o},b.PlotUtils.getBisectorNormals=function(e,t,i,n){var o,r,a=b.PlotUtils.getNormal(t,i,n),s=Math.sqrt(a[0]*a[0]+a[1]*a[1]),l=a[0]/s,a=a[1]/s,c=b.PlotUtils.distance(t,i),h=b.PlotUtils.distance(i,n),s=s>b.Constants.ZERO_TOLERANCE?b.PlotUtils.isClockWise(t,i,n)?(o=[i[0]-(r=e*c)*a,i[1]+r*l],[i[0]+(r=e*h)*a,i[1]-r*l]):(o=[i[0]+(r=e*c)*a,i[1]-r*l],[i[0]-(r=e*h)*a,i[1]+r*l]):(o=[i[0]+e*(t[0]-i[0]),i[1]+e*(t[1]-i[1])],[i[0]+e*(n[0]-i[0]),i[1]+e*(n[1]-i[1])]);return[o,s]},b.PlotUtils.getNormal=function(e,t,i){var n=e[0]-t[0],e=e[1]-t[1],o=Math.sqrt(n*n+e*e),o=(n/=o,e/=o,i[0]-t[0]),i=i[1]-t[1],t=Math.sqrt(o*o+i*i);return[n+(o/=t),e+(i/=t)]},b.PlotUtils.getCurvePoints=function(e,t){for(var i=[b.PlotUtils.getLeftMostControlPoint(t)],n=0;n<t.length-2;n++)var o=t[n],r=t[n+1],a=t[n+2],a=b.PlotUtils.getBisectorNormals(e,o,r,a),i=i.concat(a);for(var s=b.PlotUtils.getRightMostControlPoint(t),l=(i.push(s),[]),n=0;n<t.length-1;n++){for(o=t[n],r=t[n+1],l.push(o),e=0;e<b.Constants.FITTING_COUNT;e++){var c=b.PlotUtils.getCubicValue(e/b.Constants.FITTING_COUNT,o,i[2*n],i[2*n+1],r);l.push(c)}l.push(r)}return l},b.PlotUtils.getLeftMostControlPoint=function(e){var i,n,o,r,a,s=e[0],l=e[1],e=e[2],c=b.PlotUtils.getBisectorNormals(0,s,l,e)[0],e=b.PlotUtils.getNormal(s,l,e),e=Math.sqrt(e[0]*e[0]+e[1]*e[1])>b.Constants.ZERO_TOLERANCE?(e=b.PlotUtils.mid(s,l),o=s[0]-e[0],i=s[1]-e[1],n=2/b.PlotUtils.distance(s,l),r=c[0]-e[0],c=c[1]-e[1],a=e[0]+((i=-n*i)*i-(n=n*o)*n)*r+(o=2*i*n)*c,e[1]+o*r+(n*n-i*i)*c):(a=s[0]+t*(l[0]-s[0]),s[1]+t*(l[1]-s[1]));return[a,e]},b.PlotUtils.getRightMostControlPoint=function(e){var i,n,o,r,a,s=e.length,l=e[s-3],c=e[s-2],e=e[s-1],s=b.PlotUtils.getBisectorNormals(0,l,c,e)[1],l=b.PlotUtils.getNormal(l,c,e),l=Math.sqrt(l[0]*l[0]+l[1]*l[1])>b.Constants.ZERO_TOLERANCE?(l=b.PlotUtils.mid(c,e),o=e[0]-l[0],i=e[1]-l[1],n=2/b.PlotUtils.distance(c,e),r=s[0]-l[0],s=s[1]-l[1],a=l[0]+((i=-n*i)*i-(n=n*o)*n)*r+(o=2*i*n)*s,l[1]+o*r+(n*n-i*i)*s):(a=e[0]+t*(c[0]-e[0]),e[1]+t*(c[1]-e[1]));return[a,l]},b.PlotUtils.getBezierPoints=function(e){if(e.length<=2)return e;for(var t=[],i=e.length-1,n=0;n<=1;n+=.01){for(var o=0,r=0,a=0;a<=i;a++){var s=b.PlotUtils.getBinomialFactor(i,a),l=Math.pow(n,a),c=Math.pow(1-n,i-a);o+=s*l*c*e[a][0],r+=s*l*c*e[a][1]}t.push([o,r])}return t.push(e[i]),t},b.PlotUtils.getBinomialFactor=function(e,t){return b.PlotUtils.getFactorial(e)/(b.PlotUtils.getFactorial(t)*b.PlotUtils.getFactorial(e-t))},b.PlotUtils.getFactorial=function(e){if(e<=1)return 1;if(2==e)return 2;if(3==e)return 6;if(4==e)return 24;if(5==e)return 120;for(var t=1,i=1;i<=e;i++)t*=i;return t},b.PlotUtils.getQBSplinePoints=function(e){if(e.length<=2)return e;var t=[],i=e.length-2-1;t.push(e[0]);for(var n=0;n<=i;n++)for(var o=0;o<=1;o+=.05){for(var r=0,a=0,s=0;s<=2;s++){var l=b.PlotUtils.getQuadricBSplineFactor(s,o);r+=l*e[n+s][0],a+=l*e[n+s][1]}t.push([r,a])}return t.push(e[e.length-1]),t},b.PlotUtils.getQuadricBSplineFactor=function(e,t){return 0==e?Math.pow(t-1,2)/2:1==e?(-2*Math.pow(t,2)+2*t+1)/2:2==e?Math.pow(t,2)/2:0},b.Constants={TWO_PI:2*Math.PI,HALF_PI:Math.PI/2,FITTING_COUNT:100,ZERO_TOLERANCE:1e-4},{version:"1.0.0",createTime:"2018.6.19",author:"xupinhui"}),he="doublearrow",ue={headHeightFactor:.18,headWidthFactor:.3,neckHeightFactor:.85,neckWidthFactor:.15,tailWidthFactor:.1,headTailFactor:.8,swallowTailFactor:1},de={tailWidthFactor:.15,neckWidthFactor:.2,headWidthFactor:.25,headAngle:Math.PI/8.5,neckAngle:Math.PI/13};T.algorithm={},T.algorithm.doubleArrow=function(e,t){this.connPoint=null;var i={controlPoint:this.tempPoint4=null,polygonalPoint:null};if(!((a=(this.points=e).length)<2)){if(2==a)return e;var n=this.points[0],o=this.points[1],r=this.points[2],a=e.length,a=(this.tempPoint4=3==a?T.algorithm.getTempPoint4(n,o,r):this.points[3],this.connPoint=3==a||4==a?b.PlotUtils.mid(n,o):this.points[4],e=b.PlotUtils.isClockWise(n,o,r)?(h=T.algorithm.getArrowPoints(n,this.connPoint,this.tempPoint4,!1),T.algorithm.getArrowPoints(this.connPoint,o,r,!0)):(h=T.algorithm.getArrowPoints(o,this.connPoint,r,!1),T.algorithm.getArrowPoints(this.connPoint,n,this.tempPoint4,!0)),h.length),s=(a-5)/2,l=h.slice(0,s),c=h.slice(s,5+s),h=h.slice(5+s,a),u=e.slice(0,s),d=e.slice(s,5+s),e=e.slice(5+s,a),u=b.PlotUtils.getBezierPoints(u),s=b.PlotUtils.getBezierPoints(e.concat(l.slice(1))),h=b.PlotUtils.getBezierPoints(h),a=u.concat(d,s,c,h),e=T.algorithm.array2Dto1D(a);i.controlPoint=[n,o,r,this.tempPoint4,this.connPoint],i.polygonalPoint=t.Cartesian3.fromDegreesArray(e)}return i},T.algorithm.threeArrow=function(e){this.connPoint=null,this.tempPoint4=null;var t={controlPoint:this.tempPoint5=null,polygonalPoint:null};if(2<=(r=(this.points=e).length)){if(2==r)return e;var i=this.points[0],n=this.points[1],o=this.points[2],r=(3==(r=e.length)?(this.tempPoint4=T.algorithm.getTempPoint4(i,n,o),this.tempPoint5=b.PlotUtils.mid(o,this.tempPoint4)):(this.tempPoint4=this.points[3],this.tempPoint5=this.points[4]),this.connPoint=r<6?b.PlotUtils.mid(i,n):this.points[5],e=b.PlotUtils.isClockWise(i,n,o)?(c=T.algorithm.getArrowPoints(i,this.connPoint,this.tempPoint4,!1),T.algorithm.getArrowPoints(this.connPoint,n,o,!0)):(c=T.algorithm.getArrowPoints(n,this.connPoint,o,!1),T.algorithm.getArrowPoints(this.connPoint,i,this.tempPoint4,!0)),c.length),a=(r-5)/2,s=c.slice(0,a),l=c.slice(a,5+a),c=c.slice(5+a,r),h=e.slice(0,a),u=e.slice(a,5+a),e=e.slice(5+a,r),h=b.PlotUtils.getBezierPoints(h),a=b.PlotUtils.getBezierPoints(e.concat(s.slice(1))),c=b.PlotUtils.getBezierPoints(c),r=h.concat(u,a,l,c),e=T.algorithm.array2Dto1D(r);t.controlPoint=[i,n,o,this.tempPoint4,this.tempPoint5,this.connPoint],t.polygonalPoint=Cesium.Cartesian3.fromDegreesArray(e)}return t},T.algorithm.array2Dto1D=function(e){var t=[];return e.forEach(function(e){t.push(e[0]),t.push(e[1])}),t},T.algorithm.getArrowPoints=function(e,t,i,n){this.type=he,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var o=b.PlotUtils.mid(e,t),r=b.PlotUtils.distance(o,i),a=b.PlotUtils.getThirdPoint(i,o,0,.3*r,!0),s=b.PlotUtils.getThirdPoint(i,o,0,.5*r,!0),a=[o,b.PlotUtils.getThirdPoint(o,a,b.Constants.HALF_PI,r/5,n),b.PlotUtils.getThirdPoint(o,s,b.Constants.HALF_PI,r/4,n),i],o=T.algorithm.getArrowHeadPoints(a,this.headHeightFactor,this.headWidthFactor,this.neckHeightFactor,this.neckWidthFactor),s=o[0],r=o[4],n=b.PlotUtils.distance(e,t)/b.PlotUtils.getBaseLength(a)/2,i=T.algorithm.getArrowBodyPoints(a,s,r,n),a=i.length,n=i.slice(0,a/2),i=i.slice(a/2,a);return n.push(s),i.push(r),(n=n.reverse()).push(t),(i=i.reverse()).push(e),n.reverse().concat(o,i)},T.algorithm.getArrowHeadPoints=function(e,t,i){this.type=he,this.headHeightFactor=.25,this.headWidthFactor=.3,this.neckHeightFactor=.85,this.neckWidthFactor=.15;var n=b.PlotUtils.getBaseLength(e)*this.headHeightFactor,o=e[e.length-1],t=(b.PlotUtils.distance(t,i),n*this.headWidthFactor),i=n*this.neckWidthFactor,r=n*this.neckHeightFactor,n=b.PlotUtils.getThirdPoint(e[e.length-2],o,0,n,!0),e=b.PlotUtils.getThirdPoint(e[e.length-2],o,0,r,!0),r=b.PlotUtils.getThirdPoint(o,n,b.Constants.HALF_PI,t,!1),n=b.PlotUtils.getThirdPoint(o,n,b.Constants.HALF_PI,t,!0);return[b.PlotUtils.getThirdPoint(o,e,b.Constants.HALF_PI,i,!1),r,o,n,b.PlotUtils.getThirdPoint(o,e,b.Constants.HALF_PI,i,!0)]},T.algorithm.getArrowBodyPoints=function(e,t,i,n){for(var o=b.PlotUtils.wholeDistance(e),r=b.PlotUtils.getBaseLength(e)*n,a=(r-b.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=b.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(r/2-(s+=b.PlotUtils.distance(e[h-1],e[h]))/o*a)/Math.sin(u),p=b.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=b.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},T.algorithm.getTempPoint4=function(e,t,i){var n,o,r,t=b.PlotUtils.mid(e,t),a=b.PlotUtils.distance(t,i),i=b.PlotUtils.getAngleOfThreePoints(e,t,i),a=i<b.Constants.HALF_PI?(n=a*Math.sin(i),o=a*Math.cos(i),r=b.PlotUtils.getThirdPoint(e,t,b.Constants.HALF_PI,n,!1),b.PlotUtils.getThirdPoint(t,r,b.Constants.HALF_PI,o,!0)):i>=b.Constants.HALF_PI&&i<Math.PI?(n=a*Math.sin(Math.PI-i),o=a*Math.cos(Math.PI-i),r=b.PlotUtils.getThirdPoint(e,t,b.Constants.HALF_PI,n,!1),b.PlotUtils.getThirdPoint(t,r,b.Constants.HALF_PI,o,!1)):i>=Math.PI&&i<1.5*Math.PI?(n=a*Math.sin(i-Math.PI),o=a*Math.cos(i-Math.PI),r=b.PlotUtils.getThirdPoint(e,t,b.Constants.HALF_PI,n,!0),b.PlotUtils.getThirdPoint(t,r,b.Constants.HALF_PI,o,!0)):(n=a*Math.sin(2*Math.PI-i),o=a*Math.cos(2*Math.PI-i),r=b.PlotUtils.getThirdPoint(e,t,b.Constants.HALF_PI,n,!0),b.PlotUtils.getThirdPoint(t,r,b.Constants.HALF_PI,o,!1));return a},T.algorithm.tailedAttackArrow=function(e,t){e=T.algorithm.dereplication(e),this.tailWidthFactor=ue.tailWidthFactor,this.swallowTailFactor=ue.swallowTailFactor,this.swallowTailPnt=ue.swallowTailPnt;var i={controlPoint:null,polygonalPoint:null};if(!((i.controlPoint=e).length<2)){if(2==e.length)return i.polygonalPoint=e,i;var n=e[0],o=e[1],e=(b.PlotUtils.isClockWise(e[0],e[1],e[2])&&(n=e[1],o=e[0]),[b.PlotUtils.mid(n,o)].concat(e.slice(2))),r=T.algorithm.getAttackArrowHeadPoints(e,n,o,ue),a=r[0],s=r[4],l=b.PlotUtils.distance(n,o),c=b.PlotUtils.getBaseLength(e),h=c*this.tailWidthFactor*this.swallowTailFactor;this.swallowTailPnt=b.PlotUtils.getThirdPoint(e[1],e[0],0,h,!0);h=T.algorithm.getAttackArrowBodyPoints(e,a,s,l/c),e=h.length,l=[n].concat(h.slice(0,e/2));l.push(a);c=[o].concat(h.slice(e/2,e));c.push(s),l=b.PlotUtils.getQBSplinePoints(l),c=b.PlotUtils.getQBSplinePoints(c),n=T.algorithm.array2Dto1D(l.concat(r,c.reverse(),[this.swallowTailPnt,l[0]])),i.polygonalPoint=t.Cartesian3.fromDegreesArray(n)}return i},T.algorithm.getAttackArrowHeadPoints=function(e,t,i,n){this.headHeightFactor=n.headHeightFactor,this.headTailFactor=n.headTailFactor,this.headWidthFactor=n.headWidthFactor,this.neckWidthFactor=n.neckWidthFactor,this.neckHeightFactor=n.neckHeightFactor;var n=b.PlotUtils.getBaseLength(e)*this.headHeightFactor,o=e[e.length-1],r=b.PlotUtils.distance(o,e[e.length-2]),t=b.PlotUtils.distance(t,i),i=(n=n>t*this.headTailFactor?t*this.headTailFactor:n)*this.headWidthFactor,t=n*this.neckWidthFactor,r=(n=r<n?r:n)*this.neckHeightFactor,n=b.PlotUtils.getThirdPoint(e[e.length-2],o,0,n,!0),e=b.PlotUtils.getThirdPoint(e[e.length-2],o,0,r,!0),r=b.PlotUtils.getThirdPoint(o,n,b.Constants.HALF_PI,i,!1),n=b.PlotUtils.getThirdPoint(o,n,b.Constants.HALF_PI,i,!0);return[b.PlotUtils.getThirdPoint(o,e,b.Constants.HALF_PI,t,!1),r,o,n,b.PlotUtils.getThirdPoint(o,e,b.Constants.HALF_PI,t,!0)]},T.algorithm.getAttackArrowBodyPoints=function(e,t,i,n){for(var o=b.PlotUtils.wholeDistance(e),r=b.PlotUtils.getBaseLength(e)*n,a=(r-b.PlotUtils.distance(t,i))/2,s=0,l=[],c=[],h=1;h<e.length-1;h++){var u=b.PlotUtils.getAngleOfThreePoints(e[h-1],e[h],e[h+1])/2,d=(r/2-(s+=b.PlotUtils.distance(e[h-1],e[h]))/o*a)/Math.sin(u),p=b.PlotUtils.getThirdPoint(e[h-1],e[h],Math.PI-u,d,!0),u=b.PlotUtils.getThirdPoint(e[h-1],e[h],u,d,!1);l.push(p),c.push(u)}return l.concat(c)},T.algorithm.dereplication=function(e){var t=e[e.length-1],i=!1,n=[],n=e.filter(function(e){if(e[0]!=t[0]&&e[1]!=t[1])return e;i=!0});return i&&n.push(t),n},T.algorithm.fineArrow=function(e,t,i){var n,o,r,a,s,l,c;if(!(e.length<2||t.length<2))return n=de.tailWidthFactor,c=de.neckWidthFactor,s=de.headWidthFactor,a=de.headAngle,l=de.neckAngle,(o=[])[0]=e,o[1]=t,e=o[0],t=o[1],c=(o=b.PlotUtils.getBaseLength(o))*c,s=o*s,n=b.PlotUtils.getThirdPoint(t,e,b.Constants.HALF_PI,o=o*n,!0),o=b.PlotUtils.getThirdPoint(t,e,b.Constants.HALF_PI,o,!1),r=b.PlotUtils.getThirdPoint(e,t,a,s,!1),a=b.PlotUtils.getThirdPoint(e,t,a,s,!0),s=b.PlotUtils.getThirdPoint(e,t,l,c,!1),l=b.PlotUtils.getThirdPoint(e,t,l,c,!0),(c=[]).push(n[0],n[1],s[0],s[1],r[0],r[1],t[0],t[1],a[0],a[1],l[0],l[1],o[0],o[1],e[0],e[1]),c.some(e=>isNaN(e))?"":i.Cartesian3.fromDegreesArray(c)};let pe=null;function i(e,t){this.viewer=e,pe=t,this.handler=new pe.ScreenSpaceEventHandler(this.viewer.scene.canvas),this.fillMaterial=pe.Color.RED.withAlpha(.5),this.positions=[],this.state=-1,this.floatPoint=null,this.arrowEntity=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null,this.xp=T}i.prototype.clear=function(){this.state=0,this.firstPoint&&this.viewer.entities.remove(this.firstPoint),this.floatPoint&&this.viewer.entities.remove(this.floatPoint),this.arrowEntity&&this.viewer.entities.remove(this.arrowEntity),this.state=-1},i.prototype.disableHandler=function(){this.handler&&(this.handler.destroy(),this.handler=new pe.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null)};let E=null;function I(e,t){i.call(this,e,t),E=t,this.type="AttackArrow",this.fillMaterial=E.Color.RED.withAlpha(.5)}function me(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}I.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new E.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler||(this.handler=new E.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.handler.setInputAction(function(e){(e=me(e.position,i.viewer))&&(0==i.positions.length&&(i.floatPoint=i.creatPoint(e),i.floatPoint.wz=-1),i.positions.push(e),e=i.creatPoint(e),2<i.positions.length?e.wz=i.positions.length-1:e.wz=i.positions.length,i.pointArr.push(e))},E.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!i.floatPoint||i.positions.length<2||(e=me(e.endPosition,i.viewer))&&(i.floatPoint.position.setValue(e),2<=i.positions.length)&&(E.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),i.arrowEntity.objId=i.objId,t&&t(i.objId)))},E.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){if(e=me(e.position,i.viewer)){for(var t=0;t<i.pointArr.length;t++)i.pointArr[t].show=!1;i.floatPoint.show=!1,i.viewer.entities.remove(i.floatPoint),i.floatPoint=null;e=i.creatPoint(e);e.show=!1,e.wz=i.positions.length,i.pointArr.push(e),i.positions=[],i.pointArr=[],i.arrowEntity=null}},E.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var n=E.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}for(this.positions=t,i=0;i<this.positions.length;i++){var o=this.creatPoint(this.positions[i]);o.show=!1,o.wz=i+1,this.pointArr.push(o)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new E.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=n.viewer.scene.pick(e.position);if(E.defined(t)&&t.id)n.clickStep++,t.id.objId||(n.selectPoint=t.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.floatPoint&&(n.floatPoint.show=!1),n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,t=me(e.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.selectPoint=null)},E.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){(e=me(e.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.positions[n.selectPoint.wz-1]=e)},E.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){e=this.viewer.entities.add({position:e,point:{pixelSize:10,color:E.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(r){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new E.PolygonGraphics({hierarchy:new E.CallbackProperty(function(){if(r.length<3)return null;for(var e=[],t=0;t<r.length;t++){var i=a.cartesianToLatlng(r[t]);e.push(i)}var n=a.xp.algorithm.tailedAttackArrow(e,E),o=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(o=n.polygonalPoint),new E.PolygonHierarchy(o)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=E.Math.toDegrees(e.latitude);return[E.Math.toDegrees(e.longitude),t]}},(I.prototype=Object.create(Object.assign({},I.prototype,i.prototype))).constructor=I;let L=null;function D(e,t){i.call(this,e,t),L=t,this.type="StraightArrow",this.fillMaterial=L.Color.fromCssColorString("#0000FF").withAlpha(.8)}function fe(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}D.prototype={disable:function(){this.positions=[],this.firstPoint&&(this.viewer.entities.remove(this.firstPoint),this.firstPoint=null),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new L.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null),this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var i=this;this.state=1,this.handler.setInputAction(function(e){(e=fe(e.position,i.viewer))&&(0==i.positions.length&&(i.firstPoint=i.creatPoint(e),i.firstPoint.type="firstPoint",i.floatPoint=i.creatPoint(e),i.floatPoint.type="floatPoint",i.positions.push(e)),i.firstPoint.position.setValue(e),i.firstPoint.show=!0,i.positions&&3==i.positions.length&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null),i.positions.push(e.clone()))},L.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){i.positions.length<1||(e=fe(e.endPosition,i.viewer))&&(i.floatPoint.position.setValue(e),2<=i.positions.length)&&(L.defined(i.arrowEntity)?(i.positions.pop(),i.positions.push(e)):(i.positions.push(e),i.arrowEntity=i.showArrowOnMap(i.positions),t&&t(i.objId)))},L.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){(e=fe(e.position,i.viewer))&&(i.firstPoint.show=!1,i.positions=[],i.pointArr=[],i.arrowEntity=null,i.positions.push(e.clone()))},L.ScreenSpaceEventType.RIGHT_CLICK)},startModify:function(){this.state=2,this.firstPoint.show=!0,this.floatPoint.show=!0;var i=this;this.clickStep=0,this.modifyHandler||(this.modifyHandler=new L.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=i.viewer.scene.pick(e.position);L.defined(t)&&t.id?(i.clickStep++,t.id.objId||(i.selectPoint=t.id)):(i.modifyHandler.destroy(),i.modifyHandler=null,i.firstPoint.show=!1,i.floatPoint.show=!1,i.state=-1),2==i.clickStep&&(i.clickStep=0,t=fe(e.position,i.viewer))&&i.selectPoint&&(i.selectPoint.position.setValue(t),i.selectPoint=null)},L.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){i.selectPoint&&(e=fe(e.endPosition,i.viewer))&&(i.selectPoint.position.setValue(e),"firstPoint"==i.selectPoint.type&&(i.positions[1]=e),"floatPoint"==i.selectPoint.type)&&(i.positions[2]=e)},L.ScreenSpaceEventType.MOUSE_MOVE)},createByData:function(e){this.state=-1,this.positions=[];for(var t=[],i=0;i<e.length;i++){var n=L.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}this.positions=t,this.firstPoint=this.creatPoint(this.positions[1]),this.firstPoint.type="firstPoint",this.floatPoint=this.creatPoint(this.positions[2]),this.floatPoint.type="floatPoint",this.arrowEntity=this.showArrowOnMap(this.positions),this.firstPoint.show=!1,this.floatPoint.show=!1,this.arrowEntity.objId=this.objId},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){e=this.viewer.entities.add({position:e,point:{pixelSize:10,color:L.Color.YELLOW}});return e.attr="editPoint",e},showArrowOnMap:function(a){var s=this;return this.viewer.entities.add({id:s.objId,polygon:new L.PolygonGraphics({hierarchy:new L.CallbackProperty(function(){if(a.length<2)return null;var e=a[1],t=a[2],e=s.cartesianToLatlng(e),t=s.cartesianToLatlng(t),i=[],n=s.xp.algorithm.fineArrow([e[0],e[1]],[t[0],t[1]],L);if(-1!=JSON.stringify(n).indexOf("null"))return[];for(var o=0;o<n.length;o++){var r=new L.Cartesian3(n[o].x,n[o].y,n[o].z);i.push(r)}return new L.PolygonHierarchy(i)},!1),show:!0,fill:!0,material:s.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=L.Math.toDegrees(e.latitude);return[L.Math.toDegrees(e.longitude),t]}},(D.prototype=Object.create(Object.assign({},D.prototype,i.prototype))).constructor=D;let k=null;function ge(e,t){i.call(this,e,t),k=t,this.type="PincerArrow",this.fillMaterial=k.Color.YELLOW.withAlpha(.8)}function ve(e,t){e=t.camera.getPickRay(e);return e?t.scene.globe.pick(e,t.scene):null}ge.prototype={disable:function(){this.positions=[],this.arrowEntity&&(this.viewer.entities.remove(this.arrowEntity),this.arrowEntity=null),this.state=-1,this.handler&&(this.handler.destroy(),this.handler=new k.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.floatPoint&&(this.viewer.entities.remove(this.floatPoint),this.floatPoint=null),this.selectPoint&&(this.viewer.entities.remove(this.selectPoint),this.selectPoint=null);for(var e=0;e<this.pointArr.length;e++)this.pointArr[e]&&this.viewer.entities.remove(this.pointArr[e]);this.modifyHandler&&(this.modifyHandler.destroy(),this.modifyHandler=null),this.clickStep=0},startDraw:function(t){this.objId=Number((new Date).getTime()+""+Number(1e3*Math.random()).toFixed(0));var n=this;this.state=1,this.handler.setInputAction(function(e){if(e=ve(e.position,n.viewer))if(0==n.positions.length&&(n.floatPoint=n.creatPoint(e)),4<n.positions.length){(i=n.creatPoint(e)).wz=n.positions.length,n.pointArr.push(i);for(var t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!1;n.floatPoint&&(n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null),n.positions=[],n.pointArr=[],n.arrowEntity=null}else{n.positions.push(e);var i=n.creatPoint(e);2<n.positions.length?i.wz=n.positions.length-1:i.wz=n.positions.length,n.pointArr.push(i)}},k.ScreenSpaceEventType.LEFT_CLICK),this.handler.setInputAction(function(e){!n.floatPoint||n.positions.length<2||(e=ve(e.endPosition,n.viewer))&&(n.floatPoint.position.setValue(e),2<=n.positions.length)&&(k.defined(n.arrowEntity)?(n.positions.pop(),n.positions.push(e)):(n.positions.push(e),n.arrowEntity=n.showArrowOnMap(n.positions),n.arrowEntity.objId=n.objId,t&&t(n.objId)))},k.ScreenSpaceEventType.MOUSE_MOVE),this.handler.setInputAction(function(e){if(4<=n.positions.length&&(e=ve(e.position,n.viewer))){for(var t=0;t<n.pointArr.length;t++)n.pointArr[t].show=!1;n.floatPoint.show=!1,n.viewer.entities.remove(n.floatPoint),n.floatPoint=null;e=n.creatPoint(e);e.show=!1,e.wz=n.positions.length,n.pointArr.push(e),n.positions=[],n.pointArr=[],n.arrowEntity=null}},k.ScreenSpaceEventType.RIGHT_CLICK)},createByData:function(e){this.positions=[],this.state=-1,this.floatPoint=null,this.pointArr=[],this.selectPoint=null,this.clickStep=0,this.modifyHandler=null;for(var t=[],i=0;i<e.length;i++){var n=k.Cartesian3.fromDegrees(e[i][0],e[i][1]);t.push(n)}for(this.positions=t,i=0;i<this.positions.length;i++){var o=this.creatPoint(this.positions[i]);o.show=!1,o.wz=i+1,this.pointArr.push(o)}this.arrowEntity=this.showArrowOnMap(this.positions),this.arrowEntity.objId=this.objId},startModify:function(){this.state=2;for(var n=this,e=0;e<n.pointArr.length;e++)n.pointArr[e].show=!0;this.modifyHandler||(this.modifyHandler=new k.ScreenSpaceEventHandler(this.viewer.scene.canvas)),this.modifyHandler.setInputAction(function(e){var t=n.viewer.scene.pick(e.position);if(k.defined(t)&&t.id)n.clickStep++,t.id.objId||(n.selectPoint=t.id);else{for(var i=0;i<n.pointArr.length;i++)n.pointArr[i].show=!1;n.state=-1,n.modifyHandler.destroy(),n.modifyHandler=null}2==n.clickStep&&(n.clickStep=0,t=ve(e.position,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(t),n.selectPoint=null)},k.ScreenSpaceEventType.LEFT_CLICK),this.modifyHandler.setInputAction(function(e){(e=ve(e.endPosition,n.viewer))&&n.selectPoint&&(n.selectPoint.position.setValue(e),n.positions[n.selectPoint.wz-1]=e)},k.ScreenSpaceEventType.MOUSE_MOVE)},getLnglats:function(){for(var e=[],t=0;t<this.positions.length;t++){var i=this.cartesianToLatlng(this.positions[t]);e.push(i)}return e},getPositions:function(){return this.positions},creatPoint:function(e){return this.viewer.entities.add({position:e,point:{pixelSize:10,color:k.Color.YELLOW}})},showArrowOnMap:function(r){var a=this;return this.viewer.entities.add({id:a.objId,polygon:new k.PolygonGraphics({hierarchy:new k.CallbackProperty(function(){if(r.length<3)return null;for(var e=[],t=0;t<r.length;t++){var i=a.cartesianToLatlng(r[t]);e.push(i)}var n=a.xp.algorithm.doubleArrow(e,k),o=[];return-1==JSON.stringify(n.polygonalPoint).indexOf("null")&&(o=n.polygonalPoint),new k.PolygonHierarchy(o)},!1),show:!0,fill:!0,material:a.fillMaterial})})},cartesianToLatlng:function(e){var e=this.viewer.scene.globe.ellipsoid.cartesianToCartographic(e),t=k.Math.toDegrees(e.latitude);return[k.Math.toDegrees(e.longitude),t]}},(ge.prototype=Object.create(Object.assign({},ge.prototype,i.prototype))).constructor=ge;class r{constructor(e){return this.init(e)}init({cesiumGlobal:e,containerId:t,viewerConfig:i={},extraConfig:n={},MapImageryList:o=[],defaultStatic:r,baseExtendsCom:a=[],extendsCom:s,extendsComName:l}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";if(t)return{viewer:t=new F(e).init({containerId:t,viewerConfig:i,extraConfig:n,MapImageryList:o}),[l]:this.prototypeExtends(t,e,r)(a,s)};throw"Missing containerId parameter, please check the calling function initCesium."}prototypeExtends(n,r,a){return function(e,o){var t=null;function i(e){for(var t=Object.keys(e.prototype),i=0,n=t.length;i<n;i++)o.prototype[t[i]]=e.prototype[t[i]]}return Array.isArray(e)?(e.forEach(e=>{i(e)}),t=new o(n,r,a),e.forEach(e=>{e.call(t,n,r,a)})):(i(e),t=new o(n,r,a),e.call(t,n,r,a)),t}}}class ye extends r{constructor(e){return super({...e,baseExtendsCom:[u,H,N],extendsCom:W,extendsComName:"draw"})}}class _e extends r{constructor(e){return super({...e,baseExtendsCom:u,extendsCom:ie,extendsComName:"customCesiumPlugin"})}}e.Analysis=class extends r{constructor(e){return super({...e,baseExtendsCom:[u,W,oe],extendsCom:re,extendsComName:"analysis"})}},e.CustomCesiumPlugin=class{constructor(e){return new _e(e)}},e.Draw=class{constructor(e){var t=new ye(e);return this._initCurrMeasure(e,t)}_initCurrMeasure(e,t){var i=new I(t.viewer,e.cesiumGlobal),n=new D(t.viewer,e.cesiumGlobal),e=new ge(t.viewer,e.cesiumGlobal);return{...t,attackArrowObj:i,straightArrowObj:n,pincerArrowObj:e}}},e.Graphics=class extends r{constructor(e){return super({...e,baseExtendsCom:u,extendsCom:h,extendsComName:"graphics"})}},e.Material=class extends r{constructor(e){return super({...e,baseExtendsCom:[u,O],extendsCom:G,extendsComName:"material"})}},e.PassEffect=class extends r{constructor(e){return super({...e,baseExtendsCom:[u,O],extendsCom:j,extendsComName:"passEffect"})}},e.Plugin=class extends r{constructor(e){return super({...e,baseExtendsCom:[u,h],extendsCom:oe,extendsComName:"plugin"})}},e.Primitive=class extends r{constructor(e){return super({...e,baseExtendsCom:u,extendsCom:U,extendsComName:"primitive"})}},e.initCesium=function({cesiumGlobal:e,containerId:t,viewerConfig:i={},extraConfig:n={},MapImageryList:o=[],defaultStatic:r}){if(!e)throw"Missing cesiumGlobal parameter, please check the calling function initCesium.";var a,s,l;if(t)return t=new F(e).init({containerId:t,viewerConfig:i,extraConfig:n,MapImageryList:o}),s=e,l=r,{viewer:a=t,material:(i=function(e,o){var t=null;function i(e){for(var t=Object.keys(e.prototype),i=0,n=t.length;i<n;i++)o.prototype[t[i]]=e.prototype[t[i]]}return Array.isArray(e)?(e.forEach(e=>{i(e)}),t=new o(a,s,l),e.forEach(e=>{e.call(t,a,s,l)})):(i(e),t=new o(a,s,l),e.call(t,a,s,l)),t})([u,O],G),graphics:i(u,h),math3d:i(u,H),primitive:i(u,U),draw:i([u,H,N],W),passEffect:i([u,O],j),customCesiumPlugin:i(u,ie),control:i(u,ne),plugin:i([u,h],oe),base:new u(t,e),analysis:i([u,W,oe],re),attackArrowObj:new I(t,e),straightArrowObj:new D(t,e),pincerArrowObj:new ge(t,e)};throw"Missing containerId parameter, please check the calling function initCesium."},Object.defineProperty(e,"__esModule",{value:!0})});