@arcgis/core 5.1.0-next.77 → 5.1.0-next.79
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +74 -0
- package/analysis/ElevationProfile/ElevationProfileGroup.js +2 -0
- package/analysis/ElevationProfileAnalysis.d.ts +29 -14
- package/analysis/ElevationProfileAnalysis.js +1 -1
- package/analysis/ShadowCast/DiscreteOptions.d.ts +33 -6
- package/analysis/ShadowCast/DiscreteOptions.js +1 -1
- package/analysis/ShadowCast/MinDurationOptions.d.ts +6 -4
- package/analysis/ShadowCast/TotalDurationOptions.d.ts +33 -6
- package/analysis/ShadowCast/TotalDurationOptions.js +1 -1
- package/analysis/ShadowCast/colorStopsUtils.js +2 -0
- package/analysis/ShadowCastAnalysis.d.ts +24 -1
- package/analysis/ShadowCastAnalysis.js +1 -1
- package/analysis/Viewshed.d.ts +27 -0
- package/analysis/Viewshed.js +1 -1
- package/analysis/ViewshedAnalysis.js +1 -1
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.d.ts +34 -0
- package/applications/Components/OrientedImageryViewer/ImageViewer/utils.js +2 -0
- package/arcade/FunctionWrapper.js +1 -1
- package/arcade/arcadeAsyncRuntime.js +1 -1
- package/arcade/arcadeCompiler.js +1 -1
- package/arcade/arcadeRuntime.js +1 -1
- package/arcade/compilerUtils.js +1 -1
- package/arcade/debug.d.ts +139 -0
- package/arcade/debug.js +2 -0
- package/arcade/featureSetCollection.js +1 -1
- package/arcade/featureSetUtils.js +1 -1
- package/arcade/featureset/actions/GroupBy.js +1 -1
- package/arcade/featureset/actions/OrderBy.js +1 -1
- package/arcade/functions/featuresetstring.js +1 -1
- package/arcade/languageUtils.js +1 -1
- package/arcade.d.ts +46 -2
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{1c7183551f5269bdcf13.js → 01bd1b86ba899c6aa4c0.js} +1 -1
- package/assets/esri/core/workers/chunks/{1f8ccf96069ac3a40c3d.js → 01ee18782a50279f907e.js} +1 -1
- package/assets/esri/core/workers/chunks/{34ea3ed78041437a8fc8.js → 022067e807905cabeaa1.js} +1 -1
- package/assets/esri/core/workers/chunks/{537fe2522dff1e6ce03b.js → 052cdc7aaa803b5873f0.js} +1 -1
- package/assets/esri/core/workers/chunks/{8d75f6f27c1c17c33992.js → 056fd7847caaff2c9514.js} +1 -1
- package/assets/esri/core/workers/chunks/{8acee3fba488f202f82f.js → 05c3146d87d917606193.js} +1 -1
- package/assets/esri/core/workers/chunks/{75d5ea0da181f9e7425f.js → 0aebcbf41cb193e76809.js} +11 -11
- package/assets/esri/core/workers/chunks/{54023458195549f66215.js → 0b77c124b743067e4155.js} +1 -1
- package/assets/esri/core/workers/chunks/10408183681fd6c7b4ed.js +2 -0
- package/assets/esri/core/workers/chunks/17acbf40e7c1cb42d9bd.js +1 -0
- package/assets/esri/core/workers/chunks/{baeb96aef03d4c566af7.js → 1f53620f82cc7c3daabe.js} +1 -1
- package/assets/esri/core/workers/chunks/2387613b855771a3e537.js +1 -0
- package/assets/esri/core/workers/chunks/283d39dfb1625b5a74db.js +1 -0
- package/assets/esri/core/workers/chunks/{7595ceba529ed01c7590.js → 2c87c3112a43db8624f6.js} +1 -1
- package/assets/esri/core/workers/chunks/{13e60f19f436b8d683ae.js → 3c9482764c9e4f8bcbb0.js} +1 -1
- package/assets/esri/core/workers/chunks/{5e1b847b116d21908a54.js → 3e37019eee1c49d2bf64.js} +1 -1
- package/assets/esri/core/workers/chunks/45c83eb7c2a06166e3b0.js +1 -0
- package/assets/esri/core/workers/chunks/48acd146bf0241d87647.js +1 -0
- package/assets/esri/core/workers/chunks/5818f1f526577068d6ca.js +2 -0
- package/assets/esri/core/workers/chunks/5b6f2bfdcdd207d8ae42.js +1 -0
- package/assets/esri/core/workers/chunks/{330b47ac0759c3c35cc5.js → 5ccc325d83cec4f5ccdb.js} +1 -1
- package/assets/esri/core/workers/chunks/{30e710ec4d22c43d4e7e.js → 5cffc7b49966201eccdb.js} +1 -1
- package/assets/esri/core/workers/chunks/{1a87e9bbd85ba29b1514.js → 5da2051f548c2942e01a.js} +1 -1
- package/assets/esri/core/workers/chunks/5ec66e39e53c11e75179.js +2 -0
- package/assets/esri/core/workers/chunks/{0b1454a77a6a682541dc.js.LICENSE.txt → 5ec66e39e53c11e75179.js.LICENSE.txt} +9 -1
- package/assets/esri/core/workers/chunks/5f6fd20a7f4e80eafa25.js +1 -0
- package/assets/esri/core/workers/chunks/{abc06d10c7ac8ba5b0e4.js → 67ec1694d6e18b7c234c.js} +1 -1
- package/assets/esri/core/workers/chunks/{32e22d6eee9fed1f70b0.js → 6d696beddcc5fbed5875.js} +1 -1
- package/assets/esri/core/workers/chunks/{f590b60fca607d66001a.js → 716a4d7e8b908b81870b.js} +1 -1
- package/assets/esri/core/workers/chunks/71fe127734f33d020a44.js +1 -0
- package/assets/esri/core/workers/chunks/7cdd0492b2191df95102.js +2 -0
- package/assets/esri/core/workers/chunks/7cea68257d24ffd205bb.js +1 -0
- package/assets/esri/core/workers/chunks/7e530e635325dba07864.js +1 -0
- package/assets/esri/core/workers/chunks/{6b66fc32451433129a88.js → 8508f238d99021e87f71.js} +1 -1
- package/assets/esri/core/workers/chunks/{bc75ab48f4c7609ef09d.js → 85d3475667c503ec4fc6.js} +1 -1
- package/assets/esri/core/workers/chunks/8f6f5dad52747d252aac.js +596 -0
- package/assets/esri/core/workers/chunks/{d950d5c2844206502ff0.js → 992cd87ba0ab6346f692.js} +1 -1
- package/assets/esri/core/workers/chunks/{73c87eb9bd8f0f848481.js → 9c11e1fe785e1385fdb1.js} +1 -1
- package/assets/esri/core/workers/chunks/{5ed8d8b5336c81fbcda3.js → 9d216e30d04ea21fc8a2.js} +1 -1
- package/assets/esri/core/workers/chunks/a54aa93b6012a2597f82.js +1 -0
- package/assets/esri/core/workers/chunks/{cf14b3a44705dacefac4.js → a9b5ce00323cd5574bf7.js} +1 -1
- package/assets/esri/core/workers/chunks/ae6b3dfe5f757df539d6.js +1 -0
- package/assets/esri/core/workers/chunks/b14c4c3f295970f731ab.js +1 -0
- package/assets/esri/core/workers/chunks/{c70df6ed190f9ebcf6aa.js → bf2c202dec5ab7bc770b.js} +1 -1
- package/assets/esri/core/workers/chunks/c1d4110aa494a1dba3c4.js +1 -0
- package/assets/esri/core/workers/chunks/{9d6491f996eeb0c646ed.js → c442916805975744dd92.js} +1 -1
- package/assets/esri/core/workers/chunks/dacc2e5fa462495ed1cc.js +2 -0
- package/assets/esri/core/workers/chunks/f227b34cce6843df0fb6.js +1 -0
- package/assets/esri/core/workers/chunks/{dda2cb5c073d1e65f14f.js → f43d628d47eec7d530c7.js} +1 -1
- package/assets/esri/core/workers/chunks/f7531aa69a87814c60d1.js +1 -0
- package/assets/esri/core/workers/chunks/{bf8f603848bad4a7deb4.js → fb100935fd8948d779f5.js} +1 -1
- package/assets/esri/core/workers/chunks/{88b480a1d1fb01778798.js → fb9e3e7cd532ac4353f1.js} +25 -30
- package/assets/esri/core/workers/chunks/fc6ca7ffb9f1b875059c.js +1 -0
- package/assets/esri/core/workers/chunks/{14eb2cc8e2ad6d8d03fd.js → ffc4f3406ce383b9bd88.js} +1 -1
- package/assets/esri/themes/base/_core.scss +2 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +6 -0
- package/assets/esri/themes/base/widgets/_PluginSettingsControls.scss +29 -0
- package/assets/esri/themes/dark/main.css +1 -1
- package/assets/esri/themes/light/main.css +1 -1
- package/assets/esri/themes/light/view.css +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ar.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bg.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_bs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ca.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_cs.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_da.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_de.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_el.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_en.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_es.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_et.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_fr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_he.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_hu.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_id.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_it.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ja.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ko.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lt.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_lv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_nl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_no.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-BR.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_pt-PT.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ro.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_ru.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sl.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_sv.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_th.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_tr.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_uk.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_vi.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-CN.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-HK.json +1 -1
- package/assets/esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer_zh-TW.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ar.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bg.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_bs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ca.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_cs.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_da.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_de.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_el.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_en.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_es.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_et.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_fr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_he.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_hu.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_id.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_it.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ja.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ko.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lt.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_lv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_nl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_no.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-BR.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_pt-PT.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ro.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_ru.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sl.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_sv.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_th.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_tr.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_uk.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_vi.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-CN.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-HK.json +1 -1
- package/assets/esri/widgets/Sketch/t9n/Sketch_zh-TW.json +1 -1
- package/chunks/ImageMaterial.glsl.js +7 -5
- package/chunks/SlicePlaneMaterial.glsl.js +21 -13
- package/chunks/arcade.js +1 -1
- package/chunks/languageUtils.js +1 -1
- package/config.js +1 -1
- package/core/MapUtils.js +1 -1
- package/core/arrayUtils.js +1 -1
- package/core/types.d.ts +28 -0
- package/form/elements/inputs/MultipleChoiceInput.d.ts +2 -2
- package/form/elements/inputs/MultipleChoiceInput.js +1 -1
- package/geometry/operators/types.d.ts +2 -2
- package/interfaces.d.ts +4 -7
- package/kernel.js +1 -1
- package/layers/ImageryLayer.d.ts +7 -1
- package/layers/ImageryLayer.js +1 -1
- package/layers/ImageryTileLayer.d.ts +7 -1
- package/layers/ImageryTileLayer.js +1 -1
- package/layers/IntegratedMeshLayer.d.ts +18 -14
- package/layers/SceneLayer.d.ts +35 -1
- package/layers/SceneLayer.js +1 -1
- package/layers/WCSLayer.d.ts +7 -1
- package/layers/WCSLayer.js +1 -1
- package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
- package/layers/save/imageryUtils.js +1 -1
- package/layers/scene/ModelFileInfo.d.ts +29 -0
- package/layers/scene/ModelFileInfo.js +2 -0
- package/layers/scene/ModelInfo.d.ts +38 -0
- package/layers/scene/ModelInfo.js +2 -0
- package/layers/scene/modelQuerySupport.js +2 -0
- package/layers/scene/types.d.ts +14 -0
- package/layers/support/infoFor3D.js +1 -1
- package/layers/support/serviceCapabilitiesUtils.js +1 -1
- package/layers/types.d.ts +13 -1
- package/layers/video/VideoController.js +1 -1
- package/networks/UnitIdentifierManager.d.ts +15 -15
- package/networks/UnitIdentifierManager.js +1 -1
- package/networks/support/jsonTypes.d.ts +125 -13
- package/package.json +4 -4
- package/popup/Features.d.ts +1 -7
- package/popup/Features.js +1 -1
- package/popup/actions.js +1 -1
- package/renderers/visualVariables/support/ColorStop.js +1 -1
- package/rest/networks/unitIdentifiers/reserve.js +2 -0
- package/rest/networks/unitIdentifiers/support/ReserveParameters.js +2 -0
- package/rest/networks/unitIdentifiers/support/ResizeParameters.js +1 -1
- package/rest/networks/unitIdentifiers/support/UnitQueryResult.js +1 -1
- package/support/arcadeUtils.js +1 -1
- package/support/revision.js +1 -1
- package/views/2d/analysis/ElevationProfile/ElevationProfileVisualization2D.js +1 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.d.ts +5 -1
- package/views/2d/analysis/ElevationProfileAnalysisView2D.js +1 -1
- package/views/2d/engine/flow/styles/Imagery.js +1 -1
- package/views/2d/engine/flow/styles/Particles.js +1 -1
- package/views/2d/engine/flow/styles/Streamlines.js +1 -1
- package/views/2d/engine/vectorTiles/Placement.js +1 -1
- package/views/2d/engine/vectorTiles/TextShaping.js +1 -1
- package/views/2d/engine/webgl/AFeatureTile.js +1 -1
- package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
- package/views/2d/engine/webgl/GlyphMosaic.js +1 -1
- package/views/2d/engine/webgl/GlyphSource.js +1 -1
- package/views/2d/engine/webgl/Overlay.js +1 -1
- package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
- package/views/2d/engine/webgl/RenderingDevice.js +1 -1
- package/views/2d/engine/webgl/TextureManager.js +1 -1
- package/views/2d/engine/webgl/effects/HittestEffect.js +1 -1
- package/views/2d/engine/webgl/mesh/templates/shapingUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GLSLShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphContext.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueProgramCache.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TestTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/TextureStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AAnimatedShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimationUniformInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bitmap/BitmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blend/BlendTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/bloom/BloomTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/blur/BlurTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/clip/ClipTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/colorize/ColorizeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPointShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityPolygonShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/dotDensity/DotDensityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/drop-shadow/DropShadowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/FillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/GradientFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/OutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/flow/FlowTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/grid/GridTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/heatmap/HeatmapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/labels/LabelTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/LineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/line/TexturedLineTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/magnifier/MagnifierTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/markers/MarkerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/opacity/OpacityTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/overlay/OverlayTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/pieChart/PieChartTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterColorizerTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/RasterHighlightTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BaseRasterProcessorTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SpectralConversionTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/AFeatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BitmapShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlendShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlitShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BloomShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/BlurShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ColorizeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ComplexOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/DropShadowShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/EntityStorage.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/GradientStrokeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapAccumulateShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/HeatmapResolveShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/LineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/MosaicInfo.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/OverlayShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/PatternOutlineFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/ShaderHittest.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsDiffShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsMinMaxSumShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsStdDevShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TextureStatisticsSumOfSquaredDiffShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TexturedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/TileDebugInfoShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowImageryShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/flow/FlowUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterColorizerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/BaseRasterHighlightShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerLUTShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterColorizerStretchShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/RasterXYBandHighlightShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/lut.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/AspectShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/BaseRasterProcessorShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ColormapToRGBShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ConvolutionShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/CurvatureShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/FocalStatisticsShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/HillshadeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/MultiRasterMixin.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/ShadedReliefShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/processor/SlopeShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/projection.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/stretch.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderIcon.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vector-tiles/VTLShaderText.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/vvUtils.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/text/TextTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileDebugInfoTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/tile/TileStencilTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueBackground.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueCircle.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueFill.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueLine.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/vectorTiles/VTLTechniqueSymbol.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/typed/TypedShaderProgram.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/BaseLayerView2D.d.ts +3 -3
- package/views/2d/layers/BaseLayerViewGL2D.d.ts +3 -3
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/TileLayerView2D.js +1 -1
- package/views/2d/layers/VectorTileLayerView2D.js +1 -1
- package/views/2d/layers/features/FeatureContainer.js +1 -1
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/FocusAreasView.js +1 -1
- package/views/3d/StencilGeometry.js +2 -0
- package/views/3d/analysis/ElevationProfile/ElevationProfileVisualization3D.js +1 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.d.ts +5 -1
- package/views/3d/analysis/ElevationProfileAnalysisView3D.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedComputedData.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedConfiguration.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedFieldOfViewManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedScaleOrientManipulation.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedShapeVisualElement.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubVisualization.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedTool.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolUtils.js +1 -1
- package/views/3d/analysis/ViewshedAnalysisView3D.js +1 -1
- package/views/3d/focusAreaUtils.js +2 -0
- package/views/3d/layers/BuildingComponentSublayerView3D.js +1 -1
- package/views/3d/layers/I3SMeshView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMeshNormals.js +1 -1
- package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
- package/views/3d/layers/SceneLayerView3D.js +1 -1
- package/views/3d/layers/SceneLayerWorker.js +1 -1
- package/views/3d/layers/i3s/I3SQueryEngine.js +1 -1
- package/views/3d/layers/i3s/I3SUtil.js +1 -1
- package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
- package/views/3d/layers/support/TemporalSceneLayerView.js +1 -1
- package/views/3d/terrain/ElevationData.js +1 -1
- package/views/3d/terrain/PatchGeometryFactory.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Material/ComponentTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/collections/Component/Renderable.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/shading/ReadBaseColorTexture.glsl.js +1 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/DiscardOrAdjustAlpha.glsl.js +1 -5
- package/views/3d/webgl-engine/core/shaderLibrary/util/MixExternalColor.glsl.js +16 -21
- package/views/3d/webgl-engine/core/shaderTechnique/ShaderTechniqueRepository.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/ChapmanAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/LocalAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/atmosphere/MarsAtmosphere.js +1 -1
- package/views/3d/webgl-engine/effects/blit/Blit.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsComposition.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/CloudsTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/clouds/NoiseTextureAtlas.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaColorNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
- package/views/3d/webgl-engine/effects/focusArea/focusAreaMaskUtils.js +2 -0
- package/views/3d/webgl-engine/effects/fog/Fog.js +1 -1
- package/views/3d/webgl-engine/effects/globalIllumination/GlobalIllumination.js +1 -1
- package/views/3d/webgl-engine/effects/glow/GlowRenderNode.js +1 -1
- package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
- package/views/3d/webgl-engine/effects/highlight/ShadowHighlightBuffer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserLineRenderer.js +1 -1
- package/views/3d/webgl-engine/effects/laserlines/LaserlinePathTechnique.js +1 -1
- package/views/3d/webgl-engine/effects/magnifier/Magnifier.js +1 -1
- package/views/3d/webgl-engine/effects/precipitation/Precipitation.js +1 -1
- package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
- package/views/3d/webgl-engine/effects/ssao/SSAO.js +1 -1
- package/views/3d/webgl-engine/effects/stars/Stars.js +1 -1
- package/views/3d/webgl-engine/effects/stars/StarsTechnique.js +1 -1
- package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
- package/views/3d/webgl-engine/lib/Compositor.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillComputationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/CutFillVisualizationRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
- package/views/3d/webgl-engine/lib/Material.js +1 -1
- package/views/3d/webgl-engine/lib/Normals.js +1 -1
- package/views/3d/webgl-engine/lib/OrderIndependentTransparency.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
- package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
- package/views/3d/webgl-engine/materials/DefaultTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/shaders/BlackLevelLightSoftCompression.glsl.js +5 -1
- package/views/3d/webgl-engine/shaders/CheckerBoardTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/CompositingTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/DefaultMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ImageMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/LineMarkerTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/MeasurementArrowTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/OutputColorHighlightOLID.glsl.js +10 -10
- package/views/3d/webgl-engine/shaders/RibbonLineTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadedColorMaterialTechnique.js +1 -1
- package/views/3d/webgl-engine/shaders/SlicePlaneMaterialTechnique.js +1 -1
- package/views/VideoView.js +1 -1
- package/views/View2D.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileChart.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileController.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileIndicatorPointVisualization.js +1 -1
- package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +6 -4
- package/views/draw/DrawTool.js +1 -1
- package/views/draw/plugins/BezierSegmentPlugin.js +1 -1
- package/views/draw/plugins/FreehandSegmentPlugin.js +1 -1
- package/views/draw/support/GraphicMover.js +1 -1
- package/views/draw/support/PluginContext.js +1 -1
- package/views/draw/support/Reshape.js +1 -1
- package/views/draw/support/editingSessionUtils.js +1 -1
- package/views/draw/support/types.d.ts +21 -0
- package/views/draw/support/types.js +1 -1
- package/views/types.d.ts +2 -2
- package/views/webgl/FramebufferObject.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +2 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +54 -0
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +2 -0
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
- package/widgets/BatchAttributeForm/inputs/types.d.ts +4 -3
- package/widgets/BatchAttributeForm/templates/AttachmentElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/RelationshipElementTemplate.js +2 -0
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/hashElementTemplate.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/templateUtils.js +1 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +21 -1
- package/widgets/CoordinateConversion/CoordinateConversionViewModel.js +1 -1
- package/widgets/CoordinateConversion/support/Format.js +1 -1
- package/widgets/CoordinateConversion/support/coordinateConversionUtils.js +1 -1
- package/widgets/CoordinateConversion.d.ts +21 -1
- package/widgets/CoordinateConversion.js +1 -1
- package/widgets/Daylight/DaylightViewModel.js +1 -1
- package/widgets/Daylight/support/SliderWithDropdown.js +1 -1
- package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/SplitFeatureWorkflow.js +1 -1
- package/widgets/Editor/UpdateFeatureWorkflow.js +1 -1
- package/widgets/Editor/components/Settings.js +1 -1
- package/widgets/Editor/support/SketchController.js +1 -1
- package/widgets/Editor/workflowUtils.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileController.js +1 -1
- package/widgets/ElevationProfile/ElevationProfileViewModel.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView2D.js +1 -1
- package/widgets/ElevationProfile/support/ElevationProfileView3D.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation2D.js +1 -1
- package/widgets/ElevationProfile/support/InputRepresentation3D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLine2D.js +1 -1
- package/widgets/ElevationProfile/support/ProfileLines3D.js +1 -1
- package/widgets/FeatureForm/FieldInput.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/HistogramRangeSlider/HistogramRangeSliderViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.d.ts +5 -5
- package/widgets/OrientedImageryViewer/OrientedImageryViewerVisibleElements.js +1 -1
- package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
- package/widgets/OrientedImageryViewer/constants.js +1 -1
- package/widgets/OrientedImageryViewer/imageMeasurementUtils.js +1 -1
- package/widgets/OrientedImageryViewer/services/SuperimposeService.js +2 -0
- package/widgets/OrientedImageryViewer/support/superimposeUtils.js +2 -0
- package/widgets/OrientedImageryViewer/types.d.ts +10 -0
- package/widgets/OrientedImageryViewer.d.ts +17 -2
- package/widgets/OrientedImageryViewer.js +1 -1
- package/widgets/ScaleRangeSlider/ScaleRangeSliderViewModel.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/Sketch/support/PluginManager.js +1 -1
- package/widgets/Sketch/support/SettingsManager.js +2 -0
- package/widgets/Sketch.js +1 -1
- package/widgets/Slider/SliderViewModel.d.ts +2 -1
- package/widgets/Slider/SliderViewModel.js +1 -1
- package/widgets/Slider.js +1 -1
- package/widgets/smartMapping/ColorSlider/ColorSliderViewModel.js +1 -1
- package/widgets/smartMapping/OpacitySlider/OpacitySliderViewModel.js +1 -1
- package/widgets/smartMapping/SizeSlider/SizeSliderViewModel.js +1 -1
- package/widgets/smartMapping/SmartMappingSliderViewModel.js +1 -1
- package/widgets/support/ContingentValuesManager.js +1 -1
- package/widgets/support/PluginSettingsControls.js +2 -0
- package/widgets/support/SnappingControls.js +1 -1
- package/widgets/support/forms/formUtils.js +1 -1
- package/widgets/types.d.ts +1 -1
- package/analysis/ElevationProfile/elevationProfileLineTypes.js +0 -2
- package/assets/esri/core/workers/chunks/003476e950bd27a2f884.js +0 -596
- package/assets/esri/core/workers/chunks/07aca5ecad659d55e795.js +0 -2
- package/assets/esri/core/workers/chunks/07eff82916681fcff069.js +0 -1
- package/assets/esri/core/workers/chunks/0b1454a77a6a682541dc.js +0 -2
- package/assets/esri/core/workers/chunks/3697e51e1e4cf442f39a.js +0 -1
- package/assets/esri/core/workers/chunks/3cce9dad8ee0e4971d50.js +0 -1
- package/assets/esri/core/workers/chunks/68a313155ddc29bd024d.js +0 -1
- package/assets/esri/core/workers/chunks/751609831b283903ba48.js +0 -1
- package/assets/esri/core/workers/chunks/7540f7df86620f067b5a.js +0 -1
- package/assets/esri/core/workers/chunks/76e34f81bb4a7b0e694c.js +0 -1
- package/assets/esri/core/workers/chunks/7bacdd65a6cc4d284e0a.js +0 -2
- package/assets/esri/core/workers/chunks/7e97684e851274efd11f.js +0 -1
- package/assets/esri/core/workers/chunks/85aac8539996372f1ee8.js +0 -1
- package/assets/esri/core/workers/chunks/99c161fecae710b53b40.js +0 -1
- package/assets/esri/core/workers/chunks/99d298d0039c536fcf3e.js +0 -1
- package/assets/esri/core/workers/chunks/9aaf78b831f8739bc127.js +0 -1
- package/assets/esri/core/workers/chunks/bfe575da727ce7c8d331.js +0 -2
- package/assets/esri/core/workers/chunks/cb45e5d4a4ef82cda583.js +0 -1
- package/assets/esri/core/workers/chunks/e262c4864dc06c43b380.js +0 -1
- package/assets/esri/core/workers/chunks/ea59b81299acaf0d85ee.js +0 -1
- package/assets/esri/core/workers/chunks/ef0eae13408cbf83a64f.js +0 -1
- package/assets/esri/core/workers/chunks/f09a41ad239d467d9438.js +0 -2
- package/assets/esri/core/workers/chunks/f6912532aae1638cbe8f.js +0 -1
- package/rest/networks/unitIdentifiers/insertGap.js +0 -2
- package/rest/networks/unitIdentifiers/support/InsertGapParameters.js +0 -2
- /package/assets/esri/core/workers/chunks/{7bacdd65a6cc4d284e0a.js.LICENSE.txt → 10408183681fd6c7b4ed.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{f09a41ad239d467d9438.js.LICENSE.txt → 5818f1f526577068d6ca.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{bfe575da727ce7c8d331.js.LICENSE.txt → 7cdd0492b2191df95102.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{07aca5ecad659d55e795.js.LICENSE.txt → dacc2e5fa462495ed1cc.js.LICENSE.txt} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{min as o}from"../../../core/arrayUtils.js";import{createTask as i}from"../../../core/asyncUtils.js";import{dedupeResult as
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{min as o}from"../../../core/arrayUtils.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/CollectionFlattener.js";import{dedupeResult as r}from"../../../core/dedupeResult.js";import{destroyHandle as a,makeHandle as n}from"../../../core/handleUtils.js";import{equalsShallow as l}from"../../../core/lang.js";import{LRUCache as p}from"../../../core/LRUCache.js";import{mapCollection as u}from"../../../core/mapCollectionUtils.js";import{destroyMaybe as c,abortMaybe as m,equalsMaybe as h}from"../../../core/maybe.js";import{throwIfAborted as _,throwIfAbortError as d}from"../../../core/promiseUtils.js";import{watch as f,syncAndInitial as y,on as v}from"../../../core/reactiveUtils.js";import{throttle as g}from"../../../core/throttle.js";import{adaptiveVerticalLengthUnit as C,adaptiveLengthUnit as P}from"../../../core/units.js";import{property as T,subclass as j}from"../../../core/accessorSupport/decorators.js";import{ElevationQueryTileCache as U}from"../../../layers/support/ElevationQueryTileCache.js";import{absoluteHeightElevationInfo as b}from"../../../support/elevationInfoUtils.js";import{getDefaultUnitForView as w}from"../../../support/getDefaultUnitForView.js";import R from"../../../symbols/support/ElevationInfo.js";import{getConfig as I}from"./constants.js";import S from"./ElevationProfileError.js";import{InvalidGeometryError as E,UnknownError as D}from"./elevationProfileErrors.js";import{createProfileQueue as q,sanitizeProgress as x,generateProfiles as F}from"./elevationProfileGenerationUtils.js";import{mergeStatistics as O,getBoundsInMeters as k}from"./elevationProfileStatisticsUtils.js";let V=class extends e{constructor(t){super(t),this.error=null,this._getStableEffectiveUnits=r(()=>{const t=k(this._activeComputations.map(t=>t.result.rawResult)),e=this.analysis.displayUnits,o=w(this.view);return{distance:P(t.maxDistance,"meters",e.distance??o),elevation:C(t.maxElevation,"meters",e.elevation??o)}},l),this._updateTask=null,this._queue=null,this._currentTileCache=null,this._parametersPerComputation=new Map,this._getStableUpdateParameters=r(()=>({stationary:this.view.stationary??!0,activeComputations:this._activeComputations,generationParameters:this._generationParameters}),l),this._getStableGenerationParameters=r(()=>{const{view:t,analysis:e}=this;return t?.ready&&this._queue?{view:t,geometry:e.geometry,geometryIsValid:e.valid,elevationInfo:this.elevationInfo,queue:this._queue,cache:this._tileCache,options:this._options,slicePlane:"3d"===t.type?t.slice.plane:null}:null},l),this._getStableElevationInfo=r(()=>this.analysis.elevationInfo??M,h),this._getStableOptions=r(()=>{const{densificationMaxSamples:t,defaultDemResolution:e,maxTotalSamples:o}=I();let i=this._minDemResolution??e;return i=parseFloat(i.toFixed(2)),{samplingDistance:i,densificationMaxSamples:Math.round(t/this._activeComputations.length),maxTotalSamples:o}},l),this._updateThrottled=g(t=>this._update(t),I().updateThrottleMillis)}initialize(){this._flatProfilesCollection=new s({getCollections:()=>[this.analysis.profiles],getChildrenFunction:t=>"group"===t.type?t.profiles:null,itemFilterFunction:t=>"group"!==t.type}),this._computationsCollection=u(()=>this._flatProfilesCollection,t=>this.computationFactory.create({controller:this,profile:t,onInvalidate:t=>this._invalidateComputation(t)}),{recycleItems:!0}),this.addHandles([a(this._flatProfilesCollection),this._computationsCollection.on("change",()=>{this._parametersPerComputation.clear(),this._updateThrottled(this._updateParameters)}),f(()=>this._updateParameters,t=>this._updateThrottled(t),y),this._updateThrottled]);const t="3d"===this.view.type?this.view.resourceController:void 0;this._queue=q(t?.scheduler),t?.addUpdatingObject(this)}destroy(){this._abortUpdate(),this._parametersPerComputation.clear(),this._computationsCollection?.destroy(),this._queue=c(this._queue),this._currentTileCache=c(this._currentTileCache)}get effectiveDisplayUnits(){return this._getStableEffectiveUnits()}get progress(){let t=0,e=0;for(const o of this._activeComputations)t++,e+=o.progress;return x(t>0?e/t:0)}get updating(){const{progress:t}=this,e=!!this._queue?.updating,o=this._updateThrottled.hasPendingUpdates(),i=null!=this._updateTask&&!this._updateTask.finished;return e||o||i||t>0&&t<1}get results(){return this._computations.map(t=>t.result)}get statistics(){return O(this._activeComputations.map(t=>t.result.statistics))}get indicatorPoints(){return this._computations.map(t=>t.indicatorPoint)}get flatProfiles(){return this._flatProfilesCollection}onElevationChange(t){const{view:e}=this;return"3d"===e?.type?v(()=>e.elevationProvider,"elevation-change",t,{onListenerAdd:t,onListenerRemove:t}):n()}get _tileCache(){this._currentTileCache=c(this._currentTileCache);const t=this.view;if("3d"===t?.type){const e=t.basemapTerrain?.elevationQueryCache;if(null!=e)return e}return null==this._currentTileCache&&(this._currentTileCache=new U(new p(20971520))),this._currentTileCache}get _computations(){return this._computationsCollection?.toArray()??[]}get _activeComputations(){return this._computations.filter(t=>t.profile.enabled&&t.available)}get _minDemResolution(){const t=this._minDemResolutions;return t.length>0?o(t):null}get _minDemResolutions(){const t=[];for(const{minDemResolution:e}of this._activeComputations)null!=e&&t.push(e);return t}get _updateParameters(){return this._getStableUpdateParameters()}get _generationParameters(){return this._getStableGenerationParameters()}get elevationInfo(){return this._getStableElevationInfo()}get _options(){return this._getStableOptions()}_update({stationary:t,activeComputations:e,generationParameters:o}){this._abortUpdate(),t&&(null!=o?this._updateTask=i(async t=>{this.error=null;const i=e.filter(t=>!this._isComputationValid(t,o));try{if(!o.geometryIsValid)throw new E;const e=F({...o,providers:i},{signal:t});let s=!1;for await(const r of e){_(t),s||(this._clearInvalidResults(o),s=!0);for(let t=0;t<i.length;t++)i[t].setResult(r[t])}for(const t of i)this._parametersPerComputation.set(t,o)}catch(s){d(s),this._abortUpdate(),this.error=s instanceof S?s:s instanceof E?null:new D,i.forEach(t=>t.clearResult())}}):this._clearResults())}_abortUpdate(){this._updateTask=m(this._updateTask)}_isComputationValid(t,e){return this._parametersPerComputation.has(t)&&this._parametersPerComputation.get(t)===e}_invalidateComputation(t){this._parametersPerComputation.delete(t),this._updateThrottled(this._updateParameters)}_clearInvalidResults(t){for(const e of this._computations)this._isComputationValid(e,t)||(e.clearResult(),this._parametersPerComputation.delete(e))}_clearResults(){for(const t of this._computations)t.clearResult(),this._parametersPerComputation.delete(t)}};t([T({constructOnly:!0})],V.prototype,"analysis",void 0),t([T({constructOnly:!0})],V.prototype,"analysisViewData",void 0),t([T({constructOnly:!0})],V.prototype,"computationFactory",void 0),t([T({constructOnly:!0})],V.prototype,"view",void 0),t([T()],V.prototype,"error",void 0),t([T({readOnly:!0})],V.prototype,"effectiveDisplayUnits",null),t([T()],V.prototype,"progress",null),t([T()],V.prototype,"updating",null),t([T()],V.prototype,"results",null),t([T()],V.prototype,"statistics",null),t([T()],V.prototype,"indicatorPoints",null),t([T()],V.prototype,"flatProfiles",null),t([T()],V.prototype,"_updateTask",void 0),t([T()],V.prototype,"_queue",void 0),t([T()],V.prototype,"_tileCache",null),t([T()],V.prototype,"_flatProfilesCollection",void 0),t([T()],V.prototype,"_computationsCollection",void 0),t([T()],V.prototype,"_computations",null),t([T()],V.prototype,"_activeComputations",null),t([T({readOnly:!0})],V.prototype,"_minDemResolution",null),t([T()],V.prototype,"_minDemResolutions",null),t([T()],V.prototype,"_updateParameters",null),t([T()],V.prototype,"_generationParameters",null),t([T()],V.prototype,"elevationInfo",null),t([T()],V.prototype,"_options",null),V=t([j("esri.views.analysis.ElevationProfile.ElevationProfileController")],V);const M=new R({...b});export{V as ElevationProfileController};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{watch as o,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as n}from"../../../geometry/projectionUtils.js";import{getConfig as l}from"./constants.js";let a=class extends e{constructor(t){super(t),this.visible=!1,this._element=p()}initialize(){this.view.surface?.appendChild(this._element),this.addHandles([o(()=>this.visible&&!!this._screenPoint,t=>{this._element.style.display=t?"block":"none"},i),o(()=>({color:this.line.color.toCss(),zIndex:this._zIndex}),({color:t,zIndex:e})=>{Object.assign(this._element.style,{background:t,zIndex:e.toString()})},i),o(()=>this._screenPoint,t=>{t&&(this._element.style.transform=`translate(${t.x}px, ${t.y}px)`)},i)])}destroy(){this._element.remove()}get updating(){return!1}get _result(){return this.analysisViewData.results.find(t=>t.computation.profile===this.line)}get _zIndex(){const{
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../core/Accessor.js";import{watch as o,syncAndInitial as i}from"../../../core/reactiveUtils.js";import{property as r,subclass as s}from"../../../core/accessorSupport/decorators.js";import{projectOrLoad as n}from"../../../geometry/projectionUtils.js";import{getConfig as l}from"./constants.js";let a=class extends e{constructor(t){super(t),this.visible=!1,this._element=p()}initialize(){this.view.surface?.appendChild(this._element),this.addHandles([o(()=>this.visible&&!!this._screenPoint,t=>{this._element.style.display=t?"block":"none"},i),o(()=>({color:this.line.color.toCss(),zIndex:this._zIndex}),({color:t,zIndex:e})=>{Object.assign(this._element.style,{background:t,zIndex:e.toString()})},i),o(()=>this._screenPoint,t=>{t&&(this._element.style.transform=`translate(${t.x}px, ${t.y}px)`)},i)])}destroy(){this._element.remove()}get updating(){return!1}get _result(){return this.analysisViewData.results.find(t=>t.computation.profile===this.line)}get _zIndex(){const{results:t}=this.analysisViewData,e=t.findIndex(t=>t.computation.profile===this.line);return t.length-(-1===e?0:e)}get _screenPoint(){const{view:t}=this;"3d"===t.type?(t.commitProperty("size"),t.commitProperty("camera")):t.commitProperty("center");const e=t?.spatialReference,o=e?n(this._result?.indicatorPoint,e).geometry:null;return o&&t?.ready?t.toScreen(o):null}};function p(){const t=document.createElement("div"),{size:e,borderStyle:o,borderColor:i,borderWidth:r,boxShadow:s}=l().indicatorPointStyle,{style:n}=t;return n.display="block",n.position="absolute",n.top="0",n.left="0",n.contain="strict",n.boxSizing="border-box",n.width=`${e}px`,n.height=`${e}px`,n.marginTop=`-${e/2}px`,n.marginLeft=`-${e/2}px`,n.border=`${o} ${r}px ${i}`,n.borderRadius=`${e}px`,n.boxShadow=s,t}t([r()],a.prototype,"view",void 0),t([r()],a.prototype,"analysisViewData",void 0),t([r()],a.prototype,"line",void 0),t([r()],a.prototype,"visible",void 0),t([r()],a.prototype,"updating",null),t([r()],a.prototype,"_result",null),t([r()],a.prototype,"_zIndex",null),t([r()],a.prototype,"_screenPoint",null),a=t([s("esri.views.analysis.ElevationProfile.ElevationProfileIndicatorPointVisualization")],a);export{a as ElevationProfileIndicatorPointVisualization};
|
|
@@ -5,10 +5,12 @@ import type { ElevationProfileSample, ElevationProfileStatistics } from "./types
|
|
|
5
5
|
export interface ElevationProfileResultProperties {}
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Represents the result for
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Represents the result for a computed [profile line](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfile/ElevationProfileLine/).
|
|
9
|
+
* Result objects are initialized by the analysis view and dynamically updated as the elevation profile is generated.
|
|
10
|
+
*
|
|
11
|
+
* The [profile](https://developers.arcgis.com/javascript/latest/references/core/views/analysis/ElevationProfile/ElevationProfileResult/#profile) property identifies the computed
|
|
12
|
+
* line associated with the result. In some cases the results array may contain more entries than the top-level
|
|
13
|
+
* [ElevationProfileAnalysis.profiles](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfileAnalysis/#profiles) collection.
|
|
12
14
|
*
|
|
13
15
|
* @since 4.34
|
|
14
16
|
* @see [ElevationProfileAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ElevationProfileAnalysis/)
|
package/views/draw/DrawTool.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__addDisposableResource as e,__disposeResources as t,__decorate as i}from"tslib";import{createTask as n}from"../../core/asyncUtils.js";import{makeHandle as a,disposable as s}from"../../core/handleUtils.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as d}from"../../core/maybe.js";import{when as p,initial as u,watch as c,syncAndInitial as h,on as g,sync as m}from"../../core/reactiveUtils.js";import{screenPointEqual as v,createScreenPoint as y}from"../../core/screenUtils.js";import{diff as f}from"../../core/accessorSupport/diffUtils.js";import{property as M}from"../../core/accessorSupport/decorators/property.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as b}from"../../core/support/UpdatingHandles.js";import w from"../../geometry/Polygon.js";import{i as S,e as C}from"../../chunks/simplifyOperator.js";import{isPolygon as x}from"../../geometry/support/typeUtils.js";import{isCurvedGeometry as P}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as H}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getEffectiveElevationInfo as L}from"../../support/elevationInfoUtils.js";import{getMaxDeviationInPixels as k,getMinSegmentsPerCurve as I}from"../2d/layers/graphics/densificationConstants.js";import{createSnappingVisualizer as O}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as G,markHandled as V,getPointerType as T}from"./support/drawToolUtils.js";import{PluginContext as j}from"./support/PluginContext.js";import{viewEventToCommand as E}from"./support/input/drawToolInput.js";import{EditSessionManager as D}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as U}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as A}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as F}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as R}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as Z}from"./support/managers/SurfaceManager.js";import{TooltipManager as B}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as q}from"../input/InputManager.js";import{createCoordinateHelper as z}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as K}from"../interactive/InteractiveToolBase.js";import{KeyBindings as N,mediaKeys as Q,sketchKeys as W,advancedSketchKeys as $,tooltipKeys as J}from"../interactive/keybindings.js";import{isInputModeAvailable as X}from"../interactive/tooltip/tooltipCommonUtils.js";const Y=Symbol();let ee=class extends K{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._queuedFeedbackEvents=[],this._flushingQueuedFeedbackEvents=!1,this._commandsSuspended=!1,this._snappingVisualizer=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._updatingHandles=new b,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.sketchOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new F,this.globalStateManager=new U({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new D({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new R({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null,this.enableVertexVisuals=!0}initialize(){const{view:e}=this;this.interactiveHandleManager=new A({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new B({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(p(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(O(e,t).then(e=>this._snappingVisualizer=e))},u)),this.addHandles([c(()=>[this.view,this.coordinateHelper.spatialReference,this.defaultZ,this.hasZ,this.elevationInfo],([e,t,i,n,a])=>{this.surfaceManager?.destroy(),this.surfaceManager=new Z({spatialReference:t,excludedGraphicsLayer:null,defaultZ:i,hasZ:n,view:e,elevationInfo:a,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},h),p(()=>this.sketchOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),c(()=>[this.editGeometryOperations,this.sketchOptions?.labels.enabled,this.globalStateManager.segmentLabelsDisabled],()=>{this._updatingHandles.addPromise(this._setupSegmentLabels())},u),g(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},m),g(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},m),c(()=>this.lifecycleManager.updating,e=>{e||this._emitQueuedFeedbackEvents()},m),g(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),i=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this._emitWhenReady(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this._emitWhenReady(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this._emitWhenReady(e.type,{...e,removed:i,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=l(this.surfaceManager),this.interactiveHandleManager=l(this.interactiveHandleManager),this._segmentLabelsImportTask=d(this._segmentLabelsImportTask),this._segmentLabels=l(this._segmentLabels),this.tooltipManager=l(this.tooltipManager)}get _zOfLastUserInput(){const e=this.mostDownstreamPlugin&&this.editSessionManager.getSession(this.mostDownstreamPlugin),t=e?.firstPointAddedBySession?.point;return t?.hasZ?t.z:null}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,sketchOptions:i,directionOptions:n,elevationInfo:a,view:s}=this;return t&&i&&s?{defaultZ:e,directionOptions:n,elevationInfo:a,editGeometryOperations:t,sketchOptions:i,view:s,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,getAllHandles:()=>this.interactiveHandleManager?.allhandles,getHelpMessageKey:()=>this.helpMessageKey,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;if(!t)return null;return{coordinateHelper:e,viewingMode:"3d"===t.type&&"global"===t.viewingMode?1:2}}get _densificationParameters(){const{view:e,coordinateHelper:t}=this,i=t.spatialReference,n=e?.spatialReference,a=e.resolution;if(!(i&&n&&a&&Number.isFinite(a)))return null;const s=n.metersPerUnit/i.metersPerUnit;return{maxDeviation:2**Math.round(Math.log2(a))*k()*s,minSegmentsPerCurve:I()}}get test(){return{densificationParameters:this._densificationParameters,segmentLabels:this._segmentLabels}}get updating(){return this._updatingHandles.updating||this.lifecycleManager.updating||!!this._segmentLabels?.updating}get coordinateHelper(){return z(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get unprocessedGeometry(){return this.editSessionManager.outputGeometry}get simplifiedGeometryPreview(){const e=this.editSessionManager.outputGeometry;if(e&&x(e))try{const t=this._densificationParameters,i=P(e)&&t?new w({...H(e,t)}):e;if(!S(i))return C(i)}catch(t){return e}return e}get _suppressCoincidentPointOverlaysIn3D(){return"3d"===this.view.type&&"point"===this.unprocessedGeometry?.type&&!!this.interactiveHandleManager?.allhandles?.find(e=>"primary"===e.role)?.outputMapPosition}get _shapeVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.simplifiedGeometryPreview}get _vertexVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.unprocessedGeometry}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){const e=this.lastScreenPosition;return e?this.surfaceManager?.screenToMap(e,{firstPointZ:this._zOfLastUserInput})??this.view.toMap(e):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:i,snappingManager:n,interactiveHandleManager:a,_snappingVisualizer:s,defaultZ:r,hasZ:o,globalStateManager:{drawAtFixedElevation:l},view:d}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:i,interactiveHandleManager:a,snappingManager:n,snappingVisualizer:s,pointerType:"mouse",hasZ:o,defaultZ:r,view:d,drawAtFixedElevation:l}}get tooltip(){return this.tooltipManager?.tooltip}get activeTooltipInfo(){return this.tooltipManager?.tooltipInfo}get helpMessageKey(){return this.pluginStack.items.findLast(e=>e.helpMessageKey)?.helpMessageKey??"noTool"}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;if(e&&t.complete(e),0===t.pluginStack.length){const e=this.unprocessedGeometry,t=!e||"mesh"===e.type||S(e);this.emit("complete",{geometry:e,isSimple:t,aborted:!1,type:"complete",vertices:[]}),this.view?.activeTool===this&&(this.view.activeTool=null)}}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}getVertexSnappingCandidates(){return"secondary"===this.interactiveHandleManager?.capturingHandle?.role?[]:this.snappingManager?.getVertexCandidates()??[]}replaceLeaf(e){const t=this.lifecycleManager;t.updating?r.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){this._handleCommand({action:"undo"})}redo(){this._handleCommand({action:"redo"})}executeCommand(e){return this._handleCommand(e)}suspendCommands(){return this._commandsSuspended=!0,a(()=>{this._commandsSuspended=!1;const e=this.view?.inputManager.latestPointerInfo;if(e){const{x:t,y:i}=e.location;this._handleCommand({action:"manipulator-move-to",x:t,y:i})}})}addPromise(e){return this._updatingHandles.addPromise(e)}getGeometryIfCompleted(){const e=this.lifecycleManager.gatherCompletablePlugins();return this.editSessionManager?.generatePreviewGeometryForPlugins(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.enableVertexVisuals&&this.addHandles(c(()=>this._vertexVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?G(e):null})},u)),this.addHandles([c(()=>this._shapeVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e})},u),p(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:v}),c(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const i=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&i&&this._emitWhenReady("cursor-update",{updated:i.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:i.part.index,vertexIndex:i.index,coordinates:i.pos}]})},m),this._keybindings.register(e,q.TOOL),c(()=>e.viewpoint,(e,t)=>{e&&t&&f(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],Y)}onDeactivate(){super.onDeactivate(),this.removeHandles(Y),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){const t=E(e);t&&this._handleCommand(t)}forceAddVertex(){this._commitNext()}_emitWhenReady(e,t){if(this.destroyed)return;const i=()=>{this.emit(e,t)};this.lifecycleManager.updating||this._flushingQueuedFeedbackEvents?this._queuedFeedbackEvents.push(i):i()}_emitQueuedFeedbackEvents(){if(!(this.destroyed||this._flushingQueuedFeedbackEvents||this.lifecycleManager.updating||0===this._queuedFeedbackEvents.length)){this._flushingQueuedFeedbackEvents=!0;try{for(;!this.destroyed&&!this.lifecycleManager.updating&&this._queuedFeedbackEvents.length>0;)this._queuedFeedbackEvents.shift()?.()}finally{this._flushingQueuedFeedbackEvents=!1}}}async _handleCommand(e){if(!this._commandsSuspended)if(this.lifecycleManager.updating)r.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>{V(e),this._commitNext()});case"vertex-add-and-finish-part":return this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(V(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&V(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&X(t.info)&&(await t.enterInputMode(),V(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,i=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==i?.captureMode&&"capture-when-engaged"!==i?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&V(e):V(e)}_handleVertexAddAndFinishPartCommand(e){this._before(e)||(V(e),this._commitNext(),this.finishPart())}async _handleViewpointMovedCommand(e){this.editable&&(await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:T(e.originalEvent)})),this.interactiveHandleManager?.updateAllScreenPositions(this.movementCommandContext.surfaceManager))}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&V(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(t,{...this.movementCommandContext,pointerType:T(e.originalEvent)}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=T(e.originalEvent),i=this._updateLastScreenPosition(e),n=this.interactiveHandleManager?.findHandleByManipulator(i,t);"touch"===t&&n&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const a=this.interactiveHandleManager?.findHandleDragging(),s=this.interactiveHandleManager?.capturingHandle,r=a??s??n;r&&!n&&V(e),"capture-when-engaged"===r?.captureMode||"capture-always"===r?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(r.noteDragEnd(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===T(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&"primary"===r.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(r.noteDragStart(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===T(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&!r.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(r?.moveTo(i,{...this.movementCommandContext,pointerType:T(e.originalEvent)})):"grabbable-object"===r?.captureMode&&(this.interactiveHandleManager?.releaseHandle(s),await this._updatingHandles.addPromise(r.moveTo(i,{...this.movementCommandContext,pointerType:t})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),i=T(e.originalEvent),n=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t,i);this.editable&&n&&(this._before(e)||(V(e),await this._updatingHandles.addPromise(n.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:i}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new N,t=(t,i)=>{e.addToggle(t,e=>this._handleCommand({action:i,originalEvent:e,enabled:"key-down"===e.type}))},i=(t,i)=>{e.add(t,e=>this._handleCommand({action:i,originalEvent:e}))};return t(Q.preserveAspectRatio,"constraint-aspect"),t(W.center,"constraint-center"),i($.toggleFollowManipulator,"toggle-manipulator-follow"),i(W.undo,"undo"),i(W.redo,"redo"),i(W.complete,"complete"),i(W.vertexAdd,"vertex-add"),i({key:J.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}_commitNext(){const i={stack:[],error:void 0,hasError:!1};try{const t=this.mostDownstreamPlugin;if(!t)return;this.tooltipManager?.storeConstraintSnapshot();let n=!1;const a=this.editGeometryOperations;e(i,a?s(a.on("vertex-add",()=>n=!0)):null,!1);t.completeStep?t.completeStep():this.complete(t),n&&this.tooltipManager?.unlockOnVertexPlacement()}catch(n){i.error=n,i.hasError=!0}finally{t(i)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=y(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const i=o(this._pluginContexts,e,()=>new j({drawTool:this,plugin:e,session:t}));return i.session=t,i}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,i){return this._before(e)?i?.():t()}async _setupSegmentLabels(){const e=this.editGeometryOperations,t=this.sketchOptions?.labels,i=!!t?.enabled,n=this.globalStateManager.segmentLabelsDisabled;if(!e||!t||!i)return void(this._segmentLabels=l(this._segmentLabels));if(n)return void(this._segmentLabels&&(this._segmentLabels.visible=!1));if(this._segmentLabels?.context?.editGeometryOperations===e&&this._segmentLabels.context.labelOptions===t)return void(this._segmentLabels.visible=!0);const a=await this._createSegmentLabels(e,t);a&&(this._segmentLabels=l(this._segmentLabels),this._segmentLabels=a)}async _createSegmentLabels(e,t){return(this._segmentLabelsImportTask??=n(async i=>{if("3d"===this.view.type){const n=import("../3d/interactive/SegmentLabels3D.js"),{SegmentLabels3D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})}const n=import("../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})})).promise}_isSegmentLabelsSetupStale(e,t,i){return e.aborted||this.editGeometryOperations!==t||this.sketchOptions?.labels!==i||!i.enabled||this.globalStateManager.segmentLabelsDisabled}};i([M()],ee.prototype,"_commandsSuspended",void 0),i([M()],ee.prototype,"_zOfLastUserInput",null),i([M()],ee.prototype,"_snappingVisualizer",void 0),i([M()],ee.prototype,"_segmentLabels",void 0),i([M()],ee.prototype,"_segmentLabelsImportTask",void 0),i([M()],ee.prototype,"_tooltipDependencies",null),i([M()],ee.prototype,"_editSessionManagerContext",null),i([M()],ee.prototype,"_densificationParameters",null),i([M({constructOnly:!0,nonNullable:!0})],ee.prototype,"view",void 0),i([M()],ee.prototype,"automaticManipulatorSelection",void 0),i([M()],ee.prototype,"updating",null),i([M()],ee.prototype,"coordinateHelper",null),i([M()],ee.prototype,"editGeometry",null),i([M()],ee.prototype,"editGeometryOperations",null),i([M()],ee.prototype,"unprocessedGeometry",null),i([M()],ee.prototype,"simplifiedGeometryPreview",null),i([M()],ee.prototype,"_suppressCoincidentPointOverlaysIn3D",null),i([M()],ee.prototype,"_shapeVisualGeometry",null),i([M()],ee.prototype,"_vertexVisualGeometry",null),i([M()],ee.prototype,"snappingManager",void 0),i([M()],ee.prototype,"sketchOptions",void 0),i([M()],ee.prototype,"elevationInfo",void 0),i([M()],ee.prototype,"hasZ",void 0),i([M()],ee.prototype,"defaultZ",void 0),i([M()],ee.prototype,"directionOptions",void 0),i([M()],ee.prototype,"canUndo",null),i([M()],ee.prototype,"canRedo",null),i([M()],ee.prototype,"pluginStack",null),i([M()],ee.prototype,"mostDownstreamPlugin",null),i([M()],ee.prototype,"mostUpstreamPlugin",null),i([M()],ee.prototype,"lastScreenPosition",void 0),i([M()],ee.prototype,"positionOfLastUserInput",null),i([M()],ee.prototype,"tooltipManager",void 0),i([M()],ee.prototype,"measurementManager",void 0),i([M()],ee.prototype,"globalStateManager",void 0),i([M()],ee.prototype,"editSessionManager",void 0),i([M()],ee.prototype,"lifecycleManager",void 0),i([M()],ee.prototype,"surfaceManager",void 0),i([M()],ee.prototype,"interactiveHandleManager",void 0),i([M()],ee.prototype,"renderer",void 0),i([M()],ee.prototype,"movementCommandContext",null),i([M()],ee.prototype,"tooltip",null),i([M()],ee.prototype,"activeTooltipInfo",null),i([M()],ee.prototype,"helpMessageKey",null),i([M({constructOnly:!0})],ee.prototype,"enableVertexVisuals",void 0),ee=i([_("esri.views.draw.DrawTool")],ee);export{ee as DrawTool};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as i}from"tslib";import{createTask as n}from"../../core/asyncUtils.js";import{makeHandle as a,disposable as s}from"../../core/handleUtils.js";import r from"../../core/Logger.js";import{getOrCreateMapValue as o}from"../../core/MapUtils.js";import{destroyMaybe as l,abortMaybe as d}from"../../core/maybe.js";import{when as p,initial as u,watch as c,syncAndInitial as h,on as g,sync as m}from"../../core/reactiveUtils.js";import{screenPointEqual as v,createScreenPoint as y}from"../../core/screenUtils.js";import{diff as f}from"../../core/accessorSupport/diffUtils.js";import{property as M}from"../../core/accessorSupport/decorators/property.js";import{subclass as _}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as b}from"../../core/support/UpdatingHandles.js";import S from"../../geometry/Polygon.js";import{i as w,e as C}from"../../chunks/simplifyOperator.js";import{isPolygon as P}from"../../geometry/support/typeUtils.js";import{isCurvedGeometry as x}from"../../geometry/support/curves/curveUtils.js";import{densifyCurvedGeometry as H}from"../../geometry/support/curves/densifyCurvedGeometry.js";import{getEffectiveElevationInfo as L}from"../../support/elevationInfoUtils.js";import{getMaxDeviationInPixels as k,getMinSegmentsPerCurve as I}from"../2d/layers/graphics/densificationConstants.js";import{createSnappingVisualizer as O}from"./support/createSnappingVisualizer.js";import{multipointFromGeometry as V,markHandled as G,getPointerType as T}from"./support/drawToolUtils.js";import{PluginContext as j}from"./support/PluginContext.js";import{viewEventToCommand as E}from"./support/input/drawToolInput.js";import{EditSessionManager as D}from"./support/managers/EditSessionManager.js";import{GlobalStateManager as U}from"./support/managers/GlobalStateManager.js";import{InteractiveHandleManager as A}from"./support/managers/InteractiveHandleManager.js";import{MeasurementManager as F}from"./support/managers/MeasurementManager.js";import{PluginLifecycleManager as R}from"./support/managers/PluginLifecycleManager.js";import{SurfaceManager as Z}from"./support/managers/SurfaceManager.js";import{TooltipManager as B}from"./support/managers/TooltipManager.js";import{ViewEventPriorities as q}from"../input/InputManager.js";import{createCoordinateHelper as z}from"../interactive/coordinateHelper.js";import{InteractiveToolBase as K}from"../interactive/InteractiveToolBase.js";import{KeyBindings as N,mediaKeys as Q,sketchKeys as W,advancedSketchKeys as $,tooltipKeys as J}from"../interactive/keybindings.js";import{isInputModeAvailable as X}from"../interactive/tooltip/tooltipCommonUtils.js";const Y=Symbol();let ee=class extends K{constructor(e){super(e),this._shapeVisualId=Symbol(),this._vertexVisualId=Symbol(),this._pluginContexts=new Map,this._queuedFeedbackEvents=[],this._flushingQueuedFeedbackEvents=!1,this._commandsSuspended=!1,this._snappingVisualizer=null,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._updatingHandles=new b,this._keybindings=this._makeKeyBindings(),this._pendingBeginRequest=null,this.type="draw-2.0",this.automaticManipulatorSelection=!0,this.snappingManager=null,this.sketchOptions=null,this.elevationInfo=null,this.hasZ=!1,this.defaultZ=0,this.lastScreenPosition=null,this.measurementManager=new F,this.globalStateManager=new U({getPluginStack:()=>this.pluginStack}),this.editSessionManager=new D({getContext:()=>this._editSessionManagerContext}),this.lifecycleManager=new R({getContext:this._getContextForPlugin.bind(this),editSessionManager:this.editSessionManager,afterAttach:this._afterAttach.bind(this),afterDetach:this._afterDetach.bind(this),beforeResume:this._beforeResume.bind(this)}),this.surfaceManager=null,this.interactiveHandleManager=null,this.renderer=null,this.readPluginSetting=null,this.enableVertexVisuals=!0}initialize(){const{view:e}=this;this.interactiveHandleManager=new A({view:e,renderer:this.renderer}),this._override("manipulators",this.interactiveHandleManager.manipulators),this.tooltipManager=new B({getDependencies:()=>this._tooltipDependencies,getLastScreenPosition:()=>this.lastScreenPosition}),this.addHandles(p(()=>this.renderer,t=>{t.addOrUpdateVisual(this._shapeVisualId,{role:"outputGeometry"}),t.addOrUpdateVisual(this._vertexVisualId,{role:"vertex"}),this._updatingHandles.addPromise(O(e,t).then(e=>this._snappingVisualizer=e))},u)),this.addHandles([c(()=>[this.view,this.coordinateHelper.spatialReference,this.defaultZ,this.hasZ,this.elevationInfo],([e,t,i,n,a])=>{this.surfaceManager?.destroy(),this.surfaceManager=new Z({spatialReference:t,excludedGraphicsLayer:null,defaultZ:i,hasZ:n,view:e,elevationInfo:a,getContext:()=>({drawAtFixedElevation:this.globalStateManager.drawAtFixedElevation,elevationConstraint:this.tooltipManager?.elevationConstraint,constraintsEnabled:this.tooltipManager?.constraintsEnabled??!1})})},h),p(()=>this.sketchOptions?.tooltips.effectiveEnabled,()=>this.measurementManager.preloadMeasurementUtils(),{once:!0,initial:!0}),c(()=>[this.editGeometryOperations,this.sketchOptions?.labels.enabled,this.globalStateManager.segmentLabelsDisabled],()=>{this._updatingHandles.addPromise(this._setupSegmentLabels())},u),g(()=>this.editSessionManager,"cancelPlugin",({plugin:e})=>{this._suspendPlugin(e)},m),g(()=>this.editSessionManager,"restartPlugin",({restartInfo:e})=>{this._resumePlugin(e)},m),c(()=>this.lifecycleManager.updating,e=>{e||this._emitQueuedFeedbackEvents()},m),g(()=>this.editGeometryOperations,["vertex-add","vertex-update","vertex-remove"],e=>{const t=e.vertices.map(e=>({componentIndex:0,vertexIndex:e.index,coordinates:this.coordinateHelper.vectorToArray(e.pos)})),i=t.map(e=>e.coordinates);switch(e.type){case"vertex-add":this._emitWhenReady(e.type,{...e,added:i,vertices:t});break;case"vertex-update":this._emitWhenReady(e.type,{...e,updated:i,vertices:t});break;case"vertex-remove":this._emitWhenReady(e.type,{...e,removed:i,vertices:t})}})])}destroy(){this.active&&this.onDeactivate(),this.editSessionManager.destroy(),this.lifecycleManager.destroy(),this.measurementManager.destroy(),this.globalStateManager.destroy();for(const e of this._pluginContexts.values())e.destroy();this._pluginContexts.clear(),this.surfaceManager=l(this.surfaceManager),this.interactiveHandleManager=l(this.interactiveHandleManager),this._segmentLabelsImportTask=d(this._segmentLabelsImportTask),this._segmentLabels=l(this._segmentLabels),this.tooltipManager=l(this.tooltipManager)}get _zOfLastUserInput(){const e=this.mostDownstreamPlugin&&this.editSessionManager.getSession(this.mostDownstreamPlugin),t=e?.firstPointAddedBySession?.point;return t?.hasZ?t.z:null}get _tooltipDependencies(){const{defaultZ:e,editGeometryOperations:t,sketchOptions:i,directionOptions:n,elevationInfo:a,view:s}=this;return t&&i&&s?{defaultZ:e,directionOptions:n,elevationInfo:a,editGeometryOperations:t,sketchOptions:i,view:s,getActiveHandle:()=>this.interactiveHandleManager?.focusedHandle,getAllHandles:()=>this.interactiveHandleManager?.allhandles,getHelpMessageKey:()=>this.helpMessageKey,notifyTooltipsChanged:()=>{const{interactiveHandleManager:e,movementCommandContext:t}=this;e&&t&&e.reapplyPositions(t)}}:null}get _editSessionManagerContext(){const{coordinateHelper:e,view:t}=this;if(!t)return null;return{coordinateHelper:e,viewingMode:"3d"===t.type&&"global"===t.viewingMode?1:2}}get _densificationParameters(){const{view:e,coordinateHelper:t}=this,i=t.spatialReference,n=e?.spatialReference,a=e.resolution;if(!(i&&n&&a&&Number.isFinite(a)))return null;const s=n.metersPerUnit/i.metersPerUnit;return{maxDeviation:2**Math.round(Math.log2(a))*k()*s,minSegmentsPerCurve:I()}}get test(){return{densificationParameters:this._densificationParameters,segmentLabels:this._segmentLabels}}get updating(){return this._updatingHandles.updating||this.lifecycleManager.updating||!!this._segmentLabels?.updating}get coordinateHelper(){return z(this.hasZ,!1,this.view.spatialReference)}get editGeometry(){return this.editGeometryOperations?.data}get editGeometryOperations(){return this.editSessionManager.editGeometryOperations}get unprocessedGeometry(){return this.editSessionManager.outputGeometry}get simplifiedGeometryPreview(){const e=this.editSessionManager.outputGeometry;if(e&&P(e))try{const t=this._densificationParameters,i=x(e)&&t?new S({...H(e,t)}):e;if(!w(i))return C(i)}catch(t){return e}return e}get _suppressCoincidentPointOverlaysIn3D(){return"3d"===this.view.type&&"point"===this.unprocessedGeometry?.type&&!!this.interactiveHandleManager?.allhandles?.find(e=>"primary"===e.role)?.outputMapPosition}get _shapeVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.simplifiedGeometryPreview}get _vertexVisualGeometry(){return this._suppressCoincidentPointOverlaysIn3D?null:this.unprocessedGeometry}get canUndo(){return this.editSessionManager.canUndo}get canRedo(){return this.editSessionManager.canRedo}get pluginStack(){return this.lifecycleManager.pluginStack}get mostDownstreamPlugin(){return this.pluginStack.at(-1)}get mostUpstreamPlugin(){return this.pluginStack.at(0)}get positionOfLastUserInput(){const e=this.lastScreenPosition;return e?this.surfaceManager?.screenToMap(e,{firstPointZ:this._zOfLastUserInput})??this.view.toMap(e):this.view.center}get movementCommandContext(){const{editGeometryOperations:e,tooltipManager:t,surfaceManager:i,snappingManager:n,interactiveHandleManager:a,_snappingVisualizer:s,defaultZ:r,hasZ:o,globalStateManager:{drawAtFixedElevation:l},view:d}=this;return{tooltipManager:t,editGeometryOperations:e,surfaceManager:i,interactiveHandleManager:a,snappingManager:n,snappingVisualizer:s,pointerType:"mouse",hasZ:o,defaultZ:r,view:d,drawAtFixedElevation:l}}get tooltip(){return this.tooltipManager?.tooltip}get activeTooltipInfo(){return this.tooltipManager?.tooltipInfo}get helpMessageKey(){return this.pluginStack.items.findLast(e=>e.helpMessageKey)?.helpMessageKey??"noTool"}begin(e){this.active?(this.lifecycleManager.begin(e),this._pendingBeginRequest=null):this._pendingBeginRequest=e}complete(e){const t=this.lifecycleManager;if(e&&t.complete(e),0===t.pluginStack.length){const e=this.unprocessedGeometry,t=!e||"mesh"===e.type||w(e);this.emit("complete",{geometry:e,isSimple:t,aborted:!1,type:"complete",vertices:[]}),this.view?.activeTool===this&&(this.view.activeTool=null)}}cancelFirstUserLeafPlugin(){const e=this.pluginStack.toArray().findLast(e=>!0!==e.configuration?.hidden);e&&this.lifecycleManager.cancel(e)}getVertexSnappingCandidates(){return"secondary"===this.interactiveHandleManager?.capturingHandle?.role?[]:this.snappingManager?.getVertexCandidates()??[]}replaceLeaf(e){const t=this.lifecycleManager;t.updating?r.getLogger(this).info("Ignoring command; arrived while updating:","replaceLeaf"):t.replaceLeaf(e)}finishPart(){const e=this.mostUpstreamPlugin,t=e?.configuration;if(this.editGeometryOperations&&t&&t.kind?.includes("multipart")){const e=this.pluginStack.at(1);e&&this.complete(e)}}undo(){this._handleCommand({action:"undo"})}redo(){this._handleCommand({action:"redo"})}executeCommand(e){return this._handleCommand(e)}suspendCommands(){return this._commandsSuspended=!0,a(()=>{this._commandsSuspended=!1;const e=this.view?.inputManager.latestPointerInfo;if(e){const{x:t,y:i}=e.location;this._handleCommand({action:"manipulator-move-to",x:t,y:i})}})}addPromise(e){return this._updatingHandles.addPromise(e)}readPluginSettingValue(e,t){return this.readPluginSetting?.(e,t)}getGeometryIfCompleted(){const e=this.lifecycleManager.gatherCompletablePlugins();return this.editSessionManager?.generatePreviewGeometryForPlugins(e)}onActivate(){super.onActivate();const{view:e}=this;this.lastScreenPosition=e?.inputManager.latestPointerInfo?.location,this.renderer?.activate(),this._pendingBeginRequest&&(this.begin(this._pendingBeginRequest),this._pendingBeginRequest=null),this.enableVertexVisuals&&this.addHandles(c(()=>this._vertexVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._vertexVisualId,{geometry:e?V(e):null})},u)),this.addHandles([c(()=>this._shapeVisualGeometry,e=>{this.renderer?.addOrUpdateVisual(this._shapeVisualId,{geometry:e})},u),p(()=>this.interactiveHandleManager?.capturingHandle?.screenPosition,e=>this.lastScreenPosition=e,{initial:!0,equals:v}),c(()=>this.interactiveHandleManager?.capturingHandle?.outputMapPosition,(e,t)=>{const i=this.interactiveHandleManager?.capturingHandle?.editSession?.endVertex;e&&t&&i&&this._emitWhenReady("cursor-update",{updated:i.pos,type:"vertex-update",operation:"apply",vertices:[{componentIndex:i.part.index,vertexIndex:i.index,coordinates:i.pos}]})},m),this._keybindings.register(e,q.TOOL),c(()=>e.viewpoint,(e,t)=>{e&&t&&f(e,t)&&this._handleCommand({action:"viewpoint-moved"})})],Y)}onDeactivate(){super.onDeactivate(),this.removeHandles(Y),this.renderer?.deactivate(),this.snappingManager?.doneSnapping(),this.lifecycleManager.cancelAll(),this._pendingBeginRequest=null}onInputEvent(e){const t=E(e);t&&this._handleCommand(t)}forceAddVertex(){this._commitNext()}_emitWhenReady(e,t){if(this.destroyed)return;const i=()=>{this.emit(e,t)};this.lifecycleManager.updating||this._flushingQueuedFeedbackEvents?this._queuedFeedbackEvents.push(i):i()}_emitQueuedFeedbackEvents(){if(!(this.destroyed||this._flushingQueuedFeedbackEvents||this.lifecycleManager.updating||0===this._queuedFeedbackEvents.length)){this._flushingQueuedFeedbackEvents=!0;try{for(;!this.destroyed&&!this.lifecycleManager.updating&&this._queuedFeedbackEvents.length>0;)this._queuedFeedbackEvents.shift()?.()}finally{this._flushingQueuedFeedbackEvents=!1}}}async _handleCommand(e){if(!this._commandsSuspended)if(this.lifecycleManager.updating)r.getLogger(this).info("Ignoring command; arrived while updating:",e.action);else switch(e.action){case"view-drag":return await this._handleViewDragCommand(e);case"vertex-add":return this._guardCommand(e,()=>{G(e),this._commitNext()});case"vertex-add-and-finish-part":return this._handleVertexAddAndFinishPartCommand(e);case"cancel":return this._guardCommand(e,()=>this.cancel());case"complete":return this._guardCommand(e,()=>{this.mostUpstreamPlugin&&(G(e),this.complete(this.mostUpstreamPlugin))});case"finish-part":return this._guardCommand(e,()=>this.finishPart());case"undo":return this._guardCommand(e,()=>this.editSessionManager.undo());case"redo":return this._guardCommand(e,()=>this.editSessionManager.redo());case"next-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("forward"));case"previous-manipulator":return this._guardCommand(e,()=>this.interactiveHandleManager?.cycleManipulator("backward"));case"toggle-manipulator-follow":this.interactiveHandleManager?.toggleFollow()&&G(e);break;case"viewpoint-moved":return await this._handleViewpointMovedCommand(e);case"manipulator-move-to":return await this._handleManipulatorMoveToCommand(e);case"manipulator-drag-to":return await this._handleManipulatorDragToCommand(e);case"vertex-add-at-point":return await this._handleVertexAddAtPointCommand(e);case"show-tooltip":return this._guardCommand(e,async()=>{const t=this.tooltipManager?.tooltip;t&&X(t.info)&&(await t.enterInputMode(),G(e))});case"constraint-center":this.globalStateManager.setCentered(e.enabled);break;case"constraint-aspect":this.globalStateManager.setPreserveAspectRatio(e.enabled)}}async _handleViewDragCommand(e){if(!this.editable)return;const t=e.originalEvent,i=this.interactiveHandleManager?.capturingHandle;(!t||!("pointerType"in t)||"touch"!==t.pointerType||"capture-always"!==i?.captureMode&&"capture-when-engaged"!==i?.captureMode)&&"capture-when-engaged"!==this.interactiveHandleManager?.capturingHandle?.captureMode?this._before(e)&&G(e):G(e)}_handleVertexAddAndFinishPartCommand(e){this._before(e)||(G(e),this._commitNext(),this.finishPart())}async _handleViewpointMovedCommand(e){this.editable&&(await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(null,{...this.movementCommandContext,pointerType:T(e.originalEvent)})),this.interactiveHandleManager?.updateAllScreenPositions(this.movementCommandContext.surfaceManager))}async _handleManipulatorMoveToCommand(e){if(!this.editable)return;const t=this._updateLastScreenPosition(e);this.interactiveHandleManager?.capturingHandle&&G(e),await this._updatingHandles.addPromise(this.interactiveHandleManager?.capturingHandle?.moveTo(t,{...this.movementCommandContext,pointerType:T(e.originalEvent)}))}async _handleManipulatorDragToCommand(e){if(!this.editable)return;const t=T(e.originalEvent),i=this._updateLastScreenPosition(e),n=this.interactiveHandleManager?.findHandleByManipulator(i,t);"touch"===t&&n&&"start"===e.state&&this.interactiveHandleManager?.releaseHandle();const a=this.interactiveHandleManager?.findHandleDragging(),s=this.interactiveHandleManager?.capturingHandle,r=a??s??n;r&&!n&&G(e),"capture-when-engaged"===r?.captureMode||"capture-always"===r?.captureMode&&"touch"===t?"end"===e.state?await this._updatingHandles.addPromise(r.noteDragEnd(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===T(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&"primary"===r.role&&(1===this.interactiveHandleManager?.handleCount?this._handleCommand({action:"vertex-add"}):this.interactiveHandleManager?.releaseHandle())})):"start"===e.state?await this._updatingHandles.addPromise(r.noteDragStart(i,{...this.movementCommandContext,pointerType:t}).then(()=>{r&&"touch"===T(e.originalEvent)&&"grabbable-object"!==r.captureMode&&"capture-when-engaged"!==r.defaultCaptureMode&&!r.editSession?.lastPointAddedBySession&&this._handleCommand({action:"vertex-add"})})):await this._updatingHandles.addPromise(r?.moveTo(i,{...this.movementCommandContext,pointerType:T(e.originalEvent)})):"grabbable-object"===r?.captureMode&&(this.interactiveHandleManager?.releaseHandle(s),await this._updatingHandles.addPromise(r.moveTo(i,{...this.movementCommandContext,pointerType:t})))}async _handleVertexAddAtPointCommand(e){const t=this._updateLastScreenPosition(e),i=T(e.originalEvent),n=this.interactiveHandleManager?.capturingHandle??this.interactiveHandleManager?.findHandleByManipulator(t,i);this.editable&&n&&(this._before(e)||(G(e),await this._updatingHandles.addPromise(n.moveTo(t,{...this.movementCommandContext,skipSnapping:!0,pointerType:i}).finally(()=>this._commitNext()))))}_makeKeyBindings(){const e=new N,t=(t,i)=>{e.addToggle(t,e=>this._handleCommand({action:i,originalEvent:e,enabled:"key-down"===e.type}))},i=(t,i)=>{e.add(t,e=>this._handleCommand({action:i,originalEvent:e}))};return t(Q.preserveAspectRatio,"constraint-aspect"),t(W.center,"constraint-center"),i($.toggleFollowManipulator,"toggle-manipulator-follow"),i(W.undo,"undo"),i(W.redo,"redo"),i(W.complete,"complete"),i(W.vertexAdd,"vertex-add"),i({key:J.enterInputMode,continuePropagation:!0,repeats:!0},"show-tooltip"),e}_afterAttach(){}_afterDetach(e){this.interactiveHandleManager?.unregisterCustomConstraint(e),this.interactiveHandleManager?.unregisterHandle(e),this.tooltipManager?.unregisterPluginFields(e),this.globalStateManager.clearPluginOverrides(e);const t=this._pluginContexts.get(e);t&&(t.destroy(),this._pluginContexts.delete(e))}_beforeResume(e,t){this.interactiveHandleManager?.replaceEditSessions(e,t)}_commitNext(){const i={stack:[],error:void 0,hasError:!1};try{const t=this.mostDownstreamPlugin;if(!t)return;this.tooltipManager?.storeConstraintSnapshot();let n=!1;const a=this.editGeometryOperations;e(i,a?s(a.on("vertex-add",()=>n=!0)):null,!1);t.completeStep?t.completeStep():this.complete(t),n&&this.tooltipManager?.unlockOnVertexPlacement()}catch(n){i.error=n,i.hasError=!0}finally{t(i)}}_suspendPlugin(e){this.lifecycleManager.suspend(e),this.measurementManager.suspendPlugin(e)}_resumePlugin(e){this.lifecycleManager.resume(e)}_updateLastScreenPosition(e){const t=y(e.x,e.y);return this.lastScreenPosition=t,t}_getContextForPlugin(e,t){const i=o(this._pluginContexts,e,()=>new j({drawTool:this,plugin:e,session:t}));return i.session=t,i}_before(e){if(!this.hasEventListener(`before-${e.action}`))return!1;const t=new CustomEvent(`before-${e.action}`,{detail:e,cancelable:!0});return this.emit(`before-${e.action}`,t),t.defaultPrevented}_guardCommand(e,t,i){return this._before(e)?i?.():t()}async _setupSegmentLabels(){const e=this.editGeometryOperations,t=this.sketchOptions?.labels,i=!!t?.enabled,n=this.globalStateManager.segmentLabelsDisabled;if(!e||!t||!i)return void(this._segmentLabels=l(this._segmentLabels));if(n)return void(this._segmentLabels&&(this._segmentLabels.visible=!1));if(this._segmentLabels?.context?.editGeometryOperations===e&&this._segmentLabels.context.labelOptions===t)return void(this._segmentLabels.visible=!0);const a=await this._createSegmentLabels(e,t);a&&(this._segmentLabels=l(this._segmentLabels),this._segmentLabels=a)}async _createSegmentLabels(e,t){return(this._segmentLabelsImportTask??=n(async i=>{if("3d"===this.view.type){const n=import("../3d/interactive/SegmentLabels3D.js"),{SegmentLabels3D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})}const n=import("../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:a}=await this._updatingHandles.addPromise(n);return this._isSegmentLabelsSetupStale(i,e,t)?null:new a({context:{view:this.view,editGeometryOperations:e,elevationInfo:L(this.hasZ,this.elevationInfo),labelOptions:t},visible:!0})})).promise}_isSegmentLabelsSetupStale(e,t,i){return e.aborted||this.editGeometryOperations!==t||this.sketchOptions?.labels!==i||!i.enabled||this.globalStateManager.segmentLabelsDisabled}};i([M()],ee.prototype,"_commandsSuspended",void 0),i([M()],ee.prototype,"_zOfLastUserInput",null),i([M()],ee.prototype,"_snappingVisualizer",void 0),i([M()],ee.prototype,"_segmentLabels",void 0),i([M()],ee.prototype,"_segmentLabelsImportTask",void 0),i([M()],ee.prototype,"_tooltipDependencies",null),i([M()],ee.prototype,"_editSessionManagerContext",null),i([M()],ee.prototype,"_densificationParameters",null),i([M({constructOnly:!0,nonNullable:!0})],ee.prototype,"view",void 0),i([M()],ee.prototype,"automaticManipulatorSelection",void 0),i([M()],ee.prototype,"updating",null),i([M()],ee.prototype,"coordinateHelper",null),i([M()],ee.prototype,"editGeometry",null),i([M()],ee.prototype,"editGeometryOperations",null),i([M()],ee.prototype,"unprocessedGeometry",null),i([M()],ee.prototype,"simplifiedGeometryPreview",null),i([M()],ee.prototype,"_suppressCoincidentPointOverlaysIn3D",null),i([M()],ee.prototype,"_shapeVisualGeometry",null),i([M()],ee.prototype,"_vertexVisualGeometry",null),i([M()],ee.prototype,"snappingManager",void 0),i([M()],ee.prototype,"sketchOptions",void 0),i([M()],ee.prototype,"elevationInfo",void 0),i([M()],ee.prototype,"hasZ",void 0),i([M()],ee.prototype,"defaultZ",void 0),i([M()],ee.prototype,"directionOptions",void 0),i([M()],ee.prototype,"canUndo",null),i([M()],ee.prototype,"canRedo",null),i([M()],ee.prototype,"pluginStack",null),i([M()],ee.prototype,"mostDownstreamPlugin",null),i([M()],ee.prototype,"mostUpstreamPlugin",null),i([M()],ee.prototype,"lastScreenPosition",void 0),i([M()],ee.prototype,"positionOfLastUserInput",null),i([M()],ee.prototype,"tooltipManager",void 0),i([M()],ee.prototype,"measurementManager",void 0),i([M()],ee.prototype,"globalStateManager",void 0),i([M()],ee.prototype,"editSessionManager",void 0),i([M()],ee.prototype,"lifecycleManager",void 0),i([M()],ee.prototype,"surfaceManager",void 0),i([M()],ee.prototype,"interactiveHandleManager",void 0),i([M()],ee.prototype,"renderer",void 0),i([M()],ee.prototype,"readPluginSetting",void 0),i([M()],ee.prototype,"movementCommandContext",null),i([M()],ee.prototype,"tooltip",null),i([M()],ee.prototype,"activeTooltipInfo",null),i([M()],ee.prototype,"helpMessageKey",null),i([M({constructOnly:!0})],ee.prototype,"enableVertexVisuals",void 0),ee=i([_("esri.views.draw.DrawTool")],ee);export{ee as DrawTool};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{watch as i,initial as
|
|
2
|
+
import{__decorate as t}from"tslib";import{isSome as e}from"../../../core/arrayUtils.js";import o from"../../../core/Error.js";import{makeHandle as n}from"../../../core/handleUtils.js";import{watch as i,syncAndInitial as r,initial as s}from"../../../core/reactiveUtils.js";import{property as a,subclass as p}from"../../../core/accessorSupport/decorators.js";import l from"../../../geometry/Point.js";import c from"../../../geometry/Polyline.js";import{isBezierCurve as h}from"../../../geometry/support/curves/curveUtils.js";import{PluginBase as d}from"./PluginBase.js";import{bezierEnableSplineBehaviorSettingKey as u}from"../support/types.js";const _=Symbol("left-vertex"),P=Symbol("right-vertex"),m=Symbol("cp1"),y=Symbol("cp2"),f=Symbol("endpoint"),g=Symbol("anchor");let C=class extends d{constructor(){super(...arguments),this._controlPoint1LineId=Symbol(),this._controlPoint2LineId=Symbol(),this._mirroredCp2VisualId=Symbol(),this.enableSplineBehavior=!0,this.state="placing-anchor"}get helpMessageKey(){switch(this.state){case"placing-control-point-1":return"curveBezierControlPoint1";case"placing-endpoint":return"curvePlaceEndPoint";case"placing-control-point-2":return"curveBezierControlPoint2";default:return"point"}}get test(){return{computeCurve:this._computeCurve.bind(this),recomputeAndApply:this._recomputeAndApply.bind(this),cp1LineSymbol:this._controlPoint1LineId,cp2LineSymbol:this._controlPoint2LineId,controlPointId:this._mirroredCp2VisualId}}start(t,e){super.start(t,e);const o=t.session,n=t.readBooleanSetting(u);null!=n&&(this.enableSplineBehavior=n),this.addHandles(i(()=>t.readBooleanSetting(u),t=>{null!=t&&(this.enableSplineBehavior=t)},r),this._ownHandlesKey),o.preserveSharedRedoAfterOperation=!0,this.ownPlacedLeftAnchor=e?.ownPlacedLeftAnchor,this.leftAnchor=o.getInformationAboutPoint(-1,-1)?.point;let s=e?.state;if(!this.leftAnchor&&this.ownPlacedLeftAnchor?(this.leftAnchor=this.ownPlacedLeftAnchor,o.appendOrReplacePoint(_,this.leftAnchor),o?.groupGeometryChanges()):this.leftAnchor&&"placing-anchor"===e?.state&&(s="placing-control-point-1",this.ownPlacedLeftAnchor=null),this.state=this.leftAnchor?s??"placing-control-point-1":"placing-anchor",this.controlPoint1=e?.controlPoint1,this.endPoint=e?.endPoint,this.controlPoint2=e?.controlPoint2,this.enableSplineBehavior&&"placing-control-point-1"===this.state&&!s){const t=o.getInformationAboutPoint(-1,-1);if(t?.curveInfo&&h(t.curveInfo)){const[e,n]=t.curveInfo.b[2],{spatialReference:i}=t.point,r=new l({x:e,y:n,spatialReference:i}),s=b(t.point,r);this.controlPoint1=s,o?.pushUndoStep(this._captureState()),this.state="placing-endpoint",o?.pushUndoStep(this._captureState())}}this.addHandles([i(()=>this._anchorCursor?.outputMapPosition,t=>{t&&(this.leftAnchor=this.ownPlacedLeftAnchor=t,this._session?.appendOrReplacePoint(_,t))}),i(()=>this._cp1Cursor?.outputMapPosition,t=>{t&&(this.controlPoint1=t,this._recomputeAndApply())}),i(()=>this._endpointCursor?.outputMapPosition,t=>{t&&(this.endPoint=t,this._recomputeAndApply())}),i(()=>this._cp2Cursor?.outputMapPosition,t=>{t&&(this.controlPoint2=t,this._recomputeAndApply())})],this._ownHandlesKey),this._applyState(this.state),this._setupRendering(t)}completeStep(){if(this._isComplete)return;const t=this._session?.peekUndoStep();if(t){const e=this._captureState();t&&t.state===e?.state&&(t.controlPoint1=e.controlPoint1,t.controlPoint2=e.controlPoint2,t.endPoint=e.endPoint,t.leftAnchor=e.leftAnchor)}else this._session?.pushUndoStep(this._captureState());try{switch(this._session.preserveSharedRedoAfterOperation=!1,this.state){case"placing-anchor":this._applyState(this.state="placing-control-point-1");break;case"placing-control-point-1":this._applyState(this.state="placing-endpoint");break;case"placing-endpoint":this._applyState(this.state="placing-control-point-2");break;case"placing-control-point-2":this._context?.requestComplete()}}finally{this._session.preserveSharedRedoAfterOperation=!0}this._session?.pushUndoStep(this._captureState())}beforeAttachPlugin(t){return{useStandaloneSession:!0}}suspend(){return this._captureState()}_applyState(t){const e=this._session;if(!e)throw new o("drawTool:invalid-state","Bezier: attempted to apply state while context invalid");switch(e.automaticRestart=!1,this.removeHandles(m),this.removeHandles(f),this.removeHandles(y),this.removeHandles(g),t){case"placing-anchor":e.automaticRestart=!0,this._setupAnchorCursor();break;case"placing-control-point-1":{const{ownPlacedLeftAnchor:t}=this;e.automaticRestart=!t,t&&e.groupGeometryChanges(),this._setupCP1Cursor();break}case"placing-endpoint":this._setupCP1Cursor(),this._setupEndpointCursor();break;case"placing-control-point-2":this._setupCP1Cursor(),this._setupEndpointCursor(),this._setupCP2Cursor()}}_setupAnchorCursor(){this._anchorCursor=this._context.createInteractiveHandle({defaultCaptureMode:"capture-always",inputMapPosition:this._context.positionOfLastUserInput,role:"primary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._anchorCursor&&(this._context?.removeInteractiveHandle(this._anchorCursor),this._anchorCursor=null)}),g)}_setupCP1Cursor(){const t="placing-control-point-1"===this.state?"capture-always":"grabbable-object";this._cp1Cursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.controlPoint1,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._cp1Cursor&&(this._context?.removeInteractiveHandle(this._cp1Cursor),this._cp1Cursor=null)}),m)}_setupEndpointCursor(){const t="placing-endpoint"===this.state?"capture-always":"grabbable-object";this._endpointCursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.endPoint??this.controlPoint1,role:"primary",selfSnappingEnabled:!0,snappingEnabled:!0}),this.addHandles(n(()=>{this._endpointCursor&&(this._context?.removeInteractiveHandle(this._endpointCursor),this._endpointCursor=null)}),f)}_setupCP2Cursor(){const t="placing-control-point-2"===this.state?"capture-always":"grabbable-object";this._cp2Cursor=this._context.createInteractiveHandle({defaultCaptureMode:t,inputMapPosition:"capture-always"===t?void 0:this.controlPoint2??this.endPoint??this._context.positionOfLastUserInput,role:"secondary",selfSnappingEnabled:!1,snappingEnabled:!0}),this.addHandles(n(()=>{this._cp2Cursor&&(this._context?.removeInteractiveHandle(this._cp2Cursor),this._cp2Cursor=null)}),y)}_computeCurve(){const{leftAnchor:t,controlPoint1:e,endPoint:o,controlPoint2:n,state:i}=this;return t?"placing-control-point-1"===i&&e?v(e,e,e):"placing-endpoint"===i&&e&&o?v(o,e,o):e&&o&&n?v(o,e,n,{flipControlPoint2:!0}):null:null}_recomputeAndApply(){const t=this._computeCurve();t&&this._session?.appendOrReplaceCurve(P,t)}_setupRendering(t){t.addOrUpdateVisual(this._controlPoint1LineId,{role:"constructionLine",state:"idle"}),t.addOrUpdateVisual(this._controlPoint2LineId,{role:"constructionLine",state:"idle"}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{role:"controlPoint",state:"idle"}),this.addHandles([i(()=>[this.controlPoint1,this.controlPoint2,this.endPoint,this.leftAnchor],([e,o,n,i])=>{const{state:r}=this;if(i&&e&&"placing-control-point-1"!==r&&"placing-anchor"!==r){const o=new c({paths:[[[i.x,i.y],[e.x,e.y]]],spatialReference:i.spatialReference});t.addOrUpdateVisual(this._controlPoint1LineId,{geometry:o})}else t.addOrUpdateVisual(this._controlPoint1LineId,{geometry:null});if(o&&n&&i){const e=b(n,o),i=new c({paths:[[[o.x,o.y],[e.x,e.y]]],spatialReference:o.spatialReference});t.addOrUpdateVisual(this._controlPoint2LineId,{geometry:i}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{geometry:e})}else t.addOrUpdateVisual(this._controlPoint2LineId,{geometry:null}),t.addOrUpdateVisual(this._mirroredCp2VisualId,{geometry:null})},s)],this._ownHandlesKey)}_captureState(){const{state:t,controlPoint1:e,controlPoint2:o,endPoint:n,leftAnchor:i,ownPlacedLeftAnchor:r}=this;return{state:t,controlPoint1:e,endPoint:n,controlPoint2:o,leftAnchor:i,ownPlacedLeftAnchor:r}}};function v(t,o,n,i){const r=[t.x,t.y,t.z,t.m].filter(e),s=i?.flipControlPoint2?b(t,n):n;return{b:[r,[o.x,o.y],[s.x,s.y]]}}function b(t,e){const{x:o,y:n,spatialReference:i}=t,{x:r,y:s}=e;return new l({x:o+(o-r),y:n+(n-s),spatialReference:i})}t([a()],C.prototype,"_anchorCursor",void 0),t([a()],C.prototype,"_cp1Cursor",void 0),t([a()],C.prototype,"_endpointCursor",void 0),t([a()],C.prototype,"_cp2Cursor",void 0),t([a()],C.prototype,"enableSplineBehavior",void 0),t([a()],C.prototype,"state",void 0),t([a()],C.prototype,"helpMessageKey",null),t([a()],C.prototype,"controlPoint1",void 0),t([a()],C.prototype,"controlPoint2",void 0),t([a()],C.prototype,"endPoint",void 0),t([a()],C.prototype,"leftAnchor",void 0),t([a()],C.prototype,"ownPlacedLeftAnchor",void 0),C=t([p("esri.views.draw.plugins.BezierSegmentPlugin")],C);export{C as BezierSegmentPlugin,v as createBezier,b as mirrorControlPoint};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{watch as t,syncAndInitial as n,sync as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../core/accessorSupport/decorators.js";import{PluginBase as s}from"./PluginBase.js";const
|
|
2
|
+
import{__decorate as e}from"tslib";import{watch as t,syncAndInitial as n,sync as i}from"../../../core/reactiveUtils.js";import{property as a,subclass as r}from"../../../core/accessorSupport/decorators.js";import{PluginBase as s}from"./PluginBase.js";import{freehandSnappingEnabledSettingKey as p}from"../support/types.js";const o=Symbol("primary-vertex");let l=class extends s{constructor(){super(...arguments),this.completeOnDragEnd=!0,this.snappingBehavior="never"}get _effectiveSnappingEnabled(){return"when-not-capturing"===this.snappingBehavior&&!this._interactiveHandle?.dragging}get helpMessageKey(){return this._interactiveHandle?.dragging?"freehandEnd":"freehandStart"}start(e){super.start(e);const{session:a,positionOfLastUserInput:r}=e;if(r&&a.appendOrReplacePoint(o,r),!this._interactiveHandle){const a=this._effectiveSnappingEnabled;this._interactiveHandle=e.createInteractiveHandle({defaultCaptureMode:"capture-when-engaged",snappingEnabled:a,selfSnappingEnabled:a},{disableDefaultXYFields:!0}),this.addHandles([t(()=>this._context?.readBooleanSetting(p),e=>{null!=e&&(this.snappingBehavior=e?"when-not-capturing":"never")},n),t(()=>[!!this._interactiveHandle?.dragging,this._effectiveSnappingEnabled],([e,t],n)=>{const i=!!n?.[0],a=this._interactiveHandle;a&&(a.snappingEnabled=t,a.selfSnappingEnabled=t),this.completeOnDragEnd&&!e&&i&&this._context?.requestComplete()},n),t(()=>this._interactiveHandle?.outputMapPosition,e=>{e&&!this._isComplete&&this._session?.appendOrReplacePoint(o,e,{forceAppend:!!this._interactiveHandle?.dragging})},i)],this._ownHandlesKey)}}};e([a()],l.prototype,"_interactiveHandle",void 0),e([a()],l.prototype,"_effectiveSnappingEnabled",null),e([a()],l.prototype,"completeOnDragEnd",void 0),e([a()],l.prototype,"snappingBehavior",void 0),e([a()],l.prototype,"helpMessageKey",null),l=e([r("esri.views.draw.plugins.FreehandSegmentPlugin")],l);export{l as FreehandSegmentPlugin};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as i}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{clone as e}from"../../../core/lang.js";import{watch as
|
|
2
|
+
import{__decorate as i}from"tslib";import{EventedAccessor as t}from"../../../core/Evented.js";import{clone as e}from"../../../core/lang.js";import{destroyMaybe as s}from"../../../core/maybe.js";import{watch as r,when as h}from"../../../core/reactiveUtils.js";import{property as o,subclass as a}from"../../../core/accessorSupport/decorators.js";import n from"../../../layers/GraphicsLayer.js";import c from"../../../symbols/SimpleFillSymbol.js";import l from"../../../symbols/SimpleLineSymbol.js";import p from"../../../symbols/SimpleMarkerSymbol.js";import{cloneMove as d}from"./drawUtils.js";import g from"./HighlightHelper.js";import{addUniqueLayer as v,findLayerView as m}from"./layerUtils.js";import{GraphicClickEvent as y,GraphicDoubleClickEvent as _,GraphicPointerDownEvent as f,GraphicPointerUpEvent as u,GraphicPointerOutEvent as w,GraphicPointerOverEvent as G,GraphicMoveStartEvent as b,GraphicMoveEvent as k,GraphicMoveStopEvent as O}from"./input/GraphicMoverEvents.js";import{ViewEventPriorities as x}from"../../input/InputManager.js";import{createScreenPointFromEvent as H}from"../../support/screenUtils.js";const M="indicator-symbols";let E=class extends t{constructor(i){super(i),this._activeGraphic=null,this._dragEvent=null,this._hoverGraphic=null,this._indicators=[],this._initialDragGeometry=null,this._layerViews=null,this.type="graphic-mover",this.callbacks={onGraphicClick(){},onGraphicDoubleClick(){},onGraphicMoveStart(){},onGraphicMove(){},onGraphicMoveStop(){},onGraphicPointerOver(){},onGraphicPointerOut(){},onGraphicPointerDown(){},onGraphicPointerUp(){}},this.enableMoveAllGraphics=!1,this.graphics=[],this.highlightName=null,this.highlightsEnabled=!1,this.indicatorsEnabled=!1,this._defaultLayer=new n({listMode:"hide",internal:!0,title:"GraphicMover highlight layer"}),this.layer=this._defaultLayer,this.view=null}initialize(){v(this.view,this.layer),this._highlightHelper=new g({view:this.view}),this.refresh(),this.addHandles([r(()=>this.graphics.length,()=>this.refresh()),h(()=>this.view?.ready,()=>{this.addHandles([this.view.on("immediate-click",i=>this._clickHandler(i),x.TOOL),this.view.on("double-click",i=>this._doubleClickHandler(i),x.TOOL),this.view.on("pointer-down",i=>this._pointerDownHandler(i),x.TOOL),this.view.on("pointer-move",i=>this._pointerMoveHandler(i),x.TOOL),this.view.on("pointer-up",i=>this._pointerUpHandler(i),x.TOOL),this.view.on("drag",i=>this._dragHandler(i),x.TOOL),this.view.on("key-down",i=>this._keyDownHandler(i),x.TOOL)])},{once:!0,initial:!0}),r(()=>this.view,i=>{this._highlightHelper.removeAll(),this._highlightHelper.view=i}),r(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()})])}destroy(){this._removeIndicators(),this.view.map?.remove(this.layer),s(this._defaultLayer),this.reset()}get state(){const i=this.view.ready,t=this.graphics.length>0,e=this._activeGraphic;return i&&t?e?"moving":"active":i?"ready":"disabled"}refresh(){this.reset(),this._setup()}reset(){this._activeGraphic=null,this._hoverGraphic=null,this._dragEvent=null,this._highlightHelper.removeAll()}updateGeometry(i,t){const e=this.graphics[i];e&&(e.set("geometry",t),this._setUpIndicators())}_setup(){this._setUpHighlights(),this._setUpIndicators(),this._syncLayerViews()}_clickHandler(i){const t=this._findTargetGraphic(H(i));if(t){const e=new y(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-click",e),this.callbacks.onGraphicClick?.(e)}}_doubleClickHandler(i){const t=this._findTargetGraphic(H(i));if(t){const e=new _(t,this.graphics.indexOf(t),i.x,i.y,i);this.emit("graphic-double-click",e),this.callbacks.onGraphicDoubleClick?.(e)}}_pointerDownHandler(i){const t=this._findTargetGraphic(H(i));if(t){this._activeGraphic=t;const{x:e,y:s}=i,r=new f(t,this.graphics.indexOf(t),e,s,i);this.emit("graphic-pointer-down",r),this.callbacks.onGraphicPointerDown?.(r)}else this._activeGraphic=null}_pointerUpHandler(i){if(this._activeGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._activeGraphic),r=new u(this._activeGraphic,s,t,e,i);this.emit("graphic-pointer-up",r),this.callbacks.onGraphicPointerUp?.(r),this._hoverGraphic=this._activeGraphic}}_pointerMoveHandler(i){if(this._dragEvent)return;const t=this._findTargetGraphic(H(i));if(t){const{x:e,y:s}=i;if(this._hoverGraphic){if(this._hoverGraphic===t)return;const r=this.graphics.indexOf(this._hoverGraphic),h=new w(this.graphics[r],r,e,s,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",h),this.callbacks.onGraphicPointerOut?.(h)}const r=this.graphics.indexOf(t),h=new G(t,r,e,s,i);return this._hoverGraphic=t,this.emit("graphic-pointer-over",h),void this.callbacks.onGraphicPointerOver?.(h)}if(this._hoverGraphic){const{x:t,y:e}=i,s=this.graphics.indexOf(this._hoverGraphic),r=new w(this.graphics[s],s,t,e,i);this._hoverGraphic=null,this.emit("graphic-pointer-out",r),this.callbacks.onGraphicPointerOut?.(r)}}_dragHandler(i){if("start"!==i.action&&!this._dragEvent||!this._activeGraphic?.geometry)return;"start"===i.action&&this._removeIndicators(),i.stopPropagation();const{action:t,x:s,y:r}=i,h=this.graphics.indexOf(this._activeGraphic),o=this._dragEvent?s-this._dragEvent.x:0,a=this._dragEvent?r-this._dragEvent.y:0,n=s-i.origin.x,c=r-i.origin.y,l="start"===t?this._activeGraphic.geometry:this._initialDragGeometry,p=d(l,n,c,this.view);if(this._activeGraphic.geometry=p,this.enableMoveAllGraphics&&this.graphics.forEach(i=>{i!==this._activeGraphic&&(i.geometry=d(i.geometry,o,a,this.view))}),this._dragEvent=i,"start"===t){this._initialDragGeometry=e(l);const t=new b(this._activeGraphic,this.graphics,h,s,r,o,a,n,c,i);this.emit("graphic-move-start",t),this.callbacks.onGraphicMoveStart?.(t),t.defaultPrevented&&this._activeGraphic.set("geometry",l)}else if("update"===t){const t=new k(this._activeGraphic,this.graphics,h,s,r,o,a,n,c,i);this.emit("graphic-move",t),this.callbacks.onGraphicMove?.(t),t.defaultPrevented&&(this._activeGraphic.geometry=l)}else{const t=new O(this._activeGraphic,this.graphics,h,s,r,o,a,n,c,i);this._dragEvent=null,this._activeGraphic=null,this._setUpIndicators(),this.emit("graphic-move-stop",t),this.callbacks.onGraphicMoveStop?.(t),t.defaultPrevented&&(this.graphics[h].set("geometry",this._initialDragGeometry),this._setUpIndicators()),this._initialDragGeometry=null}}_keyDownHandler(i){"a"!==i.key&&"d"!==i.key&&"n"!==i.key||"moving"!==this.state||i.stopPropagation()}_findTargetGraphic(i){const t=this.view.toMap(i),e=this.graphics;this._syncLayerViews();const s=this._layerViews.flatMap(i=>"graphicsViews"in i?Array.from(i.graphicsViews(),i=>i.hitTest(t)).flat():i.graphicsView.hitTest(t)).filter(i=>e.includes(i)).sort((i,t)=>e.indexOf(i)-e.indexOf(t));return s.length?s[0]:null}_syncLayerViews(){this._layerViews=[];const i=new Set;for(const t of this.graphics){const e=m(this.view,t.layer);e&&i.add(e)}this._layerViews=[...i]}_setUpHighlights(){this.highlightsEnabled&&this.graphics.length&&this._highlightHelper.add(this.graphics,this.highlightName)}_setUpIndicators(){if(this._removeIndicators(),this.indicatorsEnabled){for(const i of this.graphics){const t=i.clone();t.symbol=U(i),this._indicators.push(t),this.addHandles(r(()=>i.symbol,()=>this._setUpIndicators()),M)}this.layer.addMany(this._indicators)}}_removeIndicators(){this.removeHandles(M),this._indicators.length&&(this.layer.removeMany(this._indicators),this._indicators.forEach(i=>i.destroy()),this._indicators=[])}};function U(i){const t=12;if(null==i.symbol)return null;switch(i.symbol.type){case"cim":return new p({style:"circle",size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}});case"picture-marker":{const{xoffset:t,yoffset:e,height:s,width:r}=i.symbol,h=s===r?r:Math.max(s,r);return new p({xoffset:t,yoffset:e,size:h,style:"square",color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-marker":{const{xoffset:t,yoffset:e,size:s,style:r}=i.symbol;return new p({xoffset:t,yoffset:e,style:"circle"===r?"circle":"square",size:s+2,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}case"simple-fill":return new c({color:[0,0,0,0],outline:{style:"dash",color:[255,127,0,1],width:1}});case"simple-line":return new l({color:[255,127,0,1],style:"dash",width:1});case"text":{const{xoffset:e,yoffset:s}=i.symbol;return new p({xoffset:e,yoffset:s,size:t,color:[0,0,0,0],outline:{color:[255,127,0,1],width:1}})}default:return null}}i([o()],E.prototype,"_activeGraphic",void 0),i([o({readOnly:!0})],E.prototype,"type",void 0),i([o()],E.prototype,"callbacks",void 0),i([o()],E.prototype,"enableMoveAllGraphics",void 0),i([o()],E.prototype,"graphics",void 0),i([o()],E.prototype,"highlightName",void 0),i([o()],E.prototype,"highlightsEnabled",void 0),i([o()],E.prototype,"indicatorsEnabled",void 0),i([o()],E.prototype,"_defaultLayer",void 0),i([o()],E.prototype,"layer",void 0),i([o({readOnly:!0})],E.prototype,"state",null),i([o()],E.prototype,"view",void 0),E=i([a("esri.views.draw.support.GraphicMover")],E);const L=E;export{L as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import{makeHandle as o}from"../../../core/handleUtils.js";import{createScalar as a,createLength as i,toUnit as s}from"../../../core/quantity.js";import{generateUUID as n}from"../../../core/uuid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{isWebMercator as p,isGeographic as u}from"../../../geometry/support/spatialReferenceUtils.js";import{createViewAlignedCoordinateSystem as c}from"./surfaceCoordinateSystems.js";import{knownFieldDisplayOrders as m}from"./types.js";import{createGeographicCoordinate as g}from"../../interactive/tooltip/fields/parsingAndFormattingUtils.js";import{elevationFromPoint as h}from"../../support/euclideanLengthMeasurementUtils.js";const f={x:m.Coordinates+10,y:m.Coordinates+11,elevation:m.Coordinates+12};let w=class extends t{constructor(e){super(e)}normalizeCtorArgs(e){const{drawTool:t,plugin:r,...o}=e;return{_drawTool:t,_plugin:r,...o}}get positionOfLastUserInput(){return this._drawTool.positionOfLastUserInput}getSession(e){return this._drawTool.editSessionManager.getSession(e)}createInteractiveHandle(e,t){const o=this._drawTool.interactiveHandleManager,i=this._drawTool.tooltipManager,s=this._plugin,l=this.session,d=this._drawTool.coordinateHelper;if(!o||!i)throw new r("draw-tool:interactive-handle-missing-dependencies","Attempted to set up an interactive handle without required dependencies.");const c=e.name??n(),m=e.defaultCaptureMode??"capture-always",h=o.registerHandle(s,{...e,name:c,editSession:l,defaultCaptureMode:m,captureMode:m});if(this._drawTool.addPromise(o.setupManipulatorForHandle(h,this._drawTool.lastScreenPosition,this._drawTool.movementCommandContext)),!t?.disableDefaultXYFields){const e=d.spatialReference;p(e)||u(e)?(i.createMeasuredField(s,{id:Symbol(`tooltip-long-${c}`),preset:"longitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.longitude),fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-lat-${c}`),preset:"latitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.latitude),fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})):(i.createMeasuredField(s,{id:Symbol(`tooltip-x-${c}`),preset:"x",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.x):null,fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-y-${c}`),preset:"y",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.y):null,fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})),this._drawTool.hasZ&&"primary"===h.role&&i.createMeasuredField(s,{id:Symbol(`tooltip-z-${c}`),preset:"elevation",getMeasurementInput:()=>h.outputMapPosition,measure:async(e,t)=>this.measureElevation(e,t.inputUnitInfos.verticalLength.unit),fieldProperties:{displayOrder:f.elevation},fieldFilters:{appliesToHandlesWithName:c}})}return h}removeInteractiveHandle(e){const t=e;this._drawTool.interactiveHandleManager?.unregisterHandle(this._plugin,t)}createConstraint(e,t){this._drawTool.interactiveHandleManager?.registerCustomConstraint(this._plugin,e,t)}removeConstraint(e){this._drawTool.interactiveHandleManager?.unregisterCustomConstraint(this._plugin,e)}createCustomField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createCustomField(this._plugin,e)}createMeasuredField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createMeasuredField(this._plugin,e)}requestComplete(){this._drawTool.complete(this._plugin)}requestCancel(e){this._drawTool.lifecycleManager.cancel(this._plugin)}requestBeginDownstreamPlugin(e,t){this._drawTool.lifecycleManager.begin([e],this._plugin,t?.cancelExisting)}async measureLength(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureLength(i,t,e,o)}async measureArea(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureArea(i,t,e,o)}async measureDistance(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureDistance(i,t,e,o)}measureElevation(e,t){const r=this._drawTool;let o=h(e);if(!o){const e=r.surfaceManager?.metersPerVerticalUnit;e&&(o=i(r.defaultZ*e,"meters"))}return t&&o&&o.unit!==t?s(o,t):o}getGlobalState(){return this._drawTool.globalStateManager.getGlobalState()}setGlobalState(e,t){this._drawTool.globalStateManager.setGlobalState(this._plugin,e,t)}addOrUpdateGraphic(e,t){const{_plugin:r,_drawTool:a}=this,i=a.renderer;i?.addOrUpdateGraphic(e,t),r.hasHandles(e)||r.addHandles(o(()=>i?.removeGraphic(e)),e)}addOrUpdateVisual(e,t){const r=this._plugin,a=this._drawTool.renderer;a?.addOrUpdateVisual(e,t),r.hasHandles(e)||r.addHandles(o(()=>a?.removeVisual(e)),e)}removeGraphic(e){this._plugin.removeHandles(e)}removeVisual(e){this._plugin.removeHandles(e)}getViewInformation(){return this._drawTool.view}getViewAlignedSurfaceCoordinateSystem(e){const{view:t,coordinateHelper:r}=this._drawTool;return t&&r?c(t,r.pointToVector(e)):null}};e([l()],w.prototype,"_plugin",void 0),e([l()],w.prototype,"_drawTool",void 0),e([l({nonNullable:!0})],w.prototype,"session",void 0),e([l()],w.prototype,"positionOfLastUserInput",null),w=e([d("esri.views.draw.support.PluginContext")],w);export{w as PluginContext};
|
|
2
|
+
import{__decorate as e}from"tslib";import t from"../../../core/Accessor.js";import r from"../../../core/Error.js";import{makeHandle as o}from"../../../core/handleUtils.js";import{createScalar as a,createLength as i,toUnit as s}from"../../../core/quantity.js";import{generateUUID as n}from"../../../core/uuid.js";import{property as l}from"../../../core/accessorSupport/decorators/property.js";import{subclass as d}from"../../../core/accessorSupport/decorators/subclass.js";import{isWebMercator as p,isGeographic as u}from"../../../geometry/support/spatialReferenceUtils.js";import{createViewAlignedCoordinateSystem as c}from"./surfaceCoordinateSystems.js";import{knownFieldDisplayOrders as m}from"./types.js";import{createGeographicCoordinate as g}from"../../interactive/tooltip/fields/parsingAndFormattingUtils.js";import{elevationFromPoint as h}from"../../support/euclideanLengthMeasurementUtils.js";const f={x:m.Coordinates+10,y:m.Coordinates+11,elevation:m.Coordinates+12};let w=class extends t{constructor(e){super(e)}normalizeCtorArgs(e){const{drawTool:t,plugin:r,...o}=e;return{_drawTool:t,_plugin:r,...o}}get positionOfLastUserInput(){return this._drawTool.positionOfLastUserInput}getSession(e){return this._drawTool.editSessionManager.getSession(e)}readBooleanSetting(e){const t=this._plugin.configuration?.uniqueId;if(t)return this._drawTool.readPluginSettingValue(t,e)}createInteractiveHandle(e,t){const o=this._drawTool.interactiveHandleManager,i=this._drawTool.tooltipManager,s=this._plugin,l=this.session,d=this._drawTool.coordinateHelper;if(!o||!i)throw new r("draw-tool:interactive-handle-missing-dependencies","Attempted to set up an interactive handle without required dependencies.");const c=e.name??n(),m=e.defaultCaptureMode??"capture-always",h=o.registerHandle(s,{...e,name:c,editSession:l,defaultCaptureMode:m,captureMode:m});if(this._drawTool.addPromise(o.setupManipulatorForHandle(h,this._drawTool.lastScreenPosition,this._drawTool.movementCommandContext)),!t?.disableDefaultXYFields){const e=d.spatialReference;p(e)||u(e)?(i.createMeasuredField(s,{id:Symbol(`tooltip-long-${c}`),preset:"longitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.longitude),fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-lat-${c}`),preset:"latitude",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>g(e?.latitude),fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})):(i.createMeasuredField(s,{id:Symbol(`tooltip-x-${c}`),preset:"x",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.x):null,fieldProperties:{displayOrder:f.x},fieldFilters:{appliesToHandlesWithName:c}}),i.createMeasuredField(s,{id:Symbol(`tooltip-y-${c}`),preset:"y",getMeasurementInput:()=>h.outputMapPosition,measure:async e=>e?a(e.y):null,fieldProperties:{displayOrder:f.y},fieldFilters:{appliesToHandlesWithName:c}})),this._drawTool.hasZ&&"primary"===h.role&&i.createMeasuredField(s,{id:Symbol(`tooltip-z-${c}`),preset:"elevation",getMeasurementInput:()=>h.outputMapPosition,measure:async(e,t)=>this.measureElevation(e,t.inputUnitInfos.verticalLength.unit),fieldProperties:{displayOrder:f.elevation},fieldFilters:{appliesToHandlesWithName:c}})}return h}removeInteractiveHandle(e){const t=e;this._drawTool.interactiveHandleManager?.unregisterHandle(this._plugin,t)}createConstraint(e,t){this._drawTool.interactiveHandleManager?.registerCustomConstraint(this._plugin,e,t)}removeConstraint(e){this._drawTool.interactiveHandleManager?.unregisterCustomConstraint(this._plugin,e)}createCustomField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createCustomField(this._plugin,e)}createMeasuredField(e){if(!this._drawTool.tooltipManager)throw new r("draw-tool:tooltip-manager-missing","Attempted to create a field without access to a tooltip manager.");return this._drawTool.tooltipManager.createMeasuredField(this._plugin,e)}requestComplete(){this._drawTool.complete(this._plugin)}requestCancel(e){this._drawTool.lifecycleManager.cancel(this._plugin)}requestBeginDownstreamPlugin(e,t){this._drawTool.lifecycleManager.begin([e],this._plugin,t?.cancelExisting)}async measureLength(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureLength(i,t,e,o)}async measureArea(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureArea(i,t,e,o)}async measureDistance(e,t,r,o){const{_drawTool:a,_plugin:i}=this;if("tooltip"!==r||a.tooltipManager?.effectiveEnabled)return await a.measurementManager.measureDistance(i,t,e,o)}measureElevation(e,t){const r=this._drawTool;let o=h(e);if(!o){const e=r.surfaceManager?.metersPerVerticalUnit;e&&(o=i(r.defaultZ*e,"meters"))}return t&&o&&o.unit!==t?s(o,t):o}getGlobalState(){return this._drawTool.globalStateManager.getGlobalState()}setGlobalState(e,t){this._drawTool.globalStateManager.setGlobalState(this._plugin,e,t)}addOrUpdateGraphic(e,t){const{_plugin:r,_drawTool:a}=this,i=a.renderer;i?.addOrUpdateGraphic(e,t),r.hasHandles(e)||r.addHandles(o(()=>i?.removeGraphic(e)),e)}addOrUpdateVisual(e,t){const r=this._plugin,a=this._drawTool.renderer;a?.addOrUpdateVisual(e,t),r.hasHandles(e)||r.addHandles(o(()=>a?.removeVisual(e)),e)}removeGraphic(e){this._plugin.removeHandles(e)}removeVisual(e){this._plugin.removeHandles(e)}getViewInformation(){return this._drawTool.view}getViewAlignedSurfaceCoordinateSystem(e){const{view:t,coordinateHelper:r}=this._drawTool;return t&&r?c(t,r.pointToVector(e)):null}};e([l()],w.prototype,"_plugin",void 0),e([l()],w.prototype,"_drawTool",void 0),e([l({nonNullable:!0})],w.prototype,"session",void 0),e([l()],w.prototype,"positionOfLastUserInput",null),w=e([d("esri.views.draw.support.PluginContext")],w);export{w as PluginContext};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{throwIfAborted as c}from"../../../core/promiseUtils.js";import{pausable as d,when as m,watch as v,initial as u,sync as y}from"../../../core/reactiveUtils.js";import{property as _,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import G from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as x,toGeometry as M}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as S,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{fromJSON as E}from"../../../geometry/support/jsonUtils.js";import{isPoint as w}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as I}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as V,toEllipticArc7 as k}from"../../../geometry/support/curves/circularArcUtils.js";import{getPaths as H,getEndpoint as O,isCircularArc as L,isEllipticArc4 as P,isBezierCurve as T,isCoordinate as R,cloneCurve as A,isEllipticArc7 as j}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as U}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as F}from"../../../geometry/support/curves/mathUtils.js";import D from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as z}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as K}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as N,getZFromVertexSnappingCandidates as W,cloneMove as $}from"./drawUtils.js";import q from"./GraphicMover.js";import X from"./HighlightHelper.js";import{addUniqueLayer as Y,isConnectedReshapeSupportedLayer as Z}from"./layerUtils.js";import{createTooltipInfos as B,connectTooltip as J,updateTranslateTooltipInfo as Q,updateTranslateVertexTooltipInfo as tt}from"./reshapeTooltipUtils.js";import{defaultSymbols as et,createMidpointGraphics as it,createVertexGraphics as st,createCurveControlPointGraphics as ot,createCurveConstructionLineGraphics as rt,attributeKeys as nt,getMidpoint as at,controlPointKinds as ht,fastCloneGeometry as pt,saveUpdatedCurveOrCoordinate as lt,toolIdAttribute as ct,splitCurve as dt,isSingleSegmentCircle as mt,isSingleSegmentEllipse as vt}from"./reshapeUtils.js";import{ViewEventPriorities as ut}from"../../input/InputManager.js";import{createCoordinateHelper as yt}from"../../interactive/coordinateHelper.js";import{sketchKeys as _t}from"../../interactive/keybindings.js";import{EditGeometryOperations as gt}from"../../interactive/editGeometry/EditGeometryOperations.js";import ft from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as Gt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as bt,enterInputModeIfAvailable as xt}from"../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Mt}from"../../support/GeometryWorkerHandle.js";const St=Symbol(),Ct={mode:"on-the-ground",offset:0};let Et=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._primaryGraphicMoving=!1,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._relatedGraphicIndex=null,this._updatingHandles=new f,this._measurementWorker=new Mt({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.filterVerticesEnabled=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=et,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new ft,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new X({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=d(()=>this.graphic?.geometry,t=>{if(!t||!0===this._primaryGraphicMoving)return;const e=new Set(this.selectedManipulators.map(Rt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t)),this.curveControlPointGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},y),this.tooltip=bt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=B(this.sketchOptions),this.addHandles([m(()=>t?.ready,()=>{const{layer:t,view:e}=this;Y(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ut.TOOL))},{once:!0,initial:!0}),v(()=>this.graphic,()=>this.refresh()),...this._effectiveFilterVerticesEnabled?[v(()=>[this.view.viewpoint,this.view.stationary],()=>{this.view.stationary&&this.refresh()})]:[],v(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),v(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),v(()=>this.enableMidpoints,()=>this.refresh()),J(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),v(()=>this.sketchOptions.labels.enabled,t=>{this._segmentLabels?this._segmentLabels.visible=t:this._setUpGeometryHelper()}),v(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??yt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _effectiveFilterVerticesEnabled(){return"2d"===this.view?.type&&this.filterVerticesEnabled}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:t,activeTooltipInfo:e,graphic:i}=this;return{sketchOptions:t,activeTooltipInfo:e,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}get updating(){return this._updatingHandles.updating||!!this._segmentLabels?.updating}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(t){if(this._reset(),this._setup(),t){for(const e of this.vertexGraphics)t.has(Rt(e))&&this._addToSelection(e);for(const e of this.curveControlPointGraphics)t.has(Rt(e))&&this._addToSelection(e)}}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&S(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;if(null==t||"mesh"===t.type||"extent"===t.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(t):this._editGeometryOperations=gt.fromGeometry(t,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new D({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new Gt({editGeometryOperations:i,elevationInfo:Ct,pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new z(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(St)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view?.map&&this.view.map.layers.remove(this._snappingGraphicsLayer),this._snappingGraphicsLayer.destroy()),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;this._relatedGraphicIndex=null,t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=wt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=it(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type,this.filterVerticesEnabled?this.view.extent:null,this.filterVerticesEnabled?this.view.resolution:-1);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){if(this._removeVertexGraphics(),this._effectiveFilterVerticesEnabled){const e=st(t,this.symbols,this._coordinateHelper,this.view.extent,this.view.resolution);this._relatedGraphicIndex=e.graphicIndex,this.vertexGraphics.addMany(e.graphics),this.layer.addMany(e.graphics)}else{const e=st(t,this.symbols,this._coordinateHelper,null,-1).graphics;this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}}_setupCurveGraphics(t){this._removeCurveGraphics();const e=ot(t,this.symbols,this._coordinateHelper),i=rt(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}async _setupSegmentLabels(){const t=this._editGeometryOperations,e=this.sketchOptions.labels.enabled;if(t&&this._segmentLabels?.context?.editGeometryOperations===t&&e||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&t&&e){const e=this._segmentLabelsImportTask??=i(async t=>{const e=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(e);return t.aborted?null:i}),s=await e.promise;if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:t,elevationInfo:Ct,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[nt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new q({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new K({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?jt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._primaryGraphicMoving=!0,this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),this._effectiveFilterVerticesEnabled&&this._resetGraphics(this.layer),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,Ut(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const{dxMap:e,dyMap:o}=N(i,s,this.view);if(this._effectiveFilterVerticesEnabled){if(this.selectedManipulators.length>0){const t=this.selectedManipulators.toArray();this.selectedManipulators.removeAll();for(const e of t){if("point"===e.geometry?.type){const{pathIndex:t,pointIndex:i}=e.attributes,s=H(n)[t][i];if(s){const t=O(s);e.geometry=this._coordinateHelper.arrayToPoint(t)}}this._addToSelection(e.clone())}}}else{const t=wt(n);this._updateVertexGraphicLocations(t)}this._connectedReshapeManager?.translate(e,o,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(this._primaryGraphicMoving=!1,!e)return;const{dx:i,dy:s,graphic:o,x:r,y:n}=t,{operationType:a}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>this._handleVertexSnap(o,{x:r,y:n},a))}_afterMoveStop(t,e){if(this._effectiveFilterVerticesEnabled&&"move"===e){const t=new Set;for(const e of this.selectedManipulators)t.add(Rt(e));return this.refresh(t),void this._updateTooltip()}if(this._isMidpoint(t)||t.getAttribute(nt.curveFromStraightEdgeFlag))return this.refresh(),void this._connectedReshapeManager?.finish();this._updateTooltip(this._isVertex(t)?t:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null}_handleVertexSnap(t,e,s){const o=t.geometry,r=this.snappingManager?.getVertexCandidates(),n=this.callbacks.onVertexSnap,a=()=>"move"===s?this._emitMoveStopEvent():this._emitReshapeStopEvent(t);if(!(n&&o&&w(o)&&r&&0!==r.length))return a(),void this._afterMoveStop(t,s);p(this._snappingTask),this._snappingTask=i(async i=>{try{const s=await n(o,e,r);c(i);const a=E(s);this._syncGeometryAfterVertexMove(t,a,0,0),t.geometry=a}finally{a(),this._afterMoveStop(t,s)}})}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t,e){const{_coordinateHelper:i}=this;if(e)for(const s of this.midpointGraphics){const{pathIndex:o,pointIndexStart:r,pointIndexEnd:n}=s.attributes;if(!e.has(o))continue;const a=e.get(o);if(!a.has(r)&&!a.has(n))continue;const h=t[o];s.geometry=new G(at(h[r],h[n],i))}else for(const s of this.midpointGraphics){const{pathIndex:e,pointIndexStart:o,pointIndexEnd:r}=s.attributes,n=t[e];s.geometry=new G(at(n[o],n[r],i))}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Tt(s);null!=t&&null!=e&&s.getAttribute(nt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Tt(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(L(r)||P(r)){const i=O(t[e][o-1]),n=L(r)?V(i,r):U(i,r),[a,h]=I(n,.25);s.geometry=new G({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(T(r)){const t=s.getAttribute(nt.controlPointKind),[e,i]=t===ht.bezier.cp1?r.b[1]:r.b[2];s.geometry=new G({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(nt.controlPointKind),[o,r]=Tt(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===ht.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Tt(t);s===e&&o>=i&&t.setAttribute(nt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(nt.pathIndex)!==e)continue;const t=o.getAttribute(nt.pointIndexStart);t>=i&&(o.setAttribute(nt.pointIndexStart,t+1),o.setAttribute(nt.pointIndexEnd,o.getAttribute(nt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Tt(t);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&w(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});if(p.valid){const i=p.apply();i.z=W(this.snappingManager)??i.z,this._stagedVertex=i,this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r()}})}else{const i=null!=this._stagedVertex?new G(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}else r()}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=pt(this._editGeometryOperations?.data.geometry);if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);let p=null;if(h){const t=n.getZ(a);p=[h.pos[0],h.pos[1]];const e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){p&&!this._isVertex(t)&&(p=null);const o=n.spatialReference,[a,h]=Tt(t);let l=It(r);const c=n.pointToArray(e);if(this._updateGeometryFromGraphic(t,l,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)){const e=new Map;e.set(a,new Set([h])),l=this._moveRelatedCoordinates(l,t,c,e,p),l=this._moveSelectedHandleCoordinates(l,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(l,e),this._updateCurveGraphicLocations(l)}else this._isMidpoint(t)&&this._updateCurveGraphicLocations(l);lt(r,l)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_syncEditGeometryOperations(t){const e=this._editGeometryOperations?.trySetGeometry(t);e||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(t,e,i,s,o){if(this._effectiveFilterVerticesEnabled&&this._relatedGraphicIndex&&o){const r=this._relatedGraphicIndex.search({minX:o[0],maxX:o[0],minY:o[1],maxY:o[1]});for(const n of r)n.coordinate[0]===o[0]&&n.coordinate[1]===o[1]&&n.graphic&&(s&&a(s,n.pathIndex,()=>new Set).add(n.pointIndex),Pt(t,n.pathIndex,n.pointIndex,i,this._coordinateHelper.spatialReference),this._relatedGraphicIndex.remove(n),n.coordinate[0]=e.geometry.x,n.coordinate[1]=e.geometry.y,n.graphic.geometry=e.geometry,this._relatedGraphicIndex.insert(n));return t}const{relatedGraphicIndices:r}=e.attributes,n=this._coordinateHelper.spatialReference;if(!r?.length)return t;for(const h of r){const o=this.vertexGraphics.at(h),[r,p]=Tt(o);s&&a(s,r,()=>new Set).add(p),Pt(t,r,p,i,n),o.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Tt(n),h=n.getAttribute(nt.relatedGraphicIndices),p=$(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,l,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Tt(e);Pt(t,s,o,l,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?kt(e,i,s,[o[0],o[1]],t.getAttribute(nt.controlPointKind)):(Pt(e,i,s,o,r),n&&(0===s?Pt(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(St),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=pt(i),o=[],{[nt.pathIndex]:r,[nt.pointIndexStart]:n,[nt.pointIndexEnd]:a}=e.attributes,h=C(e.geometry),p=0===a?n+1:a;e.attributes={[nt.tool]:ct,[nt.pathIndex]:r,[nt.pointIndex]:p,[nt.relatedGraphicIndices]:[]};const l=It(s),c=l[r][a];if(R(c)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(l[r][p]);l[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(nt.controlPointKind,ht.circle.interior),e.setAttribute(nt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),lt(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(l[r][n]),e=dt(t,c,.5,this._coordinateHelper);l[r].splice(a,1,...e),o.push({coordinates:O(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(t){const e=At(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&xt(t,this.tooltip)||_t.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),t.stopPropagation())}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=pt(e);let r=It(o);const n=[],a=At(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!R(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);lt(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),St)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,Q(i,o,this._tooltipsContext,this._updatingHandles,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,tt(i,o,n,this._tooltipsContext,this._updatingHandles,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function wt(t){let e=It(t);e=e.map(t=>t.slice());for(const i of e)for(let t=0;t<i.length;t++)i[t]=A(i[t]);if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!R(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function It(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Vt(t,e,i,s){const o=t[e][i];if(L(o))o.c[1]=s;else if(P(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function kt(t,e,i,s,o){switch(o){case ht.circle.interior:Vt(t,e,i,s);break;case ht.bezier.cp1:t[e][i].b[1]=s;break;case ht.bezier.cp2:t[e][i].b[2]=s}}function Ht(t,e){return t<1e-8*e}function Ot(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[l,c]=n,d=l-h,m=c-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],b=_*G-g*f,x=(d**2+m**2)/2;if(Ht(Math.abs(b),x))return[(h+l)/2,(p+c)/2];const[M,S]=[G/b*x,-f/b*x],C=M**2+S**2,[E,w]=[d/2-M,m/2-S];if(Ht(E**2+w**2,C)){const[t,e]=v?[-S,M]:[S,-M];return[t+M+h,e+S+p]}const I=Math.sqrt((M**2+S**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*I+M+h,w*I+S+p]}function Lt(t,e,i){const s=x(new b({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=M(s,i),r=o[0][1];return j(r)?r:k(t,r)}function Pt(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(mt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(vt(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=F(l,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=O(r);if(R(r))r.splice(0,r.length,...s);else if(T(r))r.b[0].splice(0,r.b[0].length,...s);else if(L(r)||P(r)){const o=O(t[e][i-1]),n=L(r)?V(o,r):U(o,r);t[e].splice(i,1,{c:[[...s],Ot(o,n,s,!0)]})}else if(j(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Lt(n,r,o).a}if(n&&!R(n)&&!T(r))if(L(n)||P(n)){const o=O(n),r=L(n)?V(a,n):U(a,n);t[e].splice(i+1,1,{c:[o,Ot(o,r,s,!1)]})}else if(j(n)){const t=O(r);n.a=Lt(t,n,o).a}}function Tt({attributes:t}){return[t?.[nt.pathIndex]||0,t?.[nt.pointIndex]||0]}function Rt({attributes:t}){return`${t?.[nt.pathIndex]}-${t?.[nt.pointIndex]}-${t?.[nt.controlPointKind]??"vertex"}`}function At(t){return t instanceof e?[t]:[...t]}function jt(t){const e=t.sourceLayer??t.layer;return Z(e)?{graphic:t,layer:e}:null}function Ut(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[nt.pathIndex],vertexIndex:t[nt.pointIndex]}))}t([_()],Et.prototype,"_activeOperationInfo",void 0),t([_()],Et.prototype,"_connectedReshapeManager",void 0),t([_()],Et.prototype,"_coordinateHelper",null),t([_()],Et.prototype,"_editGeometryOperations",void 0),t([_()],Et.prototype,"_effectiveFilterVerticesEnabled",null),t([_()],Et.prototype,"_primaryGraphicMoving",void 0),t([_()],Et.prototype,"_segmentLabels",void 0),t([_()],Et.prototype,"test",null),t([_()],Et.prototype,"_segmentLabelsImportTask",void 0),t([_()],Et.prototype,"_updatingHandles",void 0),t([_()],Et.prototype,"_selectedManipulator",null),t([_()],Et.prototype,"_tooltipsContext",null),t([_()],Et.prototype,"callbacks",void 0),t([_()],Et.prototype,"connectedReshapeProviders",void 0),t([_()],Et.prototype,"enableMidpoints",void 0),t([_()],Et.prototype,"enableCurveOnMidpoint",void 0),t([_()],Et.prototype,"enableMovement",void 0),t([_()],Et.prototype,"enableVertices",void 0),t([_()],Et.prototype,"filterVerticesEnabled",void 0),t([_()],Et.prototype,"graphic",void 0),t([_()],Et.prototype,"highlightName",void 0),t([_()],Et.prototype,"highlightsEnabled",void 0),t([_()],Et.prototype,"layer",void 0),t([_()],Et.prototype,"snappingManager",void 0),t([_({readOnly:!0})],Et.prototype,"state",null),t([_()],Et.prototype,"symbols",void 0),t([_()],Et.prototype,"tooltip",void 0),t([_()],Et.prototype,"tooltipInfos",void 0),t([_()],Et.prototype,"activeTooltipInfo",void 0),t([_()],Et.prototype,"updating",null),t([_({type:ft})],Et.prototype,"sketchOptions",void 0),t([_({readOnly:!0})],Et.prototype,"type",void 0),t([_({readOnly:!0})],Et.prototype,"vertexGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"curveControlPointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"constructionLineGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"midpointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"selectedManipulators",void 0),t([_()],Et.prototype,"view",void 0),Et=t([g("esri.views.draw.support.Reshape")],Et);const Ft=Et;export{Ft as default};
|
|
2
|
+
import{__decorate as t}from"tslib";import e from"../../../Graphic.js";import{createTask as i}from"../../../core/asyncUtils.js";import s from"../../../core/Collection.js";import o from"../../../core/Error.js";import{EventedAccessor as r}from"../../../core/Evented.js";import n from"../../../core/Logger.js";import{getOrCreateMapValue as a}from"../../../core/MapUtils.js";import{destroyMaybe as h,abortMaybe as p,assertIsSome as l}from"../../../core/maybe.js";import{throwIfAborted as c}from"../../../core/promiseUtils.js";import{pausable as d,when as m,watch as v,initial as u,sync as y}from"../../../core/reactiveUtils.js";import{property as _,subclass as g}from"../../../core/accessorSupport/decorators.js";import{UpdatingHandles as f}from"../../../core/support/UpdatingHandles.js";import G from"../../../geometry/Point.js";import b from"../../../geometry/Polyline.js";import{fromPolylineUsingImportOperator as x,toGeometry as M}from"../../../geometry/operators/support/apiConverter.js";import{closeRingsAndFixWinding as S,geometryToCoordinates as C}from"../../../geometry/support/coordsUtils.js";import{fromJSON as E}from"../../../geometry/support/jsonUtils.js";import{isPoint as w}from"../../../geometry/support/typeUtils.js";import{interpolateCircle as I}from"../../../geometry/support/curves/circleUtils.js";import{deriveCircleFromCircularArc as V,toEllipticArc7 as H}from"../../../geometry/support/curves/circularArcUtils.js";import{getPaths as k,getEndpoint as O,isCircularArc as P,isEllipticArc4 as L,isBezierCurve as T,isCoordinate as R,cloneCurve as A,isEllipticArc7 as j}from"../../../geometry/support/curves/curveUtils.js";import{deriveCircleFromEllipticArc4 as U}from"../../../geometry/support/curves/ellipticArc4Utils.js";import{wrapAtan2 as F}from"../../../geometry/support/curves/mathUtils.js";import D from"../../../layers/GraphicsLayer.js";import{SnappingVisualizer2D as z}from"../../2d/interactive/SnappingVisualizer2D.js";import{ConnectedReshapeManager as K}from"./ConnectedReshapeManager.js";import{screenDeltaToMapDelta as N,getZFromVertexSnappingCandidates as W,cloneMove as $}from"./drawUtils.js";import q from"./GraphicMover.js";import X from"./HighlightHelper.js";import{addUniqueLayer as Y,isConnectedReshapeSupportedLayer as Z}from"./layerUtils.js";import{createTooltipInfos as B,connectTooltip as J,updateTranslateTooltipInfo as Q,updateTranslateVertexTooltipInfo as tt}from"./reshapeTooltipUtils.js";import{defaultSymbols as et,createMidpointGraphics as it,createVertexGraphics as st,createCurveControlPointGraphics as ot,createCurveConstructionLineGraphics as rt,attributeKeys as nt,getMidpoint as at,controlPointKinds as ht,fastCloneGeometry as pt,saveUpdatedCurveOrCoordinate as lt,toolIdAttribute as ct,splitCurve as dt,isSingleSegmentCircle as mt,isSingleSegmentEllipse as vt}from"./reshapeUtils.js";import{ViewEventPriorities as ut}from"../../input/InputManager.js";import{createCoordinateHelper as yt}from"../../interactive/coordinateHelper.js";import{sketchKeys as _t}from"../../interactive/keybindings.js";import{EditGeometryOperations as gt}from"../../interactive/editGeometry/EditGeometryOperations.js";import ft from"../../interactive/sketch/SketchOptions.js";import{SnappingContext as Gt}from"../../interactive/snapping/SnappingContext.js";import{makeTooltip as bt,enterInputModeIfAvailable as xt}from"../../interactive/tooltip/tooltipCommonUtils.js";import{GeometryWorkerHandle as Mt}from"../../support/GeometryWorkerHandle.js";const St=Symbol(),Ct={mode:"on-the-ground",offset:0};let Et=class extends r{constructor(t){super(t),this._updateHandlesOnExternalGeometryChange=null,this._activeOperationInfo=null,this._connectedReshapeManager=null,this._editGeometryOperations=null,this._primaryGraphicMoving=!1,this._segmentLabels=null,this._segmentLabelsImportTask=null,this._mover=null,this._snappingContext=null,this._snappingGraphicsLayer=null,this._hoverGraphic=null,this._snappingTask=null,this._stagedVertex=null,this._relatedGraphicIndex=null,this._updatingHandles=new f,this._measurementWorker=new Mt({preloadGeodetic:!0}),this.callbacks={onReshapeStart(){},onReshape(){},onReshapeStop(){},onMoveStart(){},onMove(){},onMoveStop(){},onGraphicClick(){}},this.connectedReshapeProviders=null,this.enableMidpoints=!0,this.enableCurveOnMidpoint=!1,this.enableMovement=!0,this.enableVertices=!0,this.filterVerticesEnabled=!0,this.graphic=null,this.highlightName=null,this.highlightsEnabled=!0,this.layer=null,this.snappingManager=null,this.symbols=et,this.tooltip=null,this.activeTooltipInfo=null,this.sketchOptions=new ft,this.type="reshape",this.vertexGraphics=new s,this.curveControlPointGraphics=new s,this.constructionLineGraphics=new s,this.midpointGraphics=new s,this.selectedManipulators=new s,this.view=null}initialize(){const t=this.view;this._highlightHelper=new X({view:t}),this._setup(),this._updateHandlesOnExternalGeometryChange=d(()=>this.graphic?.geometry,t=>{if(!t||!0===this._primaryGraphicMoving)return;const e=new Set(this.selectedManipulators.map(Rt));this._highlightHelper.removeAll(),this._setUpHighlights(),this._setupGraphics(),this._clearSelection(),this.vertexGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t)),this.curveControlPointGraphics.filter(t=>e.has(Rt(t))).forEach(t=>this._addToSelection(t));const{enableMovement:i,_mover:s,graphic:o,midpointGraphics:r,vertexGraphics:n,curveControlPointGraphics:a}=this,h=n.concat(r,a).toArray();i&&h.push(o),s?.set("graphics",h)},y),this.tooltip=bt(()=>({view:t,options:this.sketchOptions.tooltips})),this.tooltipInfos=B(this.sketchOptions),this.addHandles([m(()=>t?.ready,()=>{const{layer:t,view:e}=this;Y(e,t),this.addHandles(e.on("key-down",t=>this._keyDownHandler(t),ut.TOOL))},{once:!0,initial:!0}),v(()=>this.graphic,()=>this.refresh()),...this._effectiveFilterVerticesEnabled?[v(()=>[this.view.viewpoint,this.view.stationary],()=>{this.view.stationary&&this.refresh()})]:[],v(()=>this.layer,(t,e)=>{e&&(this._clearSelection(),this._resetGraphics(e)),this.refresh()}),v(()=>[this.highlightsEnabled,this.highlightName],()=>{this._highlightHelper?.removeAll(),this._setUpHighlights()}),v(()=>this.enableMidpoints,()=>this.refresh()),J(this.tooltip,()=>this._tooltipsContext,this._updatingHandles),v(()=>this.sketchOptions.labels.enabled,t=>{this._segmentLabels?this._segmentLabels.visible=t:this._setUpGeometryHelper()}),v(()=>this.view.effectiveTheme.accentColor,()=>this._updateSymbolsForTheme(),u),this._updateHandlesOnExternalGeometryChange]),this._updateTooltip()}destroy(){this._reset(),this._mover=h(this._mover),this._connectedReshapeManager=h(this._connectedReshapeManager),this.tooltip=h(this.tooltip),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._updatingHandles=h(this._updatingHandles),this._measurementWorker.destroy()}get _coordinateHelper(){return this._editGeometryOperations?.data.coordinateHelper??yt(!!this.graphic.geometry?.hasZ,!!this.graphic.geometry?.hasM,this.view.spatialReference)}get _effectiveFilterVerticesEnabled(){return"2d"===this.view?.type&&this.filterVerticesEnabled}get test(){return{segmentLabels:this._segmentLabels}}get _selectedManipulator(){return 1===this.selectedManipulators.length?this.selectedManipulators.at(0):void 0}get _tooltipsContext(){const{sketchOptions:t,activeTooltipInfo:e,graphic:i}=this;return{sketchOptions:t,activeTooltipInfo:e,graphic:i,selectedVertex:this._selectedManipulator,measurementWorker:this._measurementWorker,updateGeometry:(t,e,i,s,o)=>{this._setUpGeometryHelper();const r=t===this.graphic;r?this._emitMoveStartEvent(0,0):this._emitReshapeStartEvent(t);const n=!0;if(this._syncGeometryAfterVertexMove(t,e,s,o,n),r){const{view:t}=this,s=t.toScreen(i),o=t.toScreen(e),r=(o?.x??0)-(s?.x??0),n=(o?.y??0)-(s?.y??0);this._emitMoveEvent(r,n),this._emitMoveStopEvent(r,n)}else this._emitReshapeEvent(t),this._emitReshapeStopEvent(t)}}}get state(){const t=this.view.ready,e=!(!this.graphic||!this.layer);return t&&e?"active":t?"ready":"disabled"}get updating(){return this._updatingHandles.updating||!!this._connectedReshapeManager?.updating||!!this._segmentLabels?.updating||!!this.snappingManager?.updating}isUIGraphic(t){return t===this.graphic||this._isMidpoint(t)||this._isCurveControlPoint(t)||this._isVertex(t)||this._isConstructionLine(t)}refresh(t){if(this._reset(),this._setup(),t){for(const e of this.vertexGraphics)t.has(Rt(e))&&this._addToSelection(e);for(const e of this.curveControlPointGraphics)t.has(Rt(e))&&this._addToSelection(e)}}reset(){this.graphic=null}clearSelection(){this._clearSelection()}removeSelectedVertices(){const{selectedManipulators:t}=this;t.length&&this._removeVertices(t)}_setup(){const{graphic:t,layer:e}=this;if(!e||null==t?.geometry)return;const i=t.geometry;"mesh"!==i.type&&"extent"!==i.type?("polygon"===i.type&&S(i),this._setUpHighlights(),this._setupGraphics(),this._setupMover(),this._setupConnectedReshapeManager(),this._setUpGeometryHelper()):this._logGeometryTypeError()}_setUpHighlights(){this.highlightsEnabled&&this.graphic&&this._highlightHelper?.add(this.graphic,this.highlightName)}_setUpGeometryHelper(){const t=this.graphic.geometry;if(null==t||"mesh"===t.type||"extent"===t.type)return this._segmentLabels=h(this._segmentLabels),void this._logGeometryTypeError();this._editGeometryOperations?this._syncEditGeometryOperations(t):this._editGeometryOperations=gt.fromGeometry(t,2,{allowCurves:!0}),this._updatingHandles.consumePromise(this._setupSegmentLabels())}_saveSnappingContextForHandle(t,e){this._snappingGraphicsLayer=new D({listMode:"hide",internal:!0,title:"Reshape snapping layer"}),this.view.map.layers.add(this._snappingGraphicsLayer);const i=this._editGeometryOperations;l(i),this._snappingContext=new Gt({editGeometryOperations:i,elevationInfo:Ct,pointer:e.viewEvent?.pointerType||"mouse",excludeFeature:this.graphic,feature:this.graphic,visualizer:new z(this._snappingGraphicsLayer),vertexHandle:this._getVertexFromEditGeometry(t)})}_reset(){this._clearSelection(),this._highlightHelper?.removeAll(),this._updateTooltip(),this._resetGraphics(),this._resetSnappingStateVars(),this._segmentLabelsImportTask=p(this._segmentLabelsImportTask),this._segmentLabels=h(this._segmentLabels),this._activeOperationInfo=null,this._mover=h(this._mover),this.removeHandles(St)}_resetSnappingStateVars(){null!=this.snappingManager&&this.snappingManager.doneSnapping(),null!=this._snappingGraphicsLayer&&(this.view.map?.layers.remove(this._snappingGraphicsLayer),h(this._snappingGraphicsLayer)),this._snappingTask=p(this._snappingTask),this._snappingTask=null,this._snappingContext=null,this._stagedVertex=null}_resetGraphics(t){this._removeMidpointGraphics(t),this._removeVertexGraphics(t),this._removeCurveGraphics(t),this._updateTooltip()}_removeMidpointGraphics(t=this.layer){const{midpointGraphics:e}=this;t?.removeMany(e.items),e.drain(h)}_removeVertexGraphics(t=this.layer){const{vertexGraphics:e}=this;this._relatedGraphicIndex=null,t?.removeMany(e.items),e.drain(h)}_removeCurveGraphics(t=this.layer){const{curveControlPointGraphics:e,constructionLineGraphics:i}=this;t?.removeMany(e.items),t?.removeMany(i.items),e.drain(h),i.drain(h)}_setupGraphics(){const t=this.graphic.geometry;if(null!=t&&("polyline"===t.type||"polygon"===t.type||"multipoint"===t.type)){const e=wt(t);this.enableMidpoints&&"multipoint"!==t.type&&this._setUpMidpointGraphics(e),this.enableVertices&&(this._setUpVertexGraphics(e),this._setupCurveGraphics(e))}}_setUpMidpointGraphics(t){this._removeMidpointGraphics();const e=it(t,this.symbols,this._coordinateHelper,"polygon"===this.graphic.geometry?.type,this.filterVerticesEnabled?this.view.extent:null,this.filterVerticesEnabled?this.view.resolution:-1);this.midpointGraphics.addMany(e),this.layer.addMany(e)}_setUpVertexGraphics(t){if(this._removeVertexGraphics(),this._effectiveFilterVerticesEnabled){const e=st(t,this.symbols,this._coordinateHelper,this.view.extent,this.view.resolution);this._relatedGraphicIndex=e.graphicIndex,this.vertexGraphics.addMany(e.graphics),this.layer.addMany(e.graphics)}else{const e=st(t,this.symbols,this._coordinateHelper,null,-1).graphics;this.vertexGraphics.addMany(e),this._storeRelatedVertexIndices(),this.layer.addMany(e)}}_setupCurveGraphics(t){this._removeCurveGraphics();const e=ot(t,this.symbols,this._coordinateHelper),i=rt(t,this.symbols,this._coordinateHelper);this.curveControlPointGraphics.addMany(e),this.constructionLineGraphics.addMany(i),this.layer.addMany(i),this.layer.addMany(e)}async _setupSegmentLabels(){const t=this._editGeometryOperations,e=this.sketchOptions.labels.enabled;if(t&&this._segmentLabels?.context?.editGeometryOperations===t&&e||(this._segmentLabels=h(this._segmentLabels)),!this._segmentLabels&&t&&e){const e=this._segmentLabelsImportTask??=i(async t=>{const e=import("../../2d/interactive/SegmentLabels2D.js"),{SegmentLabels2D:i}=await this._updatingHandles.addPromise(e);return t.aborted?null:i}),s=await this._updatingHandles.addPromise(e.promise);if(!s)return;this._segmentLabels=h(this._segmentLabels),this._segmentLabels=new s({context:{view:this.view,editGeometryOperations:t,elevationInfo:Ct,labelOptions:this.sketchOptions.labels},visible:!0})}}_updateSymbolsForTheme(){const t=this.view.effectiveTheme.accentColor;this.symbols={vertices:{...this.symbols.vertices,default:this.symbols.vertices.default.clone().set("color",t),hover:this.symbols.vertices.hover?.clone().set("color",t)},controlPoints:{...this.symbols.controlPoints,default:this.symbols.controlPoints.default.clone().set("color",t),hover:this.symbols.controlPoints.hover?.clone().set("color",t)},midpoints:{...this.symbols.midpoints},constructionLines:this.symbols.constructionLines.clone().set("color",t)};for(const e of this.vertexGraphics)this._isSelected(e)?e.symbol=this.symbols.vertices.selected:this._hoverGraphic===e?e.symbol=this.symbols.vertices.hover:e.symbol=this.symbols.vertices.default;for(const e of this.curveControlPointGraphics)this._isSelected(e)?e.symbol=this.symbols.controlPoints.selected:this._hoverGraphic===e?e.symbol=this.symbols.controlPoints.hover:e.symbol=this.symbols.controlPoints.default;for(const e of this.constructionLineGraphics)e.symbol=this.symbols.constructionLines}_storeRelatedVertexIndices(){const t=this.vertexGraphics.items;if(!t)return;const e=t.map(({geometry:t})=>({x:t.x,y:t.y}));for(let i=0;i<e.length;i++){const s=[];for(let t=0;t<e.length;t++){if(i===t)continue;const o=e[i],r=e[t];o.x===r.x&&o.y===r.y&&s.push(t)}t[i].attributes[nt.relatedGraphicIndices]=s}}_setupMover(){const{enableMovement:t,graphic:e,midpointGraphics:i,vertexGraphics:s,view:o}=this,r=s.concat(i,this.curveControlPointGraphics).toArray();t&&"multipoint"!==e.geometry?.type&&r.push(e),this._mover=new q({enableMoveAllGraphics:!1,highlightsEnabled:!1,indicatorsEnabled:!1,graphics:r,view:o,callbacks:{onGraphicClick:t=>this._onGraphicClickCallback(t),onGraphicMoveStart:t=>this._onGraphicMoveStartCallback(t),onGraphicMove:t=>this._onGraphicMoveCallback(t),onGraphicMoveStop:t=>this._onGraphicMoveStopCallback(t),onGraphicPointerOver:t=>this._onGraphicPointerOverCallback(t),onGraphicPointerOut:t=>this._onGraphicPointerOutCallback(t)}})}_setupConnectedReshapeManager(){const{connectedReshapeProviders:t}=this;null!=t&&0!==t.length&&(this._connectedReshapeManager=new K({providerFactories:t,view:this.view}))}_onGraphicClickCallback(t){t.viewEvent.stopPropagation();const e=t.graphic,i=this._isCurveControlPoint(e);if(e===this.graphic)this.clearSelection(),this.emit("graphic-click",t),this.callbacks.onGraphicClick?.(t);else if(this._isMidpoint(e)){if(2===t.viewEvent.button)return;const i=this.graphic.clone(),s=this._handleMidpointClickOrStartMove(t);this.refresh(),s.length&&this._emitVertexAddEvent([e],i,s)}else if(this._isVertex(e)||i){if(t.viewEvent.stopPropagation(),2===t.viewEvent.button)return void(i||this._removeVertices(e));t.viewEvent.native.shiftKey||this._clearSelection(),this.selectedManipulators.includes(e)?this._removeFromSelection(e,!0):this._addToSelection(e)}}_setUpOperation(t){const{graphic:e,dx:i,dy:s}=t,o=e===this.graphic;this._resetSnappingStateVars(),this._setUpGeometryHelper(),this._saveSnappingContextForHandle(e,t),this._activeOperationInfo={target:this.graphic,mover:e,operationType:o?"move":"reshape",totalDx:i,totalDy:s}}_onGraphicMoveStartCallback(t){const{dx:e,dy:i,graphic:s}=t,o=this._connectedReshapeManager,r=o?jt(this.graphic):null;if(s===this.graphic){const{geometry:n}=s;return this._primaryGraphicMoving=!0,this._setUpOperation(t),this._emitMoveStartEvent(e,i),r&&o?.startFeatureMove([r]),this._effectiveFilterVerticesEnabled&&this._resetGraphics(this.layer),void(null!=n&&"point"===n.type&&this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(e,i)}))}const{selectedManipulators:n}=this;if(!n.includes(s)){if(this._clearSelection(),this._isMidpoint(s)){const e=this.graphic.clone(),i=this._handleMidpointClickOrStartMove(t);i.length&&(this._emitVertexAddEvent([s],e,i),this._refreshGraphicIndicesAttributes(i[0]))}this._addToSelection(s)}if(this._setUpOperation(t),r){const t=n.filter(t=>this._isVertex(t));o?.startVertexMove(r,Ut(t))}this._emitReshapeStartEvent(s),this._onHandleMove(s,e,i,t,()=>{this._updateTooltip(s,t.viewEvent),this._emitReshapeEvent(s)})}_onGraphicMoveCallback(t){const e=this._activeOperationInfo;if(!e)return;const{dx:i,dy:s,graphic:o}=t;e.totalDx+=i,e.totalDy+=s;const{operationType:r}=e,{geometry:n}=o;if(null!=n)if("move"!==r)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(o,t.viewEvent),this._emitReshapeEvent(o)});else{if("point"===n.type)this._onHandleMove(o,i,s,t,()=>{this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)});else if("polyline"===n.type||"polygon"===n.type){const{dxMap:e,dyMap:o}=N(i,s,this.view);if(this._effectiveFilterVerticesEnabled){if(this.selectedManipulators.length>0){const t=this.selectedManipulators.toArray();this.selectedManipulators.removeAll();for(const e of t){if("point"===e.geometry?.type){const{pathIndex:t,pointIndex:i}=e.attributes,s=k(n)[t][i];if(s){const t=O(s);e.geometry=this._coordinateHelper.arrayToPoint(t)}}this._addToSelection(e.clone())}}}else{const t=wt(n);this._updateVertexGraphicLocations(t)}this._connectedReshapeManager?.translate(e,o,0),this._updateTooltip(this.graphic,t.viewEvent),this._emitMoveEvent(i,s)}this._syncEditGeometryOperations(n)}}_onGraphicMoveStopCallback(t){const e=this._activeOperationInfo;if(this._primaryGraphicMoving=!1,!e)return;const{dx:i,dy:s,graphic:o,x:r,y:n}=t,{operationType:a}=e;e.totalDx+=i,e.totalDy+=s,this._onHandleMove(o,i,s,t,()=>this._handleVertexSnap(o,{x:r,y:n},a))}_afterMoveStop(t,e){if(this._effectiveFilterVerticesEnabled&&"move"===e){const t=new Set;for(const e of this.selectedManipulators)t.add(Rt(e));return this.refresh(t),void this._updateTooltip()}if(this._isMidpoint(t)||t.getAttribute(nt.curveFromStraightEdgeFlag))return this.refresh(),void this._connectedReshapeManager?.finish();this._updateTooltip(this._isVertex(t)?t:null),this._resetSnappingStateVars(),this._connectedReshapeManager?.finish(),this._activeOperationInfo=null}_handleVertexSnap(t,e,s){const o=t.geometry,r=this.snappingManager?.getVertexCandidates(),n=this.callbacks.onVertexSnap,a=()=>"move"===s?this._emitMoveStopEvent():this._emitReshapeStopEvent(t);if(!(n&&o&&w(o)&&r&&0!==r.length))return a(),void this._afterMoveStop(t,s);p(this._snappingTask),this._snappingTask=i(async i=>{try{const s=await n(o,e,r);c(i);const a=E(s);this._syncGeometryAfterVertexMove(t,a,0,0),t.geometry=a}finally{a(),this._afterMoveStop(t,s)}})}_updateVertexGraphicLocations(t){const{_coordinateHelper:e}=this;for(const i of this.vertexGraphics){const{pathIndex:s,pointIndex:o}=i.attributes;i.geometry=e.arrayToPoint(O(t[s][o]))}this._updateMidpointGraphicLocations(t),this._updateCurveGraphicLocations(t)}_updateMidpointGraphicLocations(t,e){const{_coordinateHelper:i}=this;if(e)for(const s of this.midpointGraphics){const{pathIndex:o,pointIndexStart:r,pointIndexEnd:n}=s.attributes;if(!e.has(o))continue;const a=e.get(o);if(!a.has(r)&&!a.has(n))continue;const h=t[o];s.geometry=new G(at(h[r],h[n],i))}else for(const s of this.midpointGraphics){const{pathIndex:e,pointIndexStart:o,pointIndexEnd:r}=s.attributes,n=t[e];s.geometry=new G(at(n[o],n[r],i))}}_updateCurveGraphicLocations(t){const{spatialReference:e}=this._coordinateHelper,i=new Map;for(const s of this.selectedManipulators){const[t,e]=Tt(s);null!=t&&null!=e&&s.getAttribute(nt.controlPointKind)&&a(i,t,()=>new Set)?.add(e)}for(const s of this.curveControlPointGraphics){const[e,o]=Tt(s);if(i.get(e)?.has(o))continue;const r=t[e][o];if(P(r)||L(r)){const i=O(t[e][o-1]),n=P(r)?V(i,r):U(i,r),[a,h]=I(n,.25);s.geometry=new G({x:a,y:h,spatialReference:this._coordinateHelper.spatialReference})}else if(T(r)){const t=s.getAttribute(nt.controlPointKind),[e,i]=t===ht.bezier.cp1?r.b[1]:r.b[2];s.geometry=new G({x:e,y:i,spatialReference:this._coordinateHelper.spatialReference})}}for(const s of this.constructionLineGraphics){const i=s.getAttribute(nt.controlPointKind),[o,r]=Tt(s),n=t[o],a=O(n[r-1]),h=O(n[r]),p=t[o][r];i===ht.bezier.line1?s.geometry=new b({paths:[[[a[0],a[1]],[...p.b[1]]]],spatialReference:e}):s.geometry=new b({paths:[[[h[0],h[1]],[...p.b[2]]]],spatialReference:e})}}_refreshGraphicIndicesAttributes(t){const{componentIndex:e,vertexIndex:i}=t,s=t=>{const[s,o]=Tt(t);s===e&&o>=i&&t.setAttribute(nt.pointIndex,o+1)};this.vertexGraphics.forEach(s),this.curveControlPointGraphics.forEach(s),this.constructionLineGraphics.forEach(s);for(const o of this.midpointGraphics){if(o.getAttribute(nt.pathIndex)!==e)continue;const t=o.getAttribute(nt.pointIndexStart);t>=i&&(o.setAttribute(nt.pointIndexStart,t+1),o.setAttribute(nt.pointIndexEnd,o.getAttribute(nt.pointIndexEnd)+1))}}_getVertexFromEditGeometry(t){const[e,i]=Tt(t);return l(this._editGeometryOperations),this._editGeometryOperations.data.parts[e].vertices[i]}_onHandleMove(t,e,s,o,r){p(this._snappingTask);const n=this._snappingContext;if(!n)return;const a=t.geometry,h="graphic-move-stop"===o.type;if(a&&w(a))if(null!=this.snappingManager&&this.selectedManipulators.length<2&&!h){const o=this.snappingManager;this._stagedVertex=o.update({point:a,context:n}),this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r(),this._snappingTask=i(async i=>{const p=await o.snap({point:a,context:n,signal:i});if(p.valid){const i=p.apply();i.z=W(this.snappingManager)??i.z,this._stagedVertex=i,this._syncGeometryAfterVertexMove(t,new G(this._stagedVertex),e,s,h),r()}}),this._updatingHandles.consumePromise(this._snappingTask.promise)}else{const i=null!=this._stagedVertex?new G(this._stagedVertex):a;this._syncGeometryAfterVertexMove(t,i,e,s,h),r()}else r()}_syncGeometryAfterVertexMove(t,e,i,s,o=!1){const r=pt(this._editGeometryOperations?.data.geometry);if(!r)return;const{_coordinateHelper:n}=this,a=n.pointToVector(e),h=this._getVertexFromEditGeometry(t);let p=null;if(h){const t=n.getZ(a);p=[h.pos[0],h.pos[1]];const e=a[0]-h.pos[0],i=a[1]-h.pos[1],s=null!=t?t-h.pos[2]:0;"point"!==r.type&&"mesh"!==r.type||this._editGeometryOperations?.moveVertices([h],e,i,s),this._connectedReshapeManager?.translate(e,i,s)}if("point"===r.type)t.geometry=e;else if("mesh"===r.type)t.geometry=r.centerAt(e);else{if(t!==this.graphic){p&&!this._isVertex(t)&&(p=null);const o=n.spatialReference,[a,h]=Tt(t);let l=It(r);const c=n.pointToArray(e);if(this._updateGeometryFromGraphic(t,l,a,h,c,o,"polygon"===r.type),this._isVertex(t)||this._isCurveControlPoint(t)){const e=new Map;e.set(a,new Set([h])),l=this._moveRelatedCoordinates(l,t,c,e,p),l=this._moveSelectedHandleCoordinates(l,t,i,s,"polygon"===r.type),this._updateMidpointGraphicLocations(l,e),this._updateCurveGraphicLocations(l)}else this._isMidpoint(t)&&this._updateCurveGraphicLocations(l);lt(r,l)}this._updateGraphicGeometry(r),this._syncEditGeometryOperations(r),o&&(this._mover?this._mover.updateGeometry(this._mover.graphics.indexOf(t),e):t.geometry=e)}}_syncEditGeometryOperations(t){const e=this._editGeometryOperations?.trySetGeometry(t);e||(this._editGeometryOperations=null,this._setUpGeometryHelper())}_moveRelatedCoordinates(t,e,i,s,o){if(this._effectiveFilterVerticesEnabled&&this._relatedGraphicIndex&&o){const r=this._relatedGraphicIndex.search({minX:o[0],maxX:o[0],minY:o[1],maxY:o[1]});for(const n of r)n.coordinate[0]===o[0]&&n.coordinate[1]===o[1]&&n.graphic&&(s&&a(s,n.pathIndex,()=>new Set).add(n.pointIndex),Lt(t,n.pathIndex,n.pointIndex,i,this._coordinateHelper.spatialReference),this._relatedGraphicIndex.remove(n),n.coordinate[0]=e.geometry.x,n.coordinate[1]=e.geometry.y,n.graphic.geometry=e.geometry,this._relatedGraphicIndex.insert(n));return t}const{relatedGraphicIndices:r}=e.attributes,n=this._coordinateHelper.spatialReference;if(!r?.length)return t;for(const h of r){const o=this.vertexGraphics.at(h),[r,p]=Tt(o);s&&a(s,r,()=>new Set).add(p),Lt(t,r,p,i,n),o.geometry=e.geometry}return t}_moveSelectedHandleCoordinates(t,e,i,s,o){const r=this._coordinateHelper.spatialReference;for(const n of this.selectedManipulators)if(n!==e){const[e,a]=Tt(n),h=n.getAttribute(nt.relatedGraphicIndices),p=$(n.geometry,i,s,this.view),l=C(p);if(n.geometry=p,this._updateGeometryFromGraphic(n,t,e,a,l,r,o),h?.length)for(const i of h){const e=this.vertexGraphics.at(i),[s,o]=Tt(e);Lt(t,s,o,l,r),e.geometry=p}}return t}_updateGeometryFromGraphic(t,e,i,s,o,r,n){const a=e[i].length-1;this._isCurveControlPoint(t)?Ht(e,i,s,[o[0],o[1]],t.getAttribute(nt.controlPointKind)):(Lt(e,i,s,o,r),n&&(0===s?Lt(e,i,a,o,r):s===a&&(e[i][0]=o)))}_onGraphicPointerOverCallback(t){const e=t.graphic;this._hoverGraphic=e;const i=this._isVertex(e);i&&!this._isSelected(e)?e.symbol=this.symbols.vertices.hover:this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.hover),this._updateTooltip(i?e:null),this._updateHoverCursor(e)}_onGraphicPointerOutCallback(t){const e=t.graphic;this._hoverGraphic=null,this._isVertex(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.vertices.default),this._isCurveControlPoint(e)&&!this._isSelected(e)&&(e.symbol=this.symbols.controlPoints.default),this.removeHandles(St),this._updateTooltip()}_handleMidpointClickOrStartMove(t){const{graphic:e}=t,i=this.graphic.geometry;if(null==i||"polygon"!==i.type&&"polyline"!==i.type)return[];const s=pt(i),o=[],{[nt.pathIndex]:r,[nt.pointIndexStart]:n,[nt.pointIndexEnd]:a}=e.attributes,h=C(e.geometry),p=0===a?n+1:a;e.attributes={[nt.tool]:ct,[nt.pathIndex]:r,[nt.pointIndex]:p,[nt.relatedGraphicIndices]:[]};const l=It(s),c=l[r][a];if(R(c)){if(this.enableCurveOnMidpoint&&t.viewEvent.native.shiftKey){const t=O(l[r][p]);l[r].splice(p,1,{c:[t,[h[0],h[1]]]}),e.setAttribute(nt.controlPointKind,ht.circle.interior),e.setAttribute(nt.curveFromStraightEdgeFlag,!0),this.midpointGraphics.remove(e),this.curveControlPointGraphics.push(e),lt(s,l)}else l[r].splice(p,0,h),o.push({coordinates:l[r][p],componentIndex:r,vertexIndex:p})}else{const t=O(l[r][n]),e=dt(t,c,.5,this._coordinateHelper);l[r].splice(a,1,...e),o.push({coordinates:O(l[r][p]),componentIndex:r,vertexIndex:p})}return this._updateGraphicGeometry(s),this._syncEditGeometryOperations(s),o}_addToSelection(t){const e=At(t);for(const i of e)this._isCurveControlPoint(i)?i.symbol=this.symbols.controlPoints.selected:i.symbol=this.symbols.vertices.selected,this.selectedManipulators.add(i),this._updateTooltip(i);this._emitSelectEvent(e)}_removeFromSelection(t,e){if(this._isVertex(t)){const{vertices:i}=this.symbols;t.symbol=e?i.hover:i.default}else if(this._isCurveControlPoint(t)){const{controlPoints:i}=this.symbols;t.symbol=e?i.hover:i.default}this.selectedManipulators.remove(t),this._emitDeselectEvent([t]),this._updateTooltip()}_clearSelection(){const t=this.selectedManipulators.toArray(),{controlPoints:e,vertices:i}=this.symbols;if(t.length>0){for(const s of t)this._isVertex(s)?s.symbol=i.default:this._isCurveControlPoint(s)&&(s.symbol=e.default);this.selectedManipulators.removeAll(),this._emitDeselectEvent(t),this._updateTooltip()}}_keyDownHandler(t){null==this._activeOperationInfo&&xt(t,this.tooltip)||_t.delete.includes(t.key)&&!t.repeat&&this.selectedManipulators.length&&(this._removeVertices(this.selectedManipulators),t.stopPropagation())}_removeVertices(t){const e=this.graphic.geometry,i=this.vertexGraphics.length;if(null==e||"polygon"!==e.type&&"polyline"!==e.type&&"multipoint"!==e.type)return;if("polygon"===e.type&&i<4||"multipoint"===e.type&&i<2||"polyline"===e.type&&i<3)return;const s=this.graphic.clone(),o=pt(e);let r=It(o);const n=[],a=At(t);for(const h of a){if(this._isCurveControlPoint(h))continue;const{x:t,y:e}=h.geometry;for(let i=0;i<r.length;i++){const s=r[i];for(let o=0;o<s.length;o++){const[a,h]=O(s[o]);if(t===a&&e===h){n.push({coordinates:O(r[i][o]),componentIndex:i,vertexIndex:o}),r[i].splice(Number(o),1);const t=r[i][o];t&&!R(t)&&(r[i][o]=O(t))}}}}if("polygon"===o.type)r=r.filter(t=>{if(t.length<2)return!1;const[e,i]=O(t[0]),[s,o]=O(t[t.length-1]);return(2!==t.length||e!==s||i!==o)&&(e===s&&i===o||t.push(t[0]),!0)});else if("polyline"===o.type)for(const h of r)1===h.length&&r.splice(r.indexOf(h),1);lt(o,r),this._updateGraphicGeometry(o),this.refresh(),this._emitVertexRemoveEvent(a,s,n)}_isVertex(t){return this.vertexGraphics.includes(t)}_isCurveControlPoint(t){return this.curveControlPointGraphics.includes(t)}_isConstructionLine(t){return this.constructionLineGraphics.includes(t)}_isSelected(t){return(this._isVertex(t)||this.curveControlPointGraphics.includes(t))&&this.selectedManipulators.includes(t)}_isMidpoint(t){return this.midpointGraphics.includes(t)}_updateHoverCursor(t){const e=this._isMidpoint(t)?"copy":"move";this.addHandles(this.view.acquireCursor(e,"high"),St)}_updateTooltip(t,e){let i=null;const{graphic:s,view:o,tooltipInfos:r}=this,n=s?.geometry;"point"===n?.type?i=r.movePoint:this._selectedManipulator?i=r.selectedVertex:t===this.graphic?(i=r.translateGraphic,Q(i,o,this._tooltipsContext,this._updatingHandles,e)):t&&this.selectedManipulators.length>1&&(i=r.translateVertices,tt(i,o,n,this._tooltipsContext,this._updatingHandles,e)),this.activeTooltipInfo=i}_updateGraphicGeometry(t){this._updateHandlesOnExternalGeometryChange?.pause(),this.graphic.geometry=t,this._updateHandlesOnExternalGeometryChange?.resume()}_emitMoveStartEvent(t,e){const i={type:"move-start",mover:this.graphic,dx:t,dy:e};this.emit("move-start",i),this.callbacks.onMoveStart?.(i)}_emitMoveEvent(t,e){const i={type:"move",mover:this.graphic,dx:t,dy:e};this.emit("move",i),this.callbacks.onMove?.(i)}_emitMoveStopEvent(t,e){if(null==t||null==e){const i=this._activeOperationInfo;if(!i)return;t=i.totalDx,e=i.totalDy}const i={type:"move-stop",mover:this.graphic,dx:t,dy:e};this.emit("move-stop",i),this.callbacks.onMoveStop?.(i)}_emitReshapeStartEvent(t){const e={type:"reshape-start",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-start",e),this.callbacks.onReshapeStart?.(e)}_emitReshapeEvent(t){const e={type:"reshape",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape",e),this.callbacks.onReshape?.(e)}_emitReshapeStopEvent(t){const e={type:"reshape-stop",graphic:this.graphic,mover:t,selected:this.selectedManipulators.toArray()};this.emit("reshape-stop",e),this.callbacks.onReshapeStop?.(e)}_emitSelectEvent(t){const e={type:"vertex-select",added:t};this.emit("select",e),this.callbacks.onVertexSelect?.(e)}_emitDeselectEvent(t){const e={type:"vertex-deselect",removed:t};this.emit("deselect",e),this.callbacks.onVertexDeselect?.(e)}_emitVertexAddEvent(t,e,i){const s={type:"vertex-add",added:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-add",s),this.callbacks.onVertexAdd?.(s)}_emitVertexRemoveEvent(t,e,i){const s={type:"vertex-remove",removed:t,graphic:this.graphic,oldGraphic:e,vertices:i};this.emit("vertex-remove",s),this.callbacks.onVertexRemove?.(s)}_logGeometryTypeError(){n.getLogger(this).error(new o("reshape:invalid-geometry","Reshape operation not supported for the provided graphic. The geometry type is not supported."))}};function wt(t){let e=It(t);e=e.map(t=>t.slice());for(const i of e)for(let t=0;t<i.length;t++)i[t]=A(i[t]);if("polygon"===t.type)for(const i of e){const t=i[i.length-1];if(!R(t))continue;const e=i[0];e[0]===t[0]&&e[1]===t[1]&&i.length>2&&i.pop()}return e}function It(t){return"polygon"===t.type?t.curveRings?.slice()??t.rings.slice():"polyline"===t.type?t.curvePaths?.slice()??t.paths.slice():t.points.map(t=>[t])}function Vt(t,e,i,s){const o=t[e][i];if(P(o))o.c[1]=s;else if(L(o)){const o=O(t[e][i]);t[e][i]={c:[o,s]}}}function Ht(t,e,i,s,o){switch(o){case ht.circle.interior:Vt(t,e,i,s);break;case ht.bezier.cp1:t[e][i].b[1]=s;break;case ht.bezier.cp2:t[e][i].b[2]=s}}function kt(t,e){return t<1e-8*e}function Ot(t,{cx:e,cy:i,isInvalid:s,thetaStart:o,thetaEnd:r},n,a){const[h,p]=t,[l,c]=n,d=l-h,m=c-p;e-=h,i-=p;const v=a?o>r:o<r,[u,y]=s?[e,i]:v?[-i,e]:[i,-e],[_,g]=[d,m],[f,G]=[u,y],b=_*G-g*f,x=(d**2+m**2)/2;if(kt(Math.abs(b),x))return[(h+l)/2,(p+c)/2];const[M,S]=[G/b*x,-f/b*x],C=M**2+S**2,[E,w]=[d/2-M,m/2-S];if(kt(E**2+w**2,C)){const[t,e]=v?[-S,M]:[S,-M];return[t+M+h,e+S+p]}const I=Math.sqrt((M**2+S**2)/(E**2+w**2))*Math.sign(d*u+m*y);return[E*I+M+h,w*I+S+p]}function Pt(t,e,i){const s=x(new b({curvePaths:[[t,e]],spatialReference:i})),{curvePaths:o}=M(s,i),r=o[0][1];return j(r)?r:H(t,r)}function Lt(t,e,i,s,o){const r=t[e][i],n=t[e].at(i+1);if(mt(t,e)){const i=t[e][1];return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0]})}if(vt(t,e)){const i=t[e][1],[o,r]=i.a[1],[n,a]=s,h=Math.hypot(n-o,a-r),[p,l]=[n-o,a-r],c=F(l,p);return t[e][0]=[...s],void(t[e][1]={a:[[...s],[...i.a[1]],0,0,c,h,i.a[6]]})}const a=O(r);if(R(r))r.splice(0,r.length,...s);else if(T(r))r.b[0].splice(0,r.b[0].length,...s);else if(P(r)||L(r)){const o=O(t[e][i-1]),n=P(r)?V(o,r):U(o,r);t[e].splice(i,1,{c:[[...s],Ot(o,n,s,!0)]})}else if(j(r)){r.a[0].splice(0,r.a[0].length,...s);const n=O(t[e][i-1]);r.a=Pt(n,r,o).a}if(n&&!R(n)&&!T(r))if(P(n)||L(n)){const o=O(n),r=P(n)?V(a,n):U(a,n);t[e].splice(i+1,1,{c:[o,Ot(o,r,s,!1)]})}else if(j(n)){const t=O(r);n.a=Pt(t,n,o).a}}function Tt({attributes:t}){return[t?.[nt.pathIndex]||0,t?.[nt.pointIndex]||0]}function Rt({attributes:t}){return`${t?.[nt.pathIndex]}-${t?.[nt.pointIndex]}-${t?.[nt.controlPointKind]??"vertex"}`}function At(t){return t instanceof e?[t]:[...t]}function jt(t){const e=t.sourceLayer??t.layer;return Z(e)?{graphic:t,layer:e}:null}function Ut(t){return t.toArray().map(({attributes:t})=>({pathIndex:t[nt.pathIndex],vertexIndex:t[nt.pointIndex]}))}t([_()],Et.prototype,"_activeOperationInfo",void 0),t([_()],Et.prototype,"_connectedReshapeManager",void 0),t([_()],Et.prototype,"_coordinateHelper",null),t([_()],Et.prototype,"_editGeometryOperations",void 0),t([_()],Et.prototype,"_effectiveFilterVerticesEnabled",null),t([_()],Et.prototype,"_primaryGraphicMoving",void 0),t([_()],Et.prototype,"_segmentLabels",void 0),t([_()],Et.prototype,"test",null),t([_()],Et.prototype,"_segmentLabelsImportTask",void 0),t([_()],Et.prototype,"_updatingHandles",void 0),t([_()],Et.prototype,"_selectedManipulator",null),t([_()],Et.prototype,"_tooltipsContext",null),t([_()],Et.prototype,"callbacks",void 0),t([_()],Et.prototype,"connectedReshapeProviders",void 0),t([_()],Et.prototype,"enableMidpoints",void 0),t([_()],Et.prototype,"enableCurveOnMidpoint",void 0),t([_()],Et.prototype,"enableMovement",void 0),t([_()],Et.prototype,"enableVertices",void 0),t([_()],Et.prototype,"filterVerticesEnabled",void 0),t([_()],Et.prototype,"graphic",void 0),t([_()],Et.prototype,"highlightName",void 0),t([_()],Et.prototype,"highlightsEnabled",void 0),t([_()],Et.prototype,"layer",void 0),t([_()],Et.prototype,"snappingManager",void 0),t([_({readOnly:!0})],Et.prototype,"state",null),t([_()],Et.prototype,"symbols",void 0),t([_()],Et.prototype,"tooltip",void 0),t([_()],Et.prototype,"tooltipInfos",void 0),t([_()],Et.prototype,"activeTooltipInfo",void 0),t([_()],Et.prototype,"updating",null),t([_({type:ft})],Et.prototype,"sketchOptions",void 0),t([_({readOnly:!0})],Et.prototype,"type",void 0),t([_({readOnly:!0})],Et.prototype,"vertexGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"curveControlPointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"constructionLineGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"midpointGraphics",void 0),t([_({readOnly:!0})],Et.prototype,"selectedManipulators",void 0),t([_()],Et.prototype,"view",void 0),Et=t([g("esri.views.draw.support.Reshape")],Et);const Ft=Et;export{Ft as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{createTask as t}from"../../../core/asyncUtils.js";import{throwIfAborted as e,isAborted as
|
|
2
|
+
import{createTask as t}from"../../../core/asyncUtils.js";import{throwIfAborted as e,throwIfNotAbortError as r,isAborted as s}from"../../../core/promiseUtils.js";import{whenOnce as i}from"../../../core/reactiveUtils.js";import{diff as a}from"../../../core/accessorSupport/diffUtils.js";import{isGraphicsLayer as o,isSceneLayer as n}from"../../../layers/support/layerUtils.js";import{getDisplayedSymbol as c}from"../../../symbols/support/symbolUtils.js";import{GraphicState as l}from"../../3d/layers/graphics/GraphicState.js";async function u(t,r,s,i){const a=r.createQuery();a.objectIds=t,a.outFields=["*"],a.returnM=r.capabilities.data.supportsM,a.returnZ=r.capabilities.data.supportsZ,a.returnGeometry=!0,n(r)&&null!=r.infoFor3D||(a.outSpatialReference=s),!n(r)&&r.capabilities?.data.supportsTrueCurve&&(a.returnTrueCurves=!0);const o=await r.queryFeatures(a,{signal:i});return e(i),o.features}async function y(t,r,s,i){const o=await c(t,{useSourceLayer:!0,ignoreGraphicSymbol:!0,webStyleCache:r,scale:s});e(i);null!=a(t.symbol,o)&&(t.symbol=o)}async function p(a,n,c,l,u){e(u),a.graphics.includes(l)||a.add(l);const y=c.sourceLayer,p=c.layer??y,f=c.getObjectId();let b=null,w=null;function h(r){return b?.abort(),o(p)?(c.visible=r,Promise.resolve()):(b=t(async t=>{const i=await d(n,p);if(e(t),i&&!n.destroyed&&!i.destroyed)try{null!=f&&"number"==typeof f&&"setVisibility"in i&&i.setVisibility?.(f,r)}catch(a){if(s(t)||n.destroyed||i.destroyed)return;throw a}}),b.promise)}async function g(){return w||(w=(async()=>{try{await h(!0);const t=n.destroyed?null:await d(n,p).catch(()=>{});t&&!t.destroyed&&await i(()=>!t.updating)}finally{a.remove(l)}})(),n.addUpdatingPromise(w).catch(r),w)}try{await m(n,l,u),e(u),h(!1).catch(r)}catch(j){throw await g(),j}const v=async()=>g();return{remove:v,[Symbol.asyncDispose]:()=>v()}}async function d(t,e){if(!e||"building-component"===e.type)return;const r="subtype-sublayer"===e.type?e.parent:e;return r?t.whenLayerView(r):void 0}async function m(t,e,r){if("3d"===t.type){const s=new l({graphic:e}),a=t.trackGraphicState(s);try{await i(()=>s.displaying||s.error,r)}finally{a.remove()}}else await i(()=>e.visible,r)}export{u as fetchFullFeaturesByObjectId,p as swapForEditingSession,y as updateGraphicSymbolWhenRequired};
|