@arcgis/core 5.1.0-next.112 → 5.1.0-next.114
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/Graphic.d.ts +1 -0
- package/arcade.js +1 -1
- package/assets/esri/core/workers/RemoteClient.js +1 -1
- package/assets/esri/core/workers/chunks/{31a8bc25aa1441c70caa.js → 009250a7bded12099dd1.js} +1 -1
- package/assets/esri/core/workers/chunks/019a4fe7e085b2fc6ae9.js +1 -0
- package/assets/esri/core/workers/chunks/023837e5d9d2b6af66d8.js +1 -0
- package/assets/esri/core/workers/chunks/{a001e7e8a39f27284d87.js → 03c46880b69ce75a010f.js} +1 -1
- package/assets/esri/core/workers/chunks/0a530fbbb4486c670ea2.js +1 -0
- package/assets/esri/core/workers/chunks/{14b7b55c42af65ffa024.js → 0bd2b035c6ee89c725f9.js} +1 -1
- package/assets/esri/core/workers/chunks/0ded5c114cbb7574f2f4.js +1 -0
- package/assets/esri/core/workers/chunks/{b432a5a829e309837db6.js → 0e549d942d6cba1608cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{7dafe608c224b9d48ffa.js → 115664cb7d7b22a315bb.js} +1 -1
- package/assets/esri/core/workers/chunks/123a67e84ed68b96ac59.js +1 -0
- package/assets/esri/core/workers/chunks/14a241b07baa67743248.js +1 -0
- package/assets/esri/core/workers/chunks/{054ae729e7cefa2c7778.js → 170f8dc97614e9609443.js} +1 -1
- package/assets/esri/core/workers/chunks/179ffa2168c42615ccf2.js +1 -0
- package/assets/esri/core/workers/chunks/{4a65bc9091d7ea7e80df.js → 19f07c8d0f32ec889861.js} +1 -1
- package/assets/esri/core/workers/chunks/{ca92176d5348e2c533d7.js → 224a9f39876aa426a9bc.js} +1 -1
- package/assets/esri/core/workers/chunks/{beff5b4e15edee12bd4c.js → 271e42b7cd3c3441839e.js} +3 -3
- package/assets/esri/core/workers/chunks/{0550dc63b6b1274242b8.js → 27d7c701306efeea6b82.js} +1 -1
- package/assets/esri/core/workers/chunks/{8aac1155b8ac071cd2ad.js → 2855357a2c1f2ab03fb7.js} +1 -1
- package/assets/esri/core/workers/chunks/{33329f5d88e60b4ec568.js → 2a8f198f6c272f92bad5.js} +1 -1
- package/assets/esri/core/workers/chunks/{cb3004998eff7c60930e.js → 2b2a09ce14d00b4b1187.js} +1 -1
- package/assets/esri/core/workers/chunks/{5d60253ea3d247cdb3d1.js → 2bdfae998371e3aa9f2d.js} +1 -1
- package/assets/esri/core/workers/chunks/2f99a95facddc44319a9.js +1 -0
- package/assets/esri/core/workers/chunks/{bd17ac2e6f1eb8cf7abf.js → 2fa080539d039c92ce08.js} +1 -1
- package/assets/esri/core/workers/chunks/{ee635172be7fdea69367.js → 3109b05fe4fc40d4f25b.js} +1 -1
- package/assets/esri/core/workers/chunks/{92db9a6d273ae2862883.js → 315bf08dff4757ffbed3.js} +1 -1
- package/assets/esri/core/workers/chunks/32f128a1615d71bbe899.js +2 -0
- package/assets/esri/core/workers/chunks/{593772bd8b19ac664b29.js → 35527a01d61cabbfd33e.js} +1 -1
- package/assets/esri/core/workers/chunks/{711d1873c760313e287f.js → 39987c06636e757d1f00.js} +1 -1
- package/assets/esri/core/workers/chunks/40df608337d562553ce1.js +2 -0
- package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +1 -0
- package/assets/esri/core/workers/chunks/49675e77a351abda2728.js +1 -0
- package/assets/esri/core/workers/chunks/4bfeac7338df9e0b7ce1.js +1 -0
- package/assets/esri/core/workers/chunks/4ffcca40e7aa24c8cc35.js +1 -0
- package/assets/esri/core/workers/chunks/534dd93c72ea448ee908.js +1 -0
- package/assets/esri/core/workers/chunks/{2dc2487d05381de07e3f.js → 548c34ea88f113d03c93.js} +1 -1
- package/assets/esri/core/workers/chunks/{fe8334352d256d691a95.js → 5c6742728fa705d2e16e.js} +1 -1
- package/assets/esri/core/workers/chunks/{77ac243d4dcd901c2eec.js → 621d71d26bd20e296138.js} +1 -1
- package/assets/esri/core/workers/chunks/{7e203e947846d40f897e.js → 67dffb896b6ef4b2038b.js} +1 -1
- package/assets/esri/core/workers/chunks/6920e7f700a9ba280dba.js +1 -0
- package/assets/esri/core/workers/chunks/696967c8c6f53b94f851.js +1 -0
- package/assets/esri/core/workers/chunks/6b1f2b36bdc6b2ff2ea5.js +1 -0
- package/assets/esri/core/workers/chunks/{481dc7503587972a6bd2.js → 701125f6cdd91ff3655f.js} +2 -2
- package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +1 -0
- package/assets/esri/core/workers/chunks/75dfdd85abbac26ac899.js +1 -0
- package/assets/esri/core/workers/chunks/76a9b64fd573775bf6cd.js +1 -0
- package/assets/esri/core/workers/chunks/798c4d3201fcc9f2a42b.js +1 -0
- package/assets/esri/core/workers/chunks/7995e6983456c779adf9.js +1 -0
- package/assets/esri/core/workers/chunks/{6c79e8e840c1d027fbb2.js → 7e0daf0864005cdd63c5.js} +1 -1
- package/assets/esri/core/workers/chunks/{c0c693c2e0043ecba4a5.js → 817fd88fe9a48caf69fb.js} +1 -1
- package/assets/esri/core/workers/chunks/82f7d83a2073d1b0111c.js +1 -0
- package/assets/esri/core/workers/chunks/860465c4f44c373d0a1c.js +1 -0
- package/assets/esri/core/workers/chunks/8795c4895df229cb471c.js +1 -0
- package/assets/esri/core/workers/chunks/{7bc746ea17f4e336e0b0.js → 8b5ee6be52e892fbd325.js} +1 -1
- package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +640 -0
- package/assets/esri/core/workers/chunks/942e527b9b92999886c7.js +1 -0
- package/assets/esri/core/workers/chunks/961995d8da45a9203255.js +1 -0
- package/assets/esri/core/workers/chunks/{08efd64acdfe46985293.js → 9a11ff75009fef45b8c1.js} +1 -1
- package/assets/esri/core/workers/chunks/{eb1d6614eeac6d26bb9c.js → 9a3344f1dd22c425b8cc.js} +1 -1
- package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +1 -0
- package/assets/esri/core/workers/chunks/a0b6eef4890cc61609dc.js +1 -0
- package/assets/esri/core/workers/chunks/{f37be7e517f0892014e3.js → a320c69bc7528ff0d0cf.js} +1 -1
- package/assets/esri/core/workers/chunks/{660713adb5a845dfa2ef.js → a40003dfe3c081d1a1d2.js} +1 -1
- package/assets/esri/core/workers/chunks/a70fa35b2d19460637e9.js +2 -0
- package/assets/esri/core/workers/chunks/ae74f722fb385e45fcf1.js +1 -0
- package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +1 -0
- package/assets/esri/core/workers/chunks/{63ea9035dcf9ce45560c.js → b684ff4bc93bd60d6a19.js} +1 -1
- package/assets/esri/core/workers/chunks/b78fb24b47d9f31f18c6.js +1 -0
- package/assets/esri/core/workers/chunks/b7a0a5b895ddd2d3d038.js +1 -0
- package/assets/esri/core/workers/chunks/{f3161c47a572194f6017.js → c06ae3a6ecc4a4fc67b2.js} +1 -1
- package/assets/esri/core/workers/chunks/{970e91de5dfbbc247afb.js → c5b7ff8650235c464dbf.js} +1 -1
- package/assets/esri/core/workers/chunks/c8dedc010fcc2382af24.js +1 -0
- package/assets/esri/core/workers/chunks/cd2b2babcdc130b4c368.js +1 -0
- package/assets/esri/core/workers/chunks/{5a6523c903b11dea77d4.js → cdef9c3f80588ae45a04.js} +1 -1
- package/assets/esri/core/workers/chunks/{e973cab79ec2541cb81b.js → d19600336cb6023d3e34.js} +1 -1
- package/assets/esri/core/workers/chunks/{34c11e7c8762fe0c19fb.js → d39f5590022d910ee951.js} +1 -1
- package/assets/esri/core/workers/chunks/d412a43060441d347fb4.js +1 -0
- package/assets/esri/core/workers/chunks/{01c70c27aa3a955e2928.js → d41b847d08c42e5329d6.js} +2 -2
- package/assets/esri/core/workers/chunks/{10491b5b106bc5ad0b2b.js → d66f68a811c90739951a.js} +1 -1
- package/assets/esri/core/workers/chunks/d8c2bed12f937228c763.js +1 -0
- package/assets/esri/core/workers/chunks/de916dd0c11aefb6832e.js +1 -0
- package/assets/esri/core/workers/chunks/{63513e706fe55a1def15.js → e227ae2c1a63e30e62d9.js} +1 -1
- package/assets/esri/core/workers/chunks/{e4c350dc65aae121171d.js → e29d182460564c2a52ad.js} +1 -1
- package/assets/esri/core/workers/chunks/e87d02af6d6b05e19d93.js +1 -0
- package/assets/esri/core/workers/chunks/e95ce76b5b816256a519.js +1 -0
- package/assets/esri/core/workers/chunks/f0b5c140a5ba174572b6.js +1 -0
- package/assets/esri/core/workers/chunks/{ce3b5b83237cf37ff523.js → f286680e363eefdf27df.js} +1 -1
- package/assets/esri/core/workers/chunks/f7698c855800e0af3038.js +1 -0
- package/assets/esri/core/workers/chunks/f931d560f3f14598f454.js +1 -0
- package/assets/esri/core/workers/chunks/{9890c85a238879490926.js → f9f331c76c96743d8522.js} +1 -1
- package/assets/esri/core/workers/chunks/fbcf09526dc1bbe94b91.js +2 -0
- package/assets/esri/core/workers/chunks/fcbacca99c5a3ee5b69a.js +1 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
- package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
- package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +22 -6
- 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/BasemapGallery/t9n/BasemapGallery.json +1 -1
- package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
- package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
- package/assets/esri/widgets/Features/t9n/Features_en.json +1 -1
- package/chunks/GaussianSplatShadow.glsl.js +11 -9
- package/chunks/Path.glsl.js +22 -17
- package/chunks/ShadowCastVisualize.glsl.js +26 -18
- package/config.js +1 -1
- package/geometry/support/DoubleArray.js +1 -1
- package/geometry/support/Indices.js +1 -1
- package/kernel.js +1 -1
- package/layers/DimensionLayer.d.ts +22 -0
- package/layers/FeatureLayer.d.ts +15 -12
- package/layers/FeatureLayer.js +1 -1
- package/layers/GaussianSplatLayer.d.ts +22 -0
- package/layers/KnowledgeGraphLayer.d.ts +6 -4
- package/layers/KnowledgeGraphLayer.js +1 -1
- package/layers/LineOfSightLayer.d.ts +22 -0
- package/layers/LinkChartLayer.js +1 -1
- package/layers/Lyr3DWasmPerSceneView.js +1 -1
- package/layers/PointCloudLayer.d.ts +22 -0
- package/layers/ViewshedLayer.d.ts +22 -0
- package/layers/knowledgeGraph/KnowledgeGraphLayerDataManager.js +1 -1
- package/layers/knowledgeGraph/KnowledgeGraphSublayer.js +1 -1
- package/layers/support/Field.d.ts +1 -0
- package/layers/support/Field.js +1 -1
- package/layers/support/SceneModification.js +1 -1
- package/layers/support/featureLayerUtils.js +1 -1
- package/layers/support/types.d.ts +1 -1
- package/layers/types.d.ts +1 -0
- package/linkChart/LinkChartProperties.js +1 -1
- package/linkChart/utils.js +1 -1
- package/package.json +1 -1
- package/rest/support/Query.d.ts +1 -0
- package/support/revision.js +1 -1
- package/symbols/cim/animationUtils.js +1 -1
- package/symbols/cim/defaultCIMValues.js +1 -1
- package/symbols/cim/types.d.ts +45 -1
- package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
- package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
- package/views/2d/engine/webgl/animations/instructions.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedFillShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedLineShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/animated/AnimatedMarkerShader.js +1 -1
- package/views/2d/engine/webgl/shaderGraph/techniques/shaders/hittestUtils.js +1 -1
- package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
- package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
- package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
- package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
- package/views/2d/support/clippingUtils.js +1 -1
- package/views/2d/support/hitTestUtils.js +1 -1
- package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
- package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedDrawToolRenderer.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedPlacementController.js +1 -1
- package/views/3d/analysis/Viewshed/ViewshedSubTool.js +1 -1
- package/views/3d/analysis/Viewshed/placementUtils.js +1 -1
- package/views/3d/analysis/Viewshed/viewshedToolManipulatorUtils.js +1 -1
- package/views/3d/environment/EnvironmentManager.js +1 -1
- package/views/3d/input/SceneInputManager.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
- package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +1 -1
- package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
- package/views/3d/layers/graphics/extrudeUtils.js +1 -1
- package/views/3d/layers/graphics/tessellationUtils.js +1 -1
- package/views/3d/support/engineContent/line.js +1 -1
- package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
- package/views/3d/support/renderInfoUtils/polygon.js +1 -1
- package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +233 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +19 -0
- package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +64 -40
- package/views/3d/webgl-engine/core/shaderLibrary/output/OutputDepth.glsl.js +3 -3
- package/views/3d/webgl-engine/core/shaderModules/Float2sPassUniform.js +2 -0
- package/views/3d/webgl-engine/core/shaderModules/IntegersPassUniform.js +2 -0
- package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
- package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
- package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
- package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
- package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
- package/views/3d/webgl-engine/lib/Renderer.js +1 -1
- package/views/3d/webgl-engine/lib/ShadowCastRenderer.js +1 -1
- package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
- package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
- package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
- package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
- package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
- package/views/3d/webgl-engine/shaders/GaussianSplatShadow.glsl.js +1 -1
- package/views/3d/webgl-engine/shaders/ShadowCastVisualizeTechniqueConfiguration.js +1 -1
- package/views/View2D.d.ts +1 -1
- package/views/draw/DrawTool.d.ts +34 -1
- package/views/input/EventMatch.js +1 -1
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +17 -3
- package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
- package/widgets/BatchAttributeForm/css.js +1 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +25 -1
- package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.d.ts +46 -1
- package/widgets/BatchAttributeForm/inputs/RelationshipElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/UtilityNetworkAssociationsElementInput.js +1 -1
- package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
- package/widgets/BatchAttributeForm/interfaceUtils.js +1 -1
- package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
- package/widgets/BatchAttributeForm/types.d.ts +1 -1
- package/widgets/BatchAttributeForm.d.ts +2 -1
- package/widgets/BatchAttributeForm.js +1 -1
- package/widgets/Directions/DirectionsViewModel.js +1 -1
- package/widgets/Directions.js +1 -1
- package/widgets/Editor/UpdateFeaturesWorkflow.js +1 -1
- package/widgets/Editor/UpdateWorkflow.js +1 -1
- package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
- package/widgets/FeatureForm/RelationshipInput.d.ts +3 -3
- package/widgets/FeatureForm/RelationshipInput.js +1 -1
- package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
- package/widgets/FeatureTable/FeatureTableViewModel.d.ts +7 -1
- package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
- package/widgets/FeatureTable/support/FeatureStore.js +1 -1
- package/widgets/FeatureTable/support/types.d.ts +11 -1
- package/widgets/FeatureTable.d.ts +7 -1
- package/widgets/FeatureTable.js +1 -1
- package/widgets/Sketch/SketchViewModel.js +1 -1
- package/widgets/support/SelectionToolbar/SelectionToolbarViewModel.d.ts +66 -6
- package/widgets/support/SelectionToolbar/types.d.ts +20 -1
- package/assets/esri/core/workers/chunks/03babc21d1781142a974.js +0 -1
- package/assets/esri/core/workers/chunks/0c8e6ccb5a8174718d62.js +0 -640
- package/assets/esri/core/workers/chunks/0e6a388d51d9dbae46ba.js +0 -1
- package/assets/esri/core/workers/chunks/13f0e08de2dfab07d212.js +0 -1
- package/assets/esri/core/workers/chunks/1c0e8808d14d8e6dde2c.js +0 -1
- package/assets/esri/core/workers/chunks/1c8c8050d60205cf2156.js +0 -1
- package/assets/esri/core/workers/chunks/23119a1b1310b7dab2aa.js +0 -1
- package/assets/esri/core/workers/chunks/282f3d364411efac7b80.js +0 -1
- package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +0 -1
- package/assets/esri/core/workers/chunks/313a89b334e3518d30a4.js +0 -1
- package/assets/esri/core/workers/chunks/340c68d09d2e8bef6727.js +0 -2
- package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +0 -1
- package/assets/esri/core/workers/chunks/3fed503185ea1913fb84.js +0 -1
- package/assets/esri/core/workers/chunks/4020f95d8131493f799e.js +0 -1
- package/assets/esri/core/workers/chunks/4255ad7601c7a7621b71.js +0 -1
- package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +0 -1
- package/assets/esri/core/workers/chunks/4a41f98210f1da3b5041.js +0 -1
- package/assets/esri/core/workers/chunks/4afe76de6e82e86fe697.js +0 -1
- package/assets/esri/core/workers/chunks/5a85cbc04c64091d7f46.js +0 -1
- package/assets/esri/core/workers/chunks/5e5c7cc74ff1c9603aff.js +0 -1
- package/assets/esri/core/workers/chunks/601edefd8da4eb2eda28.js +0 -1
- package/assets/esri/core/workers/chunks/6f02681bcaa9bef501fc.js +0 -1
- package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
- package/assets/esri/core/workers/chunks/7c077e1a63ab97bf3e87.js +0 -1
- package/assets/esri/core/workers/chunks/7dc9ff66e1eceadbae24.js +0 -1
- package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +0 -1
- package/assets/esri/core/workers/chunks/8a1751187a20b6578875.js +0 -1
- package/assets/esri/core/workers/chunks/958617c3a9854ea04e06.js +0 -1
- package/assets/esri/core/workers/chunks/9ebc461529d5286fa2c2.js +0 -2
- package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +0 -1
- package/assets/esri/core/workers/chunks/a93a058678c8c8996d54.js +0 -1
- package/assets/esri/core/workers/chunks/aca9591d3467a24f8329.js +0 -1
- package/assets/esri/core/workers/chunks/acb8cff06142f828fb78.js +0 -1
- package/assets/esri/core/workers/chunks/b02a68bbab07557cf02d.js +0 -1
- package/assets/esri/core/workers/chunks/b891d95b7858665cd6c1.js +0 -1
- package/assets/esri/core/workers/chunks/c91d4f1b42cfe474df52.js +0 -1
- package/assets/esri/core/workers/chunks/d00b9c1fd0865bf8f317.js +0 -1
- package/assets/esri/core/workers/chunks/d02aa7438f46c1c2167a.js +0 -2
- package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +0 -1
- package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +0 -1
- package/assets/esri/core/workers/chunks/deab352545c34cac148c.js +0 -1
- package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +0 -1
- package/assets/esri/core/workers/chunks/e5854a3f69dffaf9464d.js +0 -2
- package/assets/esri/core/workers/chunks/e8518bd3596543b387f8.js +0 -1
- package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +0 -1
- package/assets/esri/core/workers/chunks/f91a2c69a93295cf4de6.js +0 -1
- package/assets/esri/core/workers/chunks/fec3fffcf854a6226df4.js +0 -1
- /package/assets/esri/core/workers/chunks/{e5854a3f69dffaf9464d.js.LICENSE.txt → 32f128a1615d71bbe899.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{340c68d09d2e8bef6727.js.LICENSE.txt → 40df608337d562553ce1.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{481dc7503587972a6bd2.js.LICENSE.txt → 701125f6cdd91ff3655f.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{d02aa7438f46c1c2167a.js.LICENSE.txt → a70fa35b2d19460637e9.js.LICENSE.txt} +0 -0
- /package/assets/esri/core/workers/chunks/{9ebc461529d5286fa2c2.js.LICENSE.txt → fbcf09526dc1bbe94b91.js.LICENSE.txt} +0 -0
package/layers/FeatureLayer.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 r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import E from"../graphic/FeatureGraphicOrigin.js";import L from"./Layer.js";import{MemorySource as D}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as x}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as q}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as A}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as R}from"./mixins/OperationalLayer.js";import{OrderedLayer as U}from"./mixins/OrderedLayer.js";import{PortalLayer as V}from"./mixins/PortalLayer.js";import{PublishableLayer as N}from"./mixins/PublishableLayer.js";import{RefreshableLayer as G}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as J}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as B}from"./mixins/TemporalLayer.js";import{TrackableLayer as W}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as H,parse as Z,cleanTitle as $}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as k,id as z,labelsVisible as K,opacityDrawingInfo as X,legendEnabled as Y,listMode as ee,popupEnabled as te,screenSizePerspectiveEnabled as re}from"./support/commonProperties.js";import{ensureLayerCredential as ie,computeEffectiveEditingEnabled as oe,readGlobalIdField as se,readObjectIdField as ae,createDefaultRenderer as ne,addAttachment as le,updateAttachment as pe,applyEdits as ue,uploadAssets as de,createQuery as ye,deleteAttachments as ce,fetchRecomputedExtents as me,getFeatureType as he,getFieldDomain as fe,queryAttachments as be,queryObjectIds as ge,queryFeatureCount as we,queryExtent as ve,queryRelatedFeatures as Fe,queryRelatedFeaturesCount as Te,validateBinsQuery as je,hasDataChanged as Se,geometryTypeKebabDict as Ie}from"./support/featureLayerUtils.js";import Ee from"./support/FeatureTemplate.js";import Le from"./support/FeatureType.js";import De from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as _e,fieldConfigurationsFromPopupTemplate as Ce,fieldConfigurationsFromFields as Pe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Oe}from"./support/fieldProperties.js";import{fixRendererFields as xe,fixTimeInfoFields as qe}from"./support/fieldUtils.js";import Me from"./support/LabelClass.js";import{reader as Ae}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Re from"./support/SymbolLayerDrawing.js";import Ue from"./support/TimeInfo.js";import Ve from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ne}from"./support/versionUtils.js";import{read as Ge}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Je}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Be,rendererTypes as We}from"../renderers/support/typeUtils.js";import He from"../rest/layerSources/DynamicDataLayer.js";import Ze from"../rest/support/FeatureSet.js";import $e from"../rest/support/Query.js";import{isNumber as ke}from"../support/guards.js";import{createPopupTemplate as ze}from"../support/popupUtils.js";import{symbolTypes as Ke}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Xe}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as Ye}from"../webdoc/support/unsupportedErrors.js";import{reader as et}from"../core/accessorSupport/decorators/reader.js";import{writer as tt}from"../core/accessorSupport/decorators/writer.js";const rt="FeatureLayer";function it(e){return e&&e instanceof a}const ot=Oe();function st(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let at=class extends(A(Q(M(N(q(x(P(U(B(W(J(G(C(R(V(m(O(_(s(L)))))))))))))))))))){constructor(...e){super(...e),this.reload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new E(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ie(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ve({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return oe(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=_e(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Ce(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return se(t.layerDefinition||t)}readObjectIdField(e,t){return ae(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){xe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ge(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return ne(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new D({layer:this,items:e})),it(t)&&this._resetMemorySource(t),it(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=Ze.fromJSON(t.featureSet);return new D({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>Ee.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?H(this.url,r):r;let e=r;if(!e&&this.url){const t=Z(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),$(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Le.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await le(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await pe(this,e,t,r,rt);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return ue(this,e,t)}async uploadAssets(e,t){return de(this,e,t)}createFieldConfigurations(){return Pe(this)}createPopupTemplate(e){return ze(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ye(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await ce(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return me(this,e,rt)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return he(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return fe(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return be(this,e,t,rt)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures($e.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await ge(this,e,t,rt)}async queryFeatureCount(e,t){return we(this,e,t,rt)}async queryExtent(e,t){return ve(this,e,t,rt)}async queryRelatedFeatures(e,t){return Fe(this,e,t,rt)}async queryRelatedFeaturesCount(e,t){return Te(this,e,t,rt)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(rt,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(rt,"Layer source does not support queryAttributeBins capability");je(e,i,rt);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ke)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return Ye(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return Ye(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return Ye(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return Ye(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(rt,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ne(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),xe(this.renderer,this.fieldsIndex),qe(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Je(this,{origin:"service"})}async hasDataChanged(){return Se(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],at.prototype,"_titleCreator",null),r([F(k)],at.prototype,"attributeTableTemplate",void 0),r([et("service","capabilities")],at.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],at.prototype,"charts",void 0),r([F({readOnly:!0})],at.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],at.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],at.prototype,"displayField",void 0),r([F({types:Ke,readOnly:!0})],at.prototype,"defaultSymbol",void 0),r([F({type:He})],at.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],at.prototype,"editingEnabled",null),r([et(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],at.prototype,"readEditingEnabled",null),r([et("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],at.prototype,"readEditingEnabledFromWebMap",null),r([tt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabled",null),r([tt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],at.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],at.prototype,"featureTitleFields",null),r([F({type:[De],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],at.prototype,"fieldConfigurations",null),r([F({...ot.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:st}}}}})],at.prototype,"fields",void 0),r([F(ot.fieldsIndex)],at.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],at.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],at.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:st,writer(e,t,r){const i=e?Ie.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Ie.read}}})],at.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],at.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],at.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],at.prototype,"hasZ",void 0),r([F(z)],at.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],at.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],at.prototype,"isTable",void 0),r([et("service","isTable",["type","geometryType"]),et("isTable",["layerDefinition.type","layerDefinition.geometryType"])],at.prototype,"readIsTable",null),r([tt("web-map","isTable")],at.prototype,"writeIsTable",null),r([F(K)],at.prototype,"labelsVisible",void 0),r([F({type:[Me],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Ae,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Ae,write:{layerContainerTypes:j}}})],at.prototype,"labelingInfo",void 0),r([F({type:Re,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],at.prototype,"symbolLayerDrawing",void 0),r([F((()=>{const e=d(X);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Xe(e),t)}}},e})())],at.prototype,"opacity",void 0),r([F(Y)],at.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(ee.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],at.prototype,"listMode",void 0),r([et("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],at.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:st}}}}})],at.prototype,"objectIdField",void 0),r([et("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],at.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],at.prototype,"operationalLayerType",void 0),r([F(ot.outFields)],at.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],at.prototype,"path",void 0),r([F(te)],at.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],at.prototype,"popupTemplate",void 0),r([tt("popupTemplate")],at.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],at.prototype,"defaultPopupTemplate",null),r([F({types:We,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Be,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],at.prototype,"renderer",null),r([et("service","renderer",["drawingInfo.renderer","defaultSymbol"]),et("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],at.prototype,"readRenderer",null),r([F()],at.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(re);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],at.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],at.prototype,"source",null),r([et("portal-item","source",["featureSet"]),et("web-map","source",["featureSet"])],at.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],at.prototype,"spatialReference",void 0),r([F({type:Number})],at.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],at.prototype,"subtypeField",void 0),r([F({readOnly:!1})],at.prototype,"subtypes",void 0),r([F({type:[Ee]})],at.prototype,"templates",void 0),r([et("templates",["editFieldsInfo","creatorField","editorField","templates"])],at.prototype,"readTemplates",null),r([F({type:Ue})],at.prototype,"timeInfo",void 0),r([F()],at.prototype,"title",void 0),r([et("service","title",["name"]),et("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],at.prototype,"readTitle",null),r([et("web-map","title",["layerDefinition.name","title"])],at.prototype,"readTitleFromWebMap",null),r([F({type:String})],at.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],at.prototype,"type",void 0),r([F({type:String})],at.prototype,"typeIdField",void 0),r([et("service","typeIdField"),et("typeIdField",["layerDefinition.typeIdField"])],at.prototype,"readTypeIdField",null),r([F({type:[Le]})],at.prototype,"types",void 0),r([et("service","types",["types"]),et("types",["layerDefinition.types"])],at.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],at.prototype,"visible",void 0),r([et("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],at.prototype,"readVisible",null),at=r([T("esri.layers.FeatureLayer")],at);export{at as default};
|
|
2
|
+
import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import E from"../graphic/FeatureGraphicOrigin.js";import L from"./Layer.js";import{MemorySource as D}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as x}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as q}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as A}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as R}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as Q}from"./mixins/OperationalLayer.js";import{OrderedLayer as U}from"./mixins/OrderedLayer.js";import{PortalLayer as V}from"./mixins/PortalLayer.js";import{PublishableLayer as N}from"./mixins/PublishableLayer.js";import{RefreshableLayer as G}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as J}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as B}from"./mixins/TemporalLayer.js";import{TrackableLayer as W}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as H,parse as Z,cleanTitle as $}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as k,id as z,labelsVisible as K,opacityDrawingInfo as X,legendEnabled as Y,listMode as ee,popupEnabled as te,screenSizePerspectiveEnabled as re}from"./support/commonProperties.js";import{ensureLayerCredential as ie,computeEffectiveEditingEnabled as oe,readGlobalIdField as se,readObjectIdField as ae,createDefaultRenderer as ne,addAttachment as le,updateAttachment as pe,applyEdits as ue,uploadAssets as de,createQuery as ye,deleteAttachments as ce,fetchRecomputedExtents as me,getFeatureType as he,getFieldDomain as fe,queryAttachments as be,queryObjectIds as ge,queryFeatureCount as we,queryExtent as ve,queryRelatedFeatures as Fe,queryRelatedFeaturesCount as Te,validateBinsQuery as je,hasDataChanged as Se,geometryTypeKebabDict as Ie}from"./support/featureLayerUtils.js";import Ee from"./support/FeatureTemplate.js";import Le from"./support/FeatureType.js";import De from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as _e,fieldConfigurationsFromPopupTemplate as Ce,fieldConfigurationsFromFields as Pe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Oe}from"./support/fieldProperties.js";import{fixRendererFields as xe,fixTimeInfoFields as qe}from"./support/fieldUtils.js";import Me from"./support/LabelClass.js";import{reader as Ae}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Re}from"./support/serviceCapabilitiesUtils.js";import Qe from"./support/SymbolLayerDrawing.js";import Ue from"./support/TimeInfo.js";import Ve from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ne}from"./support/versionUtils.js";import{read as Ge}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Je}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Be,rendererTypes as We}from"../renderers/support/typeUtils.js";import He from"../rest/layerSources/DynamicDataLayer.js";import Ze from"../rest/support/FeatureSet.js";import $e from"../rest/support/Query.js";import{isNumber as ke}from"../support/guards.js";import{createPopupTemplate as ze}from"../support/popupUtils.js";import{symbolTypes as Ke}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Xe}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as Ye}from"../webdoc/support/unsupportedErrors.js";import{reader as et}from"../core/accessorSupport/decorators/reader.js";import{writer as tt}from"../core/accessorSupport/decorators/writer.js";const rt="FeatureLayer";function it(e){return e&&e instanceof a}const ot=Oe();function st(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let at=class extends(A(R(M(N(q(x(P(U(B(W(J(G(C(Q(V(m(O(_(s(L)))))))))))))))))))){constructor(...e){super(...e),this._debounceReload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new E(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ie(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}reload(){return this._debounceReload()}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ve({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Re(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return oe(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=_e(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Ce(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return se(t.layerDefinition||t)}readObjectIdField(e,t){return ae(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){xe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ge(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return ne(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new D({layer:this,items:e})),it(t)&&this._resetMemorySource(t),it(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=Ze.fromJSON(t.featureSet);return new D({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>Ee.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?H(this.url,r):r;let e=r;if(!e&&this.url){const t=Z(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),$(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Le.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await le(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await pe(this,e,t,r,rt);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return ue(this,e,t)}async uploadAssets(e,t){return de(this,e,t)}createFieldConfigurations(){return Pe(this)}createPopupTemplate(e){return ze(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ye(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await ce(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return me(this,e,rt)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return he(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return fe(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return be(this,e,t,rt)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures($e.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await ge(this,e,t,rt)}async queryFeatureCount(e,t){return we(this,e,t,rt)}async queryExtent(e,t){return ve(this,e,t,rt)}async queryRelatedFeatures(e,t){return Fe(this,e,t,rt)}async queryRelatedFeaturesCount(e,t){return Te(this,e,t,rt)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(rt,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(rt,"Layer source does not support queryAttributeBins capability");je(e,i,rt);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ke)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return Ye(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return Ye(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return Ye(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return Ye(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(rt,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ne(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),xe(this.renderer,this.fieldsIndex),qe(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Je(this,{origin:"service"})}async hasDataChanged(){return Se(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],at.prototype,"_titleCreator",null),r([F(k)],at.prototype,"attributeTableTemplate",void 0),r([et("service","capabilities")],at.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],at.prototype,"charts",void 0),r([F({readOnly:!0})],at.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],at.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],at.prototype,"displayField",void 0),r([F({types:Ke,readOnly:!0})],at.prototype,"defaultSymbol",void 0),r([F({type:He})],at.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],at.prototype,"editingEnabled",null),r([et(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],at.prototype,"readEditingEnabled",null),r([et("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],at.prototype,"readEditingEnabledFromWebMap",null),r([tt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabled",null),r([tt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],at.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],at.prototype,"featureTitleFields",null),r([F({type:[De],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],at.prototype,"fieldConfigurations",null),r([F({...ot.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:st}}}}})],at.prototype,"fields",void 0),r([F(ot.fieldsIndex)],at.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],at.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],at.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:st,writer(e,t,r){const i=e?Ie.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Ie.read}}})],at.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],at.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],at.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],at.prototype,"hasZ",void 0),r([F(z)],at.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],at.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],at.prototype,"isTable",void 0),r([et("service","isTable",["type","geometryType"]),et("isTable",["layerDefinition.type","layerDefinition.geometryType"])],at.prototype,"readIsTable",null),r([tt("web-map","isTable")],at.prototype,"writeIsTable",null),r([F(K)],at.prototype,"labelsVisible",void 0),r([F({type:[Me],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Ae,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Ae,write:{layerContainerTypes:j}}})],at.prototype,"labelingInfo",void 0),r([F({type:Qe,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],at.prototype,"symbolLayerDrawing",void 0),r([F((()=>{const e=d(X);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Xe(e),t)}}},e})())],at.prototype,"opacity",void 0),r([F(Y)],at.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(ee.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],at.prototype,"listMode",void 0),r([et("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],at.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:st}}}}})],at.prototype,"objectIdField",void 0),r([et("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],at.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],at.prototype,"operationalLayerType",void 0),r([F(ot.outFields)],at.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],at.prototype,"path",void 0),r([F(te)],at.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],at.prototype,"popupTemplate",void 0),r([tt("popupTemplate")],at.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],at.prototype,"defaultPopupTemplate",null),r([F({types:We,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Be,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],at.prototype,"renderer",null),r([et("service","renderer",["drawingInfo.renderer","defaultSymbol"]),et("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],at.prototype,"readRenderer",null),r([F()],at.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(re);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],at.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],at.prototype,"source",null),r([et("portal-item","source",["featureSet"]),et("web-map","source",["featureSet"])],at.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],at.prototype,"spatialReference",void 0),r([F({type:Number})],at.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],at.prototype,"subtypeField",void 0),r([F({readOnly:!1})],at.prototype,"subtypes",void 0),r([F({type:[Ee]})],at.prototype,"templates",void 0),r([et("templates",["editFieldsInfo","creatorField","editorField","templates"])],at.prototype,"readTemplates",null),r([F({type:Ue})],at.prototype,"timeInfo",void 0),r([F()],at.prototype,"title",void 0),r([et("service","title",["name"]),et("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],at.prototype,"readTitle",null),r([et("web-map","title",["layerDefinition.name","title"])],at.prototype,"readTitleFromWebMap",null),r([F({type:String})],at.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],at.prototype,"type",void 0),r([F({type:String})],at.prototype,"typeIdField",void 0),r([et("service","typeIdField"),et("typeIdField",["layerDefinition.typeIdField"])],at.prototype,"readTypeIdField",null),r([F({type:[Le]})],at.prototype,"types",void 0),r([et("service","types",["types"]),et("types",["layerDefinition.types"])],at.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],at.prototype,"visible",void 0),r([et("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],at.prototype,"readVisible",null),at=r([T("esri.layers.FeatureLayer")],at);export{at as default};
|
|
@@ -134,6 +134,28 @@ export default class GaussianSplatLayer extends GaussianSplatLayerSuperclass {
|
|
|
134
134
|
*/
|
|
135
135
|
get elevationInfo(): ElevationInfo | null | undefined;
|
|
136
136
|
set elevationInfo(value: ElevationInfoProperties | null | undefined);
|
|
137
|
+
/**
|
|
138
|
+
* The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent
|
|
139
|
+
* transparent and `1` is completely opaque.
|
|
140
|
+
*
|
|
141
|
+
* > [!WARNING]
|
|
142
|
+
* >
|
|
143
|
+
* > **Known Limitations**
|
|
144
|
+
* >
|
|
145
|
+
* > In a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), modifying opacity is not supported for
|
|
146
|
+
* > [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/),
|
|
147
|
+
* > [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/),
|
|
148
|
+
* > [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMesh3DTilesLayer/),
|
|
149
|
+
* > [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMeshLayer/),
|
|
150
|
+
* > [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/),
|
|
151
|
+
* > [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/), and [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/).
|
|
152
|
+
*
|
|
153
|
+
* @default 1
|
|
154
|
+
* @example
|
|
155
|
+
* // Makes the layer 50% transparent
|
|
156
|
+
* layer.opacity = 0.5;
|
|
157
|
+
*/
|
|
158
|
+
get opacity(): number;
|
|
137
159
|
/**
|
|
138
160
|
* The spatial reference of the layer.
|
|
139
161
|
*
|
|
@@ -528,18 +528,20 @@ export default class KnowledgeGraphLayer extends KnowledgeGraphLayerSuperclass {
|
|
|
528
528
|
*/
|
|
529
529
|
addRecords(records: IdTypePair[]): Promise<void>;
|
|
530
530
|
/**
|
|
531
|
+
* Converts a given sublayer to use dynamic membership, meaning all records of the sublayer's named type will be included in the layer.
|
|
532
|
+
*
|
|
531
533
|
* @param typeName - The name of the named type to convert
|
|
532
|
-
* @returns Resolves when the sublayer is converted to dynamic data
|
|
533
534
|
*/
|
|
534
535
|
convertSublayerToDynamicData(typeName: string): void;
|
|
535
536
|
/**
|
|
537
|
+
* Converts a given sublayer to use explicit membership, with an empty member list.
|
|
538
|
+
*
|
|
536
539
|
* @param typeName - The name of the named type to convert
|
|
537
|
-
* @returns Resolves when the sublayer is converted to explicit membership
|
|
538
540
|
*/
|
|
539
541
|
convertSublayerToExplicitMembership(typeName: string): void;
|
|
540
|
-
/**
|
|
542
|
+
/** Converts the layer to use explicit membership with an empty inclusion definition for all existing sublayers. Specific entities and relationships can then be added to the layer using the addRecords method. */
|
|
541
543
|
convertToExplicitMembership(): void;
|
|
542
|
-
/**
|
|
544
|
+
/** Converts the layer to use all data for its existing sublayers. */
|
|
543
545
|
convertToFullyDynamicData(): void;
|
|
544
546
|
/**
|
|
545
547
|
* @param typeName - The name of the named type to create a sublayer for
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as d,sync as h}from"../core/reactiveUtils.js";import{isAbsolute as p,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{idToName as f,nameToId as g}from"../core/accessorSupport/PropertyOrigin.js";import w from"./Layer.js";import{KnowledgeGraphLayerDataManager as M}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import b from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{getTitleFromServerUrl as T,initializeLayersFromClientData as D,getUserKGSPrivileges as _,createCapabilitiesFromKnowledgeGraph as S}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as k}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as C}from"./mixins/PortalLayer.js";import{RefreshableLayer as A}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as G}from"./mixins/ScaleRangeLayer.js";import{url as I}from"./support/commonProperties.js";import{areResourcesSafe as N}from"../linkChart/utils.js";import{fetchKnowledgeGraph as E}from"../rest/knowledgeGraphService.js";import{a as x,c as R}from"../chunks/persistableUrlUtils.js";import{timeZoneProperty as O}from"../time/timeZoneUtils.js";import{reader as U}from"../core/accessorSupport/decorators/reader.js";import{writer as K}from"../core/accessorSupport/decorators/writer.js";let P=class extends(L(G(A(v(j(C(r(k(w))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(b)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(b)),this.type="knowledge-graph",this.url=null,!e?.title&&e?.url&&(this.title=T(e.url)),this.addHandles(d(()=>this.layers.concat(this.tables),(e,i)=>this._handleSublayersChange(e,i),h))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){l(i)}await this._fetchMetadata(e),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await D(this)}async _fetchMetadata(e){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const i=await E(this.url);this.knowledgeGraph=i;const{edit:t,fullEdit:a,updateItem:n}=await _(i.serviceDefinition.serviceItemId,this.url,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",n),this.read({dateFieldsTimeReference:i.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new M({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){const t=this.definitionSetMap?await i(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,f(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))});else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(i=>{e(i)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=new Set,t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.add(a.typeName));o(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await D(this,Array.from(i)),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach(e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new b({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach(i=>{i.parentCompositeLayer=this;const t=e.find(e=>e.type===i.graphType&&e.name===i.graphTypeName);t&&(i.objectType=t,this._updateSublayerCaches(t))})}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a,s){e[i]="<pending>",z(this.inclusionModeDefinition).then(n=>{const o=H(a);e[i]=o.itemRelativeUrl,t.toAdd.push({resource:o,content:{type:"blob",blob:n},compress:!1,finish:e=>{this.definitionSetMap=e.url}}),s()})}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,i,t){return x(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,n=a?.resources,o=g(a?.origin);n?.pendingOperations.push(new Promise(r=>{N(e??"",s?.itemUrl??"").then(l=>{if(!s||!n||null==o)return e&&(i[t]=R(e,a)),void r();const{inclusionModeDefinition:d}=this;if(!d||this._displaysAllRecords(d))return this.definitionSetMap=null,void r();const h=this.originIdOf("inclusionModeDefinition");if(7===h||this._namedTypesModified||!l||o<h)this._saveUrlAsNewResource(i,t,n,s,r);else if(o===h&&e){const o=R(e,a);p(o)?this._saveUrlAsNewResource(i,t,n,s,r):i[t]=o}})}))}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):n.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return S(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,i)=>{const t=o(this.sublayerIdsCache,i,()=>new Set);e.members?.forEach(e=>{t.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,()=>new Set);const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await D(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?n.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition||n.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made"),this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this.setAtOrigin("inclusionModeDefinition",this.dataManager.inclusionModeDefinition,f(7)),this._refreshNamedTypes()}convertToExplicitMembership(){this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made"),this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.setAtOrigin("inclusionModeDefinition",this.dataManager.inclusionModeDefinition,f(7));for(const e of this.dataManager.sublayerCaches.keys())o(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._refreshNamedTypes()}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([m()],P.prototype,"dataManager",void 0),e([m({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],P.prototype,"definitionSetMap",void 0),e([U("definitionSetMap")],P.prototype,"readDefinitionSetMap",null),e([K("definitionSetMap")],P.prototype,"writeDefinitionSetMap",null),e([m()],P.prototype,"inclusionModeDefinition",null),e([m()],P.prototype,"knowledgeGraph",void 0),e([m({type:a.ofType(b),json:{write:{ignoreOrigin:!0}}})],P.prototype,"layers",void 0),e([m()],P.prototype,"memberEntityTypes",void 0),e([m()],P.prototype,"memberRelationshipTypes",void 0),e([m({type:["KnowledgeGraphLayer"]})],P.prototype,"operationalLayerType",void 0),e([m()],P.prototype,"sublayerCapabilities",null),e([m()],P.prototype,"sublayerIdsCache",void 0),e([m({type:a.ofType(b),json:{write:{ignoreOrigin:!0}}})],P.prototype,"tables",void 0),e([m({json:{read:!1}})],P.prototype,"type",void 0),e([m(I)],P.prototype,"url",void 0),e([m(O("dateFieldsTimeReference"))],P.prototype,"dateFieldsTimeZone",void 0),P=e([u("esri.layers.KnowledgeGraphLayer")],P);const F=P;async function z(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function H(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{F as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{fetchAndConvertSerializedKnowledgeIdMap as i,serializeInclusionDefinitionToIdCollectionsMapPbf as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import a from"../core/Collection.js";import s from"../core/Error.js";import n from"../core/Logger.js";import{getOrCreateMapValue as o}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAbortError as l}from"../core/promiseUtils.js";import{watch as d,sync as h}from"../core/reactiveUtils.js";import{isAbsolute as p,join as y}from"../core/urlUtils.js";import{generateUUID as c}from"../core/uuid.js";import{property as m,subclass as u}from"../core/accessorSupport/decorators.js";import{idToName as f,nameToId as g}from"../core/accessorSupport/PropertyOrigin.js";import w from"./Layer.js";import{KnowledgeGraphLayerDataManager as M}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import b from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{getTitleFromServerUrl as T,initializeLayersFromClientData as D,getUserKGSPrivileges as _,createCapabilitiesFromKnowledgeGraph as S}from"./knowledgeGraph/layerUtils.js";import{ArcGISService as v}from"./mixins/ArcGISService.js";import{BlendLayer as L}from"./mixins/BlendLayer.js";import{CustomParametersMixin as k}from"./mixins/CustomParametersMixin.js";import{OperationalLayer as j}from"./mixins/OperationalLayer.js";import{PortalLayer as C}from"./mixins/PortalLayer.js";import{RefreshableLayer as I}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as A}from"./mixins/ScaleRangeLayer.js";import{url as G}from"./support/commonProperties.js";import{getCreationDatesForResources as N,areResourcesSafe as E}from"../linkChart/utils.js";import{fetchKnowledgeGraph as x}from"../rest/knowledgeGraphService.js";import{a as R,c as O}from"../chunks/persistableUrlUtils.js";import{timeZoneProperty as U}from"../time/timeZoneUtils.js";import{reader as K}from"../core/accessorSupport/decorators/reader.js";import{writer as P}from"../core/accessorSupport/decorators/writer.js";let F=class extends(L(A(I(v(j(C(r(k(w))))))))){constructor(e){super(e),this._graphTypeLookup=new Map,this._namedTypesModified=!1,this._idMapCreationDate=null,this.dataManager=null,this.definitionSetMap=null,this.knowledgeGraph=null,this.layers=new(a.ofType(b)),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="KnowledgeGraphLayer",this.sublayerIdsCache=new Map,this.tables=new(a.ofType(b)),this.type="knowledge-graph",this.url=null,!e?.title&&e?.url&&(this.title=T(e.url)),this.addHandles(d(()=>this.layers.concat(this.tables),(e,i)=>this._handleSublayersChange(e,i),h))}load(e){return this.addResolvingPromise(this._doLoad(e)),Promise.resolve(this)}async _doLoad(e){try{await this.loadFromPortal({supportedTypes:["Knowledge Graph Layer"]},e)}catch(i){l(i)}await this._fetchMetadata(e),await this._initializeLayerProperties(e),this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await D(this)}async _fetchMetadata(e){if(!this.url)throw new s("knowledge-graph:missing-url","KnowledgeGraphLayer must be created with a url");const i=await x(this.url);this.knowledgeGraph=i;const{edit:t,fullEdit:a,updateItem:n}=await _(i.serviceDefinition.serviceItemId,this.url,e);this._set("userHasEditingPrivileges",t),this._set("userHasFullEditingPrivileges",a),this._set("userHasUpdateItemPrivileges",n),this.read({dateFieldsTimeReference:i.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this._forEachGraphType(e=>{e.name&&this._graphTypeLookup.set(e.name,e)})}async _initializeLayerProperties(e){7===this.originIdOf("inclusionModeDefinition")?this._validateInclusionModeDefinition():await this._initializeInclusionModeDefinition(e),this._setMemberTypes(),this.dataManager=new M({knowledgeGraph:this.knowledgeGraph,inclusionModeDefinition:this.inclusionModeDefinition})}async _initializeInclusionModeDefinition(e){this._idMapCreationDate=(await N([this.definitionSetMap??""],this.portalItem?.itemUrl??"")).get(this.definitionSetMap??"")??null;const t=this.definitionSetMap?await i(this.definitionSetMap,!0,e?.signal?{signal:e.signal}:void 0):{generateAllSublayers:!0,namedTypeDefinitions:new Map};[...this.layers.toArray(),...this.tables.toArray()].forEach(e=>{const i=this._graphTypeLookup.get(e.graphTypeName);i&&!t.namedTypeDefinitions.has(i.name)&&t.namedTypeDefinitions.set(i.name,{useAllData:!0})}),this.setAtOrigin("inclusionModeDefinition",t,f(this.originIdOf("definitionSetMap")))}_validateInclusionModeDefinition(){const{inclusionModeDefinition:e}=this;if(!e)return;const{namedTypeDefinitions:i}=e;if(i?.size>0)i.forEach((e,t)=>{const a=this._graphTypeLookup.get(t);if(!a)return n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't in the data model and will be removed`),void i.delete(t);"relationship"!==a.type&&"entity"!==a.type&&(n.getLogger(this).warn(`A named type, ${t}, was in the inclusion list that wasn't properly modeled and will be removed`),i.delete(t))});else if(!e.generateAllSublayers)throw new s("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined")}_setMemberTypes(){let e=[],i=[];const{inclusionModeDefinition:t}=this,a=t?.namedTypeDefinitions;!t||t.generateAllSublayers?(e=this.knowledgeGraph.dataModel?.entityTypes??[],i=this.knowledgeGraph.dataModel?.relationshipTypes??[]):a&&a.size>0&&a.forEach((t,a)=>{const s=this._graphTypeLookup.get(a);switch(s?.type){case"relationship":i.push(s);break;case"entity":e.push(s)}}),this.memberEntityTypes=e,this.memberRelationshipTypes=i}_forEachGraphType(e){[...this.knowledgeGraph.dataModel?.entityTypes??[],...this.knowledgeGraph.dataModel?.relationshipTypes??[]].forEach(i=>{e(i)})}_refreshNamedTypes(){this._namedTypesModified=!0;for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}async _handleNewRecords(e){const i=new Set,t=[];for(const a of e){if(!this._graphTypeLookup.has(a.typeName))continue;!1===this.layers.concat(this.tables).some(e=>e.objectType.name===a.typeName)&&(this.dataManager.sublayerCaches.set(a.typeName,new Map),i.add(a.typeName));o(this.sublayerIdsCache,a.typeName,()=>new Set).add(a.id),t.push(a)}this.dataManager.addToLayer(t);for(const a of i){const e=this._graphTypeLookup.get(a);e&&(this._addSublayer(e),"entity"===e.type?this.dataManager.entityTypeNames.add(a):this.dataManager.relationshipTypeNames.add(a))}await D(this,Array.from(i)),this._refreshNamedTypes()}_createSublayers(e,i,t){e.forEach(e=>{const a=this._createSublayer(e);t(a)&&i.push(a),this._updateSublayerCaches(e)})}_addSublayer(e){const i=this._createSublayer(e);return i.geometryType?this.layers.push(i):this.tables.push(i),i}_createSublayer(e){return new b({objectType:e,parentCompositeLayer:this,graphType:e.type})}_updateSublayers(e,i){i.forEach(i=>{i.parentCompositeLayer=this;const t=e.find(e=>e.type===i.graphType&&e.name===i.graphTypeName);t&&(i.objectType=t,this._updateSublayerCaches(t))})}_updateSublayerCaches({name:e}){if(!e)return;const i=this.dataManager.sublayerCaches;i.has(e)||i.set(e,new Map)}_saveUrlAsNewResource(e,i,t,a,s,n){H(this.inclusionModeDefinition).then(n=>{const o=$(a);e[i]=o.itemRelativeUrl,t.toAdd.push({resource:o,content:{type:"blob",blob:n},compress:!1,finish:e=>{this.definitionSetMap=e.url}}),s()}).catch(e=>{n(e)})}_displaysAllRecords(e){for(const[,{useAllData:i}]of e.namedTypeDefinitions)if(!i)return!1;return!0}_handleSublayersChange(e,i){i&&(i.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}readDefinitionSetMap(e,i,t){return R(e,t)}writeDefinitionSetMap(e,i,t,a){const s=a?.portalItem,n=a?.resources,o=g(a?.origin);i[t]="<pending>",n?.pendingOperations.push(new Promise((r,l)=>{E(e??"",s?.itemUrl??"",this._idMapCreationDate).then(d=>{if(!s||!n||null==o)return e&&(i[t]=O(e,a)),void r();const{inclusionModeDefinition:h}=this;if(!h||this._displaysAllRecords(h))return this.definitionSetMap=null,void r();const y=this.originIdOf("inclusionModeDefinition");if(7===y||this._namedTypesModified||!d||o<y)this._saveUrlAsNewResource(i,t,n,s,r,l);else{if(o===y&&e){const o=O(e,a);return void(p(o)?this._saveUrlAsNewResource(i,t,n,s,r,l):(i[t]=o,r()))}r()}}).catch(e=>{l(e)})}))}set inclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("inclusionModeDefinition",e):n.getLogger(this).error("#inclusionModeDefinition","inclusionModeDefinition cannot be changed after the layer is loaded.")}get sublayerCapabilities(){return S(this.knowledgeGraph)}loadLayerAssumingLocalCache(){const e=[...this.memberEntityTypes,...this.memberRelationshipTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new a,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new a,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,i)=>{const t=o(this.sublayerIdsCache,i,()=>new Set);e.members?.forEach(e=>{t.add(e.id)})})}async addRecords(e){await this.load(),await this._handleNewRecords(e)}async createSublayerForNamedType(e){await this.load();const i=this._graphTypeLookup.get(e);if(!i)throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),o(this.sublayerIdsCache,e,()=>new Set);const t=this._addSublayer(i);return"entity"===i.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),await D(this,[e]),this._refreshNamedTypes(),t}convertSublayerToDynamicData(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);i?.useAllData?n.getLogger(this).warn("This Knowledge Graph Layer already uses dynamic membership for the sublayer - no conversion was made"):(this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!0}),this.sublayerIdsCache.delete(e),this._refreshNamedTypes())}convertSublayerToExplicitMembership(e){if(!this.dataManager.inclusionModeDefinition)throw new s("knowledge-graph:fully-dynamic-membership","This Knowledge Graph Layer already uses fully dynamic membership, individual sublayers cannot be converted");if(!this._graphTypeLookup.get(e))throw new s("knowledge-graph:missing-type","The specified type does not exist in the layer's graph data model.");const i=this.dataManager.inclusionModeDefinition.namedTypeDefinitions.get(e);if(!i||i.useAllData){if(!this.dataManager.sublayerCaches.has(e))throw new s("knowledge-graph:duplicate-type","The specified type does not exist as a sublayer.");this.sublayerIdsCache.set(e,new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map}),this._refreshNamedTypes()}else n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership for the sublayer - no conversion was made")}convertToFullyDynamicData(){this.dataManager.inclusionModeDefinition?(this.sublayerIdsCache.clear(),this.dataManager.inclusionModeDefinition=null,this._set("inclusionModeDefinition",this.dataManager.inclusionModeDefinition),this._refreshNamedTypes()):n.getLogger(this).warn("This Knowledge Graph Layer already uses fully dynamic membership - no conversion was made")}convertToExplicitMembership(){if(this.dataManager.inclusionModeDefinition&&this.dataManager.inclusionModeDefinition.namedTypeDefinitions.size>0&&[...this.dataManager.inclusionModeDefinition.namedTypeDefinitions.values()].every(e=>!1===e.useAllData))n.getLogger(this).warn("This Knowledge Graph Layer already uses explicit membership - no conversion was made");else{this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map};for(const e of this.dataManager.sublayerCaches.keys())o(this.sublayerIdsCache,e,()=>new Set),this.dataManager.inclusionModeDefinition.namedTypeDefinitions.set(e,{useAllData:!1,members:new Map});this._set("inclusionModeDefinition",this.dataManager.inclusionModeDefinition),this._refreshNamedTypes()}}async removeRecords(e){await this.load();const i=[];for(const t of e)!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(t.typeName)?.members?.has(t.id)&&i.push(t);this.dataManager.removeFromLayer(i);for(const t of i)this.sublayerIdsCache.get(t.typeName)?.delete(t.id);return this._refreshNamedTypes(),i}};e([m()],F.prototype,"dataManager",void 0),e([m({json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}})],F.prototype,"definitionSetMap",void 0),e([K("definitionSetMap")],F.prototype,"readDefinitionSetMap",null),e([P("definitionSetMap")],F.prototype,"writeDefinitionSetMap",null),e([m()],F.prototype,"inclusionModeDefinition",null),e([m()],F.prototype,"knowledgeGraph",void 0),e([m({type:a.ofType(b),json:{write:{ignoreOrigin:!0}}})],F.prototype,"layers",void 0),e([m()],F.prototype,"memberEntityTypes",void 0),e([m()],F.prototype,"memberRelationshipTypes",void 0),e([m({type:["KnowledgeGraphLayer"]})],F.prototype,"operationalLayerType",void 0),e([m()],F.prototype,"sublayerCapabilities",null),e([m()],F.prototype,"sublayerIdsCache",void 0),e([m({type:a.ofType(b),json:{write:{ignoreOrigin:!0}}})],F.prototype,"tables",void 0),e([m({json:{read:!1}})],F.prototype,"type",void 0),e([m(G)],F.prototype,"url",void 0),e([m(U("dateFieldsTimeReference"))],F.prototype,"dateFieldsTimeZone",void 0),F=e([u("esri.layers.KnowledgeGraphLayer")],F);const z=F;async function H(e){const i=await t(e);return new Blob([i],{type:"application/x-protobuf"})}function $(e){const i=`definitionSetMap-${c()}.dat`,t=y("knowledgeGraphLayer",i);return e.resourceFromPath(t)}export{z as default};
|
|
@@ -151,6 +151,28 @@ export default class LineOfSightLayer extends LineOfSightLayerSuperclass {
|
|
|
151
151
|
*/
|
|
152
152
|
get observer(): LineOfSightAnalysisObserver | null | undefined;
|
|
153
153
|
set observer(value: LineOfSightAnalysisObserverProperties | null | undefined);
|
|
154
|
+
/**
|
|
155
|
+
* The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent
|
|
156
|
+
* transparent and `1` is completely opaque.
|
|
157
|
+
*
|
|
158
|
+
* > [!WARNING]
|
|
159
|
+
* >
|
|
160
|
+
* > **Known Limitations**
|
|
161
|
+
* >
|
|
162
|
+
* > In a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), modifying opacity is not supported for
|
|
163
|
+
* > [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/),
|
|
164
|
+
* > [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/),
|
|
165
|
+
* > [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMesh3DTilesLayer/),
|
|
166
|
+
* > [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMeshLayer/),
|
|
167
|
+
* > [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/),
|
|
168
|
+
* > [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/), and [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/).
|
|
169
|
+
*
|
|
170
|
+
* @default 1
|
|
171
|
+
* @example
|
|
172
|
+
* // Makes the layer 50% transparent
|
|
173
|
+
* layer.opacity = 0.5;
|
|
174
|
+
*/
|
|
175
|
+
get opacity(): number;
|
|
154
176
|
/** The spatial reference of the layer. The spatial reference is derived from the observer. */
|
|
155
177
|
get spatialReference(): SpatialReference;
|
|
156
178
|
/**
|
package/layers/LinkChartLayer.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{__decorate as e}from"tslib";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import i from"../core/Collection.js";import{deprecated as a}from"../core/deprecate.js";import n from"../core/Error.js";import o from"../core/Logger.js";import{getOrCreateMapValue as s}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as l,isAbortError as h,createAbortError as d}from"../core/promiseUtils.js";import{watch as p,sync as c}from"../core/reactiveUtils.js";import{property as u,subclass as y}from"../core/accessorSupport/decorators.js";import{idToName as g}from"../core/accessorSupport/PropertyOrigin.js";import m from"../geometry/Extent.js";import f from"../geometry/Point.js";import L from"../geometry/Polyline.js";import{polygonCentroidPoint as w}from"../geometry/support/centroid.js";import k from"./Layer.js";import{convertFromGeometry as b}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as M,systemOriginIdFieldName as C,systemDestinationIdFieldName as T,systemLayoutGeometryFieldName as v,systemAggregationCountFieldName as E}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as N}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as S}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import D from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{getTitleFromServerUrl as x,getUserKGSPrivileges as I,createCapabilitiesFromKnowledgeGraph as _,initializeLayersFromClientData as A}from"./knowledgeGraph/layerUtils.js";import R from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as j,getRelationshipEndNodeIds as P}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as G}from"./mixins/BlendLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as z}from"./mixins/ScaleRangeLayer.js";import{url as F}from"./support/commonProperties.js";import{LCChronologicalLayout as O,LCSimpleLayout as B,LCSmartTreeLayout as H,LCRadialTreeLayout as Q,LCHierarchicalLayout as W,LCCommunityLayout as $,LCForceDirectedLayout as K,load as J}from"../libs/linkchartlayout/LinkChartLayout.js";import V from"../linkChart/LayoutSettings.js";import Z from"../linkChart/RootedLayoutSettings.js";import{fetchKnowledgeGraph as q}from"../rest/knowledgeGraphService.js";import{timeZoneProperty as X}from"../time/timeZoneUtils.js";let Y=class extends(U(G(z(r(k))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(i.ofType(D)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(i.ofType(D)),this.type="link-chart",this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new n("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(p(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),c))}normalizeCtorArgs(e){if(!e)return{};const{url:t,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}=e;let{title:n}=e;return!n&&e?.url&&(n=x(e.url)),{url:t,title:n,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}}_initializeLayerProperties(e){const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new n("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return o.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===r.type?t.has(s)||(t.add(s),a.push(r)):"entity"===r.type?t.has(s)||(t.add(s),i.push(r)):(o.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new S({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=s}load(e){const i=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await A(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine()),e.push(new Promise(e=>{i.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(a=>{q(this.url).then(async n=>{n.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),n.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const o=this.linkChart?.linkChartProperties;6===o?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:o?.entitiesUrl,relationshipsUrl:o?.relationshipsUrl},{signal:e?.signal}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:o?.layoutSettings??void 0,layoutMode:j(o.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}));const{edit:r,fullEdit:h,updateItem:d}=await I(n.serviceDefinition.serviceItemId,this.url,e);if(this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",h),this._set("userHasUpdateItemPrivileges",d),this.read({dateFieldsTimeReference:n.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this.dataPreloadedInLocalCache){const e=R.getInstance();for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const a of i.members?.values()??[]){const i=e.readFromStoreById(`${t}__${a.id}`);if(i){s(this.dataManager.sublayerCaches,t,()=>new Map).set(a.id,i)}}await i()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then(async()=>{l(e),await i()}))}a(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):o.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}get sublayerCapabilities(){return _(this.knowledgeGraph)}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await P(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));a.length>0&&(this.membershipModified=!0),await this._handleNewRecords(a,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new n("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new n("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),s(this.sublayerIdsCache,e,()=>new Set);const i=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),i.geometryType?this.layers.push(i):this.tables.push(i),await A(this,[e]),this._refreshNamedTypes(),i}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1,overrideMembershipCheck:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const l of e)(a||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(l.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(l.typeName)?.members?.has(l.id))&&n.push(l);if(t){const e=new Set,t=[];for(const i of n)if(this.dataManager.nodeConnectionsLookup.has(i.id))for(const t of this.dataManager.nodeConnectionsLookup.get(i.id))e.add(t);for(const i of e)if(this.dataManager.memberIdTypeLookup.has(i))for(const e of this.dataManager.memberIdTypeLookup.get(i))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:i,typeName:e});n=n.concat(t)}const o=this._currentLinkChartConfig.layoutSettings?.rootedLayoutSettings?.rootEntities;if(o?.length){const e=new Set(n.map(({id:e})=>e)),t=o.filter(({id:t})=>!e.has(t));if(t.length!==o.length){this._currentLinkChartConfig.layoutSettings.rootedLayoutSettings.rootEntities=t;const e=this.linkChart?.linkChartProperties;e?.layoutSettings?.rootedLayoutSettings&&(e.layoutSettings.rootedLayoutSettings.rootEntities=t)}}this.dataManager.removeFromLayer(n);for(const l of n)this.sublayerIdsCache.get(l.typeName)?.delete(l.id),this.dataManager.relationshipTypeNames.has(l.typeName)?this.relationshipLinkChartDiagramLookup.delete(l.id):this.entityLinkChartDiagramLookup.delete(l.id);const s=i?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:s}),n.length>0&&(this.membershipModified=!0);const r=[];return this.layers.forEach(e=>{r.push(e.refreshCachedQueryEngine())}),await Promise.all(r),this._refreshNamedTypes(),n}async expand(e,t){let i=[];try{const a=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);i=a.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(i,t),a.length>0&&(this.membershipModified=!0),l(t?.signal)}catch(a){throw h(a)&&i.length>0&&await this.removeRecords(i,{overrideMembershipCheck:!0}),a}return{records:i}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new i,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new i,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=s(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:a})=>{if(i.add(e),a){const i="coords"in a&&"lengths"in a?a:b(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,i):this.entityLinkChartDiagramLookup.set(e,i)}})})}async calculateLinkChartLayout(e="organic-standard",t){const i=[],a=[],r=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{i.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{a.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const h=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(i.length),g=new Float64Array(i.length),k=new Float64Array(i.length),N=new Float64Array(i.length),S=new Float64Array(i.length),D=new Uint32Array(a.length),x=new Uint32Array(a.length),I=new Float64Array(a.length),_=new Float64Array(a.length),A=[],R="organic-standard";let j=!1;const P=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let G,U="organic-standard",z=0,F=0;const V=O.apply;switch(U="geographic-organic-standard"===e?R:e,U){case"organic-standard":G=K.apply;break;case"organic-community":G=$.apply;break;case"hierarchical-bottom-to-top":G=W.apply;break;case"radial-root-centric":G=Q.apply;break;case"tree-left-to-right":G=H.apply;break;default:G=B.apply}let Z=!1;const q=new Set(t?.layoutSettings?.rootedLayoutSettings?.rootEntities?.map(({id:e})=>e));i.forEach(({typeName:i,feature:a})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedEntityLocations?.has(a.attributes[M])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)?y[z]=2:y[z]=0;const n=t.lockedEntityLocations.get(a.attributes[M]);g[z]=n.x,k[z]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)){y[z]=2;let e=null;const t=a.attributes[this.dataManager.geographicLookup.get(i).name],n=this.dataManager.geographicLookup.get(i)?.geometryType;switch(n){case"esriGeometryPoint":g[z]=t?.x,k[z]=t?.y;break;case"esriGeometryPolygon":{const i=t?w(t):null;e=i?f.fromJSON(i):null,null!=e?.x&&null!=e?.y?(g[z]=e.x,k[z]=e.y):y[z]=1;break}case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(g[z]=e.x,k[z]=e.y):y[z]=1;break;default:y[z]=1}(null==g[z]||null==k[z]||Number.isNaN(g[z])||Number.isNaN(k[z]))&&(y[z]=1,g[z]=0,k[z]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!Z&&t?.lockedEntityLocations?.has(a.attributes[M])&&(Z=!0);const e=t?.timeInfoByTypeName?.get(i),n=e?.startField,o=n&&e?.startField?a.attributes[n]:null;N[z]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?a.attributes[s]:null;S[z]=r?new Date(r).getTime():NaN,g[z]=0,k[z]=0,y[z]=1}else y[z]=1,g[z]=0,k[z]=0;q.has(a.attributes[M])&&(y[z]|=4),u.set(a.attributes[M],z),A[z]={feature:a,typeName:i},z++}),Z&&o.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let X=!1;const Y=new Map;a.forEach(i=>{const a=i.feature.attributes[C],n=i.feature.attributes[T],o=u.get(a),s=u.get(n),l=t?.timeInfoByTypeName?.get(i.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?i.feature.attributes[h]:null,p=l?.endField,c=p?i.feature.attributes[p]:null;if(void 0!==o&&void 0!==s){let t=a+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const l=Y.get(t),h=l?.has(i.typeName);h||(D[F]=o,x[F]=s,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(I[F]=d?new Date(d).getTime():NaN,_[F]=c?new Date(c).getTime():NaN),void 0===l?Y.set(t,new Map([[i.typeName,F]])):l.set(i.typeName,F),F++),r.push(i)}else X=!0,this.relationshipLinkChartDiagramLookup.set(a,null)}),X&&o.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const ee=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),te=this._convertValidatedOrganicSettingsToCalculationSettings(ee);await J();let ie=1,ae=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let i;({status:ie,links:ae,graphics:i}=V(()=>t?.signal?.aborted??!1,y,g,k,N,S,D.subarray(0,F),x.subarray(0,F),I.subarray(0,F),_.subarray(0,F),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===ie&&(this.chronologicalAuxiliaryGraphics=i)}else({status:ie,links:ae}=G(()=>t?.signal?.aborted??!1,y,g,k,D.subarray(0,F),x.subarray(0,F),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(l(t?.signal),1===ie)throw new n("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===ie)throw d();for(let n=0;n<A.length;n++){if(k[n]>84.9999?k[n]=84.9999:k[n]<-84.9999&&(k[n]=-84.9999),g[n]>179.9999?g[n]=179.9999:g[n]<-179.9999&&(g[n]=-179.9999),A[n].feature.attributes[v]=new f(g[n],k[n]),h.has(A[n].typeName)){const e=h.get(A[n].typeName);e?.set(A[n].feature.attributes[M],A[n].feature)}else{const e=new Map;e.set(A[n].feature.attributes[M],A[n].feature),h.set(A[n].typeName,e)}c.set(A[n].feature.attributes[M],A[n].feature);const e=b(A[n].feature.attributes[v]);this.entityLinkChartDiagramLookup.set(A[n].feature.attributes[M],A[n].feature.attributes[v]?e:null);const t=s(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,A[n].typeName,()=>({useAllData:!1,members:new Map}));s(t.members,A[n].feature.attributes[M],()=>({id:A[n].feature.attributes[M],linkChartLocation:void 0})).linkChartLocation=A[n].feature.attributes[v];const{x:i,y:a}=A[n].feature.attributes[v];if(j)P.xmin=Math.min(P.xmin,i),P.xmax=Math.max(P.xmax,i),P.ymin=Math.min(P.ymin,a),P.ymax=Math.max(P.ymax,a);else{const e=1e-7;P.xmin=i-e,P.xmax=i+e,P.ymin=a-e,P.ymax=a+e,j=!0}}if(this.linkChartExtent.xmin=P.xmin,this.linkChartExtent.xmax=P.xmax,this.linkChartExtent.ymin=P.ymin,this.linkChartExtent.ymax=P.ymax,!ae)throw new n("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ne=new Map,oe=new Map,se=new Map,re=new Set;for(let n=0;n<r.length;n++){const i=[],a=r[n],l=a.feature.attributes[C],h=a.feature.attributes[T];let d=l+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(a.typeName),i=t?.timeInfoByTypeName?e?.startField:null,n=i?a.feature.attributes[i]:null,o=e?.endField;d+="-"+n+"-"+(o?a.feature.attributes[o]:null)}const y=Y.get(d).get(a.typeName),g=0===y?0:ae?.vertexEndIndex[y-1];if(!re.has(y)){if(re.add(y),2===ae.types[y]){const e=[ae.vertices[2*g],ae.vertices[2*g+1]],t=[ae.vertices[2*(g+1)],ae.vertices[2*(g+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[a[0]-e[0],a[1]-e[1]],o=[a[0]+n[1],a[1]-n[0]],s=[a[0]-n[1],a[1]+n[0]];i.push(e),i.push(o),i.push(t),i.push(s),i.push(e)}else{if(0!==ae.types[y]){o.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<ae.vertexEndIndex[y];e++)i.push([ae.vertices[2*e],ae.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=A[u.get(l)]?.feature.attributes[v],t=A[u.get(h)]?.feature.attributes[v];i[0][0]===e.x&&i[0][1]===e.y||(i[0]=[e.x,e.y]),i[i.length-1][0]===t.x&&i[i.length-1][1]===t.y||(i[i.length-1]=[t.x,t.y])}for(let e=1;e<i.length-1;e++)i[e][1]>85.5?i[e][1]=85.5:i[e][1]<-85.5&&(i[e][1]=-85.5),i[e][0]>179.9999?i[e][0]=179.9999:i[e][0]<-179.9999&&(i[e][0]=-179.9999);ne.has(d)?ne.get(d).push(i):ne.set(d,[i])}const m=ne.get(d);oe.has(d)||(oe.set(d,new Map),se.set(d,new Map));const f=oe.get(d),w=se.get(d);f.has(a.typeName)||(f.set(a.typeName,m.shift()),w.set(a.typeName,0));const k=f.get(a.typeName);w.set(a.typeName,w.get(a.typeName)+1);const E=new L({paths:[k]});if(a.feature.attributes[v]=E,p.has(a.typeName)){const e=p.get(a.typeName);e?.set(a.feature.attributes[M],a.feature)}else{const e=new Map;e.set(a.feature.attributes[M],a.feature),p.set(a.typeName,e)}c.set(a.feature.attributes[M],a.feature);const N=b(a.feature.attributes[v]);this.relationshipLinkChartDiagramLookup.set(a.feature.attributes[M],a.feature.attributes[v]?N:null);const S=s(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,a.typeName,()=>({useAllData:!1,members:new Map}));s(S.members,a.feature.attributes[M],()=>({id:a.feature.attributes[M],linkChartLocation:void 0})).linkChartLocation=N}for(const n of r)n.feature.attributes[E]=se.get(n.feature.attributes[C]+"-"+n.feature.attributes[T])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:h,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){let{lockedNodeLocations:i,lockedEntityLocations:n,rootEntityIds:s,...r}=t??{};!n&&i?(a(o.getLogger(this),"lockedNodeLocations is deprecated in 5.0. Use lockedEntityLocations instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"}),n=i):n&&i&&a(o.getLogger(this),"Both lockedNodeLocations (deprecated in 5.0) and lockedEntityLocations are defined. Use lockedEntityLocations only instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"});const l=r.layoutSettings?.rootedLayoutSettings?.rootEntities;if(!l&&s){a(o.getLogger(this),"rootEntityIds is deprecated in 5.1. Use layoutSettings.rootedLayoutSettings.rootEntities instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const e=[];for(const t of s){const i=this.dataManager.memberIdTypeLookup.get(t),a=Array.from(i??[]).find(e=>this.dataManager.entityTypeNames.has(e));a&&e.push({id:t,typeName:a})}r.layoutSettings=r.layoutSettings??new V,r.layoutSettings.rootedLayoutSettings=r.layoutSettings.rootedLayoutSettings??new Z,r.layoutSettings.rootedLayoutSettings.rootEntities=e}else l&&s&&a(o.getLogger(this),"Both rootEntityIds (deprecated in 5.1) and layoutSettings.rootedLayoutSettings.rootEntities are defined. Use layoutSettings.rootedLayoutSettings.rootEntities only instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const h=[];await this._calculateLayoutWithSublayerTimeInfo(e,{...r,lockedEntityLocations:n}),this.layers.forEach(e=>{h.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(h),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||i?.members?.forEach(t=>{const i=t.linkChartLocation;let a;const n=t.id;i&&(a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]},e.set(n,new f({x:a.x,y:a.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}i=await this.dataManager.getRelationshipsBetweenNodes(e,a,t),await this._handleNewRecords(i,t),l(t)}catch(a){throw h(a)&&this.removeRecords(i),a}return{records:i}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}i=await this.dataManager.getRelationshipsFromNodes(e,n,a,t),await this._handleNewRecords(i,t),i.length>0&&(this.membershipModified=!0),l(t)}catch(a){throw h(a)&&this.removeRecords(i),a}return{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const i=new Map;this.layers.forEach(e=>{i.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const i=new Set,a=[],n=this.layers.concat(this.tables);for(const r of e){if(!this._graphTypeLookup.has(r.typeName))continue;!1===n.some(e=>e.objectType.name===r.typeName)&&(this.dataManager.sublayerCaches.set(r.typeName,new Map),i.add(r.typeName));s(this.sublayerIdsCache,r.typeName,()=>new Set).add(r.id),a.push(r)}this.dataManager.addToLayer(a);for(const s of i){const e=this._graphTypeLookup.get(s);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(s):this.dataManager.relationshipTypeNames.add(s),t.geometryType?this.layers.push(t):this.tables.push(t)}}await A(this,Array.from(i),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const o={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:new Map};for(const[s,r]of this.entityLinkChartDiagramLookup.entries())r&&o.lockedEntityLocations.set(s,new f(r.coords[0],r.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,o)}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const i=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);i&&(t.objectType=i,t.read({title:i.name},{origin:"service"}),this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const i=e.linkChartLocation;let a;const n=e.id;if(!i)return;a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]};const o=b(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[C]),i=this.relationshipLinkChartDiagramLookup.get(e.attributes[T]);if(t&&i){const a=b(new L({paths:[[[t.coords[0],t.coords[1]],[i.coords[0],i.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[M],a)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[M],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedEntityLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedEntityLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const i=e=>"number"==typeof e&&!isNaN(e),a=e=>i(e)&&e>=1,n=e=>i(e)&&e>=1,s=e=>Object.values(N).includes(e),r=e=>i(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return n(h)?l.computationBudgetTime=h:h&&o.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&a(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,o.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(s(y)?l.idealEdgeLengthType=y:void 0!==y&&o.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&r(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?o.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&r(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&o.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===N.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===N.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new D({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),a=new Set((e.entityTypes??[]).map(e=>e.name)),n=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const i of this.layers)!i.graphType&&t.has(i.graphTypeName)&&(i.graphType=a.has(i.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?a.has(e.graphTypeName):n.has(e.graphTypeName)));this.setAtOrigin("layers",e,g(this.originIdOf("layers")))}else this.layers=new i;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],i=this.layers.map(e=>e.graphTypeName).concat(t);for(const n of i)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const a=[];for(const n of this._originalInclusionList.namedTypeDefinitions.keys())i.includes(n)||(o.getLogger(this).warn(`A named type, ${n}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),a.push(n));for(const n of a)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([u(F)],Y.prototype,"url",void 0),e([u()],Y.prototype,"dataPreloadedInLocalCache",void 0),e([u()],Y.prototype,"initializationLinkChartConfig",void 0),e([u()],Y.prototype,"membershipModified",void 0),e([u()],Y.prototype,"dataManager",void 0),e([u()],Y.prototype,"initializationInclusionModeDefinition",null),e([u()],Y.prototype,"knowledgeGraph",void 0),e([u({type:i.ofType(D),json:{write:{ignoreOrigin:!0}}})],Y.prototype,"layers",void 0),e([u({readOnly:!0})],Y.prototype,"linkChart",null),e([u()],Y.prototype,"entityLinkChartDiagramLookup",void 0),e([u()],Y.prototype,"relationshipLinkChartDiagramLookup",void 0),e([u()],Y.prototype,"linkChartExtent",void 0),e([u()],Y.prototype,"memberEntityTypes",void 0),e([u()],Y.prototype,"memberRelationshipTypes",void 0),e([u({type:["LinkChartLayer"]})],Y.prototype,"operationalLayerType",void 0),e([u()],Y.prototype,"sublayerCapabilities",null),e([u()],Y.prototype,"sublayerIdsCache",void 0),e([u({type:i.ofType(D),json:{write:{ignoreOrigin:!0}}})],Y.prototype,"tables",void 0),e([u({json:{read:!1}})],Y.prototype,"type",void 0),e([u({readOnly:!0})],Y.prototype,"userHasEditingPrivileges",void 0),e([u({readOnly:!0})],Y.prototype,"userHasFullEditingPrivileges",void 0),e([u({readOnly:!0})],Y.prototype,"userHasUpdateItemPrivileges",void 0),e([u({json:{read:!1}})],Y.prototype,"chronologicalAuxiliaryGraphics",void 0),e([u(X("dateFieldsTimeReference"))],Y.prototype,"dateFieldsTimeZone",void 0),Y=e([y("esri.layers.LinkChartLayer")],Y);const ee=Y;export{ee as default};
|
|
2
|
+
import{__decorate as e}from"tslib";import{serializationUtilsModuleWrapper as t}from"../applications/KnowledgeStudio/resourceSerializationUtils.js";import i from"../core/Collection.js";import{deprecated as a}from"../core/deprecate.js";import n from"../core/Error.js";import o from"../core/Logger.js";import{getOrCreateMapValue as s}from"../core/MapUtils.js";import{MultiOriginJSONSupportMixin as r}from"../core/MultiOriginJSONSupport.js";import{throwIfAborted as l,isAbortError as h,createAbortError as d}from"../core/promiseUtils.js";import{watch as p,sync as c}from"../core/reactiveUtils.js";import{property as u,subclass as y}from"../core/accessorSupport/decorators.js";import{idToName as g}from"../core/accessorSupport/PropertyOrigin.js";import m from"../geometry/Extent.js";import f from"../geometry/Point.js";import L from"../geometry/Polyline.js";import{polygonCentroidPoint as w}from"../geometry/support/centroid.js";import k from"./Layer.js";import{convertFromGeometry as b}from"./graphics/featureConversionUtils.js";import{systemOidFieldName as M,systemOriginIdFieldName as C,systemDestinationIdFieldName as T,systemLayoutGeometryFieldName as v,systemAggregationCountFieldName as E}from"./knowledgeGraph/constants.js";import{IdealEdgeLengthTypeOptions as N}from"./knowledgeGraph/IdealEdgeLengthTypeOptions.js";import{KnowledgeGraphLayerDataManager as S}from"./knowledgeGraph/KnowledgeGraphLayerDataManager.js";import D from"./knowledgeGraph/KnowledgeGraphSublayer.js";import{getTitleFromServerUrl as x,getUserKGSPrivileges as I,createCapabilitiesFromKnowledgeGraph as _,initializeLayersFromClientData as R}from"./knowledgeGraph/layerUtils.js";import A from"./knowledgeGraph/SessionMemoryStorage.js";import{convertLayoutTypeToWebSupportedFormat as j,getRelationshipEndNodeIds as P}from"./knowledgeGraph/supportUtils.js";import{BlendLayer as G}from"./mixins/BlendLayer.js";import{OperationalLayer as U}from"./mixins/OperationalLayer.js";import{ScaleRangeLayer as F}from"./mixins/ScaleRangeLayer.js";import{url as z}from"./support/commonProperties.js";import{LCChronologicalLayout as O,LCSimpleLayout as B,LCSmartTreeLayout as H,LCRadialTreeLayout as Q,LCHierarchicalLayout as W,LCCommunityLayout as $,LCForceDirectedLayout as K,load as J}from"../libs/linkchartlayout/LinkChartLayout.js";import V from"../linkChart/LayoutSettings.js";import Z from"../linkChart/RootedLayoutSettings.js";import{getCreationDatesForResources as q}from"../linkChart/utils.js";import{fetchKnowledgeGraph as X}from"../rest/knowledgeGraphService.js";import{timeZoneProperty as Y}from"../time/timeZoneUtils.js";let ee=class extends(U(G(F(r(k))))){constructor(e){if(super(e),this.url=null,this.dataPreloadedInLocalCache=!1,this.initializationLinkChartConfig=null,this.membershipModified=!0,this._currentLinkChartConfig={layoutMode:"organic-standard"},this._graphTypeLookup=new Map,this.dataManager=null,this.knowledgeGraph=null,this.layers=new(i.ofType(D)),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map,this.linkChartExtent=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7}),this.memberEntityTypes=null,this.memberRelationshipTypes=null,this.operationalLayerType="LinkChartLayer",this.sublayerIdsCache=new Map,this.tables=new(i.ofType(D)),this.type="link-chart",this.userHasEditingPrivileges=!0,this.userHasFullEditingPrivileges=!1,this.userHasUpdateItemPrivileges=!1,this.chronologicalAuxiliaryGraphics=null,this._originalInclusionList=e?.initializationInclusionModeDefinition,e?.dataPreloadedInLocalCache&&!e?.initializationInclusionModeDefinition)throw new n("knowledge-graph:linkchart-layer-constructor","If creating a link chart composite layer and configured that data is already loaded in the cache, you must specify an inclusion list so the Composite Layer knows what records belong to it");this.addHandles(p(()=>this.layers.concat(this.tables),(e,t)=>this._handleSublayersChange(e,t),c))}normalizeCtorArgs(e){if(!e)return{};const{url:t,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}=e;let{title:n}=e;return!n&&e?.url&&(n=x(e.url)),{url:t,title:n,dataPreloadedInLocalCache:i,initializationLinkChartConfig:a}}_initializeLayerProperties(e){const t=new Set;let i=[],a=[];if(e.inclusionModeDefinition&&(!e.inclusionModeDefinition.namedTypeDefinitions||e.inclusionModeDefinition.namedTypeDefinitions.size<1))throw new n("knowledge-graph:composite-layer-constructor","If an explicit inclusion definition is defined, at least one namedTypeDefinition must also be defined");e.inclusionModeDefinition?.generateAllSublayers?(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]):e.inclusionModeDefinition?.namedTypeDefinitions&&e.inclusionModeDefinition?.namedTypeDefinitions.size>0?e.inclusionModeDefinition?.namedTypeDefinitions.forEach((n,s)=>{const r=this._graphTypeLookup.get(s);if(!r)return o.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't in the data model and will be removed`),void e.inclusionModeDefinition?.namedTypeDefinitions.delete(s);"relationship"===r.type?t.has(s)||(t.add(s),a.push(r)):"entity"===r.type?t.has(s)||(t.add(s),i.push(r)):(o.getLogger(this).warn(`A named type, ${s}, was in the inclusion list that wasn't properly modeled and will be removed`),e.inclusionModeDefinition?.namedTypeDefinitions.delete(s))}):(i=e.knowledgeGraph.dataModel.entityTypes??[],a=e.knowledgeGraph.dataModel.relationshipTypes??[]);const s=new S({knowledgeGraph:e.knowledgeGraph,inclusionModeDefinition:e.inclusionModeDefinition});this.knowledgeGraph=e.knowledgeGraph,this.memberEntityTypes=i,this.memberRelationshipTypes=a,this.dataManager=s}load(e){const i=async()=>{const e=[],t=[];this.loadLayerAssumingLocalCache(),this._layersLoadedFromAuthoritativeItem()||await R(this),this.dataManager.inclusionModeDefinition&&(this.dataManager.inclusionModeDefinition.generateAllSublayers=!1),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.forEach(e=>{e.useAllData=!1}),await this._initializeDiagram(),this.layers.forEach(i=>{t.push(i.refreshCachedQueryEngine()),e.push(new Promise(e=>{i.on("layerview-create",()=>{e(null)})}))}),this.tables.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t)};return this.addResolvingPromise(new Promise(a=>{X(this.url).then(async n=>{n.dataModel.entityTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)}),n.dataModel.relationshipTypes?.forEach(e=>{e.name&&this._graphTypeLookup.set(e.name,e)});const o=this.linkChart?.linkChartProperties;6===o?.originIdOf("entitiesUrl")&&(this.membershipModified=!1,q([o.entitiesUrl??"",o.relationshipsUrl??""],this.linkChart?.portalItem?.itemUrl??"").then(e=>{this.linkChart?.linkChartProperties.setCreationDatesForResources(e)}),this._originalInclusionList=await t.fetchAndConvertSerializedLinkChart({entitiesUrl:o?.entitiesUrl,relationshipsUrl:o?.relationshipsUrl},{signal:e?.signal}),this._alignLayersDataModelAndInclusionDefinition(n.dataModel),this.initializationLinkChartConfig={layoutSettings:o?.layoutSettings??void 0,layoutMode:j(o.layoutType)}),this._initializeLayerProperties({knowledgeGraph:n,inclusionModeDefinition:this._originalInclusionList}),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.size||(this.dataManager.inclusionModeDefinition={generateAllSublayers:!1,namedTypeDefinitions:new Map},this.dataManager.knowledgeGraph.dataModel.entityTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}),this.dataManager.knowledgeGraph.dataModel.relationshipTypes?.forEach(e=>{e.name&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.set(e.name,{useAllData:!0})}));const{edit:r,fullEdit:h,updateItem:d}=await I(n.serviceDefinition.serviceItemId,this.url,e);if(this._set("userHasEditingPrivileges",r),this._set("userHasFullEditingPrivileges",h),this._set("userHasUpdateItemPrivileges",d),this.read({dateFieldsTimeReference:n.serviceDefinition.dateFieldsTimeReference},{origin:"service"}),this.dataPreloadedInLocalCache){const e=A.getInstance();for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions??[])for(const a of i.members?.values()??[]){const i=e.readFromStoreById(`${t}__${a.id}`);if(i){s(this.dataManager.sublayerCaches,t,()=>new Map).set(a.id,i)}}await i()}else{const t="geographic-organic-standard"===this.initializationLinkChartConfig?.layoutMode;this.addResolvingPromise(this.dataManager.refreshCacheContent(void 0,!1,t,!0).then(async()=>{l(e),await i()}))}a(null)})})),Promise.resolve(this)}set initializationInclusionModeDefinition(e){"loaded"!==this.loadStatus&&"failed"!==this.loadStatus?this._set("initializationInclusionModeDefinition",e):o.getLogger(this).error("#initializationInclusionModeDefinition","initializationInclusionModeDefinition cannot be changed after the layer is loaded.")}get linkChart(){return this.parent}get sublayerCapabilities(){return _(this.knowledgeGraph)}async addRecords(e,t){let i=[];t?.cascadeAddRelationshipEndNodes&&this.dataManager.knowledgeGraph.dataModel&&(i=await P(e,this.dataManager.knowledgeGraph));const a=e.concat(i).filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id));a.length>0&&(this.membershipModified=!0),await this._handleNewRecords(a,t)}async createSublayerForNamedType(e){await this.load();const t=this._graphTypeLookup.get(e);if(!t)throw new n("knowledge-graph:missing-type","The specified type does not exist in the knowledge graph.");if(this.dataManager.sublayerCaches.has(e))throw new n("knowledge-graph:duplicate-type","The specified type already exists as a sublayer.");this.dataManager.sublayerCaches.set(e,new Map),s(this.sublayerIdsCache,e,()=>new Set);const i=this._createSublayer(t);return"entity"===t.type?this.dataManager.entityTypeNames.add(e):this.dataManager.relationshipTypeNames.add(e),this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.set(e,{useAllData:!1,members:new Map}),i.geometryType?this.layers.push(i):this.tables.push(i),await R(this,[e]),this._refreshNamedTypes(),i}async removeRecords(e,{cascadeRemoveRelationships:t=!0,recalculateLayout:i=!1,overrideMembershipCheck:a=!1}={cascadeRemoveRelationships:!0,recalculateLayout:!1,overrideMembershipCheck:!1}){let n=[];for(const l of e)(a||!1===this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(l.typeName)?.useAllData&&this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.get(l.typeName)?.members?.has(l.id))&&n.push(l);if(t){const e=new Set,t=[];for(const i of n)if(this.dataManager.nodeConnectionsLookup.has(i.id))for(const t of this.dataManager.nodeConnectionsLookup.get(i.id))e.add(t);for(const i of e)if(this.dataManager.memberIdTypeLookup.has(i))for(const e of this.dataManager.memberIdTypeLookup.get(i))this.dataManager.relationshipTypeNames.has(e)&&t.push({id:i,typeName:e});n=n.concat(t)}const o=this._currentLinkChartConfig.layoutSettings?.rootedLayoutSettings?.rootEntities;if(o?.length){const e=new Set(n.map(({id:e})=>e)),t=o.filter(({id:t})=>!e.has(t));if(t.length!==o.length){this._currentLinkChartConfig.layoutSettings.rootedLayoutSettings.rootEntities=t;const e=this.linkChart?.linkChartProperties;e?.layoutSettings?.rootedLayoutSettings&&(e.layoutSettings.rootedLayoutSettings.rootEntities=t)}}this.dataManager.removeFromLayer(n);for(const l of n)this.sublayerIdsCache.get(l.typeName)?.delete(l.id),this.dataManager.relationshipTypeNames.has(l.typeName)?this.relationshipLinkChartDiagramLookup.delete(l.id):this.entityLinkChartDiagramLookup.delete(l.id);const s=i?void 0:this.getCurrentNodeLocations();await this._calculateLayoutWithSublayerTimeInfo(this._currentLinkChartConfig.layoutMode,{layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:s}),n.length>0&&(this.membershipModified=!0);const r=[];return this.layers.forEach(e=>{r.push(e.refreshCachedQueryEngine())}),await Promise.all(r),this._refreshNamedTypes(),n}async expand(e,t){let i=[];try{const a=await this.dataManager.getConnectedRecordIds(e,t?.relationshipTypeNames,t);i=a.filter(e=>!this.sublayerIdsCache.get(e.typeName)?.has(e.id)),await this._handleNewRecords(i,t),a.length>0&&(this.membershipModified=!0),l(t?.signal)}catch(a){throw h(a)&&i.length>0&&await this.removeRecords(i,{overrideMembershipCheck:!0}),a}return{records:i}}loadLayerAssumingLocalCache(){const e=[...this.memberRelationshipTypes,...this.memberEntityTypes];this.layers.length||0===this.originIdOf("tables")?0===this.originIdOf("layers")?this._createSublayers(e,this.layers,e=>!!e.geometryType):this._updateSublayers(e,this.layers):this.layers=new i,this.tables.length||0===this.originIdOf("layers")?0===this.originIdOf("tables")?this._createSublayers(e,this.tables,e=>!e.geometryType):this._updateSublayers(e,this.tables):this.tables=new i,this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{const i=s(this.sublayerIdsCache,t,()=>new Set);e.members?.forEach(({id:e,linkChartLocation:a})=>{if(i.add(e),a){const i="coords"in a&&"lengths"in a?a:b(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(e,i):this.entityLinkChartDiagramLookup.set(e,i)}})})}async calculateLinkChartLayout(e="organic-standard",t){const i=[],a=[],r=[];this.dataManager.sublayerCaches.forEach((e,t)=>{this.dataManager.entityTypeNames.has(t)?e.forEach(e=>{i.push({typeName:t,feature:e})}):this.dataManager.relationshipTypeNames.has(t)&&e.forEach(e=>{a.push({typeName:t,feature:e})})}),this.entityLinkChartDiagramLookup=new Map,this.relationshipLinkChartDiagramLookup=new Map;const h=new Map,p=new Map,c=new Map,u=new Map,y=new Uint8Array(i.length),g=new Float64Array(i.length),k=new Float64Array(i.length),N=new Float64Array(i.length),S=new Float64Array(i.length),D=new Uint32Array(a.length),x=new Uint32Array(a.length),I=new Float64Array(a.length),_=new Float64Array(a.length),R=[],A="organic-standard";let j=!1;const P=new m({xmin:-1e-7,ymin:-1e-7,xmax:1e-7,ymax:1e-7});let G,U="organic-standard",F=0,z=0;const V=O.apply;switch(U="geographic-organic-standard"===e?A:e,U){case"organic-standard":G=K.apply;break;case"organic-community":G=$.apply;break;case"hierarchical-bottom-to-top":G=W.apply;break;case"radial-root-centric":G=Q.apply;break;case"tree-left-to-right":G=H.apply;break;default:G=B.apply}let Z=!1;const q=new Set(t?.layoutSettings?.rootedLayoutSettings?.rootEntities?.map(({id:e})=>e));i.forEach(({typeName:i,feature:a})=>{if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e&&t?.lockedEntityLocations?.has(a.attributes[M])){"geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)?y[F]=2:y[F]=0;const n=t.lockedEntityLocations.get(a.attributes[M]);g[F]=n.x,k[F]=n.y}else if("geographic-organic-standard"===e&&this.dataManager.geographicLookup.has(i)){y[F]=2;let e=null;const t=a.attributes[this.dataManager.geographicLookup.get(i).name],n=this.dataManager.geographicLookup.get(i)?.geometryType;switch(n){case"esriGeometryPoint":g[F]=t?.x,k[F]=t?.y;break;case"esriGeometryPolygon":{const i=t?w(t):null;e=i?f.fromJSON(i):null,null!=e?.x&&null!=e?.y?(g[F]=e.x,k[F]=e.y):y[F]=1;break}case"esriGeometryPolyline":case"esriGeometryMultipoint":e=t?.extent?.center,null!=e?.x&&null!=e?.y?(g[F]=e.x,k[F]=e.y):y[F]=1;break;default:y[F]=1}(null==g[F]||null==k[F]||Number.isNaN(g[F])||Number.isNaN(k[F]))&&(y[F]=1,g[F]=0,k[F]=0)}else if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){!Z&&t?.lockedEntityLocations?.has(a.attributes[M])&&(Z=!0);const e=t?.timeInfoByTypeName?.get(i),n=e?.startField,o=n&&e?.startField?a.attributes[n]:null;N[F]=o?new Date(o).getTime():NaN;const s=e?.endField,r=s&&e?.endField?a.attributes[s]:null;S[F]=r?new Date(r).getTime():NaN,g[F]=0,k[F]=0,y[F]=1}else y[F]=1,g[F]=0,k[F]=0;q.has(a.attributes[M])&&(y[F]|=4),u.set(a.attributes[M],F),R[F]={feature:a,typeName:i},F++}),Z&&o.getLogger(this).warn("Locked node locations are not supported for chronological layout at this time. Requested node locations were ignored");let X=!1;const Y=new Map;a.forEach(i=>{const a=i.feature.attributes[C],n=i.feature.attributes[T],o=u.get(a),s=u.get(n),l=t?.timeInfoByTypeName?.get(i.typeName),h=t?.timeInfoByTypeName?l?.startField:null,d=h?i.feature.attributes[h]:null,p=l?.endField,c=p?i.feature.attributes[p]:null;if(void 0!==o&&void 0!==s){let t=a+"-"+n;"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(t=t+"-"+d+"-"+c);const l=Y.get(t),h=l?.has(i.typeName);h||(D[z]=o,x[z]=s,"chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e||(I[z]=d?new Date(d).getTime():NaN,_[z]=c?new Date(c).getTime():NaN),void 0===l?Y.set(t,new Map([[i.typeName,z]])):l.set(i.typeName,z),z++),r.push(i)}else X=!0,this.relationshipLinkChartDiagramLookup.set(a,null)}),X&&o.getLogger(this).warn("A relationship is a member of this layer that has either origin or destination entity nodes that are not members. The diagram geometry will be set to null");const ee=this._validateOrganicLayoutSettings(e,t?.layoutSettings?.organicLayoutSettings),te=this._convertValidatedOrganicSettingsToCalculationSettings(ee);await J();let ie=1,ae=null;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){let i;({status:ie,links:ae,graphics:i}=V(()=>t?.signal?.aborted??!1,y,g,k,N,S,D.subarray(0,z),x.subarray(0,z),I.subarray(0,z),_.subarray(0,z),"chronological-multi-timeline"===e,t?.layoutSettings?.chronologicalLayoutSettings)),0===ie&&(this.chronologicalAuxiliaryGraphics=i)}else({status:ie,links:ae}=G(()=>t?.signal?.aborted??!1,y,g,k,D.subarray(0,z),x.subarray(0,z),te.computationBudgetTime,te.idealEdgeLengthMultiplier,te.repulsionRadiusMultiplier));if(l(t?.signal),1===ie)throw new n("knowledge-graph:layout-failed","Attempting to arrange the records in the specified layout failed");if(2===ie)throw d();for(let n=0;n<R.length;n++){if(k[n]>84.9999?k[n]=84.9999:k[n]<-84.9999&&(k[n]=-84.9999),g[n]>179.9999?g[n]=179.9999:g[n]<-179.9999&&(g[n]=-179.9999),R[n].feature.attributes[v]=new f(g[n],k[n]),h.has(R[n].typeName)){const e=h.get(R[n].typeName);e?.set(R[n].feature.attributes[M],R[n].feature)}else{const e=new Map;e.set(R[n].feature.attributes[M],R[n].feature),h.set(R[n].typeName,e)}c.set(R[n].feature.attributes[M],R[n].feature);const e=b(R[n].feature.attributes[v]);this.entityLinkChartDiagramLookup.set(R[n].feature.attributes[M],R[n].feature.attributes[v]?e:null);const t=s(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,R[n].typeName,()=>({useAllData:!1,members:new Map}));s(t.members,R[n].feature.attributes[M],()=>({id:R[n].feature.attributes[M],linkChartLocation:void 0})).linkChartLocation=R[n].feature.attributes[v];const{x:i,y:a}=R[n].feature.attributes[v];if(j)P.xmin=Math.min(P.xmin,i),P.xmax=Math.max(P.xmax,i),P.ymin=Math.min(P.ymin,a),P.ymax=Math.max(P.ymax,a);else{const e=1e-7;P.xmin=i-e,P.xmax=i+e,P.ymin=a-e,P.ymax=a+e,j=!0}}if(this.linkChartExtent.xmin=P.xmin,this.linkChartExtent.xmax=P.xmax,this.linkChartExtent.ymin=P.ymin,this.linkChartExtent.ymax=P.ymax,!ae)throw new n("knowledge-graph:layout-failed","Attempting to retrieve link geometry from diagram engine failed");const ne=new Map,oe=new Map,se=new Map,re=new Set;for(let n=0;n<r.length;n++){const i=[],a=r[n],l=a.feature.attributes[C],h=a.feature.attributes[T];let d=l+"-"+h;if("chronological-mono-timeline"===e||"chronological-multi-timeline"===e){const e=t?.timeInfoByTypeName?.get(a.typeName),i=t?.timeInfoByTypeName?e?.startField:null,n=i?a.feature.attributes[i]:null,o=e?.endField;d+="-"+n+"-"+(o?a.feature.attributes[o]:null)}const y=Y.get(d).get(a.typeName),g=0===y?0:ae?.vertexEndIndex[y-1];if(!re.has(y)){if(re.add(y),2===ae.types[y]){const e=[ae.vertices[2*g],ae.vertices[2*g+1]],t=[ae.vertices[2*(g+1)],ae.vertices[2*(g+1)+1]],a=[.5*(e[0]+t[0]),.5*(e[1]+t[1])],n=[a[0]-e[0],a[1]-e[1]],o=[a[0]+n[1],a[1]-n[0]],s=[a[0]-n[1],a[1]+n[0]];i.push(e),i.push(o),i.push(t),i.push(s),i.push(e)}else{if(0!==ae.types[y]){o.getLogger(this).warn("A relationship generated an unsupported link geometry type. It will not be rendered");continue}for(let e=g;e<ae.vertexEndIndex[y];e++)i.push([ae.vertices[2*e],ae.vertices[2*e+1]])}if("chronological-mono-timeline"!==e&&"chronological-multi-timeline"!==e){const e=R[u.get(l)]?.feature.attributes[v],t=R[u.get(h)]?.feature.attributes[v];i[0][0]===e.x&&i[0][1]===e.y||(i[0]=[e.x,e.y]),i[i.length-1][0]===t.x&&i[i.length-1][1]===t.y||(i[i.length-1]=[t.x,t.y])}for(let e=1;e<i.length-1;e++)i[e][1]>85.5?i[e][1]=85.5:i[e][1]<-85.5&&(i[e][1]=-85.5),i[e][0]>179.9999?i[e][0]=179.9999:i[e][0]<-179.9999&&(i[e][0]=-179.9999);ne.has(d)?ne.get(d).push(i):ne.set(d,[i])}const m=ne.get(d);oe.has(d)||(oe.set(d,new Map),se.set(d,new Map));const f=oe.get(d),w=se.get(d);f.has(a.typeName)||(f.set(a.typeName,m.shift()),w.set(a.typeName,0));const k=f.get(a.typeName);w.set(a.typeName,w.get(a.typeName)+1);const E=new L({paths:[k]});if(a.feature.attributes[v]=E,p.has(a.typeName)){const e=p.get(a.typeName);e?.set(a.feature.attributes[M],a.feature)}else{const e=new Map;e.set(a.feature.attributes[M],a.feature),p.set(a.typeName,e)}c.set(a.feature.attributes[M],a.feature);const N=b(a.feature.attributes[v]);this.relationshipLinkChartDiagramLookup.set(a.feature.attributes[M],a.feature.attributes[v]?N:null);const S=s(this.dataManager.inclusionModeDefinition.namedTypeDefinitions,a.typeName,()=>({useAllData:!1,members:new Map}));s(S.members,a.feature.attributes[M],()=>({id:a.feature.attributes[M],linkChartLocation:void 0})).linkChartLocation=N}for(const n of r)n.feature.attributes[E]=se.get(n.feature.attributes[C]+"-"+n.feature.attributes[T])?.get(n.typeName)??null;return this._currentLinkChartConfig={layoutMode:e,layoutSettings:t?.layoutSettings?.clone()},{nodes:h,links:p,idMap:c}}async applyNewLinkChartLayout(e="organic-standard",t){let{lockedNodeLocations:i,lockedEntityLocations:n,rootEntityIds:s,...r}=t??{};!n&&i?(a(o.getLogger(this),"lockedNodeLocations is deprecated in 5.0. Use lockedEntityLocations instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"}),n=i):n&&i&&a(o.getLogger(this),"Both lockedNodeLocations (deprecated in 5.0) and lockedEntityLocations are defined. Use lockedEntityLocations only instead.",{replacement:"Use lockedEntityLocations instead.",version:"5.0"});const l=r.layoutSettings?.rootedLayoutSettings?.rootEntities;if(!l&&s){a(o.getLogger(this),"rootEntityIds is deprecated in 5.1. Use layoutSettings.rootedLayoutSettings.rootEntities instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const e=[];for(const t of s){const i=this.dataManager.memberIdTypeLookup.get(t),a=Array.from(i??[]).find(e=>this.dataManager.entityTypeNames.has(e));a&&e.push({id:t,typeName:a})}r.layoutSettings=r.layoutSettings??new V,r.layoutSettings.rootedLayoutSettings=r.layoutSettings.rootedLayoutSettings??new Z,r.layoutSettings.rootedLayoutSettings.rootEntities=e}else l&&s&&a(o.getLogger(this),"Both rootEntityIds (deprecated in 5.1) and layoutSettings.rootedLayoutSettings.rootEntities are defined. Use layoutSettings.rootedLayoutSettings.rootEntities only instead.",{replacement:"Use layoutSettings.rootedLayoutSettings.rootEntities instead.",version:"5.1"});const h=[];await this._calculateLayoutWithSublayerTimeInfo(e,{...r,lockedEntityLocations:n}),this.layers.forEach(e=>{h.push(e.refreshCachedQueryEngine())}),this.membershipModified=!0,await Promise.all(h),this._refreshNamedTypes()}getCurrentNodeLocations(){const e=new Map;for(const[t,i]of this.dataManager.inclusionModeDefinition?.namedTypeDefinitions.entries()??[])this.dataManager.relationshipTypeNames.has(t)||i?.members?.forEach(t=>{const i=t.linkChartLocation;let a;const n=t.id;i&&(a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]},e.set(n,new f({x:a.x,y:a.y})))});return e}async refreshLinkChartCache(e){await this.dataManager.refreshCacheContent(e);const t=[];this.layers.forEach(e=>{t.push(e.refreshCachedQueryEngine())}),await Promise.all(t),this._refreshNamedTypes()}async connectBetweenEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}i=await this.dataManager.getRelationshipsBetweenNodes(e,a,t),await this._handleNewRecords(i,t),l(t)}catch(a){throw h(a)&&this.removeRecords(i),a}return{records:i}}async connectFromEntities(e,t){if(!e.length)return{records:[]};let i=[];try{let a=[];for(const e of this.dataManager.relationshipTypeNames){const t=this.sublayerIdsCache.get(e);t&&(a=a.concat(Array.from(t.keys())))}let n=[];for(const e of this.dataManager.entityTypeNames){const t=this.sublayerIdsCache.get(e);t&&(n=n.concat(Array.from(t)))}i=await this.dataManager.getRelationshipsFromNodes(e,n,a,t),await this._handleNewRecords(i,t),i.length>0&&(this.membershipModified=!0),l(t)}catch(a){throw h(a)&&this.removeRecords(i),a}return{records:i}}getCurrentLayout(){return this._currentLinkChartConfig.layoutMode}async _calculateLayoutWithSublayerTimeInfo(e="organic-standard",t){const i=new Map;this.layers.forEach(e=>{i.set(e.objectType.name,e.timeInfo)}),await this.calculateLinkChartLayout(e,{timeInfoByTypeName:i,...t}),this.linkChart?.handleChronologicalOverlay()}async _handleNewRecords(e,t){const i=new Set,a=[],n=this.layers.concat(this.tables);for(const r of e){if(!this._graphTypeLookup.has(r.typeName))continue;!1===n.some(e=>e.objectType.name===r.typeName)&&(this.dataManager.sublayerCaches.set(r.typeName,new Map),i.add(r.typeName));s(this.sublayerIdsCache,r.typeName,()=>new Set).add(r.id),a.push(r)}this.dataManager.addToLayer(a);for(const s of i){const e=this._graphTypeLookup.get(s);if(e){const t=this._createSublayer(e);"entity"===e.type?this.dataManager.entityTypeNames.add(s):this.dataManager.relationshipTypeNames.add(s),t.geometryType?this.layers.push(t):this.tables.push(t)}}await R(this,Array.from(i),t),await this.dataManager.refreshCacheContent(e.map(e=>e.id),void 0,void 0,void 0,t);const o={layoutSettings:this._currentLinkChartConfig.layoutSettings,lockedEntityLocations:new Map};for(const[s,r]of this.entityLinkChartDiagramLookup.entries())r&&o.lockedEntityLocations.set(s,new f(r.coords[0],r.coords[1]));await this.applyNewLinkChartLayout(this._currentLinkChartConfig.layoutMode,o)}_createSublayers(e,t,i){e.forEach(e=>{const a=this._createSublayer(e);i(a)&&t.push(a),this._updateSublayerCaches(e)})}_updateSublayers(e,t){t.forEach(t=>{t.parentCompositeLayer=this;const i=e.find(e=>e.type===t.graphType&&e.name===t.graphTypeName);i&&(t.objectType=i,t.read({title:i.name},{origin:"service"}),this._updateSublayerCaches(i))})}_updateSublayerCaches({name:e}){if(!e)return;const t=this.dataManager.sublayerCaches;t.has(e)||t.set(e,new Map)}_layersLoadedFromAuthoritativeItem(){const e=this.originIdOf("layers");return e>=3&&e<7}async _initializeDiagram(){this.initializationLinkChartConfig?this.initializationLinkChartConfig.doNotRecalculateLayout?(this.dataManager.inclusionModeDefinition?.namedTypeDefinitions?.forEach((e,t)=>{e?.members?.forEach(e=>{const i=e.linkChartLocation;let a;const n=e.id;if(!i)return;a="x"in i?{x:i.x,y:i.y}:{x:i.coords[0],y:i.coords[1]};const o=b(a);this.dataManager.relationshipTypeNames.has(t)?this.relationshipLinkChartDiagramLookup.set(n,o):this.entityLinkChartDiagramLookup.set(n,o),this.linkChartExtent.xmin>a.x&&(this.linkChartExtent.xmin=a.x),this.linkChartExtent.xmax<a.x&&(this.linkChartExtent.xmax=a.x),this.linkChartExtent.ymin>a.y&&(this.linkChartExtent.ymin=a.y),this.linkChartExtent.ymax<a.y&&(this.linkChartExtent.ymax=a.y)})}),this.memberRelationshipTypes.forEach(e=>{e.name&&this.dataManager.sublayerCaches.get(e.name)?.forEach(e=>{const t=this.relationshipLinkChartDiagramLookup.get(e.attributes[C]),i=this.relationshipLinkChartDiagramLookup.get(e.attributes[T]);if(t&&i){const a=b(new L({paths:[[[t.coords[0],t.coords[1]],[i.coords[0],i.coords[1]]]]}));this.relationshipLinkChartDiagramLookup.set(e.attributes[M],a)}else this.relationshipLinkChartDiagramLookup.set(e.attributes[M],null)})})):await this._calculateLayoutWithSublayerTimeInfo(this.initializationLinkChartConfig.layoutMode,{lockedEntityLocations:this.getCurrentNodeLocations(),...this.initializationLinkChartConfig}):await this._calculateLayoutWithSublayerTimeInfo("organic-standard",{lockedEntityLocations:this.getCurrentNodeLocations()})}_refreshNamedTypes(){for(const e of this.layers)e.emit("refresh",{dataChanged:!0});for(const e of this.tables)e.emit("refresh",{dataChanged:!0})}_validateOrganicLayoutSettings(e,t){const i=e=>"number"==typeof e&&!isNaN(e),a=e=>i(e)&&e>=1,n=e=>i(e)&&e>=1,s=e=>Object.values(N).includes(e),r=e=>i(e)&&e>=0,l={};if(!new Set(["organic-standard","organic-community","geographic-organic-standard","chronological-multi-timeline","chronological-mono-timeline"]).has(e)||!t)return l;const{computationBudgetTime:h,autoRepulsionRadius:d,repulsionRadiusMultiplier:p,absoluteIdealEdgeLength:c,multiplicativeIdealEdgeLength:u,idealEdgeLengthType:y}=t;return n(h)?l.computationBudgetTime=h:h&&o.getLogger(this).warn("Invalid layout computationBudgetTime setting, will revert to default setting"),l.autoRepulsionRadius=d,!d&&a(p)?l.repulsionRadiusMultiplier=p:d||(l.autoRepulsionRadius=!0,o.getLogger(this).warn("Invalid layout repulsionRadiusMultiplier setting, will revert to default setting")),"geographic-organic-standard"===e&&(s(y)?l.idealEdgeLengthType=y:void 0!==y&&o.getLogger(this).warn('Invalid layout idealEdgeLengthType setting, will revert to "multiplier" setting'),"absolute-value"===y&&r(c)?l.absoluteIdealEdgeLength=c:"absolute-value"===y&&void 0!==c?o.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting"):"multiplier"===y&&r(u)?l.multiplicativeIdealEdgeLength=u:"multiplier"===y&&void 0!==u&&o.getLogger(this).warn("Invalid layout idealEdgeLength setting, will revert to default setting")),l}_convertValidatedOrganicSettingsToCalculationSettings(e){let t=e.idealEdgeLengthType===N.ABSOLUTE?e.absoluteIdealEdgeLength:e.multiplicativeIdealEdgeLength;return e.idealEdgeLengthType===N.ABSOLUTE&&(void 0===t?t=-1:t*=-1),{computationBudgetTime:e.computationBudgetTime??void 0,repulsionRadiusMultiplier:e.repulsionRadiusMultiplier&&!e.autoRepulsionRadius?e.repulsionRadiusMultiplier:void 0,idealEdgeLengthMultiplier:t}}_createSublayer(e){return new D({objectType:e,parentCompositeLayer:this,graphType:e.type})}_handleSublayersChange(e,t){t&&(t.forEach(e=>{e.parent=null}),this.removeHandles("sublayers-owner")),e&&(e.forEach(e=>{e.parent=this}),this.addHandles([e.on("after-add",({item:e})=>{e.parent=this}),e.on("after-remove",({item:e})=>{e.parent=null})],"sublayers-owner"))}_alignLayersDataModelAndInclusionDefinition(e){const t=new Set((e.entityTypes??[]).map(e=>e.name).concat((e.relationshipTypes??[]).map(e=>e.name))),a=new Set((e.entityTypes??[]).map(e=>e.name)),n=new Set((e.relationshipTypes??[]).map(e=>e.name));if(this.layers){for(const i of this.layers)!i.graphType&&t.has(i.graphTypeName)&&(i.graphType=a.has(i.graphTypeName)?"entity":"relationship");const e=this.layers.filter(e=>t.has(e.graphTypeName)&&("entity"===e.graphType?a.has(e.graphTypeName):n.has(e.graphTypeName)));this.setAtOrigin("layers",e,g(this.originIdOf("layers")))}else this.layers=new i;if(this.layers&&this._originalInclusionList){const e=new Set(this._originalInclusionList.namedTypeDefinitions.keys()),t=this.tables?.map(e=>e.graphTypeName)??[],i=this.layers.map(e=>e.graphTypeName).concat(t);for(const n of i)e.has(n)||this._originalInclusionList.namedTypeDefinitions.set(n,{useAllData:!1,members:new Map});const a=[];for(const n of this._originalInclusionList.namedTypeDefinitions.keys())i.includes(n)||(o.getLogger(this).warn(`A named type, ${n}, was in the serialized feature collection but did not have a sublayer config in the item, so will be removed`),a.push(n));for(const n of a)this._originalInclusionList.namedTypeDefinitions.delete(n)}}};e([u(z)],ee.prototype,"url",void 0),e([u()],ee.prototype,"dataPreloadedInLocalCache",void 0),e([u()],ee.prototype,"initializationLinkChartConfig",void 0),e([u()],ee.prototype,"membershipModified",void 0),e([u()],ee.prototype,"dataManager",void 0),e([u()],ee.prototype,"initializationInclusionModeDefinition",null),e([u()],ee.prototype,"knowledgeGraph",void 0),e([u({type:i.ofType(D),json:{write:{ignoreOrigin:!0}}})],ee.prototype,"layers",void 0),e([u({readOnly:!0})],ee.prototype,"linkChart",null),e([u()],ee.prototype,"entityLinkChartDiagramLookup",void 0),e([u()],ee.prototype,"relationshipLinkChartDiagramLookup",void 0),e([u()],ee.prototype,"linkChartExtent",void 0),e([u()],ee.prototype,"memberEntityTypes",void 0),e([u()],ee.prototype,"memberRelationshipTypes",void 0),e([u({type:["LinkChartLayer"]})],ee.prototype,"operationalLayerType",void 0),e([u()],ee.prototype,"sublayerCapabilities",null),e([u()],ee.prototype,"sublayerIdsCache",void 0),e([u({type:i.ofType(D),json:{write:{ignoreOrigin:!0}}})],ee.prototype,"tables",void 0),e([u({json:{read:!1}})],ee.prototype,"type",void 0),e([u({readOnly:!0})],ee.prototype,"userHasEditingPrivileges",void 0),e([u({readOnly:!0})],ee.prototype,"userHasFullEditingPrivileges",void 0),e([u({readOnly:!0})],ee.prototype,"userHasUpdateItemPrivileges",void 0),e([u({json:{read:!1}})],ee.prototype,"chronologicalAuxiliaryGraphics",void 0),e([u(Y("dateFieldsTimeReference"))],ee.prototype,"dateFieldsTimeZone",void 0),ee=e([y("esri.layers.LinkChartLayer")],ee);const te=ee;export{te as default};
|