@arcgis/core 4.34.0-next.20 → 4.34.0-next.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/analysis/VolumeMeasurement/CutFillOptions.js +5 -0
  2. package/analysis/VolumeMeasurement/volumeMeasurementUtils.js +5 -0
  3. package/analysis/VolumeMeasurementAnalysis.d.ts +4 -0
  4. package/analysis/VolumeMeasurementAnalysis.js +5 -0
  5. package/assets/esri/core/workers/RemoteClient.js +1 -1
  6. package/assets/esri/core/workers/chunks/{bcaf6edf887e4afbbdd2.js → 02dc6e31b1244e5bb785.js} +1 -1
  7. package/assets/esri/core/workers/chunks/04c17957c15234ca0321.js +1 -0
  8. package/assets/esri/core/workers/chunks/084236ca316aad980192.js +1 -0
  9. package/assets/esri/core/workers/chunks/0b484224a92b52c34330.js +1 -0
  10. package/assets/esri/core/workers/chunks/{822b32aaeec05a347c84.js → 0ba6177ba118a0f032e2.js} +1 -1
  11. package/assets/esri/core/workers/chunks/12723e79b996969e304e.js +1 -0
  12. package/assets/esri/core/workers/chunks/{bd7b985f7962b1cc7b8a.js → 146520d263b910b5bdc7.js} +1 -1
  13. package/assets/esri/core/workers/chunks/{445ddf57d2f503a0b98b.js → 15064c3b21b325d5c2f6.js} +1 -1
  14. package/assets/esri/core/workers/chunks/19ae76283a0cb0fe4dee.js +346 -0
  15. package/assets/esri/core/workers/chunks/{28b525963420f022fb0a.js → 1cc30073f8200b67cff6.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{82a5000296134834d1ac.js → 1d75cb1747ffb7b8b050.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{55ce214a10fb6fc2e901.js → 24fe862b607ec927e07f.js} +1 -1
  18. package/assets/esri/core/workers/chunks/30fae1f066dc3cd781f1.js +1 -0
  19. package/assets/esri/core/workers/chunks/32756905bcf11699b3f7.js +1 -0
  20. package/assets/esri/core/workers/chunks/{7ec73f63929b1623de72.js → 3793f282ddaccd3465f2.js} +1 -1
  21. package/assets/esri/core/workers/chunks/3fcd73ba832cb53d3a07.js +1 -0
  22. package/assets/esri/core/workers/chunks/41f487713c6278d389a1.js +1 -0
  23. package/assets/esri/core/workers/chunks/{5e7f35bf1aab93cb1c52.js → 4cea5170939c8d363ef7.js} +1 -1
  24. package/assets/esri/core/workers/chunks/5253cca467fe9bc0a210.js +1 -0
  25. package/assets/esri/core/workers/chunks/{735d96d2b951cc1df3a3.js → 576e408fb0834f3948e8.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{2a784da5fa3f502d1803.js → 58e74681ddef30ba9cb6.js} +1 -1
  27. package/assets/esri/core/workers/chunks/5b276962c46c57155166.js +1 -0
  28. package/assets/esri/core/workers/chunks/5ce62d9fff80d014d186.js +1 -0
  29. package/assets/esri/core/workers/chunks/5e805c9e9012dd39ec86.js +1 -0
  30. package/assets/esri/core/workers/chunks/{27c9d3f6cebca087a123.js → 6136bf09950adc46bc33.js} +1 -1
  31. package/assets/esri/core/workers/chunks/66757fc16316a5c50e1e.js +1 -0
  32. package/assets/esri/core/workers/chunks/6a0fbc54638f7de138c1.js +1 -0
  33. package/assets/esri/core/workers/chunks/{dfd9ac2e28c96900c53e.js → 6c33ecffbc783cb8f944.js} +1 -1
  34. package/assets/esri/core/workers/chunks/6ca764b4baadef5c1515.js +1 -0
  35. package/assets/esri/core/workers/chunks/{fcdf714339060731fe1c.js → 7051bcc178eb512819f6.js} +1 -1
  36. package/assets/esri/core/workers/chunks/7cfba5cec425221962e8.js +1 -0
  37. package/assets/esri/core/workers/chunks/{3a753ce4de2e6ad40f7b.js → 86d6007c45f2aa643ac8.js} +1 -1
  38. package/assets/esri/core/workers/chunks/8b19fe829a9dc26fb3fe.js +1 -0
  39. package/assets/esri/core/workers/chunks/8eea6251aa09725e654e.js +1 -0
  40. package/assets/esri/core/workers/chunks/916691122d7fb38497d6.js +1 -0
  41. package/assets/esri/core/workers/chunks/919d2fd7ebc0c840a759.js +1 -0
  42. package/assets/esri/core/workers/chunks/92ad9098006568358550.js +1 -0
  43. package/assets/esri/core/workers/chunks/{2ed698579befe73caafd.js → 94d75f3b215e3bd1b4d7.js} +1 -1
  44. package/assets/esri/core/workers/chunks/97324f030738fc0d456b.js +1 -0
  45. package/assets/esri/core/workers/chunks/9c510df592befb9ff892.js +1 -0
  46. package/assets/esri/core/workers/chunks/{15d1ab71aaf6bcf3145b.js → a7a5b89c2bb69f3af59c.js} +1 -1
  47. package/assets/esri/core/workers/chunks/aba520714efc01bead36.js +1 -0
  48. package/assets/esri/core/workers/chunks/accff253af360c34e8a8.js +1 -0
  49. package/assets/esri/core/workers/chunks/ad3871f497ecea1a08c9.js +1 -0
  50. package/assets/esri/core/workers/chunks/ae6eed26fc932bc08356.js +1 -0
  51. package/assets/esri/core/workers/chunks/b4512d62b6cb26fc6b25.js +1 -0
  52. package/assets/esri/core/workers/chunks/{63e984a65ee670449a4a.js → b4bb461955a4c2bce072.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{abc75c945f3cfb1629b0.js → ba5b24beebeb703b5919.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{51afd0e71df1825d7593.js → c64fa94cba71ba2794e2.js} +1 -1
  55. package/assets/esri/core/workers/chunks/c94cc026c4ed330408fb.js +1 -0
  56. package/assets/esri/core/workers/chunks/cab1a1067f44ce374673.js +1 -0
  57. package/assets/esri/core/workers/chunks/{3f4a8c874c022dace9be.js → d1b363c418a67b087306.js} +1 -1
  58. package/assets/esri/core/workers/chunks/d45383d76ba99718b6d9.js +1 -0
  59. package/assets/esri/core/workers/chunks/{f806e9221dff7fcfc2f9.js → e2cb295104ed2f8cd2ff.js} +1 -1
  60. package/assets/esri/core/workers/chunks/{9432a5466eec397710a4.js → e49a135a2933306a6105.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{d31fa648497b0af97dc1.js → e9a9174c4d1a0a9effb6.js} +1 -1
  62. package/assets/esri/core/workers/chunks/f3d5d92e0aefc2593208.js +1 -0
  63. package/assets/esri/core/workers/chunks/f3e3c2340452c1d60c95.js +1 -0
  64. package/assets/esri/core/workers/chunks/{85b0e2a898251d048dda.js → f42155b7a4e6c5e80757.js} +1 -1
  65. package/assets/esri/core/workers/chunks/f43110391f124b8a179c.js +1009 -0
  66. package/assets/esri/core/workers/chunks/{080a8a1c6fe2d215142d.js → fb5e2b1ced03eef28e96.js} +1 -1
  67. package/assets/esri/core/workers/chunks/fe73e74e3e4278aedcc3.js +1 -0
  68. package/config.js +1 -1
  69. package/core/Clonable.js +1 -1
  70. package/core/lang.js +1 -1
  71. package/core/libs/rbush/PooledRBush.js +1 -1
  72. package/core/scheduling.js +1 -1
  73. package/geometry/Mesh.js +1 -1
  74. package/geometry/support/MeshComponent.js +1 -1
  75. package/geometry/support/MeshMaterial.js +1 -1
  76. package/geometry/support/MeshMaterialMetallicRoughness.js +1 -1
  77. package/geometry/support/MeshTexture.js +1 -1
  78. package/geometry/support/MeshTransform.js +1 -1
  79. package/geometry/support/MeshVertexAttributes.js +1 -1
  80. package/geometry/support/buffer/BufferView.js +1 -1
  81. package/geometry/support/float16.js +1 -1
  82. package/geometry/support/meshUtils/convertMeshVertexSpace.js +1 -1
  83. package/geometry/support/meshUtils/merge.js +1 -1
  84. package/geometry/support/meshUtils/meshCloneUtils.js +5 -0
  85. package/interfaces.d.ts +1134 -156
  86. package/kernel.js +1 -1
  87. package/layers/SubtypeGroupLayer.js +1 -1
  88. package/layers/graphics/controllers/FeatureTileController3D.js +1 -1
  89. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  90. package/layers/mixins/ArcGISMapService.js +1 -1
  91. package/layers/save/mapImageLayerUtils.js +1 -1
  92. package/layers/support/TilemapCache.js +1 -1
  93. package/layers/support/TitleCreator.js +1 -1
  94. package/layers/support/arcgisLayerUrl.js +1 -1
  95. package/layers/support/rasterFormats/TiffDecoder.js +1 -1
  96. package/package.json +1 -1
  97. package/rest/knowledgeGraph/GraphAddFieldIndexResult.d.ts +4 -0
  98. package/rest/knowledgeGraph/GraphAddPropertyResult.d.ts +4 -0
  99. package/rest/knowledgeGraph/GraphDataModelOperationResult.d.ts +4 -0
  100. package/rest/knowledgeGraph/GraphDeleteFieldIndexResult.d.ts +4 -0
  101. package/rest/knowledgeGraph/GraphDeletePropertyResult.d.ts +4 -0
  102. package/rest/knowledgeGraph/GraphUpdateNamedTypesResult.d.ts +4 -0
  103. package/rest/knowledgeGraph/GraphUpdatePropertyResult.d.ts +4 -0
  104. package/rest/knowledgeGraph/GraphUpdateSearchIndexResult.d.ts +4 -0
  105. package/rest/knowledgeGraphService.d.ts +7 -0
  106. package/support/requestUtils.js +1 -1
  107. package/support/revision.js +1 -1
  108. package/views/2d/engine/ManagedCanvas.js +1 -1
  109. package/views/2d/engine/ParentChildStage.js +5 -0
  110. package/views/2d/engine/Stage.js +1 -1
  111. package/views/2d/engine/webgl/OverlayContainer.js +1 -1
  112. package/views/2d/engine/webgl/OverlayMultipoint.js +1 -1
  113. package/views/2d/engine/webgl/Painter.js +1 -1
  114. package/views/2d/engine/webgl/VideoScreenRenderer.js +5 -0
  115. package/views/2d/engine/webgl/shaderGraph/techniques/TechniqueType.js +1 -1
  116. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js +5 -0
  117. package/views/2d/engine/webgl/shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js +5 -0
  118. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  119. package/views/2d/layers/MediaLayerView2D.js +1 -1
  120. package/views/2d/layers/TileLayerView2D.js +1 -1
  121. package/views/2d/layers/features/Processor.js +1 -1
  122. package/views/2d/layers/features/processor/AProcessorStrategy.js +1 -1
  123. package/views/2d/layers/features/support/AttributeStore.js +1 -1
  124. package/views/2d/mapViewDeps.js +1 -1
  125. package/views/3d/analysis/AnalysisViewManager3D.js +1 -1
  126. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.d.ts +4 -0
  127. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +5 -0
  128. package/views/3d/layers/FeatureLikeLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  130. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  131. package/views/3d/layers/graphics/DeconflictAABR.js +1 -1
  132. package/views/3d/layers/graphics/ExtentSet.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  134. package/views/3d/layers/graphics/Graphics3DElevationAlignment.js +1 -1
  135. package/views/3d/layers/graphics/Graphics3DFeatureProcessor.js +1 -1
  136. package/views/3d/layers/graphics/Graphics3DGraphicsPipeline.js +1 -1
  137. package/views/3d/layers/graphics/Labeler.js +1 -1
  138. package/views/3d/layers/graphics/pipeline/Feature3DPipeline.js +1 -1
  139. package/views/3d/layers/i3s/I3SAsyncElevationUpdater.js +1 -1
  140. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  141. package/views/3d/layers/i3s/I3SLodHandling.js +1 -1
  142. package/views/3d/layers/i3s/PointCloudRenderer.js +1 -1
  143. package/views/3d/layers/support/FeatureTileDescriptor.js +1 -1
  144. package/views/3d/layers/support/FeatureTileFetcher3D.js +1 -1
  145. package/views/3d/layers/support/FeatureTileFetcher3DContext.js +1 -1
  146. package/views/3d/layers/support/FeatureTileTree3D.js +1 -1
  147. package/views/3d/layers/support/FeatureVisibilityFilter.js +1 -1
  148. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  149. package/views/3d/state/GoToOperation.js +1 -1
  150. package/views/3d/state/ViewStateManager.js +1 -1
  151. package/views/3d/state/helpers/SceneIntersectionHelper.js +1 -1
  152. package/views/3d/support/StreamDataLoader.js +1 -1
  153. package/views/3d/support/buffer/InterleavedLayout.js +1 -1
  154. package/views/3d/support/cameraUtils.js +1 -1
  155. package/views/3d/support/viewingModeUtils.js +5 -0
  156. package/views/3d/support/viewpointUtils.js +1 -1
  157. package/views/3d/terrain/OverlayFramebufferObject.js +1 -1
  158. package/views/3d/terrain/OverlayManager.js +1 -1
  159. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  160. package/views/3d/terrain/OverlayRenderer.js +1 -1
  161. package/views/3d/terrain/TerrainSurface.js +1 -1
  162. package/views/3d/webgl/ManagedFBOResource.js +1 -1
  163. package/views/3d/webgl-engine/Stage.js +1 -1
  164. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  165. package/views/3d/webgl-engine/core/FBOPool.js +1 -1
  166. package/views/3d/webgl-engine/effects/RenderNodes.js +1 -1
  167. package/views/3d/webgl-engine/effects/RenderPluginManager.js +1 -1
  168. package/views/3d/webgl-engine/effects/geometry/RenderOccludedRenderNode.js +1 -1
  169. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  170. package/views/3d/webgl-engine/lib/SortedRenderGeometryRenderer.js +1 -1
  171. package/views/3d/webgl-engine/lib/glUtil3D.js +1 -1
  172. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  173. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  174. package/views/3d/webgl.d.ts +2 -0
  175. package/views/3d/webgl.js +1 -1
  176. package/views/SceneView.js +1 -1
  177. package/views/VideoView.js +1 -1
  178. package/views/View2D.js +1 -1
  179. package/views/Viewport2DBaseMixin.js +5 -0
  180. package/views/Viewport2DMixin.js +1 -1
  181. package/views/layers/FeatureLayerView.js +1 -1
  182. package/views/support/Scheduler.js +1 -1
  183. package/views/support/layerViewUtils.js +1 -1
  184. package/views/video/VideoOperationalDataView.js +5 -0
  185. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  186. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.d.ts +4 -0
  187. package/widgets/BatchAttributeForm/inputs/BatchFormInputs.js +1 -1
  188. package/widgets/BatchAttributeForm/inputs/EditableInput.d.ts +4 -0
  189. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  190. package/widgets/BatchAttributeForm/inputs/FieldInput.d.ts +4 -0
  191. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  192. package/widgets/BatchAttributeForm/inputs/GroupInput.d.ts +4 -0
  193. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  194. package/widgets/BatchAttributeForm/inputs/InputBase.d.ts +4 -0
  195. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  196. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  197. package/widgets/Directions.js +1 -1
  198. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  199. package/widgets/Editor/Edits.js +1 -1
  200. package/widgets/FeatureForm/EditableInput.d.ts +2 -2
  201. package/widgets/FeatureForm/FieldInput.d.ts +2 -2
  202. package/widgets/FeatureForm/GroupInput.d.ts +2 -2
  203. package/widgets/FeatureForm/InputBase.d.ts +2 -2
  204. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  205. package/widgets/OrientedImageryViewer/adapters/sketch/MeasurementAdapter.js +1 -1
  206. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  207. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  208. package/widgets/OrientedImageryViewer.js +1 -1
  209. package/widgets/VersionManagement/VersionManagementViewModel.js +1 -1
  210. package/widgets/VideoPlayer.js +1 -1
  211. package/widgets/support/SelectionList/FeatureItem.js +1 -1
  212. package/widgets/support/SelectionList/GroupLayerItem.js +1 -1
  213. package/widgets/support/SelectionList/LayerItem.js +1 -1
  214. package/widgets/support/SelectionList/SelectionListViewModel.js +1 -1
  215. package/widgets/support/SelectionList.js +1 -1
  216. package/widgets/support/Selector2D/SelectionOperation.js +1 -1
  217. package/assets/esri/core/workers/chunks/034950f7d0596e77a7dd.js +0 -1
  218. package/assets/esri/core/workers/chunks/0808b7b2a18331ac0cf6.js +0 -1
  219. package/assets/esri/core/workers/chunks/093938edee5f0532d7da.js +0 -1
  220. package/assets/esri/core/workers/chunks/0f5643d5437f48c63225.js +0 -1
  221. package/assets/esri/core/workers/chunks/116bbff428cc2dc1832e.js +0 -1
  222. package/assets/esri/core/workers/chunks/1646699188ed0cd4ce24.js +0 -1
  223. package/assets/esri/core/workers/chunks/1c7393bcd6e85ba25e1b.js +0 -1
  224. package/assets/esri/core/workers/chunks/2999ae2a7d4d1ad6447b.js +0 -1
  225. package/assets/esri/core/workers/chunks/2e3f620c79ec04033a6e.js +0 -1
  226. package/assets/esri/core/workers/chunks/2e54be3094e41fd3026d.js +0 -346
  227. package/assets/esri/core/workers/chunks/3541714d448958c9bc38.js +0 -1
  228. package/assets/esri/core/workers/chunks/48953ddf0bbcf3d77e04.js +0 -1
  229. package/assets/esri/core/workers/chunks/5b7464137aacf1c5fd78.js +0 -1
  230. package/assets/esri/core/workers/chunks/629a257509b148ff38c0.js +0 -1
  231. package/assets/esri/core/workers/chunks/6b5fc9da8ae34c889b83.js +0 -1
  232. package/assets/esri/core/workers/chunks/707b34e15937c4f7902f.js +0 -1
  233. package/assets/esri/core/workers/chunks/770e609a6bd3533ceda9.js +0 -1
  234. package/assets/esri/core/workers/chunks/7925e8ffa8027b59410e.js +0 -1
  235. package/assets/esri/core/workers/chunks/8235a997acb45ab43173.js +0 -1
  236. package/assets/esri/core/workers/chunks/851baab753d9c8e967bd.js +0 -1
  237. package/assets/esri/core/workers/chunks/aa6c37f116c07ddca5fb.js +0 -1
  238. package/assets/esri/core/workers/chunks/bac5e1d50b69f0d94694.js +0 -1
  239. package/assets/esri/core/workers/chunks/bc0c3b5a5ab3fcb8f77a.js +0 -1
  240. package/assets/esri/core/workers/chunks/bcefb413d03d59506b5a.js +0 -1009
  241. package/assets/esri/core/workers/chunks/c96fed4889712f5a9135.js +0 -1
  242. package/assets/esri/core/workers/chunks/cac281604a41af9b1759.js +0 -1
  243. package/assets/esri/core/workers/chunks/cb4c49d5b70f9563bc46.js +0 -1
  244. package/assets/esri/core/workers/chunks/d25c8c30ce4058937d4f.js +0 -1
  245. package/assets/esri/core/workers/chunks/d638ae7814acf6c0fb8e.js +0 -1
  246. package/assets/esri/core/workers/chunks/d6ce99a713afdb03e332.js +0 -1
  247. package/assets/esri/core/workers/chunks/dc3816eef53d17074eab.js +0 -1
  248. package/assets/esri/core/workers/chunks/dd70b060ea4f632c2430.js +0 -1
  249. package/assets/esri/core/workers/chunks/e2e5e8bd3406609d8996.js +0 -1
  250. package/assets/esri/core/workers/chunks/e9aa1d9ded8a52a40c57.js +0 -1
  251. package/assets/esri/core/workers/chunks/f65ad6a41c0c69bf1b21.js +0 -1
  252. package/assets/esri/core/workers/chunks/f6c815f7d3ca072172ce.js +0 -1
@@ -0,0 +1,4 @@
1
+ import "../../interfaces";
2
+
3
+ import GraphUpdateSearchIndexResult = __esri.GraphUpdateSearchIndexResult;
4
+ export default GraphUpdateSearchIndexResult;
@@ -1,7 +1,11 @@
1
1
  import "../interfaces";
2
2
 
3
+ export const executeAddGraphFieldIndex: __esri.knowledgeGraphService["executeAddGraphFieldIndex"];
4
+ export const executeAddGraphProperties: __esri.knowledgeGraphService["executeAddGraphProperties"];
3
5
  export const executeAddNamedTypes: __esri.knowledgeGraphService["executeAddNamedTypes"];
4
6
  export const executeApplyEdits: __esri.knowledgeGraphService["executeApplyEdits"];
7
+ export const executeDeleteGraphFieldIndex: __esri.knowledgeGraphService["executeDeleteGraphFieldIndex"];
8
+ export const executeDeleteGraphProperty: __esri.knowledgeGraphService["executeDeleteGraphProperty"];
5
9
  export const executeDeleteNamedType: __esri.knowledgeGraphService["executeDeleteNamedType"];
6
10
  export const executeFindPaths: __esri.knowledgeGraphService["executeFindPaths"];
7
11
  export const executeFindPathsAsynchronous: __esri.knowledgeGraphService["executeFindPathsAsynchronous"];
@@ -9,6 +13,9 @@ export const executeQuery: __esri.knowledgeGraphService["executeQuery"];
9
13
  export const executeQueryStreaming: __esri.knowledgeGraphService["executeQueryStreaming"];
10
14
  export const executeSearch: __esri.knowledgeGraphService["executeSearch"];
11
15
  export const executeSearchStreaming: __esri.knowledgeGraphService["executeSearchStreaming"];
16
+ export const executeUpdateGraphProperty: __esri.knowledgeGraphService["executeUpdateGraphProperty"];
17
+ export const executeUpdateNamedType: __esri.knowledgeGraphService["executeUpdateNamedType"];
18
+ export const executeUpdateSearchIndex: __esri.knowledgeGraphService["executeUpdateSearchIndex"];
12
19
  export const fetchAsynchronousFindPathsResultData: __esri.knowledgeGraphService["fetchAsynchronousFindPathsResultData"];
13
20
  export const fetchClientDataAtKeys: __esri.knowledgeGraphService["fetchClientDataAtKeys"];
14
21
  export const fetchKnowledgeGraph: __esri.knowledgeGraphService["fetchKnowledgeGraph"];
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import r from"../config.js";import has from"../core/has.js";import{isAborted as e}from"../core/promiseUtils.js";import{getOrigin as o,changeHost as t,hasSameOrigin as n,getAppUrl as s,urlToObject as i}from"../core/urlUtils.js";import{parse as c}from"../layers/support/arcgisLayerUrl.js";import{isSecureProxyService as a}from"../portal/support/urlUtils.js";function u(r,o,t=!1,n){return new Promise((s,i)=>{if(e(n))return void i(l());let c=()=>{f(),i(new Error(`Unable to load ${o}`))},a=()=>{const e=r;f(),s(e)},u=()=>{if(!r)return;const e=r;f(),e.src="",i(l())};const f=()=>{has("esri-image-decode")||(r.removeEventListener("error",c),r.removeEventListener("load",a)),c=null,a=null,r=null,null!=n&&n.removeEventListener("abort",u),u=null,t&&URL.revokeObjectURL(o)};null!=n&&n.addEventListener("abort",u),has("esri-image-decode")?r.decode().then(a,c):(r.addEventListener("error",c),r.addEventListener("load",a))})}function l(){try{return new DOMException("Aborted","AbortError")}catch{const r=new Error;return r.name="AbortError",r}}const f="Timeout exceeded";function m(){return new Error(f)}function p(r){return"object"==typeof r&&!!r&&"message"in r&&r.message===f}function d(e){r.request.crossOriginNoCorsDomains||(r.request.crossOriginNoCorsDomains={});const t=r.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?t[o(r)??""]=0:(t[o("http://"+r)??""]=0,t[o("https://"+r)??""]=0)}function w(e){const t=r.request.crossOriginNoCorsDomains;if(t){let r=o(e);if(r)return r=r.toLowerCase(),!n(r,s())&&t[r]<Date.now()-36e5}return!1}async function L(e){const t=i(e);e=t.path,"json"===t.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}const n=r.request.crossOriginNoCorsDomains,s=o(e);n&&s&&(n[s.toLowerCase()]=Date.now())}const v=new Map;function g(){v.clear()}function h(r,e){const o=e?.preferredHost;if(!o)return;const t=c(r);if(!t||"FeatureServer"!==t.serverType||a(r))return;const n=t.url.path.toLowerCase();v.has(n)||v.set(n,o)}function E(r){const e=c(r)?.url.path.toLowerCase();if(!e)return r;const o=v.get(e);return o?t(r,o):r}export{g as clearPreferredHosts,m as createTimeoutError,E as getPreferredUrl,w as isNoCorsRequestRequired,p as isTimeoutError,u as loadImageAsync,d as registerNoCorsDomains,L as sendNoCorsRequest,h as setPreferredHost};
5
+ import r from"../config.js";import has from"../core/has.js";import{isAborted as e}from"../core/promiseUtils.js";import{getOrigin as o,hasSameOrigin as t,changeHost as n,getAppUrl as s,urlToObject as i}from"../core/urlUtils.js";import{parse as c}from"../layers/support/arcgisLayerUrl.js";import{isSecureProxyService as a}from"../portal/support/urlUtils.js";function u(r,o,t=!1,n){return new Promise((s,i)=>{if(e(n))return void i(l());let c=()=>{f(),i(new Error(`Unable to load ${o}`))},a=()=>{const e=r;f(),s(e)},u=()=>{if(!r)return;const e=r;f(),e.src="",i(l())};const f=()=>{has("esri-image-decode")||(r.removeEventListener("error",c),r.removeEventListener("load",a)),c=null,a=null,r=null,null!=n&&n.removeEventListener("abort",u),u=null,t&&URL.revokeObjectURL(o)};null!=n&&n.addEventListener("abort",u),has("esri-image-decode")?r.decode().then(a,c):(r.addEventListener("error",c),r.addEventListener("load",a))})}function l(){try{return new DOMException("Aborted","AbortError")}catch{const r=new Error;return r.name="AbortError",r}}const f="Timeout exceeded";function m(){return new Error(f)}function p(r){return"object"==typeof r&&!!r&&"message"in r&&r.message===f}function d(e){r.request.crossOriginNoCorsDomains||(r.request.crossOriginNoCorsDomains={});const t=r.request.crossOriginNoCorsDomains;for(let r of e)r=r.toLowerCase(),/^https?:\/\//.test(r)?t[o(r)??""]=0:(t[o("http://"+r)??""]=0,t[o("https://"+r)??""]=0)}function w(e){const n=r.request.crossOriginNoCorsDomains;if(n){let r=o(e);if(r)return r=r.toLowerCase(),!t(r,s())&&n[r]<Date.now()-36e5}return!1}async function L(e){const t=i(e);e=t.path,"json"===t.query?.f&&(e+="?f=json");try{await fetch(e,{mode:"no-cors",credentials:"include"})}catch{}const n=r.request.crossOriginNoCorsDomains,s=o(e);n&&s&&(n[s.toLowerCase()]=Date.now())}const h=new Map;function v(r,e){const o=e?.preferredHost;if(!o||t(r,`https://${o}`,!0))return;const n=c(r);if(!n||"FeatureServer"!==n.serverType||a(r))return;const s=n.url.path.toLowerCase();h.has(s)||h.set(s,o)}function g(r){const e=c(r)?.url.path.toLowerCase();if(!e)return r;const o=h.get(e);return o?n(r,o):r}export{m as createTimeoutError,g as getPreferredUrl,w as isNoCorsRequestRequired,p as isTimeoutError,u as loadImageAsync,h as preferredHosts,d as registerNoCorsDomains,L as sendNoCorsRequest,v as setPreferredHost};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- const f="20250618",a="56a7f30aaafe519fb30f91d8f511226af7871b71";export{f as buildDate,a as commitHash};
5
+ const c="20250620",a="11765b8f1aca9f2c702b001bd2ad36138edc44f0";export{c as buildDate,a as commitHash};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Evented.js";import{on as t}from"../../../core/events.js";import{handlesGroup as a}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{identity as r,scale as i,rotate as o,translate as n}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";class c{constructor(s,r={}){this.events=new e,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,this._canvas=r.canvas??document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform");const i={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};s.contains(this._canvas)||s.appendChild(this._canvas);let o=this._canvas.getContext("webgl2",i);o||(o=this._canvas.getContext("webgl2",{...i,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=o,this._handles=a([t(this._canvas,"webglcontextlost",e=>this.events.emit("webgl-context-lost",e))])}destroy(){this._canvas.remove(),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}render(e,t){if(this._hasMajorPerformanceCaveat||has("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=has("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,a,s,r,i,o]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${t}, ${a}, ${s}, ${r}, ${i}, ${o})`}}else t()}resize(e){const t=this._canvas,a=t.style,{state:{size:s},pixelRatio:r}=e,i=s[0],o=s[1],n=Math.round(i*r),h=Math.round(o*r);t.width===n&&t.height===h||(t.width=n,t.height=h),a.width=i+"px",a.height=o+"px"}_computeViewTransform(e,t){const[a,c]=e.center,[l,m]=t.center,[f,d]=e.toScreen([0,0],l,m),[_,v]=e.toScreen([0,0],a,c),p=_-f,g=v-d,w=e.scale/t.scale,u=t.rotation-e.rotation,j=h();return r(j),i(j,j,[w,w]),o(j,j,s(u)),n(j,j,[p,g]),j}}export{c as ManagedCanvas};
5
+ import e from"../../../core/Evented.js";import{on as t}from"../../../core/events.js";import{handlesGroup as a}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import{deg2rad as s}from"../../../core/mathUtils.js";import{identity as r,scale as n,rotate as i,translate as o}from"../../../core/libs/gl-matrix-2/math/mat2d.js";import{create as h}from"../../../core/libs/gl-matrix-2/factories/mat2df64.js";class c{constructor(s,r={}){this.events=new e,this._hasMajorPerformanceCaveat=!1,this._lastRenderFrameCounter=0,null!=s?(this._canvas=document.createElement("canvas"),this._canvas.setAttribute("style","width: 100%; height:100%; display:block; willChange:transform"),s.contains(this._canvas)||s.appendChild(this._canvas)):null!=r.canvas&&(this._canvas=r.canvas);const n={failIfMajorPerformanceCaveat:!0,alpha:!0,antialias:!1,depth:!0,stencil:!0,powerPreference:"high-performance"};let i=this._canvas.getContext("webgl2",n);i||(i=this._canvas.getContext("webgl2",{...n,failIfMajorPerformanceCaveat:!1}),this._hasMajorPerformanceCaveat=!0),this._gl=i,this._handles=a([t(this._canvas,"webglcontextlost",e=>this.events.emit("webgl-context-lost",e))])}destroy(){this._canvas.remove(),this._canvas=null,this._handles.remove(),this._gl=null}get gl(){return this._gl}get canvas(){return this._canvas}render(e,t){if(this._hasMajorPerformanceCaveat||has("esri-force-performance-mode")){if(++this._lastRenderFrameCounter>=has("esri-performance-mode-frames-between-render")&&(t(),this._lastRenderViewState=e.state.clone(),this._lastRenderFrameCounter=0),this._lastRenderViewState){const[t,a,s,r,n,i]=this._computeViewTransform(this._lastRenderViewState,e.state);this._canvas.style.transform=`matrix(${t}, ${a}, ${s}, ${r}, ${n}, ${i})`}}else t()}resize(e){const t=this._canvas,a=t.style,{state:{size:s},pixelRatio:r}=e,n=s[0],i=s[1],o=Math.round(n*r),h=Math.round(i*r);t.width===o&&t.height===h||(t.width=o,t.height=h),a.width=n+"px",a.height=i+"px"}_computeViewTransform(e,t){const[a,c]=e.center,[l,m]=t.center,[f,_]=e.toScreen([0,0],l,m),[d,v]=e.toScreen([0,0],a,c),p=d-f,g=v-_,u=e.scale/t.scale,w=t.rotation-e.rotation,j=h();return r(j),n(j,j,[u,u]),i(j,j,s(w)),o(j,j,[p,g]),j}}export{c as ManagedCanvas};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import e from"../../../Color.js";import{ManagedCanvas as r}from"./ManagedCanvas.js";import{Stage as s}from"./Stage.js";import n from"./webgl/VideoScreenRenderer.js";class d extends s{constructor(e,s,d){super(null,s={...s,renderFrame:e=>{}},new r(null,{canvas:e})),this._requestRender=d,this.viewIsReady=!1,this.videoScreenRenderer=new n(this,s),this.videoScreenRenderer.visible=!0}requestRender(){this._requestRender()}renderChildren(r){this.videoScreenRenderer.bind(r),r.backgroundColor=e.fromArray([0,0,0,0]),super.renderChildren(r),this.videoScreenRenderer.unbind(r)}}class i extends s{constructor(e,r,s){super(e,r={...r,renderFrame:e=>{this.render(e)}},s),this._childStage=new d(s.canvas,r,()=>this.requestRender())}get childStage(){return this._childStage}render(e){this._childStage.viewIsReady?this._childStage.renderFrame(e):this.requestRender(),super.renderFrame(e)}processRender(e){super.processRender(e),this._childStage.viewIsReady&&this._childStage.visible&&this._childStage.videoScreenRenderer.processRender(e)}}export{d as ChildStage,i as ParentStage};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as n}from"../../../symbols/cim/cimAnalyzer.js";import{Container as a}from"./Container.js";import{ManagedCanvas as o}from"./ManagedCanvas.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as h}from"./webgl/definitions.js";import{WGLDrawPhase as d}from"./webgl/enums.js";import l from"./webgl/Painter.js";import{ArrayBufferPool as m}from"./webgl/PooledUint32Array.js";import{Profiler as c}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as p,shutdown as f}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as _}from"../support/Timeline.js";import{TextureWrapMode as b,SizedPixelFormat as w,SizedDepthStencilFormat as R,PixelFormat as y,PixelType as x}from"../../webgl/enums.js";import{FramebufferObject as P}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as j}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as C}from"../../webgl/RenderingContext.js";import{TextureDescriptor as T}from"../../webgl/TextureDescriptor.js";const M=2e3;class O extends a{constructor(t,i){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._canvas=new o(t,i),this.context=new C(this._canvas.gl,i.contextOptions??{}),this.painter=new l(this.context,this),this._cimAnalyzer=new n(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const a=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new _,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new c(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return a()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor},this._taskHandle=r({render:e=>this.renderFrame(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._canvas.events.on("webgl-context-lost",t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)})),this._bufferPool=new m,p()}destroy(){f(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._canvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._canvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=M,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(h),this._canvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=d.MAP;for(const s of e)s.processRender(t);if(this.children.some(e=>e.hasHighlight)){t.drawPhase=d.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some(e=>e.hasLabels)){t.drawPhase=d.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=d.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._canvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),n=Math.round(this.state.size[1]*e.resolutionScale),a=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:a,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new T(i,n);l.wrapMode=b.CLAMP_TO_EDGE,l.internalFormat=w.RGBA8,l.isImmutable=!0;const m=new P(o,l,new j(R.DEPTH24_STENCIL8,i,n)),c=o.getBoundFramebufferObject(),u=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,n),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:n-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(c),o.setViewport(u.x,u.y,u.width,u.height),this.requestRender();const f=await p;let g;return 1===e.outputScale?g=f:(g=new ImageData(Math.round(f.width*e.outputScale),Math.round(f.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(f,g,!0)),m.dispose(),g}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,y.RGBA,x.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{O as Stage,M as extraRenderTime};
5
+ import e from"../../../core/Error.js";import has from"../../../core/has.js";import{removeMaybe as t}from"../../../core/maybe.js";import{addFrameTask as r}from"../../../core/scheduling.js";import{signal as s}from"../../../core/signal.js";import{create as i}from"../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{CIMAnalyzer as a}from"../../../symbols/cim/cimAnalyzer.js";import{Container as n}from"./Container.js";import{MAX_TILE_RESHUFFLES_PER_FRAME as o}from"./webgl/definitions.js";import{WGLDrawPhase as h}from"./webgl/enums.js";import d from"./webgl/Painter.js";import{ArrayBufferPool as l}from"./webgl/PooledUint32Array.js";import{Profiler as m}from"./webgl/Profiler.js";import{TileReshuffleManager as u}from"./webgl/TileReshuffleManager.js";import{startup as c,shutdown as p}from"./webgl/shaderGraph/techniques/TechniqueRegistry.js";import{MeshWriterRegistry as g}from"./webgl/shaderGraph/techniques/mesh/MeshWriterRegistry.js";import{Timeline as f}from"../support/Timeline.js";import{TextureWrapMode as _,SizedPixelFormat as b,SizedDepthStencilFormat as w,PixelFormat as R,PixelType as y}from"../../webgl/enums.js";import{FramebufferObject as x}from"../../webgl/FramebufferObject.js";import{RenderbufferDescriptor as C}from"../../webgl/RenderbufferDescriptor.js";import{RenderingContext as P}from"../../webgl/RenderingContext.js";import{TextureDescriptor as j}from"../../webgl/TextureDescriptor.js";const T=2e3;class v extends n{constructor(t,i,n){super(),this.meshWriterRegistry=new g,this._trash=new Set,this._renderRemainingTime=0,this._lastFrameRenderTime=0,this._renderRequested=s(!1),this.stage=this,this._stationary=!0,this._reshuffleManager=new u,this._managedCanvas=n,this.context=new P(this._managedCanvas.gl,i.contextOptions??{}),this.painter=new d(this.context,this),this._cimAnalyzer=new a(this.painter.textureManager.resourceManager),has("esri-2d-profiler")&&null!=t&&(this._debugOutput=document.createElement("div"),this._debugOutput.setAttribute("style","margin: 24px 64px; position: absolute; color: red;"),t.appendChild(this._debugOutput));const o=()=>this.highlightGradient;this._renderParameters={drawPhase:0,state:this.state,pixelRatio:window.devicePixelRatio,stationary:!1,globalOpacity:1,blendMode:null,deltaTime:-1,time:0,inFadeTransition:!1,effects:null,context:this.context,painter:this.painter,timeline:i.timeline||new f,renderingOptions:i.renderingOptions,requestRender:()=>this.requestRender(),allowDelayedRender:!1,requireFBO:!1,profiler:new m(this.context,this._debugOutput),dataUploadCounter:0,get highlightGradient(){return o()},reshuffleManager:this._reshuffleManager,backgroundColor:i.backgroundColor};let h=e=>this.renderFrame(e);null!=i.renderFrame&&(h=i.renderFrame),this._taskHandle=r({render:e=>h(e)}),this._taskHandle.pause(),this._lostWebGLContextHandle=this._managedCanvas.events.on("webgl-context-lost",t=>this.emit("webgl-error",{error:new e("webgl-context-lost",t.statusMessage)})),this._bufferPool=new l,c()}destroy(){p(this.context),this.removeAllChildren(),this._emptyTrash(),this._taskHandle=t(this._taskHandle),this._lostWebGLContextHandle=t(this._lostWebGLContextHandle),this._managedCanvas.destroy(),this._debugOutput?.parentNode?.removeChild(this._debugOutput),this._bufferPool.destroy(),this.painter.dispose(),this.context.dispose(),this._managedCanvas=null}get textureManager(){return this.painter.textureManager}get backgroundColor(){return this._renderParameters.backgroundColor}set backgroundColor(e){this._renderParameters.backgroundColor=e,this.requestRender()}get canvas(){return this._managedCanvas.canvas}get bufferPool(){return this._bufferPool}get cimAnalyzer(){return this._cimAnalyzer}get renderingOptions(){return this._renderingOptions}set renderingOptions(e){this._renderingOptions=e,this.requestRender()}get renderRequested(){return this._renderRequested.value}get state(){return this._state}set state(e){this._state=e,this.requestRender()}get stationary(){return this._stationary}set stationary(e){this._stationary!==e&&(this._stationary=e,this.requestRender())}trashDisplayObject(e){this._trash.add(e),this.requestRender()}untrashDisplayObject(e){return this._trash.delete(e)}requestRender(){this._renderRemainingTime=T,this.renderRequested||(this._renderRequested.value=!0,this._taskHandle.resume())}renderFrame(e){const t=this._lastFrameRenderTime?e.time-this._lastFrameRenderTime:0;this._renderRemainingTime-=t,this._renderRemainingTime<=0&&this._taskHandle.pause(),this._lastFrameRenderTime=e.time,this._renderRequested.value=!1,this._renderParameters.state=this._state,this._renderParameters.stationary=this.stationary,this._renderParameters.pixelRatio=window.devicePixelRatio,this._renderParameters.globalOpacity=1,this._renderParameters.time=e.time,this._renderParameters.deltaTime=e.deltaTime,this._renderParameters.effects=null,this.processRender(this._renderParameters),this._emptyTrash()}_createTransforms(){return{displayViewScreenMat3:i()}}renderChildren(e){for(const t of this.children)t.beforeRender(e);this._reshuffleManager.reshuffle(o),this._managedCanvas.render(e,()=>this._renderChildren(this.children,e));for(const t of this.children)t.afterRender(e)}_renderChildren(e,t){const r=this.context;this.painter.textureUploadManager.upload(),r.resetInfo(),t.profiler.recordStart("drawLayers"),t.dataUploadCounter=0,this.painter.beforeRenderPhases(t,t.backgroundColor,this.state.padding),t.drawPhase=h.MAP;for(const s of e)s.processRender(t);if(this.children.some(e=>e.hasHighlight)){t.drawPhase=h.HIGHLIGHT;for(const r of e)r.processRender(t)}if(this.children.some(e=>e.hasLabels)){t.drawPhase=h.LABEL;for(const r of e)r.processRender(t)}if(has("esri-tiles-debug")){t.drawPhase=h.DEBUG;for(const r of e)r.processRender(t)}this.painter.afterRenderPhases(t),t.profiler.recordEnd("drawLayers"),r.logInfo()}doRender(e){const t=this.context,{state:r,pixelRatio:s}=e;this._managedCanvas.resize(e),t.setViewport(0,0,s*r.size[0],s*r.size[1]),t.setDepthWriteEnabled(!0),t.setStencilWriteMask(255),this.renderChildren(e)}async takeScreenshot(e,t,r,s){const i=Math.round(this.state.size[0]*e.resolutionScale),a=Math.round(this.state.size[1]*e.resolutionScale),n=e.resolutionScale,o=this.context,h=this._state.clone();if(null!=s){const e=h.viewpoint;h.viewpoint.rotation=s,h.viewpoint=e}const d={...this._renderParameters,drawPhase:null,globalOpacity:1,stationary:!0,state:h,pixelRatio:n,time:performance.now(),deltaTime:0,blendMode:null,effects:null,inFadeTransition:!1,backgroundColor:r},l=new j(i,a);l.wrapMode=_.CLAMP_TO_EDGE,l.internalFormat=b.RGBA8,l.isImmutable=!0;const m=new x(o,l,new C(w.DEPTH24_STENCIL8,i,a)),u=o.getBoundFramebufferObject(),c=o.getViewport();o.bindFramebuffer(m),o.setViewport(0,0,i,a),this._renderChildren(t??this.children,d);const p=this._readbackScreenshot(m,{...e.cropArea,y:a-(e.cropArea.y+e.cropArea.height)});o.bindFramebuffer(u),o.setViewport(c.x,c.y,c.width,c.height),this.requestRender();const g=await p;let f;return 1===e.outputScale?f=g:(f=new ImageData(Math.round(g.width*e.outputScale),Math.round(g.height*e.outputScale)),(await import("../../support/screenshotUtils.js")).resampleHermite(g,f,!0)),m.dispose(),f}async _readbackScreenshot(e,t){const r=(await import("../../support/screenshotUtils.js")).createEmptyImageData(t.width,t.height,document.createElement("canvas"));return await e.readPixelsAsync(t.x,t.y,t.width,t.height,R.RGBA,y.UNSIGNED_BYTE,new Uint8Array(r.data.buffer)),r}_emptyTrash(){for(;this._trash.size>0;){const e=Array.from(this._trash);this._trash.clear();for(const t of e)t.processDetach()}}}export{v as Stage,T as extraRenderTime};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{toRadian as t}from"../../../../core/libs/gl-matrix-2/math/common.js";import{identity as e,multiply as r,translate as o,scale as i,rotate as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{normalizeMapX as c}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as h}from"../../../../geometry/support/spatialReferenceUtils.js";import{getWorldWidth as m}from"../../viewpointUtils.js";import{WGLDrawPhase as d}from"./enums.js";import p from"./WGLContainer.js";import{OverlayTechnique as f}from"./shaderGraph/techniques/overlay/OverlayTechnique.js";class u extends p{constructor(){super(...arguments),this._viewStateId=-1,this._dvsMat3=a(),this._overlayTechnique=new f}get dvsMat3(){return this._dvsMat3}beforeRender(t){this._updateMatrices(t),this._updateOverlays(t,this.children);for(const e of this.children)e.beforeRender(t)}doRender(t){if(t.drawPhase!==d.MAP||!this.visible)return;super.doRender(t);const e=this._overlayTechnique;for(const r of this.children)r.draw(t,e)}onDetach(){this._overlayTechnique.shutdown()}_updateMatrices(a){const{state:h}=a,{id:m,size:d,pixelRatio:p,resolution:f,rotation:u,viewpoint:v,displayMat3:_}=h;if(this._viewStateId===m)return;const M=t(u),g=p*d[0],y=p*d[1];this._localOrigin=v.targetGeometry.clone();const{x:w,y:x}=this._localOrigin,b=c(w,h.spatialReference);this._localOrigin.x=b,this._localOrigin.y=x;const j=f*g,O=f*y,R=e(this._dvsMat3);r(R,R,_),o(R,R,n(g/2,y/2)),i(R,R,l(g/j,-y/O,1)),s(R,R,-M),this._viewStateId=m}_updateOverlays(e,r){const{state:o}=e,{rotation:i,spatialReference:s,worldScreenWidth:a,size:n,viewpoint:l}=o,c=this._localOrigin;let d,p=0;const f=h(s);if(f&&s.isWrappable){const e=n[0],r=n[1],c=t(i),h=Math.abs(Math.cos(c)),u=Math.abs(Math.sin(c)),v=Math.round(e*h+r*u),[_,M]=f.valid,g=m(s),{x:y,y:w}=l.targetGeometry,x=[y,w],b=[0,0];o.toScreen(b,x);const j=[0,0];let O;O=v>a?.5*a:.5*v;const R=Math.floor((y+.5*g)/g),q=_+R*g,S=M+R*g,G=[b[0]+O,0];o.toMap(j,G),j[0]>S&&(p=g),G[0]=b[0]-O,o.toMap(j,G),j[0]<q&&(p=-g),d={worldWidth:g,xBounds:[_,M]}}for(const t of r)t.updateDrawCoords(c,p,s,d)}}export{u as default};
5
+ import{toRadian as t}from"../../../../core/libs/gl-matrix-2/math/common.js";import{identity as e,multiply as r,translate as o,scale as i,rotate as s}from"../../../../core/libs/gl-matrix-2/math/mat3.js";import{create as a}from"../../../../core/libs/gl-matrix-2/factories/mat3f32.js";import{fromValues as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f32.js";import{fromValues as l}from"../../../../core/libs/gl-matrix-2/factories/vec3f32.js";import{normalizeMapX as c}from"../../../../geometry/support/normalizeUtils.js";import{getInfo as h}from"../../../../geometry/support/spatialReferenceUtils.js";import{getWorldWidth as m}from"../../viewpointUtils.js";import{WGLDrawPhase as d}from"./enums.js";import p from"./WGLContainer.js";import{OverlayTechnique as f}from"./shaderGraph/techniques/overlay/OverlayTechnique.js";class u extends p{constructor(){super(...arguments),this._viewStateId=-1,this._dvsMat3=a(),this._overlayTechnique=new f}get dvsMat3(){return this._dvsMat3}beforeRender(t){this._updateMatrices(t),this._updateOverlays(t,this.children);for(const e of this.children)e.beforeRender(t)}doRender(t){if(t.drawPhase!==d.MAP||!this.visible)return;super.doRender(t);const e=this._overlayTechnique;for(const r of this.children)r.draw(t,e)}onDetach(){this._overlayTechnique.shutdown()}_updateMatrices(a){const{state:h}=a,{id:m,size:d,pixelRatio:p,resolution:f,rotation:u,viewpoint:v,displayMat3:_}=h;if(this._viewStateId===m)return;const M=t(u),g=p*d[0],y=p*d[1];this._localOrigin=v.targetGeometry.clone();const{x:w,y:x}=this._localOrigin,b=c(w,h.spatialReference);this._localOrigin.x=b,this._localOrigin.y=x;const j=f*g,O=f*y,R=e(this._dvsMat3);r(R,R,_),o(R,R,n(g/2,y/2)),i(R,R,l(g/j,-y/O,1)),s(R,R,-M),this._viewStateId=m}_updateOverlays(e,r){const{state:o}=e,{rotation:i,spatialReference:s,worldScreenWidth:a,size:n,viewpoint:l}=o,c=this._localOrigin;let d,p=0;const f=h(s);if(f&&s.isWrappable){const e=n[0],r=n[1],c=t(i),h=Math.abs(Math.cos(c)),u=Math.abs(Math.sin(c)),v=Math.round(e*h+r*u),[_,M]=f.valid,g=m(s),{x:y,y:w}=l.targetGeometry,x=[y,w],b=[0,0];o.toScreen(b,x);const j=[0,0];let O;O=v>a?.5*a:.5*v;const R=Math.floor((y+.5*g)/g),q=_+R*g,S=M+R*g,G=[b[0]+O,0];o.toMap(j,G),j[0]>S&&(p=g),G[0]=b[0]-O,o.toMap(j,G),j[0]<q&&(p=-g),d={worldWidth:g,xBounds:[_,M]}}for(const t of r)t.updateDrawCoords(c,p,o,d)}}export{u as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import h from"../../../../geometry/Polygon.js";import{project as l}from"../../../../geometry/projectionUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import m from"../../../layers/support/Geometry.js";import{TextureWrapMode as d}from"../../../webgl/enums.js";import{Texture as c}from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends u{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||this.texture.setData(e);else{const t=new p(i,s);t.wrapMode=d.CLAMP_TO_EDGE,t.preMultiplyAlpha=!0,this.texture=new c(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;this._initializeData(t,o,r);const{controlPoints:n,horizon:a}=o,u=Math.sqrt(n.length),d=u,{x:c,y:p}=t,x=this._vertices,y=n[0],g=n[u-1],P=n[(d-1)*u],w=n[(d-1)*u+u-1],_=l(a?a[0].mapPoint:y.mapPoint,r),v=l(a?a[1].mapPoint:g.mapPoint,r),j=l(P.mapPoint,r),A=l(w.mapPoint,r);this.clipGeometry=a?new m({geometry:h.fromJSON({rings:[[[j.x,j.y],[A.x,A.y],[v.x,v.y],[_.x,_.y],[j.x,j.y]]],spatialReference:r})}):null;for(let h=0;h<n.length;h++){const t=n[h],{sourcePoint:e,mapPoint:i}=t;if(null==e||null==i)continue;const s=l(i,r);x[h*f+0]=s.x-c,x[h*f+1]=s.y-p}let M=e;if(i){const t=Math.min(_.x,v.x,j.x,A.x),e=Math.max(_.x,v.x,j.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?M=r:e>n&&t<n&&(M=-r)}this.wrapAroundShift=M,this.isWrapAround=0!==M}draw(t,e){this.visible&&(this.isReady&&this._vertices&&this._indices&&this._texCoords?e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices}):this.requestRender())}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(f*i.length),a=new Uint16Array(2*i.length);for(let m=0;m<i.length;m++){const e=i[m],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const h=l(o,r);n[m*f+0]=h.x-t.x,n[m*f+1]=h.y-t.y,a[2*m+0]=s.x,a[2*m+1]=s.y}const h=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let l=0;l<o;l++){for(let t=0;t<s;t++)h[u++]=l*s+t,h[u++]=(l+1)*s+t;l<o-2&&(h[u++]=(l+1)*s+(s-1),h[u++]=(l+1)*s)}this._vertices=n,this._texCoords=a,this._indices=h}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[{sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)},{sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)}]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:h,lon:l}=t[n];r[n]={sourcePoint:o(e*s,-i*s),mapPoint:new a(l,h)}}return r}}export{x as default};
5
+ import{on as t}from"../../../../core/events.js";import e from"../../../../core/Handles.js";import{disposeMaybe as r}from"../../../../core/maybe.js";import{when as i,initial as s}from"../../../../core/reactiveUtils.js";import{createScreenPoint as o}from"../../../../core/screenUtils.js";import{create as n}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import a from"../../../../geometry/Point.js";import l from"../../../../geometry/Polygon.js";import{project as h}from"../../../../geometry/projectionUtils.js";import{DisplayObject as u}from"../DisplayObject.js";import m from"../../../layers/support/Geometry.js";import{TextureWrapMode as c}from"../../../webgl/enums.js";import{Texture as d}from"../../../webgl/Texture.js";import{TextureDescriptor as p}from"../../../webgl/TextureDescriptor.js";const f=2;class x extends u{constructor(r){super(),this.element=r,this._handles=new e,this.isWrapAround=!1,this.perspectiveTransform=n(),this.wrapAroundShift=0,this.clipGeometry=null,this._handles.add(i(()=>this.element,()=>{const e=this.element;this.ready(),e&&this._handles.add(t(e,"play",()=>this.requestRender()))},s))}getMesh(t){throw new Error("Method not implemented.")}destroy(){this._handles.destroy(),this.texture=r(this.texture)}get textureSize(){if(!this.texture)return[1,1];const t=this.texture.descriptor;return[t.width,t.height]}get dvsMat3(){return this.parent.dvsMat3}beforeRender(t){const e=this.element;if(null==e)return;const{context:r}=t,{videoWidth:i,videoHeight:s}=e;if(0!==i&&0!==s){if(this.texture)e.paused||this.texture.setData(e);else{const t=new p(i,s);t.wrapMode=c.CLAMP_TO_EDGE,t.preMultiplyAlpha=!0,this.texture=new d(r,t,e)}e.paused||(this.texture.generateMipmap(),this.requestRender()),super.beforeRender(t)}}_createTransforms(){return null}updateDrawCoords(t,e,r,i){const s=this.element,o=this._getFrameInfo();if(!s||!o)return;const{spatialReference:n}=r;this._initializeData(t,o,n);const{controlPoints:a,horizon:u}=o,c=Math.sqrt(a.length),d=c,{x:p,y:x}=t,y=this._vertices,g=a[0],P=a[c-1],w=a[(d-1)*c],_=a[(d-1)*c+c-1],v=h(u?u[0].mapPoint:g.mapPoint,n),j=h(u?u[1].mapPoint:P.mapPoint,n),M=h(w.mapPoint,n),A=h(_.mapPoint,n);this.clipGeometry=u?new m({geometry:l.fromJSON({rings:[[[M.x,M.y],[A.x,A.y],[j.x,j.y],[v.x,v.y],[M.x,M.y]]],spatialReference:n})}):null;for(let l=0;l<a.length;l++){const t=a[l],{sourcePoint:e,mapPoint:r}=t;if(null==e||null==r)continue;const i=h(r,n);y[l*f+0]=i.x-p,y[l*f+1]=i.y-x}let b=e;if(i){const t=Math.min(v.x,j.x,M.x,A.x),e=Math.max(v.x,j.x,M.x,A.x),{worldWidth:r,xBounds:s}=i,[o,n]=s;t<o&&e>o?b=r:e>n&&t<n&&(b=-r)}this.wrapAroundShift=b,this.isWrapAround=0!==b}draw(t,e){if(!this.visible)return;if(!(this.isReady&&this._vertices&&this._indices&&this._texCoords))return void this.requestRender();this.stage||console.warn("OverlayMultipoint: stage is null"),e.render(t,{transform:{dvs:this.dvsMat3},config:{perspective:this.perspectiveTransform,texSize:this.textureSize,wrapAroundShift:this.wrapAroundShift,isWrapAround:this.isWrapAround,opacity:this.opacity,texture:{texture:this.texture,unit:0}},position:this._vertices,tex:this._texCoords,index:this._indices})}_initializeData(t,e,r){if(null!=this._vertices&&null!=this._indices)return;const{controlPoints:i}=e,s=Math.sqrt(i.length),o=s,n=new Float32Array(f*i.length),a=new Uint16Array(2*i.length);for(let m=0;m<i.length;m++){const e=i[m],{sourcePoint:s,mapPoint:o}=e;if(null==s||null==o)continue;const l=h(o,r);n[m*f+0]=l.x-t.x,n[m*f+1]=l.y-t.y,a[2*m+0]=s.x,a[2*m+1]=s.y}const l=new Uint16Array(o*s+(o-2)*(s+2));let u=0;for(let h=0;h<o;h++){for(let t=0;t<s;t++)l[u++]=h*s+t,l[u++]=(h+1)*s+t;h<o-2&&(l[u++]=(h+1)*s+(s-1),l[u++]=(h+1)*s)}this._vertices=n,this._texCoords=a,this._indices=l}_getFrameInfo(){if(!this.groundControlPoints)return null;const t=this._getFrameControlPoints(),e=this.frameHorizonPoints;let r=null;if(e){const t=e.startX,i=e.startY,s=e.endX,n=e.endY;r=[{sourcePoint:o(t,i),mapPoint:new a(e.startLongitude,e.startLatitude)},{sourcePoint:o(s,n),mapPoint:new a(e.endLongitude,e.endLatitude)}]}return{controlPoints:t,horizon:r}}_getFrameControlPoints(){const t=this.groundControlPoints,e=t?.length;if(!e)return[];const r=new Array(e),i=Math.max(...t.map(({x:t})=>t)),s=this.element.videoWidth/i;for(let n=0;n<e;n++){const{x:e,y:i,lat:l,lon:h}=t[n];r[n]={sourcePoint:o(e*s,-i*s),mapPoint:new a(h,l)}}return r}}export{x as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import h from"./TextureManager.js";import{TextureUploadManager as l}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,FramebufferBit as w,CompareFunction as M,BlendFactor as P,SizedDepthStencilFormat as C,BlendOperation as B,Face as N}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as A}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";class F{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new h(t),this.textureUploadManager=new l(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new T(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new O(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(M.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(o||x(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(w.STENCIL)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||x(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const h=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,h,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map(e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e)));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new T(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new A(C.DEPTH24_STENCIL8,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new O(this.context,s,this._stencilBuf),effect0:new O(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),h=this._programCache.getProgram(s,o,r,i??{},n??{});return h.setUniforms(r),h.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),h.cleanupTemporaryTextures(),{vertexShader:h.vertexShader,fragmentShader:h.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,h=this._programCache.getProgram(i,{},n,a??{},o??{});if(h.setUniforms(n),h.bind(e),this.updatePipelineState(e),r)for(const l of r)s.bind(e,t.shader.locationInfo,l),s.draw(e);else for(let l=0;l<s.parts.length;l++)s.bind(e,t.shader.locationInfo,l),s.draw(e);s.unbind(e),h.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(P.ONE,P.ONE,P.ONE,P.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(N.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,r,i)}}}}}function x(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{F as default};
5
+ import"../../../../core/has.js";import{disposeMaybe as e,destroyMaybe as t}from"../../../../core/maybe.js";import{brushes as s}from"../brushes.js";import r from"../vectorTiles/shaders/VTLMaterialManager.js";import{BitBlitRenderer as i}from"./BitBlitRenderer.js";import{backbufferStencilVisible as n}from"./definitions.js";import{WGLDrawPhase as a}from"./enums.js";import o from"./MaterialManager.js";import l from"./TextureManager.js";import{TextureUploadManager as h}from"./TextureUploadManager.js";import{WorldExtentRenderer as f}from"./WorldExtentClipRenderer.js";import{BlendEffect as c}from"./effects/BlendEffect.js";import{FeatureEffect as d}from"./effects/FeatureEffect.js";import u from"./effects/HighlightEffect.js";import{HittestEffect as p}from"./effects/HittestEffect.js";import{EffectManager as _}from"./effects/post-processing/EffectManager.js";import{SimpleMesh as b}from"./meshing/SimpleMesh.js";import m from"./painter/RenderPass.js";import{TechniqueProgramCache as E}from"./shaderGraph/techniques/TechniqueProgramCache.js";import{TextureSamplingMode as S,TextureWrapMode as g,FramebufferBit as w,CompareFunction as M,BlendFactor as P,SizedDepthStencilFormat as C,BlendOperation as B,Face as N}from"../../../webgl/enums.js";import{FramebufferObject as O}from"../../../webgl/FramebufferObject.js";import{Renderbuffer as R}from"../../../webgl/Renderbuffer.js";import{RenderbufferDescriptor as A}from"../../../webgl/RenderbufferDescriptor.js";import{TextureDescriptor as T}from"../../../webgl/TextureDescriptor.js";class F{constructor(e,t){this.context=e,this._currentPipelineStateNeedsUpdate=!1,this._blitRenderer=new i,this._worldExtentRenderer=new f,this._brushCache=new Map,this._lastWidth=null,this._lastHeight=null,this._vtlMaterialManager=new r,this._blendEffect=new c,this._stencilBuf=null,this._prevBeforeLayerFBOStack=[],this._fboPool=[],this.effects={highlight:new u,hittest:new p,insideEffect:new d("inside"),outsideEffect:new d("outside")},this._programCache=new E,this._shaderState={shader:null,uniforms:null,defines:null,optionalAttributes:null,useComputeBuffer:!1},this.materialManager=new o(e),this.textureManager=new l(t),this.textureUploadManager=new h(t),this._effectsManager=new _,this._quadMesh=b.fromVertexStream(e,[0,0,1,0,0,1,1,1])}dispose(){if(this._programCache.destroy(),this.materialManager.dispose(),this.textureManager.dispose(),this.textureUploadManager.destroy(),this._blitRenderer=e(this._blitRenderer),this._worldExtentRenderer=e(this._worldExtentRenderer),this._quadMesh=t(this._quadMesh),this._brushCache&&(this._brushCache.forEach(e=>e.dispose()),this._brushCache.clear(),this._brushCache=null),this._fbos){let e;for(e in this._fbos)this._fbos[e]&&this._fbos[e].dispose()}for(const e of this._fboPool)e.dispose();if(this._fboPool.length=0,this.effects){let e;for(e in this.effects)this.effects[e]&&this.effects[e].dispose()}this._effectsManager.dispose(),this._blendEffect.dispose(this.context),this._vtlMaterialManager=e(this._vtlMaterialManager)}clearShaderCache(){this._programCache.destroy(),this._programCache=new E}get blitRenderer(){return this._blitRenderer}get vectorTilesMaterialManager(){return this._vtlMaterialManager}get quadMesh(){return this._quadMesh}getFbos(){if(!this._fbos)throw new Error("InternalError: Painter FBOs not initialized");return this._fbos}acquireFbo(e,t){let s;if(this._fboPool.length>0)s=this._fboPool.pop();else{const r=new T(e,t);r.samplingMode=S.NEAREST,r.wrapMode=g.CLAMP_TO_EDGE,s=new O(this.context,r,this._stencilBuf)}return s.width===e&&s.height===t||s.resize(e,t),s}releaseFbo(e){this._fboPool.push(e)}getSharedStencilBuffer(){return this._stencilBuf}beforeRenderPhases(e,t,s){const{context:r}=e;this._worldExtentRenderer.render(e,t,s);const{width:i,height:n}=r.getViewport();if(this.updateFBOs(i,n),this._prevFBO=r.getBoundFramebufferObject(),r.bindFramebuffer(this.getFbos().output),r.setColorMask(!0,!0,!0,!0),null!=t){const{r:e,g:s,b:i,a:n}=t;r.setClearColor(n*e/255,n*s/255,n*i/255,n)}else r.setClearColor(0,0,0,0);r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}afterRenderPhases(e){const{context:t}=e;t.bindFramebuffer(this._prevFBO),t.setStencilFunction(M.EQUAL,n,255),t.setStencilTestEnabled(!0),t.setDepthTestEnabled(!1),this.blitTexture(t,this.getFbos().output.colorTexture,S.NEAREST)}beforeRenderLayer(e,t,s){const{context:r,blendMode:i,effects:n,drawPhase:a,requireFBO:o}=e;if(r.setClearColor(0,0,0,0),o||x(a,i,n,s)){const e=r.getBoundFramebufferObject();this._prevBeforeLayerFBOStack.push(e);const{width:t,height:s}=r.getViewport(),i=this.acquireFbo(t,s);r.bindFramebuffer(i),r.setColorMask(!0,!0,!0,!0),r.setClearColor(0,0,0,0),r.setDepthWriteEnabled(!0),r.setClearDepth(1),r.clear(w.COLOR|w.DEPTH),r.setDepthWriteEnabled(!1)}r.setDepthWriteEnabled(!1),r.setDepthTestEnabled(!1),r.setStencilTestEnabled(!0),r.setClearStencil(t),r.setStencilWriteMask(255),r.clear(w.STENCIL)}afterRenderLayer(e,t){const{context:s,blendMode:r,effects:i,requireFBO:n,drawPhase:o}=e;if(n||x(o,r,i,t)){const n=s.getBoundFramebufferObject();null!=i&&i.length>0&&o===a.MAP&&(s.setColorMask(!0,!0,!0,!0),this._applyEffects(e,i,n)),s.bindFramebuffer(this._prevBeforeLayerFBOStack.pop()),s.setStencilTestEnabled(!1),s.setStencilWriteMask(0),s.setBlendingEnabled(!0),s.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),s.setColorMask(!0,!0,!0,!0);const l=null==r||o===a.HIGHLIGHT||o===a.LABEL?"normal":r;this._blendEffect.draw(e,n.colorTexture,S.NEAREST,l,t),this.releaseFbo(n)}}renderObject(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.prepareState(e),a.draw(e,t,i)}renderObjects(e,t,r,i){const n=s[r];if(!n)return;let a=this._brushCache.get(n);void 0===a&&(a=new n,this._brushCache.set(n,a)),a.drawMany(e,t,i)}registerRenderPass(e){const t=e.brushes.map(e=>(this._brushCache.has(e)||this._brushCache.set(e,new e),this._brushCache.get(e)));return new m(t,e)}blitTexture(e,t,s,r=1){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),this._blitRenderer.render(e,t,s,r),this._currentPipelineStateNeedsUpdate=!0}getPostProcessingEffects(e){return this._effectsManager.getPostProcessingEffects(e)}updateFBOs(e,t){if(e!==this._lastWidth||t!==this._lastHeight){if(this._lastWidth=e,this._lastHeight=t,this._fbos){let s;for(s in this._fbos)this._fbos[s].resize(e,t);return}const s=new T(e,t);s.samplingMode=S.NEAREST,s.wrapMode=g.CLAMP_TO_EDGE;const r=new A(C.DEPTH24_STENCIL8,e,t);this._stencilBuf=new R(this.context,r),this._fbos={output:new O(this.context,s,this._stencilBuf),effect0:new O(this.context,s,this._stencilBuf)}}}_applyEffects(e,t,s){const{context:r}=e,i=this._effectsManager.getPostProcessingEffects(t);for(const{postProcessingEffect:n,effect:a}of i)r.bindFramebuffer(s),n.draw(e,s,a);this._currentPipelineStateNeedsUpdate=!0}setShader(e){this._shaderState.shader=e.shader,this._shaderState.uniforms=e.uniforms,this._shaderState.defines=e.defines,this._shaderState.optionalAttributes=e.optionalAttributes,this._shaderState.useComputeBuffer=e.useComputeBuffer??!1}setPipelineState(e){e!==this._currentPipelineState&&(this._currentPipelineState=e,this._currentPipelineStateNeedsUpdate=!0)}submitDraw(e,t){const{shader:s,uniforms:r,defines:i,optionalAttributes:n}=this._shaderState,a=e.context,o=t.getAttributePrecisionPackFactors(),l=this._programCache.getProgram(s,o,r,i??{},n??{});return l.setUniforms(r),l.bind(a),this.updatePipelineState(a),this.setStencilRef(a,t),t.draw(e,s.locationInfo),l.cleanupTemporaryTextures(),{vertexShader:l.vertexShader,fragmentShader:l.fragmentShader}}submitDrawMesh(e,t,s,r){this.submitDrawMeshUntyped(e,t,s,r)}submitDrawMeshUntyped(e,t,s,r){this.setShader(t);const{shader:i,uniforms:n,defines:a,optionalAttributes:o}=this._shaderState,l=this._programCache.getProgram(i,{},n,a??{},o??{});if(l.setUniforms(n),l.bind(e),this.updatePipelineState(e),r)for(const h of r)s.bind(e,t.shader.locationInfo,h),s.draw(e);else for(let h=0;h<s.parts.length;h++)s.bind(e,t.shader.locationInfo,h),s.draw(e);s.unbind(e),l.cleanupTemporaryTextures()}updatePipelineState(e){this._currentPipelineStateNeedsUpdate&&(this._currentPipelineStateNeedsUpdate=!1,this._updatePipelineState(e))}_updatePipelineState(e){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{color:t,depth:s,stencil:r}=this._currentPipelineState;if(t){const{blendMode:s,write:r}=t;switch(e.setColorMask(...r),e.setBlendingEnabled(!0),e.setBlendEquation(B.ADD),s){case"composite":e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA);break;case"additive":e.setBlendFunctionSeparate(P.ONE,P.ONE,P.ONE,P.ONE);break;case"custom":{const{blendParameters:s}=t,{dstAlpha:r,dstRGB:i,srcAlpha:n,srcRGB:a}=s;e.setBlendFunctionSeparate(a,i,n,r);break}case"delete":e.setBlendEquation(B.REVERSE_SUBTRACT),e.setBlendFunctionSeparate(P.ONE,P.ONE_MINUS_SRC_ALPHA,P.ONE,P.ONE_MINUS_SRC_ALPHA)}}else e.setColorMask(!1,!1,!1,!1);if(s){const{test:t,write:r}=s;r?(e.setDepthWriteEnabled(!0),e.setDepthRange(r.zNear,r.zFar)):e.setDepthWriteEnabled(!1),t?(e.setDepthTestEnabled(!0),e.setDepthFunction(t)):e.setDepthTestEnabled(!1)}else e.setDepthTestEnabled(!1),e.setDepthWriteEnabled(!1);if(r){const{test:t,write:s}=r;if(t){const{compare:s,mask:r,op:i,ref:n}=t;e.setStencilTestEnabled(!0),"function"!=typeof n&&e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,n,r),e.setStencilOpSeparate(N.FRONT_AND_BACK,i.fail,i.zFail,i.zPass)}else e.setStencilTestEnabled(!1);if(s){const{mask:t}=s;e.setStencilWriteMask(t)}else e.setStencilWriteMask(0)}else e.setStencilTestEnabled(!1),e.setStencilWriteMask(0)}setStencilRef(e,t){if(null==this._currentPipelineState)throw new Error("Pipeline state not defined. Call setPipelineState before calling submitDraw ");const{stencil:s}=this._currentPipelineState;if(s){const{test:r}=s;if(r){const{compare:s,mask:i,ref:n}=r;if("function"==typeof n){const r=t.getStencilReference();if(null===r)throw new Error("InternalError: Stencil reference expected for target but not defined");e.setStencilFunctionSeparate(N.FRONT_AND_BACK,s,r,i)}}}}}function x(e,t,s,r){return e!==a.LABEL_ALPHA&&e!==a.LABEL&&e!==a.HIGHLIGHT&&(1!==r||null!=t&&"normal"!==t||null!=s&&s.length>0)}export{F as default};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{disposeMaybe as e}from"../../../../core/maybe.js";import{create as t}from"../../../../core/libs/gl-matrix-2/factories/vec2f64.js";import{create as r}from"../../../../core/libs/gl-matrix-2/factories/vec4f32.js";import o from"../../../../geometry/Point.js";import{load as s,execute as i}from"../../../../geometry/operators/projectOperator.js";import{DisplayObject as a}from"../DisplayObject.js";import{VideoScreenTechnique as n}from"./shaderGraph/techniques/videoScreenRenderer/VideoScreenTechnique.js";import{TextureSamplingMode as h,TextureWrapMode as d,ColorAttachment0 as c,SizedPixelFormat as u}from"../../../webgl/enums.js";import{FramebufferObject as l}from"../../../webgl/FramebufferObject.js";import{Texture as m}from"../../../webgl/Texture.js";import{TextureDescriptor as x}from"../../../webgl/TextureDescriptor.js";class b extends a{constructor(e,t){super(),this._controlPointsOwner=t,this.readbackScreenCoords=r(),this.videoTextureCoords=new Array(36),this.overlayTextureCoords=new Array(36),this._prevFBO=null,this._acquiredFBO=null,this._isBound=!1,this._hasCoordinates=!1,this._geIsLoaded=!1,this._technique=new n,this.visible=!1,this.stage=e;for(let r=0;r<6;r++){const e=r/5;for(let t=0;t<6;t++){const o=t/5;this.videoTextureCoords[6*r+t]={u:o,v:e}}}}getMesh(e){throw new Error("Method not implemented.")}destroy(){e(this._readbackTexture)}bind(e){const{context:t,pixelRatio:r,state:o}=e;if(this._update(o),!this.ready||0===this.readbackScreenCoords[2]||0===this.readbackScreenCoords[3])return this.requestRender(),!1;const{size:s}=o,i=Math.round(r*s[0]),a=Math.round(r*s[1]),n=new x(i,a);return n.samplingMode=h.LINEAR,n.wrapMode=d.CLAMP_TO_EDGE,this._acquiredFBO||(this._acquiredFBO=new l(t,n)),this._acquiredFBO.resize(i,a),t.bindFramebuffer(this._acquiredFBO),this._isBound=!0,!0}unbind(e){if(!this._isBound)return;const{context:t,pixelRatio:r,state:o}=e,{size:s}=o,i=this._acquiredFBO;if(!i.getColorTexture(c))throw new Error("Failed to get color texture from FBO.");const a=this._getReadbackTexture(e),n=this.readbackScreenCoords,h=Math.round(r*n[0]),d=Math.round(r*(s[1]-n[1]))-a.descriptor.height,u=h+a.descriptor.width,l=d+a.descriptor.height,m=Math.max(h,0),x=Math.max(d,0),b=Math.min(u,i.width)-m,f=Math.min(l,i.height)-x;b>0&&f>0&&i.copyToTexture(m,x,b,f,m-h,x-d,a),t.bindFramebuffer(this._prevFBO)}_update(e){const r=this._controlPointsOwner.groundControlPoints(),a=r?.length;if(!a)return;if(s().then(()=>{this._geIsLoaded=!0}),!this._geIsLoaded)return void this.requestRender();const n=new Array(a),h=e.spatialReference;for(let t=0;t<a;t++){const{lat:e,lon:s}=r[t],a=new o(s,e);n[t]=i(a,h)}const d=[];let c=1/0,u=1/0,l=-1/0,m=-1/0;for(const o of n){const r=t();e.toScreen(r,o.x,o.y),d.push({x:r[0],y:r[1]}),c=Math.min(c,r[0]),u=Math.min(u,r[1]),l=Math.max(l,r[0]),m=Math.max(m,r[1])}const x=[c,m],b=[l,u];this.readbackScreenCoords[0]=Math.max(Math.floor(x[0]),0),this.readbackScreenCoords[1]=Math.max(Math.floor(b[1]),0),this.readbackScreenCoords[2]=Math.ceil(b[0]),this.readbackScreenCoords[3]=Math.ceil(x[1]);for(let t=0;t<d.length;t++){const e=d[t],r=(e.x-c)/(l-c),o=(m-e.y)/(m-u);this.overlayTextureCoords[t]={u:r,v:o}}this._hasCoordinates=!0}_createTransforms(){return null}doRender(e){if(!this._readbackTexture||!this._hasCoordinates)return void this.requestRender();const{state:t,pixelRatio:r}=e,{size:o}=t,s=[Math.round(r*o[0]),Math.round(r*o[1])],i=this._readbackTexture.descriptor,a=[i.width,i.height];this._technique.render(e,{texture:this._readbackTexture,textureCoords:this.overlayTextureCoords,opacity:1,screenSize:s,size:a})}_getReadbackTexture(e){const{context:t,pixelRatio:r}=e,o=Math.round(r*Math.abs(this.readbackScreenCoords[2]-this.readbackScreenCoords[0])),s=Math.round(r*Math.abs(this.readbackScreenCoords[3]-this.readbackScreenCoords[1]));if(this._readbackTexture)this._readbackTexture.resize(o,s);else{const e=new x(o,s);e.wrapMode=d.CLAMP_TO_EDGE,e.internalFormat=u.RGBA8,this._readbackTexture=new m(t,e)}return this._readbackTexture}}export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- var e,t;!function(e){e[e.AnimatedMarker=0]="AnimatedMarker",e[e.AnimatedMarkerShift=1]="AnimatedMarkerShift",e[e.AnimatedFill=2]="AnimatedFill",e[e.AnimatedLine=3]="AnimatedLine",e[e.Blend=4]="Blend",e[e.ComplexFill=5]="ComplexFill",e[e.ComplexOutlineFill=6]="ComplexOutlineFill",e[e.DotDensity=7]="DotDensity",e[e.Fill=8]="Fill",e[e.GradientFill=9]="GradientFill",e[e.GradientStroke=10]="GradientStroke",e[e.Grid=11]="Grid",e[e.Heatmap=12]="Heatmap",e[e.Label=13]="Label",e[e.Line=14]="Line",e[e.Magnifier=15]="Magnifier",e[e.Marker=16]="Marker",e[e.OutlineFill=17]="OutlineFill",e[e.Overlay=18]="Overlay",e[e.PatternFill=19]="PatternFill",e[e.PatternOutlineFill=20]="PatternOutlineFill",e[e.PieChart=21]="PieChart",e[e.Test=22]="Test",e[e.Text=23]="Text",e[e.TexturedLine=24]="TexturedLine",e[e.Bitmap=25]="Bitmap"}(e||(e={})),function(e){e[e.RasterColorizer=0]="RasterColorizer",e[e.RasterProcessor=1]="RasterProcessor",e[e.Aspect=2]="Aspect",e[e.BandArithmetic=3]="BandArithmetic",e[e.ColormapToRGB=4]="ColormapToRGB",e[e.CompositeBand=5]="CompositeBand",e[e.ComputeChange=6]="ComputeChange",e[e.ContrastBrightness=7]="ContrastBrightness",e[e.Convolution=8]="Convolution",e[e.Curvature=9]="Curvature",e[e.ExtractBand=10]="ExtractBand",e[e.Grayscale=11]="Grayscale",e[e.Hillshade=12]="Hillshade",e[e.Local=13]="Local",e[e.Mask=14]="Mask",e[e.NDVI=15]="NDVI",e[e.Remap=16]="Remap",e[e.Reproject=17]="Reproject",e[e.ShadedRelief=18]="ShadedRelief",e[e.Slope=19]="Slope",e[e.Statistics=20]="Statistics",e[e.Stretch=21]="Stretch"}(t||(t={}));export{t as RasterTechniqueType,e as TechniqueType};
5
+ var e,t;!function(e){e[e.AnimatedFill=0]="AnimatedFill",e[e.AnimatedLine=1]="AnimatedLine",e[e.AnimatedMarker=2]="AnimatedMarker",e[e.AnimatedMarkerShift=3]="AnimatedMarkerShift",e[e.Bitmap=4]="Bitmap",e[e.Blend=5]="Blend",e[e.ComplexFill=6]="ComplexFill",e[e.ComplexOutlineFill=7]="ComplexOutlineFill",e[e.DotDensity=8]="DotDensity",e[e.Fill=9]="Fill",e[e.GradientFill=10]="GradientFill",e[e.GradientStroke=11]="GradientStroke",e[e.Grid=12]="Grid",e[e.Heatmap=13]="Heatmap",e[e.Label=14]="Label",e[e.Line=15]="Line",e[e.Magnifier=16]="Magnifier",e[e.Marker=17]="Marker",e[e.OutlineFill=18]="OutlineFill",e[e.Overlay=19]="Overlay",e[e.PatternFill=20]="PatternFill",e[e.PatternOutlineFill=21]="PatternOutlineFill",e[e.PieChart=22]="PieChart",e[e.Test=23]="Test",e[e.Text=24]="Text",e[e.TexturedLine=25]="TexturedLine",e[e.VideoScreen=26]="VideoScreen"}(e||(e={})),function(e){e[e.RasterColorizer=0]="RasterColorizer",e[e.RasterProcessor=1]="RasterProcessor",e[e.Aspect=2]="Aspect",e[e.BandArithmetic=3]="BandArithmetic",e[e.ColormapToRGB=4]="ColormapToRGB",e[e.CompositeBand=5]="CompositeBand",e[e.ComputeChange=6]="ComputeChange",e[e.ContrastBrightness=7]="ContrastBrightness",e[e.Convolution=8]="Convolution",e[e.Curvature=9]="Curvature",e[e.ExtractBand=10]="ExtractBand",e[e.Grayscale=11]="Grayscale",e[e.Hillshade=12]="Hillshade",e[e.Local=13]="Local",e[e.Mask=14]="Mask",e[e.NDVI=15]="NDVI",e[e.Remap=16]="Remap",e[e.Reproject=17]="Reproject",e[e.ShadedRelief=18]="ShadedRelief",e[e.Slope=19]="Slope",e[e.Statistics=20]="Statistics",e[e.Stretch=21]="Stretch"}(t||(t={}));export{t as RasterTechniqueType,e as TechniqueType};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{_ as o,a as t}from"../../../../../../../chunks/tslib.es6.js";import{GraphShaderModule as e,FragmentOutput as r,location as s,uniform as p,input as i,VertexInput as n,UniformGroup as c,FragmentInput as d}from"../../GraphShaderModule.js";import{Vec4 as a,texture2D as l,Vec2 as x,Float as y,Sampler2D as u}from"../../graph/glsl.js";class f extends n{}o([s(0,x)],f.prototype,"position",void 0),o([s(1,x)],f.prototype,"texcoord",void 0),o([s(2,y)],f.prototype,"w",void 0);class g extends d{}class m extends c{}o([p(u)],m.prototype,"texture",void 0),o([p(y)],m.prototype,"opacity",void 0);class h extends e{constructor(){super(...arguments),this.type="VideoScreenShader"}vertex(o){const{position:t,texcoord:e,w:r}=o;return{glPosition:new a(t,0,r),texcoord:e}}fragment(o){const t=new r;return t.fragColor=l(this.config.texture,o.texcoord).multiply(this.config.opacity),t}}o([p(m)],h.prototype,"config",void 0),o([t(0,i(f))],h.prototype,"vertex",null),o([t(0,i(g))],h.prototype,"fragment",null);export{h as VideoScreenShader};
@@ -0,0 +1,5 @@
1
+ /*
2
+ All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
+ See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
+ */
5
+ import{destroyMaybe as e}from"../../../../../../../core/maybe.js";import{Mesh as t}from"../../../meshing/Mesh.js";import{simplePipelineState as r}from"../../utils.js";import{Technique as s}from"../Technique.js";import{TechniqueType as o}from"../TechniqueType.js";import{VideoScreenShader as i}from"../shaders/VideoScreenShader.js";import{PrimitiveType as n,DataType as m}from"../../../../../../webgl/enums.js";import{VertexElementDescriptor as h}from"../../../../../../webgl/VertexElementDescriptor.js";class u extends s{constructor(){super(...arguments),this.type=o.VideoScreen,this._mesh=null,this.shaders={geometry:new i}}render(e,t){const{context:s,painter:o}=e,{texture:i,textureCoords:n}=t,m=this._getMesh(e),h=2,u=2,a=-1,p=1,c=new Float32Array(180);for(let r=0;r<6;r++){const e=u*r/5;for(let t=0;t<6;t++){const s=h*t/5,{u:o,v:i}=n[6*r+t];c[5*(6*r+t)]=a+s,c[5*(6*r+t)+1]=p-e,c[5*(6*r+t)+2]=o,c[5*(6*r+t)+3]=i,c[5*(6*r+t)+4]=1}}m.vertexBuffers.get("geometry")?.buffer.setData(c);const f={texture:{texture:i,unit:0},opacity:t.opacity},d={shader:this.shaders.geometry,uniforms:{config:f},defines:{},optionalAttributes:null,useComputeBuffer:!1};o.setPipelineState(r),o.submitDrawMeshUntyped(s,d,m)}shutdown(){e(this._mesh)}_getMesh(e){const{context:r}=e,s=new Uint32Array(150);for(let t=0;t<5;t++)for(let e=0;e<5;e++){const r=6*(5*t+e),o=6*(t+1)+e+1,i=o-1,n=o-6,m=o-7;s[r]=o,s[r+1]=i,s[r+2]=n,s[r+3]=i,s[r+4]=m,s[r+5]=n}return this._mesh||(this._mesh=new t(r,{vertex:{geometry:{data:new Float32Array(180),attributes:[new h("position",2,m.FLOAT,0,20),new h("texcoord",2,m.FLOAT,8,20),new h("w",1,m.FLOAT,16,20)]}},index:{index:{data:s}},groups:[{primitive:n.TRIANGLES,index:"index"}],parts:[{group:0,start:0,count:s.length}]})),this._mesh}}export{u as VideoScreenTechnique};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlOr as v,sqlIn as _,sqlAnd as b}from"../../../core/sql.js";import{property as F}from"../../../core/accessorSupport/decorators/property.js";import{subclass as S}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as A}from"../../../core/support/UpdatingHandles.js";import j from"../../../geometry/Extent.js";import U from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as I}from"../../../layers/graphics/featureConversionUtils.js";import x from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as E}from"../../../layers/support/featureLayerUtils.js";import{packFields as k}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as C}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as V}from"../../../layers/support/timeSupport.js";import q from"../../../rest/support/AggregateFeatureSet.js";import R from"../../../rest/support/AttributeBinsFeatureSet.js";import O from"../../../rest/support/AttributeBinsQuery.js";import Q from"../../../rest/support/FeatureSet.js";import L from"../../../rest/support/Query.js";import{LayerView2DMixin as T}from"./LayerView2D.js";import{FeatureContainer as D}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as P}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as W}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as M}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as H}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as N}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as J}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as G}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as $}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as B}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as z}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as Z}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as K}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as X}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as Y}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as ee}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as te}from"./support/handleNoEngineError.js";import{toJSONGeometryType as re}from"./support/util.js";import{FeatureTileSubscriptionManager as se}from"../tiling/FeatureTileSubscriptionManager.js";import ie from"../../layers/FeatureLayerView.js";import ae from"../../layers/LayerView.js";import oe from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as ne}from"../../support/HighlightDefaults.js";function ue(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const le=4294967294;function he(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let ce=class extends(ie(oe(T(ae)))){constructor(){super(...arguments),this._commandsQueue=new ee({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new W,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new A,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new U}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===C(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await P(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get effectiveDisplayFilterClause(){const e=this.effectiveDisplayFilter?.where??null;return e&&this.hasHighlight?v(e,_(this.layer.objectIdField,this.highlightIds)):e}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new J(this.layer):new H(this.layer);case"geojson":case"csv":case"wfs":return new J(this.layer);case"parquet":return new z(this.layer);case"subtype-group":return new K(this.layer);case"ogc-feature":return new $(this.layer);case"stream":return new Z(this.layer);case"oriented-imagery":return new B(this.layer);case"knowledge-graph-sublayer":return new G(this.layer);case"catalog-footprint":return new M(this.layer);default:o(this.layer)}return null}get timeExtent(){return V(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=t?.name??ne;return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return te(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return te(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return te(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return te(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return te(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return te(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return te(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return te(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return te(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=Q.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await te(r,{features:[]}),i=Q.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await te(r,{features:[]}),i=q.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return te(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return te(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return te(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return te(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return te(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return te(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await te(r,{count:0,extent:null});return{count:s.count,extent:j.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await te(r,{features:[]});return R.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.subscriptionManager.update(e.targetState,this._lastTargetState),r=this.subscriptionManager.coverageSet;for(const s of this.featureContainer.tiles||[])s.isCoverage=r.has(s.id),s.neededForCoverage=t.has(s.id)||s.isCoverage;this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new D(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new se({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([he([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=re(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await X({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=L.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=O.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=L.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this.updateSuspended?(this.subscriptionManager.suspend(),Promise.resolve()):this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%le+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%le+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=re(this.layer.geometryType),i=N(this.layer),a=[];for(const o of e.added){const e=I(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=I(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),E(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender(),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new Y;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new Y;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=ue(this._lastAvailableFields,e);return this._lastAvailableFields=t,k(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[pe(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function pe(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new x,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new x,i.where=b(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new x).toJSON(),u.hiddenIds=Array.from(s)),u}e([F()],ce.prototype,"_commandsQueue",void 0),e([F()],ce.prototype,"_sourceRefreshVersion",void 0),e([F()],ce.prototype,"_displayRefreshVersion",void 0),e([F({readOnly:!0})],ce.prototype,"_pipelineUpdating",void 0),e([F()],ce.prototype,"_sourceUpdating",void 0),e([F({readOnly:!0})],ce.prototype,"dataUpdating",null),e([F({readOnly:!0})],ce.prototype,"effectiveDisplayFilterClause",null),e([F({readOnly:!0})],ce.prototype,"hasAllFeatures",null),e([F({readOnly:!0})],ce.prototype,"hasAllFeaturesInView",null),e([F({readOnly:!0})],ce.prototype,"hasFullGeometries",null),e([F()],ce.prototype,"featureEffectView",void 0),e([F()],ce.prototype,"labelingCollisionInfos",null),e([F()],ce.prototype,"layerAdapter",null),e([F({readOnly:!0})],ce.prototype,"timeExtent",null),e([F()],ce.prototype,"updating",void 0),ce=e([S("esri.views.2d.layers.FeatureLayerView2D")],ce);export{ce as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../AggregateGraphic.js";import r from"../../../Graphic.js";import s from"../../../TrackGraphic.js";import{isSome as i}from"../../../core/arrayUtils.js";import a from"../../../core/Collection.js";import{neverReached as o}from"../../../core/compilerUtils.js";import n from"../../../core/Error.js";import{makeHandle as u,handlesGroup as l}from"../../../core/handleUtils.js";import has from"../../../core/has.js";import h from"../../../core/Logger.js";import{destroyMaybe as c}from"../../../core/maybe.js";import{notDeepEqual as p}from"../../../core/object.js";import{createAbortError as d,createResolver as y,ignoreAbortErrors as f,throwIfNotAbortError as g,isAbortError as m}from"../../../core/promiseUtils.js";import{watch as w}from"../../../core/reactiveUtils.js";import{sqlAnd as v}from"../../../core/sql.js";import{property as _}from"../../../core/accessorSupport/decorators/property.js";import{subclass as b}from"../../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as S}from"../../../core/support/UpdatingHandles.js";import F from"../../../geometry/Extent.js";import A from"../../../layers/effects/FeatureEffectView.js";import{convertFromFeature as j}from"../../../layers/graphics/featureConversionUtils.js";import U from"../../../layers/support/FeatureFilter.js";import{checkServiceCurrentUserSupport as x}from"../../../layers/support/featureLayerUtils.js";import{packFields as I}from"../../../layers/support/fieldUtils.js";import{getEffectiveLayerCapabilities as E}from"../../../layers/support/layerUtils.js";import{combineTimeExtent as k}from"../../../layers/support/timeSupport.js";import C from"../../../rest/support/AggregateFeatureSet.js";import V from"../../../rest/support/AttributeBinsFeatureSet.js";import q from"../../../rest/support/AttributeBinsQuery.js";import R from"../../../rest/support/FeatureSet.js";import Q from"../../../rest/support/Query.js";import{LayerView2DMixin as O}from"./LayerView2D.js";import{FeatureContainer as L}from"./features/FeatureContainer.js";import{createFeaturePipelineWorkerProxy as T}from"./features/FeaturePipelineWorkerProxy.js";import{FeatureSourceEventLog as P}from"./features/FeatureSourceEventLog.js";import{CatalogFootprintLayerAdapter as W}from"./features/layerAdapters/CatalogFootprintLayerAdapter.js";import{FeatureLayerAdapter as M}from"./features/layerAdapters/FeatureLayerAdapter.js";import{createFeatureIdInfo as D}from"./features/layerAdapters/featureServiceUtils.js";import{InMemoryLayerAdapter as H}from"./features/layerAdapters/InMemoryLayerAdapter.js";import{KnowledgeGraphSublayerAdapter as N}from"./features/layerAdapters/KnowledgeGraphSublayerAdapter.js";import{OGCFeatureLayerAdapter as J}from"./features/layerAdapters/OGCFeatureLayerAdapter.js";import{OrientedImageryLayerAdapter as G}from"./features/layerAdapters/OrientedImageryLayerAdapter.js";import{ParquetLayerAdapter as $}from"./features/layerAdapters/ParquetLayerAdapter.js";import{StreamLayerAdapter as B}from"./features/layerAdapters/StreamLayerAdapter.js";import{SubtypeGroupLayerAdapter as z}from"./features/layerAdapters/SubtypeGroupLayerAdapter.js";import{createComplexSymbolInstances as Z}from"./features/schema/processor/symbols/ComplexSymbolSchema.js";import{DebouncedFeatureOverride as K}from"./support/DebouncedFeatureOverride.js";import{FeatureCommandQueue as X}from"./support/FeatureCommandQueue.js";import{handleNoEngineError as Y}from"./support/handleNoEngineError.js";import{toJSONGeometryType as ee}from"./support/util.js";import{FeatureTileSubscriptionManager as te}from"../tiling/FeatureTileSubscriptionManager.js";import re from"../../layers/FeatureLayerView.js";import se from"../../layers/LayerView.js";import ie from"../../layers/RefreshableLayerView.js";import{defaultHighlightName as ae}from"../../support/HighlightDefaults.js";function oe(e,t){const r=new Set;return e&&e.forEach(e=>r.add(e)),t&&t.forEach(e=>r.add(e)),r.has("*")?["*"]:Array.from(r)}const ne=4294967294;function ue(e,t){return l(e.map(e=>w(()=>{const t=e();return t&&"object"==typeof t?"getTime"in t&&"function"==typeof t.getTime?t.getTime():JSON.stringify(t):t},t)))}let le=class extends(re(ie(O(se)))){constructor(){super(...arguments),this._commandsQueue=new X({process:e=>{switch(e.type){case"override-batch":return this._doOverride(e);case"update":return this._doUpdate();case"highlight":return this._updateHighlights()}}}),this._visibilityOverrides=new Set,this._lastAvailableFields=[],this._lastTargetState=null,this.eventLog=new P,this._sourceRefreshVersion=1,this._displayRefreshVersion=1,this._pipelineUpdating=!1,this._editUpdatingHandles=new S,this._fields=null,this._sourceUpdating=!1,this.featureEffectView=new A}destroy(){this._workerProxy?.destroy(),this._workerAttached.reject(d()),this._commandsQueue.destroy()}initialize(){this._workerAttached=y(),f(this._workerAttached.promise),this.addResolvingPromise(this._initProxy()),this.featureEffectView.featureEffect=this.featureEffect,this.featureEffectView.endTransition()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new n("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:e});if(("feature"===e.type||"subtype-group"===e.type)&&!1===E(e)?.operations.supportsQuery)throw new n("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._workerProxy&&this._workerProxy.destroy();const t=this._createClientOptions();this._workerProxy=await T(t)}async _attachProxy(){const e={service:await this.layerAdapter.createServiceOptions(this.view),tileInfoJSON:this.view?.featuresTilingScheme?.tileInfo?.toJSON()};let t=[];Array.isArray(e.service.source)&&(t=e.service.source);try{await this._workerProxy.pipeline.onAttach(e,{transferList:t}),this._workerAttached.resolve()}catch(r){this._workerAttached.reject(d()),g(r)}}async _detachProxy(){return this._workerProxy.pipeline.onDetach()}async getWorker(){return await this._workerAttached.promise,this._workerProxy}get dataUpdating(){return this._sourceUpdating||this._editUpdatingHandles.updating}get hasAllFeatures(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryAllFeatures}get hasAllFeaturesInView(){const e=this.effectiveDisplayFilter?.where||null,t=!this.eventLog.willQueryAllFeatures&&null!=e&&"1=1"!==e;return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&!t}get hasFullGeometries(){return this.layer.visible&&!this.suspended&&this.eventLog.hasAllData&&this.eventLog.willQueryFullResolutionGeometry}get labelingCollisionInfos(){const e=this.layerAdapter.getLabelingDeconflictionInfo(this.view),t=this.layer.geometryType,r=!this.suspended;return e.map(({vvEvaluators:e,deconflictionEnabled:s,labelingInfo:i})=>({labelingInfo:i,container:this.featureContainer,vvEvaluators:e,deconflictionEnabled:s,geometryType:t,visible:r}))}get layerAdapter(){switch(this.layer.type){case"feature":return"memory"===this.layer.source.type?new H(this.layer):new M(this.layer);case"geojson":case"csv":case"wfs":return new H(this.layer);case"parquet":return new $(this.layer);case"subtype-group":return new z(this.layer);case"ogc-feature":return new J(this.layer);case"stream":return new B(this.layer);case"oriented-imagery":return new G(this.layer);case"knowledge-graph-sublayer":return new N(this.layer);case"catalog-footprint":return new W(this.layer);default:o(this.layer)}return null}get timeExtent(){return k(this.layerAdapter.timeOptions,this.view?.timeExtent,this._get("timeExtent"))}getDisplayStatistics(e,t){return this.featureContainer?.getDisplayStatistics(e,t)}async queryHeatmapStatistics(e){return(await this.getWorker()).pipeline.queryHeatmapStatistics(e)}highlight(e,t){let s;e instanceof r?s=[e.getObjectId()]:"number"==typeof e||"string"==typeof e?s=[e]:a.isCollection(e)&&e.length>0?s=e.map(e=>e?.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(s="number"==typeof e[0]||"string"==typeof e[0]?e:e.map(e=>e?.getObjectId()));const o=s?.filter(i);if(!o?.length)return u();const n=t?.name??ae;return this._addHighlights(o,n),u(()=>!this.destroyed&&this._removeHighlights(o,n))}async hitTest(e,i){const a=await this.featureContainer.hitTest(i);if(0===a.length)return null;const o=await this.getWorker(),{features:n,aggregates:u,tracks:l}=await o.pipeline.getDisplayFeatures(a),h=this.featureContainer.getSortKeys(a),c=({displayId:e},{displayId:t})=>h.has(e)&&h.has(t)?h.get(e)-h.get(t):e-t;return n.sort(c).reverse(),u.sort(c).reverse(),[...u.map(r=>this._createGraphicHit(e,t.fromJSON(r))),...l.map(t=>this._createGraphicHit(e,s.fromJSON(t))),...n.map(t=>this._createGraphicHit(e,r.fromJSON(t)))]}async queryStatistics(){const e=await this.getWorker();return Y(e.pipeline.queryStatistics(),{featureCount:0,ringCount:0,vertexCount:0})}async querySummaryStatistics(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForSummaryStatistics(this._cleanUpQuery(e),i,r);return Y(a,{})}async queryAggregateSummaryStatistics(e,t,r){const s={...t,scale:this.view.scale},i=(await this.getWorker()).aggregates.executeQueryForSummaryStatistics(this._cleanUpAggregateQuery(e),s,r);return Y(i,{})}async queryUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForUniqueValues(this._cleanUpQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryAggregateUniqueValues(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForUniqueValues(this._cleanUpAggregateQuery(e),i,r);return Y(a,{uniqueValueInfos:[]})}async queryClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForClassBreaks(this._cleanUpQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryAggregateClassBreaks(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForClassBreaks(this._cleanUpAggregateQuery(e),i,r);return Y(a,{classBreakInfos:[]})}async queryHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.features.executeQueryForHistogram(this._cleanUpQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}async queryAggregateHistogram(e,t,r){const s=await this.getWorker(),i={...t,scale:this.view.scale},a=s.aggregates.executeQueryForHistogram(this._cleanUpAggregateQuery(e),i,r);return Y(a,{bins:[],maxValue:null,minValue:null,normalizationTotal:null})}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(e=>{const t=R.fromJSON(e);return t.features.forEach(e=>this._setLayersForFeature(e)),t})}async queryVisibleFeatures(e,t){const r=(await this.getWorker()).pipeline.queryVisibleFeatures(this._cleanUpQuery(e),t),s=await Y(r,{features:[]}),i=R.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregates(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t),s=await Y(r,{features:[]}),i=C.fromJSON(s);return i.features.forEach(e=>this._setLayersForFeature(e)),i}async queryAggregateIds(e,t){const r=(await this.getWorker()).aggregates.executeQueryForIds(this._cleanUpAggregateQuery(e),t);return Y(r,[])}async queryAggregateCount(e,t){const r=(await this.getWorker()).aggregates.executeQueryForCount(this._cleanUpAggregateQuery(e),t);return Y(r,0)}async queryAggregateJSON(e,t){const r=(await this.getWorker()).aggregates.executeQuery(this._cleanUpAggregateQuery(e),t);return Y(r,{features:[]})}async queryFeaturesJSON(e,t){const r=(await this.getWorker()).features.executeQuery(this._cleanUpQuery(e),t);return Y(r,{features:[]})}async queryObjectIds(e,t){const r=(await this.getWorker()).features.executeQueryForIds(this._cleanUpQuery(e),t);return Y(r,[])}async queryFeatureCount(e,t){const r=(await this.getWorker()).features.executeQueryForCount(this._cleanUpQuery(e),t);return Y(r,0)}async queryExtent(e,t){const r=(await this.getWorker()).features.executeQueryForExtent(this._cleanUpQuery(e),t),s=await Y(r,{count:0,extent:null});return{count:s.count,extent:F.fromJSON(s.extent)}}async queryAttributeBins(e,t){const r=(await this.getWorker()).features.executeAttributeBinsQuery(this._cleanUpAttributeBinsQuery(e),t),s=await Y(r,{features:[]});return V.fromJSON(s)}async getSampleFeatures(e){return(await this.getWorker()).pipeline.getSampleFeatures(e)}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this.subscriptionManager)return;this.view.animation&&!this._lastTargetState&&(this._lastTargetState=e.state.clone()),!this.view.animation&&this._lastTargetState&&(this._lastTargetState=null);const t=this.subscriptionManager.update(e.targetState,this._lastTargetState),r=this.subscriptionManager.coverageSet;for(const s of this.featureContainer.tiles||[])s.isCoverage=r.has(s.id),s.neededForCoverage=t.has(s.id)||s.isCoverage;this.featureContainer.setVisibleTiles(t)}attach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.attach"),f(this._updatingHandles.addPromise(this._workerAttached.promise)),f(this._attachProxy()),this.featureContainer=new L(this),this.container.addChild(this.featureContainer),this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this.subscriptionManager=new te({tileInfoView:this.view.featuresTilingScheme,updateSubscriptions:e=>{this.featureContainer.updateSubscriptions(e),f(this._updatingHandles.addPromise(this.getWorker().then(t=>t.pipeline.updateSubscriptions(e))))},isDone:e=>this.featureContainer.isDone(e)}),this.requestUpdate(),this.addAttachHandles([ue([()=>this._displayRefreshVersion,()=>this.layer.displayFilterInfo,()=>this.timeExtent,()=>this.clips,()=>this.filter,()=>this.effectiveDisplayFilterClause,()=>this.featureEffect,()=>this._sourceRefreshVersion,()=>this.view.timeZone,()=>this.view.timeExtent,...this.layerAdapter.getUpdateHashProperties(this.view)],()=>this._update()),w(()=>this.updateSuspended,e=>{e||(this.subscriptionManager.resume(),this.view.labelManager.requestUpdate())}),w(()=>this.visible,e=>{this.view.labelManager.requestUpdate()})]),this._update(),"stream"!==this.layer.type&&"parquet"!==this.layer.type&&"catalog-footprint"!==this.layer.type&&this.addAttachHandles(this.layer.on("edits",e=>this._editUpdatingHandles.addPromise(this._edit(e))))}detach(){has("esri-2d-update-debug")&&console.debug("FeatureLayerView2D.detach"),this._detachProxy(),this._fields=null,this.featureContainer.destroy(),this.featureContainer=null,this._commandsQueue.clear(),this.container.removeAllChildren(),this.subscriptionManager=c(this.subscriptionManager),this._workerProxy.pipeline.onDetach(),this._workerAttached=y(),f(this._workerAttached.promise),this._lastAvailableFields=[],this._lastSchema=null}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}addOverrides(e){return this._commandsQueue.push({type:"override",options:{...e,release:[]}})}removeOverrides(e){for(const r of e)if(null==r)throw new n("featurelayerview:bad-override","Tried to remove an override for an invalid objectId",{objectId:r});const t={added:[],updated:[],removed:[],release:e,isWeak:!1,historicMoment:null};return this._commandsQueue.push({type:"override",options:t})}isUpdating(){const e="renderer"in this.layer&&null!=this.layer.renderer,t=this._commandsQueue.updateTracking.updating,r=null!=this._updatingRequiredPromise,s=this.featureContainer.updatingHandles.updating,i=this.updateRequested||e&&(t||r)||s||this._pipelineUpdating||this.dataUpdating;if(has("esri-2d-log-updating")){console.log(`Updating FLV2D (${this.layer.id}): ${i}\n -> updateRequested ${this.updateRequested}\n -> hasRenderer ${e}\n -> updatingRequiredFields ${r}\n -> hasPendingCommand ${t}\n -> dataUpdating ${this.dataUpdating}\n -> processing ${this._pipelineUpdating}\n -> updatingContainer ${s}\n`);for(const e of this.featureContainer.subscriptions())console.log(` -> Tile[${e.id}] Done: ${e.done}`)}return i}_createClientOptions(){const e=this;return{get container(){return e.featureContainer},setUpdating:e=>{this._set("_pipelineUpdating",e.pipeline),this._set("_sourceUpdating",e.source)},emitEvent:e=>{this.emit(e.name,e.event)},get eventLog(){return e.eventLog},fetch:async t=>{if(has("esri-2d-stabilize-glyphs")){const r=[];for(const s of t)r.push(await e.view.stage.painter.textureManager.rasterizeItem(s));return r}return Promise.all(t.map(t=>e.view.stage.painter.textureManager.rasterizeItem(t)))},fetchDictionary:e=>Promise.all(e.map(e=>this._fetchDictionaryRequest(e)))}}async _fetchDictionaryRequest(e){try{if("subtype-group"===this.layer.type)throw new Error("InternalError: SubtypeGroupLayer does not support dictionary renderer");const t=this.layer.renderer;if(!t||"dictionary"!==t.type)throw new Error("InternalError: Expected layer to have a DictionaryRenderer");const r=this._lastSchema.processor.mesh.factory.symbology;if("dictionary"!==r.type)throw new Error("InternalError: Expected schema to be of type 'dictionary'");const s={cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,store:this.featureContainer.instanceStore,scaleExpression:r.scaleExpression};this._fields||(this._fields=this.layer.fields.map(e=>e.toJSON()));const i=r.visualVariableUniforms,a=ee(this.layer.geometryType),o=await t.getSymbolForControlString(e.controlString,a,!1);if(!o||!o.data)return{type:"dictionary-response",meshes:[]};return{type:"dictionary-response",meshes:await Z({...o.data,hasTextStringTemplates:!0},{uniforms:i,path:"renderer",schemaOptions:s})}}catch(t){return{type:"dictionary-response",meshes:[]}}}_cleanUpQuery(e){const t=Q.from(e)||this.createQuery();return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAttributeBinsQuery(e){const t=q.from(e);return t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference),t.toJSON()}_cleanUpAggregateQuery(e){const t=Q.from(e)||this.createAggregateQuery();t.outSpatialReference||(t.outSpatialReference=this.view.spatialReference);const r=t.objectIds??[];for(const s of t.aggregateIds??[])r.push(s);return t.objectIds=r,t.aggregateIds=[],t.toJSON()}async _update(){return this._commandsQueue.push({type:"update"})}_edit(e){return this.updateSuspended?(this.subscriptionManager.suspend(),Promise.resolve()):this._commandsQueue.push({type:"edit",event:e})}async doRefresh(e){this.attached&&(this.updateSuspended&&e||(e?this.incrementSourceRefreshVersion():this.incrementDisplayRefreshVersion()))}incrementSourceRefreshVersion(){this._sourceRefreshVersion=(this._sourceRefreshVersion+1)%ne+1}incrementDisplayRefreshVersion(){this._displayRefreshVersion=(this._displayRefreshVersion+1)%ne+1}async _resolveIdenifiers(e){const t=[],r=[];for(const a of e)null==a.objectId||-1===a.objectId?null==a.globalId?h.getLogger(this).warn("mapview-apply-edits","A feature identifier must contain either a GlobalId or ObjectId. Ignoring",{identifier:a}):r.push(a.globalId):t.push(a.objectId);const s="globalIdField"in this.layer&&this.layer.globalIdField,i=s&&this.availableFields.includes(s);if(r.length&&!i)return h.getLogger(this).error(new n("mapview-apply-edits",`Editing the specified service requires the layer's globalIdField, ${s} to be included the layer's outFields for updates to be reflected on the map`)),t;if(r.length){const e=await this._workerProxy.pipeline.getObjectIdsFromGlobalIds(r);for(const r of e)t.push(r)}return t}_resolveOverrides(e){const t=!1,r=!1,s=ee(this.layer.geometryType),i=D(this.layer),a=[];for(const o of e.added){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.updated){const e=j(o,s,t,r,i);if(null==e.objectId)throw new n("featurelayerview:bad-override","Feature does not have an objectId",{feature:o});a.push(e)}for(const o of e.removed)if(null==o)throw new n("featurelayerview:bad-override","Tried to remove an invalid objectId",{objectId:o});return{type:"override",updates:a,removed:e.removed,release:e.release,isWeak:e.isWeak??!1,historicMoment:e.historicMoment??null}}async _resolveEdit(e){const t=this.layer,r=e.historicMoment?.getTime()??null,s="layerId"in t&&e.editedFeatures?.find(e=>e.layerId===t.layerId);if(s&&this._canEditByFeature(s)){const{adds:e,deletes:t,updates:i}=s.editedFeatures,a=this.layer.objectIdField,o=i.map(e=>e.current),n=t.map(e=>"attributes"in e?{objectId:a?e.attributes[a]:null}:e),u=await this._resolveIdenifiers(n);return this._resolveOverrides({added:e,updated:o,removed:u,historicMoment:r,isWeak:!0,release:[]})}const[i,a,o]=await Promise.all([this._resolveIdenifiers(e.addedFeatures),this._resolveIdenifiers(e.updatedFeatures),this._resolveIdenifiers(e.deletedFeatures)]);return{type:"override-by-id",updates:[...i,...a],removed:o,historicMoment:r,isWeak:!0}}_canEditByFeature(e){const{adds:t,updates:r}=e.editedFeatures;return t.every(e=>this.view.spatialReference.equals(e.geometry?.spatialReference))&&r.every(e=>this.view.spatialReference.equals(e.current.geometry?.spatialReference))}async _doUpdate(){"featureReduction"in this.layer&&this.layer.featureReduction&&this.layer.featureReduction!==this._lastFeatureReduction&&(this.layer.featureReduction=this.layer.featureReduction?.clone(),this._lastFeatureReduction=this.layer.featureReduction);try{if(await Promise.allSettled([this._handleChange(),x(this.layer)]),this.destroyed||!this.layerAdapter?.hasRequiredSupport||!this.subscriptionManager)return;const e=this.featureContainer.instanceStore;this.featureContainer.attributeView.lockTextureUploads();const t=this._lastSchema?.processor.mesh.factory.symbology?.type;let r=!0;"subtype-group"!==this.layer.type&&"dictionary"===this.layer.renderer?.type&&"dictionary"===t&&(r=!1),e.updateStart(r);const s=this.featureEffect,i={store:e,cimAnalyzer:this.view.stage.cimAnalyzer,cimResourceManager:this.view.stage.painter.textureManager.resourceManager,scaleExpression:void 0},a=await this._createViewSchemaConfig(),o={source:this.layerAdapter.createSourceSchema(a,this._sourceRefreshVersion),processor:await this.layerAdapter.createProcessorSchema(i,a,this._displayRefreshVersion)},n=o.processor.mesh.factory.labels;n&&this.view.labelManager.setLabelSchemaStyles(n,this.featureContainer);const u=p(this._lastSchema?.source.mutable,o.source.mutable)||p(this._lastSchema?.processor,o.processor);if(!u)return this.featureContainer.requestRender(),this.featureContainer.attributeView.unlockTextureUploads(),e.updateEnd(r),void(this.featureEffectView.featureEffect=s);this._lastSchema=o,this._fields=null;const l=Math.round(performance.now());has("esri-2d-update-debug")&&console.debug(`Id[${this.layer.uid}] Version[${l}] FeatureLayerView2D._doUpdate`,{changes:u});const h=await this.getWorker();await h.pipeline.updateSchema(o,l),e.updateEnd(r),this.featureEffectView.featureEffect=s,this.featureEffectView.endTransition(),this.featureContainer.restartAllAnimations(),this.featureContainer.attributeView.unlockTextureUploads(),this.featureContainer.trySwapRenderState(),this.featureContainer.requestRender(),has("esri-2d-update-debug")&&console.debug(`Version[${l}] FeatureLayerView2D.updateEnd`),this.requestUpdate()}catch(e){has("esri-2d-update-debug")&&console.error("Encountered an error during update",e)}}async _doOverride(e){const t=await this.getWorker();try{for(const r of e.messages)switch(r.type){case"edit":{const e=new K;e.add(await this._resolveEdit(r.event)),await t.pipeline.onOverride(e.toMessage());break}case"override":{const e=new K;e.add(this._resolveOverrides(r.options)),await t.pipeline.onOverride(e.toMessage());break}}}catch(r){m(r),0}}_getEffectiveAvailableFields(e){const t=oe(this._lastAvailableFields,e);return this._lastAvailableFields=t,I(this.layer.fieldsIndex,t)}async _createViewSchemaConfig(){const e=this.requiresCurrentUser?await this.signedInUser:null,t=[he(this.view,this.layerAdapter,this.timeExtent,this._visibilityOverrides,this.filter,this.effectiveDisplayFilterClause),this.featureEffect?.filter?.toJSON()??null];return{availableFields:this._getEffectiveAvailableFields(this.availableFields),displayFilterEnabled:this.displayFilterEnabled,filters:t,scale:this.view.scale,timeZone:this.view.timeZone,timeExtent:this.view.timeExtent,currentUser:e}}_processHighlight(){this._commandsQueue.push({type:"highlight"})}async _updateHighlights(){const e=this._getHighlights(),t=await this.getWorker();if(this.destroyed)return;const r=t.pipeline.updateHighlight({highlights:e}).catch(e=>{m(e)||h.getLogger(this).error(e)});this._updatingHandles.addPromise(r)}_setLayersForFeature(e){e.layer=e.sourceLayer=this.layer,this.layerAdapter.setGraphicOrigin&&this.layerAdapter.setGraphicOrigin(e)}_createGraphicHit(e,t){return this._setLayersForFeature(t),null!=t.geometry&&(t.geometry.spatialReference=this.view.spatialReference),{type:"graphic",graphic:t,layer:this.layer,mapPoint:e}}};function he(e,t,r,s,i,a){i&&(i=i.clone());const o=null!=i?i.timeExtent:null,n=null!=r&&null!=o?r.intersection(o):r||o;n&&(i??=new U,i.timeExtent=n),i=t.addFilters?.(i,e)??i,a&&(i??=new U,i.where=v(i.where,a));let u=i?.toJSON()??null;return s.size&&(u??=(new U).toJSON(),u.hiddenIds=Array.from(s)),u}e([_()],le.prototype,"_commandsQueue",void 0),e([_()],le.prototype,"_sourceRefreshVersion",void 0),e([_()],le.prototype,"_displayRefreshVersion",void 0),e([_({readOnly:!0})],le.prototype,"_pipelineUpdating",void 0),e([_()],le.prototype,"_sourceUpdating",void 0),e([_({readOnly:!0})],le.prototype,"dataUpdating",null),e([_({readOnly:!0})],le.prototype,"hasAllFeatures",null),e([_({readOnly:!0})],le.prototype,"hasAllFeaturesInView",null),e([_({readOnly:!0})],le.prototype,"hasFullGeometries",null),e([_()],le.prototype,"featureEffectView",void 0),e([_()],le.prototype,"labelingCollisionInfos",null),e([_()],le.prototype,"layerAdapter",null),e([_({readOnly:!0})],le.prototype,"timeExtent",null),e([_()],le.prototype,"updating",void 0),le=e([b("esri.views.2d.layers.FeatureLayerView2D")],le);export{le as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as f}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as g}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../symbols/Font.js";import"../../../core/mathUtils.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../chunks/pe.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new M(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new g({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=T(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new g({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){T(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function T(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],f(q,i)}class M{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../Graphic.js";import t from"../../../core/Collection.js";import i from"../../../core/Error.js";import"../../../core/has.js";import s from"../../../core/Logger.js";import{getOrCreateMapValue as r}from"../../../core/MapUtils.js";import{isAbortError as o}from"../../../core/promiseUtils.js";import{watch as n,syncAndInitial as l,on as m}from"../../../core/reactiveUtils.js";import{property as a}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/RandomLCG.js";import{subclass as p}from"../../../core/accessorSupport/decorators/subclass.js";import c from"../../../geometry/Extent.js";import{create as h}from"../../../geometry/support/aaBoundingRect.js";import{ringsContainsCoords as d}from"../../../geometry/support/contains.js";import{extentIntersectsPolygon as g}from"../../../geometry/support/intersectsBase.js";import{MediaElementView as f}from"../../../layers/support/MediaElementView.js";import"../../../renderers/SimpleRenderer.js";import"../../../symbols/SimpleFillSymbol.js";import"../../../core/scheduling.js";import"../../../core/colorUtils.js";import"../../../config.js";import"../../../symbols/cim/defaultCIMValues.js";import"../../../symbols/cim/enums.js";import"../../../core/floatRGBA.js";import"../../../geometry/Geometry.js";import"../../../geometry/Multipoint.js";import"../../../geometry/Point.js";import"../../../geometry/Polygon.js";import"../../../geometry/Polyline.js";import"../engine/webgl/definitions.js";import"../engine/webgl/animations/instructions.js";import"../../../symbols/Font.js";import"../../../core/mathUtils.js";import"../../../core/ObjectPool.js";import"../../../geometry/support/Axis.js";import"../../../geometry/support/spatialReferenceUtils.js";import"../../../geometry/support/TileClipper.js";import"../../../symbols/cim/effects/EffectAddControlPoints.js";import"../../../symbols/cim/effects/EffectArrow.js";import"../../../symbols/cim/effects/EffectBuffer.js";import"../../../symbols/cim/effects/EffectControlMeasureLine.js";import"../../../symbols/cim/effects/EffectCut.js";import"../../../symbols/cim/effects/EffectDashes.js";import"../../../symbols/cim/effects/EffectDonut.js";import"../../../symbols/cim/effects/EffectEnclosingPolygon.js";import"../../../symbols/cim/effects/EffectJog.js";import"../../../symbols/cim/effects/EffectMove.js";import"../../../symbols/cim/effects/EffectOffset.js";import"../../../symbols/cim/effects/EffectRadial.js";import"../../../symbols/cim/effects/EffectReverse.js";import"../../../symbols/cim/effects/EffectRotate.js";import"../../../symbols/cim/effects/EffectScale.js";import"../../../symbols/cim/effects/EffectSuppress.js";import"../../../symbols/cim/effects/EffectTaperedPolygon.js";import"../../../symbols/cim/effects/EffectWave.js";import"../../../symbols/cim/placements/PlacementAlongLineSameSize.js";import"../../../symbols/cim/placements/PlacementAtExtremities.js";import"../../../symbols/cim/placements/PlacementAtRatioPositions.js";import"../../../symbols/cim/placements/PlacementInsidePolygon.js";import"../../../symbols/cim/placements/PlacementOnLine.js";import"../../../symbols/cim/placements/PlacementOnVertices.js";import"../../../symbols/cim/placements/PlacementPolygonCenter.js";import"../../../symbols/cim/constants.js";import"../../../core/libs/gl-matrix-2/factories/vec2f32.js";import"../engine/webgl/alignmentUtils.js";import"../../../symbols/support/defaults.js";import"../../../symbols/cim/OverrideHelper.js";import"../../../layers/effects/EffectView.js";import"../../../core/Evented.js";import"../engine/transitions/FadeTransition.js";import"../engine/webgl/enums.js";import"../../../core/libs/gl-matrix-2/factories/vec4f32.js";import"../../webgl/enums.js";import"../engine/webgl/shaders/BackgroundPrograms.js";import"../../webgl/checkWebGLError.js";import"../engine/webgl/DefaultVertexAttributeLayouts.js";import"../engine/webgl/AFeatureTile.js";import"../engine/webgl/DisplayEntity.js";import"../engine/webgl/shaderGraph/techniques/featureTechniqueUtils.js";import"../engine/webgl/cpuMapped/MappedMesh.js";import"../engine/webgl/number.js";import"../engine/webgl/shaders/TileInfoPrograms.js";import"../../webgl/Texture.js";import"../../webgl/FBOAttachmentType.js";import"../engine/vectorTiles/style/StyleDefinition.js";import"../engine/vectorTiles/enums.js";import"../engine/webgl/shaders/BitBlitPrograms.js";import"../../../request.js";import"../../../core/urlUtils.js";import"../../../core/pbf.js";import"../engine/webgl/shaders/StencilPrograms.js";import"../engine/webgl/shaderGraph/techniques/TechniqueType.js";import"../engine/webgl/shaderGraph/techniques/shaders/BlendShader.js";import"../engine/webgl/shaderGraph/techniques/shaders/OpacityShader.js";import"../engine/webgl/shaders/HighlightPrograms.js";import"../../webgl/FramebufferObject.js";import"../engine/webgl/meshing/SimpleMesh.js";import"../engine/webgl/PooledUint32Array.js";import"../engine/webgl/Profiler.js";import"../engine/webgl/shaderGraph/techniques/TechniqueRegistry.js";import"../../../Color.js";import"../engine/webgl/shaderGraph/techniques/animated/attributes.js";import"../engine/webgl/shaderGraph/techniques/shaders/constants.js";import"../engine/webgl/mesh/templates/templateUtils.js";import"../engine/webgl/shaderGraph/techniques/line/LineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/dotDensity/DotDensityMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/ComplexOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/FillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/GradientFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/OutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/fill/PatternOutlineFillMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/heatmap/HeatmapMeshWriter.js";import"../../../geometry/support/aaBoundingBox.js";import"../engine/webgl/shaderGraph/techniques/text/TextMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/GradientStrokeMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/line/TexturedLineMeshWriter.js";import"../engine/webgl/shaderGraph/techniques/markers/MarkerMeshWriter.js";import"../../../arcade/ArcadeDate.js";import"../../../intl/locale.js";import"luxon";import"../../../core/sql/UnknownTimeZone.js";import"../../../layers/support/fieldUtils.js";import"../../../time/constants.js";import"../engine/webgl/shaderGraph/techniques/pieChart/PieChartMeshWriter.js";import"../../webgl/renderState.js";import"../../3d/webgl-engine/core/shaderModules/glsl.js";import"../../webgl/testSVGPremultipliedAlpha.js";import"../../../chunks/pe.js";import"../engine/webgl/meshing/definitions.js";import"../engine/webgl/shaderGraph/techniques/shaders/VideoScreenShader.js";import"../LabelManager.js";import"./graphics/GraphicsView2D.js";import"../../../chunks/earcut.js";import"../../../core/libs/gl-matrix-2/factories/vec3f32.js";import"../../../geometry/support/normalizeUtilsCommon.js";import"../../../geometry/SpatialReference.js";import"../../../geometry/support/Ellipsoid.js";import"../../../kernel.js";import"./support/util.js";import"../navigation/MapViewNavigation.js";import"../../../core/asyncUtils.js";import"../../../core/support/UpdatingHandles.js";import"../engine/webgl/shaderGraph/techniques/shaders/MagnifierShader.js";import"../../../core/unitUtils.js";import"../../../geometry/ellipsoidUtils.js";import"../../../geometry/projection/projectors.js";import"../engine/webgl/shaderGraph/techniques/shaders/GridShader.js";import"../../../geometry/support/geodesicConstants.js";import"../tiling/TileInfoView.js";import"../tiling/TileKey.js";import u from"../tiling/TileQueue.js";import j from"../tiling/TileStrategy.js";import y from"../engine/webgl/Overlay.js";import b from"../engine/webgl/OverlayContainer.js";import{LayerView2DMixin as w}from"./LayerView2D.js";import _ from"../../layers/LayerView.js";import v from"../../layers/MediaLayerView.js";import{TaskPriority as E}from"../../support/Scheduler.js";let G=class extends(w(v(_))){constructor(){super(...arguments),this._overlayContainer=null,this._fetchQueue=null,this._tileStrategy=null,this._elementReferences=new Map,this._debugGraphicsView=null,this._interaction=null,this.layer=null,this.elements=new t}initialize(){this.addHandles([n(()=>[this.interactive,this.suspended],async()=>{if(this.interactive&&!this._interaction){const{MediaLayerInteraction:e}=await import("./support/MediaLayerInteraction.js");this._interaction=new e({view:this.view,layer:this.layer}),this.selectedElement!==this._interaction.selectedElement&&(this._interaction.selectedElement=this.selectedElement),this.interactionOptions!==this._interaction.options&&(this._interaction.options=this.interactionOptions)}this._interaction&&(this._interaction.enabled=!this.suspended&&this.interactive)},l),n(()=>this.interactionOptions,e=>{this._interaction&&(this._interaction.options=e)},l),n(()=>this.selectedElement,e=>{this._interaction&&(this._interaction.selectedElement=e)},l)])}attach(){this.addAttachHandles([m(()=>this.layer.effectiveSource,"refresh",()=>{this._tileStrategy.refresh(e=>this._updateTile(e)),this.requestUpdate()}),m(()=>this.layer.effectiveSource,"change",({element:e})=>this._elementUpdateHandler(e))]),this._overlayContainer=new b,this.container.addChild(this._overlayContainer),this._fetchQueue=new u({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(e,t)=>this._queryElements(e,t),scheduler:this.scheduler,priority:E.MAPVIEW_FETCH_QUEUE}),this._tileStrategy=new j({cachePolicy:"purge",resampling:!0,acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear(),this._debugGraphicsView?.destroy()}supportsSpatialReference(e){return!0}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(e){this._tileStrategy.update(e),this._debugGraphicsView?.update(e)}async hitTest(e,t){const i=[],s=e.normalize(),r=[s.x,s.y];for(const{elementView:{normalizedCoords:o,element:n}}of this._elementReferences.values())null!=o&&d(o.rings,r)&&i.push({type:"media",element:n,layer:this.layer,mapPoint:e,sourcePoint:n.toSource(e)});return i.reverse()}canResume(){return null!=this.layer.source&&super.canResume()}async doRefresh(){this._fetchQueue.reset(),this._tileStrategy.refresh(e=>this._updateTile(e))}_acquireTile(e){const t=new M(e.clone());return this._updateTile(t),t}_updateTile(e){this._updatingHandles.addPromise(this._fetchQueue.push(e.key).then(t=>{const[i,s]=e.setElements(t);this._referenceElements(e,i),this._dereferenceElements(e,s),this.requestUpdate()},e=>{o(e)||s.getLogger(this).error(e)}))}_releaseTile(e){this._fetchQueue.abort(e.key.id),e.elements&&this._dereferenceElements(e,e.elements),this.requestUpdate()}async _queryElements(e,t){const i=this.layer.effectiveSource;if(null==i)return[];this.view.featuresTilingScheme.getTileBounds(S,e,!0);const s=new c({xmin:S[0],ymin:S[1],xmax:S[2],ymax:S[3],spatialReference:this.view.spatialReference});return i.queryElements(s,t)}_referenceElements(e,t){if(null!=this.layer.source)for(const i of t)this._referenceElement(e,i)}_referenceElement(e,t){r(this._elementReferences,t.uid,()=>{const e=new f({element:t,spatialReference:this.view.spatialReference}),r=new y(e);return this._overlayContainer.addChild(r),this.elements.add(t),this._updatingHandles.addPromise(t.load().catch(e=>{s.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new i("element-load-error","Element cannot be displayed",{element:t,error:e}))})),{debugGraphic:null,elementView:e,overlay:r,tiles:new Set}}).tiles.add(e)}_dereferenceElements(e,t){for(const i of t)this._dereferenceElement(e,i)}_dereferenceElement(e,t){const i=this._elementReferences.get(t.uid);i.tiles.delete(e),i.tiles.size||(this._overlayContainer.removeChild(i.overlay),i.overlay.destroy(),i.elementView.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t),this._debugGraphicsView?.graphics.remove(i.debugGraphic))}_elementUpdateHandler(e){let t=this._elementReferences.get(e.uid);if(t){const i=t.elementView.normalizedCoords;if(null==i)return this._overlayContainer.removeChild(t.overlay),t.overlay.destroy(),t.elementView.destroy(),this._elementReferences.delete(e.uid),this.elements.remove(e),void this._debugGraphicsView?.graphics.remove(t.debugGraphic);const s=[],r=[];for(const e of this._tileStrategy.tiles){const o=T(this.view.featuresTilingScheme,e,i);t.tiles.has(e)?o||r.push(e):o&&s.push(e)}for(const t of s)this._referenceElement(t,e);for(const t of r)this._dereferenceElement(t,e);return t=this._elementReferences.get(e.uid),void(t?.debugGraphic&&(t.debugGraphic.geometry=t.elementView.normalizedCoords,this._debugGraphicsView.graphicUpdateHandler({graphic:t.debugGraphic,property:"geometry"})))}const i=new f({element:e,spatialReference:this.view.spatialReference}).normalizedCoords;if(null!=i)for(const s of this._tileStrategy.tiles){T(this.view.featuresTilingScheme,s,i)&&this._referenceElement(s,e)}}};e([a()],G.prototype,"layer",void 0),e([a({readOnly:!0})],G.prototype,"elements",void 0),G=e([p("esri.views.2d.layers.MediaLayerView2D")],G);const S=h(),q={xmin:0,ymin:0,xmax:0,ymax:0};function T(e,t,i){return e.getTileBounds(S,t.key,!0),q.xmin=S[0],q.ymin=S[1],q.xmax=S[2],q.ymax=S[3],g(q,i)}class M{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],i=new Set(this.elements);this.elements=e;for(const s of e)i.has(s)?i.delete(s):t.push(s);return this.isReady=!0,[t,Array.from(i)]}destroy(){}}const C=G;export{C as default};