@arcgis/core 4.34.0-next.28 → 4.34.0-next.29
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/applications/Components/featureUtils.d.ts +6 -0
- package/applications/Components/featureUtils.js +5 -0
- package/arcade/arcade.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/functions/feature.js +1 -1
- package/arcade/functions/track.js +5 -0
- package/arcade/treeAnalysis.js +1 -1
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/086f3bc5938bf9a37274.js +1 -0
- package/assets/esri/core/workers/chunks/{7e5d3735a9c718591d64.js → 22f38cad0213f2112394.js} +1 -1
- package/assets/esri/core/workers/chunks/{746c78e1c84f9612d69b.js → 2f54776ff86f397adc55.js} +1 -1
- package/assets/esri/core/workers/chunks/{edfd8b482182803b44ca.js → 2fdf457786d2d5d7414f.js} +1 -1
- package/assets/esri/core/workers/chunks/5192f38682f1f9be7da0.js +1 -0
- package/assets/esri/core/workers/chunks/{7ee50f75914d8d650af4.js → 63cb3dcd359e96733b1b.js} +1 -1
- package/assets/esri/core/workers/chunks/{e49a95f2126ef9a994d3.js → 6ccd6171d3c572883034.js} +1 -1
- package/assets/esri/core/workers/chunks/89999baefa341bd3329c.js +1 -0
- package/assets/esri/core/workers/chunks/{629a924e99d5d6eb1998.js → 90a9b618058dc41294de.js} +1 -1
- package/assets/esri/core/workers/chunks/98f6d4ea026ed96fd3f3.js +1 -0
- package/assets/esri/core/workers/chunks/d3b1d1c389d70919fb02.js +1 -0
- package/assets/esri/core/workers/chunks/db81d881805f6f92a2e4.js +1 -0
- package/assets/esri/core/workers/chunks/e89698fc404379627349.js +1 -0
- package/assets/esri/core/workers/chunks/{0254ef9fb7f8ebb25304.js → ecc15622d6c434ea842b.js} +1 -1
- package/assets/esri/core/workers/chunks/{aa781b28dbe457427afc.js → fb71e533995c54cd806f.js} +1 -1
- package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
- package/chunks/GeodeticDistanceCalculator-Ce-woMPw.js +1 -1
- package/chunks/OperatorGeodesicBuffer.js +1 -1
- package/chunks/OperatorGeodeticArea.js +1 -1
- package/chunks/OperatorGeodeticLength.js +1 -1
- package/chunks/OperatorProximityGeodesic.js +1 -1
- package/chunks/OperatorShapePreservingLength.js +1 -1
- package/chunks/OperatorShapePreservingProject.js +1 -1
- package/chunks/Terrain.glsl.js +11 -11
- package/chunks/UnitFactory.js +1 -1
- package/chunks/arcade.js +1 -1
- package/chunks/bundle.js +1 -1
- package/config.js +1 -1
- package/geometry/operators/gx/operatorGeodeticDistance.js +1 -1
- package/interfaces.d.ts +80 -2
- package/kernel.js +1 -1
- package/layers/IntegratedMesh3DTilesLayer.js +1 -1
- package/layers/ParquetLayer.js +1 -1
- package/layers/graphics/sources/ParquetSource.js +1 -1
- package/layers/orientedImagery/core/ExposurePoint.js +1 -1
- package/layers/orientedImagery/transformations/imageToWorld.js +1 -1
- package/layers/orientedImagery/transformations/rectifyMapPoint.js +1 -1
- package/layers/orientedImagery/transformations/utils.js +1 -1
- package/layers/orientedImagery/transformations/worldToImage.js +1 -1
- package/layers/support/ParquetEncodingWkb.js +1 -1
- package/layers/support/layerUtils.js +1 -1
- package/layers/support/parquetUtils.js +1 -1
- package/libs/parquet/parquet.js +1 -1
- package/package.json +2 -2
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/layers/FeatureLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/processor/FeatureUpdateStrategy.js +1 -1
- package/views/2d/layers/features/sources/FeatureSource.js +1 -1
- package/views/2d/layers/features/sources/strategies/ALoadStrategy.js +1 -1
- package/views/2d/layers/features/sources/strategies/ParquetSnapshotLoadStrategy.js +5 -0
- package/views/2d/layers/features/sources/strategies/ParquetTileLoadStrategy.js +5 -0
- package/views/2d/layers/features/sources/strategies/chunks/FeatureSourceEndChunk.js +5 -0
- package/views/2d/layers/features/sources/strategies/chunks/ParquetSourceChunk.js +5 -0
- package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
- package/views/2d/layers/features/support/FeatureSetReaderParquet.js +1 -1
- package/views/2d/layers/features/support/XZOrder.js +5 -0
- package/views/3d/terrain/TerrainRenderer.js +1 -1
- package/views/3d/webgl-engine/shaders/{ReadShadowMapConfiguration.js → ReceiveShadowsConfiguration.js} +1 -1
- package/views/draw/support/ConnectedReshapeManager.js +5 -0
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/layerUtils.js +1 -1
- package/widgets/Feature/support/arcadeFeatureUtils.js +1 -1
- package/widgets/Feature/support/featureUtils.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewer.js +1 -1
- package/widgets/OrientedImageryViewer/components/ImageViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/navigation/NavigationManager.js +1 -1
- package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
- package/widgets/PanoramicViewer.js +1 -1
- package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.js +1 -1
- package/assets/esri/core/workers/chunks/16ff0bf4cb74f478ec1e.js +0 -1
- package/assets/esri/core/workers/chunks/1aff43dad2302677b4f4.js +0 -1
- package/assets/esri/core/workers/chunks/c6be02d2dff6e0734dab.js +0 -1
- package/assets/esri/core/workers/chunks/c8719205518e97131375.js +0 -1
- package/views/2d/layers/features/sources/strategies/ParquetLoadStrategy.js +0 -5
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import i from"../../Camera.js";import t from"../../Ground.js";import a from"../../Map.js";import o from"../../request.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import n from"../../core/Evented.js";import{JSONMap as h}from"../../core/jsonMap.js";import{rad2deg as m,deg2rad as l}from"../../core/mathUtils.js";import{destroyMaybe as d}from"../../core/maybe.js";import{isAbortError as c,waitTick as p}from"../../core/promiseUtils.js";import{watch as g,syncAndInitial as u,when as _}from"../../core/reactiveUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as y}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as f}from"../../core/accessorSupport/decorators/subclass.js";import w from"../../geometry/SpatialReference.js";import M from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as R}from"../../layers/orientedImagery/transformations/utils.js";import V from"../../views/SceneView.js";import{logAndThrow as z,getMissingPropertyErrorName as C,getMissingPropertyErrorMessage as P}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as j,maxPanoramicViewerHFOV as H,minPanoramicViewerHFOV as O,humanBinocularHFOV as S}from"./constants.js";import b from"./PanoramicZoomConditions.js";import I from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as x,meshToGraphic as k,createImageSphere as G}from"./utils.js";const F={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let A=class extends n.EventedAccessor{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new M({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new a({ground:new t({opacity:0,navigationConstraint:null}),layers:new r([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.imageSize=null,this.imageSource=null,this.navigationManager=null,this.navigationViewModel=null,this.pitch=90,this.state="ready",this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(F.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const i=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],t=e.key;i.includes(t)&&e.stopPropagation()})],F.navigation)},this._addHFOVHandles=()=>{this.removeHandles(F.fovConstraint),this.addHandles(g(()=>[this.maxHFOV,this.minHFOV],()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new b({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},u),F.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new I({view:this.imageRenderer,panoramicZoomConditions:new b({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:i,x:t,y:a}=e;switch(i){case"start":this._startPosition=this._targetPosition={x:t,y:a};break;case"update":this._targetPosition={x:t,y:a},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const i=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});i.results=i.results.filter(e=>"graphic"===e.type&&e.graphic!==this._imageGraphic),this.emit("hittest-response",i)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const i=R(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...i,spatialReference:w.WebMercator});break}}},this._handleWheel=e=>{const i=e.deltaX??e.native.deltaX;e.stopPropagation(),i>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../OrientedImageryViewer/navigation/NavigationManagerPanoramic.js").then(e=>e.default);this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,i)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,i),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(i),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.navigate=async(e,i)=>{const t=this._loadNavigationManager();this.navigationViewModel?.addUpdatingPromise(t);const a=await t;return await a.navigate(e,i)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const i=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(i),!0},this._imageRenderer=new V({map:this._map,viewingMode:"local",camera:{position:j},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:w.WebMercator,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([g(()=>this.imageSource,()=>{this.imageSource&&this.autoLoad&&this._loadWithController()},u),g(()=>this.fov,()=>{this._reloadCamera()},u),g(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},u),g(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},u),_(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},u),g(()=>this.clickAction,e=>{this.removeHandles(F.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},u)],F.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get hfov(){if(!this.camera)return null;const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t,o=Math.atan(a);return 2*m(Math.atan(Math.tan(l(e/2))*Math.sin(o)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,i]}=this.imageRenderer;return x(H,e/i)}get minHFOV(){const{size:[e,i]}=this.imageRenderer;return x(O,e/i)}get vfov(){if(!this.camera)return null;const{fov:e}=this.camera,{size:[i,t]}=this.imageRenderer,a=i/t,o=Math.atan(a);return 2*m(Math.atan(Math.tan(l(e/2))*Math.cos(o)))}async _loadImageInternal(e,i){let t;this.state="image-loading";try{t=(await o(e,{responseType:"image",...i})).data}catch(a){throw c(a)?this.state="image-load-aborted":this.state="image-load-error",a}return this._updateImageSphere(t,i)}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=d(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const i=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,i)),this._startPosition=this._targetPosition}async _updateImageSphere(e,i){await p(i);const{size:[t,a]}=this.imageRenderer;return this._imageGraphic=k(G(e)),this._graphics.add(this._imageGraphic),this.fov=x(S,t/a),this.state="image-loaded",this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):z(this.declaredClass,new s(C("panoramic-viewer"),P("PanoramicViewerViewModel","imageSource")))}};e([v()],A.prototype,"_graphics",void 0),e([v()],A.prototype,"_imageGraphic",void 0),e([v()],A.prototype,"_imageRenderer",void 0),e([v()],A.prototype,"_loadController",void 0),e([v()],A.prototype,"_map",void 0),e([v()],A.prototype,"_zoomViewModel",void 0),e([v({type:Boolean})],A.prototype,"autoLoad",void 0),e([v({type:i})],A.prototype,"camera",null),e([y(new h({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],A.prototype,"clickAction",void 0),e([v({type:Number})],A.prototype,"fov",null),e([v({readOnly:!0})],A.prototype,"hfov",null),e([v({readOnly:!0})],A.prototype,"imageRenderer",null),e([v()],A.prototype,"imageSize",void 0),e([v()],A.prototype,"imageSource",void 0),e([v({readOnly:!0})],A.prototype,"maxHFOV",null),e([v({readOnly:!0})],A.prototype,"minHFOV",null),e([v()],A.prototype,"navigationViewModel",void 0),e([v({type:Number})],A.prototype,"pitch",void 0),e([v()],A.prototype,"state",void 0),e([v({readOnly:!0})],A.prototype,"vfov",null),e([v({type:Number})],A.prototype,"yaw",void 0),A=e([f("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],A);const L=A;export{L as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../../Camera.js";import i from"../../Ground.js";import a from"../../Map.js";import o from"../../request.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import n from"../../core/Evented.js";import{JSONMap as h}from"../../core/jsonMap.js";import{rad2deg as m,deg2rad as d}from"../../core/mathUtils.js";import{destroyMaybe as l}from"../../core/maybe.js";import{isAbortError as c,waitTick as p}from"../../core/promiseUtils.js";import{watch as g,syncAndInitial as u,when as _,whenOnce as y}from"../../core/reactiveUtils.js";import{property as v}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{enumeration as f}from"../../core/accessorSupport/decorators/enumeration.js";import{subclass as w}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as M}from"../../core/support/UpdatingHandles.js";import R from"../../geometry/SpatialReference.js";import V from"../../layers/GraphicsLayer.js";import{convertSphereVertexToPixelLocation as z}from"../../layers/orientedImagery/transformations/utils.js";import C from"../../views/SceneView.js";import{logAndThrow as H,getMissingPropertyErrorName as j,getMissingPropertyErrorMessage as P}from"../OrientedImageryViewer/utils.js";import{defaultImageSphereCenter as O,maxPanoramicViewerHFOV as S,minPanoramicViewerHFOV as I,humanBinocularHFOV as b}from"./constants.js";import x from"./PanoramicZoomConditions.js";import k from"./PanoramicZoomViewModel.js";import{findDiagonalFOV as G,meshToGraphic as F,createImageSphere as A}from"./utils.js";const L={default:"default",navigation:"navigation",fovConstraint:"fov-constraint",clickAction:"image-click-action"};let N=class extends n.EventedAccessor{constructor(e){super(e),this._startPosition=null,this._targetPosition=null,this._graphics=new V({elevationInfo:{mode:"relative-to-ground"}}),this._imageGraphic=null,this._loadController=null,this._map=new a({ground:new i({opacity:0,navigationConstraint:null}),layers:new r([this._graphics])}),this._zoomViewModel=null,this.autoLoad=!1,this.clickAction="none",this.imageSize=null,this.imageSource=null,this.navigationManager=null,this.navigationViewModel=null,this.pitch=90,this.state="ready",this.updatingHandles=new M,this.yaw=0,this._addNavigationHandles=()=>{this.imageRenderer.basemapTerrain.suspended=!0,this.imageRenderer.constraints.tilt.max=180,this.removeHandles(L.navigation),this.addHandles([this.imageRenderer.on("mouse-wheel",this._handleWheel),this.imageRenderer.on("double-click",this._handleDoubleClick),this.imageRenderer.on("drag",this._handleDrag),this.imageRenderer.on("key-down",e=>{const t=["+","-","Shift","_","=","ArrowUp","ArrowDown","ArrowRight","ArrowLeft"],i=e.key;t.includes(i)&&e.stopPropagation()})],L.navigation)},this._addHFOVHandles=()=>{this.removeHandles(L.fovConstraint),this.addHandles(g(()=>[this.maxHFOV,this.minHFOV],()=>{this._zoomViewModel&&(this._zoomViewModel.panoramicZoomConditions=new x({view:this.imageRenderer,maxFOV:this.maxHFOV,minFOV:this.minHFOV}))},u),L.fovConstraint)},this._addZoomHandles=()=>{this._zoomViewModel=new k({view:this.imageRenderer,panoramicZoomConditions:new x({maxFOV:this.maxHFOV,minFOV:this.minHFOV})});const e=this.imageRenderer.ui.find("zoom");e&&(e.viewModel=this._zoomViewModel),this._addHFOVHandles()},this._cancelLoadWithController=()=>{this._loadController?.abort(),this._loadController=null},this._handleDoubleClick=e=>{e.stopPropagation(),e.native.ctrlKey?this._zoomOut():this._zoomIn()},this._handleDrag=e=>{e.stopPropagation();const{action:t,x:i,y:a}=e;switch(t){case"start":this._startPosition=this._targetPosition={x:i,y:a};break;case"update":this._targetPosition={x:i,y:a},this._updateCameraHeadingAndTilt()}},this._handleImageClick=e=>{if("image-loaded"===this.state&&this.imageRenderer.ready)switch(this.clickAction){case"emit":e.stopPropagation(),this.emit("click",e);break;case"hittest":e.stopPropagation(),e.defer(async()=>{const t=await this.imageRenderer.hitTest(e.screenPoint,{include:this._graphics});t.results=t.results.filter(e=>"graphic"===e.type&&e.graphic!==this._imageGraphic),this.emit("hittest-response",t)});break;case"pixel-location":{if(e.stopPropagation(),!this.imageSize||!e.mapPoint)return void this.emit("pixel-location",null);const t=z(e.mapPoint,this.imageSize[0],this.imageSize[1]);this.emit("pixel-location",{...t,spatialReference:R.WebMercator});break}}},this._handleWheel=e=>{const t=e.deltaX??e.native.deltaX;e.stopPropagation(),t>0||e.deltaY>0?this._zoomOut():this._zoomIn()},this._loadNavigationManager=async()=>{if(!this.navigationManager||this.navigationManager?.destroyed){const e=await import("../OrientedImageryViewer/navigation/NavigationManagerPanoramic.js").then(e=>e.default);this.navigationManager=new e({viewModel:this.navigationViewModel})}return this.navigationManager},this._loadWithController=()=>{this._cancelLoadWithController(),this._loadController=new AbortController,this.loadImage(this._loadController)},this._zoomIn=()=>this._zoomViewModel?.zoomIn(),this._zoomOut=()=>this._zoomViewModel?.zoomOut(),this.addGraphic=(e,t)=>"image-loaded"===this.state&&!this._graphics.graphics.includes(e)&&(this._graphics.graphics.add(e,t),!0),this.addManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>!this._graphics.graphics.includes(e));return this._graphics.graphics.addMany(t),!0},this.clearGraphics=()=>{this._graphics.graphics.removeAll()},this.clearImage=()=>{this.imageSize=null,this._removeImageSphere()},this.navigate=async(e,t)=>this.updatingHandles.addPromise(this.navigateInternal(e,t)),this.navigateInternal=async(e,t)=>{const i=await this._loadNavigationManager();return await i.navigate(e,t)},this.removeGraphic=e=>!("image-loaded"!==this.state||!this._graphics.graphics.includes(e))&&(this._graphics.remove(e),!0),this.removeManyGraphics=e=>{if("image-loaded"!==this.state)return!1;const t=e.filter(e=>this._graphics.graphics.includes(e));return this._graphics.removeMany(t),!0},this._imageRenderer=new C({map:this._map,viewingMode:"local",camera:{position:O},environment:{atmosphereEnabled:!1,starsEnabled:!1,lighting:{type:"virtual"}},popupEnabled:!1,spatialReference:R.WebMercator,ui:{components:["zoom"]}})}destroy(){this._imageRenderer.destroy()}initialize(){this.state="initialized",this.addHandles([g(()=>this.imageSource,()=>{this.imageSource&&this.autoLoad&&this._loadWithController()},u),g(()=>this.fov,()=>{this._reloadCamera()},u),g(()=>this.yaw,e=>{this.camera&&(this.camera.heading=e,this._reloadCamera())},u),g(()=>this.pitch,e=>{this.camera&&(this.camera.tilt=e,this._reloadCamera())},u),_(()=>this.imageRenderer.ready,()=>{this._addNavigationHandles(),this._addZoomHandles()},u),g(()=>this.clickAction,e=>{this.removeHandles(L.clickAction),"none"!==e&&this.addHandles(this.imageRenderer.on("click",this._handleImageClick))},u)],L.default)}get camera(){return this.imageRenderer.destroying||this.imageRenderer.destroyed?null:this.imageRenderer.camera}set camera(e){!e||this.imageRenderer.destroying||this.imageRenderer.destroyed||(this.imageRenderer.camera=e.clone())}get fov(){return this.camera?.fov}set fov(e){Number.isFinite(e)&&this._zoomViewModel?.zoomTo(e)}get hfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,a=t/i,o=Math.atan(a);return 2*m(Math.atan(Math.tan(d(e/2))*Math.sin(o)))}get imageRenderer(){return this._imageRenderer}get maxHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?G(S,e/t):S}get minHFOV(){const{size:[e,t]}=this.imageRenderer;return this.imageRenderer.ready?G(I,e/t):I}get updating(){return this.updatingHandles.updating}get vfov(){if(!this.camera||!this.imageRenderer?.ready)return null;const{fov:e}=this.camera,{size:[t,i]}=this.imageRenderer,a=t/i,o=Math.atan(a);return 2*m(Math.atan(Math.tan(d(e/2))*Math.cos(o)))}async _loadImageInternal(e,t){let i;this.state="image-loading";try{i=(await o(e,{responseType:"image",...t})).data}catch(a){throw c(a)?this.state="image-load-aborted":this.state="image-load-error",a}return this._updateImageSphere(i,t)}_reloadCamera(){this.camera=this.camera?.clone()}_removeImageSphere(){this._imageGraphic&&(this._graphics.remove(this._imageGraphic),this._imageGraphic=l(this._imageGraphic)),this.state="ready",this.imageSize=null}_updateCameraHeadingAndTilt(){if(!this._startPosition||!this._targetPosition||!this.camera)return;const e=this.camera.heading+(this._startPosition.x-this._targetPosition.x)/this.imageRenderer.width*this.camera.fov;this.yaw=(e+360)%360;const t=this.camera.tilt-(this._startPosition.y-this._targetPosition.y)/this.imageRenderer.height*this.imageRenderer.camera.tilt;this.pitch=Math.min(179.5,Math.max(.5,t)),this._startPosition=this._targetPosition}async _updateImageSphere(e,t){return await p(t),this._imageGraphic=F(A(e)),this._graphics.add(this._imageGraphic),this.state="image-loaded",y(()=>this.imageRenderer.ready,t).then(()=>{const{size:[e,t]}=this.imageRenderer;this.fov=G(b,e/t)}),this.imageSize=[e.width,e.height],this._imageGraphic.geometry}async loadImage(e){return this._removeImageSphere(),this.imageSource?this._loadImageInternal(this.imageSource,e):H(this.declaredClass,new s(j("panoramic-viewer"),P("PanoramicViewerViewModel","imageSource")))}};e([v()],N.prototype,"_graphics",void 0),e([v()],N.prototype,"_imageGraphic",void 0),e([v()],N.prototype,"_imageRenderer",void 0),e([v()],N.prototype,"_loadController",void 0),e([v()],N.prototype,"_map",void 0),e([v()],N.prototype,"_zoomViewModel",void 0),e([v({type:Boolean})],N.prototype,"autoLoad",void 0),e([v({type:t})],N.prototype,"camera",null),e([f(new h({emit:"emit",hittest:"hittest",none:"none","pixel-location":"pixel-location"}))],N.prototype,"clickAction",void 0),e([v({type:Number})],N.prototype,"fov",null),e([v({readOnly:!0})],N.prototype,"hfov",null),e([v({readOnly:!0})],N.prototype,"imageRenderer",null),e([v()],N.prototype,"imageSize",void 0),e([v()],N.prototype,"imageSource",void 0),e([v({readOnly:!0})],N.prototype,"maxHFOV",null),e([v({readOnly:!0})],N.prototype,"minHFOV",null),e([v()],N.prototype,"navigationViewModel",void 0),e([v({type:Number})],N.prototype,"pitch",void 0),e([v()],N.prototype,"state",void 0),e([v()],N.prototype,"updatingHandles",void 0),e([v()],N.prototype,"updating",null),e([v({readOnly:!0})],N.prototype,"vfov",null),e([v({type:Number})],N.prototype,"yaw",void 0),N=e([w("esri.widgets.PanoramicViewer.PanoramicViewerViewModel")],N);const W=N;export{W as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./OrientedImageryViewer/components/NavigationUI360.js";import{loadSequentialNavigationUIComponents as n,SequentialNavigationUI as s}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import l from"./PanoramicViewer/PanoramicViewerViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as
|
|
5
|
+
import{__decorate as e}from"tslib";import t from"../Camera.js";import{property as i}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import r from"./Widget.js";import a from"./OrientedImageryViewer/components/NavigationUI360.js";import{loadSequentialNavigationUIComponents as n,SequentialNavigationUI as s}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import l from"./PanoramicViewer/PanoramicViewerViewModel.js";import{loadCalciteComponents as p}from"./support/componentsUtils.js";import{globalCss as d}from"./support/globalCss.js";import"./support/widgetUtils.js";import{vmEvent as c}from"./support/decorators/vmEvent.js";import{tsx as u}from"./support/jsxFactory.js";const v="esri-panoramic-viewer";let g=class extends r{constructor(e){super(e),this.navigationEnabled=!1,this.uiStrings=null,this.viewModel=new l,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,t)=>{this.viewModel.addGraphic(e,t)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadImage=e=>this.viewModel.loadImage(e),this.navigate=async(e,t)=>await this.viewModel.navigate(e,t),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return Promise.all([p({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel")}),n()])}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get currentNode(){return this.navigationViewModel?.currentNode}get fov(){return this.camera?.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get imageSource(){return this.viewModel.imageSource}set imageSource(e){this.viewModel.imageSource=e}get navigationMode(){return this.navigationViewModel?.navigationMode}get navigationNodes(){return this.navigationViewModel?.navigationNodes}get navigationViewModel(){return this.viewModel.navigationViewModel}set navigationViewModel(e){this.viewModel.navigationViewModel=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}get _navigationUI(){return u(a,{currentNode:this.currentNode,navigate:this.navigate,nodes:this.navigationNodes})}get _sequentialNavigationUI(){return u(s,{layout:"horizontal",uiStrings:this.uiStrings,onAction:e=>{this.navigate(this.currentNode,e)}})}_renderNavigationUI(){switch(this.navigationMode){case"directional":return this._navigationUI;case"sequential":return this._sequentialNavigationUI;default:return null}}render(){return u("calcite-panel",{loading:this.viewModel.updating},u("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(d.widget,v)}),this.navigationEnabled?this._renderNavigationUI():null)}static{this.vnodeSelector="calcite-panel"}};e([i({type:Boolean})],g.prototype,"autoLoad",null),e([i({type:t})],g.prototype,"camera",null),e([i()],g.prototype,"clickAction",null),e([i()],g.prototype,"currentNode",null),e([i({type:Number})],g.prototype,"fov",null),e([i({readOnly:!0,type:Number})],g.prototype,"hfov",null),e([i()],g.prototype,"icon",null),e([i({readOnly:!0})],g.prototype,"imageRenderer",null),e([i({readOnly:!0})],g.prototype,"imageSize",null),e([i()],g.prototype,"imageSource",null),e([i({type:Boolean})],g.prototype,"navigationEnabled",void 0),e([i()],g.prototype,"navigationMode",null),e([i()],g.prototype,"navigationNodes",null),e([i()],g.prototype,"navigationViewModel",null),e([i({type:Number})],g.prototype,"pitch",null),e([i({readOnly:!0})],g.prototype,"state",null),e([i()],g.prototype,"ui",null),e([i()],g.prototype,"uiStrings",void 0),e([i({readOnly:!0,type:Number})],g.prototype,"vfov",null),e([c(["click","hittest-response","pixel-location"]),i({type:l})],g.prototype,"viewModel",void 0),e([i({type:Number})],g.prototype,"yaw",null),e([i()],g.prototype,"_navigationUI",null),e([i()],g.prototype,"_sequentialNavigationUI",null),g=e([o("esri.widgets.PanoramicViewer")],g);const h=g;export{h as default};
|
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
|
|
4
4
|
*/
|
|
5
|
-
import{__decorate as e}from"tslib";import{id as t}from"../../kernel.js";import r from"../../core/Collection.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import l from"../../core/Logger.js";import{whenOnce as o}from"../../core/reactiveUtils.js";import{property as n}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{isPoint as h,isMultipoint as u}from"../../geometry/support/jsonUtils.js";import{fetchMessageBundle as p}from"../../intl/messages.js";import d from"../../layers/FeatureLayer.js";import g from"../../layers/GraphicsLayer.js";import y from"../../layers/support/CodedValueDomain.js";import{isFeatureLayer as m,isSubtypeSublayer as f,getOwningPortalUrl as w}from"../../layers/support/layerUtils.js";import _ from"../../networks/UtilityNetwork.js";import{getFeaturesFromLayers as b}from"../../networks/support/utils.js";import A from"../../portal/Portal.js";import{hasUserTypeExtension as v}from"../../portal/support/utils.js";import{trace as k}from"../../rest/networks/trace.js";import I from"../../rest/networks/support/TraceLocation.js";import G from"../../rest/networks/support/TraceParameters.js";import{addUniqueLayer as R}from"../../views/draw/support/layerUtils.js";import{GeometryHandler as F}from"./support/GeometryHandler.js";import{GraphicHandler as L,barrierColor as T,startingPointColor as H}from"./support/GraphicHandler.js";import{ResultAreaHandler as N}from"./support/ResultAreaHandler.js";import{UtilityHelper as S}from"./support/UtilityHelper.js";const P=()=>p("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace"),U=()=>p("esri/core/t9n/Units"),V=`utility-network-trace-flags-${Date.now()}`,B=`utility-network-trace-results-${Date.now()}`,C=`utility-network-trace-sketch-${Date.now()}`;function E(e){return e instanceof y}function j(e){return"feature"===e.layer.type||"subtype-group"===e.layer.type}function D(e){return"layer"in e}function O(e){return void 0!==e.layerViews}function M(e){return"graphics"===e.type}function x(e){return"feature"===e.type||"subtype-group"===e.type||"group"===e.type}async function q(e){const t=new d({url:e.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const r=t.version;if(Number(r)<=11.1){const t=await w(e.layerUrl),r=new A({url:t});await r.load();const s=r?.user?.username;return!!s&&v(r,s,"utilityNetwork")}return!0}let z=class extends a.EventedAccessor{constructor(e){super(e),this._activeProgress=!1,this._clickHandler=null,this._flags=[],this._flagId=0,this._geometryHandler=null,this._highlightHandler=[],this._resultAreaHandler=null,this._sketchViewModel=null,this._traceTimeout=6e5,this._utilityHelper=new S,this._validUNLayers=[],this._watchHandler=null,this.traces=[],this.graphicHandler=null,this.defaultGraphicColor={color:[255,255,0,.6],haloOpacity:.9,fillOpacity:.2,hex:"#FFFF00"},this.enableResultArea=!1,this.flags=[],this.gdbVersion="sde.DEFAULT",this.messages=null,this.messagesUnits=null,this.defaultResultAreaProperties={type:"convexhull",distance:10,unit:"meters",areaUnit:"square-meters",color:{color:[255,165,0,.5],haloOpacity:.9,fillOpacity:.2,hex:"#ffa500"},show:!1},this.selectedTraces=[],this.selectOnComplete=!0,this.showGraphicsOnComplete=!0,this.showSelectionAttributes=!0,this.traceResults=[],this.utilityNetwork=null}initialize(){s(l.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this._geometryHandler=new F,this.graphicHandler=new L,this._resultAreaHandler=new N;(async()=>{const[e,t]=await Promise.all([P(),U()]);this.set({messages:e,messagesUnits:t})})()}destroy(){this.view=null}get resultAreaProperties(){return this.defaultResultAreaProperties}set resultAreaProperties(e){this._set("resultAreaProperties",{...this.defaultResultAreaProperties,...e}),this.graphicHandler.addCustomColor(this.resultAreaProperties.color),this.traceResults.forEach(t=>{const r=t.resultArea?.show;t.resultArea={...this.defaultResultAreaProperties,...e},this.removeResultAreaFromMap(t),this.enableResultArea&&this.createResultAreaGraphic(t).then(s=>{if(s){t.resultAreaGraphic=s;const i=e?.show??r;t.resultArea&&(t.resultArea.show=i),i&&this.addResultAreaToMap(t,s)}})})}get state(){return this.view?.ready?"ready":"loading"}get view(){return this._get("view")}set view(e){e&&"2d"!==e.type&&l.getLogger(this).error(new i("view:invalid-view","SceneView is not supported",{view:e})),this._set("view",e),this.utilityNetwork&&this.reset(),this.utilityNetwork=null,this.loadUtilityNetwork().then(e=>{e&&this.selectTracesOnLoad()})}addFlagByHit(e,t){const r=!!this.view&&this.view.popupEnabled,s=e=>{this.view?.popup&&(this.view.popupEnabled=e)};return new Promise((i,a)=>{r&&s(!1),this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",l=>{if("complete"===l.state){const o=this._getGraphicLayer(C);o&&l.graphic&&o.remove(l.graphic),this.queryFlagByHitTest(l,e,t).then(r=>{this.emit("add-flag-complete",{type:e,symbol:t}),i(r)}).catch(r=>{this.emit("add-flag-error",{type:e,symbol:t}),a(r)}).finally(()=>{r&&s(!0),this._clickHandler?.remove()})}}),this._sketchViewModel.create("point"),this.emit("add-flag",{type:e})})}addNonspatialTraceLocation(e,t){const r=this._getDisplayField(e),s=this.utilityNetwork?.getTerminalConfiguration(e),i={terminalId:null,isFilterBarrier:!1,allTerminals:s,selectedTerminals:[s?s.terminals[0].id||null:1],displayValue:r};e.attributes={...e.attributes,...i};const a=e.attributes.hasOwnProperty("GLOBALID")?e.attributes.GLOBALID:e.attributes.globalid;if(!this._flags.some(e=>e.globalId===a&&e.type===t)){const r=this._createFlagProperty(e,t,null);this._flags.push(r),this.emit("add-flag-complete",{type:t})}this.emit("add-flag",{type:t})}async addFlagsOnLoad(){if(this._flags.length>0)return[];await o(()=>null!=this.view&&!this.view.updating);return(await Promise.all(this.flags.map(async e=>{if(!e.mapPoint)return null;const{type:t}=e,r=e.mapPoint.clone(),s="barrier"===t?T:H,i={graphic:this.graphicHandler.makeGraphic(r,s),state:"complete",tool:"point",toolEventInfo:null,type:"create"};try{return await this.queryFlagByHitTest(i,e.type,null),this.emit("add-flag-complete",{type:t}),null}catch(a){return this.emit("add-flag-error",{type:t}),"barrier"===t?"barrier":"starting-point"}}))).filter(e=>!e)}async addResultAreaToMap(e,t){if(this.view)if(e.resultArea.show=!0,t)this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t});else if(e.results){const t=await this.createResultAreaGraphic(e);t&&(e.resultAreaGraphic=t,this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t}))}}async addResultGraphicToView(e,t){const{view:r}=this,{results:s}=e;if(r&&s&&this.utilityNetwork)for(const i in s.aggregatedGeometry)if("line,multipoint,polygon".includes(i)){const a=i,l=s.aggregatedGeometry[a];if(null!=l){l.spatialReference=this.utilityNetwork.spatialReference,e.graphicEnabled=!0;const s=await this._geometryHandler.projectGeometry(l,r.spatialReference),i={globalid:e.trace.globalId};if(null!==s){const e=this.graphicHandler.makeGraphic(s,t.color,i,r.spatialReference);this._getGraphicLayer(B)?.add(e)}}}}addTerminal(e,t){const r=[...this._flags];r.forEach(r=>{r.globalId===t.globalId&&(t.selectedTerminals?.includes(parseInt(e,10))||r.selectedTerminals?.push(parseInt(e,10)))}),this._flags=r}async callTrace(){const e=this.traces.filter(e=>e.selected);return!!e.length&&(this.traceResults.length>0&&this.traceResults.forEach(e=>{this.removeResultGraphicFromView(e)}),this.traceResults=[],this.removeSelection(),await Promise.all(e.map(async(e,t)=>{const r=e,s=new G({gdbVersion:this.utilityNetwork?.gdbVersion,moment:this.utilityNetwork?.historicMoment,namedTraceConfigurationGlobalId:r.globalId,outSpatialReference:null,resultTypes:null,traceType:r.traceType,traceLocations:this._flags,traceConfiguration:null});await this.executeTrace(r,this.utilityNetwork?.networkServiceUrl,s).then(e=>{if(e.hasOwnProperty("results")){const r={...e};if(null!==r.results){r.resultArea={...this.resultAreaProperties};const e=[...r.results.elements];r.results.elements.length=0;const s=new Map;for(const t of e)s.has(t.globalId)||(s.set(t.globalId,!0),r.results.elements.push(t));const i=[...this.traceResults];i.splice(t,0,r),this.traceResults=i,null!==r.results&&(this.selectOnComplete&&this.mergeSelection(!0,r.trace),this.showGraphicsOnComplete&&this.addResultGraphicToView(r,r.graphicColor),this.enableResultArea&&this.createResultAreaGraphic(r).then(e=>{e&&(r.resultAreaGraphic=e,r.resultArea?.show&&this.addResultAreaToMap(r,r.resultAreaGraphic))}))}else{const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}this._activeProgress=!1}else{this._activeProgress=!1;const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}}).catch(e=>{throw this._activeProgress=!1,e})})),!0)}cancelAddFlagByHit(){this._sketchViewModel.cancel()}changeResultAreaColor(e,t){if(!e.resultArea)return;e.resultArea.color=t;const r=this._resultAreaHandler?.changeResultAreaColor(e.trace.globalId,t,this.view.map);e.resultAreaGraphic&&(e.resultAreaGraphic.symbol=r)}changeResultGraphicColor(e,t){const r=[...this.traceResults];r.length>0&&r.forEach(r=>{r.trace.globalId===t.trace.globalId&&(r.graphicColor=e,r.graphicEnabled=!0)}),this.traceResults=r,this.removeResultGraphicFromView(t),this.addResultGraphicToView(t,e)}changeFlagSymbol(e,t){this._flags.length>0&&this._flags.forEach(r=>{r.type===e&&t&&r.mapGraphic&&(r.mapGraphic.symbol=t)})}checkCanTrace(){const e={status:!0,issues:[]},t=this.traces.filter(e=>e.selected);t.length||(e.status=!1,e.issues.push("noTracesSelected"));this._flags.some(e=>"starting-point"===e.type)||(e.status=!1,e.issues.push("noStartingPoints"));return this._flags.filter(e=>null!==e.allTerminals).some(e=>!e.selectedTerminals.length)&&(e.status=!1,e.issues.push("noTerminalSelected")),e}checkSelectionExist(){return this._highlightHandler.some(e=>e)}clearResult(e){if(!this.view)return;let t=this.traceResults;if(t.length>0){const r=t.filter(t=>t.trace.globalId===e.globalId);r.length>0&&(this.removeResultGraphicFromView(r[0]),this.removeResultAreaFromMap(r[0])),t=t.filter(t=>t.trace.globalId!==e.globalId)}this.traceResults=t,0===t.length?(this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]})):this.mergeSelection(!1,e)}createResultAreaGeometries(e,t,r){if(!this.view||!this.resultAreaProperties)return;let s;if(s="convexhull"===this.resultAreaProperties?.type?1===t.length&&(h(t[0])||u(t[0])&&1===t[0].points.length)?this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0):this._resultAreaHandler?.createConvexHull(t,e.resultArea?.distance,e.resultArea?.unit):this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0),!s)return;if(Array.isArray(s)){for(const t of s){const r=this.getResultAreaAttributes(e,t),s=this._resultAreaHandler?.createResultAreaGraphic(t,r,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color);if(s)return s}return}const i=this.getResultAreaAttributes(e,s);return this._resultAreaHandler?.createResultAreaGraphic(s,i,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color)}async createResultAreaGraphic(e){if(e.results){const t=await this._createResultAreaInputGeometry(e.results);if(t.length>0){const r=Array(t.length).fill(e.resultArea?.distance),s=this.createResultAreaGeometries(e,t,r);return this.emit("create-result-area",{graphic:s}),s}}}executeTrace(e,t,r){const s=this._processFlags(r.traceLocations);return r.traceLocations=s,k(t,r,{timeout:this._traceTimeout}).then(t=>({trace:e,results:t,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:"success",date:new Date})).catch(t=>({trace:e,results:null,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:t.message,date:new Date}))}async getNonspatialTraceLocationInitialFeature(){return new Promise((e,t)=>{this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",async r=>{if("complete"!==r.state)return;const s=this._getGraphicLayer(C);s&&r.graphic&&s.remove(r.graphic);const i=this.view?.toScreen(r.graphic?.geometry);if(!i)return;const a=await(this.view?.hitTest(i));if(a?.results.length){const r=a.results.find(e=>"graphic"===e.type&&this.utilityNetwork?.isUtilityLayer(e.layer));r?e(r):t(null)}}),this._sketchViewModel.create("point")})}getResultAreaAttributes(e,r){const{messages:s}=this,i=[],a=[];this._flags.forEach(e=>{const t=e.displayValue?.field+":"+e.displayValue?.value+";"+s.attributeStrings.globalid+":"+e.globalId+";"+s.attributeStrings.terminalid+":"+e.terminalId+";"+s.attributeStrings.x+":"+e.mapPoint?.x+";"+s.attributeStrings.y+":"+e.mapPoint?.y;"starting-point"===e.type?i.push(t):a.push(t)});const l=this.utilityNetwork?this.utilityNetwork.gdbVersion:this.gdbVersion;return{traceId:e.trace.globalId,traceName:e.trace.title,traceDescription:e.trace.description??"",startingPoints:i.toString(),barriers:a.toString(),version:l??void 0,username:t.credentials[0].userId,date:e.date,elementCount:e.results?.elements.length,functionResult:JSON.stringify(e.results?.globalFunctionResults),areaStatistic:r?this._geometryHandler.calculateArea(r,e.resultArea?.areaUnit):0}}getValidSources(){let e=[];const t=this.utilityNetwork?.dataElement?.domainNetworks??[];for(const r of t)e=e.concat(r.junctionSources),e=e.concat(r.edgeSources);return e}groupResultsByNetworkSource(e){return 0===e.length?[]:this._groupBy(e,"networkSourceId")}async loadUtilityNetwork(){const{view:e}=this;if(!e)return null;if(await e.when(),this.utilityNetwork){if(this.utilityNetwork.loaded||await this.utilityNetwork.load(),this.utilityNetwork instanceof _){try{const t=e.map;await t.loadAll()}catch(s){if("layer:unsupported-layer-type"!==s.name)throw s}finally{this._loadUNSupportItems()}return this.utilityNetwork}return null}const t=e.map,r=t.utilityNetworks?.at(0);if(r){if(await r.load(),this.utilityNetwork=r,!await q(r))throw new i("utility-network:no-user-type-extension","User type extension not found");try{await t.loadAll()}catch(s){if("layer:unsupported-layer-type"!==s.name)throw s}finally{this._loadUNSupportItems()}return r}return null}manageFilterBarrier(e,t){const r=[...this._flags];r.forEach(r=>{r.globalId===t.globalId&&"barrier"===t.type&&r.id===t.id&&(r.isFilterBarrier=e)}),this._flags=r}mergeSelection(e,t){let r=[];const s=[...this.traceResults],i=t.globalId;s.forEach(t=>{i===t.trace.globalId&&(t.selectionEnabled=e),t.selectionEnabled&&null!==t.results?.elements&&(r=[...r,...t.results?.elements??[]])}),this.selectResults([...new Set(r)])}async queryFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return null;const s=this.utilityNetwork.getObjectIdsFromElements(e),i={layerUrl:s[0].layerUrl,objectIds:s[0].objectIds,outFields:["*"]},a=t.map?.allTables.toArray().filter(e=>e?.parsedUrl?.path===s[0].layerUrl).filter(m)??[];this._getUniqueMapLayerViews(t).filter(({layer:e})=>e?.parsedUrl?.path===s[0].layerUrl).forEach(({layer:e})=>{"feature"!==e.type&&"subtype-group"!==e.type||a.push(e)});const l=(await Promise.all(a.map(async e=>{const s={layers:new r([e]),layerInfos:[i],returnGeometry:!0,outSpatialReference:t.spatialReference},[a]=await b(s,!1);return a}))).filter(({featureSet:e})=>e.features.length>0);return l.length>0?l:null}queryFlagByHitTest(e,t,r){return this._lookupFlagByHit(e).then(e=>{const{view:s}=this;if(!s)return!1;if(e.length>0){const s=[...this._flags],i=r;return e.forEach(e=>{const r=e.graphic,a=r.attributes.hasOwnProperty("GLOBALID")?r.attributes.GLOBALID:r.attributes.globalid;if(s.filter(e=>e.globalId===a).length<=0){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(V)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}else if(null!==r.attributes.percentAlong){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(V)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}}),this._flags=s,!0}return!1})}removeResultGraphicFromView(e){const{view:t}=this;if(!t)return;const r=this._getGraphicLayer(B)?.graphics;e.graphicEnabled=!1;const s=r?.filter(t=>t.attributes[t.attributes.hasOwnProperty("GLOBALID")?"GLOBALID":"globalid"]===e.trace.globalId);s?.forEach(e=>{this._getGraphicLayer(B)?.remove(e)})}removeFlag(e){const t=this._flags.filter(t=>{if(t.id!==e.id)return t});this._removeGraphic(e),this._flags=t}removeAllResultAreaGraphics(){this._resultAreaHandler?.removeAllResultAreaGraphics(this.view.map)}removeResultAreaFromMap(e){if(e.resultArea){e.resultArea.show=!1;const t=this._resultAreaHandler?.removeResultArea(e.trace.globalId,this.view?.map);t&&this.emit("remove-result-area",{graphic:t})}}removeSelection(){this._highlightHandler.forEach(e=>{e&&e.remove()}),this._highlightHandler=[]}removeTerminal(e,t){const r=[...this._flags];r.forEach(r=>{if(r.globalId===t.globalId&&t.selectedTerminals?.includes(parseInt(e,10))){const s=t.selectedTerminals.indexOf(parseInt(e,10));r.selectedTerminals?.splice(s,1)}}),this._flags=r}removeFlagsOnLoadWatcher(){this._watchHandler&&null!==this._watchHandler&&this._watchHandler.remove()}removeClickHandler(){this._clickHandler&&(this._sketchViewModel.cancel(),this._clickHandler.remove())}reset(){this._flags=[],this.traceResults=[];const e=[...this.traces];e.forEach(e=>{e.selected=!1}),this.traces=e,this.view&&(this._getGraphicLayer(C)?.removeAll(),this._getGraphicLayer(V)?.removeAll(),this._getGraphicLayer(B)?.removeAll(),this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]}),this.emit("reset"))}selectFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return;const r=this.utilityNetwork.getObjectIdsFromElements(e);this._getUniqueMapLayerViews(t).forEach(e=>{D(e)&&e.layer?.parsedUrl?.path===r[0].layerUrl&&j(e)&&this._highlightHandler.push(e.highlight(r[0].objectIds))})}selectResults(e){if(e.length>0){this.removeSelection();const t=this.groupResultsByNetworkSource(e),r=[];for(const e in t)this.selectFeaturesById(t[e]),r.push(this.queryFeaturesById(t[e]));Promise.all(r).then(e=>{this.emit("select-features",{resultSet:e})})}else this.removeSelection(),this.emit("clear-selection",{resultSet:[]})}selectTraces(e,t){const r=[...this.traces];r.forEach(r=>{t===r.globalId&&(r.selected=e)}),this.traces=r}selectTracesOnLoad(){this.utilityNetwork?.hasOwnProperty("sharedNamedTraceConfigurations")&&(this.traces=[...this.utilityNetwork.sharedNamedTraceConfigurations],this.traces.forEach(e=>{e.selected=!1,this.selectedTraces.includes(e.globalId)&&(e.selected=!0)}))}zoomToAsset(e){this.view?.goTo(e).catch(e=>console.error(e))}async _createResultAreaInputGeometry(e){if(null!=e.aggregatedGeometry)return this._geometryHandler.mergeAggregatedToGeometries(e.aggregatedGeometry);const t=this.groupResultsByNetworkSource(e.elements),r=[];for(const s in t)r.push(this.queryFeaturesById(t[s]));try{const e=await Promise.all(r),t=[];for(const r of e)if(r)for(const e of r)for(const r of e.featureSet.features)r.geometry&&t.push(r.geometry);return t}catch{return[]}}_loadUNSupportItems(){if(!this.utilityNetwork)return;const{map:e}=this.view,{messages:t}=this;this._populateOutfields(),this._createGraphicLayer(C),this._createGraphicLayer(V),this._createGraphicLayer(B),this._resultAreaHandler?.createGraphicLayer(e,t?.alertsStrings.genericResultHeader),this._validUNLayers=this._utilityHelper.getValidUtilityNetworkLayers(e,this.utilityNetwork),this._sketchViewModel=this.graphicHandler.initializeSketch(this.view,this._getGraphicLayer(C),this._validUNLayers)}_getUniqueMapLayerViews(e){const t=[],r=e.layerViews.filter(({layer:{type:e}})=>"feature"===e||"group"===e||"subtype-group"===e).toArray(),s=e=>{for(const r of e.layerViews)O(r)?s(r):t.push(r)};return r.forEach(e=>{switch(e.layer.type){case"group":O(e)&&s(e);break;case"subtype-group":t.push(e);break;default:t.some(t=>t.layer.id===e.layer.id)||t.push(e)}}),t}_processFlags(e){const t=[];return e.forEach(e=>{if(null!==e.selectedTerminals&&e.selectedTerminals.length>0)e.selectedTerminals.forEach(r=>{const s=new I({globalId:e.globalId,percentAlong:e.percentAlong,terminalId:r,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(s)});else{const r=new I({globalId:e.globalId,percentAlong:e.percentAlong,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(r)}}),t}_getDisplayField(e){return f(e?.sourceLayer)?this._getDisplayFieldBySublayer(e):this._getDisplayFieldByFeatureLayer(e)}_getDisplayFieldBySublayer(e){let t="",r="";const s=e.sourceLayer;t=this._checkParentForData(s,"displayField");for(const i in e.attributes){const a=i.toLowerCase();a===t?.toLowerCase()?(r=e.attributes[i],"assetgroup"===a||"assettype"===a?r=this._checkSubtype(s,s.subtypeCode):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))}return{field:t,value:r.toString()}}_getDisplayFieldByFeatureLayer(e){const t=e.sourceLayer;let r=t.displayField,s="";for(const i in e.attributes){const a=i.toLowerCase();if(a===r?.toLowerCase())if(s=e.attributes[i],"assetgroup"===a||"assettype"===a){let a=e.attributes[t.typeIdField.toUpperCase()];a||(a=e.attributes[t.typeIdField.toLowerCase()]),r=t.typeIdField,s=this._checkSubtype(t,a),""===r&&(t.templates&&t.templates.length>0?(r=t.templates[0]?.name,s=t.templates[0]?.name):(r=t.displayField,s=e.attributes[i]))}else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t));else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t))}return{field:r,value:s?s.toString():""}}_checkSubtype(e,t){let r=t;if("subtype-sublayer"===e.type){const s=this._checkParentForData(e,"subtypes");s?.length>0&&s.forEach(e=>{e.code===t&&(r=e.name)})}else if(null!=e.types&&e.types.length>0){const s=e.types.filter(e=>e.id===t);s.length>0&&(r=s[0].name)}return r}_checkDomain(e,t,r){let s=r;const i=e.filter(e=>e.name.toLowerCase()===t.toLowerCase());if(i.length>0&&E(i[0].domain)&&i[0].domain?.codedValues){const e=i[0].domain.codedValues.filter(({code:e})=>e===r);e.length>0&&(s=e[0].name)}return s}_checkParentForData(e,t){return e.parent?.[t]??null}_defaultDisplayField(e,t){return e.trim()?e:t.templates&&t.templates?.length>0?t.templates[0].name:t.title}get _uniqueFlagId(){return this._flagId++}_groupBy(e,t){return e.reduce((e,r)=>((e[r[t]]=e[r[t]]||[]).push(r),e),{})}async _lookupFlagByHit(e){const t=e.graphic?.geometry,r=[];if(t&&h(t)&&this.view){const s=this.view.toScreen(t);if(s){const t=await this.view.hitTest(s,{include:this._validUNLayers});if(t?.results.length){const s=t.results.find(e=>null!==e.layer);if(s.graphic?.geometry)if("polyline"===s.graphic.geometry.type){const t={terminalId:null,isFilterBarrier:!1,allTerminals:null,selectedTerminals:null,percentAlong:this._geometryHandler.getPercentageAlong(s.graphic.geometry,e.graphic?.geometry,s.graphic.geometry.spatialReference),displayValue:this._getDisplayField(s.graphic),mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...t},r.push(s)}else if(("point"===s.graphic.geometry.type||"polygon"===s.graphic.geometry.type)&&this.utilityNetwork){const e=this.utilityNetwork.getTerminalConfiguration(s.graphic),t=this._getDisplayField(s.graphic),i={terminalId:e?e.terminals[0].id||null:1,isFilterBarrier:!1,allTerminals:e??null,selectedTerminals:[e?e.terminals[0].id||null:1],percentAlong:null,displayValue:t,mapPoint:s.mapPoint};s.graphic.attributes={...s.graphic.attributes,...i},r.push(s)}}}}return r}_createFlagProperty(e,t,r){const s=new I;s.terminalId=e.attributes.terminalId,s.isFilterBarrier=e.attributes.isFilterBarrier,s.percentAlong=e.attributes.percentAlong,s.globalId=e.attributes.globalid||e.attributes.GLOBALID,s.type=t;const i=s;return i.details=e,i.mapGraphic=r,i.id=this._uniqueFlagId,i.allTerminals=e.attributes.allTerminals,i.selectedTerminals=e.attributes.selectedTerminals,i.displayValue=e.attributes.displayValue,i.mapPoint=e.attributes.mapPoint,i}async _populateOutfields(){if(!this.view)return;const{map:e}=this.view,t=this.getValidSources(),r=e=>{"group"===e.type?e.layers.forEach(e=>{x(e)&&r(e)}):t.some(t=>t.layerId===e.layerId)&&e.fields.some(e=>"assetgroup"===e.name.toLowerCase())&&(e.outFields=["assetgroup","assettype","globalid","objectid"])};for(const s of e.layers)x(s)&&r(s)}_removeGraphic(e){this._getGraphicLayer(V)?.remove(e.mapGraphic)}_createGraphicLayer(e){const{map:t}=this.view;if(!t.findLayerById(e)){const t=new g({id:e,internal:!0,listMode:"hide",title:e});R(this.view,t)}}_getGraphicLayer(e){const{map:t}=this.view;if(t){const r=t.findLayerById(e);if(r&&M(r))return r}return null}};e([n()],z.prototype,"_activeProgress",void 0),e([n()],z.prototype,"_flags",void 0),e([n()],z.prototype,"traces",void 0),e([n()],z.prototype,"defaultGraphicColor",void 0),e([n()],z.prototype,"enableResultArea",void 0),e([n()],z.prototype,"flags",void 0),e([n()],z.prototype,"gdbVersion",void 0),e([n()],z.prototype,"messages",void 0),e([n()],z.prototype,"messagesUnits",void 0),e([n()],z.prototype,"resultAreaProperties",null),e([n()],z.prototype,"selectedTraces",void 0),e([n()],z.prototype,"selectOnComplete",void 0),e([n()],z.prototype,"showGraphicsOnComplete",void 0),e([n()],z.prototype,"showSelectionAttributes",void 0),e([n({readOnly:!0})],z.prototype,"state",null),e([n()],z.prototype,"traceResults",void 0),e([n()],z.prototype,"utilityNetwork",void 0),e([n({value:null})],z.prototype,"view",null),z=e([c("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceViewModel")],z);const $=z;export{$ as default};
|
|
5
|
+
import{__decorate as e}from"tslib";import{id as t}from"../../kernel.js";import r from"../../core/Collection.js";import{deprecatedFunction as s}from"../../core/deprecate.js";import i from"../../core/Error.js";import a from"../../core/Evented.js";import l from"../../core/Logger.js";import{whenOnce as o,once as n}from"../../core/reactiveUtils.js";import{property as c}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{isPoint as u,isMultipoint as p}from"../../geometry/support/jsonUtils.js";import{fetchMessageBundle as d}from"../../intl/messages.js";import g from"../../layers/FeatureLayer.js";import y from"../../layers/GraphicsLayer.js";import m from"../../layers/support/CodedValueDomain.js";import{isFeatureLayer as f,isSubtypeSublayer as w,getOwningPortalUrl as b}from"../../layers/support/layerUtils.js";import _ from"../../networks/UtilityNetwork.js";import{getFeaturesFromLayers as A}from"../../networks/support/utils.js";import v from"../../portal/Portal.js";import{hasUserTypeExtension as k}from"../../portal/support/utils.js";import{trace as I}from"../../rest/networks/trace.js";import F from"../../rest/networks/support/TraceLocation.js";import G from"../../rest/networks/support/TraceParameters.js";import{addUniqueLayer as R}from"../../views/draw/support/layerUtils.js";import{GeometryHandler as L}from"./support/GeometryHandler.js";import{GraphicHandler as T,barrierColor as H,startingPointColor as N}from"./support/GraphicHandler.js";import{ResultAreaHandler as S}from"./support/ResultAreaHandler.js";import{UtilityHelper as P}from"./support/UtilityHelper.js";const U=()=>d("esri/widgets/UtilityNetworkTrace/t9n/UtilityNetworkTrace"),V=()=>d("esri/core/t9n/Units"),B=`utility-network-trace-flags-${Date.now()}`,C=`utility-network-trace-results-${Date.now()}`,E=`utility-network-trace-sketch-${Date.now()}`;function j(e){return e instanceof m}function D(e){return"feature"===e.layer.type||"subtype-group"===e.layer.type}function O(e){return"layer"in e}function M(e){return void 0!==e.layerViews}function x(e){return"graphics"===e.type}function q(e){return"feature"===e.type||"subtype-group"===e.type||"group"===e.type}async function $(e){const t=new g({url:e.networkSystemLayers.dirtyAreasLayerUrl});await t.load();const r=t.version;if(Number(r)<=11.1){const t=await b(e.layerUrl),r=new v({url:t});await r.load();const s=r?.user?.username;return!!s&&k(r,s,"utilityNetwork")}return!0}let z=class extends a.EventedAccessor{constructor(e){super(e),this._activeProgress=!1,this._clickHandler=null,this._flags=[],this._flagId=0,this._geometryHandler=null,this._highlightHandler=[],this._resultAreaHandler=null,this._sketchViewModel=null,this._traceTimeout=6e5,this._utilityHelper=new P,this._validUNLayers=[],this._watchHandler=null,this.traces=[],this.graphicHandler=null,this.defaultGraphicColor={color:[255,255,0,.6],haloOpacity:.9,fillOpacity:.2,hex:"#FFFF00"},this.enableResultArea=!1,this.flags=[],this.gdbVersion="sde.DEFAULT",this.messages=null,this.messagesUnits=null,this.defaultResultAreaProperties={type:"convexhull",distance:10,unit:"meters",areaUnit:"square-meters",color:{color:[255,165,0,.5],haloOpacity:.9,fillOpacity:.2,hex:"#ffa500"},show:!1},this.selectedTraces=[],this.selectOnComplete=!0,this.showGraphicsOnComplete=!0,this.showSelectionAttributes=!0,this.traceResults=[],this.utilityNetwork=null}initialize(){s(l.getLogger(this),"gdbVersion will be removed and the gdbVersion of the UtilityNetwork will be consumed directly.",{replacement:"UtilityNetwork.gdbVersion",version:"4.31"}),this._geometryHandler=new L,this.graphicHandler=new T,this._resultAreaHandler=new S;(async()=>{const[e,t]=await Promise.all([U(),V()]);this.set({messages:e,messagesUnits:t})})()}destroy(){this.view=null}get resultAreaProperties(){return this.defaultResultAreaProperties}set resultAreaProperties(e){this._set("resultAreaProperties",{...this.defaultResultAreaProperties,...e}),this.graphicHandler.addCustomColor(this.resultAreaProperties.color),this.traceResults.forEach(t=>{const r=t.resultArea?.show;t.resultArea={...this.defaultResultAreaProperties,...e},this.removeResultAreaFromMap(t),this.enableResultArea&&this.createResultAreaGraphic(t).then(s=>{if(s){t.resultAreaGraphic=s;const i=e?.show??r;t.resultArea&&(t.resultArea.show=i),i&&this.addResultAreaToMap(t,s)}})})}get state(){return this.view?.ready?"ready":"loading"}get view(){return this._get("view")}set view(e){e&&"2d"!==e.type&&l.getLogger(this).error(new i("view:invalid-view","SceneView is not supported",{view:e})),this._set("view",e),this.utilityNetwork&&this.reset(),this.utilityNetwork=null,this.loadUtilityNetwork().then(e=>{e&&this.selectTracesOnLoad()})}addFlagByHit(e,t){const r=!!this.view&&this.view.popupEnabled,s=e=>{this.view?.popup&&(this.view.popupEnabled=e)};return new Promise((i,a)=>{r&&s(!1),this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",l=>{if("complete"===l.state){const o=this._getGraphicLayer(E);o&&l.graphic&&o.remove(l.graphic),this.queryFlagByHitTest(l,e,t).then(r=>{this.emit("add-flag-complete",{type:e,symbol:t}),i(r)}).catch(r=>{this.emit("add-flag-error",{type:e,symbol:t}),a(r)}).finally(()=>{r&&s(!0),this._clickHandler?.remove()})}}),this._sketchViewModel.create("point"),this.emit("add-flag",{type:e})})}addNonspatialTraceLocation(e,t){const r=this._getDisplayField(e),s=this.utilityNetwork?.getTerminalConfiguration(e),i={terminalId:null,isFilterBarrier:!1,allTerminals:s,selectedTerminals:[s?s.terminals[0].id||null:1],displayValue:r};e.attributes={...e.attributes,...i};const a=e.attributes.hasOwnProperty("GLOBALID")?e.attributes.GLOBALID:e.attributes.globalid;if(!this._flags.some(e=>e.globalId===a&&e.type===t)){const r=this._createFlagProperty(e,t,null);this._flags.push(r),this.emit("add-flag-complete",{type:t})}this.emit("add-flag",{type:t})}async addFlagsOnLoad(){if(this._flags.length>0)return[];await o(()=>null!=this.view&&!this.view.updating);return(await Promise.all(this.flags.map(async e=>{if(!e.mapPoint)return null;const{type:t}=e,r=e.mapPoint.clone(),s="barrier"===t?H:N,i={graphic:this.graphicHandler.makeGraphic(r,s),state:"complete",tool:"point",toolEventInfo:null,type:"create"};try{return await this.queryFlagByHitTest(i,e.type,null),this.emit("add-flag-complete",{type:t}),null}catch(a){return this.emit("add-flag-error",{type:t}),"barrier"===t?"barrier":"starting-point"}}))).filter(e=>!e)}async addResultAreaToMap(e,t){if(this.view)if(e.resultArea.show=!0,t)this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t});else if(e.results){const t=await this.createResultAreaGraphic(e);t&&(e.resultAreaGraphic=t,this._resultAreaHandler?.addResultAreaToMap(t,this.view.map),this.emit("add-result-area",{graphic:t}))}}async addResultGraphicToView(e,t){const{view:r}=this,{results:s}=e;if(r&&s&&this.utilityNetwork)for(const i in s.aggregatedGeometry)if("line,multipoint,polygon".includes(i)){const a=i,l=s.aggregatedGeometry[a];if(null!=l){l.spatialReference=this.utilityNetwork.spatialReference,e.graphicEnabled=!0;const s=await this._geometryHandler.projectGeometry(l,r.spatialReference),i={globalid:e.trace.globalId};if(null!==s){const e=this.graphicHandler.makeGraphic(s,t.color,i,r.spatialReference);this._getGraphicLayer(C)?.add(e)}}}}addTerminal(e,t){const r=[...this._flags];r.forEach(r=>{r.globalId===t.globalId&&(t.selectedTerminals?.includes(parseInt(e,10))||r.selectedTerminals?.push(parseInt(e,10)))}),this._flags=r}async callTrace(){const e=this.traces.filter(e=>e.selected);return!!e.length&&(this.traceResults.length>0&&this.traceResults.forEach(e=>{this.removeResultGraphicFromView(e)}),this.traceResults=[],this.removeSelection(),await Promise.all(e.map(async(e,t)=>{const r=e,s=new G({gdbVersion:this.utilityNetwork?.gdbVersion,moment:this.utilityNetwork?.historicMoment,namedTraceConfigurationGlobalId:r.globalId,outSpatialReference:null,resultTypes:null,traceType:r.traceType,traceLocations:this._flags,traceConfiguration:null});await this.executeTrace(r,this.utilityNetwork?.networkServiceUrl,s).then(e=>{if(e.hasOwnProperty("results")){const r={...e};if(null!==r.results){r.resultArea={...this.resultAreaProperties};const e=[...r.results.elements];r.results.elements.length=0;const s=new Map;for(const t of e)s.has(t.globalId)||(s.set(t.globalId,!0),r.results.elements.push(t));const i=[...this.traceResults];i.splice(t,0,r),this.traceResults=i,null!==r.results&&(this.selectOnComplete&&this.mergeSelection(!0,r.trace),this.showGraphicsOnComplete&&this.addResultGraphicToView(r,r.graphicColor),this.enableResultArea&&this.createResultAreaGraphic(r).then(e=>{e&&(r.resultAreaGraphic=e,r.resultArea?.show&&this.addResultAreaToMap(r,r.resultAreaGraphic))}))}else{const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}this._activeProgress=!1}else{this._activeProgress=!1;const r=[...this.traceResults];r.splice(t,0,e),this.traceResults=r}}).catch(e=>{throw this._activeProgress=!1,e})})),!0)}cancelAddFlagByHit(){this._sketchViewModel.cancel()}changeResultAreaColor(e,t){if(!e.resultArea)return;e.resultArea.color=t;const r=this._resultAreaHandler?.changeResultAreaColor(e.trace.globalId,t,this.view.map);e.resultAreaGraphic&&(e.resultAreaGraphic.symbol=r)}changeResultGraphicColor(e,t){const r=[...this.traceResults];r.length>0&&r.forEach(r=>{r.trace.globalId===t.trace.globalId&&(r.graphicColor=e,r.graphicEnabled=!0)}),this.traceResults=r,this.removeResultGraphicFromView(t),this.addResultGraphicToView(t,e)}changeFlagSymbol(e,t){this._flags.length>0&&this._flags.forEach(r=>{r.type===e&&t&&r.mapGraphic&&(r.mapGraphic.symbol=t)})}checkCanTrace(){const e={status:!0,issues:[]},t=this.traces.filter(e=>e.selected);t.length||(e.status=!1,e.issues.push("noTracesSelected"));this._flags.some(e=>"starting-point"===e.type)||(e.status=!1,e.issues.push("noStartingPoints"));return this._flags.filter(e=>null!==e.allTerminals).some(e=>!e.selectedTerminals.length)&&(e.status=!1,e.issues.push("noTerminalSelected")),e}checkSelectionExist(){return this._highlightHandler.some(e=>e)}clearResult(e){if(!this.view)return;let t=this.traceResults;if(t.length>0){const r=t.filter(t=>t.trace.globalId===e.globalId);r.length>0&&(this.removeResultGraphicFromView(r[0]),this.removeResultAreaFromMap(r[0])),t=t.filter(t=>t.trace.globalId!==e.globalId)}this.traceResults=t,0===t.length?(this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]})):this.mergeSelection(!1,e)}createResultAreaGeometries(e,t,r){if(!this.view||!this.resultAreaProperties)return;let s;if(s="convexhull"===this.resultAreaProperties?.type?1===t.length&&(u(t[0])||p(t[0])&&1===t[0].points.length)?this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0):this._resultAreaHandler?.createConvexHull(t,e.resultArea?.distance,e.resultArea?.unit):this._resultAreaHandler?.createBuffer(t,r,e.resultArea?.unit,!0),!s)return;if(Array.isArray(s)){for(const t of s){const r=this.getResultAreaAttributes(e,t),s=this._resultAreaHandler?.createResultAreaGraphic(t,r,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color);if(s)return s}return}const i=this.getResultAreaAttributes(e,s);return this._resultAreaHandler?.createResultAreaGraphic(s,i,e.resultArea?.areaUnit,this.messages,this.messagesUnits,e.resultArea?.color)}async createResultAreaGraphic(e){if(e.results){const t=await this._createResultAreaInputGeometry(e.results);if(t.length>0){const r=Array(t.length).fill(e.resultArea?.distance),s=this.createResultAreaGeometries(e,t,r);return this.emit("create-result-area",{graphic:s}),s}}}executeTrace(e,t,r){const s=this._processFlags(r.traceLocations);return r.traceLocations=s,I(t,r,{timeout:this._traceTimeout}).then(t=>({trace:e,results:t,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:"success",date:new Date})).catch(t=>({trace:e,results:null,selectionEnabled:!1,graphicEnabled:!1,graphicColor:this.defaultGraphicColor,status:t.message,date:new Date}))}async getNonspatialTraceLocationInitialFeature(){return new Promise((e,t)=>{this._clickHandler?.remove(),this._clickHandler=this._sketchViewModel.on("create",async r=>{if("complete"!==r.state)return;const s=this._getGraphicLayer(E);s&&r.graphic&&s.remove(r.graphic);const i=this.view?.toScreen(r.graphic?.geometry);if(!i)return;const a=await(this.view?.hitTest(i));if(a?.results.length){const r=a.results.find(e=>"graphic"===e.type&&this.utilityNetwork?.isUtilityLayer(e.layer));r?e(r):t(null)}}),this._sketchViewModel.create("point")})}getResultAreaAttributes(e,r){const{messages:s}=this,i=[],a=[];this._flags.forEach(e=>{const t=e.displayValue?.field+":"+e.displayValue?.value+";"+s.attributeStrings.globalid+":"+e.globalId+";"+s.attributeStrings.terminalid+":"+e.terminalId+";"+s.attributeStrings.x+":"+e.mapPoint?.x+";"+s.attributeStrings.y+":"+e.mapPoint?.y;"starting-point"===e.type?i.push(t):a.push(t)});const l=this.utilityNetwork?this.utilityNetwork.gdbVersion:this.gdbVersion;return{traceId:e.trace.globalId,traceName:e.trace.title,traceDescription:e.trace.description??"",startingPoints:i.toString(),barriers:a.toString(),version:l??void 0,username:t.credentials[0].userId,date:e.date,elementCount:e.results?.elements.length,functionResult:JSON.stringify(e.results?.globalFunctionResults),areaStatistic:r?this._geometryHandler.calculateArea(r,e.resultArea?.areaUnit):0}}getValidSources(){let e=[];const t=this.utilityNetwork?.dataElement?.domainNetworks??[];for(const r of t)e=e.concat(r.junctionSources),e=e.concat(r.edgeSources);return e}groupResultsByNetworkSource(e){return 0===e.length?[]:this._groupBy(e,"networkSourceId")}async loadUtilityNetwork(){const{view:e}=this;if(!e)return null;if(await e.when(),this.utilityNetwork){if(this.utilityNetwork.loaded||await this.utilityNetwork.load(),this.utilityNetwork instanceof _){try{const t=e.map;await t.loadAll()}catch(s){if("layer:unsupported-layer-type"!==s.name)throw s}finally{this._loadUNSupportItems()}return this.utilityNetwork}return null}const t=e.map,r=t.utilityNetworks?.at(0);if(r){if(await r.load(),this.utilityNetwork=r,!await $(r))throw new i("utility-network:no-user-type-extension","User type extension not found");try{await t.loadAll()}catch(s){if("layer:unsupported-layer-type"!==s.name)throw s}finally{this._loadUNSupportItems()}return r}return null}manageFilterBarrier(e,t){const r=[...this._flags];r.forEach(r=>{r.globalId===t.globalId&&"barrier"===t.type&&r.id===t.id&&(r.isFilterBarrier=e)}),this._flags=r}mergeSelection(e,t){let r=[];const s=[...this.traceResults],i=t.globalId;s.forEach(t=>{i===t.trace.globalId&&(t.selectionEnabled=e),t.selectionEnabled&&null!==t.results?.elements&&(r=[...r,...t.results?.elements??[]])}),this.selectResults([...new Set(r)])}async queryFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return null;const s=this.utilityNetwork.getObjectIdsFromElements(e),i={layerUrl:s[0].layerUrl,objectIds:s[0].objectIds,outFields:["*"]},a=t.map?.allTables.toArray().filter(e=>e?.parsedUrl?.path===s[0].layerUrl).filter(f)??[];this._getUniqueMapLayerViews(t).filter(({layer:e})=>e?.parsedUrl?.path===s[0].layerUrl).forEach(({layer:e})=>{"feature"!==e.type&&"subtype-group"!==e.type||a.push(e)});const l=(await Promise.all(a.map(async e=>{const s={layers:new r([e]),layerInfos:[i],returnGeometry:!0,outSpatialReference:t.spatialReference},[a]=await A(s,!1);return a}))).filter(({featureSet:e})=>e.features.length>0);return l.length>0?l:null}queryFlagByHitTest(e,t,r){return this._lookupFlagByHit(e).then(e=>{const{view:s}=this;if(!s)return!1;if(e.length>0){const s=[...this._flags],i=r;return e.forEach(e=>{const r=e.graphic,a=r.attributes.hasOwnProperty("GLOBALID")?r.attributes.GLOBALID:r.attributes.globalid;if(s.filter(e=>e.globalId===a).length<=0){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(B)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}else if(null!==r.attributes.percentAlong){const e=this.graphicHandler.getFlagGraphic(r.attributes.mapPoint,t,r,i);this._getGraphicLayer(B)?.add(e);const a=this._createFlagProperty(r,t,e);s.push(a)}}),this._flags=s,!0}return!1})}removeResultGraphicFromView(e){const{view:t}=this;if(!t)return;const r=this._getGraphicLayer(C)?.graphics;e.graphicEnabled=!1;const s=r?.filter(t=>t.attributes[t.attributes.hasOwnProperty("GLOBALID")?"GLOBALID":"globalid"]===e.trace.globalId);s?.forEach(e=>{this._getGraphicLayer(C)?.remove(e)})}removeFlag(e){const t=this._flags.filter(t=>{if(t.id!==e.id)return t});this._removeGraphic(e),this._flags=t}removeAllResultAreaGraphics(){this._resultAreaHandler?.removeAllResultAreaGraphics(this.view.map)}removeResultAreaFromMap(e){if(e.resultArea){e.resultArea.show=!1;const t=this._resultAreaHandler?.removeResultArea(e.trace.globalId,this.view?.map);t&&this.emit("remove-result-area",{graphic:t})}}removeSelection(){this._highlightHandler.forEach(e=>{e&&e.remove()}),this._highlightHandler=[]}removeTerminal(e,t){const r=[...this._flags];r.forEach(r=>{if(r.globalId===t.globalId&&t.selectedTerminals?.includes(parseInt(e,10))){const s=t.selectedTerminals.indexOf(parseInt(e,10));r.selectedTerminals?.splice(s,1)}}),this._flags=r}removeFlagsOnLoadWatcher(){this._watchHandler&&null!==this._watchHandler&&this._watchHandler.remove()}removeClickHandler(){this._clickHandler&&(this._sketchViewModel.cancel(),this._clickHandler.remove())}reset(){this._flags=[],this.traceResults=[];const e=[...this.traces];e.forEach(e=>{e.selected=!1}),this.traces=e,this.view&&(this._getGraphicLayer(E)?.removeAll(),this._getGraphicLayer(B)?.removeAll(),this._getGraphicLayer(C)?.removeAll(),this.removeAllResultAreaGraphics(),this.removeSelection(),this.emit("clear-selection",{resultSet:[]}),this.emit("reset"))}selectFeaturesById(e){const{view:t}=this;if(!t||!this.utilityNetwork)return;const r=this.utilityNetwork.getObjectIdsFromElements(e);this._getUniqueMapLayerViews(t).forEach(e=>{O(e)&&e.layer?.parsedUrl?.path===r[0].layerUrl&&D(e)&&this._highlightHandler.push(e.highlight(r[0].objectIds))})}selectResults(e){if(e.length>0){this.removeSelection();const t=this.groupResultsByNetworkSource(e),r=[];for(const e in t)this.selectFeaturesById(t[e]),r.push(this.queryFeaturesById(t[e]));Promise.all(r).then(e=>{this.emit("select-features",{resultSet:e})})}else this.removeSelection(),this.emit("clear-selection",{resultSet:[]})}selectTraces(e,t){const r=[...this.traces];r.forEach(r=>{t===r.globalId&&(r.selected=e)}),this.traces=r}selectTracesOnLoad(){this.utilityNetwork?.hasOwnProperty("sharedNamedTraceConfigurations")&&(this.traces=[...this.utilityNetwork.sharedNamedTraceConfigurations],this.traces.forEach(e=>{e.selected=!1,this.selectedTraces.includes(e.globalId)&&(e.selected=!0)}))}zoomToAsset(e){this.view?.goTo(e).catch(e=>console.error(e))}async _createResultAreaInputGeometry(e){if(null!=e.aggregatedGeometry)return this._geometryHandler.mergeAggregatedToGeometries(e.aggregatedGeometry);const t=this.groupResultsByNetworkSource(e.elements),r=[];for(const s in t)r.push(this.queryFeaturesById(t[s]));try{const e=await Promise.all(r),t=[];for(const r of e)if(r)for(const e of r)for(const r of e.featureSet.features)r.geometry&&t.push(r.geometry);return t}catch{return[]}}_loadUNSupportItems(){if(!this.utilityNetwork)return;const{map:e}=this.view,{messages:t}=this;this._populateOutfields(),this._createGraphicLayer(E),this._createGraphicLayer(B),this._createGraphicLayer(C),this._resultAreaHandler?.createGraphicLayer(e,t?.alertsStrings.genericResultHeader),this._validUNLayers=this._utilityHelper.getValidUtilityNetworkLayers(e,this.utilityNetwork),this._sketchViewModel=this.graphicHandler.initializeSketch(this.view,this._getGraphicLayer(E),this._validUNLayers)}_getUniqueMapLayerViews(e){const t=[],r=e.layerViews.filter(({layer:{type:e}})=>"feature"===e||"group"===e||"subtype-group"===e).toArray(),s=e=>{for(const r of e.layerViews)M(r)?s(r):t.push(r)};return r.forEach(e=>{switch(e.layer.type){case"group":M(e)&&s(e);break;case"subtype-group":t.push(e);break;default:t.some(t=>t.layer.id===e.layer.id)||t.push(e)}}),t}_processFlags(e){const t=[];return e.forEach(e=>{if(null!==e.selectedTerminals&&e.selectedTerminals.length>0)e.selectedTerminals.forEach(r=>{const s=new F({globalId:e.globalId,percentAlong:e.percentAlong,terminalId:r,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(s)});else{const r=new F({globalId:e.globalId,percentAlong:e.percentAlong,type:e.type,isFilterBarrier:e.isFilterBarrier});t.push(r)}}),t}_getDisplayField(e){return w(e?.sourceLayer)?this._getDisplayFieldBySublayer(e):this._getDisplayFieldByFeatureLayer(e)}_getDisplayFieldBySublayer(e){let t="",r="";const s=e.sourceLayer;t=this._checkParentForData(s,"displayField");for(const i in e.attributes){const a=i.toLowerCase();a===t?.toLowerCase()?(r=e.attributes[i],"assetgroup"===a||"assettype"===a?r=this._checkSubtype(s,s.subtypeCode):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))):(r=this._checkDomain(s.fields,i,r),"string"==typeof r&&(r=this._defaultDisplayField(r,s)))}return{field:t,value:r.toString()}}_getDisplayFieldByFeatureLayer(e){const t=e.sourceLayer;let r=t.displayField,s="";for(const i in e.attributes){const a=i.toLowerCase();if(a===r?.toLowerCase())if(s=e.attributes[i],"assetgroup"===a||"assettype"===a){let a=e.attributes[t.typeIdField.toUpperCase()];a||(a=e.attributes[t.typeIdField.toLowerCase()]),r=t.typeIdField,s=this._checkSubtype(t,a),""===r&&(t.templates&&t.templates.length>0?(r=t.templates[0]?.name,s=t.templates[0]?.name):(r=t.displayField,s=e.attributes[i]))}else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t));else s=this._checkDomain(t.fields,i,s),"string"==typeof s&&(s=this._defaultDisplayField(s,t))}return{field:r,value:s?s.toString():""}}_checkSubtype(e,t){let r=t;if("subtype-sublayer"===e.type){const s=this._checkParentForData(e,"subtypes");s?.length>0&&s.forEach(e=>{e.code===t&&(r=e.name)})}else if(null!=e.types&&e.types.length>0){const s=e.types.filter(e=>e.id===t);s.length>0&&(r=s[0].name)}return r}_checkDomain(e,t,r){let s=r;const i=e.filter(e=>e.name.toLowerCase()===t.toLowerCase());if(i.length>0&&j(i[0].domain)&&i[0].domain?.codedValues){const e=i[0].domain.codedValues.filter(({code:e})=>e===r);e.length>0&&(s=e[0].name)}return s}_checkParentForData(e,t){return e.parent?.[t]??null}_defaultDisplayField(e,t){return e.trim()?e:t.templates&&t.templates?.length>0?t.templates[0].name:t.title}get _uniqueFlagId(){return this._flagId++}_groupBy(e,t){return e.reduce((e,r)=>((e[r[t]]=e[r[t]]||[]).push(r),e),{})}async _lookupFlagByHit(e){const t=[];let r={};const s=e.graphic?.geometry,i=this.view?.toScreen(s),a=await(this.view?.hitTest(i,{include:this._validUNLayers}));if(!a?.results.length)return[];const l=a?.results.find(e=>null!==e.layer),o=l,c=o.graphic.geometry?.type,h=l?.layer,u=h.globalIdField??"globalid",p=h.objectIdField??"objectid";if(u&&!!o.graphic.attributes[u])r=o.graphic.attributes;else{const e=await(this.view?.whenLayerView(h)),t=e.createQuery();t.outFields=["assetgroup","assettype","globalid","objectid"],t.where=`${p} = ${o.graphic.attributes[p]}`,await n(()=>!e?.updating&&!e?.dataUpdating);const s=await(e?.queryFeatures(t)),i=s?.features[0],a=i?.attributes;r=a}const d=this._getDisplayField(o.graphic),g=o.mapPoint;let y={};if("point"===c||"polygon"===c){if(this.utilityNetwork){const e=this.utilityNetwork.getTerminalConfiguration(o.graphic);y={terminalId:e?e.terminals[0].id||null:1,isFilterBarrier:!1,allTerminals:e??null,selectedTerminals:[e?e.terminals[0].id||null:1],percentAlong:null,displayValue:d,mapPoint:g}}}else if("polyline"===c){const t=o.graphic.geometry;y={terminalId:null,isFilterBarrier:!1,allTerminals:null,selectedTerminals:null,percentAlong:this._geometryHandler.getPercentageAlong(t,e.graphic?.geometry,t.spatialReference),displayValue:d,mapPoint:g}}return o.graphic.attributes={...r,...y},t.push(o),t}_createFlagProperty(e,t,r){const s=new F;s.terminalId=e.attributes.terminalId,s.isFilterBarrier=e.attributes.isFilterBarrier,s.percentAlong=e.attributes.percentAlong,s.globalId=e.attributes.globalid||e.attributes.GLOBALID,s.type=t;const i=s;return i.details=e,i.mapGraphic=r,i.id=this._uniqueFlagId,i.allTerminals=e.attributes.allTerminals,i.selectedTerminals=e.attributes.selectedTerminals,i.displayValue=e.attributes.displayValue,i.mapPoint=e.attributes.mapPoint,i}async _populateOutfields(){if(!this.view)return;const{map:e}=this.view,t=this.getValidSources(),r=e=>{"group"===e.type?e.layers.forEach(e=>{q(e)&&r(e)}):t.some(t=>t.layerId===e.layerId)&&e.fields.some(e=>"assetgroup"===e.name.toLowerCase())&&(e.outFields=["assetgroup","assettype","globalid","objectid"])};for(const s of e.layers)q(s)&&r(s)}_removeGraphic(e){this._getGraphicLayer(B)?.remove(e.mapGraphic)}_createGraphicLayer(e){const{map:t}=this.view;if(!t.findLayerById(e)){const t=new y({id:e,internal:!0,listMode:"hide",title:e});R(this.view,t)}}_getGraphicLayer(e){const{map:t}=this.view;if(t){const r=t.findLayerById(e);if(r&&x(r))return r}return null}};e([c()],z.prototype,"_activeProgress",void 0),e([c()],z.prototype,"_flags",void 0),e([c()],z.prototype,"traces",void 0),e([c()],z.prototype,"defaultGraphicColor",void 0),e([c()],z.prototype,"enableResultArea",void 0),e([c()],z.prototype,"flags",void 0),e([c()],z.prototype,"gdbVersion",void 0),e([c()],z.prototype,"messages",void 0),e([c()],z.prototype,"messagesUnits",void 0),e([c()],z.prototype,"resultAreaProperties",null),e([c()],z.prototype,"selectedTraces",void 0),e([c()],z.prototype,"selectOnComplete",void 0),e([c()],z.prototype,"showGraphicsOnComplete",void 0),e([c()],z.prototype,"showSelectionAttributes",void 0),e([c({readOnly:!0})],z.prototype,"state",null),e([c()],z.prototype,"traceResults",void 0),e([c()],z.prototype,"utilityNetwork",void 0),e([c({value:null})],z.prototype,"view",null),z=e([h("esri.widgets.UtilityNetworkTrace.UtilityNetworkTraceViewModel")],z);const J=z;export{J as default};
|