@arcgis/core 4.31.0-next.20240619 → 4.31.0-next.20240621

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 (189) hide show
  1. package/assets/esri/core/workers/RemoteClient.js +1 -1
  2. package/assets/esri/core/workers/chunks/{3a74d3fc690177a703f5.js → 019ce38b02e3bf517125.js} +1 -1
  3. package/assets/esri/core/workers/chunks/{222807cfaa2e17d0efea.js → 6745cedf6f82c8917904.js} +1 -1
  4. package/assets/esri/core/workers/chunks/7b6cd976367a0dd297d6.js +1 -0
  5. package/assets/esri/core/workers/chunks/{d7c0728bdd9a7fd1d701.js → 9d677af08238d9e09e72.js} +36 -25
  6. package/assets/esri/core/workers/chunks/bedf60888f07b78b314d.js +1 -0
  7. package/assets/esri/core/workers/chunks/c39237c00c1d588dc107.js +1 -0
  8. package/assets/esri/core/workers/chunks/cf1530abe2842f3d8eb0.js +1 -0
  9. package/assets/esri/core/workers/chunks/de7fa31d86a65ccdffc1.js +1 -0
  10. package/assets/esri/core/workers/chunks/{8ee8f3c54b2cce217845.js → f13fb6b712e364bbf48c.js} +1 -1
  11. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ar.json +1 -1
  12. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bg.json +1 -1
  13. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_bs.json +1 -1
  14. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ca.json +1 -1
  15. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_cs.json +1 -1
  16. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_da.json +1 -1
  17. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_de.json +1 -1
  18. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_el.json +1 -1
  19. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_es.json +1 -1
  20. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_et.json +1 -1
  21. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fi.json +1 -1
  22. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_fr.json +1 -1
  23. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_he.json +1 -1
  24. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hr.json +1 -1
  25. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_hu.json +1 -1
  26. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_id.json +1 -1
  27. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_it.json +1 -1
  28. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ja.json +1 -1
  29. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ko.json +1 -1
  30. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lt.json +1 -1
  31. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_lv.json +1 -1
  32. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nb.json +1 -1
  33. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_nl.json +1 -1
  34. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pl.json +1 -1
  35. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-BR.json +1 -1
  36. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_pt-PT.json +1 -1
  37. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ro.json +1 -1
  38. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_ru.json +1 -1
  39. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sk.json +1 -1
  40. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sl.json +1 -1
  41. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sr.json +1 -1
  42. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_sv.json +1 -1
  43. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_th.json +1 -1
  44. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_tr.json +1 -1
  45. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_uk.json +1 -1
  46. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_vi.json +1 -1
  47. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-CN.json +1 -1
  48. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-HK.json +1 -1
  49. package/assets/esri/widgets/CatalogLayerList/t9n/CatalogLayerList_zh-TW.json +1 -1
  50. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ar.json +1 -1
  51. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bg.json +1 -1
  52. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_bs.json +1 -1
  53. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ca.json +1 -1
  54. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_cs.json +1 -1
  55. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_da.json +1 -1
  56. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_de.json +1 -1
  57. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_el.json +1 -1
  58. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_es.json +1 -1
  59. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_et.json +1 -1
  60. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fi.json +1 -1
  61. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_fr.json +1 -1
  62. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_he.json +1 -1
  63. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hr.json +1 -1
  64. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_hu.json +1 -1
  65. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_id.json +1 -1
  66. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_it.json +1 -1
  67. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ja.json +1 -1
  68. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ko.json +1 -1
  69. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lt.json +1 -1
  70. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_lv.json +1 -1
  71. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nb.json +1 -1
  72. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_nl.json +1 -1
  73. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pl.json +1 -1
  74. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-BR.json +1 -1
  75. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_pt-PT.json +1 -1
  76. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ro.json +1 -1
  77. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_ru.json +1 -1
  78. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sk.json +1 -1
  79. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sl.json +1 -1
  80. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sr.json +1 -1
  81. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_sv.json +1 -1
  82. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_th.json +1 -1
  83. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_tr.json +1 -1
  84. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_uk.json +1 -1
  85. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_vi.json +1 -1
  86. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-CN.json +1 -1
  87. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-HK.json +1 -1
  88. package/assets/esri/widgets/FeatureTable/t9n/FeatureTable_zh-TW.json +1 -1
  89. package/chunks/CheckerBoard.glsl.js +9 -6
  90. package/chunks/ComponentShader.glsl.js +23 -23
  91. package/chunks/HUDMaterial.glsl.js +29 -33
  92. package/chunks/HighlightApply.glsl.js +150 -23
  93. package/chunks/HighlightDownsample.glsl.js +25 -12
  94. package/chunks/ImageMaterial.glsl.js +1 -2
  95. package/chunks/LineMarker.glsl.js +30 -30
  96. package/chunks/RibbonLine.glsl.js +42 -42
  97. package/chunks/ShadowHighlight.glsl.js +15 -6
  98. package/chunks/Terrain.glsl.js +6 -3
  99. package/interfaces.d.ts +50 -14
  100. package/layers/graphics/sources/FeatureLayerSource.js +1 -1
  101. package/layers/mixins/EditBusLayer.js +1 -1
  102. package/layers/mixins/FeatureLayerBase.js +1 -1
  103. package/layers/orientedImagery/core/ExposurePoint.js +1 -1
  104. package/layers/orientedImagery/transformations/imageToGroundUtils.js +1 -1
  105. package/layers/support/featureLayerUtils.js +1 -1
  106. package/package.json +1 -1
  107. package/portal/schemas/definitions.js +1 -1
  108. package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.js +1 -1
  109. package/support/revision.js +1 -1
  110. package/views/2d/layers/support/ExportStrategy.js +1 -1
  111. package/views/3d/layers/I3SMeshView3D.js +1 -1
  112. package/views/3d/layers/SceneLayerView3D.js +1 -1
  113. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  114. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  115. package/views/3d/layers/graphics/Graphics3DObject3DGraphicLayer.js +1 -1
  116. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  117. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  118. package/views/3d/layers/i3s/Highlights.js +1 -1
  119. package/views/3d/layers/i3s/PointRenderer.js +1 -1
  120. package/views/3d/support/HighlightOptions.js +1 -1
  121. package/views/3d/support/HighlightOptionsBase.js +5 -0
  122. package/views/3d/terrain/OverlayRenderTargets.js +1 -1
  123. package/views/3d/terrain/TerrainRenderer.js +1 -1
  124. package/views/3d/webgl-engine/collections/Component/ComponentData.js +1 -1
  125. package/views/3d/webgl-engine/collections/Component/ComponentObjectCollection.js +1 -1
  126. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  127. package/views/3d/webgl-engine/collections/Component/Material/shader/ComponentData.glsl.js +1 -2
  128. package/views/3d/webgl-engine/core/FBOCache.js +1 -1
  129. package/views/3d/webgl-engine/core/renderPasses/RenderPass.js +1 -1
  130. package/views/3d/webgl-engine/core/shaderLibrary/output/OutputHighlight.glsl.js +18 -7
  131. package/views/3d/webgl-engine/core/shaderModules/Integer2PassUniform.js +5 -0
  132. package/views/3d/webgl-engine/effects/RenderPlugin.js +1 -1
  133. package/views/3d/webgl-engine/effects/highlight/Highlight.js +1 -1
  134. package/views/3d/webgl-engine/effects/highlight/HighlightPassParameters.js +1 -1
  135. package/views/3d/webgl-engine/lib/BindParameters.js +1 -1
  136. package/views/3d/webgl-engine/lib/DefaultVertexBufferLayouts.js +1 -1
  137. package/views/3d/webgl-engine/lib/Material.js +1 -1
  138. package/views/3d/webgl-engine/lib/Program.js +1 -1
  139. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  140. package/views/3d/webgl-engine/lib/RenderingContext.js +1 -1
  141. package/views/3d/webgl-engine/lib/Viewshed.js +1 -1
  142. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  143. package/views/3d/webgl-engine/lib/depthRangeUtils.js +1 -1
  144. package/views/3d/webgl-engine/lib/edgeRendering/EdgeRenderer.js +1 -1
  145. package/views/3d/webgl-engine/lib/edgeRendering/EdgeView.js +1 -1
  146. package/views/3d/webgl-engine/lib/edgeRendering/interfaces.js +1 -1
  147. package/views/3d/webgl-engine/lib/edgeRendering/util.js +1 -1
  148. package/views/3d/webgl-engine/lib/lodRendering/LodRenderer.js +1 -1
  149. package/views/3d/webgl-engine/materials/CheckerBoardMaterial.js +1 -1
  150. package/views/3d/webgl-engine/materials/ColorMaterial.js +1 -1
  151. package/views/3d/webgl-engine/materials/DefaultMaterial.js +1 -1
  152. package/views/3d/webgl-engine/materials/HUDMaterial.js +1 -1
  153. package/views/3d/webgl-engine/materials/ImageMaterial.js +1 -1
  154. package/views/3d/webgl-engine/materials/LineCalloutMaterial.js +1 -1
  155. package/views/3d/webgl-engine/materials/LineMarkerMaterial.js +1 -1
  156. package/views/3d/webgl-engine/materials/MeasurementArrowMaterial.js +1 -1
  157. package/views/3d/webgl-engine/materials/NativeLineMaterial.js +1 -1
  158. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  159. package/views/3d/webgl-engine/materials/PatternMaterial.js +1 -1
  160. package/views/3d/webgl-engine/materials/RibbonLineMaterial.js +1 -1
  161. package/views/3d/webgl-engine/materials/ShadedColorMaterial.js +1 -1
  162. package/views/3d/webgl-engine/materials/renderers/MergedRenderer.js +1 -1
  163. package/views/3d/webgl-engine/shaders/CheckerBoard.glsl.js +1 -1
  164. package/views/3d/webgl-engine/shaders/HUDMaterialTechnique.js +1 -1
  165. package/views/3d/webgl-engine/shaders/HighlightApply.glsl.js +1 -1
  166. package/views/3d/webgl-engine/shaders/LineMarker.glsl.js +1 -1
  167. package/views/3d/webgl-engine/shaders/RibbonLine.glsl.js +1 -1
  168. package/views/3d/webgl-engine/shaders/ShadowHighlight.glsl.js +1 -1
  169. package/views/SceneView.js +1 -1
  170. package/views/SelectionManager.js +1 -1
  171. package/views/support/HighlightDefaults.js +1 -1
  172. package/views/webgl/BufferObject.js +1 -1
  173. package/views/webgl/RenderingContext.js +1 -1
  174. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  175. package/widgets/OrientedImageryViewer/adapters/OrientedImageryViewerViewModelAdapter2D.js +1 -1
  176. package/widgets/OrientedImageryViewer/utils.js +1 -1
  177. package/widgets/OrientedImageryViewer.js +1 -1
  178. package/widgets/PanoramicViewer/PanoramicViewerViewModel.js +1 -1
  179. package/widgets/PanoramicViewer/constants.js +1 -1
  180. package/widgets/PanoramicViewer/utils.js +1 -1
  181. package/widgets/Print.js +1 -1
  182. package/assets/esri/core/workers/chunks/24484bd0185ea0f79760.js +0 -1
  183. package/assets/esri/core/workers/chunks/4f2be9fd4ff5b3ad3110.js +0 -1
  184. package/assets/esri/core/workers/chunks/88c7d84a1fde246ca71f.js +0 -1
  185. package/assets/esri/core/workers/chunks/986520dd0de64105dbff.js +0 -1
  186. package/assets/esri/core/workers/chunks/ad0a87dba95785ad6171.js +0 -1
  187. package/chunks/HighlightBlur.glsl.js +0 -25
  188. package/views/3d/webgl-engine/effects/highlight/HighlightBlurTechnique.js +0 -5
  189. package/views/3d/webgl-engine/shaders/HighlightBlur.glsl.js +0 -5
