@arcgis/core 6.0.0-next.20 → 6.0.0-next.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (120) hide show
  1. package/arcgisGlobal.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/0049b66ccbfb168caa76.js +1 -0
  4. package/assets/esri/core/workers/chunks/17c6d66b47aa690df0d4.js +1 -0
  5. package/assets/esri/core/workers/chunks/{564565246dae080f5e6c.js → 1f6b601147521a42e65c.js} +1 -1
  6. package/assets/esri/core/workers/chunks/25d14874198773d2d836.js +1 -0
  7. package/assets/esri/core/workers/chunks/{00d66e3fba5ab4d2aa3c.js → 461e63a0f436c41a9f4a.js} +1 -1
  8. package/assets/esri/core/workers/chunks/{8a485130781b49dbf608.js → 601e1d020b8115497944.js} +1 -1
  9. package/assets/esri/core/workers/chunks/728837812940d7f2ef43.js +1 -0
  10. package/assets/esri/core/workers/chunks/{9401cc22373566e1171e.js → 8a7b02037151767542f1.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{9fab290090ef2ccae810.js → 9e0559cd0bb01a0ed9d7.js} +1 -1
  12. package/assets/esri/core/workers/chunks/{597db9c90f19092d8d66.js → a0c9e3f8b7d55d6dc1d5.js} +10 -10
  13. package/assets/esri/core/workers/chunks/a6f969851d4278865cc5.js +1 -0
  14. package/assets/esri/core/workers/chunks/{9d61740ef8bdcc162be1.js → a8df3f59728f841b608e.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{28b74bc77f7c13080074.js → be97a629e2ae4d13ceb3.js} +1 -1
  16. package/assets/esri/core/workers/chunks/db9921fbda556f142c4a.js +1 -0
  17. package/assets/esri/core/workers/chunks/{612104dff305ff062dfa.js → dfc81e66196c402f39b4.js} +2 -2
  18. package/assets/esri/core/workers/chunks/{a34b3d2e11a777e1ff3f.js → f28b63c1179366dac8a2.js} +1 -1
  19. package/chunks/DefaultMaterial.glsl.js +1 -1
  20. package/chunks/RealisticTree.glsl.js +1 -1
  21. package/chunks/RibbonLine.glsl.js +113 -121
  22. package/config.d.ts +62 -34
  23. package/config.js +1 -1
  24. package/core/workers/Connection.d.ts +58 -89
  25. package/core/workers.d.ts +45 -54
  26. package/kernel.js +1 -1
  27. package/layers/FeatureLayer.d.ts +7 -5
  28. package/layers/FeatureLayer.js +1 -1
  29. package/layers/GeospatialPDFLayer.js +1 -1
  30. package/layers/MapImageLayer.d.ts +9 -3
  31. package/layers/MapNotesLayer.d.ts +2 -2
  32. package/layers/SubtypeGroupLayer.d.ts +1 -1
  33. package/layers/SubtypeGroupLayer.js +1 -1
  34. package/layers/geospatialPDF/GeospatialPDFLayerWorker.js +1 -1
  35. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  36. package/layers/graphics/sources/support/QueryTask.js +1 -1
  37. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +16 -16
  38. package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
  39. package/layers/mixins/ArcGISMapService.js +1 -1
  40. package/layers/ogc/ogcFeatureUtils.js +1 -1
  41. package/layers/support/Sublayer.d.ts +29 -15
  42. package/layers/support/Sublayer.js +1 -1
  43. package/layers/support/commonProperties.js +1 -1
  44. package/package.json +3 -3
  45. package/rest/layerSources/DynamicDataLayer.d.ts +4 -2
  46. package/rest/layerSources/DynamicDataLayer.js +1 -1
  47. package/rest/layerSources/DynamicMapLayer.d.ts +1 -1
  48. package/rest/layerSources/DynamicWorkspaceLayer.d.ts +45 -0
  49. package/rest/layerSources/DynamicWorkspaceLayer.js +2 -0
  50. package/rest/layerSources/typeUtils.js +2 -0
  51. package/rest/print.js +1 -1
  52. package/rest/query/operations/queryRelatedRecords.js +1 -1
  53. package/rest/query/operations/queryUtils.js +1 -1
  54. package/rest/support/Query.js +1 -1
  55. package/rest/support/RelationshipQuery.js +1 -1
  56. package/symbols/LineSymbol3D.d.ts +5 -3
  57. package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +6 -0
  58. package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
  59. package/views/2d/layers/AnnotationFeatureLayerView2D.js +1 -1
  60. package/views/2d/layers/CSVLayerView2D.js +1 -1
  61. package/views/2d/layers/CatalogFootprintLayerView2D.js +1 -1
  62. package/views/2d/layers/DimensionFeatureLayerView2D.js +1 -1
  63. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  64. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  65. package/views/2d/layers/GeoJSONLayerView2D.js +1 -1
  66. package/views/2d/layers/KnowledgeGraphSublayerView2D.js +1 -1
  67. package/views/2d/layers/OGCFeatureLayerView2D.js +1 -1
  68. package/views/2d/layers/OrientedImageryLayerView2D.js +1 -1
  69. package/views/2d/layers/ParquetLayerView2D.js +1 -1
  70. package/views/2d/layers/StreamLayerView2D.js +1 -1
  71. package/views/2d/layers/SubtypeGroupLayerView2D.js +1 -1
  72. package/views/2d/layers/WFSLayerView2D.js +1 -1
  73. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  74. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  75. package/views/3d/analysis/Dimension/DimensionVisualization.js +1 -1
  76. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  77. package/views/3d/analysis/Dimension/lengthDimensionManipulatorUtils.js +1 -1
  78. package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +6 -0
  79. package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
  80. package/views/3d/analysis/LineOfSight/LineOfSightObserverPlugin.js +1 -1
  81. package/views/3d/analysis/LineOfSight/LineOfSightTargetPlugin.js +1 -1
  82. package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
  83. package/views/3d/analysis/Viewshed/ViewshedPlacementPointPlugin.js +1 -1
  84. package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
  85. package/views/3d/interactive/editingTools/move/MoveTool3D.js +1 -1
  86. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  87. package/views/3d/interactive/manipulators/ResizeManipulator.js +1 -1
  88. package/views/3d/interactive/manipulators/RotateManipulator.js +1 -1
  89. package/views/3d/interactive/manipulators/ShiftManipulator.js +1 -1
  90. package/views/3d/interactive/visualElements/ExtendedLineVisualElement.js +1 -1
  91. package/views/3d/interactive/visualElements/LineVisualElement.js +1 -1
  92. package/views/3d/interactive/visualElements/OutlineVisualElement.js +1 -1
  93. package/views/3d/interactive/visualElements/ParallelLineVisualElement.js +1 -1
  94. package/views/3d/interactive/visualElements/RightAngleQuadVisualElement.js +1 -1
  95. package/views/3d/layers/FlowSubView3D.js +1 -1
  96. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  97. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  98. package/views/3d/support/elevationUpdateUtils.js +1 -1
  99. package/views/3d/terrain/TerrainData.js +1 -1
  100. package/views/3d/terrain/terrainUtils.js +1 -1
  101. package/views/3d/webgl-engine/collections/Component/Material/ComponentData.glsl.js +2 -2
  102. package/views/3d/webgl-engine/core/shaderLibrary/attributes/SymbolColor.glsl.js +3 -3
  103. package/views/3d/webgl-engine/core/shaderLibrary/default/DefaultMaterialExternalColor.glsl.js +2 -2
  104. package/views/3d/webgl-engine/core/shaderLibrary/output/getEmissions.glsl.js +2 -2
  105. package/views/3d/webgl-engine/lib/GridLocalOriginFactory.js +1 -1
  106. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  107. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  108. package/views/3d/webgl-engine/shaders/RibbonLineTechniqueConfiguration.js +1 -1
  109. package/views/BreakpointsOwner.d.ts +6 -0
  110. package/views/analysis/ElevationProfile/ElevationProfileTool.js +1 -1
  111. package/views/types.d.ts +3 -0
  112. package/views/ui/UI.js +1 -1
  113. package/views/webgl/ShaderBuilder.js +1 -1
  114. package/widgets/FloorFilter/FloorFilterViewModel.js +1 -1
  115. package/assets/esri/core/workers/chunks/1e40a26dcce4d1dadc28.js +0 -1
  116. package/assets/esri/core/workers/chunks/370aad23df597db80d65.js +0 -1
  117. package/assets/esri/core/workers/chunks/510502a4c9a2ba8d3f7b.js +0 -1
  118. package/assets/esri/core/workers/chunks/6ad309154fe84210d23c.js +0 -1
  119. package/assets/esri/core/workers/chunks/a49fe94933b65b4b64f8.js +0 -1
  120. package/assets/esri/core/workers/chunks/e8bf653376a607f00897.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as s,isAborted as c,throwIfAborted as l}from"../../../core/promiseUtils.js";import{pausable as u,sync as d,watch as f,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import _ from"../../../layers/GraphicsLayer.js";import v from"../../../symbols/CIMSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import b from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as x}from"../ExclusiveOperationManager.js";import{isPolyline as S,isValidInputGraphic as C,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as T}from"../../input/InputManager.js";import{isCancelEvent as E}from"../../interactive/interactiveToolUtils.js";import{makeGeometryAnalysisSnappingOptions as D}from"../../interactive/snapping/allLayerSnapping.js";import O from"../../../widgets/Sketch/SketchViewModel.js";let k=class extends n{constructor(e){super(e),this._sketchViewModels=new i,this._updatingHandles=new g,this._operationManager=new x}initialize(){let{view:e}=this;this._allLayerSnappingOptions=D(e),this._graphicsLayer=new _({listMode:`hide`,internal:!0}),this._externalGeometryChangeHandle=u(()=>this._analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),d),this.addHandles([f(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:n,geometryVisualizationVisible:r,visible:i})=>{j(e,t);let a=this.sketchGraphic;switch(a&&(a.visible=i),n){case`idle`:case`reshaping-disabled`:a&&!r&&(a.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case`reshaping`:s(this._startReshape());break;case`awaiting-sketch`:this.analysisViewData.interactive=!0}},p),f(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},p),this._allLayerSnappingOptions,this._externalGeometryChangeHandle])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>o(e));let e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get(`sketchGraphic`)}set sketchGraphic(e){e!==this._get(`sketchGraphic`)&&(this._set(`sketchGraphic`,e),this._updateAnalysisFromSketchGraphic())}get state(){let{visible:e,interactive:t}=this.analysisViewData;if(!e)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return this._sketching?`sketching`:`awaiting-sketch`;case`pick-feature`:return`picking`;default:return this._analysis.geometry?t?`reshaping`:`reshaping-disabled`:`idle`}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return A(this.view.type)}place(e){return this._operationManager.start(`place`,async t=>{let n=this._createSketchViewModel(),r=this._analysis.clone();this._ensureUpdatedSketchGraphic();let i=this.sketchGraphic,o=this._analysis.elevationInfo,l=a(()=>{this.sketchGraphic===i&&(this._graphicsLayer.elevationInfo=o)}),u=n.on(`create`,e=>{switch(e.state){case`start`:this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case`active`:this._updateAnalysisFromSketchGraphic();break;case`complete`:this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case`cancel`:t.stop()}});t.handles.push(u,a(()=>{if(u.remove(),n.destroy(),this._sketchViewModels.remove(n),this._updateAnalysisFromSketchGraphic(),!this._analysis.valid)return this._clear(),t.reject();if(c(e)||r.equals(this._analysis))return t.reject();t.resolve({})}),l),this._graphicsLayer.elevationInfo=M,await this._updatingHandles.addPromise(s(n.create(`polyline`)))},e)}async pickFeature(e){return this._operationManager.start(`pick-feature`,async e=>{let{view:t}=this;t.closePopup();let n=null;e.handles.push(t.on(`immediate-click`,i=>{i.defer(async()=>{n?.abort(),n=r(async n=>{let{results:r}=await t.hitTest(i);l(n);let a=null;for(let e of r)if(e.type===`graphic`&&C(e.graphic)&&!w(e.graphic)){a=e.graphic;break}a&&(i.preventDefault(),i.stopPropagation(),this._externalGeometryChangeHandle.pause(),this.sketchGraphic=null,this._analysis.setGeometryFromFeature(a),this._externalGeometryChangeHandle.resume(),e.resolve({feature:a}),e.stop())}),await n.promise})},T.TOOL),t.on(`key-down`,t=>{E(t)&&(e.reject(),e.stop())},T.TOOL),t.acquireCursor(`crosshair`,`high`),a(()=>{n?.abort(),e.reject()})),t.focus()},e)}_startReshape(){let e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start(`reshape`,async t=>{let n=()=>{let t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:`reshape`})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;let r=e.on(`update`,e=>{this._updateAnalysisFromSketchGraphic(),e.state===`complete`&&(this.state===`reshaping`?s(n()):t.resolve())});t.handles.push(r,a(()=>{r.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await n()})}_createSketchViewModel(){return new O({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:`click`,hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol,snappingOptions:this._allLayerSnappingOptions.options})}_ensureUpdatedSketchGraphic(){let{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;let n=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return n.geometry=e,this._addSketchGraphic(n),n}_addSketchGraphic(e){let{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),t.length!==1&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){this._externalGeometryChangeHandle.pause();let e=this.sketchGraphic?.geometry;S(e)||(e=null);let t=this._analysis;t.geometry!==e&&(t.geometry=e),this._externalGeometryChangeHandle.resume()}};e([m({constructOnly:!0})],k.prototype,`analysisViewData`,void 0),e([m({constructOnly:!0})],k.prototype,`view`,void 0),e([m()],k.prototype,`sketchGraphic`,null),e([m({nonNullable:!0})],k.prototype,`state`,null),e([m()],k.prototype,`updating`,null),e([m()],k.prototype,`_sketching`,null),e([m()],k.prototype,`_analysis`,null),e([m()],k.prototype,`_lineSymbol`,null),k=e([h(`esri.views.analysis.ElevationProfile.ElevationProfileTool`)],k);function A(e){if(e===`2d`){let e={type:`CIMSolidStroke`,enable:!0,capStyle:`Butt`,joinStyle:`Round`,width:1.5};return new v({data:{type:`CIMSymbolReference`,symbol:{type:`CIMLineSymbol`,symbolLayers:[{...e,effects:[{type:`CIMGeometricEffectDashes`,dashTemplate:[5,4],lineDashEnding:`FullGap`,controlPointEnding:`NoConstraint`}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new y({color:[0,0,0,0]})}function j(e,t){t&&(t.removeFromParent(),e?.add(t))}const M=new b({mode:`on-the-ground`,offset:0});export{k as ElevationProfileTool};
2
+ import{__decorate as e}from"tslib";import t from"../../../Graphic.js";import n from"../../../core/Accessor.js";import{createTask as r}from"../../../core/asyncUtils.js";import i from"../../../core/Collection.js";import{makeHandle as a}from"../../../core/handleUtils.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{ignoreAbortErrors as s,isAborted as c,throwIfAborted as l}from"../../../core/promiseUtils.js";import{pausable as u,sync as d,watch as f,syncAndInitial as p}from"../../../core/reactiveUtils.js";import{property as m,subclass as h}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as g}from"../../../core/support/UpdatingHandles.js";import _ from"../../../layers/GraphicsLayer.js";import v from"../../../symbols/CIMSymbol.js";import y from"../../../symbols/SimpleLineSymbol.js";import b from"../../../symbols/support/ElevationInfo.js";import{ExclusiveOperationManager as x}from"../ExclusiveOperationManager.js";import{isPolyline as S,isValidInputGraphic as C,isInternalGraphic as w}from"./elevationProfileGeometryUtils.js";import{ViewEventPriorities as T}from"../../input/InputManager.js";import{isCancelEvent as E}from"../../interactive/interactiveToolUtils.js";import{makeGeometryAnalysisSnappingOptions as D}from"../../interactive/snapping/allLayerSnapping.js";import O from"../../../widgets/Sketch/SketchViewModel.js";let k=class extends n{constructor(e){super(e),this.canStopPlacing=!1,this._sketchViewModels=new i,this._updatingHandles=new g,this._operationManager=new x}initialize(){let{view:e}=this;this._allLayerSnappingOptions=D(e),this._graphicsLayer=new _({listMode:`hide`,internal:!0}),this._externalGeometryChangeHandle=u(()=>this._analysis.geometry,()=>this._ensureUpdatedSketchGraphic(),d),this.addHandles([f(()=>({map:e.map,internalGraphicsLayer:this._graphicsLayer,state:this.state,geometryVisualizationVisible:this._analysis.viewOptions.geometryVisualizationVisible,visible:this.analysisViewData.visible}),({map:e,internalGraphicsLayer:t,state:n,geometryVisualizationVisible:r,visible:i})=>{j(e,t);let a=this.sketchGraphic;switch(a&&(a.visible=i),n){case`idle`:case`reshaping-disabled`:a&&!r&&(a.visible=!1),this._operationManager.stop(),this._ensureUpdatedSketchGraphic();break;case`reshaping`:s(this._startReshape());break;case`awaiting-sketch`:this.analysisViewData.interactive=!0}},p),f(()=>this._analysis.elevationInfo,e=>{this._graphicsLayer.elevationInfo=e},p),this._allLayerSnappingOptions,this._externalGeometryChangeHandle])}destroy(){this._operationManager.destroy(),this._sketchViewModels.drain(e=>o(e));let e=this._graphicsLayer;this.view.map?.remove(e),e.destroy()}get sketchGraphic(){return this._get(`sketchGraphic`)}set sketchGraphic(e){e!==this._get(`sketchGraphic`)&&(this._set(`sketchGraphic`,e),this._updateAnalysisFromSketchGraphic())}get state(){let{visible:e,interactive:t}=this.analysisViewData;if(!e)return`idle`;switch(this._operationManager.currentOperationType){case`place`:return this._sketching?`sketching`:`awaiting-sketch`;case`pick-feature`:return`picking`;default:return this._analysis.geometry?t?`reshaping`:`reshaping-disabled`:`idle`}}get updating(){return this._sketchViewModels.some(e=>e.updating)||this._updatingHandles.updating}get _sketching(){return this._sketchViewModels.some(e=>e.createGraphic===this.sketchGraphic)}get _analysis(){return this.analysisViewData.analysis}get _lineSymbol(){return A(this.view.type)}place(e){return this._operationManager.start(`place`,async t=>{let n=this._createSketchViewModel(),r=this._analysis.clone();this._ensureUpdatedSketchGraphic();let i=this.sketchGraphic,o=this._analysis.elevationInfo,l=a(()=>{this.sketchGraphic===i&&(this._graphicsLayer.elevationInfo=o)}),u=()=>{let{activeComponent:e}=n;this.canStopPlacing=(e?.type===`draw-2d`||e?.type===`draw-3d`)&&e.drawOperation.numCommittedVertices>=2},d=n.on(`create`,e=>{switch(u(),e.state){case`start`:this._graphicsLayer.removeAll(),this.sketchGraphic=e.graphic,this._analysis.elevationInfo=this._graphicsLayer.elevationInfo;break;case`active`:this._updateAnalysisFromSketchGraphic();break;case`complete`:this.sketchGraphic&&(this._updateAnalysisFromSketchGraphic(),this._addSketchGraphic(this.sketchGraphic)),t.stop();break;case`cancel`:t.stop()}});t.handles.push(d,n.on([`undo`,`redo`],u),a(()=>{if(d.remove(),this.canStopPlacing=!1,n.destroy(),this._sketchViewModels.remove(n),this._updateAnalysisFromSketchGraphic(),!this._analysis.valid)return this._clear(),t.reject();if(c(e)||r.equals(this._analysis))return t.reject();t.resolve({})}),l),this._graphicsLayer.elevationInfo=M,await this._updatingHandles.addPromise(s(n.create(`polyline`)))},e)}async pickFeature(e){return this._operationManager.start(`pick-feature`,async e=>{let{view:t}=this;t.closePopup();let n=null;e.handles.push(t.on(`immediate-click`,i=>{i.defer(async()=>{n?.abort(),n=r(async n=>{let{results:r}=await t.hitTest(i);l(n);let a=null;for(let e of r)if(e.type===`graphic`&&C(e.graphic)&&!w(e.graphic)){a=e.graphic;break}a&&(i.preventDefault(),i.stopPropagation(),this._externalGeometryChangeHandle.pause(),this.sketchGraphic=null,this._analysis.setGeometryFromFeature(a),this._externalGeometryChangeHandle.resume(),e.resolve({feature:a}),e.stop())}),await n.promise})},T.TOOL),t.on(`key-down`,t=>{E(t)&&(e.reject(),e.stop())},T.TOOL),t.acquireCursor(`crosshair`,`high`),a(()=>{n?.abort(),e.reject()})),t.focus()},e)}_startReshape(){let e=this._createSketchViewModel();return this._sketchViewModels.add(e),this._operationManager.start(`reshape`,async t=>{let n=()=>{let t=this._ensureUpdatedSketchGraphic();return t?this._updatingHandles.addPromise(e.update(t,{tool:`reshape`})):Promise.resolve()};if(!this._ensureUpdatedSketchGraphic())return;let r=e.on(`update`,e=>{this._updateAnalysisFromSketchGraphic(),e.state===`complete`&&(this.state===`reshaping`?s(n()):t.resolve())});t.handles.push(r,a(()=>{r.remove(),this._sketchViewModels.remove(e),e.destroy(),t.resolve()})),await n()})}_createSketchViewModel(){return new O({layer:this._graphicsLayer,view:this.view,defaultCreateOptions:{mode:`click`,hasZ:!0},updateOnGraphicClick:!1,defaultUpdateOptions:{enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,enableZ:!1,highlightOptions:{enabled:!1},multipleSelectionEnabled:!1,reshapeOptions:{shapeOperation:`none`},toggleToolOnClick:!1,tool:`reshape`},polylineSymbol:this._lineSymbol,activeLineSymbol:this._lineSymbol,snappingOptions:this._allLayerSnappingOptions.options})}_ensureUpdatedSketchGraphic(){let{geometry:e}=this._analysis;if(!e)return this.sketchGraphic=null,this._graphicsLayer.removeAll(),null;let n=this.sketchGraphic??=new t({symbol:this._lineSymbol,geometry:e});return n.geometry=e,this._addSketchGraphic(n),n}_addSketchGraphic(e){let{graphics:t}=this._graphicsLayer;t.includes(e)||t.add(e),t.length!==1&&t.removeMany(t.filter(t=>t!==e))}_clear(){this.sketchGraphic=null,this._analysis.clear()}_updateAnalysisFromSketchGraphic(){this._externalGeometryChangeHandle.pause();let e=this.sketchGraphic?.geometry;S(e)||(e=null);let t=this._analysis;t.geometry!==e&&(t.geometry=e),this._externalGeometryChangeHandle.resume()}};e([m({constructOnly:!0})],k.prototype,`analysisViewData`,void 0),e([m({constructOnly:!0})],k.prototype,`view`,void 0),e([m()],k.prototype,`canStopPlacing`,void 0),e([m()],k.prototype,`sketchGraphic`,null),e([m({nonNullable:!0})],k.prototype,`state`,null),e([m()],k.prototype,`updating`,null),e([m()],k.prototype,`_sketching`,null),e([m()],k.prototype,`_analysis`,null),e([m()],k.prototype,`_lineSymbol`,null),k=e([h(`esri.views.analysis.ElevationProfile.ElevationProfileTool`)],k);function A(e){if(e===`2d`){let e={type:`CIMSolidStroke`,enable:!0,capStyle:`Butt`,joinStyle:`Round`,width:1.5};return new v({data:{type:`CIMSymbolReference`,symbol:{type:`CIMLineSymbol`,symbolLayers:[{...e,effects:[{type:`CIMGeometricEffectDashes`,dashTemplate:[5,4],lineDashEnding:`FullGap`,controlPointEnding:`NoConstraint`}],color:[0,0,0,255]},{...e,color:[255,255,255,255]}]}}})}return new y({color:[0,0,0,0]})}function j(e,t){t&&(t.removeFromParent(),e?.add(t))}const M=new b({mode:`on-the-ground`,offset:0});export{k as ElevationProfileTool};
package/views/types.d.ts CHANGED
@@ -870,6 +870,7 @@ export interface HitTestOptions3D {
870
870
  * > Please refer to the [styling guide](https://developers.arcgis.com/javascript/latest/styling/#view-size-css-classes) for additional
871
871
  * > information on working with this.
872
872
  *
873
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
873
874
  * @since 5.0
874
875
  * @see [BreakpointsOwner.breakpoints](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints)
875
876
  */
@@ -941,6 +942,7 @@ export interface Breakpoints {
941
942
  * landscape | The [width](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#width) of the view is greater than its [height](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#height).
942
943
  * portrait | The [width](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#width) of the view is equal to or smaller than its [height](https://developers.arcgis.com/javascript/latest/references/core/views/View2D/#height).
943
944
  *
945
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
944
946
  * @since 5.0
945
947
  */
946
948
  export type BreakpointOrientation = "landscape" | "portrait";
@@ -960,6 +962,7 @@ export type BreakpointOrientation = "landscape" | "portrait";
960
962
  * large | The width or height of the view is between the values set in the `medium` and `large` [breakpoints](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints). | 993 - 1200
961
963
  * xlarge | The width or height of the view is larger than the value set in the `large` [breakpoint](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#breakpoints). | > 1200
962
964
  *
965
+ * @deprecated since 5.2. Use alternative responsive design techniques such as a [ResizeObserver](https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver) instead.
963
966
  * @since 5.0
964
967
  * @see [widthBreakpoint](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#widthBreakpoint)
965
968
  * @see [heightBreakpoint](https://developers.arcgis.com/javascript/latest/references/core/views/BreakpointsOwner/#heightBreakpoint)
package/views/ui/UI.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{getLocale as t,onLocaleChange as n}from"../../intl.js";import r from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import{EventedAccessor as a}from"../../core/Evented.js";import{makeHandle as o}from"../../core/handleUtils.js";import{watch as s,initial as c}from"../../core/reactiveUtils.js";import{property as l,cast as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{setCalciteModeClass as f}from"../../support/modeUtils.js";import p from"./Component.js";import{isRTL as m}from"../../widgets/support/widget.js";const h={left:0,top:0,bottom:0,right:0},g={bottom:30,top:15,right:15,left:15},_=`esri-ui`,v={ui:_,corner:`${_}-corner`,innerContainer:`${_}-inner-container`,manualContainer:`${_}-manual-container`,cornerContainer:`${_}-corner-container`,topLeft:`${_}-top-left`,topRight:`${_}-top-right`,bottomLeft:`${_}-bottom-left`,bottomRight:`${_}-bottom-right`};function y(e){return e&&!e._started&&typeof e.postMixInProperties==`function`&&typeof e.buildRendering==`function`&&typeof e.postCreate==`function`&&typeof e.startup==`function`}function b(e){return e===0?`0`:`${e}px`}function x(e){let t=typeof e==`object`&&!!e&&Object.getPrototypeOf(e);return(t===null||t===Object.prototype)&&(`component`in e||`index`in e||`position`in e)?e:null}function S(e,{top:t,bottom:n,left:r,right:i}){e.style.top=t,e.style.bottom=n,e.style.left=r,e.style.right=i}let C=class extends a{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=[],this._componentMap=new Map,this._removeWidgetHandleKey=Symbol(`componentOnRemoveSymbol`),this._locale=t(),this.view=null,this._applyViewPadding=()=>{let e=this.container;e&&S(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{let e=this._innerContainer;e&&S(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([s(()=>[this.view?.padding,this.container],this._applyViewPadding,c),s(()=>this.padding,this._applyUIPadding,c),s(()=>[this.container,this._locale],([e,t])=>{e&&e.setAttribute(`lang`,t)},c),n(e=>{this._locale=e})])}destroy(){this.removeAllHandles(),this.container=null;for(let e of this._components)e.destroy();this._components.length=0,this._componentMap.clear(),this.view=null,this._set(`view`,null)}set container(e){let t=this._get(`container`);e!==t&&(e&&(e.classList.add(v.ui),f(e),this._attachContainers(e)),t&&(t.classList.remove(v.ui),S(t,{top:``,bottom:``,left:``,right:``}),t.textContent=``),this._set(`container`,e))}get height(){let e=this.view?.height??0;if(e===0)return e;let{top:t,bottom:n}=this._getViewPadding();return Math.max(e-t-n,0)}get padding(){return this._get(`padding`)}set padding(e){this._overrideIfSome(`padding`,e)}castPadding(e){return typeof e==`number`?{bottom:e,top:e,right:e,left:e}:{...g,...e}}get width(){let e=this.view?.width??0;if(e===0)return e;let{left:t,right:n}=this._getViewPadding();return Math.max(e-t-n,0)}add(e,t){let n,r,i;if(Array.isArray(e)){e.forEach(e=>this.add(e,t));return}let a=x(e);a&&({index:n,position:t,component:e,key:r}=a),t&&typeof t==`object`&&({index:n,key:r,position:t,internal:i}=t),!(!e||t&&!this._isValidPosition(t))&&this._add(e,t,n??this._getNumComponentsAtPosition(t),r,i)}remove(e,t){if(!e)return;if(Array.isArray(e))return e.map(e=>this.remove(e,t));let n=this._find(e);if(n){let e=this._componentMap.get(n);if(!e||e.key!==t)return;let r=this._components.indexOf(n);return n.node.parentNode?.removeChild(n.node),this._componentMap.delete(n),n.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.forEach(t=>{let n=this._componentMap.get(t);n&&n.position===e.position&&n.index>e.index&&n.index--}),this._components.splice(r,1)[0]}}empty(e,t={removeInternal:!1}){if(Array.isArray(e)){for(let n of e)this.empty(n,t);return}let n=this._positionNameToContainerLookup[e??`manual`],r=Array.prototype.slice.call(n.children).map(e=>this._findByNode(e)).filter(e=>e==null?!1:!(this._componentMap.get(e)?.internal??!1)||t.removeInternal);for(let e of r)this.remove(e)}move(e,t){if(Array.isArray(e)&&e.forEach(e=>this.move(e,t)),!e)return;let n,r=x(e)||x(t);if(r&&(n=r.index,t=r.position,e=r.component||e),t&&!this._isValidPosition(t))return;let i=this.remove(e);i&&this.add(i,{position:t,index:n})}find(e){if(!e)return null;let t=this._findById(e);return t&&(t.widget||t.node)}getComponents(e,t={includeInternal:!1}){return e?Array.isArray(e)?e.flatMap(e=>this._getComponentsAtPosition(e,t)):this._getComponentsAtPosition(e,t):this._components.filter(e=>t.includeInternal||!(this._componentMap.get(e)?.internal??!1)).map(({widget:e,node:t})=>e??t)}getPosition(e){for(let t in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[t].contains(e))return t;return null}_add(e,t,n,i,a){e instanceof p||(e=new p({node:e}));let{widget:s}=e;s!=null&&s instanceof r&&s.addHandles(o(()=>{queueMicrotask(()=>this.remove(e))}),this._removeWidgetHandleKey);let c=this._positionNameToContainerLookup[t];this._components.some(e=>{let t=this._componentMap.get(e)?.position,r=t?this._positionNameToContainerLookup[t]:null;return c===r&&this._componentMap.get(e)?.index===n})&&this._components.forEach(e=>{let t=this._componentMap.get(e),r=t?.position,i=r?this._positionNameToContainerLookup[r]:null;t&&i===c&&t.index>=n&&t.index++}),this._place({component:e,position:t,index:n}),this._components.push(e),this._componentMap.set(e,{key:i,position:t,internal:a,index:n})}_find(e){return e?e instanceof p?this._findByComponent(e):typeof e==`string`?this._findById(e):`domNode`in e?this._findByNode(e.domNode):this._findByNode(e):null}_getViewPadding(){return this.view?.padding??h}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){let e=document.createElement(`div`);e.classList.add(v.innerContainer,v.cornerContainer);let t=document.createElement(`div`);t.classList.add(v.innerContainer,v.manualContainer);let n=document.createElement(`div`);n.classList.add(v.topLeft,v.corner),e.appendChild(n);let r=document.createElement(`div`);r.classList.add(v.topRight,v.corner),e.appendChild(r);let i=document.createElement(`div`);i.classList.add(v.bottomLeft,v.corner),e.appendChild(i);let a=document.createElement(`div`);a.classList.add(v.bottomRight,v.corner),e.appendChild(a),this._innerContainer=e,this._manualContainer=t;let o=m();this._cornerNameToContainerLookup={"top-left":n,"top-right":r,"bottom-left":i,"bottom-right":a,"top-leading":o?r:n,"top-trailing":o?n:r,"bottom-leading":o?a:i,"bottom-trailing":o?i:a},this._positionNameToContainerLookup={manual:t,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){let t=e.position??`manual`,{component:n,index:r}=e,i=this._positionNameToContainerLookup[t],a=r!=null&&r>-1;if(y(n.widget)&&n.widget.startup(),!a){i.appendChild(n.node);return}let o=Array.from(i.children);if(o.length===0)i.appendChild(n.node);else{for(let e of o){let t=this._findByNode(e);if(t&&r<(this._componentMap.get(t)?.index??0)){e.parentNode?.insertBefore(n.node,e);return}}i.appendChild(n.node)}}_toPixelPosition(e){return{top:b(e.top),left:b(e.left),right:b(e.right),bottom:b(e.bottom)}}_findByComponent(e){return this._components.find(t=>t===e)??null}_findById(e){return this._components.find(({id:t})=>t===e)??null}_findByNode(e){return e?this._components.find(({node:t})=>t===e):null}_getComponentsAtPosition(e,t){let n=this._positionNameToContainerLookup[e];return Array.prototype.slice.call(n.children).map(e=>this._findByNode(e)).filter(i).filter(e=>t.includeInternal||!(this._componentMap.get(e)?.internal??!1)).map(({widget:e,node:t})=>e??t)}_getNumComponentsAtPosition(e){return this._positionNameToContainerLookup[e]?.children.length??0}};e([l()],C.prototype,`_locale`,void 0),e([l()],C.prototype,`container`,null),e([l()],C.prototype,`height`,null),e([l({value:g})],C.prototype,`padding`,null),e([u(`padding`)],C.prototype,`castPadding`,null),e([l()],C.prototype,`view`,void 0),e([l()],C.prototype,`width`,null),C=e([d(`esri.views.ui.UI`)],C);const w=C;export{w as default};
2
+ import{__decorate as e}from"tslib";import{getLocale as t,onLocaleChange as n}from"../../intl.js";import r from"../../core/Accessor.js";import{isSome as i}from"../../core/arrayUtils.js";import{EventedAccessor as a}from"../../core/Evented.js";import{makeHandle as o}from"../../core/handleUtils.js";import{watch as s,initial as c}from"../../core/reactiveUtils.js";import{property as l,cast as u,subclass as d}from"../../core/accessorSupport/decorators.js";import{setCalciteModeClass as f}from"../../support/modeUtils.js";import p from"./Component.js";import{isRTL as m}from"../../widgets/support/widget.js";const h={left:0,top:0,bottom:0,right:0},g={bottom:30,top:15,right:15,left:15},_=`esri-ui`,v={ui:_,corner:`${_}-corner`,innerContainer:`${_}-inner-container`,manualContainer:`${_}-manual-container`,cornerContainer:`${_}-corner-container`,topLeft:`${_}-top-left`,topRight:`${_}-top-right`,bottomLeft:`${_}-bottom-left`,bottomRight:`${_}-bottom-right`};function y(e){return e&&!e._started&&typeof e.postMixInProperties==`function`&&typeof e.buildRendering==`function`&&typeof e.postCreate==`function`&&typeof e.startup==`function`}function b(e){return e===0?`0`:`${e}px`}function x(e){let t=typeof e==`object`&&!!e&&Object.getPrototypeOf(e);return(t===null||t===Object.prototype)&&(`component`in e||`index`in e||`position`in e)?e:null}function S(e,{top:t,bottom:n,left:r,right:i}){e.style.top=t,e.style.bottom=n,e.style.left=r,e.style.right=i}let C=class extends a{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=[],this._componentMap=new Map,this._removeWidgetHandleKey=Symbol(`componentOnRemoveSymbol`),this._locale=t(),this.view=null,this._applyViewPadding=()=>{let e=this.container;e&&S(e,this._toPixelPosition(this._getViewPadding()))},this._applyUIPadding=()=>{let e=this._innerContainer;e&&S(e,this._toPixelPosition(this.padding))},this._initContainers()}initialize(){this.addHandles([s(()=>[this.view?.padding,this.container],this._applyViewPadding,c),s(()=>this.padding,this._applyUIPadding,c),s(()=>[this.container,this._locale],([e,t])=>{e&&e.setAttribute(`lang`,t)},c),n(e=>{this._locale=e})])}destroy(){this.removeAllHandles(),this.container=null;for(let e of this._components.slice())e.node?.remove(),e.destroy();this._components.length=0,this._componentMap.clear(),this._innerContainer=null,this._manualContainer=null,this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this.view=null,this._set(`view`,null)}set container(e){let t=this._get(`container`);e!==t&&(e&&(e.classList.add(v.ui),f(e),this._attachContainers(e)),t&&(t.classList.remove(v.ui),S(t,{top:``,bottom:``,left:``,right:``}),t.textContent=``),this._set(`container`,e))}get height(){let e=this.view?.height??0;if(e===0)return e;let{top:t,bottom:n}=this._getViewPadding();return Math.max(e-t-n,0)}get padding(){return this._get(`padding`)}set padding(e){this._overrideIfSome(`padding`,e)}castPadding(e){return typeof e==`number`?{bottom:e,top:e,right:e,left:e}:{...g,...e}}get width(){let e=this.view?.width??0;if(e===0)return e;let{left:t,right:n}=this._getViewPadding();return Math.max(e-t-n,0)}add(e,t){let n,r,i;if(Array.isArray(e)){e.forEach(e=>this.add(e,t));return}let a=x(e);a&&({index:n,position:t,component:e,key:r}=a),t&&typeof t==`object`&&({index:n,key:r,position:t,internal:i}=t),!(!e||t&&!this._isValidPosition(t))&&this._add(e,t,n??this._getNumComponentsAtPosition(t),r,i)}remove(e,t){if(!e)return;if(Array.isArray(e))return e.map(e=>this.remove(e,t));let n=this._find(e);if(n){let e=this._componentMap.get(n);if(!e||e.key!==t)return;let r=this._components.indexOf(n);return n.node.parentNode?.removeChild(n.node),this._componentMap.delete(n),n.widget?.removeHandlesReference(this._removeWidgetHandleKey),this._components.forEach(t=>{let n=this._componentMap.get(t);n&&n.position===e.position&&n.index>e.index&&n.index--}),this._components.splice(r,1)[0]}}empty(e,t={removeInternal:!1}){if(Array.isArray(e)){for(let n of e)this.empty(n,t);return}let n=this._positionNameToContainerLookup[e??`manual`],r=Array.prototype.slice.call(n.children).map(e=>this._findByNode(e)).filter(e=>e==null?!1:!(this._componentMap.get(e)?.internal??!1)||t.removeInternal);for(let e of r)this.remove(e)}move(e,t){if(Array.isArray(e)&&e.forEach(e=>this.move(e,t)),!e)return;let n,r=x(e)||x(t);if(r&&(n=r.index,t=r.position,e=r.component||e),t&&!this._isValidPosition(t))return;let i=this.remove(e);i&&this.add(i,{position:t,index:n})}find(e){if(!e)return null;let t=this._findById(e);return t&&(t.widget||t.node)}getComponents(e,t={includeInternal:!1}){return e?Array.isArray(e)?e.flatMap(e=>this._getComponentsAtPosition(e,t)):this._getComponentsAtPosition(e,t):this._components.filter(e=>t.includeInternal||!(this._componentMap.get(e)?.internal??!1)).map(({widget:e,node:t})=>e??t)}getPosition(e){for(let t in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[t].contains(e))return t;return null}_add(e,t,n,i,a){e instanceof p||(e=new p({node:e}));let{widget:s}=e;s!=null&&s instanceof r&&s.addHandles(o(()=>{queueMicrotask(()=>this.remove(e))}),this._removeWidgetHandleKey);let c=this._positionNameToContainerLookup[t];this._components.some(e=>{let t=this._componentMap.get(e)?.position,r=t?this._positionNameToContainerLookup[t]:null;return c===r&&this._componentMap.get(e)?.index===n})&&this._components.forEach(e=>{let t=this._componentMap.get(e),r=t?.position,i=r?this._positionNameToContainerLookup[r]:null;t&&i===c&&t.index>=n&&t.index++}),this._place({component:e,position:t,index:n}),this._components.push(e),this._componentMap.set(e,{key:i,position:t,internal:a,index:n})}_find(e){return e?e instanceof p?this._findByComponent(e):typeof e==`string`?this._findById(e):`domNode`in e?this._findByNode(e.domNode):this._findByNode(e):null}_getViewPadding(){return this.view?.padding??h}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){let e=document.createElement(`div`);e.classList.add(v.innerContainer,v.cornerContainer);let t=document.createElement(`div`);t.classList.add(v.innerContainer,v.manualContainer);let n=document.createElement(`div`);n.classList.add(v.topLeft,v.corner),e.appendChild(n);let r=document.createElement(`div`);r.classList.add(v.topRight,v.corner),e.appendChild(r);let i=document.createElement(`div`);i.classList.add(v.bottomLeft,v.corner),e.appendChild(i);let a=document.createElement(`div`);a.classList.add(v.bottomRight,v.corner),e.appendChild(a),this._innerContainer=e,this._manualContainer=t;let o=m();this._cornerNameToContainerLookup={"top-left":n,"top-right":r,"bottom-left":i,"bottom-right":a,"top-leading":o?r:n,"top-trailing":o?n:r,"bottom-leading":o?a:i,"bottom-trailing":o?i:a},this._positionNameToContainerLookup={manual:t,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){let t=e.position??`manual`,{component:n,index:r}=e,i=this._positionNameToContainerLookup[t],a=r!=null&&r>-1;if(y(n.widget)&&n.widget.startup(),!a){i.appendChild(n.node);return}let o=Array.from(i.children);if(o.length===0)i.appendChild(n.node);else{for(let e of o){let t=this._findByNode(e);if(t&&r<(this._componentMap.get(t)?.index??0)){e.parentNode?.insertBefore(n.node,e);return}}i.appendChild(n.node)}}_toPixelPosition(e){return{top:b(e.top),left:b(e.left),right:b(e.right),bottom:b(e.bottom)}}_findByComponent(e){return this._components.find(t=>t===e)??null}_findById(e){return this._components.find(({id:t})=>t===e)??null}_findByNode(e){return e?this._components.find(({node:t})=>t===e):null}_getComponentsAtPosition(e,t){let n=this._positionNameToContainerLookup[e];return Array.prototype.slice.call(n.children).map(e=>this._findByNode(e)).filter(i).filter(e=>t.includeInternal||!(this._componentMap.get(e)?.internal??!1)).map(({widget:e,node:t})=>e??t)}_getNumComponentsAtPosition(e){return this._positionNameToContainerLookup[e]?.children.length??0}};e([l()],C.prototype,`_locale`,void 0),e([l()],C.prototype,`container`,null),e([l()],C.prototype,`height`,null),e([l({value:g})],C.prototype,`padding`,null),e([u(`padding`)],C.prototype,`castPadding`,null),e([l()],C.prototype,`view`,void 0),e([l()],C.prototype,`width`,null),C=e([d(`esri.views.ui.UI`)],C);const w=C;export{w as default};
@@ -16,7 +16,7 @@ ${o.join(`
16
16
  `)}
17
17
  ${s.join(`
18
18
  `)}`}generateBind(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[0];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[0];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return t=>{for(let i=0;i<r;++i)n[i](e,t)}}generateBindPass(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[1];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i)=>{for(let a=0;a<r;++a)n[a](e,i,t)}}generateBindDraw(e){let t=new Map;this.vertex.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)}),this.fragment.uniforms.entries.forEach(e=>{let n=e.bind[2];n&&t.set(e.name,n)});let n=Array.from(t.values()),r=n.length;return(t,i,a)=>{for(let o=0;o<r;++o)n[o](e,a,t,i)}}}class a{constructor(e){this._stage=e,this._entries=new Map}add(...e){for(let t of e)this._add(t);return this._stage}get(e){return this._entries.get(e)}_add(t){if(t==null)n().error(`Trying to add null Uniform from ${Error().stack}.`);else{if(this._entries.has(t.name)&&!this._entries.get(t.name).equals(t))throw new e(`shaderbuilder:duplicate-uniform`,`Duplicate uniform name ${t.name} for different uniform type`);this._entries.set(t.name,t)}}generateSource(){return Array.from(this._entries.values()).map(({name:e,arraySize:t,type:n})=>t==null?`uniform ${n} ${e};`:`uniform ${n} ${e}[${t}];`)}get entries(){return Array.from(this._entries.values())}}class o{constructor(){this._entries=new Map}add(t,n){if(this._entries.has(t))throw new e(`shaderbuilder:duplicate-input`,`Duplicate input for ${t}`);this._entries.set(t,n)}get(t){let n=this._entries.get(t);if(n==null)throw new e(`shaderbuilder:input-resolver-error`,`No resolver for input ${t} found.`);return n()}}class s{constructor(e){this._stage=e,this._bodies=[]}add(e){return this._bodies.push(e),this._stage}generateSource(t){if(this._bodies.length>0){let e=[];for(let t of this._bodies)typeof t==`string`?e.push(t):e.push(...t());return[`void main() {\n ${e.join(`
19
- `)||``} \n}`]}if(t)throw new e(`shaderbuilder:missing-main`,`Shader does not contain main function body.`);return[]}}class c{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)typeof t==`string`?e.push(t):e.push(...t());return e}}class l extends r{constructor(){super(...arguments),this.uniforms=new a(this),this.main=new s(this),this.code=new c(this),this.constants=new p(this),this.inputs=new o}get builder(){return this}}class u{constructor(){this._entries=[]}add(e,t){this._entries.push([e,t])}generateSource(e){return e===`fragment`?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class d{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,invariant:r?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((n,r)=>t.push((n.invariant&&e===`vertex`?`invariant `:``)+(n.type===`int`?`flat `:``)+(e===`vertex`?`out`:`in`)+` ${n.type} ${r};`)),t}}class f{constructor(){this._entries=new Map}add(e,t,r=0){let i=this._entries.get(r);i?.name===e&&i?.type===t?n().warn(`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}static{this.DEFAULT_TYPE=`vec4`}static{this.DEFAULT_NAME=`fragColor`}generateSource(e){if(e===`vertex`)return[];this._entries.size===0&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});let t=[];return this._entries.forEach((e,n)=>t.push(`layout(location = ${n}) out ${e.type} ${e.name};`)),t}}class p{constructor(e){this._stage=e,this._entries=new Set}add(e,t,n){let r=`ERROR_CONSTRUCTOR_STRING`;switch(t){case`float`:r=p._numberToFloatStr(n);break;case`int`:r=p._numberToIntStr(n);break;case`uint`:r=p._numberToUintStr(n);break;case`bool`:r=n.toString();break;case`vec2`:r=`vec2(${p._numberToFloatStr(n[0])},\
19
+ `)||``} \n}`]}if(t)throw new e(`shaderbuilder:missing-main`,`Shader does not contain main function body.`);return[]}}class c{constructor(e){this._stage=e,this._entries=[]}add(e){return this._entries.push(e),this._stage}generateSource(){let e=[];for(let t of this._entries)typeof t==`string`?e.push(t):e.push(...t());return e}}class l extends r{constructor(){super(...arguments),this.uniforms=new a(this),this.main=new s(this),this.code=new c(this),this.constants=new p(this),this.inputs=new o}get builder(){return this}}class u{constructor(){this._entries=[]}add(e,t){this._entries.push([e,t])}generateSource(e){return e===`fragment`?[]:this._entries.map(e=>`in ${e[1]} ${e[0]};`)}get names(){return this._entries.map(([e])=>e)}}class d{constructor(){this._entries=new Map}add(e,t,r){this._entries.has(e)?n().warn(`Ignoring duplicate varying ${t} ${e}`):this._entries.set(e,{type:t,flat:r?.flat??!1,invariant:r?.invariant??!1})}generateSource(e){let t=[];return this._entries.forEach((n,r)=>t.push((n.invariant&&e===`vertex`?`invariant `:``)+(n.flat?`flat `:``)+(e===`vertex`?`out`:`in`)+` ${n.type} ${r};`)),t}}class f{constructor(){this._entries=new Map}add(e,t,r=0){let i=this._entries.get(r);i?.name===e&&i?.type===t?n().warn(`Fragment shader output location ${r} occupied`):this._entries.set(r,{name:e,type:t})}static{this.DEFAULT_TYPE=`vec4`}static{this.DEFAULT_NAME=`fragColor`}generateSource(e){if(e===`vertex`)return[];this._entries.size===0&&this._entries.set(0,{name:f.DEFAULT_NAME,type:f.DEFAULT_TYPE});let t=[];return this._entries.forEach((e,n)=>t.push(`layout(location = ${n}) out ${e.type} ${e.name};`)),t}}class p{constructor(e){this._stage=e,this._entries=new Set}add(e,t,n){let r=`ERROR_CONSTRUCTOR_STRING`;switch(t){case`float`:r=p._numberToFloatStr(n);break;case`int`:r=p._numberToIntStr(n);break;case`uint`:r=p._numberToUintStr(n);break;case`bool`:r=n.toString();break;case`vec2`:r=`vec2(${p._numberToFloatStr(n[0])},\
20
20
  ${p._numberToFloatStr(n[1])})`;break;case`vec3`:r=`vec3(${p._numberToFloatStr(n[0])},\
21
21
  ${p._numberToFloatStr(n[1])},\
22
22
  ${p._numberToFloatStr(n[2])})`;break;case`vec4`:r=`vec4(${p._numberToFloatStr(n[0])},\
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/6.0/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{createTask as n}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{watch as s,initial as c,syncAndInitial as l}from"../../core/reactiveUtils.js";import{Milliseconds as u}from"../../core/time.js";import{isBlobProtocol as d}from"../../core/urlUtils.js";import{property as f,subclass as p}from"../../core/accessorSupport/decorators.js";import m from"../../geometry/Polygon.js";import h from"../../webdoc/Widgets.js";import g from"../../webdoc/widgets/FloorFilter.js";import{isWebMap as _}from"../../webmap/utils.js";import{GoTo as v}from"../support/GoTo.js";function y(e){return e.declaredClass===`esri.WebScene`}let b=class extends v(t){constructor(e){super(e),this.filterMenuOpen=!1,this.filterMenuType=`site`,this.filterMode=`base-floors`,this.levelsExpanded=!0,this.searchTerm=null,this.view=null,this._updateFloorFilterTask=null,this._viewHeightBreakpoint=null,this._viewWidthBreakpoint=null}initialize(){this.addHandles([s(()=>this.view?.map,e=>{this._updateFloorFilterTask!=null&&(this._updateFloorFilterTask.abort(),this._updateFloorFilterTask=null),this._updateFloorFilterTask=n(async t=>{await this._updateFloorFilterFromMap(e),o(t),this._setInitialViewState(e)})},c),s(()=>this.view,(e,t)=>{this._unregisterWidget(t),this._registerWidget(e),this._watchSearchResults(e)},l),s(()=>this.mediaLayer,e=>{this._watchLayerVisibility(e)},l),s(()=>this.view?.widthBreakpoint??null,e=>{this._viewWidthBreakpoint=e}),s(()=>this.view?.heightBreakpoint??null,e=>{this._viewHeightBreakpoint=e}),s(()=>this.facility,()=>void this.getOverlays()),s(()=>this.level,e=>this._updateMediaLayer(e))])}destroy(){if(this._unregisterWidget(this.view),this.mediaLayer&&this.view?.map.remove(this.mediaLayer),this.overlaysByLevel){for(let e of this.overlaysByLevel.values()){let t=e.image.image;d(t)&&URL.revokeObjectURL(t)}this.overlaysByFacility?.clear(),this.overlaysByLevel.clear()}this.view=null,this._updateFloorFilterTask!=null&&(this._updateFloorFilterTask.abort(),this._updateFloorFilterTask=null)}set enabled(e){this._callOverride(`enabled`,e)}set facility(e){if(e&&this._isOverridden(`facility`)){let t=this.getFacility(e);this.hasMultipleSites&&(this.site=t?.siteId||null)}this._callOverride(`facility`,e)}set filterFeatures(e){this._callOverride(`filterFeatures`,e)}set filterLayers(e){this._callOverride(`filterLayers`,e)}get floorVisibilityMode(){return this.view&&y(this.view?.map)?this.view.map.widgets?.floorFilter?.floorVisibilityMode??`belowSelected`:`belowSelected`}get hasFacilities(){return this.filterLayers?.facilityLayer!=null&&this.filterFeatures?.facilities?.facilitiesInfo?.length>0}get hasLevels(){return this.filterLayers?.levelLayer!=null&&this.filterFeatures?.levels?.levelsInfo?.length>0}get hasMultipleSites(){return this.filterLayers?.siteLayer!=null&&this.filterFeatures?.sites?.sitesInfo?.length>1}get isNormalMode(){let e=!0,t=this._viewWidthBreakpoint;return(this._viewHeightBreakpoint===`xsmall`||t===`xsmall`)&&(e=!1),e}set level(e){if(!e){this._callOverride(`level`,e),this.facility=null,this.site=null,this.setFloors(null);return}let t=null,n=null,r=e?.split(`--`);r?.length>1&&r[0]===`all`?(n=r[1],t={id:e,facilityId:n,shortName:null,longName:null,levelNumber:null,verticalOrder:null}):(t=this.getLevel(e),n=t?.facilityId??null),this.level===e&&!this.isNormalMode&&!this.levelsExpanded?this.getFacilityLevels(n)?.length>1&&(this.levelsExpanded=!0):(t&&this.hasFacilities&&this.hasLevels?(this.facility=n,this.hasMultipleSites&&(this.site=this.getFacility(n)?.siteId||null),this.setFloors(t)):this._isOverridden(`level`)&&(this.facility=null,this.site=null,this.hasMultipleSites&&(this.filterMenuType=`site`),this.setFloors(null)),this._callOverride(`level`,e))}set longNames(e){this._callOverride(`longNames`,e)}set minimized(e){this._callOverride(`minimized`,e)}set pinnedLevels(e){this._callOverride(`pinnedLevels`,e)}get selectedVerticalOrder(){return _(this.view?.map)?this.view.map.resourceInfo?.widgets?.floorFilter?.selectedVerticalOrder??null:null}set site(e){this._callOverride(`site`,e)}get state(){return this.view&&this.filterFeatures&&this.hasFacilities&&this.hasLevels?`ready`:this.view&&!this.filterFeatures?`loading`:`disabled`}get useVerticalOrder(){return this.view?.map==null?!1:_(this.view?.map)||y(this.view.map)?this.view.map.widgets?.floorFilter?.useVerticalOrder??!1:!1}filterFacilities(e){let t=e;return this.searchTerm&&(this.searchTerm=this.searchTerm.trim(),t=e.filter(e=>{let{name:t}=e;return t.toLowerCase().includes(this.searchTerm?.toLowerCase())})),this.site&&(t=t.filter(e=>e.siteId===this.site)),t.sort((e,t)=>{let n=e.name,r=t.name;return n.localeCompare(r,void 0,{sensitivity:`base`})})}filterSites(e){let t=e;return this.searchTerm&&(this.searchTerm=this.searchTerm.trim(),t=e.filter(e=>{let{name:t}=e;return t.toLowerCase().includes(this.searchTerm?.toLowerCase())})),t.sort((e,t)=>{let n=e.name,r=t.name;return n.localeCompare(r,void 0,{sensitivity:`base`})})}getBaseLevel(e){let t=this.filterFeatures?.levels?.levelsInfo,n=null;if(e){let{id:r}=e;if(t&&t.length>0&&(t.forEach(e=>{e.verticalOrder===0&&e.facilityId===r&&(n=e)}),!n)){let e=null;t.forEach(t=>{t.facilityId===r&&(e?(t.verticalOrder??0)>=0?e.verticalOrder!=null&&(e.verticalOrder<0||(t.verticalOrder??0)<e.verticalOrder)&&(e=t):e.verticalOrder!=null&&t.verticalOrder!=null&&e.verticalOrder<0&&t.verticalOrder>e.verticalOrder&&(e=t):e=t)}),e&&(n=e)}}return n}getFacility(e){return this.filterFeatures?.facilities?.facilitiesInfo?.find(t=>t.id===e)??null}getFacilityLevels(e){return!e||!this.filterFeatures?.levels?.levelsInfo?[]:this.filterFeatures.levels.levelsInfo.filter(t=>t.facilityId===e).sort((e,t)=>{let n=e.verticalOrder??0,r=t.verticalOrder??0;return n>r?-1:n===r?0:1})}getLevel(e){return this.filterFeatures?.levels?.levelsInfo?.find(t=>t.id===e)??null}async getOverlays(e=!1){let{facility:t,level:n,mediaLayer:i,overlaysByFacility:a,overlaysByLevel:o,view:s}=this;if(_(s?.map)&&i){if((i?.source).elements.removeAll(),t?.length&&(!a?.has(t)||e)){a?.set(t,new r);let e=s.map.floorInfo?.levelLayer?.layerId,n=s.map.findLayerById(e??``);if(!n||s.type!==`2d`)return;let i=await this._getAttachments(n,t),{default:c}=await import(`../../request.js`),l=Object.keys(i).map(async e=>{let r=i[e],s=r.find(e=>e.contentType===`application/json`);if(!s?.url)return;let l=new URL(s.url);n.gdbVersion?.length&&l.searchParams.set(`gdbVersion`,n.gdbVersion);let{data:u}=await c(l.toString(),{responseType:`json`}),d=r.find(e=>e.name===u.name),f=d?.url??``;if(f?.length>0){let e=new URL(f);e.searchParams.delete(`token`),n.gdbVersion?.length&&e.searchParams.set(`gdbVersion`,n.gdbVersion);let{default:r}=await import(`../../layers/support/ControlPointsGeoreference.js`),i=r.fromJSON(u.georeference),c=await this.toImageElement(e.toString(),i,u.opacity,u.clipImage,u.geometry);await c.load();let l={...u,attachments:[s,d],facilityId:t,image:c,source:JSON.stringify(u),url:e.toString()};o?.set(l.levelId,l),a?.get(t)?.push(l)}});await Promise.all(l)}this._updateMediaLayer(n)}}getSite(e){return this.filterFeatures?.sites?.sitesInfo?.find(t=>t.id===e)??null}async goTo(e){let{view:t}=this;if(!t||!e)return;let{geometry:n}=e;if(n?.extent){let e=e=>{this.callGoTo({target:e,options:{duration:u(1e3),easing:`quad-in-out-coast`}})};if(n.hasZ&&n.spatialReference?.vcsWkid!==t.spatialReference?.vcsWkid){let{projectIsLoaded:r,projectLoad:i,projectExecute:a}=await import(`../../geometry/operators/projectOperator.js`);r()||await i();let o=a(n.extent,t.spatialReference.clone(),{zConversionDisabled:!0});o&&e(o)}else e(n.extent)}}setFloors(e){let{view:t}=this;t&&(t?.map?.allLayers?.forEach(e=>{e.type===`feature`&&this._computeViewAllModeFloors(e)}),t.floors=new r(this._computeFloors(e)))}async toImageElement(e,t,n,r,i){let{default:o}=await import(`../../layers/support/ImageElement.js`),{facility:s}=this,c=()=>new o({image:e,georeference:t,opacity:n});if(r)try{let r=i?m.fromJSON(i):this.getFacility(s)?.geometry;if(r==null)return c();let{pixelRings:a,width:l,height:u}=await this._polygonToImagePixels(t,r),d=await this._imagePolygonToBlob(e,a,l,u);return new o({image:URL.createObjectURL(d),georeference:t,opacity:n})}catch(e){return a.getLogger(this).warn(`Unable to clip image; using full image instead: ${e.message}`,e),c()}return c()}updateWebDocument(e){if(_(e)||y(e)){let t={enabled:this.enabled,longNames:this.longNames,minimized:this.minimized,pinnedLevels:this.pinnedLevels,site:this.site??null,facility:this.facility??null,level:this.level??null,useVerticalOrder:this.useVerticalOrder,selectedVerticalOrder:this.selectedVerticalOrder};y(e)&&(t.floorVisibilityMode=this.floorVisibilityMode);let n=new g(t);e.widgets??=new h,e.widgets.floorFilter=n}}_computeFloors(e){if(this.filterMode===`single-floor`)this._computeSingleFloor(e);else if(this.filterMode===`base-floors`)return this.view?.type===`3d`?this._computeBaseFloors3D(e):this._computeBaseFloors(e);return this._computeEmptyFloors()}_computeSingleFloor(e){if(!e)return this._computeEmptyFloors();let t=[];return e?.id===`all`?this.getFacilityLevels(e.facilityId).forEach(e=>{e.id&&t.push(e.id)}):e&&t.push(e.id),t}_computeBaseFloors(e){let t=this.filterFeatures?.levels?.levelsInfo;if(!t?.length)return this._computeEmptyFloors();let n=[];e?.id===`all`?this.getFacilityLevels(e.facilityId).forEach(e=>{e.id&&n.push(e.id)}):e&&n.push(e.id);let r=e?.facilityId,i=e?.verticalOrder,a=(e,t)=>{e===0&&n.push(t)};return t.forEach(e=>{let{id:t,facilityId:o,verticalOrder:s}=e;!r&&!n.includes(t)?a(s,t):o!==r&&!n.includes(t)&&(this.useVerticalOrder?s===i&&n.push(t):a(s,t))}),n}_computeBaseFloors3D(e){let t=this.filterFeatures?.levels?.levelsInfo;if(!t?.length)return this._computeEmptyFloors();let n=[],r=e?.id.split(`--`)??[],i=r?.length>1&&r[0]===`all`;i?this.getFacilityLevels(e?.facilityId).forEach(e=>{e.id&&n.push(e.id)}):e&&n.push(e.id);let a=e?.facilityId,o=e?.verticalOrder;return t.forEach(e=>{let{id:t,facilityId:r,verticalOrder:s}=e;if(!a&&!n.includes(t))n.push(t);else if(!n.includes(t)){let{floorVisibilityMode:e,useVerticalOrder:c}=this,l=s<=o;r===a?e===`belowSelected`&&l&&n.push(t):(i||!c||e===`selectedOnly`&&s===o||e===`belowSelected`&&l)&&n.push(t)}}),n}_computeEmptyFloors(){return[]}async _setFilterLayers(){let{view:e}=this;if(e&&!this._isOverridden(`filterLayers`)){if(!_(e.map)&&!y(e.map))throw new i(`floorfilter:unsupported-map`,`Map must be a webmap or webscene`);{let t=e.map,n=t?.allLayers;if(n?.items?.length>0){let e={siteLayer:null,facilityLayer:null,levelLayer:null},r=t.floorInfo?.siteLayer?.layerId,i=t.floorInfo?.facilityLayer?.layerId,a=t.floorInfo?.levelLayer?.layerId,o=t.floorInfo?.siteLayer?.sublayerId||t.floorInfo?.facilityLayer?.sublayerId||t.floorInfo?.levelLayer?.sublayerId;if(!i||!a)return;let s=n.items.filter(e=>e.type===`feature`||e.type===`scene`),c=n.items.filter(e=>e.type===`map-image`);if(c?.length>0&&o){await Promise.all(c.map(e=>e.load()));let n=t.floorInfo?.siteLayer?.sublayerId,o=t.floorInfo?.facilityLayer?.sublayerId,s=t.floorInfo?.levelLayer?.sublayerId;c.forEach(t=>{let c=t.id,l=t?.allSublayers,u=l?.items;(c===r||c===i||c===a)&&u?.length>0&&l.items.forEach(t=>{let i=t.id;c===r&&i===n?e.siteLayer=t:i===o?e.facilityLayer=t:i===s&&(e.levelLayer=t)})})}s?.length>0&&s.forEach(t=>{let n=t.id;n===r?e.siteLayer=t:n===i?e.facilityLayer=t:n===a&&(e.levelLayer=t)}),this.filterLayers=e}}}}async _getAttachments(e,t){let{view:n}=this;if(_(n?.map)){let{facilityIdField:r}=n.map.floorInfo?.levelLayer??{};if(e&&n.type===`2d`&&t?.length>0&&e.capabilities.data.supportsAttachment)return e.queryAttachments({returnMetadata:!0,where:`${r} = '${t}'`})}return{}}async _getFilterFeatures(){if(this._isOverridden(`filterFeatures`))return this.filterFeatures;let[e,t,n]=await Promise.all([this._getSites(),this._getFacilities(),this._getLevels()]);return{sites:e,facilities:t,levels:n}}async _getSites(){let e={sitesInfo:[]},{filterLayers:t,view:n}=this,r=n?.map,{siteLayer:i}=t;if(!i||!r?.floorInfo?.siteLayer)return e;let a=i.createQuery();a.returnGeometry=!0,a.outFields=[`*`],a.returnZ=!0,`type`in i&&i.type===`scene`&&(a.multipatchOption=`xyFootprint`);let{siteIdField:o,nameField:s}=r.floorInfo.siteLayer,c=await i.queryFeatures(a);if(c?.features?.length>0){let t=c.features,n=i?.fieldsIndex.get(o)?.name||o,r=i?.fieldsIndex.get(s)?.name||s;n!=null&&r!=null&&t.forEach(t=>{let i=t.attributes,a=t.geometry,o=i[n],s=i[r];o&&s&&e.sitesInfo.push({id:o,name:s,geometry:a})})}return e}async _getFacilities(){let{filterLayers:e,view:t}=this,n=t?.map,{facilityLayer:r}=e,i={facilitiesInfo:[]};if(!r||!n?.floorInfo?.facilityLayer)return i;let a=r.createQuery();a.returnGeometry=!0,a.outFields=[`*`],a.returnZ=!0,`type`in r&&r.type===`scene`&&(a.multipatchOption=`xyFootprint`);let{facilityIdField:o,siteIdField:s,nameField:c}=n.floorInfo.facilityLayer,l=await r.queryFeatures(a);if(l?.features?.length>0){let e=l.features,t=r?.fieldsIndex.get(o)?.name||o,n=r?.fieldsIndex.get(s)?.name||s,a=r?.fieldsIndex.get(c)?.name||c;t&&n&&a&&e.forEach(e=>{let r=e.attributes,o=e.geometry,s=r[t],c=r[n],l=r[a];s&&l&&i.facilitiesInfo.push({id:s,siteId:c,name:l,geometry:o})})}return i}async _getLevels(){let{filterLayers:e,view:t}=this,n=t?.map,{levelLayer:r}=e,i={levelsInfo:[]};if(!r||!n?.floorInfo?.levelLayer)return i;let a=r.createQuery();a.returnGeometry=!0,a.outFields=[`*`],a.returnZ=!0;let{levelIdField:o,facilityIdField:s,longNameField:c,shortNameField:l,levelNumberField:u,verticalOrderField:d}=n.floorInfo.levelLayer,f=await r.queryFeatures(a);if(f?.features?.length>0){let e=f.features,t=r?.fieldsIndex.get(o)?.name||o,n=r?.fieldsIndex.get(s)?.name||s,a=r?.fieldsIndex.get(c)?.name||c,p=r?.fieldsIndex.get(l)?.name||l,m=r?.fieldsIndex.get(u)?.name||u,h=r?.fieldsIndex.get(d)?.name||d;t&&n&&a&&p&&m&&h&&e.forEach(e=>{let r=e.attributes,o=r[t],s=r[n],c=r[a],l=r[p],u=r[m],d=r[h];o&&s&&c&&l&&typeof u==`number`&&typeof d==`number`&&i.levelsInfo.push({id:o,facilityId:s,longName:c,shortName:l,levelNumber:u,verticalOrder:d})})}return i}async _imagePolygonToBlob(e,t,n,r){let{getImageData:a}=await import(`../../core/imageUtils.js`),o=await a(e),s=new OffscreenCanvas(n,r),c=s.getContext(`2d`);if(!c)throw new i(`floorfilter:floor-plan-overlay`,`Unable to obtain a rendering context from the canvas.`);let l=new Path2D;for(let e of t)if(!(e.length<3)){l.moveTo(e[0].x,e[0].y);for(let t=1;t<e.length;t++)l.lineTo(e[t].x,e[t].y);l.closePath()}return c.save(),c.clip(l,`evenodd`),c.drawImage(o,0,0,n,r),c.restore(),await s.convertToBlob({type:`image/png`})}async _polygonToImagePixels(e,t){if(e?.type!==`control-points`)throw new i(`floorfilter:floor-plan-overlay`,"Expected a `ControlPointsGeoreference`.");let{default:n}=await import(`../../geometry/Point.js`);return{pixelRings:t.rings.map(r=>r.map(([r,a])=>{let o=new n({x:r,y:a,spatialReference:t.spatialReference}),s=e.toSource(o);if(!s)throw new i(`floorfilter:floor-plan-overlay`,`toSource() returned null; check spatial references and projectOperator.`);return{x:s.x,y:s.y}})),width:e.width,height:e.height}}_registerWidget(e){e?.registerComponent(this)}_unregisterWidget(e){e?.unregisterComponent(this)}_watchLayerVisibility(e){if(this.filterLayers?.levelLayer?.type===`feature`&&e){let t=this.filterLayers?.levelLayer;this.addHandles(s(()=>t.visible,t=>{e.visible=t},l))}}_watchSearchResults(e){e?.on(`select-result-floor`,e=>{let t=this.getLevel(e);t&&this.level!==e&&(this.level=e,this.setFloors(t))})}async _setInitialViewState(e){if(this.view)try{await this.view.when(),await this._setFilterLayers();let t=await this._getFilterFeatures();if(!t)return;if(this.filterFeatures=t,!this.hasFacilities||!this.hasLevels){a.getLogger(this).error(`Facilities and Levels are required for the Floor Filter widget`);return}if(this.hasMultipleSites||(this.filterMenuType=`facility`),this.facility&&this.level){this.filterMenuType=`facility`;let e=this.getFacility(this.facility),t=this.getLevel(this.level);this.site||=e?.siteId||void 0,this.setFloors(t)}else if(this.facility&&!this.level){this.filterMenuType=`facility`;let e=this.getFacility(this.facility),t=this.getBaseLevel(e);this.site||=e?.siteId||void 0,this.level=t?.id||void 0,this.setFloors(t)}else if(!this.facility&&this.level){this.filterMenuType=`facility`;let e=this.getLevel(this.level),t=this.getFacility(e?.facilityId);this.facility=t?.id||void 0,this.site||=t?.siteId||void 0,this.setFloors(e)}else if(this.site&&!this.facility&&!this.level)this.filterMenuType=`site`,this.setFloors(null);else{if(!e||!_(e)){this.setFloors(null);return}let t=e?.widgets?.floorFilter;if(!t){this.setFloors(null);return}t.site&&!this.site&&(this.site=t.site,this.filterMenuType=`facility`),this.setFloors(null)}if(this.filterLayers?.levelLayer?.type===`feature`&&this.filterLayers.levelLayer.capabilities.data.supportsAttachment&&this.mediaLayer==null){let{levelLayer:e}=this.filterLayers,{default:t}=await import(`../../layers/MediaLayer.js`);this.mediaLayer=new t({blendMode:`normal`,listMode:`hide`,maxScale:e.maxScale,minScale:e.minScale,spatialReference:this.view.spatialReference.clone(),title:`floor-filter-media-layer`,visible:e.visible}),this.overlaysByFacility=new Map,this.overlaysByLevel=new Map,this.view.map.add(this.mediaLayer),this.getOverlays(!0)}}catch(e){a.getLogger(this).error(`Couldn't retrieve sites, facilities, and levels`,e)}}_callOverride(e,t){this._override(e,t)}async _updateFloorFilterFromMap(e){if(!e||!_(e))return;await this.view?.when();let t=e?.widgets?.floorFilter;t&&(this._isOverridden(`enabled`)||(this.enabled=t.enabled),this._isOverridden(`longNames`)||(this.longNames=t.longNames),this._isOverridden(`minimized`)||(this.minimized=t.minimized),this._isOverridden(`pinnedLevels`)||(this.pinnedLevels=t.pinnedLevels),this._isOverridden(`site`)||(this.site=t.site),this._isOverridden(`facility`)||(this.facility=t.facility),this._isOverridden(`level`)||(this.level=t.level))}_updateMediaLayer(e){let{mediaLayer:t,overlaysByLevel:n}=this;if(t&&n&&e?.length){let r=t.source;r.elements.removeAll(),n.get(e)?.visible===!0&&r.elements.push(n.get(e)?.image)}}_computeViewAllModeFloors(e){let{filterFeatures:t}=this;if(e.floorInfo?.viewAllMode&&this.hasLevels&&this.hasFacilities&&this.filterMode===`base-floors`){let{level:n,facility:i}=this,a=[];t.levels.levelsInfo.forEach(e=>{let{id:t,facilityId:r}=e;i&&r===i?n&&t===n&&a.push(t):a.push(t)}),e.floorInfo.viewAllLevelIds=new r(a)}}};e([f({value:!1})],b.prototype,`enabled`,null),e([f({value:void 0})],b.prototype,`facility`,null),e([f({value:null})],b.prototype,`filterFeatures`,null),e([f({value:null})],b.prototype,`filterLayers`,null),e([f()],b.prototype,`filterMenuOpen`,void 0),e([f()],b.prototype,`filterMenuType`,void 0),e([f()],b.prototype,`filterMode`,void 0),e([f({readOnly:!0,value:`belowSelected`})],b.prototype,`floorVisibilityMode`,null),e([f()],b.prototype,`hasFacilities`,null),e([f()],b.prototype,`hasLevels`,null),e([f()],b.prototype,`hasMultipleSites`,null),e([f({readOnly:!0})],b.prototype,`isNormalMode`,null),e([f({value:void 0})],b.prototype,`level`,null),e([f({value:!1})],b.prototype,`longNames`,null),e([f()],b.prototype,`levelsExpanded`,void 0),e([f()],b.prototype,`mediaLayer`,void 0),e([f({value:!1})],b.prototype,`minimized`,null),e([f()],b.prototype,`overlaysByFacility`,void 0),e([f()],b.prototype,`overlaysByLevel`,void 0),e([f({value:!1})],b.prototype,`pinnedLevels`,null),e([f()],b.prototype,`searchTerm`,void 0),e([f({readOnly:!0})],b.prototype,`selectedVerticalOrder`,null),e([f({value:void 0})],b.prototype,`site`,null),e([f({readOnly:!0})],b.prototype,`state`,null),e([f({readOnly:!0,value:!1})],b.prototype,`useVerticalOrder`,null),e([f()],b.prototype,`view`,void 0),e([f()],b.prototype,`_viewHeightBreakpoint`,void 0),e([f()],b.prototype,`_viewWidthBreakpoint`,void 0),e([f()],b.prototype,`updateWebDocument`,null),b=e([p(`esri.widgets.FloorFilter.FloorFilterViewModel`)],b);const x=b;export{x as default};
2
+ import{__decorate as e}from"tslib";import t from"../../core/Accessor.js";import{createTask as n}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import i from"../../core/Error.js";import a from"../../core/Logger.js";import{throwIfAborted as o}from"../../core/promiseUtils.js";import{watch as s,initial as c,syncAndInitial as l}from"../../core/reactiveUtils.js";import{Milliseconds as u}from"../../core/time.js";import{isBlobProtocol as d}from"../../core/urlUtils.js";import{property as f,subclass as p}from"../../core/accessorSupport/decorators.js";import m from"../../geometry/Polygon.js";import h from"../../webdoc/Widgets.js";import g from"../../webdoc/widgets/FloorFilter.js";import{isWebMap as _}from"../../webmap/utils.js";import{GoTo as v}from"../support/GoTo.js";function y(e){return e.declaredClass===`esri.WebScene`}let b=class extends v(t){constructor(e){super(e),this.filterMenuOpen=!1,this.filterMenuType=`site`,this.filterMode=`base-floors`,this.levelsExpanded=!0,this.searchTerm=null,this.view=null,this._updateFloorFilterTask=null,this._viewHeightBreakpoint=null,this._viewWidthBreakpoint=null}initialize(){this.addHandles([s(()=>this.view?.map,e=>{this._updateFloorFilterTask!=null&&(this._updateFloorFilterTask.abort(),this._updateFloorFilterTask=null),this._updateFloorFilterTask=n(async t=>{await this._updateFloorFilterFromMap(e),o(t),this._setInitialViewState(e)}),this._watchMapLayers(e)},c),s(()=>this.view,(e,t)=>{this._unregisterWidget(t),this._registerWidget(e),this._watchSearchResults(e)},l),s(()=>this.mediaLayer,e=>{this._watchLayerVisibility(e)},l),s(()=>this.view?.widthBreakpoint??null,e=>{this._viewWidthBreakpoint=e}),s(()=>this.view?.heightBreakpoint??null,e=>{this._viewHeightBreakpoint=e}),s(()=>this.facility,()=>void this.getOverlays()),s(()=>this.level,e=>this._updateMediaLayer(e))])}destroy(){if(this._unregisterWidget(this.view),this.mediaLayer&&this.view?.map.remove(this.mediaLayer),this.overlaysByLevel){for(let e of this.overlaysByLevel.values()){let t=e.image.image;d(t)&&URL.revokeObjectURL(t)}this.overlaysByFacility?.clear(),this.overlaysByLevel.clear()}this.view=null,this._updateFloorFilterTask!=null&&(this._updateFloorFilterTask.abort(),this._updateFloorFilterTask=null)}set enabled(e){this._callOverride(`enabled`,e)}set facility(e){if(e&&this._isOverridden(`facility`)){let t=this.getFacility(e);this.hasMultipleSites&&(this.site=t?.siteId||null)}this._callOverride(`facility`,e)}set filterFeatures(e){this._callOverride(`filterFeatures`,e)}set filterLayers(e){this._callOverride(`filterLayers`,e)}get floorVisibilityMode(){return this.view&&y(this.view?.map)?this.view.map.widgets?.floorFilter?.floorVisibilityMode??`belowSelected`:`belowSelected`}get hasFacilities(){return this.filterLayers?.facilityLayer!=null&&this.filterFeatures?.facilities?.facilitiesInfo?.length>0}get hasLevels(){return this.filterLayers?.levelLayer!=null&&this.filterFeatures?.levels?.levelsInfo?.length>0}get hasMultipleSites(){return this.filterLayers?.siteLayer!=null&&this.filterFeatures?.sites?.sitesInfo?.length>1}get isNormalMode(){let e=!0,t=this._viewWidthBreakpoint;return(this._viewHeightBreakpoint===`xsmall`||t===`xsmall`)&&(e=!1),e}set level(e){if(!e){this._callOverride(`level`,e),this.facility=null,this.site=null,this.setFloors(null);return}let t=null,n=null,r=e?.split(`--`);r?.length>1&&r[0]===`all`?(n=r[1],t={id:e,facilityId:n,shortName:null,longName:null,levelNumber:null,verticalOrder:null}):(t=this.getLevel(e),n=t?.facilityId??null),this.level===e&&!this.isNormalMode&&!this.levelsExpanded?this.getFacilityLevels(n)?.length>1&&(this.levelsExpanded=!0):(t&&this.hasFacilities&&this.hasLevels?(this.facility=n,this.hasMultipleSites&&(this.site=this.getFacility(n)?.siteId||null),this.setFloors(t)):this._isOverridden(`level`)&&(this.facility=null,this.site=null,this.hasMultipleSites&&(this.filterMenuType=`site`),this.setFloors(null)),this._callOverride(`level`,e))}set longNames(e){this._callOverride(`longNames`,e)}set minimized(e){this._callOverride(`minimized`,e)}set pinnedLevels(e){this._callOverride(`pinnedLevels`,e)}get selectedVerticalOrder(){return _(this.view?.map)?this.view.map.resourceInfo?.widgets?.floorFilter?.selectedVerticalOrder??null:null}set site(e){this._callOverride(`site`,e)}get state(){return this.view&&this.filterFeatures&&this.hasFacilities&&this.hasLevels?`ready`:this.view&&!this.filterFeatures?`loading`:`disabled`}get useVerticalOrder(){return this.view?.map==null?!1:_(this.view?.map)||y(this.view.map)?this.view.map.widgets?.floorFilter?.useVerticalOrder??!1:!1}filterFacilities(e){let t=e;return this.searchTerm&&(this.searchTerm=this.searchTerm.trim(),t=e.filter(e=>{let{name:t}=e;return t.toLowerCase().includes(this.searchTerm?.toLowerCase())})),this.site&&(t=t.filter(e=>e.siteId===this.site)),t.sort((e,t)=>{let n=e.name,r=t.name;return n.localeCompare(r,void 0,{sensitivity:`base`})})}filterSites(e){let t=e;return this.searchTerm&&(this.searchTerm=this.searchTerm.trim(),t=e.filter(e=>{let{name:t}=e;return t.toLowerCase().includes(this.searchTerm?.toLowerCase())})),t.sort((e,t)=>{let n=e.name,r=t.name;return n.localeCompare(r,void 0,{sensitivity:`base`})})}getBaseLevel(e){let t=this.filterFeatures?.levels?.levelsInfo,n=null;if(e){let{id:r}=e;if(t&&t.length>0&&(t.forEach(e=>{e.verticalOrder===0&&e.facilityId===r&&(n=e)}),!n)){let e=null;t.forEach(t=>{t.facilityId===r&&(e?(t.verticalOrder??0)>=0?e.verticalOrder!=null&&(e.verticalOrder<0||(t.verticalOrder??0)<e.verticalOrder)&&(e=t):e.verticalOrder!=null&&t.verticalOrder!=null&&e.verticalOrder<0&&t.verticalOrder>e.verticalOrder&&(e=t):e=t)}),e&&(n=e)}}return n}getFacility(e){return this.filterFeatures?.facilities?.facilitiesInfo?.find(t=>t.id===e)??null}getFacilityLevels(e){return!e||!this.filterFeatures?.levels?.levelsInfo?[]:this.filterFeatures.levels.levelsInfo.filter(t=>t.facilityId===e).sort((e,t)=>{let n=e.verticalOrder??0,r=t.verticalOrder??0;return n>r?-1:n===r?0:1})}getLevel(e){return this.filterFeatures?.levels?.levelsInfo?.find(t=>t.id===e)??null}async getOverlays(e=!1){let{facility:t,level:n,mediaLayer:i,overlaysByFacility:a,overlaysByLevel:o,view:s}=this;if(_(s?.map)&&i){if((i?.source).elements.removeAll(),t?.length&&(!a?.has(t)||e)){a?.set(t,new r);let e=s.map.floorInfo?.levelLayer?.layerId,n=s.map.findLayerById(e??``);if(!n||s.type!==`2d`)return;let i=await this._getAttachments(n,t),{default:c}=await import(`../../request.js`),l=Object.keys(i).map(async e=>{let r=i[e],s=r.find(e=>e.contentType===`application/json`);if(!s?.url)return;let l=new URL(s.url);n.gdbVersion?.length&&l.searchParams.set(`gdbVersion`,n.gdbVersion);let{data:u}=await c(l.toString(),{responseType:`json`}),d=r.find(e=>e.name===u.name),f=d?.url??``;if(f?.length>0){let e=new URL(f);e.searchParams.delete(`token`),n.gdbVersion?.length&&e.searchParams.set(`gdbVersion`,n.gdbVersion);let{default:r}=await import(`../../layers/support/ControlPointsGeoreference.js`),i=r.fromJSON(u.georeference),c=await this.toImageElement(e.toString(),i,u.opacity,u.clipImage,u.geometry);await c.load();let l={...u,attachments:[s,d],facilityId:t,image:c,source:JSON.stringify(u),url:e.toString()};o?.set(l.levelId,l),a?.get(t)?.push(l)}});await Promise.all(l)}this._updateMediaLayer(n)}}getSite(e){return this.filterFeatures?.sites?.sitesInfo?.find(t=>t.id===e)??null}async goTo(e){let{view:t}=this;if(!t||!e)return;let{geometry:n}=e;if(n?.extent){let e=e=>{this.callGoTo({target:e,options:{duration:u(1e3),easing:`quad-in-out-coast`}})};if(n.hasZ&&n.spatialReference?.vcsWkid!==t.spatialReference?.vcsWkid){let{projectIsLoaded:r,projectLoad:i,projectExecute:a}=await import(`../../geometry/operators/projectOperator.js`);r()||await i();let o=a(n.extent,t.spatialReference.clone(),{zConversionDisabled:!0});o&&e(o)}else e(n.extent)}}setFloors(e){let{view:t}=this;t&&(t?.map?.allLayers?.forEach(e=>{e.type===`feature`&&this._computeViewAllModeFloors(e)}),t.floors=new r(this._computeFloors(e)))}async toImageElement(e,t,n,r,i){let{default:o}=await import(`../../layers/support/ImageElement.js`),{facility:s}=this,c=()=>new o({image:e,georeference:t,opacity:n});if(r)try{let r=i?m.fromJSON(i):this.getFacility(s)?.geometry;if(r==null)return c();let{pixelRings:a,width:l,height:u}=await this._polygonToImagePixels(t,r),d=await this._imagePolygonToBlob(e,a,l,u);return new o({image:URL.createObjectURL(d),georeference:t,opacity:n})}catch(e){return a.getLogger(this).warn(`Unable to clip image; using full image instead: ${e.message}`,e),c()}return c()}updateWebDocument(e){if(_(e)||y(e)){let t={enabled:this.enabled,longNames:this.longNames,minimized:this.minimized,pinnedLevels:this.pinnedLevels,site:this.site??null,facility:this.facility??null,level:this.level??null,useVerticalOrder:this.useVerticalOrder,selectedVerticalOrder:this.selectedVerticalOrder};y(e)&&(t.floorVisibilityMode=this.floorVisibilityMode);let n=new g(t);e.widgets??=new h,e.widgets.floorFilter=n}}_computeFloors(e){if(this.filterMode===`single-floor`)this._computeSingleFloor(e);else if(this.filterMode===`base-floors`)return this.view?.type===`3d`?this._computeBaseFloors3D(e):this._computeBaseFloors(e);return this._computeEmptyFloors()}_computeSingleFloor(e){if(!e)return this._computeEmptyFloors();let t=[];return e?.id===`all`?this.getFacilityLevels(e.facilityId).forEach(e=>{e.id&&t.push(e.id)}):e&&t.push(e.id),t}_computeBaseFloors(e){let t=this.filterFeatures?.levels?.levelsInfo;if(!t?.length)return this._computeEmptyFloors();let n=[];e?.id===`all`?this.getFacilityLevels(e.facilityId).forEach(e=>{e.id&&n.push(e.id)}):e&&n.push(e.id);let r=e?.facilityId,i=e?.verticalOrder,a=(e,t)=>{e===0&&n.push(t)};return t.forEach(e=>{let{id:t,facilityId:o,verticalOrder:s}=e;!r&&!n.includes(t)?a(s,t):o!==r&&!n.includes(t)&&(this.useVerticalOrder?s===i&&n.push(t):a(s,t))}),n}_computeBaseFloors3D(e){let t=this.filterFeatures?.levels?.levelsInfo;if(!t?.length)return this._computeEmptyFloors();let n=[],r=e?.id.split(`--`)??[],i=r?.length>1&&r[0]===`all`;i?this.getFacilityLevels(e?.facilityId).forEach(e=>{e.id&&n.push(e.id)}):e&&n.push(e.id);let a=e?.facilityId,o=e?.verticalOrder;return t.forEach(e=>{let{id:t,facilityId:r,verticalOrder:s}=e;if(!a&&!n.includes(t))n.push(t);else if(!n.includes(t)){let{floorVisibilityMode:e,useVerticalOrder:c}=this,l=s<=o;r===a?e===`belowSelected`&&l&&n.push(t):(i||!c||e===`selectedOnly`&&s===o||e===`belowSelected`&&l)&&n.push(t)}}),n}_computeEmptyFloors(){return[]}async _setFilterLayers(){let{view:e}=this;if(e&&!this._isOverridden(`filterLayers`)){if(!_(e.map)&&!y(e.map))throw new i(`floorfilter:unsupported-map`,`Map must be a webmap or webscene`);{let t=e.map,n=t?.allLayers;if(n?.items?.length>0){let e={siteLayer:null,facilityLayer:null,levelLayer:null},r=t.floorInfo?.siteLayer?.layerId,i=t.floorInfo?.facilityLayer?.layerId,a=t.floorInfo?.levelLayer?.layerId,o=t.floorInfo?.siteLayer?.sublayerId||t.floorInfo?.facilityLayer?.sublayerId||t.floorInfo?.levelLayer?.sublayerId;if(!i||!a)return;let s=n.items.filter(e=>e.type===`feature`||e.type===`scene`),c=n.items.filter(e=>e.type===`map-image`);if(c?.length>0&&o){await Promise.all(c.map(e=>e.load()));let n=t.floorInfo?.siteLayer?.sublayerId,o=t.floorInfo?.facilityLayer?.sublayerId,s=t.floorInfo?.levelLayer?.sublayerId;c.forEach(t=>{let c=t.id,l=t?.allSublayers,u=l?.items;(c===r||c===i||c===a)&&u?.length>0&&l.items.forEach(t=>{let i=t.id;c===r&&i===n?e.siteLayer=t:i===o?e.facilityLayer=t:i===s&&(e.levelLayer=t)})})}s?.length>0&&s.forEach(t=>{let n=t.id;n===r?e.siteLayer=t:n===i?e.facilityLayer=t:n===a&&(e.levelLayer=t)}),this.filterLayers=e}}}}async _getAttachments(e,t){let{view:n}=this;if(_(n?.map)){let{facilityIdField:r}=n.map.floorInfo?.levelLayer??{};if(e&&n.type===`2d`&&t?.length>0&&e.capabilities.data.supportsAttachment)return e.queryAttachments({returnMetadata:!0,where:`${r} = '${t}'`})}return{}}async _getFilterFeatures(){if(this._isOverridden(`filterFeatures`))return this.filterFeatures;let[e,t,n]=await Promise.all([this._getSites(),this._getFacilities(),this._getLevels()]);return{sites:e,facilities:t,levels:n}}async _getSites(){let e={sitesInfo:[]},{filterLayers:t,view:n}=this,r=n?.map,{siteLayer:i}=t;if(!i||!r?.floorInfo?.siteLayer)return e;let a=i.createQuery();a.returnGeometry=!0,a.outFields=[`*`],a.returnZ=!0,`type`in i&&i.type===`scene`&&(a.multipatchOption=`xyFootprint`);let{siteIdField:o,nameField:s}=r.floorInfo.siteLayer,c=await i.queryFeatures(a);if(c?.features?.length>0){let t=c.features,n=i?.fieldsIndex.get(o)?.name||o,r=i?.fieldsIndex.get(s)?.name||s;n!=null&&r!=null&&t.forEach(t=>{let i=t.attributes,a=t.geometry,o=i[n],s=i[r];o&&s&&e.sitesInfo.push({id:o,name:s,geometry:a})})}return e}async _getFacilities(){let{filterLayers:e,view:t}=this,n=t?.map,{facilityLayer:r}=e,i={facilitiesInfo:[]};if(!r||!n?.floorInfo?.facilityLayer)return i;let a=r.createQuery();a.returnGeometry=!0,a.outFields=[`*`],a.returnZ=!0,`type`in r&&r.type===`scene`&&(a.multipatchOption=`xyFootprint`);let{facilityIdField:o,siteIdField:s,nameField:c}=n.floorInfo.facilityLayer,l=await r.queryFeatures(a);if(l?.features?.length>0){let e=l.features,t=r?.fieldsIndex.get(o)?.name||o,n=r?.fieldsIndex.get(s)?.name||s,a=r?.fieldsIndex.get(c)?.name||c;t&&n&&a&&e.forEach(e=>{let r=e.attributes,o=e.geometry,s=r[t],c=r[n],l=r[a];s&&l&&i.facilitiesInfo.push({id:s,siteId:c,name:l,geometry:o})})}return i}async _getLevels(){let{filterLayers:e,view:t}=this,n=t?.map,{levelLayer:r}=e,i={levelsInfo:[]};if(!r||!n?.floorInfo?.levelLayer)return i;let a=r.createQuery();a.returnGeometry=!0,a.outFields=[`*`],a.returnZ=!0;let{levelIdField:o,facilityIdField:s,longNameField:c,shortNameField:l,levelNumberField:u,verticalOrderField:d}=n.floorInfo.levelLayer,f=await r.queryFeatures(a);if(f?.features?.length>0){let e=f.features,t=r?.fieldsIndex.get(o)?.name||o,n=r?.fieldsIndex.get(s)?.name||s,a=r?.fieldsIndex.get(c)?.name||c,p=r?.fieldsIndex.get(l)?.name||l,m=r?.fieldsIndex.get(u)?.name||u,h=r?.fieldsIndex.get(d)?.name||d;t&&n&&a&&p&&m&&h&&e.forEach(e=>{let r=e.attributes,o=r[t],s=r[n],c=r[a],l=r[p],u=r[m],d=r[h];o&&s&&c&&l&&typeof u==`number`&&typeof d==`number`&&i.levelsInfo.push({id:o,facilityId:s,longName:c,shortName:l,levelNumber:u,verticalOrder:d})})}return i}async _imagePolygonToBlob(e,t,n,r){let{getImageData:a}=await import(`../../core/imageUtils.js`),o=await a(e),s=new OffscreenCanvas(n,r),c=s.getContext(`2d`);if(!c)throw new i(`floorfilter:floor-plan-overlay`,`Unable to obtain a rendering context from the canvas.`);let l=new Path2D;for(let e of t)if(!(e.length<3)){l.moveTo(e[0].x,e[0].y);for(let t=1;t<e.length;t++)l.lineTo(e[t].x,e[t].y);l.closePath()}return c.save(),c.clip(l,`evenodd`),c.drawImage(o,0,0,n,r),c.restore(),await s.convertToBlob({type:`image/png`})}async _polygonToImagePixels(e,t){if(e?.type!==`control-points`)throw new i(`floorfilter:floor-plan-overlay`,"Expected a `ControlPointsGeoreference`.");let{default:n}=await import(`../../geometry/Point.js`);return{pixelRings:t.rings.map(r=>r.map(([r,a])=>{let o=new n({x:r,y:a,spatialReference:t.spatialReference}),s=e.toSource(o);if(!s)throw new i(`floorfilter:floor-plan-overlay`,`toSource() returned null; check spatial references and projectOperator.`);return{x:s.x,y:s.y}})),width:e.width,height:e.height}}_registerWidget(e){e?.registerComponent(this)}_unregisterWidget(e){e?.unregisterComponent(this)}_watchLayerVisibility(e){if(this.filterLayers?.levelLayer?.type===`feature`&&e){let t=this.filterLayers?.levelLayer;this.addHandles(s(()=>t.visible,t=>{e.visible=t},l))}}_watchMapLayers(e){this.removeHandles(`layers-handle`),e&&this.addHandles(e.allLayers.on(`after-remove`,t=>{if(t.item){let r=e.floorInfo,i=r?.siteLayer?.layerId??``,a=r?.facilityLayer?.layerId??``,s=r?.levelLayer?.layerId??``;(t.item.id===a||t.item.id===s||t.item.id===i)&&(this._updateFloorFilterTask!=null&&(this._updateFloorFilterTask.abort(),this._updateFloorFilterTask=null),this._updateFloorFilterTask=n(async t=>{o(t),this.level=null,this.filterMenuOpen=!1,this._clearOverride(`filterLayers`),this._clearOverride(`filterFeatures`),this._setInitialViewState(e)}))}}),`layers-handle`)}_watchSearchResults(e){e?.on(`select-result-floor`,e=>{let t=this.getLevel(e);t&&this.level!==e&&(this.level=e,this.setFloors(t))})}async _setInitialViewState(e){if(this.view)try{await this.view.when(),await this._setFilterLayers();let t=await this._getFilterFeatures();if(!t)return;if(this.filterFeatures=t,!this.hasFacilities||!this.hasLevels){a.getLogger(this).error(`Facilities and Levels are required for the Floor Filter widget`);return}if(this.hasMultipleSites||(this.filterMenuType=`facility`),this.facility&&this.level){this.filterMenuType=`facility`;let e=this.getFacility(this.facility),t=this.getLevel(this.level);this.site||=e?.siteId||void 0,this.setFloors(t)}else if(this.facility&&!this.level){this.filterMenuType=`facility`;let e=this.getFacility(this.facility),t=this.getBaseLevel(e);this.site||=e?.siteId||void 0,this.level=t?.id||void 0,this.setFloors(t)}else if(!this.facility&&this.level){this.filterMenuType=`facility`;let e=this.getLevel(this.level),t=this.getFacility(e?.facilityId);this.facility=t?.id||void 0,this.site||=t?.siteId||void 0,this.setFloors(e)}else if(this.site&&!this.facility&&!this.level)this.filterMenuType=`site`,this.setFloors(null);else{if(!e||!_(e)){this.setFloors(null);return}let t=e?.widgets?.floorFilter;if(!t){this.setFloors(null);return}t.site&&!this.site&&(this.site=t.site,this.filterMenuType=`facility`),this.setFloors(null)}if(this.filterLayers?.levelLayer?.type===`feature`&&this.filterLayers.levelLayer.capabilities.data.supportsAttachment&&this.mediaLayer==null){let{levelLayer:e}=this.filterLayers,{default:t}=await import(`../../layers/MediaLayer.js`);this.mediaLayer=new t({blendMode:`normal`,listMode:`hide`,maxScale:e.maxScale,minScale:e.minScale,spatialReference:this.view.spatialReference.clone(),title:`floor-filter-media-layer`,visible:e.visible}),this.overlaysByFacility=new Map,this.overlaysByLevel=new Map,this.view.map.add(this.mediaLayer),this.getOverlays(!0)}}catch(e){a.getLogger(this).error(`Couldn't retrieve sites, facilities, and levels`,e)}}_callOverride(e,t){this._override(e,t)}async _updateFloorFilterFromMap(e){if(!e||!_(e))return;await this.view?.when();let t=e?.widgets?.floorFilter;t&&(this._isOverridden(`enabled`)||(this.enabled=t.enabled),this._isOverridden(`longNames`)||(this.longNames=t.longNames),this._isOverridden(`minimized`)||(this.minimized=t.minimized),this._isOverridden(`pinnedLevels`)||(this.pinnedLevels=t.pinnedLevels),this._isOverridden(`site`)||(this.site=t.site),this._isOverridden(`facility`)||(this.facility=t.facility),this._isOverridden(`level`)||(this.level=t.level))}_updateMediaLayer(e){let{mediaLayer:t,overlaysByLevel:n}=this;if(t&&n&&e?.length){let r=t.source;r.elements.removeAll(),n.get(e)?.visible===!0&&r.elements.push(n.get(e)?.image)}}_computeViewAllModeFloors(e){let{filterFeatures:t}=this;if(e.floorInfo?.viewAllMode&&this.hasLevels&&this.hasFacilities&&this.filterMode===`base-floors`){let{level:n,facility:i}=this,a=[];t.levels.levelsInfo.forEach(e=>{let{id:t,facilityId:r}=e;i&&r===i?n&&t===n&&a.push(t):a.push(t)}),e.floorInfo.viewAllLevelIds=new r(a)}}};e([f({value:!1})],b.prototype,`enabled`,null),e([f({value:void 0})],b.prototype,`facility`,null),e([f({value:null})],b.prototype,`filterFeatures`,null),e([f({value:null})],b.prototype,`filterLayers`,null),e([f()],b.prototype,`filterMenuOpen`,void 0),e([f()],b.prototype,`filterMenuType`,void 0),e([f()],b.prototype,`filterMode`,void 0),e([f({readOnly:!0,value:`belowSelected`})],b.prototype,`floorVisibilityMode`,null),e([f()],b.prototype,`hasFacilities`,null),e([f()],b.prototype,`hasLevels`,null),e([f()],b.prototype,`hasMultipleSites`,null),e([f({readOnly:!0})],b.prototype,`isNormalMode`,null),e([f({value:void 0})],b.prototype,`level`,null),e([f({value:!1})],b.prototype,`longNames`,null),e([f()],b.prototype,`levelsExpanded`,void 0),e([f()],b.prototype,`mediaLayer`,void 0),e([f({value:!1})],b.prototype,`minimized`,null),e([f()],b.prototype,`overlaysByFacility`,void 0),e([f()],b.prototype,`overlaysByLevel`,void 0),e([f({value:!1})],b.prototype,`pinnedLevels`,null),e([f()],b.prototype,`searchTerm`,void 0),e([f({readOnly:!0})],b.prototype,`selectedVerticalOrder`,null),e([f({value:void 0})],b.prototype,`site`,null),e([f({readOnly:!0})],b.prototype,`state`,null),e([f({readOnly:!0,value:!1})],b.prototype,`useVerticalOrder`,null),e([f()],b.prototype,`view`,void 0),e([f()],b.prototype,`_viewHeightBreakpoint`,void 0),e([f()],b.prototype,`_viewWidthBreakpoint`,void 0),e([f()],b.prototype,`updateWebDocument`,null),b=e([p(`esri.widgets.FloorFilter.FloorFilterViewModel`)],b);const x=b;export{x as default};
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkRemoteClient=self.webpackChunkRemoteClient||[]).push([[8278],{25728(e,r,t){t.d(r,{M:()=>S});var i=t(32198),a=t(69622),n=t(76953),s=t(4718);class o{constructor(){this._propertyOriginMap=new Map,this._originStores=Array(8),this._values=new Map,this.multipleOriginsSupported=!0}clone(e){let r=new o,t=this._originStores[0];t&&t.forEach((e,t)=>{r.set(t,(0,s.o8)(e),0)});for(let t=2;t<8;t++){let i=this._originStores[t];i&&i.forEach((i,a)=>{e&&e.has(a)||r.set(a,(0,s.o8)(i),t)})}return r}get(e,r){let t=void 0===r?this._values:this._originStores[r];return t?t.get(e):void 0}keys(e){let r=null==e?this._values:this._originStores[e];return r?[...r.keys()]:[]}set(e,r,t=7){let i=this._originStores[t];if(i||(i=new Map,this._originStores[t]=i),i.set(e,r),!this._values.has(e)||this._propertyOriginMap.get(e)<=t){let i=this._values.get(e);return this._values.set(e,r),this._propertyOriginMap.set(e,t),i!==r}return!1}delete(e,r=7){let t=this._originStores[r];if(!t)return;let i=t.get(e);if(t.delete(e),this._values.has(e)&&this._propertyOriginMap.get(e)===r){this._values.delete(e);for(let t=r-1;t>=0;t--){let r=this._originStores[t];if(r&&r.has(e)){this._values.set(e,r.get(e)),this._propertyOriginMap.set(e,t);break}}}return i}has(e,r){let t=void 0===r?this._values:this._originStores[r];return!!t&&t.has(e)}revert(e,r){for(;r>0&&!this.has(e,r);)--r;let t=this._originStores[r]?.get(e),i=this._values.get(e);return this._values.set(e,t),this._propertyOriginMap.set(e,r),i!==t}originOf(e){return this._propertyOriginMap.get(e)||0}isAtOrigin(e,r){return this.has(e,r)&&this.originOf(e)===r}isBelowOrigin(e,r){return!this.has(e)||this.originOf(e)<r}forEach(e){this._values.forEach(e)}}var l=t(35666),y=t(45917),p=t(88620),u=t(64108);const d=e=>{let r=e,t=class extends r{constructor(...e){super(...e);let r=(0,p.oY)(this),t=r.store,i=new o;r.store=i,(0,n.k)(r,t,i)}read(e,r){(0,y.L)(this,e,r)}getAtOrigin(e,r){let t=c(this),i=(0,l.aB)(r);return t.get(e,i)}originOf(e){return(0,l.OL)(this.originIdOf(e))}originIdOf(e){return c(this).originOf(e)}revertToOrigin(e,r){let t=c(this),i=(0,l.aB)(r),a=(0,p.oY)(this);"*"===e&&t.keys(i).forEach(e=>this.revertToOrigin(e,r)),a.invalidate(e),t.revert(e,i),a.commit(e)}revertAllToOrigin(e){let r=c(this),t=(0,l.aB)(e);r.keys(t).forEach(r=>this.revertToOrigin(r,e))}};return t=(0,i.Cg)([(0,u.$)("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function c(e){return(0,p.oY)(e).store}d(a.A);var g=t(91429),m=t(16649),L=t(49422);const h=e=>{let r=e,t=class extends r{constructor(...e){super(...e)}clear(e,r="user"){(0,p.oY)(this).clearOrigin(e,(0,l.aB)(r))}write(e,r){return e||={},(0,L.M)(this,e,r),e}setAtOrigin(e,r,t){(0,p.oY)(this).setAtOrigin(e,r,(0,l.aB)(t))}removeOrigin(e){let r=v(this),t=(0,l.aB)(e),i=r.keys(t);for(let e of i)r.originOf(e)===t&&r.set(e,r.get(e,t),7)}updateOrigin(e,r){let t=v(this),i=(0,l.aB)(r),a=(0,m.Jt)(this,e);for(let r=i+1;r<8;++r)t.delete(e,r);t.set(e,a,i)}toJSON(e){return this.write({},e)}};return t=(0,i.Cg)([(0,g.$K)("esri.core.WriteableMultiOriginJSONMixin")],t),t.prototype.toJSON.isDefaultToJSON=!0,t};function v(e){return(0,p.oY)(e).store}const S=e=>{let r=h(d(e)),t=class extends r{};return t=(0,i.Cg)([(0,u.$)("esri.core.MultiOriginJSONSupport")],t),t};S(a.A)},89317(e,r,t){t.d(r,["K",0,["operational-layers","basemap-base-layers","basemap-ground-layers","ground"]])},34287(e,r,t){var i=t(32198),a=t(49186),n=t(84952),s=t(91429),o=t(78888),l=t(89317),y=t(45917),p=t(49422),u=t(10873),d=t(6345),c=t(79677),g=t(59923),m=t(36005),L=t(43937);t.d(r,["q",0,e=>{let r=e,t=class extends r{constructor(){super(...arguments),this.persistenceEnabled=!0,this.title=null}readId(e,r,t){return"Group Layer"===t?.portalItem?.type?void 0:e}writeListMode(e,r,t,i){(i&&"ground"===i.layerContainerType||e&&(0,p.R)(this,t,{},i))&&(r[t]=e)}writeOperationalLayerType(e,r,t){e&&(r[t]=e)}writeTitle(e,r){r.title=e??"Layer"}readVisibilityTimeExtent(e){return e?c.A.fromArray(e):null}writeVisibilityTimeExtent(e,r,t,i){e&&"tables"!==i.layerContainerType&&(e.isEmpty?i?.messages&&i.messages.push(new a.A("layer:invalid-visibilityTimeExtent","visibilityTimeExtent cannot be empty")):r[t]=e.toArray())}read(e,r){r&&(r.layer=this),(0,y.t)(this,e,r=>super.read(e,r),r)}write(e,r){if(!this.persistenceEnabled&&!r?.ignorePersistenceEnabled)return null;if(r?.origin&&!(0,d.Bu)(r,this.operationalLayerType,this.type))return(0,g.U4)(r,this),null;let t=super.write(e,{...r,layer:this}),i=!!r&&!!r.messages&&!!r.messages.filter(e=>e instanceof a.A&&"web-document-write:property-required"===e.name).length;return(0,n.w8)(t?.url)?(r?.messages?.push(new a.A("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&i?null:t}beforeSave(){}};return(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],t.prototype,"id",void 0),(0,i.Cg)([(0,m.w)("id",["id"])],t.prototype,"readId",null),(0,i.Cg)([(0,s.MZ)(u.C1)],t.prototype,"listMode",void 0),(0,i.Cg)([(0,L.K)("listMode")],t.prototype,"writeListMode",null),(0,i.Cg)([(0,s.MZ)({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1},"web-scene":{name:"layerType",read:!1,write:{enabled:!0,ignoreOrigin:!0,layerContainerTypes:l.K,isRequired:!0}}}}})],t.prototype,"operationalLayerType",void 0),(0,i.Cg)([(0,L.K)("operationalLayerType")],t.prototype,"writeOperationalLayerType",null),(0,i.Cg)([(0,s.MZ)(u.ke)],t.prototype,"opacity",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,readOnly:!1})],t.prototype,"persistenceEnabled",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],t.prototype,"title",void 0),(0,i.Cg)([(0,L.K)("title"),(0,L.K)(["web-scene"],"title")],t.prototype,"writeTitle",null),(0,i.Cg)([(0,s.MZ)({type:c.A,json:{origins:{"web-scene":{write:{layerContainerTypes:l.K}}}}})],t.prototype,"visibilityTimeExtent",void 0),(0,i.Cg)([(0,m.w)("visibilityTimeExtent")],t.prototype,"readVisibilityTimeExtent",null),(0,i.Cg)([(0,L.K)(["portal-item","web-map","web-scene"],"visibilityTimeExtent",{visibilityTimeExtent:{type:[[o.jz,o.Uv]]}})],t.prototype,"writeVisibilityTimeExtent",null),(0,i.Cg)([(0,s.MZ)({type:Boolean,json:{name:"visibility",write:{layerContainerTypes:l.K}}})],t.prototype,"visible",void 0),t=(0,i.Cg)([(0,s.$K)("esri.layers.mixins.OperationalLayer")],t),t}])},96184(e,r,t){t.d(r,{A:()=>g});var i=t(32198),a=t(69540),n=t(25482),s=t(91429),o=t(73133),l=t(79677),y=t(10184),p=t(56400),u=t(36005),d=t(43937);function c(e,r){return y.A.fromJSON({value:e,unit:r})}let g=class extends((0,a.OU)(n.o)){constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeZone=null,this.trackIdField=null,this.useTime=!0,this.stops=null}readFullTimeExtent(e,r){return r.timeExtent&&Array.isArray(r.timeExtent)&&2===r.timeExtent.length?l.A.fromArray(r.timeExtent):null}writeFullTimeExtent(e,r){null!=e?.start&&null!=e.end&&(r.timeExtent=e.toArray())}readInterval(e,r){return r.timeInterval&&r.timeIntervalUnits?c(r.timeInterval,r.timeIntervalUnits):r.defaultTimeInterval&&r.defaultTimeIntervalUnits?c(r.defaultTimeInterval,r.defaultTimeIntervalUnits):null}writeInterval(e,r){r.timeInterval=e?.toJSON().value??null,r.timeIntervalUnits=e?.toJSON().unit??null}};(0,i.Cg)([(0,s.MZ)({type:Boolean,json:{name:"exportOptions.timeDataCumulative",origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],g.prototype,"cumulative",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{name:"endTimeField",write:!0}})],g.prototype,"endField",void 0),(0,i.Cg)([(0,s.MZ)({type:l.A,json:{write:!0}})],g.prototype,"fullTimeExtent",void 0),(0,i.Cg)([(0,u.w)("fullTimeExtent",["timeExtent"])],g.prototype,"readFullTimeExtent",null),(0,i.Cg)([(0,d.K)("fullTimeExtent",{timeExtent:{type:[Number]}})],g.prototype,"writeFullTimeExtent",null),(0,i.Cg)([(0,s.MZ)({type:Boolean,json:{default:!1,write:!0}})],g.prototype,"hasLiveData",void 0),(0,i.Cg)([(0,s.MZ)({type:y.A,json:{write:!0}})],g.prototype,"interval",void 0),(0,i.Cg)([(0,u.w)("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],g.prototype,"readInterval",null),(0,i.Cg)([(0,d.K)("interval",{timeInterval:{type:Number},timeIntervalUnits:{type:o.j.jsonValues}})],g.prototype,"writeInterval",null),(0,i.Cg)([(0,s.MZ)({type:String,json:{name:"startTimeField",write:!0}})],g.prototype,"startField",void 0),(0,i.Cg)([(0,s.MZ)((0,p.P6)("timeReference",!0,!1))],g.prototype,"timeZone",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],g.prototype,"trackIdField",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,json:{name:"exportOptions.useTime",origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],g.prototype,"useTime",void 0),(0,i.Cg)([(0,s.MZ)({type:[Date],json:{read:!1}})],g.prototype,"stops",void 0),g=(0,i.Cg)([(0,s.$K)("esri.layers.support.TimeInfo")],g)},10873(e,r,t){t.d(r,{Qo:()=>v,U$:()=>E});var i=t(66552),a=t(89317),n=t(5443),s=t(16930),o=t(96184),l=t(97159),y=t(88625),p=t(43440),u=t(78553);const d={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:{enabled:!0,layerContainerTypes:a.K}}},c={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,r)=>!r.disablePopup},write:{enabled:!0,writer(e,r,t){r[t]=!e}}}},g={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:{enabled:!0,layerContainerTypes:a.K}}},m={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:l.w}}},L={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:{enabled:!0,layerContainerTypes:a.K}}},h={value:null,type:y.A,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:{enabled:!0,layerContainerTypes:a.K}}};function v(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const S={write:{enabled:!0,layerContainerTypes:a.K},read:!0},f={type:Number,json:{origins:{"web-document":S,"portal-item":{write:{layerContainerTypes:a.K}}}}},w={...f,json:{...f.json,origins:{"web-document":{...S,write:{enabled:!0,layerContainerTypes:a.K,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,r,t)=>t&&"service"!==t.origin||!r.drawingInfo||void 0===r.drawingInfo.transparency?r.layerDefinition?.drawingInfo&&void 0!==r.layerDefinition.drawingInfo.transparency?(0,u.D)(r.layerDefinition.drawingInfo.transparency):void 0:(0,u.D)(r.drawingInfo.transparency)}}},b={type:n.A,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,r)=>{let t=n.A.fromJSON(e);return null!=r.spatialReference&&"object"==typeof r.spatialReference&&(t.spatialReference=s.A.fromJSON(r.spatialReference)),t}}}},read:!1}},I={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},T={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.minScale",write:{layerContainerTypes:a.K}}},C={type:Number,json:{origins:{service:{write:{enabled:!1}}},name:"layerDefinition.maxScale",write:{layerContainerTypes:a.K}}},M={json:{write:{ignoreOrigin:!0,layerContainerTypes:a.K},origins:{"web-map":{read:!1,write:!1}}}},O={type:p.A,json:{name:"attributeTableInfo",write:!0}},A=new i.J({High:"high",Medium:"medium",Low:"low",None:"none"}),x={type:A.apiValues,json:{name:"layerDefinition.barrierWeight",default:"high",read:A.read,write:A.write,origins:{service:{read:!1}}}};function G(e){return{name:"layerDefinition.timeInfo",read:!0,write:{enabled:!0,overridePolicy(r,t){return{enabled:!0,ignoreOrigin:!!e&&this.originIdOf(t)<3}}}}}function E(e){let r=e?.alwaysWriteNonItemOrigin,t={[e?.webDocumentOrigin??"web-document"]:G(r),"portal-item":G(r)};return e?.disableServiceOrigin&&(t.service={read:!1,write:!1}),{type:o.A,json:{name:e?.name,origins:t}}}t.d(r,["C1",0,M,"Fm",0,b,"Ih",0,w,"M6",0,c,"OZ",0,m,"PY",0,d,"Yj",0,h,"es",0,x,"fV",0,L,"hG",0,C,"hn",0,T,"id",0,I,"kF",0,g,"ke",0,f,"zQ",0,O])},6345(e,r,t){t.d(r,{Bu:()=>S,VH:()=>v});var i=t(44208);const a={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},n={ArcGISAnnotationLayer:"AnnotationFeatureLayer",ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",ArcGISVideoLayer:"VideoLayer",BingMapsAerial:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",CatalogLayer:"CatalogLayer",CSV:"CSVLayer",GeoJSON:"GeoJSONLayer",GeoRSS:"GeoRSSLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",KnowledgeGraphLayer:"KnowledgeGraphLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",get ParquetLayer(){return(0,i.A)("parquetlayer-persistence-enabled")?"ParquetLayer":"UnsupportedLayer"},SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},s={ArcGISFeatureLayer:"FeatureLayer",SubtypeGroupTable:"SubtypeGroupLayer"},o={ArcGISImageServiceLayer:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WCS:"UnsupportedLayer",WMS:"UnsupportedLayer",WebTiledLayer:"WebTileLayer"},l={IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer"},y={ArcGISTiledElevationServiceLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},p={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BuildingSceneLayer:"BuildingSceneLayer",CSV:"CSVLayer",CatalogLayer:"CatalogLayer",GaussianSplatLayer:"GaussianSplatLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",KML:"KMLLayer",LineOfSightLayer:"LineOfSightLayer",MediaLayer:"MediaLayer",OGCFeatureLayer:"OGCFeatureLayer",Object3DTilesLayer:"UnsupportedLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",RasterDataLayer:"UnsupportedLayer",VectorTileLayer:"VectorTileLayer",ViewshedLayer:"ViewshedLayer",Voxel:"VoxelLayer",WCS:"WCSLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},u={ArcGISFeatureLayer:"FeatureLayer"},d={...n,LinkChartLayer:"LinkChartLayer"},c=a,g=s,m={ArcGISAnnotationLayer:"AnnotationFeatureLayer",ArcGISDimensionLayer:"DimensionFeatureLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISSceneServiceLayer:"SceneLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",BuildingSceneLayer:"BuildingSceneLayer",IntegratedMesh3DTilesLayer:"IntegratedMesh3DTilesLayer",IntegratedMeshLayer:"IntegratedMeshLayer",MediaLayer:"MediaLayer",OrientedImageryLayer:"OrientedImageryLayer",PointCloudLayer:"PointCloudLayer",SubtypeGroupLayer:"SubtypeGroupLayer",WCS:"WCSLayer"},L=s;function h(e){switch(e.origin){case"web-scene":switch(e.layerContainerType){case"basemap-base-layers":return o;case"basemap-ground-layers":return l;case"ground":return y;case"tables":return u;default:return p}case"link-chart":switch(e.layerContainerType){case"basemap-base-layers":return c;case"tables":return g;default:return d}default:switch(e.layerContainerType){case"basemap-base-layers":return a;case"tables":return s;case"ground":case"basemap-ground-layers":return;default:return n}}}function v(e,r){if(!r)return"UnknownLayer";if("DefaultTileLayer"===r){let r="UnknownLayer";if("web-scene"===e.origin)switch(e.layerContainerType){case"operational-layers":case"basemap-base-layers":r="TileLayer";break;case"ground":r="ElevationLayer"}else switch(e.layerContainerType){case"basemap-base-layers":case"operational-layers":r="TileLayer"}return r}return h(e)?.[r]??"UnknownLayer"}function S(e,r,t){if(!e?.origin)return!1;switch(e.origin){case"web-map":case"link-chart":if("operational-layers"===e.layerContainerType&&"ArcGISDimensionLayer"===r&&"dimension-feature"!==t)return!1;break;case"web-scene":if("operational-layers"===e.layerContainerType)switch(r){case"ArcGISDimensionLayer":if("dimension"!==t)return!1;break;case"ArcGISTiledElevationServiceLayer":return!1}break;case"portal-item":if("ArcGISDimensionLayer"===r&&"dimension-feature"!==t)return!1}let i=function(e){if("portal-item"===e.origin)switch(e.layerContainerType){case"basemap-base-layers":case"ground":case"basemap-ground-layers":return;case"tables":return L;default:return m}return h(e)}(e)?.[r];return null!=i&&"UnknownLayer"!==i&&"UnsupportedLayer"!==i}},31756(e,r,t){var i=t(86211),a=t(79258);const n={unknown:1,inches:(0,i.oU)(1,"meters","inches"),feet:(0,i.oU)(1,"meters","feet"),"us-feet":(0,i.oU)(1,"meters","us-feet"),yards:(0,i.oU)(1,"meters","yards"),miles:(0,i.oU)(1,"meters","miles"),"nautical-miles":(0,i.oU)(1,"meters","nautical-miles"),millimeters:(0,i.oU)(1,"meters","millimeters"),centimeters:(0,i.oU)(1,"meters","centimeters"),decimeters:(0,i.oU)(1,"meters","decimeters"),meters:(0,i.oU)(1,"meters","meters"),kilometers:(0,i.oU)(1,"meters","kilometers"),"decimal-degrees":1/(0,i.vl)(1,"meters",a.$O.radius)};t.d(r,["j",0,n])},88625(e,r,t){t.d(r,{A:()=>v});var i,a=t(32198),n=t(69540),s=t(66552),o=t(25482),l=t(97768),y=t(91429),p=t(30524);let u=i=class extends o.o{constructor(e){super(e),this.expression=void 0,this.title=void 0}async collectRequiredFields(e,r){return(0,p.Dx)(e,r,null,this.expression)}clone(){return new i({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};(0,a.Cg)([(0,y.MZ)({type:String,json:{write:{isRequired:!0}}})],u.prototype,"expression",void 0),(0,a.Cg)([(0,y.MZ)({type:String,json:{write:!0}})],u.prototype,"title",void 0),u=i=(0,a.Cg)([(0,y.$K)("esri.symbols.support.FeatureExpressionInfo")],u);const d=u;var c=t(16271),g=t(36005),m=t(43937);const L=(0,s.O)()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),h=new s.J({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let v=class extends((0,n.OU)(o.o)){constructor(e){super(e),this.featureExpressionInfo=void 0,this.offset=null}readFeatureExpressionInfo(e,r){return null!=e?e.expression?e:void 0:r.featureExpression&&0===r.featureExpression.value?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,r,t,i){r[t]=e.write({},i),"0"===e.expression&&(r.featureExpression={value:0})}get mode(){let{offset:e,featureExpressionInfo:r}=this;return this._isOverridden("mode")?this._get("mode"):null!=e||r?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,r){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,r):null}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&(0,l.CM)(this.featureExpressionInfo,e.featureExpressionInfo)}};(0,a.Cg)([(0,y.MZ)({type:d,json:{write:!0}})],v.prototype,"featureExpressionInfo",void 0),(0,a.Cg)([(0,g.w)("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],v.prototype,"readFeatureExpressionInfo",null),(0,a.Cg)([(0,m.K)("featureExpressionInfo",{featureExpressionInfo:{type:d},"featureExpression.value":{type:[0]}})],v.prototype,"writeFeatureExpressionInfo",null),(0,a.Cg)([(0,y.MZ)({type:L.apiValues,nonNullable:!0,json:{type:L.jsonValues,read:L.read,write:{writer:L.write,isRequired:!0}}})],v.prototype,"mode",null),(0,a.Cg)([(0,y.MZ)({type:Number,json:{write:!0}})],v.prototype,"offset",void 0),(0,a.Cg)([(0,y.MZ)({type:c.KQ,json:{type:String,read:h.read,write:h.write}})],v.prototype,"unit",null),v=(0,a.Cg)([(0,y.$K)("esri.symbols.support.ElevationInfo")],v)},16271(e,r,t){t.d(r,{Ao:()=>n});var i=t(4576),a=t(31756);function n(e){return 1/(a.j[e]||1)}const s=function(){let e=Object.keys(a.j);return(0,i.TF)(e,"decimal-degrees"),e.sort(),e}();t.d(r,["KQ",0,s])},43440(e,r,t){t.d(r,{A:()=>O});var i=t(32198),a=t(25482),n=t(4718),s=t(91429),o=t(69540),l=t(10107),y=t(64108);let p=class extends a.o{constructor(e){super(e),this.description=null,this.label=null,this.type=null}};(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"description",void 0),(0,i.Cg)([(0,l.MZ)({type:String,json:{write:!0}})],p.prototype,"label",void 0),(0,i.Cg)([(0,l.MZ)()],p.prototype,"type",void 0),p=(0,i.Cg)([(0,y.$)("esri.tables.elements.AttributeTableElement")],p);const u=p;let d=class extends((0,o.OU)(u)){constructor(e){super(e),this.displayType="auto",this.type="attachment"}clone(){return super.clone()}};(0,i.Cg)([(0,s.MZ)({type:["auto"],json:{write:!0}})],d.prototype,"displayType",void 0),(0,i.Cg)([(0,s.MZ)({type:["attachment"],readOnly:!0,json:{read:!1,write:{enabled:!0,isRequired:!0}}})],d.prototype,"type",void 0),d=(0,i.Cg)([(0,s.$K)("esri.tables.elements.AttributeTableAttachmentElement")],d);const c=d;let g=class extends((0,o.OU)(u)){constructor(e){super(e),this.description=null,this.fieldName=null,this.label=null,this.type="field"}clone(){return super.clone()}};(0,i.Cg)([(0,s.MZ)({type:String,json:{read:!1,write:!1}})],g.prototype,"description",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{write:{enabled:!0,isRequired:!0}}})],g.prototype,"fieldName",void 0),(0,i.Cg)([(0,s.MZ)({type:String,json:{read:!1,write:!1}})],g.prototype,"label",void 0),(0,i.Cg)([(0,s.MZ)({type:["field"],readOnly:!0,json:{read:!1,write:{enabled:!0,isRequired:!0}}})],g.prototype,"type",void 0),g=(0,i.Cg)([(0,s.$K)("esri.tables.elements.AttributeTableFieldElement")],g);const m=g;var L=t(78888);let h=class extends((0,o.OU)(u)){constructor(e){super(e),this.relationshipId=null,this.type="relationship"}clone(){return super.clone()}};(0,i.Cg)([(0,s.MZ)({type:Number,json:{type:L.jz,write:{enabled:!0,isRequired:!0}}})],h.prototype,"relationshipId",void 0),(0,i.Cg)([(0,s.MZ)({type:["relationship"],readOnly:!0,json:{read:!1,write:{enabled:!0,isRequired:!0}}})],h.prototype,"type",void 0),h=(0,i.Cg)([(0,s.$K)("esri.tables.elements.AttributeTableRelationshipElement")],h);const v=h,S={base:u,key:"type",typeMap:{attachment:c,field:m,relationship:v}};let f=class extends((0,o.OU)(u)){constructor(e){super(e),this.elements=null,this.type="group"}clone(){return super.clone()}};(0,i.Cg)([(0,s.MZ)({types:[S],json:{name:"attributeTableElements",write:!0}})],f.prototype,"elements",void 0),(0,i.Cg)([(0,s.MZ)({type:["group"],readOnly:!0,json:{read:!1,write:{enabled:!0,isRequired:!0}}})],f.prototype,"type",void 0),f=(0,i.Cg)([(0,s.$K)("esri.tables.elements.AttributeTableGroupElement")],f);const w=f;let b=class extends((0,o.OU)(a.o)){constructor(e){super(e),this.field=null,this.order=null}};(0,i.Cg)([(0,s.MZ)({type:String,json:{write:!0}})],b.prototype,"field",void 0),(0,i.Cg)([(0,s.MZ)({type:["asc","desc"],json:{write:!0}})],b.prototype,"order",void 0),b=(0,i.Cg)([(0,s.$K)("esri.tables.support.FieldOrder")],b);const I=b;var T;const C=function(e){return{typesWithGroup:{base:u,key:"type",typeMap:{attachment:c,field:m,group:e,relationship:v}},typesWithoutGroup:S}}(w);let M=T=class extends a.o{constructor(e){super(e),this.elements=null,this.orderByFields=null}clone(){return new T({elements:(0,n.o8)(this.elements),orderByFields:(0,n.o8)(this.orderByFields)})}};(0,i.Cg)([(0,s.MZ)({types:[C.typesWithGroup],json:{name:"attributeTableElements",write:!0}})],M.prototype,"elements",void 0),(0,i.Cg)([(0,s.MZ)({type:[I],json:{write:!0}})],M.prototype,"orderByFields",void 0),M=T=(0,i.Cg)([(0,s.$K)("esri.tables.AttributeTableTemplate")],M);const O=M}}]);