@arcgis/core 4.34.0-next.52 → 4.34.0-next.54

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 (139) hide show
  1. package/applications/Components/formatUtils.d.ts +3 -0
  2. package/applications/Components/formatUtils.js +5 -0
  3. package/assets/esri/core/workers/RemoteClient.js +1 -1
  4. package/assets/esri/core/workers/chunks/{35fc8a64674005b1d1d7.js → 0a4357af5b8c0532b439.js} +1 -1
  5. package/assets/esri/core/workers/chunks/{e58336aafe8c95bb6831.js → 0eb728cee6e40cb30c01.js} +1 -1
  6. package/assets/esri/core/workers/chunks/{b87ed14fde381f79bc9f.js → 17776d9d3558d45ea7b5.js} +1 -1
  7. package/assets/esri/core/workers/chunks/23f54b49742098def8ae.js +1 -0
  8. package/assets/esri/core/workers/chunks/2efa4d8fe5454f8b2a05.js +1 -0
  9. package/assets/esri/core/workers/chunks/{a69e885336eb5d2729fd.js → 3505988ce3839cdbbc98.js} +1 -1
  10. package/assets/esri/core/workers/chunks/{46ab551bd19e52e73649.js → 3800764932a1c32cb29f.js} +1 -1
  11. package/assets/esri/core/workers/chunks/3c57b2e13628b5c1f6de.js +1 -0
  12. package/assets/esri/core/workers/chunks/435169b455fd2846799b.js +1 -0
  13. package/assets/esri/core/workers/chunks/{77493aa2118d462612a0.js → 43bd338bb0de375b9bb7.js} +1 -1
  14. package/assets/esri/core/workers/chunks/{5a016dcd3192d42d363e.js → 5fc414fc2cfc68828c5b.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ecd673eccf89643df07a.js → 659f7e99b2d524ef53fb.js} +2 -2
  16. package/assets/esri/core/workers/chunks/69e6000044bfb03776ac.js +1 -0
  17. package/assets/esri/core/workers/chunks/{037bc400257bc13b3ec8.js → 772e81e9162e2240a7a6.js} +1 -1
  18. package/assets/esri/core/workers/chunks/813efde41e90e652b7db.js +1 -0
  19. package/assets/esri/core/workers/chunks/82404ff7c298493ff6f4.js +1 -0
  20. package/assets/esri/core/workers/chunks/{f1de768b0a6d345f7e39.js → 8f6ff09e7d2f01b79faf.js} +1 -1
  21. package/assets/esri/core/workers/chunks/9639a6f6fab52a501bf7.js +1 -0
  22. package/assets/esri/core/workers/chunks/{cfa8b17cf1349f6ed355.js → 9e9be7f6ea32957f1088.js} +1 -1
  23. package/assets/esri/core/workers/chunks/9fef330b241f958b55df.js +1 -0
  24. package/assets/esri/core/workers/chunks/aab349d4624b78ef429f.js +1 -0
  25. package/assets/esri/core/workers/chunks/b9f5672093727c6f92c9.js +1 -0
  26. package/assets/esri/core/workers/chunks/bcc233a86e01ff1eac16.js +1 -0
  27. package/assets/esri/core/workers/chunks/cac060a187f3a27a19ba.js +1 -0
  28. package/assets/esri/core/workers/chunks/cda27c0fafd687dfa72e.js +1 -0
  29. package/assets/esri/core/workers/chunks/{82a390be9500b629f6bc.js → d0bf1fc6e3c198bc565d.js} +1 -1
  30. package/assets/esri/core/workers/chunks/dd120d562b63618e71c0.js +1 -0
  31. package/assets/esri/core/workers/chunks/dd2b5f115d156b5b212e.js +1 -0
  32. package/assets/esri/core/workers/chunks/e28d3ed65c3a76a044c8.js +1 -0
  33. package/assets/esri/core/workers/chunks/{fb4950995f6780f6c22a.js → ee0286b5f5475f2d853f.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{c5b2a261d8c216ca4a10.js → f8505bf69795f5293a79.js} +1 -1
  35. package/assets/esri/core/workers/chunks/fae6030a81cb91a91b69.js +1 -0
  36. package/assets/esri/core/workers/chunks/ff7962063d132c1ec814.js +1 -0
  37. package/assets/esri/themes/base/widgets/_FloorFilter.scss +23 -19
  38. package/assets/esri/themes/dark/main.css +1 -1
  39. package/assets/esri/themes/light/main.css +1 -1
  40. package/assets/esri/themes/light/view.css +1 -1
  41. package/config.js +1 -1
  42. package/geometry/operators/json/graphicBufferOperator.js +5 -0
  43. package/geometry/support/coordinateSystem.js +1 -1
  44. package/interfaces.d.ts +93 -185
  45. package/kernel.js +1 -1
  46. package/layers/KMLLayer.js +1 -1
  47. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  48. package/layers/graphics/data/QueryEngine.js +1 -1
  49. package/layers/graphics/sources/WFSSourceWorker.js +1 -1
  50. package/layers/graphics/sources/geojson/GeoJSONSourceWorker.js +1 -1
  51. package/layers/graphics/sources/support/CSVSourceWorker.js +1 -1
  52. package/layers/graphics/sources/support/MemorySourceWorker.js +1 -1
  53. package/layers/support/ElevationQuery.js +1 -1
  54. package/layers/support/ExportImageParameters.js +1 -1
  55. package/networks/UtilityNetwork.js +1 -1
  56. package/networks/support/typeUtils.js +1 -1
  57. package/package.json +3 -3
  58. package/portal/Portal.js +1 -1
  59. package/renderers/support/rasterRendererHelper.js +1 -1
  60. package/renderers/support/utils.js +1 -1
  61. package/rest/featureService/FeatureService.js +1 -1
  62. package/rest/networks/support/Circuit.js +5 -0
  63. package/rest/networks/support/CircuitSection.js +1 -1
  64. package/rest/networks/support/Subcircuit.js +1 -1
  65. package/rest/print.js +1 -1
  66. package/support/revision.js +1 -1
  67. package/symbols/cim/CIMEffects.js +1 -1
  68. package/symbols/cim/effects/EffectOffset.js +1 -1
  69. package/views/2d/analysisViewModuleImportUtils.js +5 -0
  70. package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelMeshWriter.js +1 -1
  71. package/views/2d/input/MapViewInputManager.js +1 -1
  72. package/views/2d/layers/LayerView2D.js +1 -1
  73. package/views/3d/analysis/Dimension/LengthDimensionSubTool.js +1 -1
  74. package/views/3d/analysis/ElevationProfile/HoveredPointsVisualization.js +1 -1
  75. package/views/3d/analysis/LineOfSight/LineOfSightRayIntersector.js +1 -1
  76. package/views/3d/analysis/Viewshed/FieldOfViewManipulation.js +1 -1
  77. package/views/3d/analysisViewModuleImportUtils.js +5 -0
  78. package/views/3d/input/SceneInputManager.js +1 -1
  79. package/views/3d/interactive/editingTools/draw/DrawGraphicTool3D.js +1 -1
  80. package/views/3d/interactive/editingTools/manipulations/MoveManipulation.js +1 -1
  81. package/views/3d/interactive/editingTools/reshape/ReshapeOperation.js +1 -1
  82. package/views/3d/interactive/measurementTools/areaMeasurement3D/AreaMeasurement3DTool.js +1 -1
  83. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  84. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  85. package/views/3d/terrain/TerrainSurface.js +1 -1
  86. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  87. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  88. package/views/SceneView.js +1 -1
  89. package/views/ToolViewManager.js +1 -1
  90. package/views/View.js +1 -1
  91. package/views/View2D.js +1 -1
  92. package/views/draw/Draw.js +1 -1
  93. package/views/draw/DrawGraphicTool.js +1 -1
  94. package/views/draw/DrawOperation.js +1 -1
  95. package/views/draw/LegacyDrawManipulator.js +1 -1
  96. package/views/draw/support/Box.js +1 -1
  97. package/views/draw/support/GraphicMover.js +1 -1
  98. package/views/draw/support/Reshape.js +1 -1
  99. package/views/input/InputManager.js +1 -1
  100. package/views/input/handlers/LatestPointer.js +1 -1
  101. package/views/interactive/InteractiveToolBase.js +1 -1
  102. package/views/interactive/ToolViewManagerManipulatorState.js +1 -1
  103. package/views/interactive/Tooltip.js +1 -1
  104. package/views/interactive/snapping/featureSources/GraphicsSnappingSource.js +1 -1
  105. package/views/interactive/snapping/featureSources/featureServiceSource/FeatureServiceSnappingSourceWorker.js +1 -1
  106. package/views/layers/support/popupUtils.js +1 -1
  107. package/views/support/AnalysisViewManager.js +5 -0
  108. package/views/support/PromiseQueue.js +5 -0
  109. package/views/support/Scheduler.js +1 -1
  110. package/widgets/Feature/FeatureViewModel.js +1 -1
  111. package/widgets/FeatureTable/Grid/support/ButtonMenu.js +1 -1
  112. package/widgets/FloorFilter/css.js +1 -1
  113. package/widgets/FloorFilter.js +1 -1
  114. package/widgets/HistogramRangeSlider.js +1 -1
  115. package/widgets/Sketch/SketchViewModel.js +1 -1
  116. package/widgets/support/ItemList.js +1 -1
  117. package/assets/esri/core/workers/chunks/0874b88d5ae7c2b78b3b.js +0 -1
  118. package/assets/esri/core/workers/chunks/0c129b78e5cfe96795e1.js +0 -1
  119. package/assets/esri/core/workers/chunks/1a3a4c2c642899be37a0.js +0 -1
  120. package/assets/esri/core/workers/chunks/2b75212c31145cc07d16.js +0 -1
  121. package/assets/esri/core/workers/chunks/37a97e690786814bf0b3.js +0 -1
  122. package/assets/esri/core/workers/chunks/48e64f99720907017778.js +0 -1
  123. package/assets/esri/core/workers/chunks/4c6862ad3af947c704f7.js +0 -1
  124. package/assets/esri/core/workers/chunks/4d544e3e19ce07c2c195.js +0 -1
  125. package/assets/esri/core/workers/chunks/781b59ba0cabe78bc122.js +0 -1
  126. package/assets/esri/core/workers/chunks/8c1bd9bcfc59497de3b5.js +0 -1
  127. package/assets/esri/core/workers/chunks/8cc700da2ac58849a708.js +0 -1
  128. package/assets/esri/core/workers/chunks/9b7fee0adffeee8d45ae.js +0 -1
  129. package/assets/esri/core/workers/chunks/9d30fed26e0d84ef893b.js +0 -1
  130. package/assets/esri/core/workers/chunks/b29f0b32787edb4e75cf.js +0 -1
  131. package/assets/esri/core/workers/chunks/b877142a275188a16e17.js +0 -1
  132. package/assets/esri/core/workers/chunks/c87bb42f825c39f9cce3.js +0 -1
  133. package/assets/esri/core/workers/chunks/cc0cb4906e4419f7c4a9.js +0 -1
  134. package/assets/esri/core/workers/chunks/f667096ea325f690c4a6.js +0 -1
  135. package/assets/esri/core/workers/chunks/f9f94b5efa9a64cdb407.js +0 -1
  136. package/layers/graphics/data/executeQueryForSnapping.js +0 -5
  137. package/layers/support/PromiseQueue.js +0 -5
  138. package/views/3d/analysis/AnalysisViewManager3D.js +0 -5
  139. /package/assets/esri/core/workers/chunks/{ecd673eccf89643df07a.js.LICENSE.txt → 659f7e99b2d524ef53fb.js.LICENSE.txt} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{GeometryCursor as t}from"../../../geometry/GeometryCursor.js";import{collectPath as e}from"../../../geometry/geometryCursorCollectUtils.js";import r from"../../../geometry/SpatialReference.js";import{isExtent as s}from"../../../geometry/support/jsonUtils.js";import{clipCursorToTileExtent as i,lazyOffsetOperator as o}from"../CIMEffects.js";import{CurveHelper as n,pixelTolerance as f}from"../CurveHelper.js";const m=10;class a{static{this.instance=null}static local(){return null===a.instance&&(a.instance=new a),a.instance}execute(t,e,r,s,i,o){return new l(t,e,r,s,i,o)}}class l{constructor(t,e,r,s,i,o){this._preventClipping=o,this._inputGeometries=t,this._tileKey=s,this._curveHelper=new n,this._offset=(e.offset??1)*r,this._method=e.method,this._maxInflateSize=Math.max(Math.abs(i*r),m),this._option=e.option,this._offsetFlattenError=f*r}next(){let n;for(;n=this._inputGeometries.next();){if(0===this._offset)return n.clone();if("esriGeometryEnvelope"===n.geometryType){if("Rounded"===this._method&&this._offset>0){const r=e(n),s=this._curveHelper.offset(r,-this._offset,this._method,4,this._offsetFlattenError);if(s){const e=t.createEmptyOptimizedCIM(n.geometryType);return e.pushPath(s),e}return null}const r=n.asJSON();if(s(r)&&Math.min(r.xmax-r.xmin,r.ymax-r.ymin)+2*this._offset>0)return t.fromJSONCIM({xmin:r.xmin-this._offset,xmax:r.xmax+this._offset,ymin:r.ymin-this._offset,ymax:r.ymax+this._offset})}const f=!this._preventClipping&&this._tileKey?i(n,this._maxInflateSize,!0):n.clone();if(!f)continue;const m=o.module,a={...f.asJSON(),spatialReference:{wkid:r.WebMercator.wkid}},l=m.execute(a,-this._offset,{joins:h(this._method),flattenError:this._offsetFlattenError,miterLimit:4});return l?t.fromJSONCIM(l):null}return null}}function h(t){switch(t){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{a as EffectOffset};
5
+ import{GeometryCursor as e}from"../../../geometry/GeometryCursor.js";import{collectPath as t}from"../../../geometry/geometryCursorCollectUtils.js";import s from"../../../geometry/SpatialReference.js";import{isExtent as r}from"../../../geometry/support/jsonUtils.js";import{clipCursorToTileExtent as i,lazyOffsetOperator as o,lazyGraphicBufferOperator as n}from"../CIMEffects.js";import{CurveHelper as f,pixelTolerance as m}from"../CurveHelper.js";const a=10;class l{static{this.instance=null}static local(){return null===l.instance&&(l.instance=new l),l.instance}execute(e,t,s,r,i,o){return new h(e,t,s,r,i,o)}}class h{constructor(e,t,s,r,i,o){this._preventClipping=o,this._inputGeometries=e,this._tileKey=r,this._curveHelper=new f,this._offset=(t.offset??1)*s,this._method=t.method,this._maxInflateSize=Math.max(Math.abs(i*s),a),this._option=t.option,this._offsetFlattenError=m*s}next(){let f;for(;f=this._inputGeometries.next();){if(0===this._offset)return f.clone();if("esriGeometryEnvelope"===f.geometryType){if("Rounded"===this._method&&this._offset>0){const s=t(f),r=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);if(r){const t=e.createEmptyOptimizedCIM(f.geometryType);return t.pushPath(r),t}return null}const s=f.asJSON();if(r(s)&&Math.min(s.xmax-s.xmin,s.ymax-s.ymin)+2*this._offset>0)return e.fromJSONCIM({xmin:s.xmin-this._offset,xmax:s.xmax+this._offset,ymin:s.ymin-this._offset,ymax:s.ymax+this._offset})}const m=!this._preventClipping&&this._tileKey?i(f,this._maxInflateSize,!0):f.clone();if(!m)continue;const a=o.module,l=n.module,h={...m.asJSON(),spatialReference:{wkid:s.WebMercator.wkid}};let c,p=u(this._method);return"esriGeometryPolygon"===f.geometryType&&this._offset>0?("square"===p&&(p="bevel"),c=l.executeMany([h],[this._offset],{joins:p})[0]):c=a.execute(h,-this._offset,{joins:p,flattenError:this._offsetFlattenError,miterLimit:4}),c?e.fromJSONCIM(c):null}return null}}function u(e){switch(e){case"Rounded":return"round";case"Bevelled":return"bevel";case"Mitered":return"miter";case"Square":return"square"}}export{l as EffectOffset};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import o from"../../core/Error.js";function r(r){throw new o("analysis-view-module-import-utils:analysis-not-supported",`Analysis "${r.type}" is not supported`)}export{r as importAnalysisViewModule};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as h,add as c,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as f}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as g,convertToGeometry as _}from"../../../../../../../layers/graphics/featureConversionUtils.js";import p from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as b,minMaxZoomPrecisionFactor as x}from"../../../definitions.js";import M from"../../../collisions/BoundingBox.js";import{LabelMetric as v}from"../../../collisions/LabelMetric.js";import{smoothPaths as y,pathDivide as P}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as w,processColorInput as L}from"../fill/meshWriterUtils.js";import{TextMeshWriter as I,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,j=128;function A(e,t){return i(`${e}${t}`)}function D(e,t,r){return i(`${e}${t}${r}`)}function G(e,t,r,s){return i(`${e}${t}${r*2**(B-s)}`)}function Z(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(B-s)}`)}const k=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class F extends I{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,r){if(this._zoomLevel=r||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[r,s]=i.coords;this._writePoint(e,r,s,0,t);break}case"esriGeometryMultipoint":{let i=0;const r=f.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,h=this.evaluatedMeshParams.scaleInfo?.minScale??0,c=this.evaluatedMeshParams.labelClassId;return new v(e,c,t,i,r,s,n,a,l,h,o)}_writePoint(e,t,i,r,s){if(t<0||t>b||i<0||i>b)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=A(s.getObjectId(),r),h=D(s.getObjectId(),a,r),[c,m]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new v(n,a,l,h,t,i,c,m,u,d,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<S);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:w(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new p;g(a,n,!1,!1,"esriGeometryPolyline",1);const l=C(new p,a,o),h=C(new p,a,-o),c=_(h,"esriGeometryPolyline",!1,!1),m=_(l,"esriGeometryPolyline",!1,!1),u=y(m.paths,s.bounds.width),d=y(c.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<u.length;f++)this._current.pathIndex=f,P(u[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<d.length;f++)this._current.pathIndex=f,P(d[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=y(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,P(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,a=this._current.zoomRange[0],l=k(t),h=this._current.shaping.bounds.width/(1<<S),c=Math.sqrt(n||j)/(1<<S),m=Math.min(i,r-i),u=this._current.shaping.isMultiline?B:Math.log2(m/(c+h/2)),d=0===t?u:Math.min(l,u),f=Math.max(a,this._zoomLevel+S-d),g=this._zoomLevel-f,_=this._current.shaping.bounds.width/2*2**g,p=G(this._current.objId,this._current.pathIndex,t,this._zoomLevel),b=Z(this._current.objId,this._current.pathIndex,t,this._zoomLevel,this.evaluatedMeshParams.labelClassId);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,f,p,b):s&&g<0?this._placeStraightAlong(e,a,p,b):"parallel"===o?this._placeStraightAlong(e,f,p,b):"curved"===o&&this._placeCurved(e,f,_,p,b)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:h}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,h)),s.metricBoxWrite(n.boundsT);const c=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360,u={clipAngle:c,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,h,n,0,a,u,!1);const d={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,h,n,0,a,d,!1),s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,h=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,h),this._placeBack(e,a,t,i,0,h),this._placeForward(e,a,t,i,0,h)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:h,shaping:c,zoomRange:m,referenceBounds:d}=this._current,{boxBorderLineColor:f,boxBackgroundColor:g}=this.evaluatedMeshParams,_=e.clone(),p=e.angle*(180/Math.PI)%360,b=(e.angle*(180/Math.PI)+180)%360,x=c.glyphs.length>0&&!(!f&&!g);if(l.metricStart(this._createLineLabelMetric(h,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(B,m[1]),f=r(o(),-e.angle),g={minZoom:n,maxZoom:a,clipAngle:p,mapAligned:!0,isLineLabel:!0},_=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=u(_,-1*x),[i,r]=c.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,c.glyphs[0].textureBinding),this._writeTextBox(l,h,e.x,e.y,r,d,g),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=u(_,x),[i,r]=c.shapeBackground(s(o(),f,t));g.clipAngle=b,l.recordStart(this.instanceId,this.attributeLayout,c.glyphs[0].textureBinding),this._writeTextBox(l,h,e.x,e.y,r,d,g),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(_,i,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(_,i,0,b,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+z}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+z}_placeFirst(e,i,s,a,l=!1){const{out:h,id:c,shaping:m,zoomRange:d,referenceBounds:f}=this._current,g=m.glyphs,_=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=u(_,p),x=r(o(),-e.angle);n(b,b,x);for(const t of g){const r=t.x>m.bounds.x?s:1-s,o=r*e.remainingLength+(1-r)*e.backwardLength,n=Math.abs(t.x+t.width/2-m.bounds.x),u=Math.max(0,this._zoomLevel+Math.log2(n/(o+z))),g=Math.max(i,l?0:u);if(t.maxZoom=Math.min(d[1],B),t.angle=e.angle+(1-s)*Math.PI,t.minZoom=Math.max(d[0],g),this._writeLineGlyph(h,c,e.x,e.y,t,a,f,!0),(s||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new M(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);h.metricBoxWrite(e)}}}_placeOnSegment(e,i,s,a,l,h,c){const{out:m,id:d,shaping:f,referenceBounds:g}=this._current,_=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,x={x:e.x+s*-l*p,y:e.y+s*-l*b},v=t(this.evaluatedMeshParams.offsetX),y=t(this.evaluatedMeshParams.offsetY),P=u(v,y),w=r(o(),-e.angle);n(P,P,w);for(const t of _){const i=t.x>f.bounds.x?h:1-h;if(!(i&&1===l||!i&&-1===l))continue;const r=Math.abs(t.x+t.width/2-f.bounds.x),o=Math.max(0,this._zoomLevel+Math.log2(r/s)-.1),n=Math.max(a,this._zoomLevel+Math.log2(r/(s+e.length+z)));if(0!==o&&(t.angle=e.angle+(1-h)*Math.PI,t.minZoom=n,t.maxZoom=o,this._writeLineGlyph(m,d,x.x,x.y,t,c,g,!0),(h||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new M(t.bounds.x+P[0],t.bounds.y+P[1],t.bounds.width,t.bounds.height);m.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>b||r<0||r>b)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:h}=s,{fontSize:c,haloSize:m,outlineSize:u}=this._textMeshTransformProps;this._writeQuad(e,t,i,r,{texcoords:l,offsets:h,fontSize:c,haloSize:m,outlineSize:u,color:L(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],s.minZoom),maxZoom:Math.min(this._current.zoomRange[1],s.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*x)/x}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),r=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),r=this._packedZoom(r);const s=this._packedZoom(this._zoomLevel);return i<=s&&s<=r}}function C(e,t,i){const{coords:r,lengths:s}=t,o=d(),n=d(),u=d(),f=d(),g=d(),_=d(),p=2;let b=0;for(let d=0;d<s.length;d++){const t=s[d];for(let s=0;s<t;s++){const d=p*(s+b-1),x=p*(s+b),M=p*(s+b+1);s>0?a(o,r[d],r[d+1]):a(o,0,0),a(n,r[x],r[x+1]),s<t-1?a(u,r[M],r[M+1]):a(u,0,0),0===s?a(f,0,0):(l(f,n,o),h(f,f),a(f,f[1],-f[0])),s===t-1?a(g,0,0):(l(g,u,n),h(g,g),a(g,g[1],-g[0])),c(_,f,g),h(_,_);const v=_[0]*g[0]+_[1]*g[1];0!==v&&m(_,_,v),m(_,_,i),e.coords.push(n[0]+_[0],n[1]+_[1])}e.lengths.push(t),b+=t}return e}export{F as LabelMeshWriter,A as labelIdHash,D as labelMetricHash,G as lineLabelIdHash,Z as lineLabelMetricHash};
5
+ import{memoize as e}from"../../../../../../../core/MapUtils.js";import{pt2px as t}from"../../../../../../../core/screenUtils.js";import{numericHash as i}from"../../../../../../../core/string.js";import{fromRotation as r,translate as s}from"../../../../../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as o}from"../../../../../../../core/libs/gl-matrix-2/factories/mat2df32.js";import{transformMat2d as n,set as a,sub as l,normalize as c,add as h,scale as m}from"../../../../../../../core/libs/gl-matrix-2/math/vec2.js";import{fromValues as u}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{create as d}from"../../../../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{GeometryCursor as f}from"../../../../../../../geometry/GeometryCursor.js";import{generalizeOptimizedGeometry as _,convertToGeometry as g}from"../../../../../../../layers/graphics/featureConversionUtils.js";import p from"../../../../../../../layers/graphics/OptimizedGeometry.js";import{tileSize as b,minMaxZoomPrecisionFactor as x}from"../../../definitions.js";import v from"../../../collisions/BoundingBox.js";import{LabelMetric as M}from"../../../collisions/LabelMetric.js";import{smoothPaths as P,pathDivide as y}from"../../../mesh/templates/segmentUtils.js";import{getMinMaxZoom as w,processColorInput as L}from"../fill/meshWriterUtils.js";import{TextMeshWriter as I,maxLabelZoom as B}from"../text/TextMeshWriter.js";const S=1,z=0,D=128;function j(e,t){return i(`${e}${t}`)}function A(e,t,r){return i(`${e}${t}${r}`)}function G(e,t,r,s){return i(`${e}${t}${r*2**(B-s)}`)}function Z(e,t,r,s,o){return i(`${e}${o}${t}${r*2**(B-s)}`)}const k=e(e=>{let t=0;if(0===e)return 1/0;for(;!(e%2);)t++,e/=2;return t});class F extends I{constructor(){super(...arguments),this._zoomLevel=0}_write(e,t,i,r){if(this._zoomLevel=r||0,null!=i)throw new Error("InternalError: EffectGeometry not support for LabelMeshWriter");switch(t.geometryType){case"esriGeometryPoint":{const i=t.readXForDisplay(),r=t.readYForDisplay();this._writePoint(e,i,r,0,t);break}case"esriGeometryEnvelope":case"esriGeometryPolygon":{const i=t.readCentroidForDisplay();if(!i)return;const[r,s]=i.coords;this._writePoint(e,r,s,0,t);break}case"esriGeometryMultipoint":{let i=0;const r=f.fromFeatureSetReader(t);if(r?.nextPath())for(;r.nextPoint();)this._writePoint(e,r.x,r.y,i++,t);break}case"esriGeometryPolyline":this._writeLines(e,t)}}_getMetricDir(){const{horizontalAlignment:e,verticalAlignment:t}=this.evaluatedMeshParams;return["center"===e?0:"right"===e?-1:1,"middle"===t?0:"bottom"===t?-1:1]}_createLineLabelMetric(e,t,i,r,s,o){const[n,a]=this._getMetricDir(),l=this.evaluatedMeshParams.scaleInfo?.maxScale??0,c=this.evaluatedMeshParams.scaleInfo?.minScale??0,h=this.evaluatedMeshParams.labelClassId;return new M(e,h,t,i,r,s,n,a,l,c,o)}_writePoint(e,t,i,r,s){if(t<0||t>b||i<0||i>b)return;const o=this._getShaping();if(!o)return;const n=s.getDisplayId(),a=this.evaluatedMeshParams.labelClassId,l=j(s.getObjectId(),r),c=A(s.getObjectId(),a,r),[h,m]=this._getMetricDir(),u=this.evaluatedMeshParams.scaleInfo?.maxScale??0,d=this.evaluatedMeshParams.scaleInfo?.minScale??0,f=this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0};e.metricStart(new M(n,a,l,c,t,i,h,m,u,d,f)),this._writeGlyphs(e,n,t,i,o,0,f,void 0,!1),e.metricBoxWrite(o.boundsT),e.metricEnd()}_getPointReferenceBounds(){if(!this._references)return null;for(const e of this._references){const t=e.getBoundsInfo();if(t)return t}return null}_writeLines(e,t){const{scaleInfo:i,verticalAlignment:r}=this.evaluatedMeshParams,s=this.evaluatedMeshParams.repeatLabelDistance||128,o=this._getShaping("middle");if(!o)return;const n=(e,t,i,r)=>this._placeSubdivGlyphs(e,t,i,r),a=(o.bounds.width+s)/(1<<S);this._current={out:e,id:t.getDisplayId(),objId:t.getObjectId(),shaping:o,zoomRange:w(i,this.getTileInfo()),referenceBounds:this._getPointReferenceBounds()||{offsetX:0,offsetY:0,size:0},offsetDirection:null,pathIndex:0},this._verticalPlacement="bottom"===r?"above":"top"===r?"below":null,this._verticalPlacement?this._writeAboveAndBelowAlong(t,n,a):this._writeCenterAlong(t,n,a)}_writeAboveAndBelowAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=s.bounds.halfHeight,n=e.readGeometryForDisplay();if(!n)return;const a=new p;_(a,n,!1,!1,"esriGeometryPolyline",1);const l=C(new p,a,o),c=C(new p,a,-o),h=g(c,"esriGeometryPolyline",!1,!1),m=g(l,"esriGeometryPolyline",!1,!1),u=P(m.paths,s.bounds.width),d=P(h.paths,s.bounds.width);this._current.offsetDirection="above";for(let f=0;f<u.length;f++)this._current.pathIndex=f,y(u[f],i,t,!!r);this._current.offsetDirection="below";for(let f=0;f<d.length;f++)this._current.pathIndex=f,y(d[f],i,t,!!r)}_writeCenterAlong(e,t,i){const{repeatLabel:r}=this.evaluatedMeshParams,{shaping:s}=this._current,o=P(e.readLegacyGeometryForDisplay().paths,s.bounds.width);for(let n=0;n<o.length;n++)this._current.pathIndex=n,y(o[n],i,t,!!r)}_placeSubdivGlyphs(e,t,i,r){const{allowOverrun:s,labelPosition:o,repeatLabelDistance:n}=this.evaluatedMeshParams,a=this._current.zoomRange[0],l=k(t),c=this._current.shaping.bounds.width/(1<<S),h=Math.sqrt(n||D)/(1<<S),m=Math.min(i,r-i),u=this._current.shaping.isMultiline?B:Math.log2(m/(h+c/2)),d=0===t?u:Math.min(l,u),f=Math.max(a,this._zoomLevel+S-d),_=this._zoomLevel-f,g=this._current.shaping.bounds.width/2*2**_,p=G(this._current.objId,this._current.pathIndex,t,this._zoomLevel),b=Z(this._current.objId,this._current.pathIndex,t,this._zoomLevel,this.evaluatedMeshParams.labelClassId);this._current.shaping.isMultiline?0===t&&this._placeStraight(e,f,p,b):s&&_<0?this._placeStraightAlong(e,a,p,b):"parallel"===o?this._placeStraightAlong(e,f,p,b):"curved"===o&&this._placeCurved(e,f,g,p,b)}_placeStraight(e,t,i,r){const{out:s,id:o,shaping:n,referenceBounds:a}=this._current,{x:l,y:c}=e;s.metricStart(this._createLineLabelMetric(o,i,r,l,c)),s.metricBoxWrite(n.boundsT);const h=e.angle*(180/Math.PI)%360,m=(e.angle*(180/Math.PI)+180)%360;if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const e={clipAngle:h,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const e={clipAngle:m,mapAligned:!0,isLineLabel:!0,minZoom:t};this._writeGlyphs(s,o,l,c,n,0,a,e,!1)}s.metricEnd()}_placeCurved(e,t,i,r,s){const{out:o,id:n}=this._current;o.metricStart(this._createLineLabelMetric(n,r,s,e.x,e.y));const a=e.clone(),l=e.angle*(180/Math.PI)%360,c=(e.angle*(180/Math.PI)+180)%360;this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||(this._placeFirst(a,t,1,l),this._placeBack(e,a,t,i,1,l),this._placeForward(e,a,t,i,1,l)),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||(this._placeFirst(a,t,0,c),this._placeBack(e,a,t,i,0,c),this._placeForward(e,a,t,i,0,c)),o.metricEnd()}_placeStraightAlong(e,i,n,a){const{out:l,id:c,shaping:h,zoomRange:m,referenceBounds:d}=this._current,{boxBorderLineColor:f,boxBackgroundColor:_}=this.evaluatedMeshParams,g=e.clone(),p=e.angle*(180/Math.PI)%360,b=(e.angle*(180/Math.PI)+180)%360,x=h.glyphs.length>0&&!(!f&&!_);if(l.metricStart(this._createLineLabelMetric(c,n,a,e.x,e.y)),x){const n=Math.max(i,m[0],0),a=Math.min(B,m[1]),f=r(o(),-e.angle),_={minZoom:n,maxZoom:a,clipAngle:p,mapAligned:!0,isLineLabel:!0},g=t(this.evaluatedMeshParams.offsetX),x=t(this.evaluatedMeshParams.offsetY);if(!this._verticalPlacement||this._verticalPlacement===this._current.offsetDirection){const t=u(g,-1*x),[i,r]=h.shapeBackground(s(o(),f,t));l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,d,_),l.recordEnd()}if(!this._verticalPlacement||this._verticalPlacement!==this._current.offsetDirection){const t=u(g,x),[i,r]=h.shapeBackground(s(o(),f,t));_.clipAngle=b,l.recordStart(this.instanceId,this.attributeLayout,h.glyphs[0].textureBinding),this._writeTextBox(l,c,e.x,e.y,r,d,_),l.recordEnd()}}this._verticalPlacement&&this._verticalPlacement!==this._current.offsetDirection||this._placeFirst(g,i,1,p,!0),this._verticalPlacement&&this._verticalPlacement===this._current.offsetDirection||this._placeFirst(g,i,0,b,!0),l.metricEnd()}_placeBack(e,t,i,r,s,o){const n=e.clone();let a=e.backwardLength+z;for(;n.prev()&&!(a>=r);)this._placeOnSegment(n,t,a,i,-1,s,o),a+=n.length+z}_placeForward(e,t,i,r,s,o){const n=e.clone();let a=e.remainingLength+z;for(;n.next()&&!(a>=r);)this._placeOnSegment(n,t,a,i,1,s,o),a+=n.length+z}_placeFirst(e,i,s,a,l=!1){const{out:c,id:h,shaping:m,zoomRange:d,referenceBounds:f}=this._current,_=m.glyphs,g=t(this.evaluatedMeshParams.offsetX),p=t(this.evaluatedMeshParams.offsetY),b=u(g,p),x=r(o(),-e.angle);n(b,b,x);for(const t of _){const r=t.x>m.bounds.x?s:1-s,o=r*e.remainingLength+(1-r)*e.backwardLength,n=Math.abs(t.x+t.width/2-m.bounds.x),u=Math.max(0,this._zoomLevel+Math.log2(n/(o+z))),_=Math.max(i,l?0:u);if(t.maxZoom=Math.min(d[1],B),t.angle=e.angle+(1-s)*Math.PI,t.minZoom=Math.max(d[0],_),this._writeLineGlyph(c,h,e.x,e.y,t,a,f,!0),(s||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom)){const e=new v(t.bounds.x+b[0],t.bounds.y+b[1],t.bounds.width,t.bounds.height);c.metricBoxWrite(e)}}}_placeOnSegment(e,i,s,a,l,c,h){const{out:m,id:d,shaping:f,referenceBounds:_}=this._current,g=f.glyphs,p=e.dx/e.length,b=e.dy/e.length,x={x:e.x+s*-l*p,y:e.y+s*-l*b},M=t(this.evaluatedMeshParams.offsetX),P=t(this.evaluatedMeshParams.offsetY),y=u(M,P),w=r(o(),-e.angle);n(y,y,w);for(const t of g){const i=t.x>f.bounds.x?c:1-c;if(!(i&&1===l||!i&&-1===l))continue;const r=Math.abs(t.x+t.width/2-f.bounds.x),o=Math.max(0,this._zoomLevel+Math.log2(r/s)-.1),n=Math.max(a,this._zoomLevel+Math.log2(r/(s+e.length+z)));if(0!==o&&(t.angle=e.angle+(1-c)*Math.PI,t.minZoom=n,t.maxZoom=o,this._writeLineGlyph(m,d,x.x,x.y,t,h,_,!0),(c||this._current.offsetDirection)&&this._isVisible(t.minZoom,t.maxZoom))){const e=new v(t.bounds.x+y[0],t.bounds.y+y[1],t.bounds.width,t.bounds.height);m.metricBoxWrite(e)}}}_writeLineGlyph(e,t,i,r,s,o,n,a){if(i<0||i>b||r<0||r>b)return;e.recordStart(this.instanceId,this.attributeLayout,s.textureBinding);const{texcoords:l,offsets:c}=s,{fontSize:h,haloSize:m,outlineSize:u}=this._textMeshTransformProps;this._writeQuad(e,t,i,r,{texcoords:l,offsets:c,fontSize:h,haloSize:m,outlineSize:u,color:L(this.evaluatedMeshParams.color),isBackground:!1,referenceBounds:n,minZoom:Math.max(this._current.zoomRange[0],s.minZoom),maxZoom:Math.min(this._current.zoomRange[1],s.maxZoom),clipAngle:o,mapAligned:a,isLineLabel:!0}),e.recordEnd()}_packedZoom(e){return Math.floor(e*x)/x}_isVisible(e,t){let i=Math.max(this._current.zoomRange[0],e),r=Math.min(this._current.zoomRange[1],t);i=this._packedZoom(i),r=this._packedZoom(r);const s=this._packedZoom(this._zoomLevel);return i<=s&&s<=r}}function C(e,t,i){const{coords:r,lengths:s}=t,o=d(),n=d(),u=d(),f=d(),_=d(),g=d(),p=2;let b=0;for(let d=0;d<s.length;d++){const t=s[d];for(let s=0;s<t;s++){const d=p*(s+b-1),x=p*(s+b),v=p*(s+b+1);s>0?a(o,r[d],r[d+1]):a(o,0,0),a(n,r[x],r[x+1]),s<t-1?a(u,r[v],r[v+1]):a(u,0,0),0===s?a(f,0,0):(l(f,n,o),c(f,f),a(f,f[1],-f[0])),s===t-1?a(_,0,0):(l(_,u,n),c(_,_),a(_,_[1],-_[0])),h(g,f,_),c(g,g);const M=g[0]*_[0]+g[1]*_[1];0!==M&&m(g,g,M),m(g,g,i),e.coords.push(n[0]+g[0],n[1]+g[1])}e.lengths.push(t),b+=t}return e}export{F as LabelMeshWriter,j as labelIdHash,A as labelMetricHash,G as lineLabelIdHash,Z as lineLabelMetricHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as r,watch as i,initial as n,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as c}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as m}from"./handlers/DoubleTapDragZoom.js";import{DragPan as l}from"./handlers/DragPan.js";import{DragRotate as u}from"./handlers/DragRotate.js";import{GamepadNavigation as h}from"./handlers/GamepadNavigation.js";import{KeyPan as w}from"./handlers/KeyPan.js";import{KeyRotate as d}from"./handlers/KeyRotate.js";import{KeyZoom as v}from"./handlers/KeyZoom.js";import{MouseWheelZoom as g}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as f}from"./handlers/PinchAction.js";import{BrowserEventSource as j}from"../../input/BrowserEventSource.js";import{InputManager as A,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{DoubleTapDrag as M}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as P}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as T}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as z}from"../../input/recognizers/SingleAndDoubleClick.js";const C={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}},L=Symbol("handles");let E=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([r(()=>!e(),()=>this._disconnect()),r(e,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this.removeHandles(L),this._inputManager=o(this._inputManager)}_connect(){const e=this.view.surface,t=new j(e,this.view.input),o=[new P,new T,new z,new b(this.view.navigation),new M],r=new A({eventSource:t,recognizers:o}),a=new l(this.view,["primary"]),p=new u(this.view,["secondary"]);r.installHandlers("prevent-context-menu",[new _],y.INTERNAL),r.installHandlers("navigation",[new f(this.view),new h(this.view),new g(this.view),new c(this.view),new c(this.view,[C.counter]),a,new w(this.view,C.pan),new v(this.view,C.zoom),new d(this.view,C.rotate),p,new m(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(r),this._source=t,this._inputManager=r,this.addHandles([i(()=>this.view?.navigation?.browserTouchPanEnabled,e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)},n),i(()=>{const{actionMap:e}=this.view.navigation;return{panActions:D("pan",e),rotateActions:D("rotate",e)}},({panActions:e,rotateActions:t})=>{a.pointerActions=e,p.pointerActions=t},s)],L)}get test(){}};e([a()],E.prototype,"view",void 0),e([a()],E.prototype,"latestPointerType",null),e([a()],E.prototype,"latestPointerLocation",null),e([a()],E.prototype,"multiTouchActive",null),E=e([p("esri.views.2d.input.MapViewInputManager")],E);const k=E;export{k as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as o}from"../../../core/maybe.js";import{when as r,watch as i,initial as n,syncAndInitial as s}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as c}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as p}from"./handlers/DoubleClickZoom.js";import{DoubleTapDragZoom as m}from"./handlers/DoubleTapDragZoom.js";import{DragPan as h}from"./handlers/DragPan.js";import{DragRotate as l}from"./handlers/DragRotate.js";import{GamepadNavigation as u}from"./handlers/GamepadNavigation.js";import{KeyPan as w}from"./handlers/KeyPan.js";import{KeyRotate as d}from"./handlers/KeyRotate.js";import{KeyZoom as v}from"./handlers/KeyZoom.js";import{MouseWheelZoom as f}from"./handlers/MouseWheelZoom.js";import{PinchRotateAndZoom as g}from"./handlers/PinchAction.js";import{BrowserEventSource as j}from"../../input/BrowserEventSource.js";import{InputManager as A,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as D}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as _}from"../../input/handlers/support.js";import{DoubleTapDrag as M}from"../../input/recognizers/DoubleTapDrag.js";import{Drag as b}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as z}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as I}from"../../input/recognizers/SingleAndDoubleClick.js";const T={counter:"Control",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwise:["a","A"],counterClockwise:["d","D"],reset:["n","N"]}},C=Symbol("handles");let E=class extends t{initialize(){const e=()=>this.view?.ready;this.addHandles([r(()=>!e(),()=>this._disconnect()),r(e,()=>this._connect())])}destroy(){this._disconnect()}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}isModifierKeyDown(e){return this._inputManager?.isModifierKeyDown(e)??!1}_disconnect(){this.view.viewEvents.disconnect(),this.removeHandles(C),this._inputManager=o(this._inputManager)}_connect(){const e=this.view.surface,t=new j(e,this.view.input),o=[new z,new P,new I,new b(this.view.navigation),new M],r=new A({eventSource:t,recognizers:o}),a=new h(this.view,["primary"]),c=new l(this.view,["secondary"]);r.installHandlers("prevent-context-menu",[new D],y.INTERNAL),r.installHandlers("navigation",[new g(this.view),new u(this.view),new f(this.view),new p(this.view),new p(this.view,[T.counter]),a,new w(this.view,T.pan),new v(this.view,T.zoom),new d(this.view,T.rotate),c,new m(this.view,"touch")],y.INTERNAL),this.view.viewEvents.connect(r),this._source=t,this._inputManager=r,this.addHandles([i(()=>this.view?.navigation?.browserTouchPanEnabled,e=>{this._source&&(this._source.browserTouchPanningEnabled=!e)},n),i(()=>{const{actionMap:e}=this.view.navigation;return{panActions:_("pan",e),rotateActions:_("rotate",e)}},({panActions:e,rotateActions:t})=>{a.pointerActions=e,c.pointerActions=t},s)],C)}get test(){}};e([a()],E.prototype,"view",void 0),e([a()],E.prototype,"latestPointerInfo",null),e([a()],E.prototype,"multiTouchActive",null),E=e([c("esri.views.2d.input.MapViewInputManager")],E);const k=E;export{k as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import s from"../../../core/Error.js";import{watch as r,on as h,syncAndInitial as o}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{isLinkChartView as l}from"../../../linkChart/utils.js";import{Container as p}from"../engine/Container.js";import{HighlightCounter as c}from"./support/HighlightCounter.js";import{createOrReuseHighlightGradient as d}from"./support/util.js";import{getDefaultHighlightOptions as u,setDefaultHighlightOptions as g}from"../support/highlightOptionsUtils.js";import m from"../../layers/support/ClipRect.js";import f from"../../layers/support/Geometry.js";import y from"../../layers/support/Path.js";import v from"../../support/HighlightOptions.js";import{isInEffectiveScaleRange as w}from"../../support/layerViewUtils.js";const R=e.ofType({key:"type",base:null,typeMap:{rect:m,path:y,geometry:f}}),_=new(e.ofType(v)),S=m=>{const f=m;let y=class extends f{constructor(){super(...arguments),this._highlightCounter=new c,this.attached=!1,this.clips=new R,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const t=this.view?.spatialReferenceLocked??!0,e=this.view?.spatialReference;e&&t&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new s("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new p),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([r(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},o),r(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},o),r(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},o),r(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},o),r(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},o),r(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.color,haloColor:t.haloColor,fillOpacity:t.fillOpacity,haloOpacity:t.haloOpacity,haloWidth:t.haloWidth,haloBlur:t.haloBlur}})),()=>{this.container.highlightGradient=d(this.container.highlightGradient,this._mergedHighlights.items)},o),r(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._processHighlight()}),h(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},o),r(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:e})=>{const i=w(e,t);i!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=i)},o)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return u(this)}set highlightOptions(t){g(this,t)}get hasHighlight(){return this._highlightCounter.size>0}get _mergedHighlights(){if(!this.view)return _;if(!this.highlights)return this.view.highlights;const t=this.view.highlights.clone();for(const e of this.highlights){const i=t.find(t=>t.name===e.name);i&&i.assignFrom(e)}return t}get highlightIds(){return Array.from(this._highlightCounter.objectIds)}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const t=this.view?.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,e){return Promise.resolve(null)}supportsSpatialReference(t){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":case"graphics":break;default:if(l(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const t=super.getSuspendInfo(),e=!this.spatialReferenceSupported;return e&&(t.spatialReferenceNotSupported=e),t}addAttachHandles(t){this.addHandles(t,"attach")}_addHighlights(t,e){this._highlightCounter.add(t,e)&&this._processHighlight()}_removeHighlights(t,e){this._highlightCounter.delete(t,e)&&this._processHighlight()}_processHighlight(){}_getHighlights(){const t=[];for(const[e,i]of this._highlightCounter.highlightNamesByObjectId){const s=this._getHighlightBits(i);t.push({objectId:e,highlightFlags:s})}return t}_getHighlightBits(t){const e=new Set(t);let i=1,s=0;if(!this.view)return 0;const r=this._mergedHighlights;for(const{name:h}of r)e.delete(h)&&(s=i),i<<=1;return s}};return t([a()],y.prototype,"attached",void 0),t([a({type:R,set(t){const e=i(t,this._get("clips"),R);this._set("clips",e)}})],y.prototype,"clips",void 0),t([a()],y.prototype,"container",void 0),t([a({type:v})],y.prototype,"highlightOptions",null),t([a({type:e.ofType(v)})],y.prototype,"highlights",void 0),t([a()],y.prototype,"_mergedHighlights",null),t([a()],y.prototype,"moving",void 0),t([a({readOnly:!0})],y.prototype,"spatialReferenceSupported",null),t([a({readOnly:!0})],y.prototype,"updateParameters",void 0),t([a()],y.prototype,"updateRequested",void 0),t([a()],y.prototype,"updating",null),t([a()],y.prototype,"view",void 0),t([a()],y.prototype,"_visibleAtCurrentScale",void 0),t([a({readOnly:!0})],y.prototype,"visibleAtCurrentScale",null),y=t([n("esri.views.2d.layers.LayerView2D")],y),y};export{S as LayerView2DMixin};
5
+ import{__decorate as t}from"tslib";import e from"../../../core/Collection.js";import{referenceSetter as i}from"../../../core/collectionUtils.js";import{deprecatedFunction as s}from"../../../core/deprecate.js";import r from"../../../core/Error.js";import h from"../../../core/Logger.js";import{watch as o,on as a,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import{isLinkChartView as c}from"../../../linkChart/utils.js";import{Container as d}from"../engine/Container.js";import{HighlightCounter as g}from"./support/HighlightCounter.js";import{createOrReuseHighlightGradient as u}from"./support/util.js";import{getDefaultHighlightOptions as m,setDefaultHighlightOptions as f}from"../support/highlightOptionsUtils.js";import y from"../../layers/support/ClipRect.js";import v from"../../layers/support/Geometry.js";import w from"../../layers/support/Path.js";import R from"../../support/HighlightOptions.js";import{isInEffectiveScaleRange as _}from"../../support/layerViewUtils.js";const S=e.ofType({key:"type",base:null,typeMap:{rect:y,path:w,geometry:v}}),H=new(e.ofType(R)),b=y=>{const v=y;let w=class extends v{constructor(){super(...arguments),this._highlightCounter=new g,this.attached=!1,this.clips=new S,this.highlights=null,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this._visibleAtCurrentScale=!0}initialize(){const t=this.view?.spatialReferenceLocked??!0,e=this.view?.spatialReference;e&&t&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new r("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new d),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.addHandles([o(()=>this.suspended,t=>{this.container&&(this.container.visible=!t)},n),o(()=>this.updateSuspended,t=>{this.view&&!t&&this.updateRequested&&this.view.requestUpdate()},n),o(()=>this.layer?.opacity??1,t=>{this.container&&(this.container.opacity=t)},n),o(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",t=>{this.container&&(this.container.blendMode=t)},n),o(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,t=>{this.container&&(this.container.effect=t)},n),o(()=>this._mergedHighlights.items.map(t=>({name:t.name,options:{fillColor:t.color,haloColor:t.haloColor,fillOpacity:t.fillOpacity,haloOpacity:t.haloOpacity,haloWidth:t.haloWidth,haloBlur:t.haloBlur}})),()=>{this.container.highlightGradient=u(this.container.highlightGradient,this._mergedHighlights.items)},n),o(()=>this._mergedHighlights.items.map(t=>t.name),()=>{this._processHighlight()}),a(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},n),o(()=>({scale:this.view?.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}),({scale:t,scaleRange:e})=>{const i=_(e,t);i!==this._visibleAtCurrentScale&&(this._visibleAtCurrentScale=i)},n)],"constructor"),this.view?.whenLayerView?this.view.whenLayerView(this.layer).then(t=>{t===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get highlightOptions(){return this._logHighlightOptionsDeprecation(),m(this)}set highlightOptions(t){this._logHighlightOptionsDeprecation(),f(this,t)}_logHighlightOptionsDeprecation(){s(h.getLogger(this),"`LayerView.highlightOptions` is deprecated in favor of View.highlights",{replacement:"View.highlights",version:"4.33",see:"https://arcg.is/inbTa1#highlights",warnOnce:!0})}get hasHighlight(){return this._highlightCounter.size>0}get _mergedHighlights(){if(!this.view)return H;if(!this.highlights)return this.view.highlights;const t=this.view.highlights.clone();for(const e of this.highlights){const i=t.find(t=>t.name===e.name);i&&i.assignFrom(e)}return t}get highlightIds(){return Array.from(this._highlightCounter.objectIds)}get scheduler(){return this.view.scheduler}get spatialReferenceSupported(){const t=this.view?.spatialReference;return null==t||this.supportsSpatialReference(t)}get updating(){return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!this._updatingHandles?.updating||this.container.transitioning)}get visibleAtCurrentScale(){return this._visibleAtCurrentScale}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.removeHandles("attach"),this.detach(),this.updateRequested=!1)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.updateSuspended||this.view.requestUpdate())}processUpdate(t){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",t),this.updateRequested&&!this.updateSuspended&&(this.updateRequested=!1,this.update(t))):this.updateRequested=!1}hitTest(t,e){return Promise.resolve(null)}supportsSpatialReference(t){return!0}canResume(){if(!this.spatialReferenceSupported)return!1;switch(this.layer?.type){case"link-chart":case"knowledge-graph-sublayer":case"graphics":break;default:if(c(this.view)&&!this.view.inGeographicLayout)return!1}return!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const t=super.getSuspendInfo(),e=!this.spatialReferenceSupported;return e&&(t.spatialReferenceNotSupported=e),t}addAttachHandles(t){this.addHandles(t,"attach")}_addHighlights(t,e){this._highlightCounter.add(t,e)&&this._processHighlight()}_removeHighlights(t,e){this._highlightCounter.delete(t,e)&&this._processHighlight()}_processHighlight(){}_getHighlights(){const t=[];for(const[e,i]of this._highlightCounter.highlightNamesByObjectId){const s=this._getHighlightBits(i);t.push({objectId:e,highlightFlags:s})}return t}_getHighlightBits(t){const e=new Set(t);let i=1,s=0;if(!this.view)return 0;const r=this._mergedHighlights;for(const{name:h}of r)e.delete(h)&&(s=i),i<<=1;return s}};return t([l()],w.prototype,"attached",void 0),t([l({type:S,set(t){const e=i(t,this._get("clips"),S);this._set("clips",e)}})],w.prototype,"clips",void 0),t([l()],w.prototype,"container",void 0),t([l({type:R})],w.prototype,"highlightOptions",null),t([l({type:e.ofType(R)})],w.prototype,"highlights",void 0),t([l()],w.prototype,"_mergedHighlights",null),t([l()],w.prototype,"moving",void 0),t([l({readOnly:!0})],w.prototype,"spatialReferenceSupported",null),t([l({readOnly:!0})],w.prototype,"updateParameters",void 0),t([l()],w.prototype,"updateRequested",void 0),t([l()],w.prototype,"updating",null),t([l()],w.prototype,"view",void 0),t([l()],w.prototype,"_visibleAtCurrentScale",void 0),t([l({readOnly:!0})],w.prototype,"visibleAtCurrentScale",null),w=t([p("esri.views.2d.layers.LayerView2D")],w),w};export{b as LayerView2DMixin};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as I,createMeasureTypeManipulator as V,measureTypeManipulatorHandles as R,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new C,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._snappingManagerResult=dt(i),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new S);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerType??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager.options}get _snappingManager(){return this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._snappingManager,i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=new i({startPoint:w(a,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=w(a,new S);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=I(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=V(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=R(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0})}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
5
+ import{__decorate as t}from"tslib";import e from"../../../../Color.js";import i from"../../../../analysis/LengthDimension.js";import a from"../../../../core/Accessor.js";import n from"../../../../core/Handles.js";import{destroyHandle as s,handlesGroup as o}from"../../../../core/handleUtils.js";import"../../../../core/has.js";import{equals as r}from"../../../../core/lang.js";import{mapCollection as p}from"../../../../core/mapCollectionUtils.js";import{releaseMaybe as l,destroyMaybe as u}from"../../../../core/maybe.js";import{memoize as d}from"../../../../core/memoize.js";import{ignoreAbortErrors as c}from"../../../../core/promiseUtils.js";import{watch as m,initial as h,sync as g,syncAndInitial as f,when as _}from"../../../../core/reactiveUtils.js";import{property as M}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/Logger.js";import{subclass as v}from"../../../../core/accessorSupport/decorators/subclass.js";import{create as y}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{UpdatingHandles as C}from"../../../../core/support/UpdatingHandles.js";import S from"../../../../geometry/Point.js";import{clonePoint as w}from"../../../../layers/graphics/hydratedFeatures.js";import{reapplyConstraint as b,applyConstraint as P,computeConstraint as O,constraintDependencies as D}from"./lengthDimensionConstraintUtils.js";import{LengthDimensionManipulators as H,LengthDimensionPointManipulator as j,pointManipulatorHandles as T,createOffsetManipulator as x,offsetManipulatorHandles as G,LineOfSightOrientationManipulator as z,headingManipulatorHandles as U,rotationManipulatorHandles as I,createMeasureTypeManipulator as V,measureTypeManipulatorHandles as R,updateOffsetManipulatorTransform as A,updateHeadingManipulatorTransform as E,updateRotationManipulatorTransform as k,updateMeasureTypeManipulatorTransform as L,unfocusedOffsetWidth as F,focusedOffsetWidth as q}from"./lengthDimensionManipulatorUtils.js";import{isValidComputation as B,arePointsVerticallyAligned as N,computationToGeometryDependencies as J,computeGeometryFromDimension as K}from"./lengthDimensionUtils.js";import{disabledPointColor as Q,pointRadius as W,getTransparentAccentColor as X,getContrastColor as Y,initialOffsetPx as Z}from"./settings.js";import{getRotateHeadingTexture as $}from"../images/Factory.js";import{SnappingVisualizer3D as tt}from"../../interactive/SnappingVisualizer3D.js";import{LineVisualElement as et}from"../../interactive/visualElements/LineVisualElement.js";import{VerticesVisualElement as it}from"../../interactive/visualElements/VerticesVisualElement.js";import{ImageMaterial as at}from"../../webgl-engine/materials/ImageMaterial.js";import{createStipplePatternSimple as nt}from"../../webgl-engine/materials/lineStippleUtils.js";import{RibbonLineMaterial as st}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createCoordinateHelper as ot}from"../../../interactive/coordinateHelper.js";import{EditGeometry as rt}from"../../../interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as pt}from"../../../interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as lt}from"../../../interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as ut}from"../../../interactive/snapping/SnappingDragPipelineStep.js";import{acquire as dt}from"../../../interactive/snapping/SnappingManagerPool.js";import{SnappingOperation as ct}from"../../../interactive/snapping/SnappingOperation.js";import{setupSnappingToggleHandles as mt}from"../../../interactive/snapping/snappingUtils.js";let ht=class extends a{constructor(t){super(t),this._stagedDimension=null,this._computationManipulators=new Map,this._computationHandles=new n,this._updatingHandles=new C,this._getSnappingContext=d(t=>new lt({elevationInfo:{mode:"absolute-height",offset:0},pointer:t,editGeometryOperations:new pt(new rt("point",ot(!0,!1,this.view.spatialReference)),this.view.state.viewingMode),visualizer:new tt}));const{view:i}=t;this._snappingManagerResult=dt(i),this.addHandles(this._snappingManagerResult),this._unfocusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._focusedOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial=this._createOffsetManipulatorMaterial(),this._thinOffsetManipulatorMaterial.setParameters({stipplePattern:nt(2)}),this._constraintSnappingIndicator=new et({view:i,attached:!0,width:1,renderOccluded:4,stipplePattern:nt(5),isDecoration:!0});const a=e.toUnitRGBA(Q);this._stagedStartIndicator=new it({view:i,attached:!1,elevationInfo:{mode:"absolute-height",offset:0},spatialReference:t.view.renderCoordsHelper.spatialReference,color:a,size:2*W,outlineSize:0,renderOccluded:4,isDecoration:!0})}initialize(){const{view:t}=this;this._snappingOperation=new ct({view:t});const i=X(t.effectiveTheme),a=Y(t.effectiveTheme),n=!t.stage?.renderView.renderingContext.driverTest.svgPremultipliesAlpha.result;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial=new at({draped:!1,texture:this._textureHandle.texture,writeDepth:!1,renderOccluded:16,isDecoration:!0});const o=p(()=>this.analysisViewData.computations,({computation:t})=>this._createManipulators(t));this.addHandles([m(()=>({accentColor:X(t.effectiveTheme),contrastColor:Y(t.effectiveTheme)}),({accentColor:i,contrastColor:a})=>{const s=this._textureHandle;this._textureHandle=$(t.stage.textures,{accentColor:i,contrastColor:a,preMultiplyAlpha:n}),this._orientationManipulatorMaterial.setParameters({texture:this._textureHandle.texture}),s?.release();const o=e.toUnitRGBA(i);this._unfocusedOffsetManipulatorMaterial.setParameters({color:o}),this._focusedOffsetManipulatorMaterial.setParameters({color:o}),this._thinOffsetManipulatorMaterial.setParameters({color:o}),this._constraintSnappingIndicator.color=o},h),s(o),m(()=>({stagedPoint:this._snappingOperation.stagedPoint,stagedComputation:this._stagedComputation}),({stagedPoint:t,stagedComputation:e})=>{if(null==e||null==t)return;const i=w(t,new S);this._applyPointUpdate(e,{endPoint:i})},g),m(()=>({stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}),(t,e)=>{const{stagedDimension:i,selectedComputation:a,firstGrabbedManipulator:n}=t;if(i===e?.stagedDimension&&n===e?.firstGrabbedManipulator){for(const s of[a,e?.selectedComputation])if(null!=s){const e=this._computationManipulators.get(s);null!=e&&this._updateManipulators(s,e,t)}}else for(const[s,o]of this._computationManipulators)this._updateManipulators(s,o,t)},f),m(()=>this.analysis.style.lineSize,t=>this._updateManipulatorStyle(t),h),m(()=>this.view.state.camera,()=>{null!=this._stagedComputation&&this._updateStagedDimensionOffset(this._stagedComputation)}),m(()=>{const t=this._stagedComputation;if(!t)return null;const e=t.elevationAlignedStartPoint,i=y();return null!=e&&this.view.renderCoordsHelper.toRenderCoords(e,i)?i:null},t=>{null!=t?(this._stagedStartIndicator.vertices=[t],this._stagedStartIndicator.attached=!0):this._stagedStartIndicator.attached=!1})]),this.addHandles(this._constraintHandles),this.addHandles(this._snappingIndicatorHandles),mt(this,()=>{const t=this._activeComputation,e=this._stagedComputation;if(null==t||null!=e){const t=this.view.inputManager.latestPointerInfo?.type??"mouse",e=this._getSnappingContext(t);this._updatingHandles.addPromise(c(this._snappingOperation.snapAgainNearPreviousMapPoint(this._snappingManager,e)))}if(null!=t){const{start:e,end:i}=this._computationManipulators.get(t);if(e.grabbing||i.grabbing){const i=e.grabbing?"start":"end",a=this._computeConstraint(t);b(t,i,{constraint:a,view:this.view})}}})}destroy(){this._textureHandle=l(this._textureHandle),this._snappingOperation=u(this._snappingOperation),this._computationHandles.destroy(),this._constraintSnappingIndicator.destroy(),this._stagedStartIndicator.destroy(),this._orientationManipulatorMaterial.dispose()}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}get firstGrabbedManipulator(){return this.parentTool.firstGrabbedManipulator}get hasGrabbedManipulators(){return this.parentTool.hasGrabbedManipulators}get snappingOptions(){return this._snappingManager.options}get _snappingManager(){return this._snappingManagerResult.snappingManager}get _activeComputation(){if(null!=this._stagedComputation)return this._stagedComputation;const{selectedComputation:t}=this.analysisViewData;return this.hasGrabbedManipulators&&null!=t?t:null}get _stagedComputation(){const t=this._stagedDimension,e=this.analysisViewData.computations.at(-1)?.computation;return null==t||null==e||e.dimension!==t?null:e}get _constraintHandles(){return[_(()=>this.analysisViewData.selectedComputation,t=>{t.previousConstraint=this._computeConstraint(t)},{...f,equals:r}),m(()=>{const t=this._activeComputation;if(null==t)return null;const{measureType:e,orientation:i}=t.dimension;return{measureType:e,orientation:i,computation:t}},(t,e)=>{if(null!=t&&null==e){const{measureType:e,orientation:i,computation:a}=t;switch(a.previousConstraint){case 0:a.preConstraintProperties={measureType:"horizontal",orientation:0};break;case 1:a.preConstraintProperties={measureType:"vertical",orientation:0};break;case 2:a.preConstraintProperties={measureType:"direct",orientation:i};break;default:a.preConstraintProperties={measureType:e,orientation:i}}}null==t&&null!=e&&(e.computation.preConstraintProperties=null)},g)]}get _snappingIndicatorHandles(){const t="snapping-indicator-event-handles";return[m(()=>({stagedComputation:this._stagedComputation,activeComputation:this._activeComputation}),({stagedComputation:e,activeComputation:i})=>{const a=this._constraintSnappingIndicator;if(this.removeHandles(t),null!=i)if(i===e)a.attached=!0;else{const{start:e,end:n}=this._computationManipulators.get(i),s=()=>{a.attached=e.grabbing||n.grabbing};s(),this.addHandles([e.events.on("grab-changed",s),n.events.on("grab-changed",s)],t)}else a.attached=!1}),m(()=>{const t=this._activeComputation;return null!=t?{geometry:t.geometry,constraint:t.previousConstraint}:{}},({geometry:t,constraint:e})=>{const i=this._constraintSnappingIndicator;null!=t&&null!=e&&2!==e?(i.visible=!0,i.setGeometryFromSegment(t.directSegment)):i.visible=!1})]}removeStaged(){return null!=this._stagedDimension&&(this.analysis.dimensions.remove(this._stagedDimension),this._stagedDimension=null,!0)}onDeactivate(){this.removeStaged(),this._resetSnappingState()}onClick(t){const{_stagedDimension:e}=this;if(null==e){const e=this._onUnstagedClick(t);return this.analysis.dimensions.add(e),null}return this._onStagedClick(t),e}onPointerMove({mapPoint:t,pointerType:e}){if("touch"===e)return;const i=this._getSnappingContext(e);this._updatingHandles.addPromise(c(this._snappingOperation.snap({point:t},this._snappingManager,i)))}onManipulatorSelectionChanged(){if(null!=this.analysisViewData.selectedComputation){this._computationManipulators.get(this.analysisViewData.selectedComputation).offset.selected||(this.analysisViewData.selectedDimension=null)}}_onUnstagedClick({mapPoint:t,pointerType:e}){let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=new i({startPoint:w(a,new S),endPoint:null,measureType:"horizontal"});return this._stagedDimension=n,this._resetSnappingState(),n}_onStagedClick({mapPoint:t,pointerType:e}){const i=this._stagedComputation;if(null==i)return;let a=t;if("mouse"===e){const i=this._getSnappingContext(e);a=this._snappingManager.update({point:t,context:i})}const n=w(a,new S);this._applyPointUpdate(i,{endPoint:n}),this._stagedDimension=null,this._resetSnappingState()}_resetSnappingState(){this._snappingManager.doneSnapping(),this._snappingOperation.abort(),this._snappingOperation.stagedPoint=null}_createManipulators(t){const e=this._setupPointManipulator(t,{isStart:!0}),i=this._setupPointManipulator(t,{isStart:!1}),a=this._setupOffsetManipulator(t),n=this._setupHeadingManipulator(t),s=this._setupRotationManipulator(t),r=this._setupMeasureTypeManipulator(t,"direct"),p=this._setupMeasureTypeManipulator(t,"horizontal"),l=this._setupMeasureTypeManipulator(t,"vertical"),u=new H({start:e,end:i,offset:a,heading:n,rotation:s,direct:r,horizontal:p,vertical:l});this._setupComputationToManipulatorsSync(t,u),this._computationManipulators.set(t,u),this.manipulators.addMany(u.values());const d=o(u.values().map(t=>t.events.on("focus-changed",()=>{u.values().some(t=>t.focused)&&this._resetSnappingState()})));return{manipulators:u,remove:()=>{d.remove(),this._computationHandles.remove(t),this._computationManipulators.delete(t);for(const t of u.values())this.manipulators.remove(t)}}}_setupComputationToManipulatorsSync(t,e){this._computationHandles.add([m(()=>t.geometry,()=>this._updateManipulators(t,e),{...f,equals:r})],t)}_setupPointManipulator(t,e){const{view:i}=this,{dimension:a}=t,n=new j(i,{metadata:a}),s=T(n,{isStart:e.isStart,createSnappingPipelineStep:t=>ut({snappingContext:this._getSnappingContext(t),snappingManager:this._snappingManager,updatingHandles:this._updatingHandles}),dimension:a,onUpdate:e=>this._applyPointUpdate(t,e),view:i});return this._computationHandles.add(s,t),n}_setupOffsetManipulator(t){const{view:e}=this,i=x(e,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,metadata:t.dimension}),a=G(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupHeadingManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=U(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupRotationManipulator(t){const{view:e}=this,i=new z(e,{lineSizePt:this.analysis.style.lineSize,material:this._orientationManipulatorMaterial,metadata:t.dimension}),a=I(i,{computation:t,view:e});return this._computationHandles.add(a,t),i}_setupMeasureTypeManipulator(t,e){const{view:i}=this,a=V(i,{lineSizePt:this.analysis.style.lineSize,unfocusedMaterial:this._unfocusedOffsetManipulatorMaterial,focusedMaterial:this._focusedOffsetManipulatorMaterial,thinOffsetManipulatorMaterial:this._thinOffsetManipulatorMaterial,metadata:t.dimension}),n=R(a,{computation:t,manipulatorMeasureType:e,view:i});return this._computationHandles.add(n,t),a}_updateManipulators(t,e,i={stagedDimension:this._stagedDimension,selectedComputation:this.analysisViewData.selectedComputation,firstGrabbedManipulator:this.firstGrabbedManipulator}){const{stagedDimension:a,selectedComputation:n,firstGrabbedManipulator:s}=i,{start:o,end:r,offset:p,heading:l,rotation:u}=e,d=n===t,c=B(t),{dimension:m}=t;for(const f of e.values()){const t=c&&null==a&&(null==s||f===s);f===p?(f.available=t,f.selected=d):f.available=t&&d}if(!c)return;null!=this._computeConstraint(t)?e.forEachMeasureTypeManipulator(t=>t.available=!1):e.manipulatorForMeasureType(m.measureType).available=!1;for(const f of[l,u])"direct"===m.measureType&&0!==m.offset||(f.available=!1);N(t)?u.available=!1:l.available=!1;const{geometry:h}=t;o.renderLocation=h.directSegment.startRenderSpace,r.renderLocation=h.directSegment.endRenderSpace;const{renderCoordsHelper:g}=this.view;A(p,h,g),l.available&&E(l,t,g),u.available&&k(u,t,g),e.forEachMeasureTypeManipulator((e,i)=>{e.available&&L(e,t,i,g)})}_updateManipulatorStyle(t){const e=F(t),i=q(t),a={lineSizePt:t,material:this._orientationManipulatorMaterial};for(const{offset:n,heading:s,rotation:o}of this._computationManipulators.values())n.radius=i/2,s.update(a),o.update(a);this._unfocusedOffsetManipulatorMaterial.setParameters({width:e}),this._focusedOffsetManipulatorMaterial.setParameters({width:i})}_applyPointUpdate(t,e){const{view:i}=this,a=J(t);"startPoint"in e&&(a.elevationAlignedStartPoint=e.startPoint),"endPoint"in e&&(a.elevationAlignedEndPoint=e.endPoint);const n=K(a,i.renderCoordsHelper);if(null==n)return;const s=this._computeConstraint({...a,geometry:n});P(t,e,{...a,constraint:s,unconstrainedGeometry:n,view:i}),t===this._stagedComputation&&this._updateStagedDimensionOffset(t)}_updateStagedDimensionOffset(t){if(null==t.geometry)return;t.geometry.directSegment.eval(.5,gt);const{state:e,renderCoordsHelper:i}=this.view,a=e.camera.computeScreenPixelSizeAt(gt);t.dimension.offset=Z*a*i.unitInMeters}_computeConstraint(t){return O(D(t,this._snappingManager.options),this.view)}_createOffsetManipulatorMaterial(){return new st({width:1,renderOccluded:4,writeDepth:!1,hasPolygonOffset:!0,isDecoration:!0})}get test(){}};t([M({constructOnly:!0})],ht.prototype,"analysis",void 0),t([M({constructOnly:!0})],ht.prototype,"analysisViewData",void 0),t([M({constructOnly:!0})],ht.prototype,"manipulators",void 0),t([M({constructOnly:!0})],ht.prototype,"parentTool",void 0),t([M({constructOnly:!0,nonNullable:!0})],ht.prototype,"view",void 0),t([M({readOnly:!0})],ht.prototype,"updating",null),t([M()],ht.prototype,"firstGrabbedManipulator",null),t([M()],ht.prototype,"hasGrabbedManipulators",null),t([M()],ht.prototype,"snappingOptions",null),t([M()],ht.prototype,"_stagedDimension",void 0),t([M()],ht.prototype,"_activeComputation",null),t([M()],ht.prototype,"_stagedComputation",null),ht=t([v("esri.views.3d.analysis.Dimension.LengthDimensionSubTool")],ht);const gt=y();export{ht as LengthDimensionSubTool};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import r from"../../../../core/Accessor.js";import t from"../../../../core/Collection.js";import{watch as e,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as a}from"../../../../core/accessorSupport/decorators/subclass.js";import{HoveredPointVisualization as n}from"./HoveredPointVisualization.js";let p=class extends r{constructor(o){super(o),this._hoveredPoints=new t}initialize(){this.addHandles([e(()=>{const o=this.analysisViewData.analysis;return this.analysisViewData.hoveredPoints.map((r,t)=>r?{hoveredPoint:r,color:o.profiles.at(t).color}:null).filter(o=>!!o)},o=>this._update(o),s)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}_update(o){const{view:r,_hoveredPoints:t}=this,e=o.length;for(;t.length>e;)t.pop()?.destroy();for(;t.length<e;){const o=new n({view:r});t.push(o)}for(let s=0;s<e;++s){const r=o[s],i=t.at(e-1-s);i.position=r.hoveredPoint,i.color=r.color}}};o([i()],p.prototype,"view",void 0),o([i()],p.prototype,"analysisViewData",void 0),o([i()],p.prototype,"_hoveredPoints",void 0),p=o([a("esri.views.3d.analysis.ElevationProfile.HoveredPointsVisualization")],p);export{p as HoveredPointsVisualization};
5
+ import{__decorate as o}from"tslib";import e from"../../../../core/Accessor.js";import r from"../../../../core/Collection.js";import{watch as t,syncAndInitial as s}from"../../../../core/reactiveUtils.js";import{property as i}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as n}from"../../../../core/accessorSupport/decorators/subclass.js";import{HoveredPointVisualization as a}from"./HoveredPointVisualization.js";let p=class extends e{constructor(o){super(o),this._hoveredPoints=new r}initialize(){this.addHandles([t(()=>{const{analysis:o,hoveredPoints:e}=this.analysisViewData;return e.map((e,r)=>{const t=o.profiles.at(r);return!0===t?.viewOptions.hoveredPointVisible&&null!=e?{hoveredPoint:e,color:t.color}:null}).filter(o=>!!o)},o=>this._update(o),s)])}destroy(){this._hoveredPoints.drain(o=>o.destroy())}_update(o){const{view:e,_hoveredPoints:r}=this,t=o.length;for(;r.length>t;)r.pop()?.destroy();for(;r.length<t;){const o=new a({view:e});r.push(o)}for(let s=0;s<t;++s){const e=o[s],i=r.at(t-1-s);i.position=e.hoveredPoint,i.color=e.color}}};o([i()],p.prototype,"view",void 0),o([i()],p.prototype,"analysisViewData",void 0),o([i()],p.prototype,"_hoveredPoints",void 0),p=o([n("esri.views.3d.analysis.ElevationProfile.HoveredPointsVisualization")],p);export{p as HoveredPointsVisualization};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as i,n,g as c,f as a}from"../../../../chunks/vec32.js";import{create as l,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{copy as u,fromPoints as d,create as f}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{getObjectId as y}from"../../../../layers/graphics/dehydratedFeatures.js";import{LineOfSightIntersectionResult as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as w}from"../../terrain/Intersector.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as I}from"../../webgl-engine/lib/intersectorUtilsConversions.js";let b=class extends r{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=new v(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}getScreenPointIntersection(e){const r=t(e,g.get()),o=j(this.view.state.camera,r,x);return this._getRayIntersection(o)}_getRayIntersection(e,r){const{view:t,intersector:o}=this;if(null==e||null==t.sceneIntersectionHelper)return null;o.options.store=0,t.sceneIntersectionHelper.intersectToolIntersectorRay(e,o,r);const s=o.results.min;if(null==s.target)return null;const i=l();if(!s.getIntersectionPoint(i))return null;if(null!=r?.maxDistance&&!s.withinDistance(r.maxDistance))return null;const n=t.renderCoordsHelper.fromRenderCoords(i,new m({spatialReference:t.spatialReference})),c=p(s.normal);if(w(s))return new h({type:2,id:s.target.lij.slice(),mapPoint:n,renderPoint:i,normal:c,ray:u(e),graphic:null});const a=I(s,t);if(null==a)return null;const{layer:d,sourceLayer:f}=a,g="scene"===f?.type?y(a,f.objectIdField):a.uid;return new h({type:0,id:`${d?.uid}/${g}`,mapPoint:n,renderPoint:i,normal:c,ray:u(e),graphic:a})}updateFromGroundIntersection(e,r,t){const o=R,s=P,l=L,m=S;i(s,e),this.view.renderCoordsHelper.worldUpAtPosition(s,l),n(l,l);const u=this.view.basemapTerrain.visibleElevationBounds,f=(r>=0?1:-1)*((u?Math.abs(u.max-u.min):100)+Math.abs(r));c(m,l,f),a(o,s,m),d(o,s,x);const g=this._getRayIntersection(x,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:f});if(null!=g){const e=S;return c(e,l,r),a(t,g.renderPoint,e),p(g.normal)}return i(t,e),null}};e([o()],b.prototype,"view",void 0),e([o()],b.prototype,"intersector",void 0),b=e([s("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],b);const R=l(),P=l(),L=l(),S=l(),x=f();export{b as LineOfSightRayIntersector};
5
+ import{__decorate as e}from"tslib";import r from"../../../../core/Accessor.js";import{screenPointObjectToArray as t}from"../../../../core/screenUtils.js";import{property as o}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/has.js";import"../../../../core/Logger.js";import"../../../../core/RandomLCG.js";import{subclass as s}from"../../../../core/accessorSupport/decorators/subclass.js";import{c as i,n,g as c,f as a}from"../../../../chunks/vec32.js";import{create as l,clone as p}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import m from"../../../../geometry/Point.js";import{create as u,copy as d,fromPoints as f}from"../../../../geometry/support/ray.js";import{sv2d as g}from"../../../../geometry/support/vectorStacks.js";import{getObjectId as y}from"../../../../layers/graphics/dehydratedFeatures.js";import{LineOfSightIntersectionResult as h}from"./LineOfSightIntersectionResult.js";import{fromScreen as j}from"../../support/geometryUtils/ray.js";import{isTerrainIntersectorResult as w}from"../../terrain/Intersector.js";import{Intersector as v}from"../../webgl-engine/lib/Intersector.js";import{toGraphic as I}from"../../webgl-engine/lib/intersectorUtilsConversions.js";let b=class extends r{constructor(e){super(e),this._terrainIntersectionOptionsLayerUids=new Set(["terrain"])}initialize(){this.intersector=new v(this.view.state.viewingMode),this.intersector.options.hud=!1,this.intersector.options.store=0}getScreenPointIntersection(e){const r=t(e,g.get()),o=j(this.view.state.camera,r,x);return this._getRayIntersection(o)}_getRayIntersection(e,r){const{view:t,intersector:o}=this;if(null==e||null==t.sceneIntersectionHelper)return null;o.options.store=0,t.sceneIntersectionHelper.intersectToolIntersectorRay(e,o,r);const s=o.results.min;if(null==s.target)return null;const i=l();if(!s.getIntersectionPoint(i))return null;if(null!=r?.maxDistance&&!s.withinDistance(r.maxDistance))return null;const n=t.renderCoordsHelper.fromRenderCoords(i,new m({spatialReference:t.spatialReference})),c=p(s.normal);if(w(s))return new h({type:2,id:s.target.lij.slice(),mapPoint:n,renderPoint:i,normal:c,ray:d(e),graphic:null});const a=I(s,t);if(null==a)return null;const{layer:u,sourceLayer:f}=a,g="scene"===f?.type?y(a,f.objectIdField):a.uid;return new h({type:0,id:`${u?.uid}/${g}`,mapPoint:n,renderPoint:i,normal:c,ray:d(e),graphic:a})}updateFromGroundIntersection(e,r,t){const o=R,s=P,l=L,m=S;i(s,e),this.view.renderCoordsHelper.worldUpAtPosition(s,l),n(l,l);const u=this.view.basemapTerrain.visibleElevationBounds,d=(r>=0?1:-1)*((u?Math.abs(u.max-u.min):100)+Math.abs(r));c(m,l,d),a(o,s,m),f(o,s,x);const g=this._getRayIntersection(x,{include:this._terrainIntersectionOptionsLayerUids,maxDistance:d});if(null!=g){const e=S;return c(e,l,r),a(t,g.renderPoint,e),p(g.normal)}return i(t,e),null}};e([o()],b.prototype,"view",void 0),e([o()],b.prototype,"intersector",void 0),b=e([s("esri.views.3d.analysis.LineOfSight.LineOfSightRayIntersector")],b);const R=l(),P=l(),L=l(),S=l(),x=u();export{b as LineOfSightRayIntersector};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../../../Color.js";import r from"../../../../core/Handles.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{deg2rad as a,clamp as i}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromRotation as m,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as d,a as _,g}from"../../../../chunks/vec32.js";import{create as M,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as v}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as j}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as w,screenToCircleAngle as A}from"./viewshedToolUtils.js";import{Manipulator3D as V}from"../../interactive/Manipulator3D.js";import{RenderObject as O}from"../../interactive/RenderObject.js";import{InteractiveManipulation as E}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as R}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as U}from"../../../interactive/dragEventPipeline.js";class x extends E{constructor(t){super(),this._handles=new r,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles=o(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(t,r){const a=Object.values(this._manipulators);return e(a.map(({manipulator:e,side:a})=>U(e,(e,i,o,n,s)=>{const l=z(a,r),c=i.next(t=>({...t,manipulatorType:2,side:a})),u=A(c,this._view,l,r);t(e,u,o)})))}updateManipulatorsTransform(t){t.arcCentersPoints(H),this._forEachManipulatorInfo(r=>this._updateArcManipulatorTransform(r,t,H[r.side]))}updateManipulatorVisuals(t){this._forEachManipulatorInfo(r=>this._updateArcManipulatorVisuals(r,t))}_updateArcManipulatorVisuals({manipulator:t,side:r},e){const a=[];if(null!=e){const[i,o]=P(r,e,this._unfocusedArcMaterial);a.push(new O(i,1),new O(i.instantiate({material:this._focusedArcMaterial}),2)),t.collisionType={type:"line",paths:[o]}}t.renderObjects=a,t.radius=j.collisionRadius}_updateArcManipulatorTransform({manipulator:t,side:r},e,i){const o=e.horizontalFieldOfView,n=a(e.verticalFieldOfView/2),s=a(o/2),_=I(r);t.renderLocation=i;const g=f(),M=t=>{h(g,t,g)};M(l(k,a(-90))),_||M(c(k,n));const b=e.farDistanceRenderSpace;let v,j;M(u(k,d(L,b,b,b))),M(p(k,F(r))),M(w(e,k)),_?(v=s,j=e.tiltedUpVector):(j=e.rightVector,v=n),v*="right"===r||"bottom"===r?-1:1;const A=m(k,v,j);null!=A&&M(A),t.modelTransform=g}_createManipulators(){const t=this._createArcManipulator("left"),r=this._createArcManipulator("right"),e=this._createArcManipulator("top"),a=this._createArcManipulator("bottom");this._manipulators={left:t,right:r,top:e,bottom:a};[[a.manipulator,e.manipulator],[t.manipulator,r.manipulator]].forEach(([t,r])=>{t.metadata={pairedManipulator:r},r.metadata={pairedManipulator:t}})}_createArcManipulator(t){const r=new V({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),e={manipulator:r,side:t};return this._updateArcManipulatorVisuals(e),this._handles.add(r.events.on("focus-changed",t=>{const e=r.metadata?.pairedManipulator;null!=e&&(e.hovering!==r.hovering&&(e.hovering=r.hovering),e.grabbing!==r.grabbing&&(e.grabbing=r.grabbing))})),e}_createArcMaterial(r){const e=j.getFovArcWidth(r),a=new T({renderOccluded:4,isDecoration:!0,width:e});return this._handles.add(n(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>a.setParameters({color:t}),s)),a}forEachManipulator(t){Object.values(this._manipulators).forEach(({manipulator:r})=>t(r,2))}_forEachManipulatorInfo(t){Object.values(this._manipulators).forEach(r=>t(r))}get test(){return{manipulators:this._manipulators}}}function P(t,r,e){const{horizontalFieldOfView:o,verticalFieldOfView:n}=r,s=I(t),l=a(i((s?n:o)/2,0,15)),c=S(-l/2,l/2,s?1:Math.max(Math.sin(a(90-n/2)),.1));return[y(e,c),c]}function S(t,r,e,a=10){R(a>1,"createArcPolylineGeometry() needs at least 2 for numVertices");const i=r-t;if(i<=0||e<=0){const t=.01;return[b(0,0,t),b(0,0,-t)]}const o=[],n=i/a;for(let s=0;s<a;s++){let i=t+s*n;s===a-1&&(i=r);const l=Math.cos(i)*e,c=Math.sin(i)*e,u=b(l-e,0,c);o.push(u)}return o}function D(t){switch(t){case"left":return 0;case"bottom":return 1;case"right":return 2;case"top":return 3}}function F(t){return D(t)*G}function I(t){return"left"===t||"right"===t}function C(t){return"left"===t?"right":"right"===t?"left":"top"===t?"bottom":"top"}function z(t,{observerRenderSpace:r,targetRenderSpace:e,tiltedUpVector:a,rightVector:i,farDistanceRenderSpace:o}){const n=_(L,e,r),s=I(t)?i:a,l=g(B,s,o);return v(r,n,l)}const G=Math.PI/2,k=f(),L=M(),B=M(),H={top:M(),bottom:M(),left:M(),right:M()};export{x as FieldOfViewManipulation,S as createArcPolylineVertices,C as flipSide,I as isSideHorizontal,F as sideToRad};
5
+ import t from"../../../../Color.js";import r from"../../../../core/Handles.js";import{handlesGroup as e}from"../../../../core/handleUtils.js";import{deg2rad as a,clamp as i}from"../../../../core/mathUtils.js";import{destroyMaybe as o}from"../../../../core/maybe.js";import{watch as n,initial as s}from"../../../../core/reactiveUtils.js";import{fromYRotation as l,fromXRotation as c,fromScaling as u,fromZRotation as p,fromRotation as m,multiply as h}from"../../../../core/libs/gl-matrix-2/math/mat4.js";import{create as f}from"../../../../core/libs/gl-matrix-2/factories/mat4f64.js";import{i as d,a as g,g as _}from"../../../../chunks/vec32.js";import{create as M,fromValues as b}from"../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{f as v}from"../../../../chunks/boundedPlane.js";import{viewshedToolManipulatorConfiguration as j}from"./ViewshedConfiguration.js";import{getViewshedRotationMatrix as w,screenToCircleAngle as A}from"./viewshedToolUtils.js";import{Manipulator3D as V}from"../../interactive/Manipulator3D.js";import{RenderObject as O}from"../../interactive/RenderObject.js";import{InteractiveManipulation as E}from"../../interactive/editingTools/manipulations/InteractiveManipulation.js";import{createPolylineGeometry as y}from"../../webgl-engine/lib/GeometryUtil.js";import{assert as R}from"../../webgl-engine/lib/Util.js";import{RibbonLineMaterial as T}from"../../webgl-engine/materials/RibbonLineMaterial.js";import{createManipulatorDragEventPipeline as U}from"../../../interactive/dragEventPipeline.js";class x extends E{constructor(t){super(),this._handles=new r,this._tool=t.tool,this._view=t.view,this._focusedArcMaterial=this._createArcMaterial(!0),this._unfocusedArcMaterial=this._createArcMaterial(!1),this._createManipulators(),this.forEachManipulator(t=>this._tool.manipulators.add(t))}destroy(){this._handles=o(this._handles),this.forEachManipulator(t=>{this._tool.manipulators.remove(t),t.destroy()}),this._tool=null,this._view=null,this._manipulators=null}createDragPipeline(t,r){const a=Object.values(this._manipulators);return e(a.map(({manipulator:e,side:a})=>U(e,(e,i,o,n,s)=>{const l=z(a,r),c=i.next(t=>({...t,manipulatorType:2,side:a})),u=A(c,this._view,l,r);t(e,u,o)})))}updateManipulatorsTransform(t){t.arcCentersPoints(H),this._forEachManipulatorInfo(r=>this._updateArcManipulatorTransform(r,t,H[r.side]))}updateManipulatorVisuals(t){this._forEachManipulatorInfo(r=>this._updateArcManipulatorVisuals(r,t))}_updateArcManipulatorVisuals({manipulator:t,side:r},e){const a=[];if(null!=e){const[i,o]=P(r,e,this._unfocusedArcMaterial);a.push(new O(i,1),new O(i.instantiate({material:this._focusedArcMaterial}),2)),t.collisionType={type:"line",paths:[o]}}t.renderObjects=a,t.radius=j.collisionRadius}_updateArcManipulatorTransform({manipulator:t,side:r},e,i){const o=e.horizontalFieldOfView,n=a(e.verticalFieldOfView/2),s=a(o/2),g=I(r);t.renderLocation=i;const _=f(),M=t=>{h(_,t,_)};M(l(k,a(-90))),g||M(c(k,n));const b=e.farDistanceRenderSpace;let v,j;M(u(k,d(L,b,b,b))),M(p(k,F(r))),M(w(e,k)),g?(v=s,j=e.tiltedUpVector):(j=e.rightVector,v=n),v*="right"===r||"bottom"===r?-1:1;const A=m(k,v,j);null!=A&&M(A),t.modelTransform=_}_createManipulators(){const t=this._createArcManipulator("left"),r=this._createArcManipulator("right"),e=this._createArcManipulator("top"),a=this._createArcManipulator("bottom");this._manipulators={left:t,right:r,top:e,bottom:a};[[a.manipulator,e.manipulator],[t.manipulator,r.manipulator]].forEach(([t,r])=>{t.metadata={pairedManipulator:r},r.metadata={pairedManipulator:t}})}_createArcManipulator(t){const r=new V({view:this._view,autoScaleRenderObjects:!1,worldSized:!0}),e={manipulator:r,side:t};return this._updateArcManipulatorVisuals(e),this._handles.add(r.events.on(["focus-changed","grab-changed"],t=>{const e=r.metadata?.pairedManipulator;null!=e&&(e.hovering!==r.hovering&&(e.hovering=r.hovering),e.grabbing!==r.grabbing&&(e.grabbing=r.grabbing))})),e}_createArcMaterial(r){const e=j.getFovArcWidth(r),a=new T({renderOccluded:4,isDecoration:!0,width:e});return this._handles.add(n(()=>t.toUnitRGBA(this._view.effectiveTheme.accentColor),t=>a.setParameters({color:t}),s)),a}forEachManipulator(t){Object.values(this._manipulators).forEach(({manipulator:r})=>t(r,2))}_forEachManipulatorInfo(t){Object.values(this._manipulators).forEach(r=>t(r))}get test(){return{manipulators:this._manipulators}}}function P(t,r,e){const{horizontalFieldOfView:o,verticalFieldOfView:n}=r,s=I(t),l=a(i((s?n:o)/2,0,15)),c=S(-l/2,l/2,s?1:Math.max(Math.sin(a(90-n/2)),.1));return[y(e,c),c]}function S(t,r,e,a=10){R(a>1,"createArcPolylineGeometry() needs at least 2 for numVertices");const i=r-t;if(i<=0||e<=0){const t=.01;return[b(0,0,t),b(0,0,-t)]}const o=[],n=i/a;for(let s=0;s<a;s++){let i=t+s*n;s===a-1&&(i=r);const l=Math.cos(i)*e,c=Math.sin(i)*e,u=b(l-e,0,c);o.push(u)}return o}function D(t){switch(t){case"left":return 0;case"bottom":return 1;case"right":return 2;case"top":return 3}}function F(t){return D(t)*G}function I(t){return"left"===t||"right"===t}function C(t){return"left"===t?"right":"right"===t?"left":"top"===t?"bottom":"top"}function z(t,{observerRenderSpace:r,targetRenderSpace:e,tiltedUpVector:a,rightVector:i,farDistanceRenderSpace:o}){const n=g(L,e,r),s=I(t)?i:a,l=_(B,s,o);return v(r,n,l)}const G=Math.PI/2,k=f(),L=M(),B=M(),H={top:M(),bottom:M(),left:M(),right:M()};export{x as FieldOfViewManipulation,S as createArcPolylineVertices,C as flipSide,I as isSideHorizontal,F as sideToRad};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import s from"../../core/Error.js";const i={"area-measurement":()=>import("./analysis/AreaMeasurementAnalysisView3D.js"),dimension:()=>import("./analysis/DimensionAnalysisView3D.js"),"direct-line-measurement":()=>import("./analysis/DirectLineMeasurementAnalysisView3D.js"),"elevation-profile":()=>import("./analysis/ElevationProfileAnalysisView3D.js"),"line-of-sight":()=>import("./analysis/LineOfSightAnalysisView3D.js"),slice:()=>import("./analysis/SliceAnalysisView3D.js"),viewshed:()=>import("./analysis/ViewshedAnalysisView3D.js"),"volume-measurement":()=>import("./analysis/VolumeMeasurementAnalysisView3D.js")};function e(e){const n=i[e.type];if(!n)throw new s("analysis-view-module-import-utils:analysis-not-supported",`Analysis "${e.type}" is not supported`);return n()}export{e as importAnalysisViewModule};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as o}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as e,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as c}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as g}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as l}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as y}from"../../input/BrowserEventSource.js";import{InputManager as f,ViewEventPriorities as v}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as j}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as A}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as T}from"../../input/recognizers/VerticalTwoFingerDrag.js";let b=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:o,dragPrimary:r,dragSecondary:t,dragTertiary:e})=>{"pro"===o&&(t="zoom",e="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:t,dragTertiary:e};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(o){const{actionMap:r}=this.view.navigation;r.dragPrimary=o,r.dragSecondary="pan"===o?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerType(){return this._inputManager?.latestPointerType}get latestPointerLocation(){return this._inputManager?.latestPointerLocation}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=t(this._inputManager),this._source=t(this._source)}connect(){const o=this.view;this._source=new y(this.view.surface,o.input);const r=[new A,new P,new M,new j(this.view.navigation),new T],t=new f({eventSource:this._source,recognizers:r});this._inputManager=t,t.installHandlers("prevent-context-menu",[new _],v.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new l(o,["primary"]),this._modeDragRotate=new m(o,["secondary"],0),this._modeDragZoom=new p(o,["tertiary"],a.fov),this._modeKeyboardNavigation=new g(o,a),t.installHandlers("navigation",[new h(o),new d(o),new c(o),new u(o,a.fov),new m(o,["primary"],1,[a.lookAround.modifier]),new m(o,["secondary"],0,[a.lookAround.modifier]),new l(o,["tertiary"],[a.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(o)],v.INTERNAL),this.view.viewEvents.connect(t),this.addHandles([e(()=>this.view.navigation?.browserTouchPanEnabled,o=>{this._source.browserTouchPanningEnabled=!o},i),e(()=>{const{actionMap:o}=this.view.navigation,{dragPrimary:r,dragSecondary:t,dragTertiary:e}=o;return{mode:this.mode,dragPrimary:r,dragSecondary:t,dragTertiary:e}},this._updateMode,n)])}isModifierKeyDown(o){return this._inputManager?.isModifierKeyDown(o)??!1}get test(){}};o([a()],b.prototype,"view",void 0),o([a({type:["default","pro"]})],b.prototype,"mode",void 0),o([a({readOnly:!0})],b.prototype,"updating",null),o([a()],b.prototype,"latestPointerType",null),o([a()],b.prototype,"latestPointerLocation",null),o([a()],b.prototype,"multiTouchActive",null),o([a()],b.prototype,"_inputManager",void 0),b=o([s("esri.views.3d.input.SceneInputManager")],b);const S=b;export{S as default};
5
+ import{__decorate as o}from"tslib";import r from"../../../core/Accessor.js";import"../../../core/has.js";import{destroyMaybe as t}from"../../../core/maybe.js";import{watch as e,initial as i,syncAndInitial as n}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{DoubleClickZoom as d}from"./handlers/DoubleClickZoom.js";import{DragRotate as m}from"./handlers/DragRotate.js";import{DragZoom as p}from"./handlers/DragZoom.js";import{GamepadNavigation as c}from"./handlers/GamepadNavigation.js";import{KeyboardNavigation as g}from"./handlers/KeyboardNavigation.js";import{MouseWheelZoom as u}from"./handlers/MouseWheelZoom.js";import{PinchAndPanNavigation as l}from"./handlers/PinchAndPanNavigation.js";import{PointerDownCancelAnimation as h}from"./handlers/PointerDownCancelAnimation.js";import{TwoFingerTilt as w}from"./handlers/TwoFingerTilt.js";import{BrowserEventSource as f}from"../../input/BrowserEventSource.js";import{InputManager as v,ViewEventPriorities as y}from"../../input/InputManager.js";import{PreventContextMenu as _}from"../../input/handlers/PreventContextMenu.js";import{getPointerActions as D}from"../../input/handlers/support.js";import{Drag as j}from"../../input/recognizers/Drag.js";import{ImmediateDoubleClick as A}from"../../input/recognizers/ImmediateDoubleClick.js";import{PointerClickHoldAndDrag as P}from"../../input/recognizers/PointerClickHoldAndDrag.js";import{SingleAndDoubleClick as M}from"../../input/recognizers/SingleAndDoubleClick.js";import{VerticalTwoFingerDrag as b}from"../../input/recognizers/VerticalTwoFingerDrag.js";let T=class extends r{constructor(){super(...arguments),this.mode="default",this._updateMode=({mode:o,dragPrimary:r,dragSecondary:t,dragTertiary:e})=>{"pro"===o&&(t="zoom",e="pan"===r?"rotate":"pan");const i={dragPrimary:r,dragSecondary:t,dragTertiary:e};this._modeDragPan&&(this._modeDragPan.pointerActions=D("pan",i)),this._modeDragRotate&&(this._modeDragRotate.pointerActions=D("rotate",i)),this._modeDragZoom&&(this._modeDragZoom.pointerActions=D("zoom",i))}}destroy(){this.disconnect()}get primaryDragAction(){return this.view.navigation.actionMap.dragPrimary}set primaryDragAction(o){const{actionMap:r}=this.view.navigation;r.dragPrimary=o,r.dragSecondary="pan"===o?"rotate":"pan"}get updating(){return!!this._inputManager?.updating}get latestPointerInfo(){return this._inputManager?.latestPointerInfo}get multiTouchActive(){return this._inputManager?.multiTouchActive??!1}disconnect(){this.removeAllHandles(),this.view.viewEvents.disconnect(),this._modeDragPan=null,this._modeDragRotate=null,this._modeDragZoom=null,this._modeKeyboardNavigation=null,this._inputManager=t(this._inputManager),this._source=t(this._source)}connect(){const o=this.view;this._source=new f(this.view.surface,o.input);const r=[new A,new P,new M,new j(this.view.navigation),new b],t=new v({eventSource:this._source,recognizers:r});this._inputManager=t,t.installHandlers("prevent-context-menu",[new _],y.INTERNAL);const a={fov:"Shift",pan:{left:"ArrowLeft",right:"ArrowRight",forward:"ArrowUp",backward:"ArrowDown",up:["u","U"],down:["j","J"]},lookAround:{headingLeft:["a","A"],headingRight:["d","D"],tiltUp:["w","W"],tiltDown:["s","S"],modifier:"b"},zoom:{zoomIn:["+","="],zoomOut:["-","_"]},reset:{heading:["n","N"],tilt:["p","P"]}};this._modeDragPan=new l(o,["primary"]),this._modeDragRotate=new m(o,["secondary"],0),this._modeDragZoom=new p(o,["tertiary"],a.fov),this._modeKeyboardNavigation=new g(o,a),t.installHandlers("navigation",[new h(o),new d(o),new c(o),new u(o,a.fov),new m(o,["primary"],1,[a.lookAround.modifier]),new m(o,["secondary"],0,[a.lookAround.modifier]),new l(o,["tertiary"],[a.lookAround.modifier]),this._modeDragRotate,this._modeDragZoom,this._modeDragPan,this._modeKeyboardNavigation,new w(o)],y.INTERNAL),this.view.viewEvents.connect(t),this.addHandles([e(()=>this.view.navigation?.browserTouchPanEnabled,o=>{this._source.browserTouchPanningEnabled=!o},i),e(()=>{const{actionMap:o}=this.view.navigation,{dragPrimary:r,dragSecondary:t,dragTertiary:e}=o;return{mode:this.mode,dragPrimary:r,dragSecondary:t,dragTertiary:e}},this._updateMode,n)])}isModifierKeyDown(o){return this._inputManager?.isModifierKeyDown(o)??!1}get test(){}};o([a()],T.prototype,"view",void 0),o([a({type:["default","pro"]})],T.prototype,"mode",void 0),o([a({readOnly:!0})],T.prototype,"updating",null),o([a()],T.prototype,"latestPointerInfo",null),o([a()],T.prototype,"multiTouchActive",null),o([a()],T.prototype,"_inputManager",void 0),T=o([s("esri.views.3d.input.SceneInputManager")],T);const S=T;export{S as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{i as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as V}from"../settings.js";import{ExtendedLineVisualElement as w}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as L}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as I}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as S,geometryTypeToDrawOperationGeometryType as D}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as G}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as x,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends S{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new V({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new I({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},n),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new G({view:this.view,manipulators:this.manipulators,geometryType:D(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new x(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new w({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o(()=>l.visualElements.zVerticalLine,e=>e.apply(h),a),o(()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)}),({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=j(U,r,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o(()=>l.visualElements.lineObjects.outline,e=>e.apply(c),a),o(()=>l.visualElements.lineObjects.shadowStyle,e=>e.apply(c),a),r(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o(()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)}),({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace)return t.loading=!1,null;t.loading=!0;const s=r(()=>{t.loading=!1});let o;const a=()=>o&&cancelAnimationFrame(o);return i([l(()=>e.displaying,()=>{a(),o=requestAnimationFrame(()=>s.remove())},{...n,once:!0}),r(a),s])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new L,U=h();export{b as DrawGraphicTool3D};
5
+ import{__decorate as e}from"tslib";import{unitRGBAFromColor as t}from"../../../../../core/colorUtils.js";import{handlesGroup as i,makeHandle as r}from"../../../../../core/handleUtils.js";import{destroyMaybe as s}from"../../../../../core/maybe.js";import{watch as o,syncAndInitial as n,initial as a,when as l}from"../../../../../core/reactiveUtils.js";import{property as c}from"../../../../../core/accessorSupport/decorators/property.js";import"../../../../../core/has.js";import"../../../../../core/Logger.js";import"../../../../../core/RandomLCG.js";import{subclass as m}from"../../../../../core/accessorSupport/decorators/subclass.js";import{i as p}from"../../../../../chunks/vec32.js";import{create as h}from"../../../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{getEffectiveElevationInfo as u,getEffectiveElevationMode as d}from"../../../../../support/elevationInfoUtils.js";import v from"../../../../../symbols/support/ElevationInfo.js";import{SegmentLabels3D as f}from"../../SegmentLabels3D.js";import{SnappingVisualizer3D as g}from"../../SnappingVisualizer3D.js";import{meshTransformFastUpdateHandles as y}from"../meshFastUpdateUtils.js";import{Settings as V}from"../settings.js";import{ExtendedLineVisualElement as w}from"../../visualElements/ExtendedLineVisualElement.js";import{OutlineVisualElement as E}from"../../visualElements/OutlineVisualElement.js";import{VerticesVisualElement as _}from"../../visualElements/VerticesVisualElement.js";import{evaluateElevationAlignmentAtPoint as j}from"../../../layers/graphics/elevationAlignmentUtils.js";import{ElevationContext as L}from"../../../layers/graphics/ElevationContext.js";import{GraphicState as I}from"../../../layers/graphics/GraphicState.js";import{DrawGraphicTool as S,geometryTypeToDrawOperationGeometryType as D}from"../../../../draw/DrawGraphicTool.js";import{DrawOperation as G}from"../../../../draw/DrawOperation.js";import{ElevationDrawSurface as x,SceneDrawSurface as C}from"../../../../draw/drawSurfaces.js";import{updateMeshTransformFromTooltipInfo as O}from"../../../../interactive/tooltip/tooltipCommonUtils.js";import{autorun as T}from"../../../../../core/accessorSupport/trackingUtils.js";let b=class extends S{constructor(e){super(e),this._activeVertexVisualElement=null,this._createGraphicState=null,this._outlineVisualElement=null,this._verticesVisualElement=null,this._verticalLineVisualElement=null,this._settings=new V({getTheme:()=>this.view.effectiveTheme}),this.geometryType=null,this.type="draw-3d"}initialize(){const{mode:e,offset:t,unit:i}=this.elevationInfo;this.internalGraphicsLayer.elevationInfo=new v({mode:e,offset:t,unit:i})}normalizeCtorArgs(e){if(!e.elevationInfo){const t=e.hasZ??!0;return{...e,elevationInfo:u(t)}}return e}initializeGraphic(e){const{view:t}=this,r=this._createGraphicState=new I({graphic:e});return i([t.maskOccludee(e),t.trackGraphicState(r),o(()=>({element:this._outlineVisualElement,isDraped:r.isDraped}),({element:e,isDraped:t})=>{e&&(e.isDraped=t)},n),T(()=>{O(this.tooltipInfos.mesh,this.geometryToPlace)}),this._setupLoadingIndicator(r),...y(r)])}makeDrawOperation(){const{geometryType:e}=this,t="circle"!==e&&"rectangle"!==e;return new G({view:this.view,manipulators:this.manipulators,geometryType:D(e),drawingMode:this.mode,hasZ:this.hasZ,defaultZ:this.defaultZ,snapToSceneEnabled:this.snapToScene,drawSurface:new C(this.view,this.elevationInfo,[this.internalGraphicsLayer]),elevationDrawSurface:new x(this.elevationInfo,this.defaultZ,this.view,this.internalGraphicsLayer),hasM:!1,elevationInfo:this.elevationInfo,snappingManager:this.snappingManager,snappingVisualizer:new g,segmentLabels:t?new f:null,labelOptions:this.sketchOptions.labels,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,this.elevationInfo),cursor:this.cursor,constraintsEnabled:!0,automaticLengthMeasurementUtils:this.automaticLengthMeasurementUtils})}onActiveVertexChanged(e){const{view:n}=this;if(this._activeVertexVisualElement)return this._activeVertexVisualElement.vertices=[e],this._activeVertexVisualElement.recreate(),this._updateVerticalLineVisualElement(e),r();const l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:[e],elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0});this._activeVertexVisualElement=m;const p=l.visualElements.zVerticalLine,h=new w({view:n,extensionType:p.extensionType,innerWidth:1,attached:!1,writeDepthEnabled:!1,renderOccluded:4,isDecoration:!0});this._verticalLineVisualElement=h;const u=i([o(()=>l.visualElements.zVerticalLine,e=>e.apply(h),a),o(()=>({selectedColor:t(l.colors.selected),outlineColor:t(l.manipulators.vertex.outlineColor)}),({selectedColor:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._activeVertexVisualElement=s(this._activeVertexVisualElement),this._verticalLineVisualElement=s(this._verticalLineVisualElement)})]);return m.attached=!0,this._updateVerticalLineVisualElement(e),u}_updateVerticalLineVisualElement(e){const t=this._verticalLineVisualElement;if(!t)return;const{renderCoordsHelper:i,elevationProvider:r}=this.view;p(U,e[0],e[1],e[2]),z.setFromElevationInfo(this.elevationInfo),U[2]=j(U,r,z,i);i.toRenderCoords(U,this.view.spatialReference,U)?(t.setStartEndFromWorldDownAtLocation(U),t.attached=!0):t.attached=!1}onOutlineChanged(e){if(this._outlineVisualElement)return this._outlineVisualElement.geometry=e,r();const t=this.internalGraphicsLayer.elevationInfo,{view:n}=this,l=this._settings,c=new E({view:n,geometry:e,elevationInfo:t,isDraped:this._createGraphicState?this._createGraphicState.isDraped:"on-the-ground"===d(this.hasZ,t),attached:!1,isDecoration:!0});this._outlineVisualElement=c;const m=i([o(()=>l.visualElements.lineObjects.outline,e=>e.apply(c),a),o(()=>l.visualElements.lineObjects.shadowStyle,e=>e.apply(c),a),r(()=>{this._outlineVisualElement=s(this._outlineVisualElement)})]);return c.attached=!0,c.laserlineEnabled=!0,m}onRegularVerticesChanged(e){if(this._verticesVisualElement)return this._verticesVisualElement.vertices=e,r();const{view:n}=this,l=this._settings,c=l.manipulators.vertex,m=new _({view:n,spatialReference:n.spatialReference,vertices:e,elevationInfo:this.internalGraphicsLayer.elevationInfo,size:c.size,outlineSize:c.outlineSize,renderOccluded:c.renderOccluded,attached:!1,isDecoration:!0}),p=i([o(()=>({color:t(l.manipulators.vertex.color),outlineColor:t(l.manipulators.vertex.outlineColor)}),({color:e,outlineColor:t})=>{m.color=e,m.outlineColor=t},a),r(()=>{this._verticesVisualElement=s(this._verticesVisualElement)})]);return m.attached=!0,this._verticesVisualElement=m,p}updateGraphicGeometry(e){if("mesh"===this.geometryType&&"point"===e?.type){const t=this.geometryToPlace;t?.centerAt(e),O(this.tooltipInfos.mesh,t);const i=this._graphic;return void(t&&i.geometry===t||(i.geometry=t))}super.updateGraphicGeometry(e)}_setupLoadingIndicator(e){const{drawOperation:t}=this;if(!this.geometryToPlace||e.displaying)return t.loading=!1,null;t.loading=!0;const s=r(()=>{t.loading=!1});let o;const a=()=>{o&&cancelAnimationFrame(o)};return i([l(()=>e.displaying,()=>{a(),o=requestAnimationFrame(()=>s.remove())},{...n,once:!0}),r(a),s])}};e([c({constructOnly:!0})],b.prototype,"elevationInfo",void 0),e([c({constructOnly:!0})],b.prototype,"geometryType",void 0),e([c()],b.prototype,"type",void 0),e([c({constructOnly:!0})],b.prototype,"view",void 0),b=e([m("esri.views.3d.interactive.editingTools.draw.DrawGraphicTool3D")],b);const z=new L,U=h();export{b as DrawGraphicTool3D};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import i from"../../../../../core/Handles.js";import{handlesGroup as a}from"../../../../../core/handleUtils.js";import has from"../../../../../core/has.js";import{when as t}from"../../../../../core/reactiveUtils.js";import{discRadiusSmall as n,discRadius as e}from"./config.js";import{InteractiveManipulation as s}from"./InteractiveManipulation.js";import{MoveXYAxisManipulation as o}from"./MoveXYAxisManipulation.js";import{MoveXYDiscManipulation as l}from"./MoveXYDiscManipulation.js";import{MoveZManipulation as r}from"./MoveZManipulation.js";class p extends s{constructor(a){super(),this._handles=new i;const{tool:t,view:n,snapToScene:e,radius:s}=a;this._view=n,this.xyManipulation=new l({tool:t,view:n,snapToScene:e,radius:s}),this.xyAxisManipulation=new o({tool:t,view:n,radius:s}),this.zManipulation=new r({tool:t,view:n,radius:s}),this.xyManipulation.available=a.xyAvailable,this.xyAxisManipulation.available=a.xyAxisAvailable,this.zManipulation.available=a.zAvailable,this._autoHideXYAxis(),this.forEachManipulator(i=>this._handles.add(i.events.on("grab-changed",()=>this._updateManipulatorInteractivity())))}destroy(){this._handles.destroy(),this.xyManipulation.destroy(),this.xyAxisManipulation.destroy(),this.zManipulation.destroy()}createManipulatedObjectDragPipeline(i,t,n){return a([this.xyManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n),this.xyAxisManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n),this.zManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),t,n)])}createDragPipeline(i,t,n,e){return a([this.xyManipulation.createDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n,e),this.xyAxisManipulation.createDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n,e),this.zManipulation.createDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),n)])}set snapToScene(i){this.xyManipulation.snapToScene=i}set angle(i){this.xyAxisManipulation.angle=i}set radius(i){this.xyAxisManipulation.radius=i,this.xyManipulation.radius=i,this.zManipulation.radius=i}set displayScale(i){this.xyManipulation.displayScale=i,this.xyAxisManipulation.displayScale=i}forEachManipulator(i){this.xyManipulation.forEachManipulator(a=>i(a,1)),this.xyAxisManipulation.forEachManipulator(a=>i(a,1)),this.zManipulation.forEachManipulator(a=>i(a,0))}get _xyAxisVisible(){const i=this.xyManipulation.someManipulator(i=>i.focused)||this.xyAxisManipulation.someManipulator(i=>i.focused);return this._view.inputManager&&"touch"===this._view.inputManager.latestPointerType||i}_autoHideXYAxis(){const i=this.xyAxisManipulation,a=this.xyManipulation;if(has("esri-mobile"))return;const n=[];a.forEachManipulator(i=>n.push(i)),i.forEachManipulator(i=>n.push(i));const e=()=>{const a=[];this._xyAxisVisible||i.forEachManipulator(i=>a.push(i.disableDisplay())),this._handles.remove(u),this._handles.add(a,u)};for(const t of n)this._handles.add(t.events.on("focus-changed",e));this._view.inputManager&&this._handles.add(t(()=>this._view.inputManager?.latestPointerType,e)),e()}static radiusForSymbol(i){const a=null!=i&&"point-3d"===i.type&&i.symbolLayers;return!!a&&a.some(i=>"icon"===i.type)?n:e}}const u="disable-xy-axis-display";export{p as MoveManipulation};
5
+ import i from"../../../../../core/Handles.js";import{handlesGroup as a}from"../../../../../core/handleUtils.js";import has from"../../../../../core/has.js";import{when as t}from"../../../../../core/reactiveUtils.js";import{discRadiusSmall as n,discRadius as e}from"./config.js";import{InteractiveManipulation as s}from"./InteractiveManipulation.js";import{MoveXYAxisManipulation as o}from"./MoveXYAxisManipulation.js";import{MoveXYDiscManipulation as l}from"./MoveXYDiscManipulation.js";import{MoveZManipulation as r}from"./MoveZManipulation.js";class p extends s{constructor(a){super(),this._handles=new i;const{tool:t,view:n,snapToScene:e,radius:s}=a;this._view=n,this.xyManipulation=new l({tool:t,view:n,snapToScene:e,radius:s}),this.xyAxisManipulation=new o({tool:t,view:n,radius:s}),this.zManipulation=new r({tool:t,view:n,radius:s}),this.xyManipulation.available=a.xyAvailable,this.xyAxisManipulation.available=a.xyAxisAvailable,this.zManipulation.available=a.zAvailable,this._autoHideXYAxis(),this.forEachManipulator(i=>this._handles.add(i.events.on("grab-changed",()=>this._updateManipulatorInteractivity())))}destroy(){this._handles.destroy(),this.xyManipulation.destroy(),this.xyAxisManipulation.destroy(),this.zManipulation.destroy()}createManipulatedObjectDragPipeline(i,t,n){return a([this.xyManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n),this.xyAxisManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n),this.zManipulation.createManipulatedObjectDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),t,n)])}createDragPipeline(i,t,n,e){return a([this.xyManipulation.createDragPipeline((a,t,n,e,s)=>i(0,a,t,n,e,s),t,n,e),this.xyAxisManipulation.createDragPipeline((a,t,n,e,s)=>i(1,a,t,n,e,s),t,n,e),this.zManipulation.createDragPipeline((a,t,n,e,s)=>i(2,a,t,n,e,s),n)])}set snapToScene(i){this.xyManipulation.snapToScene=i}set angle(i){this.xyAxisManipulation.angle=i}set radius(i){this.xyAxisManipulation.radius=i,this.xyManipulation.radius=i,this.zManipulation.radius=i}set displayScale(i){this.xyManipulation.displayScale=i,this.xyAxisManipulation.displayScale=i}forEachManipulator(i){this.xyManipulation.forEachManipulator(a=>i(a,1)),this.xyAxisManipulation.forEachManipulator(a=>i(a,1)),this.zManipulation.forEachManipulator(a=>i(a,0))}get _xyAxisVisible(){const i=this.xyManipulation.someManipulator(i=>i.focused)||this.xyAxisManipulation.someManipulator(i=>i.focused);return this._view.inputManager&&"touch"===this._view.inputManager.latestPointerInfo?.type||i}_autoHideXYAxis(){const i=this.xyAxisManipulation,a=this.xyManipulation;if(has("esri-mobile"))return;const n=[];a.forEachManipulator(i=>n.push(i)),i.forEachManipulator(i=>n.push(i));const e=()=>{const a=[];this._xyAxisVisible||i.forEachManipulator(i=>a.push(i.disableDisplay())),this._handles.remove(u),this._handles.add(a,u)};for(const t of n)this._handles.add(t.events.on("focus-changed",e));this._view.inputManager&&this._handles.add(t(()=>this._view.inputManager?.latestPointerInfo?.type,e)),e()}static radiusForSymbol(i){const a=null!=i&&"point-3d"===i.type&&i.symbolLayers;return!!a&&a.some(i=>"icon"===i.type)?n:e}}const u="disable-xy-axis-display";export{p as MoveManipulation};