package/interfaces.d.ts CHANGED
@@ -5139,7 +5139,7 @@ declare namespace __esri {
5139
5139
  */
5140
5140
  elements: (FieldElement | GroupElement | RelationshipElement | TextElement)[];
5141
5141
  /**
5142
- * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-ExpressionInfo.html) that reference [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expressions following the specification defined by the [Form Constraint Profile](https://developers.arcgis.com/javascript/latest/arcade/#constraint) or the [Form Calculation Profile](https://developers.arcgis.com/javascript/latest/arcade/#form-calculation).
5142
+ * An array of [ExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-ExpressionInfo.html) objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expressions following the specification defined by the [Form Constraint Profile](https://developers.arcgis.com/javascript/latest/arcade/#constraint) or the [Form Calculation Profile](https://developers.arcgis.com/javascript/latest/arcade/#form-calculation).
5143
5143
  *
5144
5144
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html#expressionInfos)
5145
5145
  */
@@ -5153,13 +5153,13 @@ declare namespace __esri {
5153
5153
  */
5154
5154
  preserveFieldValuesWhenHidden: boolean;
5155
5155
  /**
5156
- * The string template for defining how to format the title displayed at the top of a form.
5156
+ * The string defining how to format the title displayed at the top of a form.
5157
5157
  *
5158
5158
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html#title)
5159
5159
  */
5160
5160
  title: string;
5161
5161
  /**
5162
- * A FormTemplate formats and defines the content of a [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) for a specific [Layer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-Layer.html) or [Graphic](https://developers.arcgis.com/javascript/latest/api-reference/esri-Graphic.html).
5162
+ * A `FormTemplate` formats and defines the content of a [FeatureForm](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureForm.html) for a specific [Featurelayer](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html) or SubtypeSubLayer.
5163
5163
  *
5164
5164
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html)
5165
5165
  */
@@ -5192,7 +5192,7 @@ declare namespace __esri {
5192
5192
  | (TextElementProperties & { type: "text" })
5193
5193
  )[];
5194
5194
  /**
5195
- * An array of objects or [ExpressionInfo[]](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-ExpressionInfo.html) that reference [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expressions following the specification defined by the [Form Constraint Profile](https://developers.arcgis.com/javascript/latest/arcade/#constraint) or the [Form Calculation Profile](https://developers.arcgis.com/javascript/latest/arcade/#form-calculation).
5195
+ * An array of [ExpressionInfo](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-ExpressionInfo.html) objects that reference [Arcade](https://developers.arcgis.com/javascript/latest/arcade/) expressions following the specification defined by the [Form Constraint Profile](https://developers.arcgis.com/javascript/latest/arcade/#constraint) or the [Form Calculation Profile](https://developers.arcgis.com/javascript/latest/arcade/#form-calculation).
5196
5196
  *
5197
5197
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html#expressionInfos)
5198
5198
  */
@@ -5206,7 +5206,7 @@ declare namespace __esri {
5206
5206
  */
5207
5207
  preserveFieldValuesWhenHidden?: boolean;
5208
5208
  /**
5209
- * The string template for defining how to format the title displayed at the top of a form.
5209
+ * The string defining how to format the title displayed at the top of a form.
5210
5210
  *
5211
5211
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-form-FormTemplate.html#title)
5212
5212
  */
@@ -9070,7 +9070,7 @@ declare namespace __esri {
9070
9070
  */
9071
9071
  expires: number;
9072
9072
  /**
9073
- * Indicates that this credential was created to access the [ArcGIS REST Admin service](https://developers.arcgis.com/rest/services-reference/enterprise/rest-api-admin.htm).
9073
+ * Indicates that this credential was created to access the [ArcGIS Server Administrator REST API](https://developers.arcgis.com/rest/enterprise-administration/server/overview/).
9074
9074
  *
9075
9075
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin)
9076
9076
  */
@@ -9130,7 +9130,7 @@ declare namespace __esri {
9130
9130
  */
9131
9131
  expires?: number;
9132
9132
  /**
9133
- * Indicates that this credential was created to access the [ArcGIS REST Admin service](https://developers.arcgis.com/rest/services-reference/enterprise/rest-api-admin.htm).
9133
+ * Indicates that this credential was created to access the [ArcGIS Server Administrator REST API](https://developers.arcgis.com/rest/enterprise-administration/server/overview/).
9134
9134
  *
9135
9135
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-identity-Credential.html#isAdmin)
9136
9136
  */
@@ -15624,6 +15624,12 @@ declare namespace __esri {
15624
15624
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryTileLayer.html#fetchTile)
15625
15625
  */
15626
15626
  fetchTile(level: number, row: number, col: number, options?: ImageryTileLayerFetchTileOptions): Promise<any>;
15627
+ /**
15628
+ * Generates a new raster info for the specified client side raster function.
15629
+ *
15630
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryTileLayer.html#generateRasterInfo)
15631
+ */
15632
+ generateRasterInfo(rasterFunction: RasterFunction | RasterFunctionProperties, options?: ImageryTileLayerGenerateRasterInfoOptions): Promise<RasterInfo>;
15627
15633
  /**
15628
15634
  * Saves the layer to its existing portal item in the [Portal](https://developers.arcgis.com/javascript/latest/api-reference/esri-portal-Portal.html) authenticated within the user's current session.
15629
15635
  *
@@ -15705,6 +15711,15 @@ declare namespace __esri {
15705
15711
  signal?: AbortSignal;
15706
15712
  }
15707
15713
 
15714
+ export interface ImageryTileLayerGenerateRasterInfoOptions {
15715
+ /**
15716
+ * Signal object that can be used to abort the asynchronous task.
15717
+ *
15718
+ * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-ImageryTileLayer.html#generateRasterInfo)
15719
+ */
15720
+ signal?: AbortSignal;
15721
+ }
15722
+
15708
15723
  export interface ImageryTileLayerSaveAsOptions {
15709
15724
  /**
15710
15725
  * The portal folder where the layer's portal item will be saved.
@@ -52055,7 +52070,14 @@ declare namespace __esri {
52055
52070
  | "esriGraphPropertyDocumentKeywords"
52056
52071
  | "esriGraphPropertyDocumentContentType"
52057
52072
  | "esriGraphPropertyDocumentMetadata"
52058
- | "esriGraphPropertyDocumentFileExtension";
52073
+ | "esriGraphPropertyDocumentFileExtension"
52074
+ | "esriGraphPropertyProvenanceInstanceId"
52075
+ | "esriGraphPropertyProvenanceSourceType"
52076
+ | "esriGraphPropertyProvenanceSourceName"
52077
+ | "esriGraphPropertyProvenanceSource"
52078
+ | "esriGraphPropertyProvenanceComment"
52079
+ | "esriGraphPropertyProvenanceTypeName"
52080
+ | "esriGraphPropertyProvenancePropertyName";
52059
52081
  /**
52060
52082
  * Specifies if the property is system maintained.
52061
52083
  *
@@ -52176,7 +52198,14 @@ declare namespace __esri {
52176
52198
  | "esriGraphPropertyDocumentKeywords"
52177
52199
  | "esriGraphPropertyDocumentContentType"
52178
52200
  | "esriGraphPropertyDocumentMetadata"
52179
- | "esriGraphPropertyDocumentFileExtension";
52201
+ | "esriGraphPropertyDocumentFileExtension"
52202
+ | "esriGraphPropertyProvenanceInstanceId"
52203
+ | "esriGraphPropertyProvenanceSourceType"
52204
+ | "esriGraphPropertyProvenanceSourceName"
52205
+ | "esriGraphPropertyProvenanceSource"
52206
+ | "esriGraphPropertyProvenanceComment"
52207
+ | "esriGraphPropertyProvenanceTypeName"
52208
+ | "esriGraphPropertyProvenancePropertyName";
52180
52209
  /**
52181
52210
  * Specifies if the property is system maintained.
52182
52211
  *
@@ -69570,7 +69599,14 @@ declare namespace __esri {
69570
69599
  *
69571
69600
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-smartMapping-renderers-pieChart.html#createRendererForClustering)
69572
69601
  */
69573
- layer: FeatureLayer | CSVLayer | GeoJSONLayer | WFSLayer | OGCFeatureLayer | StreamLayer | OrientedImageryLayer;
69602
+ layer: | FeatureLayer
69603
+ | CSVLayer
69604
+ | GeoJSONLayer
69605
+ | WFSLayer
69606
+ | OGCFeatureLayer
69607
+ | StreamLayer
69608
+ | OrientedImageryLayer
69609
+ | KnowledgeGraphSublayer;
69574
69610
  /**
69575
69611
  * Determines whether to create a pie chart or a donut chart.
69576
69612
  *
@@ -105641,7 +105677,7 @@ declare namespace __esri {
105641
105677
  */
105642
105678
  tableTemplate: TableTemplate;
105643
105679
  /**
105644
- * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-time-TimeExtent.html) in which to filter and display data within the FeatureTable widget.
105680
+ * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html) in which to filter and display data within the FeatureTable widget.
105645
105681
  *
105646
105682
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#timeExtent)
105647
105683
  */
@@ -105955,7 +105991,7 @@ declare namespace __esri {
105955
105991
  */
105956
105992
  tableTemplate?: TableTemplateProperties;
105957
105993
  /**
105958
- * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-time-TimeExtent.html) in which to filter and display data within the FeatureTable widget.
105994
+ * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html) in which to filter and display data within the FeatureTable widget.
105959
105995
  *
105960
105996
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html#timeExtent)
105961
105997
  */
@@ -106296,7 +106332,7 @@ declare namespace __esri {
106296
106332
  */
106297
106333
  tableTemplate: TableTemplate;
106298
106334
  /**
106299
- * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-time-TimeExtent.html) in which to filter and display data within the [FeatureTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html) widget.
106335
+ * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html) in which to filter and display data within the [FeatureTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html) widget.
106300
106336
  *
106301
106337
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#timeExtent)
106302
106338
  */
@@ -106538,7 +106574,7 @@ declare namespace __esri {
106538
106574
  */
106539
106575
  tableTemplate?: TableTemplateProperties;
106540
106576
  /**
106541
- * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-time-TimeExtent.html) in which to filter and display data within the [FeatureTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html) widget.
106577
+ * The [TimeExtent](https://developers.arcgis.com/javascript/latest/api-reference/esri-TimeExtent.html) in which to filter and display data within the [FeatureTable](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable.html) widget.
106542
106578
  *
106543
106579
  * [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-FeatureTable-FeatureTableViewModel.html#timeExtent)
106544
106580
  */
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import{id as t}from"../../../kernel.js";import s from"../../../request.js";import{isSome as r}from"../../../core/arrayUtils.js";import a from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as i}from"../../../core/jsonMap.js";import o from"../../../core/Loadable.js";import n from"../../../core/Logger.js";import{setDeepValue as u}from"../../../core/object.js";import{debounce as l,after as c,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{join as d}from"../../../core/urlUtils.js";import{generateBracedUUID as y}from"../../../core/uuid.js";import{property as h}from"../../../core/accessorSupport/decorators/property.js";import{subclass as m}from"../../../core/accessorSupport/decorators/subclass.js";import f from"../../../geometry/Extent.js";import g from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as w}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as S}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as q,getFeatureJSON as E,getFeatureIds as O,getAttachmentEditsJSON as R,isProtectedOrPrivateVersionError as b,unpackEditResultData as A,createEditedFeatures as x}from"../applyEditsUtils.js";import{createDrawingInfo as F}from"./support/clientSideDefaults.js";import _ from"./support/QueryTask.js";import{isHostedAgolService as j}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as v}from"../../support/featureLayerUtils.js";import{getAssetMapTable as I}from"../../support/infoFor3D.js";import{executeQueryJSON as T}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as M}from"../../../rest/query/operations/editsZScale.js";import N from"../../../rest/support/Query.js";import U from"../../../time/TimeExtent.js";import{isSafeToEditVersion as J,isVersionInEditSession as k,isHistoricVersion as L,currentSessionId as Q}from"../../../versionManagement/support/versionManagementUtils.js";import C from"../../../geometry/SpatialReference.js";const D=new i({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),P=new i({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let V=class extends o{constructor(){super(...arguments),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=l((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,s=this._fetchService(t,{...e}).then((()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e))).then((()=>this._ensureLatestMetadata(e)));return this.addResolvingPromise(s),Promise.resolve(this)}get queryTask(){const{capabilities:e,parsedUrl:t,dynamicDataSource:s,infoFor3D:r,gdbVersion:a,spatialReference:i,fieldsIndex:o}=this.layer,n=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==r,u=e?.operations?.supportsQueryAttachments??!1;return new _({url:t.path,pbfSupported:n,fieldsIndex:o,infoFor3D:r,dynamicDataSource:s,gdbVersion:a,sourceSpatialReference:i,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const{layer:r}=this;await v(r,"editing");const a=e.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+a+"/addAttachment",o=this._getLayerRequestOptions(),n=this._getFormDataForAttachment(t,o.query);try{const e=await s(i,{body:n});return q(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,r){await this.load();const{layer:a}=this;await v(a,"editing");const i=e.attributes[a.objectIdField],o=a.parsedUrl.path+"/"+i+"/updateAttachment",n=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(r,n.query);try{const e=await s(o,{body:u});return q(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,i){await this.load();const{layer:o}=this;await v(o,"editing");const n=o.infoFor3D,u=null!=n,l=u||(i?.globalIdUsed??!1),c=u?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,p=e.addFeatures?.map((e=>E(this.layer,e,n)))??[],d=(await Promise.all(p)).filter(r),y=e.updateFeatures?.map((e=>E(this.layer,e,n)))??[],h=(await Promise.all(y)).filter(r),m=O(this.layer,e.deleteFeatures,l);M(d,h,o.spatialReference);const f=await R(this.layer,e),g=o.capabilities.editing.supportsAsyncApplyEdits&&u,w=i?.gdbVersion||o.gdbVersion,S={gdbVersion:w,rollbackOnFailure:i?.rollbackOnFailureEnabled,useGlobalIds:l,returnEditMoment:i?.returnEditMoment,usePreviousEditMoment:i?.usePreviousEditMoment,async:g};await J(this.layer.url,w,!0);const q=k(this.layer.url,w||null);if(await L(o.url,w,o.historicMoment))throw new a("feature-layer-source:historic-version","Editing a historic version is not allowed");i?.returnServiceEditsOption?(S.edits=JSON.stringify([{id:o.layerId,adds:d.length?d:null,updates:h.length?h:null,deletes:m.length?m:null,attachments:f,assetMaps:c}]),S.returnServiceEditsOption=D.toJSON(i?.returnServiceEditsOption),S.returnServiceEditsInSourceSR=i?.returnServiceEditsInSourceSR):(S.adds=d.length?JSON.stringify(d):null,S.updates=h.length?JSON.stringify(h):null,S.deletes=m.length?l?JSON.stringify(m):m.join(","):null,S.attachments=f&&JSON.stringify(f),S.assetMaps=null!=c?JSON.stringify(c):void 0);const A=this._getLayerRequestOptions({method:"post",query:S});q&&(A.authMode="immediate",A.query.returnEditMoment=!0,A.query.sessionId=Q);const x=i?.returnServiceEditsOption?o.url:o.parsedUrl.path;let F;try{F=g?await this._asyncApplyEdits(x+"/applyEdits",A):await s(x+"/applyEdits",A)}catch(_){if(!b(_))throw _;A.authMode="immediate",F=g?await this._asyncApplyEdits(x+"/applyEdits",A):await s(x+"/applyEdits",A)}if(!o.capabilities.operations?.supportsEditing&&o.effectiveCapabilities?.operations?.supportsEditing){const e=t?.findCredential(o.url);await(e?.refreshToken())}return this._createEditsResult(F)}async deleteAttachments(e,t){await this.load();const{layer:r}=this;await v(r,"editing");const a=e.attributes[r.objectIdField],i=r.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await s(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(q)}catch(o){throw this._createAttachmentErrorResult(a,o)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:r,url:a}=this.layer,{data:i}=await s(`${a}/${r}`,t),{id:o,extent:n,fullExtent:u,timeExtent:l}=i,c=n||u;return{id:o,fullExtent:c&&f.fromJSON(c),timeExtent:l&&U.fromJSON({start:l[0],end:l[1]})}}))}async queryAttachments(e,t={}){await this.load();const s=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,s)}async queryFeatures(e,t){await this.load();const s=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});return e.outStatistics?.length&&s.features.length&&s.features.forEach((t=>{const s=t.attributes;e.outStatistics?.forEach((({outStatisticFieldName:e})=>{if(e){const t=e.toLowerCase();t&&t in s&&e!==t&&(s[e]=s[t],delete s[t])}}))})),s}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!j(this.layer.url))return"unavailable";const e=d(this.layer.url,"status"),t=await s(e,{query:{f:"json"}});return P.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:s}=await import("./support/uploadAssets.js");return s(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}async _asyncApplyEdits(e,t){const r=(await s(e,t)).data.statusUrl;for(;;){const e=(await s(r,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return s(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new a("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new a("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await c($)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const r={};has("featurelayer-advanced-symbols")&&(r.returnAdvancedSymbols=!0),t?.cacheBust&&(r._ts=Date.now());const{data:a}=await s(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:r,signal:t?.signal}));e=a}this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const r=e.type;if(!this.supportedSourceTypes.has(r))throw new a("feature-layer-source:unsupported-type",`Source type "${r}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=F(e.geometryType).renderer;u("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:r}=await s(this.layer.url,this._getLayerRequestOptions({signal:t}));r.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:r.spatialReference})}catch(r){p(r)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const s=e.addFeatures.filter((e=>e.geometry));if(t.length!==s.length+e.updateFeatures.length)throw new a("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const r=new Array,i=new Map;for(const a of t){const{geometry:e}=a,{vertexSpace:t}=e;if(w(t))r.push(e);else{const t=e.anchor,{convertMeshVertexSpace:s}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),o=await s(e,new g({origin:[t.x,t.y,t.z??0]}));i.set(o,e),a.geometry=o,r.push(o)}}await this.uploadAssets(r);for(const[a,o]of i)o.addExternalSources(a.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,s=this.layer.globalIdField,r=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,o=i.getExternalSourcesOnService(r),u=a.getAttribute(s);if(0===o.length){n.getLogger(this).error(`Skipping feature ${u}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=o.find(S)??o[0];for(const s of l)1===s.parts.length?t.push({globalId:y(),parentGlobalId:u,assetName:s.assetName,assetHash:s.parts[0].partHash,flags:[]}):n.getLogger(this).error(`Skipping asset ${s.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:s}=this.layer,r=[];let a=null;if(Array.isArray(t))for(const o of t)r.push({id:o.id,editedFeatures:o.editedFeatures}),o.id===s&&(a={addResults:o.addResults??[],updateResults:o.updateResults??[],deleteResults:o.deleteResults??[],attachments:o.attachments,editMoment:o.editMoment});else a=t;const i=A(a);if(r.length>0){i.editedFeatureResults=[];for(const e of r){const{editedFeatures:t}=e,s=t?.spatialReference?new C(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:x(t,s)})}}return i}_createAttachmentErrorResult(e,t){const s=t.details.messages?.[0]||t.message,r=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new a("feature-layer-source:attachment-failure",s,{code:r})}}_getFormDataForAttachment(e,t){const s=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(s)for(const r in t){const e=t[r];null!=e&&(s.set?s.set(r,e):s.append(r,e))}return s}_getLayerRequestOptions(e={}){const{parsedUrl:t,gdbVersion:s,dynamicDataSource:r}=this.layer;return{...e,query:{gdbVersion:s,layer:r?JSON.stringify({source:r}):void 0,...t.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:s,infoFor3D:a,parsedUrl:i}=t;if(null==a||null==s)return!1;const o=I(a);if(null==o)return!1;const n=d(i.path,`../${o.id}`),u=new Array;for(const r of e){if(!(r.geometry.metadata.getExternalSourcesOnService(i).length>0))return!1;u.push(r)}const l=u.map((e=>e.getAttribute(s))).filter(r);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:p}}=a,y=new N({where:`${c} IN (${l.map((e=>`'${e}'`))})`,outFields:[p,c],returnGeometry:!1}),h=await T(n,y),{features:m}=h;return 0!==m.length&&!u.some((e=>{const t=e.getAttribute(s);if(!t)return!0;const{metadata:r}=e.geometry,a=m.filter((e=>e.getAttribute(c)===t));if(0===a.length)return!0;const o=a.map((e=>e.getAttribute(p)));return r.getExternalSourcesOnService(i).flatMap((({source:e})=>e.flatMap((e=>e.parts.map((e=>e.partHash)))))).some((e=>o.every((t=>e!==t))))}))}};e([h()],V.prototype,"type",void 0),e([h({constructOnly:!0})],V.prototype,"layer",void 0),e([h({constructOnly:!0})],V.prototype,"supportedSourceTypes",void 0),e([h({readOnly:!0})],V.prototype,"queryTask",null),V=e([m("esri.layers.graphics.sources.FeatureLayerSource")],V);const $=1e3,G=V;export{G as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../config.js";import"../../../geometry.js";import r from"../../../request.js";import{isSome as s,remove as a}from"../../../core/arrayUtils.js";import i from"../../../core/Error.js";import has from"../../../core/has.js";import{JSONMap as n}from"../../../core/jsonMap.js";import o from"../../../core/Loadable.js";import u from"../../../core/Logger.js";import{setDeepValue as l}from"../../../core/object.js";import{debounce as c,after as d,throwIfAbortError as p}from"../../../core/promiseUtils.js";import{watch as h}from"../../../core/reactiveUtils.js";import{join as y}from"../../../core/urlUtils.js";import{generateBracedUUID as m}from"../../../core/uuid.js";import{property as f}from"../../../core/accessorSupport/decorators/property.js";import{subclass as g}from"../../../core/accessorSupport/decorators/subclass.js";import w from"../../../geometry/Extent.js";import S from"../../../geometry/support/MeshGeoreferencedVertexSpace.js";import{isRelativeVertexSpace as q}from"../../../geometry/support/meshVertexSpaceUtils.js";import{isOriginalExternal as E}from"../../../geometry/support/meshUtils/External.js";import{createFeatureEditResult as O,getFeatureJSON as _,getFeatureIds as b,getAttachmentEditsJSON as R,isProtectedOrPrivateVersionError as A,unpackEditResultData as F,createEditedFeatures as I}from"../applyEditsUtils.js";import{createDrawingInfo as x}from"./support/clientSideDefaults.js";import j from"./support/QueryTask.js";import{isHostedAgolService as v}from"../../support/arcgisLayerUrl.js";import{ensureLayerCredential as T}from"../../support/featureLayerUtils.js";import{getAssetMapTable as M}from"../../support/infoFor3D.js";import{executeQueryJSON as N}from"../../../rest/query/executeQueryJSON.js";import{unapplyEditsZUnitScaling as U}from"../../../rest/query/operations/editsZScale.js";import J from"../../../rest/support/Query.js";import D from"../../../time/TimeExtent.js";import{isSafeToEditVersion as k,isVersionInEditSession as C,isHistoricVersion as L,currentSessionId as Q}from"../../../versionManagement/support/versionManagementUtils.js";import P from"../../../geometry/SpatialReference.js";const V=new n({originalAndCurrentFeatures:"original-and-current-features",none:"none"}),$=new n({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let G=class extends o{constructor(e){super(e),this.type="feature-layer",this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.refresh=c((async()=>{await this.load();const e=this.sourceJSON.editingInfo?.lastEditDate;if(null==e)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const t=e!==this.sourceJSON.editingInfo?.lastEditDate;return{dataChanged:t,updates:t?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})),this._ongoingAssetUploads=new Map}load(e){const t=this.layer.sourceJSON,r=this._fetchService(t,{...e}).then((()=>this.layer.setUserPrivileges(this.sourceJSON.serviceItemId,e))).then((()=>this._ensureLatestMetadata(e)));return this.addResolvingPromise(r),Promise.resolve(this)}initialize(){this.addHandles([h((()=>{const e=this.layer;return e&&"lastEditsEventDate"in e?e.lastEditsEventDate:null}),(e=>this._handleLastEditsEventChange(e)))])}destroy(){this._removeEditInterceptor()}get queryTask(){const{capabilities:e,parsedUrl:t,gdbVersion:r,spatialReference:s,fieldsIndex:a}=this.layer,i="infoFor3D"in this.layer?this.layer.infoFor3D:null,n="dynamicDataSource"in this.layer?this.layer.dynamicDataSource:null,o=has("featurelayer-pbf")&&e?.query.supportsFormatPBF&&null==i,u=e?.operations?.supportsQueryAttachments??!1;return new j({url:t.path,pbfSupported:o,fieldsIndex:a,infoFor3D:i,dynamicDataSource:n,gdbVersion:r,sourceSpatialReference:s,queryAttachmentsSupported:u})}async addAttachment(e,t){await this.load();const{layer:s}=this;await T(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/addAttachment",n=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(t,n.query);try{const e=await r(i,{body:o});return O(e.data.addAttachmentResult)}catch(u){throw this._createAttachmentErrorResult(a,u)}}async updateAttachment(e,t,s){await this.load();const{layer:a}=this;await T(a,"editing");const i=e.attributes[a.objectIdField],n=a.parsedUrl.path+"/"+i+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:t}}),u=this._getFormDataForAttachment(s,o.query);try{const e=await r(n,{body:u});return O(e.data.updateAttachmentResult)}catch(l){throw this._createAttachmentErrorResult(i,l)}}async applyEdits(e,t){await this.load();const{layer:a}=this;await T(a,"editing");const n="infoFor3D"in a?a.infoFor3D:null,o=null!=n,u=o||(t?.globalIdUsed??!1),l=o?await this._uploadMeshesAndGetAssetMapEditsJSON(e):null,c=e.addFeatures?.map((e=>_(this.layer,e,n)))??[],d=(await Promise.all(c)).filter(s),p=e.updateFeatures?.map((e=>_(this.layer,e,n)))??[],h=(await Promise.all(p)).filter(s),y=b(this.layer,e.deleteFeatures,u);U(d,h,a.spatialReference);const m=await R(this.layer,e),f=a.capabilities.editing.supportsAsyncApplyEdits&&o,g=t?.gdbVersion||a.gdbVersion,w={gdbVersion:g,rollbackOnFailure:t?.rollbackOnFailureEnabled,useGlobalIds:u,returnEditMoment:t?.returnEditMoment,usePreviousEditMoment:t?.usePreviousEditMoment,async:f};await k(this.layer.url,g,!0);const S=C(this.layer.url,g||null);if(await L(a.url,g,a.historicMoment))throw new i("feature-layer-source:historic-version","Editing a historic version is not allowed");t?.returnServiceEditsOption?(w.edits=JSON.stringify([{id:a.layerId,adds:d.length?d:null,updates:h.length?h:null,deletes:y.length?y:null,attachments:m,assetMaps:l}]),w.returnServiceEditsOption=V.toJSON(t?.returnServiceEditsOption),w.returnServiceEditsInSourceSR=t?.returnServiceEditsInSourceSR):(w.adds=d.length?JSON.stringify(d):null,w.updates=h.length?JSON.stringify(h):null,w.deletes=y.length?u?JSON.stringify(y):y.join(","):null,w.attachments=m&&JSON.stringify(m),w.assetMaps=null!=l?JSON.stringify(l):void 0);const q=this._getLayerRequestOptions({method:"post",query:w});S&&(q.authMode="immediate",q.query.returnEditMoment=!0,q.query.sessionId=Q);const E=t?.returnServiceEditsOption?a.url:a.parsedUrl.path;let O;try{O=f?await this._asyncApplyEdits(E+"/applyEdits",q):await r(E+"/applyEdits",q)}catch(F){if(!A(F))throw F;q.authMode="immediate",O=f?await this._asyncApplyEdits(E+"/applyEdits",q):await r(E+"/applyEdits",q)}return this._createEditsResult(O)}async deleteAttachments(e,t){await this.load();const{layer:s}=this;await T(s,"editing");const a=e.attributes[s.objectIdField],i=s.parsedUrl.path+"/"+a+"/deleteAttachments";try{return(await r(i,this._getLayerRequestOptions({query:{attachmentIds:t.join(",")},method:"post"}))).data.deleteAttachmentResults.map(O)}catch(n){throw this._createAttachmentErrorResult(a,n)}}fetchRecomputedExtents(e={}){const t=e.signal;return this.load({signal:t}).then((async()=>{const t=this._getLayerRequestOptions({...e,query:{returnUpdates:!0}}),{layerId:s,url:a}=this.layer,{data:i}=await r(`${a}/${s}`,t),{id:n,extent:o,fullExtent:u,timeExtent:l}=i,c=o||u;return{id:n,fullExtent:c&&w.fromJSON(c),timeExtent:l&&D.fromJSON({start:l[0],end:l[1]})}}))}async queryAttachments(e,t={}){await this.load();const r=this._getLayerRequestOptions(t);return this.queryTask.executeAttachmentQuery(e,r)}async queryFeatures(e,t){await this.load();const r=await this.queryTask.execute(e,{...t,query:this._createRequestQueryOptions(t)});return e.outStatistics?.length&&r.features.length&&r.features.forEach((t=>{const r=t.attributes;e.outStatistics?.forEach((({outStatisticFieldName:e})=>{if(e){const t=e.toLowerCase();t&&t in r&&e!==t&&(r[e]=r[t],delete r[t])}}))})),r}async queryFeaturesJSON(e,t){return await this.load(),this.queryTask.executeJSON(e,{...t,query:this._createRequestQueryOptions(t)})}async queryObjectIds(e,t){return await this.load(),this.queryTask.executeForIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryFeatureCount(e,t){return await this.load(),this.queryTask.executeForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryExtent(e,t){return await this.load(),this.queryTask.executeForExtent(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeatures(e,t){return await this.load(),this.queryTask.executeRelationshipQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryRelatedFeaturesCount(e,t){return await this.load(),this.queryTask.executeRelationshipQueryForCount(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopFeatures(e,t){return await this.load(),this.queryTask.executeTopFeaturesQuery(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopObjectIds(e,t){return await this.load(),this.queryTask.executeForTopIds(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopExtents(e,t){return await this.load(),this.queryTask.executeForTopExtents(e,{...t,query:this._createRequestQueryOptions(t)})}async queryTopCount(e,t){return await this.load(),this.queryTask.executeForTopCount(e,{...t,query:this._createRequestQueryOptions(t)})}async fetchPublishingStatus(){if(!v(this.layer.url))return"unavailable";const e=y(this.layer.url,"status"),t=await r(e,{query:{f:"json"}});return $.fromJSON(t.data.status)}async uploadAssets(e,t){const{uploadAssets:r}=await import("./support/uploadAssets.js");return r(e,{layer:this.layer,ongoingUploads:this._ongoingAssetUploads},t)}_handleLastEditsEventChange(e){const t=this.layer;if(null==e||!("capabilities"in t)||!("effectiveCapabilities"in t))return;if(!(!t.capabilities?.operations?.supportsEditing&&t.effectiveCapabilities?.operations?.supportsEditing))return;const r=t.url;if(null==r)return;"layerId"in t&&y(r,t.layerId.toString());this._getOrCreateEditInterceptor(r).before=t=>{const r=t.requestOptions.method??"auto";if("auto"===r||"head"===r){const r=t.requestOptions.query??{};r._ts=e.getTime(),t.requestOptions.query=r}}}_getOrCreateEditInterceptor(e){return null==this._editInterceptor&&(this._editInterceptor={urls:e},t.request.internalInterceptors.push(this._editInterceptor)),this._editInterceptor}_removeEditInterceptor(){null!=this._editInterceptor&&(a(t.request.internalInterceptors,this._editInterceptor),this._editInterceptor=null)}async _asyncApplyEdits(e,t){const s=(await r(e,t)).data.statusUrl;for(;;){const e=(await r(s,{query:{f:"json"},responseType:"json"})).data;switch(e.status){case"Completed":return r(e.resultUrl,{query:{f:"json"},responseType:"json"});case"CompletedWithErrors":throw new i("async-applyEdits-failed","asynchronous applyEdits call failed.");case"Failed ImportChanges":case"InProgress":case"Pending":case"ExportAttachments":case"ExportChanges":case"ExportingData":case"ExportingSnapshot":case"ImportAttachments":case"ProvisioningReplica":case"UnRegisteringReplica":break;default:throw new i("async-applyEdits-failed","asynchronous applyEdits call failed (undefined response status)")}await d(H)}}_createRequestQueryOptions(e){const t={...this.layer.customParameters,token:this.layer.apiKey,...e?.query};return this.layer.datesInUnknownTimezone&&(t.timeReferenceUnknownClient=!0),t}async _fetchService(e,t){if(!e){const s={};has("featurelayer-advanced-symbols")&&(s.returnAdvancedSymbols=!0),t?.cacheBust&&(s._ts=Date.now());const{data:a}=await r(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:s,signal:t?.signal}));e=a}this.sourceJSON=await this._patchServiceJSON(e,t?.signal);const s=e.type;if(!this.supportedSourceTypes.has(s))throw new i("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}async _patchServiceJSON(e,t){if("Table"!==e.type&&e.geometryType&&!e?.drawingInfo?.renderer&&!e.defaultSymbol){const t=x(e.geometryType).renderer;l("drawingInfo.renderer",t,e)}if("esriGeometryMultiPatch"===e.geometryType&&e.infoFor3D&&(e.geometryType="mesh"),null==e.extent)try{const{data:s}=await r(this.layer.url,this._getLayerRequestOptions({signal:t}));s.spatialReference&&(e.extent={xmin:0,ymin:0,xmax:0,ymax:0,spatialReference:s.spatialReference})}catch(s){p(s)}return e}async _ensureLatestMetadata(e){if(this.layer.userHasUpdateItemPrivileges&&this.sourceJSON.cacheMaxAge>0)return this._fetchService(null,{...e,cacheBust:!0})}async _uploadMeshesAndGetAssetMapEditsJSON(e){const{addAssetFeatures:t}=e;if(!t?.length)return null;if(await this._areAllAssetsAlreadyMapped(t))return null;const r=e.addFeatures.filter((e=>e.geometry));if(t.length!==r.length+e.updateFeatures.length)throw new i("feature-layer-source:unsupported-mesh-edits","Mixing attribute only edits with mesh geometry edits is not currently supported");const s=new Array,a=new Map;for(const i of t){const{geometry:e}=i,{vertexSpace:t}=e;if(q(t))s.push(e);else{const t=e.anchor,{convertMeshVertexSpace:r}=await import("../../../geometry/support/meshUtils/convertMeshVertexSpace.js"),n=await r(e,new S({origin:[t.x,t.y,t.z??0]}));a.set(n,e),i.geometry=n,s.push(n)}}await this.uploadAssets(s);for(const[i,n]of a)n.addExternalSources(i.metadata.externalSources.items);return{adds:this._getAssetMapEditsJSON(t),updates:[],deletes:[]}}_getAssetMapEditsJSON(e){const t=new Array,r=this.layer.globalIdField,s=this.layer.parsedUrl;for(const a of e){const e=a.geometry,{metadata:i}=e,n=i.getExternalSourcesOnService(s),o=a.getAttribute(r);if(0===n.length){u.getLogger(this).error(`Skipping feature ${o}. The mesh it is associated with has not been uploaded to the service and cannot be mapped to it.`);continue}const{source:l}=n.find(E)??n[0];for(const r of l)1===r.parts.length?t.push({globalId:m(),parentGlobalId:o,assetName:r.assetName,assetHash:r.parts[0].partHash,flags:[]}):u.getLogger(this).error(`Skipping asset ${r.assetName}. It does not have exactly one part, so we cannot map it to a feature.`)}return t}_createEditsResult(e){const t=e.data,{layerId:r}=this.layer,s=[];let a=null;if(Array.isArray(t))for(const n of t)s.push({id:n.id,editedFeatures:n.editedFeatures}),n.id===r&&(a={addResults:n.addResults??[],updateResults:n.updateResults??[],deleteResults:n.deleteResults??[],attachments:n.attachments,editMoment:n.editMoment});else a=t;const i=F(a);if(s.length>0){i.editedFeatureResults=[];for(const e of s){const{editedFeatures:t}=e,r=t?.spatialReference?new P(t.spatialReference):null;i.editedFeatureResults.push({layerId:e.id,editedFeatures:I(t,r)})}}return i}_createAttachmentErrorResult(e,t){const r=t.details.messages?.[0]||t.message,s=t.details.httpStatus||t.details.messageCode;return{objectId:e,globalId:null,error:new i("feature-layer-source:attachment-failure",r,{code:s})}}_getFormDataForAttachment(e,t){const r=e instanceof FormData?e:e&&e.elements?new FormData(e):null;if(r)for(const s in t){const e=t[s];null!=e&&(r.set?r.set(s,e):r.append(s,e))}return r}_getLayerRequestOptions(e={}){const{layer:t,layer:{parsedUrl:r,gdbVersion:s}}=this;return{...e,query:{gdbVersion:s,layer:"dynamicDataSource"in t&&t.dynamicDataSource?JSON.stringify({source:t.dynamicDataSource}):void 0,...r.query,f:"json",...this._createRequestQueryOptions(e)},responseType:"json"}}async _areAllAssetsAlreadyMapped(e){const{layer:t}=this,{globalIdField:r,parsedUrl:a}=t,i="infoFor3D"in t?t.infoFor3D:null;if(null==i||null==r)return!1;const n=M(i);if(null==n)return!1;const o=y(a.path,`../${n.id}`),u=new Array;for(const s of e){if(!(s.geometry.metadata.getExternalSourcesOnService(a).length>0))return!1;u.push(s)}const l=u.map((e=>e.getAttribute(r))).filter(s);if(0===l.length)return!1;const{assetMapFieldRoles:{parentGlobalId:c,assetHash:d}}=i,p=new J({where:`${c} IN (${l.map((e=>`'${e}'`))})`,outFields:[d,c],returnGeometry:!1}),h=await N(o,p),{features:m}=h;return 0!==m.length&&!u.some((e=>{const t=e.getAttribute(r);if(!t)return!0;const{metadata:s}=e.geometry,i=m.filter((e=>e.getAttribute(c)===t));if(0===i.length)return!0;const n=i.map((e=>e.getAttribute(d)));return s.getExternalSourcesOnService(a).flatMap((({source:e})=>e.flatMap((e=>e.parts.map((e=>e.partHash)))))).some((e=>n.every((t=>e!==t))))}))}};e([f()],G.prototype,"type",void 0),e([f({constructOnly:!0})],G.prototype,"layer",void 0),e([f({constructOnly:!0})],G.prototype,"supportedSourceTypes",void 0),e([f({readOnly:!0})],G.prototype,"queryTask",null),G=e([g("esri.layers.graphics.sources.FeatureLayerSource")],G);const H=1e3,z=G;export{z 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.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{createResolver as s}from"../../core/promiseUtils.js";import"../../core/Logger.js";import"../../core/has.js";import"../../core/Error.js";import{subclass as r}from"../../core/accessorSupport/decorators/subclass.js";import{defaultVersionNameLookup as d,isVersionInEditSession as n}from"../../versionManagement/support/versionManagementUtils.js";const o=new e.EventEmitter;function l(t){return o.on("apply-edits",new WeakRef(t))}function a(t){return o.on("update-moment",new WeakRef(t))}function h(t,e,i=null,r=!1){const d=s();return r=null==e||r,o.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:r,result:d.promise}),d}function c(t,e,i=null,s){o.emit("update-moment",{serviceUrl:t,layerId:e,gdbVersion:i,moment:s})}const u=Symbol();function m(t){return null!=t&&"object"==typeof t&&u in t}function p(t){return null!=t&&"object"==typeof t&&"gdbVersion"in t}function b(t,e,i){const s=new URL(t).host,r=d.get(s),n=t=>!t||t===r;return n(e)&&n(i)||e===i}const g=e=>{var s;let d=class extends e{constructor(...t){super(...t),this[s]=!0,this._applyEditsHandler=t=>{const{serviceUrl:e,layerId:s,gdbVersion:r,mayReceiveServiceEdits:d,result:n}=t,o=e===this.url,l=null!=s&&null!=this.layerId&&s===this.layerId,a=p(this),h=p(this)&&b(e,r,this.gdbVersion);if(!o||a&&!h||!l&&!d)return;const c=n.then((t=>{if(l&&(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length))return this.emit("edits",i(t)),t;const s=t.editedFeatures?.find((({layerId:t})=>t===this.layerId));if(s){const{adds:e,updates:r,deletes:d}=s.editedFeatures,n={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map((({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]}))):[],deletedFeatures:d?d.map((({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]}))):[],updatedFeatures:r?r.map((({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]}))):[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return this.emit("edits",n),n}const d={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(e,r,d.historicMoment)&&this.emit("edits",d),d})).then((t=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(e,r,t.historicMoment)&&(this.historicMoment=t.historicMoment),t)));this.emit("apply-edits",{result:c})},this._updateMomentHandler=t=>{const{serviceUrl:e,gdbVersion:i,moment:s}=t,r=e===this.url,d=p(this),n=p(this)&&b(e,i,this.gdbVersion),o=p(this)&&!b(e,this.gdbVersion,null);r&&d&&n&&o&&"historicMoment"in this&&this.historicMoment!==s&&(this.historicMoment=s)},this.when().then((()=>{this.addHandles(l(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(a(this._updateMomentHandler))}),(()=>{}))}_shouldUpdateHistoricMoment(t,e,i){return"historicMoment"in this&&this.historicMoment!==i&&n(t,e)}};return s=u,d=t([r("esri.layers.mixins.EditBusLayer")],d),d};export{g as EditBusLayer,h as emitApplyEditsEvent,c as emitUpdateMomentEvent,m as isEditBusLayer,p as isLayerWithGDBVersion,l as onApplyEditsEvent,a as onUpdateMomentEvent,b as versionMatches};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import e from"../../core/Evented.js";import{clone as i}from"../../core/lang.js";import{createResolver as s}from"../../core/promiseUtils.js";import{property as r}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import{subclass as d}from"../../core/accessorSupport/decorators/subclass.js";import{defaultVersionNameLookup as o,isVersionInEditSession as n}from"../../versionManagement/support/versionManagementUtils.js";const a=new e.EventEmitter;function l(t){return a.on("apply-edits",new WeakRef(t))}function h(t){return a.on("update-moment",new WeakRef(t))}function c(t,e,i=null,r=!1){const d=s();return r=null==e||r,a.emit("apply-edits",{serviceUrl:t,layerId:e,gdbVersion:i,mayReceiveServiceEdits:r,result:d.promise}),d}function u(t,e,i=null,s){a.emit("update-moment",{serviceUrl:t,layerId:e,gdbVersion:i,moment:s})}const m=Symbol();function p(t){return null!=t&&"object"==typeof t&&m in t}function b(t){return null!=t&&"object"==typeof t&&"gdbVersion"in t}function g(t,e,i){const s=new URL(t).host,r=o.get(s),d=t=>!t||t===r;return d(e)&&d(i)||e===i}const F=e=>{var s;let o=class extends e{constructor(...t){super(...t),this[s]=!0,this._applyEditsHandler=t=>{const{serviceUrl:e,layerId:s,gdbVersion:r,mayReceiveServiceEdits:d,result:o}=t,n=e===this.url,a=null!=s&&null!=this.layerId&&s===this.layerId,l=b(this),h=b(this)&&g(e,r,this.gdbVersion);if(!n||l&&!h||!a&&!d)return;this.lastEditsEventDate=new Date;const c=o.then((t=>{if(a&&(t.addedFeatures.length||t.updatedFeatures.length||t.deletedFeatures.length||t.addedAttachments.length||t.updatedAttachments.length||t.deletedAttachments.length))return this.emit("edits",i(t)),t;const s=t.editedFeatures?.find((({layerId:t})=>t===this.layerId));if(s){const{adds:e,updates:r,deletes:d}=s.editedFeatures,o={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:e?e.map((({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]}))):[],deletedFeatures:d?d.map((({attributes:t})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]}))):[],updatedFeatures:r?r.map((({current:{attributes:t}})=>({objectId:this.objectIdField&&t[this.objectIdField],globalId:this.globalIdField&&t[this.globalIdField]}))):[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return this.emit("edits",o),o}const d={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:[],deletedFeatures:[],updatedFeatures:[],editedFeatures:i(t.editedFeatures),exceededTransferLimit:!1,historicMoment:i(t.historicMoment)};return"historicMoment"in this&&this._shouldUpdateHistoricMoment(e,r,d.historicMoment)&&this.emit("edits",d),d})).then((t=>("historicMoment"in this&&this._shouldUpdateHistoricMoment(e,r,t.historicMoment)&&(this.historicMoment=t.historicMoment),t)));this.emit("apply-edits",{result:c})},this._updateMomentHandler=t=>{const{serviceUrl:e,gdbVersion:i,moment:s}=t,r=e===this.url,d=b(this),o=b(this)&&g(e,i,this.gdbVersion),n=b(this)&&!g(e,this.gdbVersion,null);r&&d&&o&&n&&"historicMoment"in this&&this.historicMoment!==s&&(this.historicMoment=s)},this.when().then((()=>{this.addHandles(l(this._applyEditsHandler)),"historicMoment"in this&&this.addHandles(h(this._updateMomentHandler))}),(()=>{}))}_shouldUpdateHistoricMoment(t,e,i){return"historicMoment"in this&&this.historicMoment!==i&&n(t,e)}};return s=m,t([r()],o.prototype,"lastEditsEventDate",void 0),o=t([d("esri.layers.mixins.EditBusLayer")],o),o};export{F as EditBusLayer,c as emitApplyEditsEvent,u as emitUpdateMomentEvent,p as isEditBusLayer,b as isLayerWithGDBVersion,l as onApplyEditsEvent,h as onUpdateMomentEvent,g as versionMatches};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import a from"../../geometry/Extent.js";import d from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as c,writeUrlWithLayerId as y}from"../support/arcgisLayerUrl.js";import{elevationInfo as m,maxScale as h,minScale as f,url as v}from"../support/commonProperties.js";import g from"../support/EditFieldsInfo.js";import{FeatureIndex as I}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as F,isLayerCacheStale as S,readGlobalIdField as b,readObjectIdField as j,readVersion as x}from"../support/featureLayerUtils.js";import E from"../support/GeometryFieldsInfo.js";import O from"../support/LayerFloorInfo.js";import U from"../support/Relationship.js";import{getFeatureLayerCapabilities as w}from"../support/serviceCapabilitiesUtils.js";import T from"../support/Subtype.js";import{timeZoneProperty as M}from"../../time/timeZoneUtils.js";const D=D=>{let R=class extends D{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(I)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}if(this.userHasUpdateItemPrivileges){if(S(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return w(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return this.sourceJSON?.isMultiServicesView?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}readGlobalIdFieldFromService(e,t){return b(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||this.sourceJSON?.isMultiServicesView)return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return this.sourceJSON?.isMultiServicesView?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return j(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}set url(e){if(null==e)return void this._set("url",e);const t=c({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){y(this,e,null,t,i)}readVersion(e,t){return x(t)}};return e([o({readOnly:!0})],R.prototype,"authenticationTriggerEvent",null),e([o({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],R.prototype,"copyright",void 0),e([o({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],R.prototype,"capabilities",void 0),e([s("service","capabilities")],R.prototype,"readCapabilitiesFromService",null),e([o(M("dateFieldsTimeReference"))],R.prototype,"dateFieldsTimeZone",void 0),e([o({type:Boolean})],R.prototype,"datesInUnknownTimezone",void 0),e([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],R.prototype,"definitionExpression",void 0),e([o({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],R.prototype,"displayField",void 0),e([o({readOnly:!0,type:g})],R.prototype,"editFieldsInfo",void 0),e([o({readOnly:!0})],R.prototype,"editingInfo",void 0),e([s("editingInfo")],R.prototype,"readEditingInfo",null),e([o({readOnly:!0})],R.prototype,"effectiveCapabilities",null),e([o((()=>{const e=r(m),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],R.prototype,"elevationInfo",void 0),e([o({type:O,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:l}}}}})],R.prototype,"floorInfo",void 0),e([o({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],R.prototype,"fullExtent",void 0),e([o()],R.prototype,"gdbVersion",void 0),e([o({readOnly:!0,type:E,json:{read:{source:"geometryProperties"}}})],R.prototype,"geometryFieldsInfo",void 0),e([o({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:F.read}}}})],R.prototype,"geometryType",void 0),e([o({type:String})],R.prototype,"globalIdField",void 0),e([s("service","globalIdField",["globalIdField","fields"])],R.prototype,"readGlobalIdFieldFromService",null),e([o({readOnly:!0})],R.prototype,"hasFullEditingRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],R.prototype,"hasM",void 0),e([o({readOnly:!0})],R.prototype,"hasUpdateItemRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],R.prototype,"hasZ",void 0),e([o({readOnly:!0,type:d})],R.prototype,"heightModelInfo",void 0),e([o({type:Date})],R.prototype,"historicMoment",void 0),e([o({type:t.ofType(I),readOnly:!0})],R.prototype,"indexes",void 0),e([o({readOnly:!0})],R.prototype,"isTable",void 0),e([s("service","isTable",["type"])],R.prototype,"readIsTableFromService",null),e([o({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],R.prototype,"layerId",void 0),e([o(h)],R.prototype,"maxScale",void 0),e([s("service","maxScale",["maxScale","effectiveMaxScale"])],R.prototype,"readMaxScale",null),e([o(f)],R.prototype,"minScale",void 0),e([s("service","minScale",["minScale","effectiveMinScale"])],R.prototype,"readMinScale",null),e([o({type:String})],R.prototype,"objectIdField",void 0),e([s("service","objectIdField",["objectIdField","fields"])],R.prototype,"readObjectIdFieldFromService",null),e([o(M("preferredTimeReference"))],R.prototype,"preferredTimeZone",void 0),e([o({type:[U],readOnly:!0})],R.prototype,"relationships",void 0),e([o({type:Boolean})],R.prototype,"returnM",void 0),e([o({type:Boolean})],R.prototype,"returnZ",void 0),e([o({readOnly:!0,json:{write:!1}})],R.prototype,"serverGens",void 0),e([o({readOnly:!0})],R.prototype,"serviceDefinitionExpression",void 0),e([s("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],R.prototype,"readServiceDefinitionExpression",null),e([o({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],R.prototype,"serviceItemId",void 0),e([o()],R.prototype,"sourceJSON",void 0),e([o({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],R.prototype,"spatialReference",void 0),e([o({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],R.prototype,"subtypeField",void 0),e([o({type:[T],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],R.prototype,"subtypes",void 0),e([o({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],R.prototype,"trackIdField",void 0),e([o(v)],R.prototype,"url",null),e([n("url")],R.prototype,"writeUrl",null),e([o({json:{origins:{service:{read:!0}},read:!1}})],R.prototype,"version",void 0),e([s("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],R.prototype,"readVersion",null),R=e([p("esri.layers.mixins.FeatureLayerBase")],R),R};export{D as FeatureLayerBase};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../core/Collection.js";import{clone as r}from"../../core/lang.js";import i from"../../core/Logger.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import{reader as s}from"../../core/accessorSupport/decorators/reader.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{writer as n}from"../../core/accessorSupport/decorators/writer.js";import{excludeTables as l}from"../../core/accessorSupport/layerContainerType.js";import a from"../../geometry/Extent.js";import d from"../../geometry/HeightModelInfo.js";import u from"../../geometry/SpatialReference.js";import{sanitizeUrlWithLayerId as y,writeUrlWithLayerId as c}from"../support/arcgisLayerUrl.js";import{elevationInfo as m,maxScale as h,minScale as f,url as v}from"../support/commonProperties.js";import g from"../support/EditFieldsInfo.js";import{FeatureIndex as I}from"../support/FeatureIndex.js";import{geometryTypeKebabDict as F,isLayerCacheStale as b,supportsQueryOnly as j,readGlobalIdField as S,readObjectIdField as x,readVersion as E}from"../support/featureLayerUtils.js";import U from"../support/GeometryFieldsInfo.js";import O from"../support/LayerFloorInfo.js";import T from"../support/Relationship.js";import{getFeatureLayerCapabilities as w}from"../support/serviceCapabilitiesUtils.js";import D from"../support/Subtype.js";import{timeZoneProperty as M}from"../../time/timeZoneUtils.js";const R=R=>{let B=class extends R{constructor(){super(...arguments),this.copyright=null,this.capabilities=null,this.dateFieldsTimeZone=null,this.datesInUnknownTimezone=!1,this.definitionExpression=null,this.displayField=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.globalIdField=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.indexes=new(t.ofType(I)),this.isTable=!1,this.layerId=void 0,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.preferredTimeZone=null,this.relationships=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.serviceItemId=null,this.sourceJSON=null,this.spatialReference=u.WGS84,this.subtypeField=null,this.subtypes=null,this.trackIdField=null,this.version=void 0}get authenticationTriggerEvent(){if(!this.url)return null;const{capabilities:e}=this;if(e){const{query:t,operations:r,editing:i}=e;if(!t.supportsQueryByOthers||!t.supportsQueryByAnonymous)return"load";if(r.supportsEditing&&!(i.supportsUpdateByOthers&&i.supportsUpdateByAnonymous&&i.supportsDeleteByOthers&&i.supportsDeleteByAnonymous))return"load"}if(this.userHasUpdateItemPrivileges){if(b(this))return"load";if(this.hasUpdateItemRestrictions)return e.operations.supportsQuery?"editing":"load"}if(this.userHasFullEditingPrivileges&&this.hasFullEditingRestrictions)return"editing";const t=this.editFieldsInfo;return(t?.creatorField||t?.editorField)&&e?.operations.supportsEditing?"editing":null}readCapabilitiesFromService(e,t){return w(t,this.url)}readEditingInfo(e,t){const{editingInfo:r}=t;return r?{lastEditDate:null!=r.lastEditDate?new Date(r.lastEditDate):null}:null}get effectiveCapabilities(){const e=this.capabilities;if(!e)return null;const t=r(e),{operations:i,editing:o}=t;return j(this)?(this.userHasUpdateItemPrivileges&&(i.supportsQuery=!0),t):this.userHasUpdateItemPrivileges?(i.supportsAdd=i.supportsDelete=i.supportsEditing=i.supportsQuery=i.supportsUpdate=o.supportsDeleteByOthers=o.supportsGeometryUpdate=o.supportsUpdateByOthers=!0,t):(this.userHasFullEditingPrivileges&&i.supportsEditing&&(i.supportsAdd=i.supportsDelete=i.supportsUpdate=o.supportsGeometryUpdate=!0),t)}readGlobalIdFieldFromService(e,t){return S(t)}get hasFullEditingRestrictions(){const e=this.capabilities;if(!e||j(this))return!1;const{operations:t,editing:r}=e;return t.supportsEditing&&!(t.supportsAdd&&t.supportsDelete&&t.supportsUpdate&&r.supportsGeometryUpdate)}get hasUpdateItemRestrictions(){const e=this.capabilities;if(!e)return!1;const{operations:t,editing:r}=e;return j(this)?!t.supportsQuery:!(t.supportsAdd&&t.supportsDelete&&t.supportsEditing&&t.supportsQuery&&t.supportsUpdate&&r.supportsDeleteByOthers&&r.supportsGeometryUpdate&&r.supportsUpdateByOthers)}readIsTableFromService(e,t){return"Table"===t.type}readMaxScale(e,t){return t.effectiveMaxScale||e||0}readMinScale(e,t){return t.effectiveMinScale||e||0}readObjectIdFieldFromService(e,t){return x(t)}readServiceDefinitionExpression(e,t){return t.definitionQuery||t.definitionExpression}set url(e){if(null==e)return void this._set("url",e);const t=y({layer:this,url:e,nonStandardUrlAllowed:!0,logger:i.getLogger(this)});this._set("url",t.url),null!=t.layerId&&this._set("layerId",t.layerId)}writeUrl(e,t,r,i){c(this,e,null,t,i)}readVersion(e,t){return E(t)}};return e([o({readOnly:!0})],B.prototype,"authenticationTriggerEvent",null),e([o({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],B.prototype,"copyright",void 0),e([o({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],B.prototype,"capabilities",void 0),e([s("service","capabilities")],B.prototype,"readCapabilitiesFromService",null),e([o(M("dateFieldsTimeReference"))],B.prototype,"dateFieldsTimeZone",void 0),e([o({type:Boolean})],B.prototype,"datesInUnknownTimezone",void 0),e([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],B.prototype,"definitionExpression",void 0),e([o({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],B.prototype,"displayField",void 0),e([o({readOnly:!0,type:g})],B.prototype,"editFieldsInfo",void 0),e([o({readOnly:!0})],B.prototype,"editingInfo",void 0),e([s("editingInfo")],B.prototype,"readEditingInfo",null),e([o({readOnly:!0})],B.prototype,"effectiveCapabilities",null),e([o((()=>{const e=r(m),t=e.json.origins;return t["web-map"]={read:!1,write:!1},t["portal-item"]={read:!1,write:!1},e})())],B.prototype,"elevationInfo",void 0),e([o({type:O,json:{name:"layerDefinition.floorInfo",write:!0,origins:{"web-scene":{name:"layerDefinition.floorInfo",write:{enabled:!0,layerContainerTypes:l}}}}})],B.prototype,"floorInfo",void 0),e([o({type:a,json:{origins:{service:{read:{source:"extent"}}}}})],B.prototype,"fullExtent",void 0),e([o()],B.prototype,"gdbVersion",void 0),e([o({readOnly:!0,type:U,json:{read:{source:"geometryProperties"}}})],B.prototype,"geometryFieldsInfo",void 0),e([o({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:F.read}}}})],B.prototype,"geometryType",void 0),e([o({type:String})],B.prototype,"globalIdField",void 0),e([s("service","globalIdField",["globalIdField","fields"])],B.prototype,"readGlobalIdFieldFromService",null),e([o({readOnly:!0})],B.prototype,"hasFullEditingRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],B.prototype,"hasM",void 0),e([o({readOnly:!0})],B.prototype,"hasUpdateItemRestrictions",null),e([o({type:Boolean,json:{origins:{service:{read:!0}}}})],B.prototype,"hasZ",void 0),e([o({readOnly:!0,type:d})],B.prototype,"heightModelInfo",void 0),e([o({type:Date})],B.prototype,"historicMoment",void 0),e([o({type:t.ofType(I),readOnly:!0})],B.prototype,"indexes",void 0),e([o({readOnly:!0})],B.prototype,"isTable",void 0),e([s("service","isTable",["type"])],B.prototype,"readIsTableFromService",null),e([o({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],B.prototype,"layerId",void 0),e([o(h)],B.prototype,"maxScale",void 0),e([s("service","maxScale",["maxScale","effectiveMaxScale"])],B.prototype,"readMaxScale",null),e([o(f)],B.prototype,"minScale",void 0),e([s("service","minScale",["minScale","effectiveMinScale"])],B.prototype,"readMinScale",null),e([o({type:String})],B.prototype,"objectIdField",void 0),e([s("service","objectIdField",["objectIdField","fields"])],B.prototype,"readObjectIdFieldFromService",null),e([o(M("preferredTimeReference"))],B.prototype,"preferredTimeZone",void 0),e([o({type:[T],readOnly:!0})],B.prototype,"relationships",void 0),e([o({type:Boolean})],B.prototype,"returnM",void 0),e([o({type:Boolean})],B.prototype,"returnZ",void 0),e([o({readOnly:!0,json:{write:!1}})],B.prototype,"serverGens",void 0),e([o({readOnly:!0})],B.prototype,"serviceDefinitionExpression",void 0),e([s("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],B.prototype,"readServiceDefinitionExpression",null),e([o({type:String,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],B.prototype,"serviceItemId",void 0),e([o()],B.prototype,"sourceJSON",void 0),e([o({type:u,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],B.prototype,"spatialReference",void 0),e([o({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],B.prototype,"subtypeField",void 0),e([o({type:[D],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],B.prototype,"subtypes",void 0),e([o({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],B.prototype,"trackIdField",void 0),e([o(v)],B.prototype,"url",null),e([n("url")],B.prototype,"writeUrl",null),e([o({json:{origins:{service:{read:!0}},read:!1}})],B.prototype,"version",void 0),e([s("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],B.prototype,"readVersion",null),B=e([p("esri.layers.mixins.FeatureLayerBase")],B),B};export{R as FeatureLayerBase};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import{ClonableMixin as r}from"../../../core/Clonable.js";import t from"../../../core/Error.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as c}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../../core/accessorSupport/decorators/writer.js";import m from"./CameraOrientation.js";import u from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as y,getEffectiveElevationSource as d,orientedImageryTypeMap as f}from"./utils.js";import{CameraOrientationType as g}from"../enums/CameraOrientationType.js";import h from"../../../geometry/Point.js";function v(e){throw new t("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function w(e,r){throw new t("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:r})}let O=class extends(r(o)){constructor(e){super(e),this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,r){const t={},{attributes:o,layer:a,geometry:i}=e,n={};for(const c in o)t[c.toLowerCase()]=o[c],n[c.toLowerCase()]=c;super.read({geometry:i,layer:a??{},sourceMap:n,...t},r)}write(e,r){const t=super.write(e,r),{sourceMap:o}=this;if(!o||!t)return t;const a={};for(const i in t){const e=o[i.toLowerCase()];e&&(a[e]=t[i])}return a}readCameraHeading(e,r){const{cameraheading:t,camheading:o,layer:a}=r;return t??o??a.cameraHeading}readCameraHeight(e,r){const{cameraheight:t,avghtag:o,layer:a}=r;return t??o??a.cameraHeight}readCamOffset(e,r){const{cameraoffset:t,camoffset:o}=r;return t?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,r){e&&(r.cameraOffset=e.join(";"))}readCameraOrientation(e,r){const{cameraorientation:t,camori:o}=r;return t??o}readCameraPitch(e,r){const{camerapitch:t,campitch:o,layer:a}=r;return t??o??a.cameraPitch}readCameraRoll(e,r){const{cameraroll:t,camroll:o,layer:a}=r;return t??o??a.cameraRoll}readDepthImage(e,r){const{depthimage:t,depthimg:o,layer:a}=r,i=t??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:c}=a??{};return y(i,n,c)}readElevationSource(e,r){const{elevationsource:t,layer:o}=r,{demPathSuffix:a,demPathPrefix:i}=o;if(t){const e=this._parseIfJSON(t);return d(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,r){const{fardistance:t,fardist:o,layer:a}=r;return t??o??a.farDistance}readHFOV(e,r){const{horizontalfieldofview:t,hfov:o,layer:a}=r;return t??o??a.horizontalFieldOfView}readImageURL(e,r){const{imagepath:t,layer:o}=r;t||w("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;return y(t,a,i)}readImageRotation(e,r){const{imagerotation:t,imgrot:o,layer:a}=r;return t??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return"360"===this.orientedImageryType}get location(){const{cameraOrientation:e,cameraHeight:r,elevation:t}=this;if(e){const{type:r,x:t,y:o,z:a,horizontalWKID:i}=e;return new h({x:t,y:o,z:a,spatialReference:{wkid:r===g.LTP?4326:i}})}if("number"!=typeof r)throw v("cameraHeight");const o=this.geometry.clone();return o.z=o.hasZ?o.z:(t??0)+r,o}readNearDistance(e,r){const{neardistance:t,neardist:o,layer:a}=r;return t??o??a.nearDistance}readOrientationAccuracy(e,r){const{accuracy:t,orientationaccuracy:o}=r;return o?.split(";").map(Number)??t?.split(";").map(Number)??null}writeOrientationAccuracy(e,r){e&&(r.orientationAccuracy=e.join(";"))}readOIType(e,r){const{orientedimagerytype:t,oitype:o,camerapitch:a,campitch:i,layer:n}=r,c=f.read(t??o??n.orientedImageryType),p=a??i??n.cameraPitch;return"oblique"===c?p<10?"nadir":"oblique":c}readVFOV(e,r){const{verticalfieldofview:t,vfov:o,layer:a}=r;return t??o??a.verticalFieldOfView}_parseIfJSON(e){let r=null;try{r=JSON.parse(e)}catch(t){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,t)}return r}};e([i({type:Date,json:{write:{enabled:!0,target:"aquisitionDate"},name:"acquisitiondate"}})],O.prototype,"acquisitionDate",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],O.prototype,"cameraHeading",void 0),e([p("cameraHeading")],O.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],O.prototype,"cameraHeight",void 0),e([p("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],O.prototype,"readCameraHeight",null),e([i()],O.prototype,"cameraOffset",void 0),e([p("cameraOffset",["cameraoffset","camoffset"])],O.prototype,"readCamOffset",null),e([l("cameraOffset")],O.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,r,t)=>{r[t]=e.toString()}}},type:m}),n((e=>e?u.getCameraOrientation(e):null))],O.prototype,"cameraOrientation",void 0),e([p("cameraOrientation",["cameraorientation","camori"])],O.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],O.prototype,"cameraPitch",void 0),e([p("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],O.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],O.prototype,"cameraRoll",void 0),e([p("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],O.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],O.prototype,"depthImage",void 0),e([p("depthImage",["depthimage","depthimg"])],O.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],O.prototype,"elevation",void 0),e([i({json:{write:!0}})],O.prototype,"elevationSource",void 0),e([p("elevationSource",["elevationsource","layer.effectiveElevationSource"])],O.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],O.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"farDistance",void 0),e([p("farDistance",["fardistance","fardist","layer.farDistance"])],O.prototype,"readFarDistance",null),e([i({type:h,json:{name:"geometry"}})],O.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"horizontalFieldOfView",void 0),e([p("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],O.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],O.prototype,"imagePath",void 0),e([p("imagePath",["imagepath"])],O.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],O.prototype,"imageRotation",void 0),e([p("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],O.prototype,"readImageRotation",null),e([i()],O.prototype,"isHorizontal",null),e([i()],O.prototype,"isInspection",null),e([i()],O.prototype,"isNadir",null),e([i()],O.prototype,"isOblique",null),e([i()],O.prototype,"isSpherical",null),e([i()],O.prototype,"location",null),e([i({json:{write:!0},type:String})],O.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"nearDistance",void 0),e([p("nearDistance",["neardistance","neardist","layer.nearDistance"])],O.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],O.prototype,"objectId",void 0),e([i()],O.prototype,"orientationAccuracy",void 0),e([p("orientationAccuracy",["accuracy","orientationaccuracy"])],O.prototype,"readOrientationAccuracy",null),e([l("orientationAccuracy")],O.prototype,"writeOrientationAccuracy",null),e([c(f)],O.prototype,"orientedImageryType",void 0),e([p("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],O.prototype,"readOIType",null),e([i({type:Number,json:{name:"sortorder",write:{target:"sortOrder"}}})],O.prototype,"sortOrder",void 0),e([i({type:Object})],O.prototype,"sourceMap",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"verticalFieldOfView",void 0),e([p("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],O.prototype,"readVFOV",null),O=e([s("esri.layers.orientedImagery.core.ExposurePoint")],O);const j=O;export{j as default};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import"../../../geometry.js";import{ClonableMixin as r}from"../../../core/Clonable.js";import t from"../../../core/Error.js";import{JSONSupport as o}from"../../../core/JSONSupport.js";import a from"../../../core/Logger.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import{cast as n}from"../../../core/accessorSupport/decorators/cast.js";import{enumeration as c}from"../../../core/accessorSupport/decorators/enumeration.js";import{reader as p}from"../../../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{writer as l}from"../../../core/accessorSupport/decorators/writer.js";import m from"./CameraOrientation.js";import u from"./cameraOrientationFactory.js";import{appendPrefixAndSuffix as y,getEffectiveElevationSource as d,orientedImageryTypeMap as f}from"./utils.js";import{CameraOrientationType as g}from"../enums/CameraOrientationType.js";import h from"../../../geometry/Point.js";function v(e){throw new t("exposure-point:missing-default-value",`a value for ${e} is missing in default properties`)}function w(e,r){throw new t("exposure-point:missing-attribute-value",`a value for ${e} is missing in attribute table`,{exposurePoint:r})}let O=class extends(r(o)){constructor(e){super(e),this.cameraOrientation=null,this.elevation=null,this.elevationSource=null,this.name=null,this.sourceMap=null}read(e,r){const t={},{attributes:o,layer:a,geometry:i}=e,n={};for(const c in o)t[c.toLowerCase()]=o[c],n[c.toLowerCase()]=c;super.read({geometry:i,layer:a??{},sourceMap:n,...t},r)}write(e,r){const t=super.write(e,r),{sourceMap:o}=this;if(!o||!t)return t;const a={};for(const i in t){const e=o[i.toLowerCase()];e&&(a[e]=t[i])}return a}readCameraHeading(e,r){const{cameraheading:t,camheading:o,layer:a}=r;return t??o??a.cameraHeading}readCameraHeight(e,r){const{cameraheight:t,avghtag:o,layer:a}=r;return t??o??a.cameraHeight}readCamOffset(e,r){const{cameraoffset:t,camoffset:o}=r;return t?.split(";").map(Number)??o?.split(";").map(Number)??null}writeCameraOffset(e,r){e&&(r.cameraOffset=e.join(";"))}readCameraOrientation(e,r){const{cameraorientation:t,camori:o}=r;return t??o}readCameraPitch(e,r){const{camerapitch:t,campitch:o,layer:a}=r;return t??o??a.cameraPitch}readCameraRoll(e,r){const{cameraroll:t,camroll:o,layer:a}=r;return t??o??a.cameraRoll}readDepthImage(e,r){const{depthimage:t,depthimg:o,layer:a}=r,i=t??o??null,{depthImagePathPrefix:n,depthImagePathSuffix:c}=a??{};return y(i,n,c)}readElevationSource(e,r){const{elevationsource:t,layer:o}=r,{demPathSuffix:a,demPathPrefix:i}=o;if(t){const e=this._parseIfJSON(t);return d(e,i,a)}return o.effectiveElevationSource}readFarDistance(e,r){const{fardistance:t,fardist:o,layer:a}=r;return t??o??a.farDistance}readHFOV(e,r){const{horizontalfieldofview:t,hfov:o,layer:a}=r;return t??o??a.horizontalFieldOfView}readImageURL(e,r){const{imagepath:t,layer:o}=r;t||w("imagePath",this);const{imagePathPrefix:a,imagePathSuffix:i}=o;return y(t,a,i)}readImageRotation(e,r){const{imagerotation:t,imgrot:o,layer:a}=r;return t??o??a.imageRotation}get isHorizontal(){return"horizontal"===this.orientedImageryType}get isInspection(){return"inspection"===this.orientedImageryType}get isNadir(){return"nadir"===this.orientedImageryType}get isOblique(){return"oblique"===this.orientedImageryType}get isSpherical(){return"360"===this.orientedImageryType}get location(){const{cameraOrientation:e,cameraHeight:r,elevation:t}=this;if(e){const{type:r,x:t,y:o,z:a,horizontalWKID:i}=e;return new h({x:t,y:o,z:a,spatialReference:{wkid:r===g.LTP?4326:i}})}if("number"!=typeof r)throw v("cameraHeight");const o=this.geometry.clone();return o.z=o.hasZ?o.z:(t??0)+r,o}readNearDistance(e,r){const{neardistance:t,neardist:o,layer:a}=r;return t??o??a.nearDistance}readOrientationAccuracy(e,r){const{accuracy:t,orientationaccuracy:o}=r;return o?.split(";").map(Number)??t?.split(";").map(Number)??null}writeOrientationAccuracy(e,r){e&&(r.orientationAccuracy=e.join(";"))}readOIType(e,r){const{orientedimagerytype:t,oitype:o,camerapitch:a,campitch:i,layer:n}=r,c=f.read(t??o??n.orientedImageryType),p=a??i??n.cameraPitch;return"oblique"===c?p<10?"nadir":"oblique":c}readVFOV(e,r){const{verticalfieldofview:t,vfov:o,layer:a}=r;return t??o??a.verticalFieldOfView}_parseIfJSON(e){let r=null;try{r=JSON.parse(e)}catch(t){a.getLogger(this).error("couldn't parse the given elevation source JSON",e,t)}return r}};e([i({type:Date,json:{write:{enabled:!0,target:"aquisitionDate"},name:"acquisitiondate"}})],O.prototype,"acquisitionDate",void 0),e([i({type:Number,json:{write:!0,read:{source:["cameraheading","camheading","layer.cameraHeading"]}}})],O.prototype,"cameraHeading",void 0),e([p("cameraHeading")],O.prototype,"readCameraHeading",null),e([i({type:Number,json:{write:!0}})],O.prototype,"cameraHeight",void 0),e([p("cameraHeight",["cameraheight","avghtag","layer.cameraHeight"])],O.prototype,"readCameraHeight",null),e([i()],O.prototype,"cameraOffset",void 0),e([p("cameraOffset",["cameraoffset","camoffset"])],O.prototype,"readCamOffset",null),e([l("cameraOffset")],O.prototype,"writeCameraOffset",null),e([i({json:{write:{writer:(e,r,t)=>{r[t]=e.toString()}}},type:m}),n((e=>e?u.getCameraOrientation(e):null))],O.prototype,"cameraOrientation",void 0),e([p("cameraOrientation",["cameraorientation","camori"])],O.prototype,"readCameraOrientation",null),e([i({type:Number,json:{write:!0}})],O.prototype,"cameraPitch",void 0),e([p("cameraPitch",["camerapitch","campitch","layer.cameraPitch"])],O.prototype,"readCameraPitch",null),e([i({type:Number,json:{write:!0}})],O.prototype,"cameraRoll",void 0),e([p("cameraRoll",["cameraroll","camroll","layer.cameraRoll"])],O.prototype,"readCameraRoll",null),e([i({json:{write:!0},type:String})],O.prototype,"depthImage",void 0),e([p("depthImage",["depthimage","depthimg"])],O.prototype,"readDepthImage",null),e([i({type:Number,json:{write:!0}})],O.prototype,"elevation",void 0),e([i({json:{write:!0},clonable:"reference"})],O.prototype,"elevationSource",void 0),e([p("elevationSource",["elevationsource","layer.effectiveElevationSource"])],O.prototype,"readElevationSource",null),e([i({json:{name:"exposurestationid",write:{target:"exposureStationId"}},type:String})],O.prototype,"exposureStationId",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"farDistance",void 0),e([p("farDistance",["fardistance","fardist","layer.farDistance"])],O.prototype,"readFarDistance",null),e([i({type:h,json:{name:"geometry"}})],O.prototype,"geometry",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"horizontalFieldOfView",void 0),e([p("horizontalFieldOfView",["horizontalfieldofview","hfov","layer.horizontalFieldOfView"])],O.prototype,"readHFOV",null),e([i({json:{write:!0},type:String})],O.prototype,"imagePath",void 0),e([p("imagePath",["imagepath"])],O.prototype,"readImageURL",null),e([i({type:Number,json:{write:!0}})],O.prototype,"imageRotation",void 0),e([p("imageRotation",["imagerotation","imgrot","layer.imageRotation"])],O.prototype,"readImageRotation",null),e([i()],O.prototype,"isHorizontal",null),e([i()],O.prototype,"isInspection",null),e([i()],O.prototype,"isNadir",null),e([i()],O.prototype,"isOblique",null),e([i()],O.prototype,"isSpherical",null),e([i()],O.prototype,"location",null),e([i({json:{write:!0},type:String})],O.prototype,"name",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"nearDistance",void 0),e([p("nearDistance",["neardistance","neardist","layer.nearDistance"])],O.prototype,"readNearDistance",null),e([i({json:{write:!0,name:"objectid"},type:Number})],O.prototype,"objectId",void 0),e([i()],O.prototype,"orientationAccuracy",void 0),e([p("orientationAccuracy",["accuracy","orientationaccuracy"])],O.prototype,"readOrientationAccuracy",null),e([l("orientationAccuracy")],O.prototype,"writeOrientationAccuracy",null),e([c(f)],O.prototype,"orientedImageryType",void 0),e([p("orientedImageryType",["orientedimagerytype","oitype","layer.orientedImageryType"])],O.prototype,"readOIType",null),e([i({type:Number,json:{name:"sortorder",write:{target:"sortOrder"}}})],O.prototype,"sortOrder",void 0),e([i({type:Object})],O.prototype,"sourceMap",void 0),e([i({type:Number,json:{write:!0}})],O.prototype,"verticalFieldOfView",void 0),e([p("verticalFieldOfView",["verticalfieldofview","vfov","layer.verticalFieldOfView"])],O.prototype,"readVFOV",null),O=e([s("esri.layers.orientedImagery.core.ExposurePoint")],O);const j=O;export{j 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.31/esri/copyright.txt for details.
4
4
  */
5
- import"../../../geometry.js";import"../../../core/has.js";import"../../../core/Logger.js";import{deg2rad as e}from"../../../core/mathUtils.js";import{zeros as t,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{m as a,z as n,g as i}from"../../../chunks/vec32.js";import o from"../../../geometry/Point.js";import{projectWithZConversion as s,initializeProjection as c,project as f}from"../../../geometry/projection.js";import{fromPoints as m,fromValues as p}from"../../../geometry/support/ray.js";import{k as l,i as y}from"../../../chunks/sphere.js";import{geographicToWebMercator as u,webMercatorToGeographic as x}from"../../../geometry/support/webMercatorUtils.js";import{limitZToGround as z}from"../core/coverageUtils.js";import w from"../core/ExposurePoint.js";import{transformPoints as g,updateElevation as h}from"./groundToImageUtils.js";import{getWebMercatorScalingFactor as d,convertPixelToHeadingPitch as R,convertHeadingPitchToSphereVertex as j,scaleAndAddWithFactor as b,hasCameraOrientationLTP as P,computeHFOVAndVFOV as v,ltpToGeographic as M,projectiveTransform2 as O,scaleWithFactor as S,calculateRotationMatrix as F,transformMat3 as L,projectiveTransform as H,getPlaneLineIntersectionPoint as V}from"./utils.js";import{defaultImageSphereCenter as A}from"../../../widgets/PanoramicViewer/constants.js";import{isNumber as T}from"../../../widgets/support/dataUtils.js";import U from"../../../geometry/Polygon.js";import C from"../../../geometry/SpatialReference.js";function D(e,t){if(!e)return Promise.resolve([]);const r=t.feature;let a=r.attributes;return a instanceof w||(a=w.fromJSON(r),a&&(r.attributes=a)),E(e,t)}function E(e,t){const{attributes:r}=t.feature;if(r.isSpherical||360===r.horizontalFieldOfView){const{location:a,cameraOrientation:n,farDistance:i,cameraHeading:o,cameraHeight:s}=r;return G(e,a,i,[t.imageProperties.width,t.imageProperties.height],o,s,n)}return W(e,t)}async function G(e,t,a,n,i,s,c){let f=new o(t);f.spatialReference.isGeographic&&f.spatialReference.isWGS84&&4!==c?.type&&(f=u(f));const x=d(f),z=new Array,[w,g,h]=f.toArray(),P=l([w,g,h??0],a*x),v=A.toArray();for(const l of e){let e,t;if(T(l.heading)&&T(l.pitch))e=l.heading,t=l.pitch;else{const r=R({x:l.x,y:l.y},n[0],n[1]);e=r.heading,t=r.pitch}e=(e+i)%360;const a=m([v[0],v[1],v[2]],j(e,t)),c=p([w,g,h??0],a.direction),u=r();y(P,c,u);const d=(f.z??0)-s;if(u[2]<d){const e=Math.abs((f.z-d)/-a.direction[2])*x;b([f.x,f.y,f.z],a.direction,e,x,u)}else u[2]=d;z.push(new o(u,f.spatialReference))}return z}async function W(e,t){const{feature:r,footprintExtent:a,options:n}=t,{attributes:{cameraHeight:i,cameraOrientation:c,cameraPitch:f,cameraRoll:m,elevationSource:p,horizontalFieldOfView:l,location:y,verticalFieldOfView:z},elevationSample:w}=r,h=P(c),{vfov:R}=v(l,z,m??0);let j=new o(y),b=!1;h&&(j=new o(M(j,[c.latitude,c.longitude,c.ellipsoidRadius,c.squaredEccentricity]))),j.spatialReference.isWGS84&&(b=!0,j=u(j));const S=d(j),F=N(t,j,S),L=h?F.map((e=>x(new o(e)))):F,H=await g(L,t,!0).then((e=>e.map((e=>({x:e.x,y:e.y,z:1}))))),V=new Array;for(const u of e){const e={...u,z:1},r={...O(e,H,L),spatialReference:j.spatialReference},[c]=await g([h?x(new o(r)):new o(r)],t,!0);await Z(e,c,H,L,j,r,h,t);const m=await s(p||w?await k({cameraLocation:j,groundFootPrint:L,projectedPoint:r,webMercatorScalingFactor:S,vfov:R,shouldConvertToLatLong:b,isCameraOrientationLTP:h,imgPoint:e},t):new o(J(r,j,S,j.z-i,f,R,b)),a.spatialReference,n);V.push(m)}return V}async function k(e,t){const{cameraLocation:r,groundFootPrint:a,projectedPoint:n,webMercatorScalingFactor:i,vfov:s,shouldConvertToLatLong:f,isCameraOrientationLTP:m,imgPoint:p}=e,{cameraHeight:l,cameraPitch:y}=t.feature.attributes;await c(r.spatialReference,t.footprintExtent.spatialReference,null,t.options);let u=await I(a,t),z=0,w=r.z??0-l,d=0;for(;d<10;){const e=B(u,r,n);if(!e||!q([r.x,r.y,r.z],[e.x,e.y,e.z],[n.x,n.y,n.z]))return new o(J(n,r,i,w,y,s,f));const a=new o({x:e.x,y:e.y,z:e.z,spatialReference:r.spatialReference}),c=await g([m?x(a):a],t);if(z=Math.abs(p.x-c[0].x)+Math.abs(p.y-c[0].y),w=e.z,z<=1)return new o(J(n,r,i,w,y,s,f));d+=1;const{extent:l}=u,R=(l?.width??0)/10,j=(l?.height??0)/10;if(R<1||j<1)return new o(J(n,r,i,w,y,s,f));const{x:b,y:P}=e,v=await h(K(R,j).map((([e,t])=>new o({x:b+e,y:P+t,spatialReference:r.spatialReference}))),t,!1);v.push(v[0]),u=new U({rings:[v.map((e=>e.toArray()))],spatialReference:r.spatialReference})}return new o(J(n,r,i,w,y,s,f))}const q=(e,r,i)=>a(n(t(),r,e),n(t(),i,e))>0;function J(e,r,a,i,s,c,f){const m=Math.sqrt((e.z-r.z)**2+(Math.sqrt((e.x-r.x)**2+(e.y-r.y)**2)/a)**2)*a,p=S(n(t(),[e.x,e.y,e.z],[r.x,r.y,r.z]),1/m,1/a);if(e.z<i||s+c/2<90){const t=Math.abs((r.z-i)/-p[2])*a,n=b([r.x,r.y,r.z],p,t,a);e.x=n[0],e.y=n[1],e.z=n[2]}else e.z=i;return f?x(new o(e)).toJSON():e}function N(r,a,s){const{feature:c}=r,{attributes:f}=c,m=2*Math.tan(e(f.verticalFieldOfView)/2)*f.farDistance*s,p=2*Math.tan(e(f.horizontalFieldOfView)/2)*f.farDistance*s,l=F("HPR",[f.cameraHeading,f.cameraPitch,f.cameraRoll??0]),y=L([0,0,-1],l),u=b([a.x,a.y,a.z],y,f.farDistance*s,s),x=L([0,1,0],l),z=L([1,0,0],l),w=S(x,m/2,s),g=S(z,p/2,s),h=n(t(),w,g),d=i(t(),w,g);return[i(t(),u,h),i(t(),u,d),n(t(),u,h),n(t(),u,d)].map((e=>{const[t,r,n]=e;return new o({x:t,y:r,z:n,spatialReference:a.spatialReference})}))}async function I(e,t){const r=e[0].spatialReference.isWGS84?C.WebMercator:e[0].spatialReference,{cameraHeight:a,location:n,elevation:i}=t.feature.attributes,s="number"==typeof n.z&&"number"==typeof i?n.z-i:a,c=z(e.map((({x:e,y:t,z:r})=>[e,t,r])),s,n,d(n)),m=(await h(c.map((e=>new o(e,n.spatialReference))),t,!1)).map((e=>f(e,r)));return new U({hasZ:!0,rings:[m.map((e=>[e.x,e.y,e.z]))],spatialReference:r})}async function Z(e,t,r,a,n,i,s,c){let f=0;const m=8;for(let p=0;p<=m;p+=1){if(f=Math.abs(e.x-t.x)+Math.abs(e.y-t.y),f<=1)return;const[m,p,l,y]=K(f,f).map((([t,i])=>({...H({x:e.x+t,y:e.y+i,z:1},r[0],r[1],r[2],r[3],{x:a[0].x,y:a[0].y,z:a[0].z},{x:a[1].x,y:a[1].y,z:a[1].z},{x:a[2].x,y:a[2].y,z:a[2].z},{x:a[3].x,y:a[3].y,z:a[3].z}),spatialReference:n.spatialReference}))),[u,z,w,h]=await g(s?[x(new o(m)),x(new o(p)),x(new o(l)),x(new o(y))]:[new o(m),new o(p),new o(l),new o(y)],c,!0).then((e=>e.map((e=>({...e,z:0}))))),{x:d,y:R,z:j}=H(e,u,z,w,h,m,p,l,y);i.x=d,i.y=R,i.z=j,[t]=await g([s?x(new o(i)):new o(i)],c,!0)}}function B(e,t,r){const a={x:e.rings[0][0][0],y:e.rings[0][0][1],z:e.rings[0][0][2]},n={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},i={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},o={x:e.rings[0][2][0],y:e.rings[0][2][1],z:e.rings[0][2][2]},s=(o.z-i.z)*(n.y-a.y)-(o.y-i.y)*(n.z-a.z),c=-((o.z-i.z)*(n.x-a.x)-(n.z-a.z)*(o.x-i.x)),f=(o.y-i.y)*(n.x-a.x)-(n.y-a.y)*(o.x-i.x),m=-(s*a.x+c*a.y+f*a.z);return V(t.toJSON(),r,s,c,f,m)}const K=(e,t)=>[[-e,-t],[e,-t],[e,t],[-e,t]];export{D as transformPoints};
5
+ import"../../../geometry.js";import"../../../core/has.js";import"../../../core/Logger.js";import{deg2rad as e}from"../../../core/mathUtils.js";import{zeros as t,create as r}from"../../../core/libs/gl-matrix-2/factories/vec3f64.js";import{m as a,z as n,g as i}from"../../../chunks/vec32.js";import o from"../../../geometry/Point.js";import{projectWithZConversion as s,initializeProjection as c,project as f}from"../../../geometry/projection.js";import{fromPoints as p,fromValues as m}from"../../../geometry/support/ray.js";import{k as l,i as y}from"../../../chunks/sphere.js";import{geographicToWebMercator as u,webMercatorToGeographic as g}from"../../../geometry/support/webMercatorUtils.js";import{createCoveragePolygon as w,limitZToGround as x}from"../core/coverageUtils.js";import z from"../core/ExposurePoint.js";import{transformPoints as h,updateElevation as d}from"./groundToImageUtils.js";import{getWebMercatorScalingFactor as R,convertPixelToHeadingPitch as j,convertHeadingPitchToSphereVertex as b,scaleAndAddWithFactor as P,hasCameraOrientationLTP as v,computeHFOVAndVFOV as M,ltpToGeographic as O,projectiveTransform2 as S,scaleWithFactor as F,calculateRotationMatrix as L,transformMat3 as H,projectiveTransform as V,getPlaneLineIntersectionPoint as A}from"./utils.js";import{defaultImageSphereCenter as T}from"../../../widgets/PanoramicViewer/constants.js";import{isNumber as U}from"../../../widgets/support/dataUtils.js";import C from"../../../geometry/Polygon.js";import D from"../../../geometry/SpatialReference.js";function E(e,t){if(!e)return Promise.resolve([]);const r=t.feature;let a=r.attributes;return a instanceof z||(a=z.fromJSON(r),a&&(r.attributes=a)),G(e,t)}function G(e,t){const{attributes:r}=t.feature;if(r.isSpherical||360===r.horizontalFieldOfView){const{location:a,cameraOrientation:n,farDistance:i,cameraHeading:o,cameraHeight:s}=r;return W(e,a,i,[t.imageProperties.width,t.imageProperties.height],o,s,n)}return k(e,t)}async function W(e,t,a,n,i,s,c){let f=new o(t);f.spatialReference.isGeographic&&f.spatialReference.isWGS84&&4!==c?.type&&(f=u(f));const g=R(f),w=new Array,[x,z,h]=f.toArray(),d=l([x,z,h??0],a*g),v=T.toArray();for(const l of e){let e,t;if(U(l.heading)&&U(l.pitch))e=l.heading,t=l.pitch;else{const r=j({x:l.x,y:l.y},n[0],n[1]);e=r.heading,t=r.pitch}e=(e+i)%360;const a=p([v[0],v[1],v[2]],b(e,t)),c=m([x,z,h??0],a.direction),u=r();y(d,c,u);const R=(f.z??0)-s;if(u[2]<R){const e=Math.abs((f.z-R)/-a.direction[2])*g;P([f.x,f.y,f.z],a.direction,e,g,u)}else u[2]=R;w.push(new o(u,f.spatialReference))}return w}async function k(e,t){const{feature:r,footprintExtent:a,options:n}=t,{attributes:{cameraHeight:i,cameraOrientation:c,cameraPitch:f,cameraRoll:p,elevationSource:m,horizontalFieldOfView:l,location:y,verticalFieldOfView:x},elevationSample:z}=r,d=v(c),{vfov:j}=M(l,x,p??0);let b=new o(y),P=!1;d&&(b=new o(O(b,[c.latitude,c.longitude,c.ellipsoidRadius,c.squaredEccentricity]))),b.spatialReference.isWGS84&&(P=!0,b=u(b));const F=R(b),L=I(t,b,F),H=d?L.map((e=>g(new o(e)))):L,V=await h(H,t,!0).then((e=>e.map((e=>({x:e.x,y:e.y,z:1}))))),A=new Array;for(const u of e){const e={...u,z:1},c={...S(e,V,H),spatialReference:b.spatialReference},[p]=await h([d?g(new o(c)):new o(c)],t,!0);await B(e,p,V,H,b,c,d,t);const l=r.attributes.clone();l.geometry=b.clone();const{polygon:y}=w(l),x=y.rings[0].map((e=>new o(e,y.spatialReference))),R=await s(m||z?await q({cameraLocation:b,groundFootPrint:x,projectedPoint:c,webMercatorScalingFactor:F,vfov:j,shouldConvertToLatLong:P,isCameraOrientationLTP:d,imgPoint:e},t):new o(N(c,b,F,b.z-i,f,j,P)),a.spatialReference,n);A.push(R)}return A}async function q(e,t){const{cameraLocation:r,groundFootPrint:a,projectedPoint:n,webMercatorScalingFactor:i,vfov:s,shouldConvertToLatLong:f,isCameraOrientationLTP:p,imgPoint:m}=e,{cameraHeight:l,cameraPitch:y}=t.feature.attributes;await c(r.spatialReference,t.footprintExtent.spatialReference,null,t.options);let u=await Z(a,t),w=0,x=(r.z??0)-l,z=0;for(;z<10;){const e=K(u,r,n);if(!e||!J([r.x,r.y,r.z],[e.x,e.y,e.z],[n.x,n.y,n.z]))return new o(N(n,r,i,x,y,s,f));const a=new o({x:e.x,y:e.y,z:e.z,spatialReference:r.spatialReference}),c=await h([p?g(a):a],t);if(w=Math.abs(m.x-c[0].x)+Math.abs(m.y-c[0].y),x=e.z,w<=1)return new o(N(n,r,i,x,y,s,f));z+=1;const{extent:l}=u,R=(l?.width??0)/10,j=(l?.height??0)/10;if(R<1||j<1)return new o(N(n,r,i,x,y,s,f));const{x:b,y:P}=e,v=await d(Q(R,j).map((([e,t])=>new o({x:b+e,y:P+t,spatialReference:r.spatialReference}))),t,!1);v.push(v[0]),u=new C({rings:[v.map((e=>e.toArray()))],spatialReference:r.spatialReference})}return new o(N(n,r,i,x,y,s,f))}const J=(e,r,i)=>a(n(t(),r,e),n(t(),i,e))>0;function N(e,r,a,i,s,c,f){const p=Math.sqrt((e.z-r.z)**2+(Math.sqrt((e.x-r.x)**2+(e.y-r.y)**2)/a)**2)*a,m=F(n(t(),[e.x,e.y,e.z],[r.x,r.y,r.z]),1/p,1/a);if(e.z<i||s+c/2<90){const t=Math.abs((r.z-i)/-m[2])*a,n=P([r.x,r.y,r.z],m,t,a);e.x=n[0],e.y=n[1],e.z=n[2]}else e.z=i;return f?g(new o(e)).toJSON():e}function I(r,a,s){const{feature:c}=r,{attributes:f}=c,p=2*Math.tan(e(f.verticalFieldOfView)/2)*f.farDistance*s,m=2*Math.tan(e(f.horizontalFieldOfView)/2)*f.farDistance*s,l=L("HPR",[f.cameraHeading,f.cameraPitch,f.cameraRoll??0]),y=H([0,0,-1],l),u=P([a.x,a.y,a.z],y,f.farDistance*s,s),g=H([0,1,0],l),w=H([1,0,0],l),x=F(g,p/2,s),z=F(w,m/2,s),h=n(t(),x,z),d=i(t(),x,z);return[i(t(),u,h),i(t(),u,d),n(t(),u,h),n(t(),u,d)].map((e=>{const[t,r,n]=e;return new o({x:t,y:r,z:n,spatialReference:a.spatialReference})}))}async function Z(e,t){const r=e[0].spatialReference.isWGS84?D.WebMercator:e[0].spatialReference,{cameraHeight:a,location:n,elevation:i}=t.feature.attributes,s="number"==typeof n.z&&"number"==typeof i?n.z-i:a,c=x(e.map((({x:e,y:t,z:r})=>[e,t,r])),s,n,R(n)),p=(await d(c.map((e=>new o(e,n.spatialReference))),t,!1)).map((e=>f(e,r)));return new C({hasZ:!0,rings:[p.map((e=>[e.x,e.y,e.z]))],spatialReference:r})}async function B(e,t,r,a,n,i,s,c){let f=0;const p=8;for(let m=0;m<=p;m+=1){if(f=Math.abs(e.x-t.x)+Math.abs(e.y-t.y),f<=1)return;const[p,m,l,y]=Q(f,f).map((([t,i])=>({...V({x:e.x+t,y:e.y+i,z:1},r[0],r[1],r[2],r[3],{x:a[0].x,y:a[0].y,z:a[0].z},{x:a[1].x,y:a[1].y,z:a[1].z},{x:a[2].x,y:a[2].y,z:a[2].z},{x:a[3].x,y:a[3].y,z:a[3].z}),spatialReference:n.spatialReference}))),[u,w,x,z]=await h(s?[g(new o(p)),g(new o(m)),g(new o(l)),g(new o(y))]:[new o(p),new o(m),new o(l),new o(y)],c,!0).then((e=>e.map((e=>({...e,z:0}))))),{x:d,y:R,z:j}=V(e,u,w,x,z,p,m,l,y);i.x=d,i.y=R,i.z=j,[t]=await h([s?g(new o(i)):new o(i)],c,!0)}}function K(e,t,r){const a={x:e.rings[0][0][0],y:e.rings[0][0][1],z:e.rings[0][0][2]},n={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},i={x:e.rings[0][1][0],y:e.rings[0][1][1],z:e.rings[0][1][2]},o={x:e.rings[0][2][0],y:e.rings[0][2][1],z:e.rings[0][2][2]},s=(o.z-i.z)*(n.y-a.y)-(o.y-i.y)*(n.z-a.z),c=-((o.z-i.z)*(n.x-a.x)-(n.z-a.z)*(o.x-i.x)),f=(o.y-i.y)*(n.x-a.x)-(n.y-a.y)*(o.x-i.x),p=-(s*a.x+c*a.y+f*a.z);return A(t.toJSON(),r,s,c,f,p)}const Q=(e,t)=>[[-e,-t],[e,-t],[e,t],[-e,t]];export{E as transformPoints};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.31/esri/copyright.txt for details.
4
4
  */
5
- import{id as t}from"../../kernel.js";import{symbolTypesRenderer as e}from"../../symbols.js";import{resultOrAbort as r}from"../../core/asyncUtils.js";import n from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import{parseWhereClause as a}from"../../core/sql.js";import{createTypeReader as s}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{queryAllJSON as i}from"./featureQueryAll.js";import{getOwningPortalUrl as u}from"./layerUtils.js";import l from"../../renderers/SimpleRenderer.js";import c from"../../renderers/UniqueValueRenderer.js";import p from"../../rest/support/AttachmentQuery.js";import d from"../../rest/support/Query.js";import f from"../../rest/support/RelationshipQuery.js";const y=new o({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function m(t,e,r,o){const a=await L(t);if(await h(t,e,o),!a.addAttachment)throw new n(o,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function h(t,e,r){const{attributes:o}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?o?a&&o[a]?Promise.resolve():Promise.reject(new n(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new n(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new n(r,"A feature is required to add/delete/update attachments")):Promise.reject(new n(r,"this layer doesn't support attachments"))}async function w(t,e,r,o,a){const s=await L(t);if(await h(t,e,a),!s.updateAttachment)throw new n(a,"Layer source does not support updateAttachment capability");return s.updateAttachment(e,r,o)}async function b(t,e,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await t.load();let a=r;return"feature"===o.type&&o.infoFor3D&&null!=e.deleteFeatures&&null!=o.globalIdField&&(a={...a,globalIdToObjectId:await J(o,e.deleteFeatures,o.globalIdField)}),n(o,o.source,e,r)}async function g(t,e,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await t.load();return n(o,o.source,e,r)}async function j(t,e,r,o){const a=await L(t);if(await h(t,e,o),!a.deleteAttachments)throw new n(o,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function I(t,e,r){const o=(await t.load({signal:e?.signal})).source;if(!o.fetchRecomputedExtents)throw new n(r,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(e)}async function q(t,e,r,o){e=p.from(e),await t.load();const a=t.source,s=t.capabilities;if(!s?.data?.supportsAttachment)throw new n(o,"this layer doesn't support attachments");const{attachmentTypes:i,objectIds:u,globalIds:l,num:c,size:d,start:f,where:y}=e;if(!s?.operations?.supportsQueryAttachments){if(i?.length>0||l?.length>0||d?.length>0||c||f||y)throw new n(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(u?.length||l?.length||y))throw new n(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new n(o,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function F(t,e,r,o){const a=await L(t);if(!a.queryObjectIds)throw new n(o,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(d.from(e)??t.createQuery(),r)}async function A(t,e,r,o){const a=await L(t);if(!a.queryFeatureCount)throw new n(o,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(d.from(e)??t.createQuery(),r)}async function O(t,e,r,o){const a=await L(t);if(!a.queryExtent)throw new n(o,"Layer source does not support queryExtent capability");return a.queryExtent(d.from(e)??t.createQuery(),r)}async function P(t,e,r,o){const a=await L(t);if(!a.queryRelatedFeatures)throw new n(o,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(f.from(e),r)}async function S(t,e,r,o){const a=await L(t);if(!a.queryRelatedFeaturesCount)throw new n(o,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(f.from(e),r)}async function E(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(null!=n&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await a(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function x(t){const e=new d,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=t.returnZ&&(e.returnZ=t.returnZ),r.supportsM&&null!=t.returnM&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:o,timeExtent:a}=t;return e.timeExtent=null!=o&&null!=a?a.offset(-o.value,o.unit):a||null,e.multipatchOption="multipatch"===t.geometryType?"xyFootprint":null,e}function R(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function M(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function C(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function G(t,e){const{subtypes:r,subtypeField:n}=t;if(!e||!r?.length||!n)return null;const o=e.attributes[n];return null==o?null:r.find((t=>t.code===o))}async function L(t){return(await t.load()).source}async function Q(e,r){if(!t)return;if(t.findCredential(e))return;let n;try{const o=await u(e,r);o&&(n=await t.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await t.getCredential(e,{signal:n})}catch(o){}}async function T(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await Q(n,r)}function v(t){return!t.sourceJSON?.isMultiServicesView&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const D=s({types:e});function U(t,e){if(t.defaultSymbol)return t.types?.length?new c({defaultSymbol:D(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map((t=>({id:t.id,symbol:D(t.symbol,t,e)})))}):new l({symbol:D(t.defaultSymbol,t,e)})}function V(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return null==r||(e*=1e3,Date.now()-r<e)}async function J(t,e,n){if(null==e)return null;const o=[],{objectIdField:a}=t;if(e.forEach((t=>{let e=null;if("attributes"in t){const{attributes:r}=t;e={globalId:r[n],objectId:null!=r[a]&&-1!==r[a]?r[a]:null}}else e={globalId:t.globalId,objectId:null!=t.objectId&&-1!==t.objectId?t.objectId:null};null!=e.globalId&&(null!=e.objectId&&-1!==e.objectId||o.push(e.globalId))})),0===o.length)return null;const s=t.createQuery();s.where=o.map((t=>`${n}='${t}'`)).join(" OR "),s.returnGeometry=!1,s.outFields=[a,n],s.cacheHint=!1;const u=await r(i(t,s));if(!u.ok)return null;const l=new Map,c=u.value.features;for(const r of c){const t=r.attributes[n],e=r.attributes[a];null!=t&&null!=e&&-1!==e&&l.set(t,e)}return l}function N(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return null==n?null:t.find((t=>{const{id:e}=t;return null!=e&&e.toString()===n.toString()}))??null}export{m as addAttachment,b as applyEdits,v as computeEffectiveEditingEnabled,U as createDefaultRenderer,x as createQuery,j as deleteAttachments,Q as ensureCredentialIfSignedIn,T as ensureLayerCredential,I as fetchRecomputedExtents,y as geometryTypeKebabDict,G as getFeatureSubtype,N as getFeatureType,J as getGlobalIdToObjectIdMap,E as hasDataChanged,V as isLayerCacheStale,q as queryAttachments,O as queryExtent,A as queryFeatureCount,F as queryObjectIds,P as queryRelatedFeatures,S as queryRelatedFeaturesCount,R as readGlobalIdField,M as readObjectIdField,C as readVersion,w as updateAttachment,g as uploadAssets};
5
+ import{id as t}from"../../kernel.js";import{symbolTypesRenderer as e}from"../../symbols.js";import{resultOrAbort as r}from"../../core/asyncUtils.js";import n from"../../core/Error.js";import{JSONMap as o}from"../../core/jsonMap.js";import{parseWhereClause as a}from"../../core/sql.js";import{createTypeReader as i}from"../../core/accessorSupport/extensions/serializableProperty/reader.js";import{queryAllJSON as s}from"./featureQueryAll.js";import{getOwningPortalUrl as u}from"./layerUtils.js";import l from"../../renderers/SimpleRenderer.js";import c from"../../renderers/UniqueValueRenderer.js";import p from"../../rest/support/AttachmentQuery.js";import d from"../../rest/support/Query.js";import f from"../../rest/support/RelationshipQuery.js";const y=new o({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"});async function m(t,e,r,o){const a=await G(t);if(await h(t,e,o),!a.addAttachment)throw new n(o,"Layer source does not support addAttachment capability");return a.addAttachment(e,r)}function h(t,e,r){const{attributes:o}=e,{objectIdField:a}=t;return t.capabilities?.data?.supportsAttachment?e?o?a&&o[a]?Promise.resolve():Promise.reject(new n(r,`feature is missing the identifying attribute ${a}`)):Promise.reject(new n(r,"'attributes' are required on a feature to query attachments")):Promise.reject(new n(r,"A feature is required to add/delete/update attachments")):Promise.reject(new n(r,"this layer doesn't support attachments"))}async function w(t,e,r,o,a){const i=await G(t);if(await h(t,e,a),!i.updateAttachment)throw new n(a,"Layer source does not support updateAttachment capability");return i.updateAttachment(e,r,o)}async function b(t,e,r){const{applyEdits:n}=await import("../graphics/editingSupport.js"),o=await t.load();let a=r;return"feature"===o.type&&o.infoFor3D&&null!=e.deleteFeatures&&null!=o.globalIdField&&(a={...a,globalIdToObjectId:await J(o,e.deleteFeatures,o.globalIdField)}),n(o,o.source,e,r)}async function g(t,e,r){const{uploadAssets:n}=await import("../graphics/editingSupport.js"),o=await t.load();return n(o,o.source,e,r)}async function j(t,e,r,o){const a=await G(t);if(await h(t,e,o),!a.deleteAttachments)throw new n(o,"Layer source does not support deleteAttachments capability");return a.deleteAttachments(e,r)}async function I(t,e,r){const o=(await t.load({signal:e?.signal})).source;if(!o.fetchRecomputedExtents)throw new n(r,"Layer source does not support fetchUpdates capability");return o.fetchRecomputedExtents(e)}async function q(t,e,r,o){e=p.from(e),await t.load();const a=t.source,i=t.capabilities;if(!i?.data?.supportsAttachment)throw new n(o,"this layer doesn't support attachments");const{attachmentTypes:s,objectIds:u,globalIds:l,num:c,size:d,start:f,where:y}=e;if(!i?.operations?.supportsQueryAttachments){if(s?.length>0||l?.length>0||d?.length>0||c||f||y)throw new n(o,"when 'capabilities.operations.supportsQueryAttachments' is false, only objectIds is supported",e)}if(!(u?.length||l?.length||y))throw new n(o,"'objectIds', 'globalIds', or 'where' are required to perform attachment query",e);if(!a.queryAttachments)throw new n(o,"Layer source does not support queryAttachments capability",e);return a.queryAttachments(e)}async function F(t,e,r,o){const a=await G(t);if(!a.queryObjectIds)throw new n(o,"Layer source does not support queryObjectIds capability");return a.queryObjectIds(d.from(e)??t.createQuery(),r)}async function A(t,e,r,o){const a=await G(t);if(!a.queryFeatureCount)throw new n(o,"Layer source does not support queryFeatureCount capability");return a.queryFeatureCount(d.from(e)??t.createQuery(),r)}async function O(t,e,r,o){const a=await G(t);if(!a.queryExtent)throw new n(o,"Layer source does not support queryExtent capability");return a.queryExtent(d.from(e)??t.createQuery(),r)}async function P(t,e,r,o){const a=await G(t);if(!a.queryRelatedFeatures)throw new n(o,"Layer source does not support queryRelatedFeatures capability");return a.queryRelatedFeatures(f.from(e),r)}async function S(t,e,r,o){const a=await G(t);if(!a.queryRelatedFeaturesCount)throw new n(o,"Layer source does not support queryRelatedFeaturesCount capability");return a.queryRelatedFeaturesCount(f.from(e),r)}async function E(t){const e=t.source;if(e?.refresh)try{const{dataChanged:r,updates:n}=await e.refresh();if(null!=n&&(t.sourceJSON={...t.sourceJSON,...n},t.read(n,{origin:"service",url:t.parsedUrl})),r)return!0}catch{}if(t.definitionExpression)try{return(await a(t.definitionExpression,t.fieldsIndex)).hasDateFunctions}catch{}return!1}function x(t){const e=new d,r=t.capabilities?.data,n=t.capabilities?.query;e.historicMoment=t.historicMoment,e.gdbVersion=t.gdbVersion,e.returnGeometry=!0,n&&(e.compactGeometryEnabled=n.supportsCompactGeometry,e.defaultSpatialReferenceEnabled=n.supportsDefaultSpatialReference),r&&(r.supportsZ&&null!=t.returnZ&&(e.returnZ=t.returnZ),r.supportsM&&null!=t.returnM&&(e.returnM=t.returnM)),e.outFields=["*"];const{timeOffset:o,timeExtent:a}=t;return e.timeExtent=null!=o&&null!=a?a.offset(-o.value,o.unit):a||null,e.multipatchOption="multipatch"===t.geometryType?"xyFootprint":null,e}function R(t){const{globalIdField:e,fields:r}=t;if(e)return e;if(r)for(const n of r)if("esriFieldTypeGlobalID"===n.type)return n.name}function M(t){const{objectIdField:e,fields:r}=t;if(e)return e;if(r)for(const n of r)if("esriFieldTypeOID"===n.type)return n.name}function C(t){return t.currentVersion?t.currentVersion:t.hasOwnProperty("capabilities")||t.hasOwnProperty("drawingInfo")||t.hasOwnProperty("hasAttachments")||t.hasOwnProperty("htmlPopupType")||t.hasOwnProperty("relationships")||t.hasOwnProperty("timeInfo")||t.hasOwnProperty("typeIdField")||t.hasOwnProperty("types")?10:9.3}function L(t,e){const{subtypes:r,subtypeField:n}=t;if(!e||!r?.length||!n)return null;const o=e.attributes[n];return null==o?null:r.find((t=>t.code===o))}async function G(t){return(await t.load()).source}async function Q(e,r){if(!t)return;if(t.findCredential(e))return;let n;try{const o=await u(e,r);o&&(n=await t.checkSignInStatus(`${o}/sharing`))}catch(o){}if(n)try{const n=null!=r?r.signal:null;await t.getCredential(e,{signal:n})}catch(o){}}async function T(t,e,r){const n=t.parsedUrl?.path;n&&t.authenticationTriggerEvent===e&&await Q(n,r)}function v(t){return!Z(t)&&(t.userHasUpdateItemPrivileges||t.editingEnabled)}const D=i({types:e});function U(t,e){if(t.defaultSymbol)return t.types?.length?new c({defaultSymbol:D(t.defaultSymbol,t,e),field:t.typeIdField,uniqueValueInfos:t.types.map((t=>({id:t.id,symbol:D(t.symbol,t,e)})))}):new l({symbol:D(t.defaultSymbol,t,e)})}function V(t){let e=t.sourceJSON?.cacheMaxAge;if(!e)return!1;const r=t.editingInfo?.lastEditDate?.getTime();return null==r||(e*=1e3,Date.now()-r<e)}async function J(t,e,n){if(null==e)return null;const o=[],{objectIdField:a}=t;if(e.forEach((t=>{let e=null;if("attributes"in t){const{attributes:r}=t;e={globalId:r[n],objectId:null!=r[a]&&-1!==r[a]?r[a]:null}}else e={globalId:t.globalId,objectId:null!=t.objectId&&-1!==t.objectId?t.objectId:null};null!=e.globalId&&(null!=e.objectId&&-1!==e.objectId||o.push(e.globalId))})),0===o.length)return null;const i=t.createQuery();i.where=o.map((t=>`${n}='${t}'`)).join(" OR "),i.returnGeometry=!1,i.outFields=[a,n],i.cacheHint=!1;const u=await r(s(t,i));if(!u.ok)return null;const l=new Map,c=u.value.features;for(const r of c){const t=r.attributes[n],e=r.attributes[a];null!=t&&null!=e&&-1!==e&&l.set(t,e)}return l}function N(t,e,r){if(!e||!r||!t)return null;const n=r.getAttribute(e);return null==n?null:t.find((t=>{const{id:e}=t;return null!=e&&e.toString()===n.toString()}))??null}function Z(t){return t.sourceJSON?.isMultiServicesView||$(t)}function $(t){return!!t.sourceJSON?.capabilities?.toLowerCase().split(",").map((t=>t.trim())).includes("map")}export{m as addAttachment,b as applyEdits,v as computeEffectiveEditingEnabled,U as createDefaultRenderer,x as createQuery,j as deleteAttachments,Q as ensureCredentialIfSignedIn,T as ensureLayerCredential,I as fetchRecomputedExtents,y as geometryTypeKebabDict,L as getFeatureSubtype,N as getFeatureType,J as getGlobalIdToObjectIdMap,E as hasDataChanged,V as isLayerCacheStale,q as queryAttachments,O as queryExtent,A as queryFeatureCount,F as queryObjectIds,P as queryRelatedFeatures,S as queryRelatedFeaturesCount,R as readGlobalIdField,M as readObjectIdField,C as readVersion,Z as supportsQueryOnly,w as updateAttachment,g as uploadAssets};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "4.31.0-next.20240619",
3
+ "version": "4.31.0-next.20240621",
4
4
  "homepage": "https://js.arcgis.com",
5
5
  "description": "ArcGIS Maps SDK for JavaScript: A complete 2D and 3D mapping and data visualization API",
6
6
  "keywords": [