@arcgis/core 5.1.0-next.113 → 5.1.0-next.114

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (204) hide show
  1. package/Graphic.d.ts +1 -0
  2. package/assets/esri/core/workers/RemoteClient.js +1 -1
  3. package/assets/esri/core/workers/chunks/{31a8bc25aa1441c70caa.js → 009250a7bded12099dd1.js} +1 -1
  4. package/assets/esri/core/workers/chunks/019a4fe7e085b2fc6ae9.js +1 -0
  5. package/assets/esri/core/workers/chunks/023837e5d9d2b6af66d8.js +1 -0
  6. package/assets/esri/core/workers/chunks/{a001e7e8a39f27284d87.js → 03c46880b69ce75a010f.js} +1 -1
  7. package/assets/esri/core/workers/chunks/0a530fbbb4486c670ea2.js +1 -0
  8. package/assets/esri/core/workers/chunks/{14b7b55c42af65ffa024.js → 0bd2b035c6ee89c725f9.js} +1 -1
  9. package/assets/esri/core/workers/chunks/0ded5c114cbb7574f2f4.js +1 -0
  10. package/assets/esri/core/workers/chunks/{b432a5a829e309837db6.js → 0e549d942d6cba1608cf.js} +1 -1
  11. package/assets/esri/core/workers/chunks/{7dafe608c224b9d48ffa.js → 115664cb7d7b22a315bb.js} +1 -1
  12. package/assets/esri/core/workers/chunks/123a67e84ed68b96ac59.js +1 -0
  13. package/assets/esri/core/workers/chunks/14a241b07baa67743248.js +1 -0
  14. package/assets/esri/core/workers/chunks/{054ae729e7cefa2c7778.js → 170f8dc97614e9609443.js} +1 -1
  15. package/assets/esri/core/workers/chunks/179ffa2168c42615ccf2.js +1 -0
  16. package/assets/esri/core/workers/chunks/{4a65bc9091d7ea7e80df.js → 19f07c8d0f32ec889861.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{ca92176d5348e2c533d7.js → 224a9f39876aa426a9bc.js} +1 -1
  18. package/assets/esri/core/workers/chunks/{0550dc63b6b1274242b8.js → 27d7c701306efeea6b82.js} +1 -1
  19. package/assets/esri/core/workers/chunks/{8aac1155b8ac071cd2ad.js → 2855357a2c1f2ab03fb7.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{33329f5d88e60b4ec568.js → 2a8f198f6c272f92bad5.js} +1 -1
  21. package/assets/esri/core/workers/chunks/{cb3004998eff7c60930e.js → 2b2a09ce14d00b4b1187.js} +1 -1
  22. package/assets/esri/core/workers/chunks/{5d60253ea3d247cdb3d1.js → 2bdfae998371e3aa9f2d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/2f99a95facddc44319a9.js +1 -0
  24. package/assets/esri/core/workers/chunks/{bd17ac2e6f1eb8cf7abf.js → 2fa080539d039c92ce08.js} +1 -1
  25. package/assets/esri/core/workers/chunks/{ee635172be7fdea69367.js → 3109b05fe4fc40d4f25b.js} +1 -1
  26. package/assets/esri/core/workers/chunks/{92db9a6d273ae2862883.js → 315bf08dff4757ffbed3.js} +1 -1
  27. package/assets/esri/core/workers/chunks/{593772bd8b19ac664b29.js → 35527a01d61cabbfd33e.js} +1 -1
  28. package/assets/esri/core/workers/chunks/{52a91c314afec70199bc.js → 39987c06636e757d1f00.js} +1 -1
  29. package/assets/esri/core/workers/chunks/41074d383af3662673ca.js +1 -0
  30. package/assets/esri/core/workers/chunks/49675e77a351abda2728.js +1 -0
  31. package/assets/esri/core/workers/chunks/4bfeac7338df9e0b7ce1.js +1 -0
  32. package/assets/esri/core/workers/chunks/4ffcca40e7aa24c8cc35.js +1 -0
  33. package/assets/esri/core/workers/chunks/534dd93c72ea448ee908.js +1 -0
  34. package/assets/esri/core/workers/chunks/{2dc2487d05381de07e3f.js → 548c34ea88f113d03c93.js} +1 -1
  35. package/assets/esri/core/workers/chunks/{77ac243d4dcd901c2eec.js → 621d71d26bd20e296138.js} +1 -1
  36. package/assets/esri/core/workers/chunks/{7e203e947846d40f897e.js → 67dffb896b6ef4b2038b.js} +1 -1
  37. package/assets/esri/core/workers/chunks/6920e7f700a9ba280dba.js +1 -0
  38. package/assets/esri/core/workers/chunks/696967c8c6f53b94f851.js +1 -0
  39. package/assets/esri/core/workers/chunks/6b1f2b36bdc6b2ff2ea5.js +1 -0
  40. package/assets/esri/core/workers/chunks/7014e73dfd3c8baa704c.js +1 -0
  41. package/assets/esri/core/workers/chunks/75dfdd85abbac26ac899.js +1 -0
  42. package/assets/esri/core/workers/chunks/76a9b64fd573775bf6cd.js +1 -0
  43. package/assets/esri/core/workers/chunks/798c4d3201fcc9f2a42b.js +1 -0
  44. package/assets/esri/core/workers/chunks/{6c79e8e840c1d027fbb2.js → 7e0daf0864005cdd63c5.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{c0c693c2e0043ecba4a5.js → 817fd88fe9a48caf69fb.js} +1 -1
  46. package/assets/esri/core/workers/chunks/82f7d83a2073d1b0111c.js +1 -0
  47. package/assets/esri/core/workers/chunks/8795c4895df229cb471c.js +1 -0
  48. package/assets/esri/core/workers/chunks/{7bc746ea17f4e336e0b0.js → 8b5ee6be52e892fbd325.js} +1 -1
  49. package/assets/esri/core/workers/chunks/927c8ca7fd385b28a1b7.js +640 -0
  50. package/assets/esri/core/workers/chunks/942e527b9b92999886c7.js +1 -0
  51. package/assets/esri/core/workers/chunks/961995d8da45a9203255.js +1 -0
  52. package/assets/esri/core/workers/chunks/{eb1d6614eeac6d26bb9c.js → 9a3344f1dd22c425b8cc.js} +1 -1
  53. package/assets/esri/core/workers/chunks/9a6e62ef984e9c5babc4.js +1 -0
  54. package/assets/esri/core/workers/chunks/a0b6eef4890cc61609dc.js +1 -0
  55. package/assets/esri/core/workers/chunks/{f37be7e517f0892014e3.js → a320c69bc7528ff0d0cf.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{660713adb5a845dfa2ef.js → a40003dfe3c081d1a1d2.js} +1 -1
  57. package/assets/esri/core/workers/chunks/b5937ce657c1fff3864f.js +1 -0
  58. package/assets/esri/core/workers/chunks/{63ea9035dcf9ce45560c.js → b684ff4bc93bd60d6a19.js} +1 -1
  59. package/assets/esri/core/workers/chunks/b7a0a5b895ddd2d3d038.js +1 -0
  60. package/assets/esri/core/workers/chunks/{f3161c47a572194f6017.js → c06ae3a6ecc4a4fc67b2.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{970e91de5dfbbc247afb.js → c5b7ff8650235c464dbf.js} +1 -1
  62. package/assets/esri/core/workers/chunks/c8dedc010fcc2382af24.js +1 -0
  63. package/assets/esri/core/workers/chunks/cd2b2babcdc130b4c368.js +1 -0
  64. package/assets/esri/core/workers/chunks/{5a6523c903b11dea77d4.js → cdef9c3f80588ae45a04.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{e973cab79ec2541cb81b.js → d19600336cb6023d3e34.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{34c11e7c8762fe0c19fb.js → d39f5590022d910ee951.js} +1 -1
  67. package/assets/esri/core/workers/chunks/d412a43060441d347fb4.js +1 -0
  68. package/assets/esri/core/workers/chunks/{01c70c27aa3a955e2928.js → d41b847d08c42e5329d6.js} +2 -2
  69. package/assets/esri/core/workers/chunks/{10491b5b106bc5ad0b2b.js → d66f68a811c90739951a.js} +1 -1
  70. package/assets/esri/core/workers/chunks/d8c2bed12f937228c763.js +1 -0
  71. package/assets/esri/core/workers/chunks/de916dd0c11aefb6832e.js +1 -0
  72. package/assets/esri/core/workers/chunks/{63513e706fe55a1def15.js → e227ae2c1a63e30e62d9.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{e4c350dc65aae121171d.js → e29d182460564c2a52ad.js} +1 -1
  74. package/assets/esri/core/workers/chunks/e87d02af6d6b05e19d93.js +1 -0
  75. package/assets/esri/core/workers/chunks/f0b5c140a5ba174572b6.js +1 -0
  76. package/assets/esri/core/workers/chunks/{ce3b5b83237cf37ff523.js → f286680e363eefdf27df.js} +1 -1
  77. package/assets/esri/core/workers/chunks/f7698c855800e0af3038.js +1 -0
  78. package/assets/esri/core/workers/chunks/f931d560f3f14598f454.js +1 -0
  79. package/assets/esri/core/workers/chunks/{9890c85a238879490926.js → f9f331c76c96743d8522.js} +1 -1
  80. package/assets/esri/core/workers/chunks/fcbacca99c5a3ee5b69a.js +1 -0
  81. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core-simd.wasm +0 -0
  82. package/assets/esri/rest/knowledgeGraph/wasmInterface/arcgis-knowledge-client-core.wasm +0 -0
  83. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery.json +1 -1
  84. package/assets/esri/widgets/BasemapGallery/t9n/BasemapGallery_en.json +1 -1
  85. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  86. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  87. package/chunks/Path.glsl.js +22 -17
  88. package/config.js +1 -1
  89. package/geometry/support/DoubleArray.js +1 -1
  90. package/geometry/support/Indices.js +1 -1
  91. package/kernel.js +1 -1
  92. package/layers/DimensionLayer.d.ts +22 -0
  93. package/layers/FeatureLayer.d.ts +15 -12
  94. package/layers/FeatureLayer.js +1 -1
  95. package/layers/GaussianSplatLayer.d.ts +22 -0
  96. package/layers/LineOfSightLayer.d.ts +22 -0
  97. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  98. package/layers/PointCloudLayer.d.ts +22 -0
  99. package/layers/ViewshedLayer.d.ts +22 -0
  100. package/layers/support/Field.d.ts +1 -0
  101. package/layers/support/Field.js +1 -1
  102. package/layers/support/SceneModification.js +1 -1
  103. package/layers/support/types.d.ts +1 -1
  104. package/layers/types.d.ts +1 -0
  105. package/package.json +1 -1
  106. package/rest/support/Query.d.ts +1 -0
  107. package/support/revision.js +1 -1
  108. package/symbols/cim/animationUtils.js +1 -1
  109. package/symbols/cim/defaultCIMValues.js +1 -1
  110. package/views/2d/engine/vectorTiles/VectorTileContainer.js +1 -1
  111. package/views/2d/engine/webgl/animations/instructions.js +1 -1
  112. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  113. package/views/2d/layers/FeatureLikeLayerView2D.js +1 -1
  114. package/views/2d/layers/features/layerAdapters/CatalogFootprintLayerAdapter.js +1 -1
  115. package/views/2d/layers/features/layerAdapters/DimensionLayerAdapter.js +1 -1
  116. package/views/2d/layers/features/layerAdapters/FeatureLayerAdapter.js +1 -1
  117. package/views/2d/layers/features/layerAdapters/InMemoryLayerAdapter.js +1 -1
  118. package/views/2d/layers/features/layerAdapters/KnowledgeGraphSublayerAdapter.js +1 -1
  119. package/views/2d/layers/features/layerAdapters/OGCFeatureLayerAdapter.js +1 -1
  120. package/views/2d/layers/features/layerAdapters/OrientedImageryLayerAdapter.js +1 -1
  121. package/views/2d/layers/features/layerAdapters/ParquetLayerAdapter.js +1 -1
  122. package/views/2d/layers/features/layerAdapters/StreamLayerAdapter.js +1 -1
  123. package/views/2d/layers/features/layerAdapters/SubtypeGroupLayerAdapter.js +1 -1
  124. package/views/2d/support/clippingUtils.js +1 -1
  125. package/views/2d/support/hitTestUtils.js +1 -1
  126. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  127. package/views/3d/input/SceneInputManager.js +1 -1
  128. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  129. package/views/3d/layers/IntegratedMesh3DTilesLayerWorkerHandle.js +1 -1
  130. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  131. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  132. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  133. package/views/3d/layers/graphics/Graphics3DSymbolLayer.js +1 -1
  134. package/views/3d/layers/graphics/extrudeUtils.js +1 -1
  135. package/views/3d/layers/graphics/tessellationUtils.js +1 -1
  136. package/views/3d/support/engineContent/line.js +1 -1
  137. package/views/3d/support/renderInfoUtils/polygon.js +1 -1
  138. package/views/3d/webgl-engine/core/shaderLibrary/TextureBackedBufferFields.glsl.js +3 -3
  139. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathEvaluate.glsl.js +233 -0
  140. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexInfo.glsl.js +19 -0
  141. package/views/3d/webgl-engine/core/shaderLibrary/attributes/PathVertexPosition.glsl.js +64 -40
  142. package/views/3d/webgl-engine/core/shaderModules/Float2sPassUniform.js +2 -0
  143. package/views/3d/webgl-engine/core/shaderModules/IntegersPassUniform.js +2 -0
  144. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  145. package/views/3d/webgl-engine/lib/PathEvaluator.js +1 -1
  146. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  147. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  148. package/views/3d/webgl-engine/lib/PathProfile.js +1 -1
  149. package/views/3d/webgl-engine/lib/TextureBackedBuffer/TextureBackedBufferFieldCreation.js +1 -1
  150. package/views/3d/webgl-engine/materials/PathLayouts.js +1 -1
  151. package/views/3d/webgl-engine/materials/PathMaterial.js +1 -1
  152. package/views/3d/webgl-engine/materials/PathTechniqueConfiguration.js +1 -1
  153. package/views/3d/webgl-engine/materials/internal/bufferWriterUtils.js +1 -1
  154. package/views/View2D.d.ts +1 -1
  155. package/views/draw/DrawTool.d.ts +34 -1
  156. package/views/input/EventMatch.js +1 -1
  157. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  158. package/widgets/BatchAttributeForm.js +1 -1
  159. package/widgets/Directions/DirectionsViewModel.js +1 -1
  160. package/widgets/Directions.js +1 -1
  161. package/widgets/FeatureTable/FeatureTableViewModel.d.ts +7 -1
  162. package/widgets/FeatureTable/FeatureTableViewModel.js +1 -1
  163. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  164. package/widgets/FeatureTable/support/types.d.ts +11 -1
  165. package/widgets/FeatureTable.d.ts +7 -1
  166. package/widgets/FeatureTable.js +1 -1
  167. package/assets/esri/core/workers/chunks/02c0640005b09007bb70.js +0 -1
  168. package/assets/esri/core/workers/chunks/0c8e6ccb5a8174718d62.js +0 -640
  169. package/assets/esri/core/workers/chunks/13f0e08de2dfab07d212.js +0 -1
  170. package/assets/esri/core/workers/chunks/1c0e8808d14d8e6dde2c.js +0 -1
  171. package/assets/esri/core/workers/chunks/1c8c8050d60205cf2156.js +0 -1
  172. package/assets/esri/core/workers/chunks/23119a1b1310b7dab2aa.js +0 -1
  173. package/assets/esri/core/workers/chunks/282f3d364411efac7b80.js +0 -1
  174. package/assets/esri/core/workers/chunks/2ffffc1931b2e27c6617.js +0 -1
  175. package/assets/esri/core/workers/chunks/313a89b334e3518d30a4.js +0 -1
  176. package/assets/esri/core/workers/chunks/389e57aab12d52d72695.js +0 -1
  177. package/assets/esri/core/workers/chunks/3fed503185ea1913fb84.js +0 -1
  178. package/assets/esri/core/workers/chunks/4020f95d8131493f799e.js +0 -1
  179. package/assets/esri/core/workers/chunks/4255ad7601c7a7621b71.js +0 -1
  180. package/assets/esri/core/workers/chunks/453c3b265481c80fc625.js +0 -1
  181. package/assets/esri/core/workers/chunks/4a41f98210f1da3b5041.js +0 -1
  182. package/assets/esri/core/workers/chunks/4afe76de6e82e86fe697.js +0 -1
  183. package/assets/esri/core/workers/chunks/5a85cbc04c64091d7f46.js +0 -1
  184. package/assets/esri/core/workers/chunks/5e5c7cc74ff1c9603aff.js +0 -1
  185. package/assets/esri/core/workers/chunks/601edefd8da4eb2eda28.js +0 -1
  186. package/assets/esri/core/workers/chunks/6f02681bcaa9bef501fc.js +0 -1
  187. package/assets/esri/core/workers/chunks/7b66691d133dabd87ce6.js +0 -1
  188. package/assets/esri/core/workers/chunks/7c077e1a63ab97bf3e87.js +0 -1
  189. package/assets/esri/core/workers/chunks/7dc9ff66e1eceadbae24.js +0 -1
  190. package/assets/esri/core/workers/chunks/85a200aecc7a844c9566.js +0 -1
  191. package/assets/esri/core/workers/chunks/958617c3a9854ea04e06.js +0 -1
  192. package/assets/esri/core/workers/chunks/a5b9ae4c93f9af7589f2.js +0 -1
  193. package/assets/esri/core/workers/chunks/a93a058678c8c8996d54.js +0 -1
  194. package/assets/esri/core/workers/chunks/acb8cff06142f828fb78.js +0 -1
  195. package/assets/esri/core/workers/chunks/b4badbcf1bdb7823d825.js +0 -1
  196. package/assets/esri/core/workers/chunks/b891d95b7858665cd6c1.js +0 -1
  197. package/assets/esri/core/workers/chunks/c91d4f1b42cfe474df52.js +0 -1
  198. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +0 -1
  199. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +0 -1
  200. package/assets/esri/core/workers/chunks/e393fd61deb2e7f22ee6.js +0 -1
  201. package/assets/esri/core/workers/chunks/e8518bd3596543b387f8.js +0 -1
  202. package/assets/esri/core/workers/chunks/ee56290e600cbeb25a00.js +0 -1
  203. package/assets/esri/core/workers/chunks/f91a2c69a93295cf4de6.js +0 -1
  204. package/assets/esri/core/workers/chunks/fec3fffcf854a6226df4.js +0 -1
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import E from"../graphic/FeatureGraphicOrigin.js";import L from"./Layer.js";import{MemorySource as D}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as x}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as q}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as A}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as Q}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as R}from"./mixins/OperationalLayer.js";import{OrderedLayer as U}from"./mixins/OrderedLayer.js";import{PortalLayer as V}from"./mixins/PortalLayer.js";import{PublishableLayer as N}from"./mixins/PublishableLayer.js";import{RefreshableLayer as G}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as J}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as B}from"./mixins/TemporalLayer.js";import{TrackableLayer as W}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as H,parse as Z,cleanTitle as $}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as k,id as z,labelsVisible as K,opacityDrawingInfo as X,legendEnabled as Y,listMode as ee,popupEnabled as te,screenSizePerspectiveEnabled as re}from"./support/commonProperties.js";import{ensureLayerCredential as ie,computeEffectiveEditingEnabled as oe,readGlobalIdField as se,readObjectIdField as ae,createDefaultRenderer as ne,addAttachment as le,updateAttachment as pe,applyEdits as ue,uploadAssets as de,createQuery as ye,deleteAttachments as ce,fetchRecomputedExtents as me,getFeatureType as he,getFieldDomain as fe,queryAttachments as be,queryObjectIds as ge,queryFeatureCount as we,queryExtent as ve,queryRelatedFeatures as Fe,queryRelatedFeaturesCount as Te,validateBinsQuery as je,hasDataChanged as Se,geometryTypeKebabDict as Ie}from"./support/featureLayerUtils.js";import Ee from"./support/FeatureTemplate.js";import Le from"./support/FeatureType.js";import De from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as _e,fieldConfigurationsFromPopupTemplate as Ce,fieldConfigurationsFromFields as Pe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Oe}from"./support/fieldProperties.js";import{fixRendererFields as xe,fixTimeInfoFields as qe}from"./support/fieldUtils.js";import Me from"./support/LabelClass.js";import{reader as Ae}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Qe}from"./support/serviceCapabilitiesUtils.js";import Re from"./support/SymbolLayerDrawing.js";import Ue from"./support/TimeInfo.js";import Ve from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ne}from"./support/versionUtils.js";import{read as Ge}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Je}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Be,rendererTypes as We}from"../renderers/support/typeUtils.js";import He from"../rest/layerSources/DynamicDataLayer.js";import Ze from"../rest/support/FeatureSet.js";import $e from"../rest/support/Query.js";import{isNumber as ke}from"../support/guards.js";import{createPopupTemplate as ze}from"../support/popupUtils.js";import{symbolTypes as Ke}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Xe}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as Ye}from"../webdoc/support/unsupportedErrors.js";import{reader as et}from"../core/accessorSupport/decorators/reader.js";import{writer as tt}from"../core/accessorSupport/decorators/writer.js";const rt="FeatureLayer";function it(e){return e&&e instanceof a}const ot=Oe();function st(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let at=class extends(A(Q(M(N(q(x(P(U(B(W(J(G(C(R(V(m(O(_(s(L)))))))))))))))))))){constructor(...e){super(...e),this.reload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new E(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ie(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ve({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Qe(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return oe(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=_e(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Ce(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return se(t.layerDefinition||t)}readObjectIdField(e,t){return ae(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){xe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ge(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return ne(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new D({layer:this,items:e})),it(t)&&this._resetMemorySource(t),it(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=Ze.fromJSON(t.featureSet);return new D({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>Ee.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?H(this.url,r):r;let e=r;if(!e&&this.url){const t=Z(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),$(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Le.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await le(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await pe(this,e,t,r,rt);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return ue(this,e,t)}async uploadAssets(e,t){return de(this,e,t)}createFieldConfigurations(){return Pe(this)}createPopupTemplate(e){return ze(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ye(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await ce(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return me(this,e,rt)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return he(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return fe(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return be(this,e,t,rt)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures($e.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await ge(this,e,t,rt)}async queryFeatureCount(e,t){return we(this,e,t,rt)}async queryExtent(e,t){return ve(this,e,t,rt)}async queryRelatedFeatures(e,t){return Fe(this,e,t,rt)}async queryRelatedFeaturesCount(e,t){return Te(this,e,t,rt)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(rt,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(rt,"Layer source does not support queryAttributeBins capability");je(e,i,rt);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ke)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return Ye(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return Ye(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return Ye(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return Ye(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(rt,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ne(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),xe(this.renderer,this.fieldsIndex),qe(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Je(this,{origin:"service"})}async hasDataChanged(){return Se(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],at.prototype,"_titleCreator",null),r([F(k)],at.prototype,"attributeTableTemplate",void 0),r([et("service","capabilities")],at.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],at.prototype,"charts",void 0),r([F({readOnly:!0})],at.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],at.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],at.prototype,"displayField",void 0),r([F({types:Ke,readOnly:!0})],at.prototype,"defaultSymbol",void 0),r([F({type:He})],at.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],at.prototype,"editingEnabled",null),r([et(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],at.prototype,"readEditingEnabled",null),r([et("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],at.prototype,"readEditingEnabledFromWebMap",null),r([tt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabled",null),r([tt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],at.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],at.prototype,"featureTitleFields",null),r([F({type:[De],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],at.prototype,"fieldConfigurations",null),r([F({...ot.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:st}}}}})],at.prototype,"fields",void 0),r([F(ot.fieldsIndex)],at.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],at.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],at.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:st,writer(e,t,r){const i=e?Ie.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Ie.read}}})],at.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],at.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],at.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],at.prototype,"hasZ",void 0),r([F(z)],at.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],at.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],at.prototype,"isTable",void 0),r([et("service","isTable",["type","geometryType"]),et("isTable",["layerDefinition.type","layerDefinition.geometryType"])],at.prototype,"readIsTable",null),r([tt("web-map","isTable")],at.prototype,"writeIsTable",null),r([F(K)],at.prototype,"labelsVisible",void 0),r([F({type:[Me],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Ae,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Ae,write:{layerContainerTypes:j}}})],at.prototype,"labelingInfo",void 0),r([F({type:Re,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],at.prototype,"symbolLayerDrawing",void 0),r([F((()=>{const e=d(X);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Xe(e),t)}}},e})())],at.prototype,"opacity",void 0),r([F(Y)],at.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(ee.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],at.prototype,"listMode",void 0),r([et("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],at.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:st}}}}})],at.prototype,"objectIdField",void 0),r([et("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],at.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],at.prototype,"operationalLayerType",void 0),r([F(ot.outFields)],at.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],at.prototype,"path",void 0),r([F(te)],at.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],at.prototype,"popupTemplate",void 0),r([tt("popupTemplate")],at.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],at.prototype,"defaultPopupTemplate",null),r([F({types:We,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Be,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],at.prototype,"renderer",null),r([et("service","renderer",["drawingInfo.renderer","defaultSymbol"]),et("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],at.prototype,"readRenderer",null),r([F()],at.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(re);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],at.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],at.prototype,"source",null),r([et("portal-item","source",["featureSet"]),et("web-map","source",["featureSet"])],at.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],at.prototype,"spatialReference",void 0),r([F({type:Number})],at.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],at.prototype,"subtypeField",void 0),r([F({readOnly:!1})],at.prototype,"subtypes",void 0),r([F({type:[Ee]})],at.prototype,"templates",void 0),r([et("templates",["editFieldsInfo","creatorField","editorField","templates"])],at.prototype,"readTemplates",null),r([F({type:Ue})],at.prototype,"timeInfo",void 0),r([F()],at.prototype,"title",void 0),r([et("service","title",["name"]),et("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],at.prototype,"readTitle",null),r([et("web-map","title",["layerDefinition.name","title"])],at.prototype,"readTitleFromWebMap",null),r([F({type:String})],at.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],at.prototype,"type",void 0),r([F({type:String})],at.prototype,"typeIdField",void 0),r([et("service","typeIdField"),et("typeIdField",["layerDefinition.typeIdField"])],at.prototype,"readTypeIdField",null),r([F({type:[Le]})],at.prototype,"types",void 0),r([et("service","types",["types"]),et("types",["layerDefinition.types"])],at.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],at.prototype,"visible",void 0),r([et("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],at.prototype,"readVisible",null),at=r([T("esri.layers.FeatureLayer")],at);export{at as default};
2
+ import{__addDisposableResource as e,__disposeResources as t,__decorate as r}from"tslib";import i from"../PopupTemplate.js";import o from"../request.js";import{ClonableMixin as s}from"../core/Clonable.js";import a from"../core/Collection.js";import n from"../core/Error.js";import{disposable as l,makeHandle as p,abortHandle as u}from"../core/handleUtils.js";import{clone as d}from"../core/lang.js";import y from"../core/Logger.js";import{destroyMaybe as c}from"../core/maybe.js";import{MultiOriginJSONSupportMixin as m}from"../core/MultiOriginJSONSupport.js";import{setDeepValue as h}from"../core/object.js";import{debounce as f,throwIfAbortError as b,whenOrAbort as g,onAbort as w}from"../core/promiseUtils.js";import{sqlAnd as v}from"../core/sql.js";import{property as F,subclass as T}from"../core/accessorSupport/decorators.js";import{excludeTables as j}from"../core/accessorSupport/layerContainerType.js";import S from"../form/FormTemplate.js";import I from"../geometry/SpatialReference.js";import E from"../graphic/FeatureGraphicOrigin.js";import L from"./Layer.js";import{MemorySource as D}from"./graphics/sources/MemorySource.js";import{APIKeyMixin as _}from"./mixins/APIKeyMixin.js";import{ArcGISService as C}from"./mixins/ArcGISService.js";import{BlendLayer as P}from"./mixins/BlendLayer.js";import{CustomParametersMixin as O}from"./mixins/CustomParametersMixin.js";import{DisplayFilteredLayer as x}from"./mixins/DisplayFilteredLayer.js";import{EditBusLayer as q}from"./mixins/EditBusLayer.js";import{FeatureEffectLayer as M}from"./mixins/FeatureEffectLayer.js";import{FeatureLayerBase as A}from"./mixins/FeatureLayerBase.js";import{FeatureReductionLayer as R}from"./mixins/FeatureReductionLayer.js";import{OperationalLayer as Q}from"./mixins/OperationalLayer.js";import{OrderedLayer as U}from"./mixins/OrderedLayer.js";import{PortalLayer as V}from"./mixins/PortalLayer.js";import{PublishableLayer as N}from"./mixins/PublishableLayer.js";import{RefreshableLayer as G}from"./mixins/RefreshableLayer.js";import{ScaleRangeLayer as J}from"./mixins/ScaleRangeLayer.js";import{TemporalLayer as B}from"./mixins/TemporalLayer.js";import{TrackableLayer as W}from"./mixins/TrackableLayer.js";import{titleFromUrlAndName as H,parse as Z,cleanTitle as $}from"./support/arcgisLayerUrl.js";import{attributeTableTemplate as k,id as z,labelsVisible as K,opacityDrawingInfo as X,legendEnabled as Y,listMode as ee,popupEnabled as te,screenSizePerspectiveEnabled as re}from"./support/commonProperties.js";import{ensureLayerCredential as ie,computeEffectiveEditingEnabled as oe,readGlobalIdField as se,readObjectIdField as ae,createDefaultRenderer as ne,addAttachment as le,updateAttachment as pe,applyEdits as ue,uploadAssets as de,createQuery as ye,deleteAttachments as ce,fetchRecomputedExtents as me,getFeatureType as he,getFieldDomain as fe,queryAttachments as be,queryObjectIds as ge,queryFeatureCount as we,queryExtent as ve,queryRelatedFeatures as Fe,queryRelatedFeaturesCount as Te,validateBinsQuery as je,hasDataChanged as Se,geometryTypeKebabDict as Ie}from"./support/featureLayerUtils.js";import Ee from"./support/FeatureTemplate.js";import Le from"./support/FeatureType.js";import De from"./support/FieldConfiguration.js";import{popupTemplateWithFieldConfigurations as _e,fieldConfigurationsFromPopupTemplate as Ce,fieldConfigurationsFromFields as Pe}from"./support/fieldConfigUtils.js";import{defineFieldProperties as Oe}from"./support/fieldProperties.js";import{fixRendererFields as xe,fixTimeInfoFields as qe}from"./support/fieldUtils.js";import Me from"./support/LabelClass.js";import{reader as Ae}from"./support/labelingInfo.js";import{getFeatureLayerCapabilities as Re}from"./support/serviceCapabilitiesUtils.js";import Qe from"./support/SymbolLayerDrawing.js";import Ue from"./support/TimeInfo.js";import Ve from"./support/TitleCreator.js";import{serviceSupportsSpatialReference as Ne}from"./support/versionUtils.js";import{read as Ge}from"../renderers/support/jsonUtils.js";import{loadStyleRenderer as Je}from"../renderers/support/styleUtils.js";import{webSceneRendererTypes as Be,rendererTypes as We}from"../renderers/support/typeUtils.js";import He from"../rest/layerSources/DynamicDataLayer.js";import Ze from"../rest/support/FeatureSet.js";import $e from"../rest/support/Query.js";import{isNumber as ke}from"../support/guards.js";import{createPopupTemplate as ze}from"../support/popupUtils.js";import{symbolTypes as Ke}from"../symbols/support/typeUtils.js";import{opacityToTransparency as Xe}from"../webdoc/support/opacityUtils.js";import{addLayerUnsupportedError as Ye}from"../webdoc/support/unsupportedErrors.js";import{reader as et}from"../core/accessorSupport/decorators/reader.js";import{writer as tt}from"../core/accessorSupport/decorators/writer.js";const rt="FeatureLayer";function it(e){return e&&e instanceof a}const ot=Oe();function st(e,t,r){const i=!!r?.writeLayerSchema;return{enabled:i,ignoreOrigin:i}}let at=class extends(A(R(M(N(q(x(P(U(B(W(J(G(C(Q(V(m(O(_(s(L)))))))))))))))))))){constructor(...e){super(...e),this._debounceReload=f(async()=>{if(this.destroyed||!this.loaded||this._hasMemorySource())return!1;const e=new AbortController,t=u(e);this.addHandles(t,"reload"),this._set("reloading",!0);try{const t=await this.reloadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]});return t&&(this.sourceJSON=null,await this.initLayerProperties(await this.createGraphicsSource(e.signal))),e.signal.throwIfAborted(),t}finally{this.removeHandles("reload"),this._set("reloading",!1)}}),this.attributeTableTemplate=null,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.graphicOrigin=new E(this),this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.symbolLayerDrawing=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="ArcGISFeatureLayer",this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.reloading=!1,this.resourceInfo=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=I.WGS84,this.subtypeCode=null,this.subtypeField=null,this.subtypes=null,this.supportedSourceTypes=new Set(["Feature Layer","Oriented Imagery Layer","Table","Catalog Layer"]),this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0,this._debouncedSaveOperations=f(async(e,t,r)=>{const{save:i,saveAs:o}=await import("./save/featureLayerUtils.js");switch(e){case 0:return i(this,t);case 1:return o(this,r,t)}})}destroy(){this.source?.destroy()}normalizeCtorArgs(e,t){return"string"==typeof e?{url:e,...t}:e}load(e){const t=null!=e?e.signal:null;if(this.portalItem?.loaded&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(e=>this.initLayerProperties(e))),Promise.resolve(this);const r=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"]},e).catch(b).then(async()=>{if(this.url&&null==this.layerId&&/FeatureServer|MapServer\/*$/i.test(this.url)){const e=await this._fetchFirstValidLayerId(t);null!=e&&(this.layerId=e)}if(!this.url&&!this._hasMemorySource())throw new n("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>ie(this,"load",e));return this.addResolvingPromise(r),Promise.resolve(this)}reload(){return this._debounceReload()}get _titleCreator(){const e=this._get("_titleCreator");return c(e),new Ve({fieldsIndex:this.fieldsIndex,objectIdField:this.objectIdField,fields:this.fields,displayField:this.displayField,effectivePopupTemplate:this.popupTemplate??this.defaultPopupTemplate})}readCapabilities(e,t){return t=t.layerDefinition||t,Re(t,this.url)}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),(this._get("createQueryVersion")??0)+1}get editingEnabled(){return!(this.loaded&&!this.capabilities?.operations.supportsEditing)&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,r){return this._readEditingEnabled(t,!0,r)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,r,i){this._writeEditingEnabled(e,t,!0,i)}get effectiveEditingEnabled(){return oe(this)}get featureTitleFields(){return[...this._titleCreator.requiredFields]}set fieldConfigurations(e){if(this._hasMemorySource())return;if(this._override("fieldConfigurations",e),!this.loaded)return;const t=_e(this,e);t&&this._set("popupTemplate",t)}get fieldConfigurations(){if(!this._hasMemorySource())return this._isOverridden("fieldConfigurations")?this._get("fieldConfigurations"):Ce(this)||null}readIsTable(e,t){return"Table"===(t=t?.layerDefinition??t).type||!t.geometryType}writeIsTable(e,t,r,i){i?.writeLayerSchema&&h(r,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return se(t.layerDefinition||t)}readObjectIdField(e,t){return ae(t.layerDefinition||t)}writePopupTemplate(e,t,r,i){e&&(t[r]=e.toJSON({...i,writeFieldFormat:!i?.writeLayerSchema}))}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){xe(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,r){t=t.layerDefinition||t;const i=t.drawingInfo?.renderer;if(i){const e=Ge(i,t,r)??void 0;return e||y.getLogger(this).error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:r}),e}return ne(t,r)}get source(){return this._get("source")}set source(e){e||(e=null);const t=this._get("source");t!==e&&((Array.isArray(e)||e instanceof a)&&(e=new D({layer:this,items:e})),it(t)&&this._resetMemorySource(t),it(e)&&this._initMemorySource(e),this._set("source",e))}readSource(e,t){const r=Ze.fromJSON(t.featureSet);return new D({layer:this,items:r?.features??[]})}readTemplates(e,t){const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e=e?.map(e=>Ee.fromJSON(e)),this._fixTemplates(e,i),this._fixTemplates(e,o),e}readTitle(e,t){const r=t.layerDefinition?.name??t.name,i=t.title||t.layerDefinition?.title;if(r){if("item-title"===this.sublayerTitleMode)return this.url?H(this.url,r):r;let e=r;if(!e&&this.url){const t=Z(this.url);null!=t&&(e=t.title)}if(!e)return;const t=this.portalItem?.title;return"item-title-and-service-name"===this.sublayerTitleMode&&t&&t!==e&&(e=t+" - "+e),$(e)}if("item-title"===this.sublayerTitleMode&&i)return i}readTitleFromWebMap(e,t){return t.title||t.layerDefinition?.name}readTypeIdField(e,t){let r=(t=t.layerDefinition||t).typeIdField;if(r&&t.fields){r=r.toLowerCase();const e=t.fields.find(e=>e.name.toLowerCase()===r);e&&(r=e.name)}return r}readTypes(e,t){e=(t=t.layerDefinition||t).types;const r=t.editFieldsInfo,i=r?.creatorField,o=r?.editorField;return e?.map(e=>(e=Le.fromJSON(e),this._fixTemplates(e.templates,i),this._fixTemplates(e.templates,o),e))}readVisible(e,t){return null!=t.layerDefinition?.defaultVisibility?!!t.layerDefinition.defaultVisibility:null!=t.visibility?!!t.visibility:void 0}async addAttachment(e,t){const r=await le(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async updateAttachment(e,t,r){const i=await pe(this,e,t,r,rt);return this.lastEditsEventDate=new Date,i}async applyEdits(e,t){return ue(this,e,t)}async uploadAssets(e,t){return de(this,e,t)}createFieldConfigurations(){return Pe(this)}createPopupTemplate(e){return ze(this,e)}async createGraphicsSource(r){const i={stack:[],error:void 0,hasError:!1};try{if(this._hasMemorySource()&&this.source)return this.source.load({signal:r});const{default:t}=await g(import("./graphics/sources/FeatureLayerSource.js"),r),o=new t({layer:this,supportedSourceTypes:this.supportedSourceTypes});e(i,l(w(r,()=>o.cancelLoad())??p()),!1);return await o.load({signal:r}),o}catch(o){i.error=o,i.hasError=!0}finally{t(i)}}createQuery(){const e=ye(this);e.dynamicDataSource=this.dynamicDataSource;const t=null!=this.subtypeCode?`${this.subtypeField} = ${this.subtypeCode}`:null,r=v(this.definitionExpression,t);return e.where=r||"1=1",e}async deleteAttachments(e,t){const r=await ce(this,e,t,rt);return this.lastEditsEventDate=new Date,r}async fetchRecomputedExtents(e){return me(this,e,rt)}async getFeatureTitle(e,t){return this._titleCreator.getTitle(this,e,t)}async getFeatureTitles(e,t){return this._titleCreator.getTitles(this,e,t)}getFeatureType(e){return he(this.types,this.typeIdField,e)}getFieldAlias(e){const t=this.getField(e);if(t)return this.getFieldConfiguration(t.name)?.alias||t.alias}getFieldConfiguration(e){return e=e.toLowerCase(),this.fieldConfigurations?.find(t=>t.name.toLowerCase()===e)}getFieldDomain(e,t){return fe(this,e,t,this.getField(e)?.domain??null)}async queryAttachments(e,t){return be(this,e,t,rt)}async queryFeatures(e,t){const r=await this.load(),i=await r.source.queryFeatures($e.from(e)??r.createQuery(),t),o=this.graphicOrigin;if(i?.features)for(const s of i.features)s.layer=s.sourceLayer=r,s.origin=o;return i}async queryObjectIds(e,t){return await ge(this,e,t,rt)}async queryFeatureCount(e,t){return we(this,e,t,rt)}async queryExtent(e,t){return ve(this,e,t,rt)}async queryRelatedFeatures(e,t){return Fe(this,e,t,rt)}async queryRelatedFeaturesCount(e,t){return Te(this,e,t,rt)}async queryPivot(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryPivot||!i?.operations?.supportsQueryPivot)throw new n(rt,"Layer source does not support queryPivot capability");const o=await import("../rest/support/PivotQuery.js"),s=await r.queryPivot(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopFeatures(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopFeatures||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopFeatures capability");const o=await import("../rest/support/TopFeaturesQuery.js"),s=await r.queryTopFeatures(o.default.from(e),t),a=this.graphicOrigin;if(s?.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryAttributeBins(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryAttributeBins)throw new n(rt,"Layer source does not support queryAttributeBins capability");je(e,i,rt);const o=await import("../rest/support/AttributeBinsQuery.js"),s=await r.queryAttributeBins(o.default.from(e),t),a=this.graphicOrigin;if(s.features)for(const n of s.features)n.layer=n.sourceLayer=this,n.origin=a;return s}async queryTopObjectIds(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopObjectIds||!i?.query.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopObjectIds capability");const o=await import("../rest/support/TopFeaturesQuery.js");return(await r.queryTopObjectIds(o.default.from(e),t)).filter(ke)}async queryTopFeaturesExtent(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopExtents||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryTopExtents capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopExtents(o.default.from(e),t)}async queryTopFeatureCount(e,t){const{source:r,capabilities:i}=await this.load();if(!r.queryTopCount||!i?.query?.supportsTopFeaturesQuery)throw new n(rt,"Layer source does not support queryFeatureCount capability");const o=await import("../rest/support/TopFeaturesQuery.js");return r.queryTopCount(o.default.from(e),t)}read(e,t){const r=e.featureCollection;if((r||"Feature Collection"===e.type)&&(this.resourceInfo=e),r){const{layers:e,showLegend:i}=r;1===e?.length&&(super.read(e[0],t),null!=i&&super.read({showLegend:i},t))}super.read(e,t),"service"===t?.origin&&(["objectIdField","fields","timeInfo","dateFieldsTimeZone","uniqueIdFields"].forEach(e=>this.revertToOrigin(e,"service")),this.spatialReference||this.revertToOrigin("spatialReference","service"))}write(e,t){t={...t,origin:t?.origin??void 0,writeLayerSchema:t?.writeLayerSchema??this._hasMemorySource()};const{origin:r,layerContainerType:i}=t;if(this.dynamicDataSource)return Ye(t,this,"a dynamic data source cannot be written to web scenes, web maps and feature service items"),null;if(this.isTable){if(("web-map"===r||"web-scene"===r)&&"tables"!==i)return Ye(t,this,"a table source can only be written to tables"),null;if(this._hasMemorySource())return Ye(t,this,"an in-memory table source cannot be written to web scenes and web maps"),null}else if(this.loaded&&("web-map"===r||"web-scene"===r)&&"tables"===i)return Ye(t,this,"a non-table source cannot be written to tables in web maps or web scenes"),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new n(rt,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){return!!this.loaded&&("memory"===this.source?.type||Ne(this,e))}async save(e){return this._debouncedSaveOperations(0,e)}async saveAs(e,t){return this._debouncedSaveOperations(1,t,e)}_readEditingEnabled(e,t,r){let i=e.layerDefinition?.capabilities;return i?this._hasEditingCapability(i):(i=e.capabilities,t&&"web-map"===r?.origin&&!this._hasMemorySource()&&i?this._hasEditingCapability(i):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(e=>e.trim()).includes("editing")}_writeEditingEnabled(e,t,r,i){if(!e){const e=this.capabilities?.operations?.supportsSync?"Query,Sync":"Query";h("layerDefinition.capabilities",e,t),r&&!i?.writeLayerSchema&&(t.capabilities=e)}}_fetchFirstValidLayerId(e){return o(this.url??"",{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(e=>{const t=e.data;if(t)return this.applyPreferredHost(t),this.findFirstValidLayerId(t)})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",portalItem:this.portalItem,portal:this.portalItem?.portal,url:this.parsedUrl})),this._verifySource(),this._verifyFields(),xe(this.renderer,this.fieldsIndex),qe(this.timeInfo,this.fieldsIndex),this._hasMemorySource()&&"mesh"===this.geometryType&&(this.capabilities.query.supportsReturnMesh=!0),Je(this,{origin:"service"})}async hasDataChanged(){return Se(this)}async fetchPublishingStatus(){const e=this.source;return e?.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){const e=this.parsedUrl?.path??"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||-1!==e.search(/\/FeatureServer\//i)||this.fields?.some(e=>"geometry"===e.type)||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(e=>{const r=e.prototype?.attributes;r&&t&&delete r[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new n("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new n("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(e=>{e.layer=this,e.sourceLayer=this}),this.addHandles([e.on("after-add",e=>{e.item.layer=this,e.item.sourceLayer=this}),e.on("after-remove",e=>{e.item.layer=null,e.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(e=>{e.layer=null,e.sourceLayer=null}),this.removeHandles("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}findFirstValidLayerId(e){const t=[...e.layers||[],...e.tables||[]];return t.find(({type:e})=>!e||this.supportedSourceTypes.has(e))?.id}};r([F({clonable:!1,readOnly:!0})],at.prototype,"_titleCreator",null),r([F(k)],at.prototype,"attributeTableTemplate",void 0),r([et("service","capabilities")],at.prototype,"readCapabilities",null),r([F({json:{origins:{"web-scene":{write:!1}},write:!0}})],at.prototype,"charts",void 0),r([F({readOnly:!0})],at.prototype,"createQueryVersion",null),r([F({json:{read:{source:"layerDefinition.copyrightText"}}})],at.prototype,"copyright",void 0),r([F({json:{read:{source:"layerDefinition.displayField"}}})],at.prototype,"displayField",void 0),r([F({types:Ke,readOnly:!0})],at.prototype,"defaultSymbol",void 0),r([F({type:He})],at.prototype,"dynamicDataSource",void 0),r([F({type:Boolean})],at.prototype,"editingEnabled",null),r([et(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],at.prototype,"readEditingEnabled",null),r([et("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],at.prototype,"readEditingEnabledFromWebMap",null),r([tt(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabled",null),r([tt("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],at.prototype,"writeEditingEnabledToWebMap",null),r([F({readOnly:!0})],at.prototype,"effectiveEditingEnabled",null),r([F({clonable:!1,readOnly:!0})],at.prototype,"featureTitleFields",null),r([F({type:[De],json:{name:"layerDefinition.fieldConfigurations",write:{overridePolicy(e,t,r){return{enabled:!r?.writeLayerSchema,ignoreOrigin:1===this.originIdOf(t)}}}}})],at.prototype,"fieldConfigurations",null),r([F({...ot.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:st}}}}})],at.prototype,"fields",void 0),r([F(ot.fieldsIndex)],at.prototype,"fieldsIndex",void 0),r([F({type:S,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],at.prototype,"formTemplate",void 0),r([F({json:{read:{source:"layerDefinition.extent"}}})],at.prototype,"fullExtent",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:st,writer(e,t,r){const i=e?Ie.toJSON(e):null;i&&h(r,i,t)}}}},read:{source:"layerDefinition.geometryType",reader:Ie.read}}})],at.prototype,"geometryType",void 0),r([F({readOnly:!0,clonable:!1})],at.prototype,"graphicOrigin",void 0),r([F({json:{read:{source:"layerDefinition.hasM"}}})],at.prototype,"hasM",void 0),r([F({json:{read:{source:"layerDefinition.hasZ"}}})],at.prototype,"hasZ",void 0),r([F(z)],at.prototype,"id",void 0),r([F({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],at.prototype,"infoFor3D",void 0),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],at.prototype,"isTable",void 0),r([et("service","isTable",["type","geometryType"]),et("isTable",["layerDefinition.type","layerDefinition.geometryType"])],at.prototype,"readIsTable",null),r([tt("web-map","isTable")],at.prototype,"writeIsTable",null),r([F(K)],at.prototype,"labelsVisible",void 0),r([F({type:[Me],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:Ae,write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:Ae,write:{layerContainerTypes:j}}})],at.prototype,"labelingInfo",void 0),r([F({type:Qe,json:{name:"layerDefinition.drawingInfo.symbolLayerDrawing",write:!0,origins:{"web-scene":{write:!1}}}})],at.prototype,"symbolLayerDrawing",void 0),r([F((()=>{const e=d(X);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(e,t,r){h(r,Xe(e),t)}}},e})())],at.prototype,"opacity",void 0),r([F(Y)],at.prototype,"legendEnabled",void 0),r([F({type:["show","hide"],json:(()=>{const e=d(ee.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],at.prototype,"listMode",void 0),r([et("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],at.prototype,"readGlobalIdField",null),r([F({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:st}}}}})],at.prototype,"objectIdField",void 0),r([et("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],at.prototype,"readObjectIdField",null),r([F({type:["ArcGISFeatureLayer"],json:{write:{target:"layerType",ignoreOrigin:!0,layerContainerTypes:j}}})],at.prototype,"operationalLayerType",void 0),r([F(ot.outFields)],at.prototype,"outFields",void 0),r([F({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],at.prototype,"path",void 0),r([F(te)],at.prototype,"popupEnabled",void 0),r([F({type:i,json:{name:"popupInfo",write:!0}})],at.prototype,"popupTemplate",void 0),r([tt("popupTemplate")],at.prototype,"writePopupTemplate",null),r([F({readOnly:!0})],at.prototype,"defaultPopupTemplate",null),r([F({types:We,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:Be,name:"layerDefinition.drawingInfo.renderer",write:{layerContainerTypes:j,overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,r)=>({ignoreOrigin:r?.writeLayerSchema,layerContainerTypes:j})}}})],at.prototype,"renderer",null),r([et("service","renderer",["drawingInfo.renderer","defaultSymbol"]),et("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],at.prototype,"readRenderer",null),r([F()],at.prototype,"resourceInfo",void 0),r([F((()=>{const e=d(re);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],at.prototype,"screenSizePerspectiveEnabled",void 0),r([F({clonable:!1})],at.prototype,"source",null),r([et("portal-item","source",["featureSet"]),et("web-map","source",["featureSet"])],at.prototype,"readSource",null),r([F({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],at.prototype,"spatialReference",void 0),r([F({type:Number})],at.prototype,"subtypeCode",void 0),r([F({readOnly:!1})],at.prototype,"subtypeField",void 0),r([F({readOnly:!1})],at.prototype,"subtypes",void 0),r([F({type:[Ee]})],at.prototype,"templates",void 0),r([et("templates",["editFieldsInfo","creatorField","editorField","templates"])],at.prototype,"readTemplates",null),r([F({type:Ue})],at.prototype,"timeInfo",void 0),r([F()],at.prototype,"title",void 0),r([et("service","title",["name"]),et("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],at.prototype,"readTitle",null),r([et("web-map","title",["layerDefinition.name","title"])],at.prototype,"readTitleFromWebMap",null),r([F({type:String})],at.prototype,"sublayerTitleMode",void 0),r([F({json:{read:!1}})],at.prototype,"type",void 0),r([F({type:String})],at.prototype,"typeIdField",void 0),r([et("service","typeIdField"),et("typeIdField",["layerDefinition.typeIdField"])],at.prototype,"readTypeIdField",null),r([F({type:[Le]})],at.prototype,"types",void 0),r([et("service","types",["types"]),et("types",["layerDefinition.types"])],at.prototype,"readTypes",null),r([F({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility",layerContainerTypes:j}}}}})],at.prototype,"visible",void 0),r([et("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],at.prototype,"readVisible",null),at=r([T("esri.layers.FeatureLayer")],at);export{at as default};
@@ -134,6 +134,28 @@ export default class GaussianSplatLayer extends GaussianSplatLayerSuperclass {
134
134
  */
135
135
  get elevationInfo(): ElevationInfo | null | undefined;
136
136
  set elevationInfo(value: ElevationInfoProperties | null | undefined);
137
+ /**
138
+ * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent
139
+ * transparent and `1` is completely opaque.
140
+ *
141
+ * > [!WARNING]
142
+ * >
143
+ * > **Known Limitations**
144
+ * >
145
+ * > In a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), modifying opacity is not supported for
146
+ * > [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/),
147
+ * > [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/),
148
+ * > [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMesh3DTilesLayer/),
149
+ * > [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMeshLayer/),
150
+ * > [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/),
151
+ * > [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/), and [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/).
152
+ *
153
+ * @default 1
154
+ * @example
155
+ * // Makes the layer 50% transparent
156
+ * layer.opacity = 0.5;
157
+ */
158
+ get opacity(): number;
137
159
  /**
138
160
  * The spatial reference of the layer.
139
161
  *
@@ -151,6 +151,28 @@ export default class LineOfSightLayer extends LineOfSightLayerSuperclass {
151
151
  */
152
152
  get observer(): LineOfSightAnalysisObserver | null | undefined;
153
153
  set observer(value: LineOfSightAnalysisObserverProperties | null | undefined);
154
+ /**
155
+ * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent
156
+ * transparent and `1` is completely opaque.
157
+ *
158
+ * > [!WARNING]
159
+ * >
160
+ * > **Known Limitations**
161
+ * >
162
+ * > In a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), modifying opacity is not supported for
163
+ * > [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/),
164
+ * > [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/),
165
+ * > [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMesh3DTilesLayer/),
166
+ * > [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMeshLayer/),
167
+ * > [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/),
168
+ * > [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/), and [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/).
169
+ *
170
+ * @default 1
171
+ * @example
172
+ * // Makes the layer 50% transparent
173
+ * layer.opacity = 0.5;
174
+ */
175
+ get opacity(): number;
154
176
  /** The spatial reference of the layer. The spatial reference is derived from the observer. */
155
177
  get spatialReference(): SpatialReference;
156
178
  /**
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import t from"../request.js";import{has}from"../applications/Components/baUtils.js";import i from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as f}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as w}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as b}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as L}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as M}from"../views/support/Scheduler.js";import{Yield as R}from"../views/support/Yield.js";const C=3857,k=32662,S=4326,W=5773;let I=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._haveAddedViewSRForNoOpPrj=!1,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0,this._debugFlags=new Set,this._debugLevel=2,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;0===t||1===t?r.getLogger(this).error(e):2===t&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get viewSR(){return this._viewSR}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(M.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._jobDataBufferPtr&&(this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0),this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,t)=>{this._lyr3DMain.cancel_elevation_query(t),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),R}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);if(i){this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0;const s=this._isUpdating(i);i.needFrame=!0,s||i.layerView.updatingFlagChanged()}}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t),i.needFrame=!0,i.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);if(i){const s=this._lyr3DMain._malloc(8*t.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)r[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length),this._lyr3DMain._free(s);const a=this._isUpdating(i);i.needFrame=!0,a||i.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();let d="global"===this.view.viewingMode?6:4;6===d?(this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W,this._viewSR.wkt=""):(this._viewSR.vcsWkid||(this._viewSR.vcsWkid=b(this.view.heightModelInfo)),this.view.renderSpatialReference?.isWebMercator?(this._viewSR.wkid=this._viewSR.latestWkid=C,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this.view.renderSpatialReference?.wkid===k?(this._viewSR.wkid=this._viewSR.latestWkid=S,d=3,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this._viewSR.vcsWkid||this._viewSR.latestVcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=-1));const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,t,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new w(L(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,t){this._lyr3DMain?.set_lod_pixel_threshold(t);const i=this._layers.get(e.wasmLayerId);i&&(i.needFrame=!0,i.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,t,i){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===t.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===C?y.WebMercator:y.PlateCarree,r=t.projectSync(s);r&&(t=r);const a=2*t.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<t.coordinates.length;++y){const e=t.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=i?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:t,signal:i?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,t)=>{h.resolveCallback=e,h.rejectCallback=t});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((t,i)=>{o(t.signal)&&(this._lyr3DMain.cancel_elevation_query(i),t.rejectCallback(n()),e.push(i))});for(let t=0;t<e.length;++t)this._elevationQueries.delete(e[t])}_pulseTask(e){const t=this._lyr3DMain;if(t){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:i,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:i,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};t.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;t.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let i=0,s=0;this._layers.forEach(e=>{i+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),i/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-i-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,i,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,t){if(t.isForElevationQuery)return;const i=this._isUpdating(e);e.outstandingJobCount+=1,i||e.layerView.updatingFlagChanged()}_decrementJobCount(e,t){if(t.isForElevationQuery)return;const i=this._isUpdating(e);e.outstandingJobCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const t=this._isUpdating(e);e.outstandingRenderableCount+=1,t||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const t=this._isUpdating(e);e.outstandingRenderableCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,t){for(;!t.done&&e.length>0;){e.shift()(this._lyr3DMain),t.madeProgress()}}_decrementJobCountIfLayerExists(e,t){this._layers.get(e.layerView.wasmLayerId)===e&&this._decrementJobCount(e,t)}_decrementRenderableCountIfLayerExists(e){this._layers.get(e.layerView.wasmLayerId)===e&&this._decrementRenderableCount(e)}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&!e.layerView.destroyed?this._pendingJobFailed.push(t=>{try{t.on_job_failed(i.jobId,i.desc)}finally{this._decrementJobCountIfLayerExists(e,i)}}):this._decrementJobCountIfLayerExists(e,i)}_onJobSucceeded(e,t,i){if(e.layerView.destroyed)return void(this._lyr3DMain?this._pendingJobFailed.push(t=>{try{t.on_job_failed(i.jobId,i.desc)}finally{this._decrementJobCountIfLayerExists(e,i)}}):this._decrementJobCountIfLayerExists(e,i));const{data:s}=t;if(this._lyr3DMain){const r=r=>{try{const e=s.byteLength,a=this._ensureJobDataBuffer(e);new Uint8Array(r.HEAPU8.buffer,a,e).set(s),r.on_job_completed(i.jobId,t.jobDescJson,a,e)}finally{this._decrementJobCountIfLayerExists(e,i)}};this._pendingJobCompleted.push(r)}else this._decrementJobCountIfLayerExists(e,i)}_ensureJobDataBuffer(e){return e<=this._jobDataBufferCapacity&&this._jobDataBufferPtr||(this._jobDataBufferPtr&&this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=this._lyr3DMain._malloc(e),this._jobDataBufferCapacity=e),this._jobDataBufferPtr}_getRequestPromises(e,i,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,s,r,a,n){const o=this._getRequestPromises(e.urls,t,i,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(t=>{let i=1;return l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t,e);const i=t.abortController.signal,s=t.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(t,r,e);else if(0===r.status)this._onJobSucceeded(t,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const t of e)o.inputs.push(t);return this._workerHandle.invoke(o,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),this._lyr3DMain?this._pendingJobFailed.push(i=>{try{i.on_job_failed(e.jobId,e.desc)}finally{this._decrementJobCountIfLayerExists(t,e)}}):this._decrementJobCountIfLayerExists(t,e)})}};try{const t=await this._getInitialPromise(e,n,d,s,o,i,a);if(3===t.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(i);h(await this._getInitialPromise(e,n,d,s,o,i,s.session))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain?this._pendingJobFailed.push(i=>{try{i.on_job_failed(e.jobId,e.desc)}finally{this._decrementJobCountIfLayerExists(t,e)}}):this._decrementJobCountIfLayerExists(t,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:t}=e;t.data&&t.data.byteLength>0&&(t.data=t.data.slice());const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{!this._lyr3DMain||i.layerView.destroyed?this._decrementRenderableCountIfLayerExists(i):this._pendingRenderableCreated.push(s=>{try{const{layerId:i,handle:r}=e,a=t();s.on_renderable_created(!0,i,r,a.memUsageBytes,a.numGaussians??0)}finally{this._decrementRenderableCountIfLayerExists(i)}})}).catch(t=>{l(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),!this._lyr3DMain||i.layerView.destroyed?this._decrementRenderableCountIfLayerExists(i):this._pendingRenderableCreated.push(t=>{try{const{layerId:i,handle:s}=e;t.on_renderable_created(!1,i,s,0,0)}finally{this._decrementRenderableCountIfLayerExists(i)}})}))}_freeRenderables(e,t,i){if(i<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,t,i,s){this._lyr3DMain&&this._debugLog(i,s,this._lyr3DMain.UTF8ToString(e,t),!1)}_onElevQueryComplete(e){const t=this._elevationQueries.get(e),i=this._lyr3DMain.get_elevation_query_result(e);if(t)if(i.succeeded&&i.zs){const s=i.zs.slice(),r=t.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),t.resolveCallback(r),this._elevationQueries.delete(e)}else t.rejectCallback(new s("elevation-query:error",i?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_is3DTilesIMLayer(e){return"integrated-mesh-3dtiles"===e.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:f};const i="integrated-mesh-3dtiles"===t.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==s.errorCode)return{wasmLayerId:f,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!0});const o=D(t.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(t)||this._is3DTilesIMLayerView(e)&&this._is3DTilesIMLayer(t)){let i=t.spatialReference;if(e.useEsriCrs&&t.esriCrsSpatialReference){i=t.esriCrsSpatialReference;const s=u(i);let r=1,a=1;!s&&i.wkid&&-1!==i.wkid&&(r=c.values[c[i.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(i)),s,r,a).catch(d),!this._haveAddedViewSRForNoOpPrj&&i.vcsWkid&&this._viewSR.vcsWkid&&-1!==this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==i.vcsWkid&&(this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d),this._haveAddedViewSRForNoOpPrj=!0)}this._isGaussianSplatLayerView(e)?h=this._lyr3DMain.add_gaussian_splat_layer(l,t.url,a,o):this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,t.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")))}return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:f})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const t=this._isUpdating(e);e.needFrame=!0,t||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],I.prototype,"view",void 0),e([h({readOnly:!0})],I.prototype,"isTerrainReady",null),I=e([_("esri.layers.Lyr3DWasmPerSceneView")],I);const j=I;export{j as default};
2
+ import{__decorate as e}from"tslib";import t from"../request.js";import{has}from"../applications/Components/baUtils.js";import i from"../core/Accessor.js";import s from"../core/Error.js";import r from"../core/Logger.js";import{someMap as a}from"../core/MapUtils.js";import{createAbortError as n,isAborted as o,isAbortError as l}from"../core/promiseUtils.js";import{watch as d}from"../core/reactiveUtils.js";import{property as h,subclass as _}from"../core/accessorSupport/decorators.js";import y from"../geometry/SpatialReference.js";import{isGeographic as u}from"../geometry/support/spatialReferenceUtils.js";import c from"../geometry/support/WKIDUnitConversion.js";import{wasmFailedToInit as g,elevQueriesFull as m,elevQueriesGenericFail as p,invalidLayerView as f}from"./ILyr3DWasmPerSceneView.js";import{Lyr3DWorkerHandle as w}from"./Lyr3DWorkerHandle.js";import{getVCSFromHeightModelInfo as b}from"./support/tiles3DUtils.js";import{loadLyr3DMainWASM as v}from"../libs/lyr3d/Lyr3DModule.js";import{getElevationOffsetInMeters as D}from"../support/elevationInfoUtils.js";import{makeScheduleFunction as L}from"../views/3d/layers/support/makeScheduleFunction.js";import{TaskPriority as M}from"../views/support/Scheduler.js";import{Yield as R}from"../views/support/Yield.js";const C=3857,k=32662,S=4326,W=5773;let I=class extends i{constructor(e){super(e),this._lyr3DMainPromise=null,this._lyr3DMain=null,this._layers=new Map,this._viewSR=null,this._haveAddedViewSRForNoOpPrj=!1,this._lyr3DBusyCount=0,this._lyr3DInternalMemoryBytes=0,this._isTerrainReady=!1,this._hasLayerThatReplacesTerrain=!1,this._elevationQueries=new Map,this._pendingJobCompleted=new Array,this._pendingJobFailed=new Array,this._pendingRenderableCreated=new Array,this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0,this._debugFlags=new Set,this._debugLevel=0,this._wasmNotLoaded="method requiring WASM was called when WASM isn't loaded",this._pulseTaskHandle=null,this._cameraDirty=!0,this._cameraElevationDirty=!0,this._debugFlags.add(0),this._debugFlags.add(1),this._debugFlags.add(2)}_debugLog(e,t,i,s=!0){if(this._debugFlags.has(e)&&this._debugLevel>=t){const e=s?`[js] ${i}`:`${i}`;0===t||1===t?r.getLogger(this).error(e):2===t&&r.getLogger(this).warn(e),r.getLogger(this).info(e)}}get viewSR(){return this._viewSR}get lyr3DInternalMemoryBytes(){return this._lyr3DInternalMemoryBytes}initialize(){this._debugLevel>2&&(r.getLogger(this).level="info"),this._debugLog(0,3,"Lyr3DWasmPerSceneView.initialize()"),this.addHandles([d(()=>this.view.state?.contentCamera,()=>this._updateWasmCamera()),d(()=>this.view.state?.contentCamera.relativeElevation,()=>{this._cameraElevationDirty=!0,this._markAllLayerViewsUpdating()})]),this._pulseTaskHandle=this.view.resourceController.scheduler.registerTask(M.LYR3D,this)}destroy(){this._debugLog(0,3,"Lyr3DWasmPerSceneView.destroy()"),this._lyr3DMain&&(this._jobDataBufferPtr&&(this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=0,this._jobDataBufferCapacity=0),this._layers.forEach(e=>{e.abortController.abort()}),this._elevationQueries.forEach((e,t)=>{this._lyr3DMain.cancel_elevation_query(t),e.rejectCallback(n())}),this._elevationQueries.clear(),this._lyr3DMain.uninitialize_lyr3d_wasm(),this._lyr3DMain=null),this._pendingJobCompleted.length=0,this._pendingJobFailed.length=0,this._pendingRenderableCreated.length=0;const e=this._workerHandle;e&&e.destroyWasm().then(()=>{this._workerHandle?.destroy(),this._workerHandle=null}),this._pulseTaskHandle?.remove(),this._pulseTaskHandle=null}get readyToRun(){return this._hasPendingPulseWork()}runTask(e){return this._pulseTask(e),R}_hasPendingPulseWork(){return!!this._lyr3DMain&&(this._cameraDirty||this._cameraElevationDirty||this._pendingJobCompleted.length>0||this._pendingJobFailed.length>0||this._pendingRenderableCreated.length>0||this._elevationQueries.size>0||a(this._layers,e=>this._isUpdating(e)))}addLayerView(e){return this._lyr3DMain?this._addLayerView(e):(this._debugLog(0,1,"Lyr3DWasmPerSceneView.add3DTilesLayerView() called when WASM wasn't initialized"),{wasmLayerId:g})}removeLayerView(e){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;this._doRemoveLayerView(e);const t=this._layers.size;return 0===t&&(this._debugLog(0,3,"Lyr3DWasmPerSceneView.remove3DTilesLayerView() no Lyr3D layers left after removing a layer, destroying"),this.destroy()),t}getValidLayerViewCount(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),0;let e=0;return this._layers.forEach(t=>{t.layerView.wasmLayerId>=0&&++e}),e}setEnabled(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);if(i){this._lyr3DMain.set_enabled(e.wasmLayerId,t),i.needMemoryUsageUpdate=!0;const s=this._isUpdating(i);i.needFrame=!0,s||i.layerView.updatingFlagChanged()}}setLayerOffset(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);i&&(this._lyr3DMain.set_carto_offset_z(e.wasmLayerId,t),i.needFrame=!0,i.layerView.updatingFlagChanged())}getAttributionText(){if(!this._lyr3DMain)return this._debugLog(0,1,this._wasmNotLoaded),[];return this._lyr3DMain.get_current_attribution_text().split("|")}onRenderableEvicted(e,t,i){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);this._layers.get(e.wasmLayerId)&&this._lyr3DMain.on_renderable_evicted(e.wasmLayerId,t,i)}setMeshModifications(e,t){if(!this._lyr3DMain)return void this._debugLog(0,1,this._wasmNotLoaded);const i=this._layers.get(e.wasmLayerId);if(i){const s=this._lyr3DMain._malloc(8*t.length),r=new Float64Array(this._lyr3DMain.HEAPF64.buffer,s,t.length);for(let e=0;e<t.length;++e)r[e]=t[e];this._lyr3DMain.set_mesh_modification_polygons(e.wasmLayerId,s,t.length),this._lyr3DMain._free(s);const a=this._isUpdating(i);i.needFrame=!0,a||i.layerView.updatingFlagChanged()}}isUpdating(e){if(!this._lyr3DMain&&this._lyr3DMainPromise)return!0;const t=this._layers.get(e);return!!t&&(t.outstandingJobCount>0||t.outstandingRenderableCount>0||t.needFrame||this._lyr3DBusyCount>0)}initializeWasm(e,t){return this._lyr3DMain?Promise.resolve():this.view.renderSpatialReference?(this._debugLog(0,3,"Lyr3DWasmPerSceneView.initializeWasm()"),this._lyr3DMainPromise||(this._lyr3DMainPromise=v().then(i=>{this._lyr3DMain=i,this._lyr3DMainPromise=null;const s=this._lyr3DMain.addFunction(this._onNewJob.bind(this),"v"),r=this._lyr3DMain.addFunction(this._onNewRenderable.bind(this),"v"),a=this._lyr3DMain.addFunction(this._freeRenderables.bind(this),"viii"),n=this._lyr3DMain.addFunction(this._setRenderableVisibility.bind(this),"viiii"),o=this._lyr3DMain.addFunction(this._onWasmError.bind(this),"viiii"),l=this._lyr3DMain.addFunction(this._onElevQueryComplete.bind(this),"vi");if(!this.view.renderSpatialReference)return void(this._lyr3DMain=null);this._viewSR=this.view.renderSpatialReference?.toJSON();let d="global"===this.view.viewingMode?6:4;6===d?(this._viewSR.wkid=this._viewSR.latestWkid=S,this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W,this._viewSR.wkt=""):(this._viewSR.vcsWkid||(this._viewSR.vcsWkid=b(this.view.heightModelInfo)),this.view.renderSpatialReference?.isWebMercator?(this._viewSR.wkid=this._viewSR.latestWkid=C,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this.view.renderSpatialReference?.wkid===k?(this._viewSR.wkid=this._viewSR.latestWkid=S,d=3,this._viewSR.vcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=W)):this._viewSR.vcsWkid||this._viewSR.latestVcsWkid||(this._viewSR.vcsWkid=this._viewSR.latestVcsWkid=-1));const h=has("esri-lyr3D-max-concurrent-requests")??16;return this._lyr3DMain.initialize_lyr3d_wasm(o,s,r,a,n,l,e,t,d,this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),Math.max(this._debugLevel,0),h)?(this._workerHandle=new w(L(this.view.resourceController)),this._workerHandle.promise?this._workerHandle.promise:void 0):(this._lyr3DMain=null,void this._debugLog(0,0,"Lyr3d Main WASM failed to initialize",!1))}).catch(e=>{this._debugLog(0,0,`Lyr3d WASM failed to download error = ${e}`,!1)})),this._lyr3DMainPromise):Promise.reject()}get isTerrainReady(){return this._isTerrainReady}setLodPixelThreshold(e,t){this._lyr3DMain?.set_lod_pixel_threshold(t);const i=this._layers.get(e.wasmLayerId);i&&(i.needFrame=!0,i.layerView.updatingFlagChanged())}setMaximumGaussianSplatCount(e){this._lyr3DMain.set_maximum_splat_count(e),this._layers.forEach(e=>{"gaussian-splat-3d"===e.layerView.type&&(e.needFrame=!0,e.layerView.updatingFlagChanged())})}queryElevation(e,t,i){if(!this._lyr3DMain)return Promise.reject(this._wasmNotLoaded);if(0===t.coordinates.length)return Promise.reject("no coordinates for elevation query");const s="global"===this.view.viewingMode?y.WGS84:this._viewSR.wkid===C?y.WebMercator:y.PlateCarree,r=t.projectSync(s);r&&(t=r);const a=2*t.coordinates.length,n=this._lyr3DMain._malloc(8*a),o=new Float64Array(this._lyr3DMain.HEAPF64.buffer,n,a);for(let y=0;y<t.coordinates.length;++y){const e=t.coordinates[y];o[2*y]=e.x,o[2*y+1]=e.y}const l=i?.maxGeometricError??0,d=this._lyr3DMain.create_elevation_query(e.wasmLayerId,l,n,a);if(this._lyr3DMain._free(n),d===m)return Promise.reject("max mesh elevation query limit exceeded");if(d===p)return Promise.reject("elevation query failed");const h={descriptor:t,signal:i?.signal,resolveCallback:null,rejectCallback:null},_=new Promise((e,t)=>{h.resolveCallback=e,h.rejectCallback=t});return this._elevationQueries.set(d,h),_}_checkForAbortedElevationQueries(){const e=[];this._elevationQueries.forEach((t,i)=>{o(t.signal)&&(this._lyr3DMain.cancel_elevation_query(i),t.rejectCallback(n()),e.push(i))});for(let t=0;t<e.length;++t)this._elevationQueries.delete(e[t])}_pulseTask(e){const t=this._lyr3DMain;if(t){if(this._cameraDirty){const e=this.view.state?.contentCamera;if(e){const{eye:i,center:s,up:r,near:a,far:n,fovY:o}=e,l=[e.viewport[2],e.viewport[3]],d={eye:i,center:s,up:r,near:a,far:n,fov:o,aspectRatio:e.width/e.height,viewport:l};t.set_camera_parameters(d),this._cameraDirty=!1}}if(this._cameraElevationDirty){const e=this.view.state?.contentCamera.relativeElevation;t.set_camera_elevation(e)}this._checkForAbortedElevationQueries();let i=0,s=0;this._layers.forEach(e=>{i+=e.layerView.usedMemory,s+=e.layerView.cachedMemory}),i/=1048576,s/=1048576;const r=this.view.resourceController.memoryController,a=r.usedMemory*r.maxMemory-i-this._lyr3DInternalMemoryBytes/1048576;this._lyr3DBusyCount=this._lyr3DMain.frame_pulse(r.memoryFactor,i,s,a,r.maxMemory),this._lyr3DInternalMemoryBytes=this._lyr3DMain.get_index_memory_bytes(),this._layers.forEach(e=>{this._cameraElevationDirty||(e.needFrame=!1),e.layerView.updatingFlagChanged()}),this._hasLayerThatReplacesTerrain&&!this._isTerrainReady&&(this._isTerrainReady=this._lyr3DMain.is_terrain_ready(),this._isTerrainReady&&this.notifyChange("isTerrainReady")),this._flushPendingWasmCalls(e),this._cameraElevationDirty=!1}}_isUpdating(e){return e.outstandingJobCount>0||e.outstandingRenderableCount>0||e.needFrame||this._cameraDirty||this._lyr3DBusyCount>0}_incrementJobCount(e,t){if(t.isForElevationQuery)return;const i=this._isUpdating(e);e.outstandingJobCount+=1,i||e.layerView.updatingFlagChanged()}_decrementJobCount(e,t){if(t.isForElevationQuery)return;const i=this._isUpdating(e);e.outstandingJobCount-=1;i!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_incrementRenderableCount(e){const t=this._isUpdating(e);e.outstandingRenderableCount+=1,t||e.layerView.updatingFlagChanged()}_decrementRenderableCount(e){const t=this._isUpdating(e);e.outstandingRenderableCount-=1;t!==this._isUpdating(e)&&e.layerView.updatingFlagChanged()}_flushPendingWasmCalls(e){this._lyr3DMain&&(this._flushPendingCalls(this._pendingJobFailed,e),this._flushPendingCalls(this._pendingJobCompleted,e),this._flushPendingCalls(this._pendingRenderableCreated,e))}_flushPendingCalls(e,t){for(;!t.done&&e.length>0;){e.shift()(this._lyr3DMain),t.madeProgress()}}_decrementJobCountIfLayerExists(e,t){this._layers.get(e.layerView.wasmLayerId)===e&&this._decrementJobCount(e,t)}_decrementRenderableCountIfLayerExists(e){this._layers.get(e.layerView.wasmLayerId)===e&&this._decrementRenderableCount(e)}_onJobFailed(e,t,i){t.error.length&&this._debugLog(1,1,t.error,!1),this._lyr3DMain&&!e.layerView.destroyed?this._pendingJobFailed.push(t=>{try{t.on_job_failed(i.jobId,i.desc)}finally{this._decrementJobCountIfLayerExists(e,i)}}):this._decrementJobCountIfLayerExists(e,i)}_onJobSucceeded(e,t,i){if(e.layerView.destroyed)return void(this._lyr3DMain?this._pendingJobFailed.push(t=>{try{t.on_job_failed(i.jobId,i.desc)}finally{this._decrementJobCountIfLayerExists(e,i)}}):this._decrementJobCountIfLayerExists(e,i));const{data:s}=t;if(this._lyr3DMain){const r=r=>{try{const e=s.byteLength,a=this._ensureJobDataBuffer(e);new Uint8Array(r.HEAPU8.buffer,a,e).set(s),r.on_job_completed(i.jobId,t.jobDescJson,a,e)}finally{this._decrementJobCountIfLayerExists(e,i)}};this._pendingJobCompleted.push(r)}else this._decrementJobCountIfLayerExists(e,i)}_ensureJobDataBuffer(e){return e<=this._jobDataBufferCapacity&&this._jobDataBufferPtr||(this._jobDataBufferPtr&&this._lyr3DMain._free(this._jobDataBufferPtr),this._jobDataBufferPtr=this._lyr3DMain._malloc(e),this._jobDataBufferCapacity=e),this._jobDataBufferPtr}_getRequestPromises(e,i,s,r){const a=[];for(const n of e){const e=new URL(n);if("integrated-mesh-3dtiles"===r.type){if(e.origin===s.origin&&e.pathname===s.pathname){if(r.rootTileset){a.push(Promise.resolve(r.rootTileset.slice()));continue}}else r.session&&e.searchParams.set("session",r.session)}a.push(t(e.toString(),i).then(e=>e.data))}return a}_getInitialPromise(e,t,i,s,r,a,n){const o=this._getRequestPromises(e.urls,t,i,s);return Promise.all(o).then(e=>(r.inputs=e,this._workerHandle.invoke(r,a))).then(e=>e).catch(t=>{let i=1;return l(t)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):n&&400===t.details?.httpStatus?(i=3,this._debugLog(1,2,"Session expired, trying to create new Session.")):this._debugLog(1,1,`job ${e.jobId} failed with error ${t}.`),{status:i,error:"",jobDescJson:"",data:new Uint8Array(0),missingInputUrls:[],inputs:[]}})}async _onNewJob(){const e=this._lyr3DMain.get_next_job(),t=this._layers.get(e.layerId);if(!t)return;this._incrementJobCount(t,e);const i=t.abortController.signal,s=t.layerView.layer,r="integrated-mesh-3dtiles"===s.type?s.key:null,a="integrated-mesh-3dtiles"===s.type?s.session:null,n={responseType:"array-buffer",signal:i,query:{...t.customParameters,token:t.apiKey,key:r}},o={id:e.jobId,inputs:[],jobDescJson:e.desc.slice(),isMissingResourceCase:!1},d=new URL(s.url),h=r=>{if(1===r.status)this._onJobFailed(t,r,e);else if(0===r.status)this._onJobSucceeded(t,r,e);else if(2===r.status){const a=this._getRequestPromises(r.missingInputUrls,n,d,s);Promise.all(a).then(e=>{o.jobDescJson=r.jobDescJson,r.originalInputs?o.inputs=r.originalInputs:o.inputs=[],o.isMissingResourceCase=!0;for(const t of e)o.inputs.push(t);return this._workerHandle.invoke(o,i)}).then(i=>{1===i.status?this._onJobFailed(t,i,e):0===i.status&&this._onJobSucceeded(t,i,e)}).catch(i=>{l(i)?this._debugLog(1,2,`job ${e.jobId} was cancelled.`):this._debugLog(1,1,`job ${e.jobId} failed with error ${i}.`),this._lyr3DMain?this._pendingJobFailed.push(i=>{try{i.on_job_failed(e.jobId,e.desc)}finally{this._decrementJobCountIfLayerExists(t,e)}}):this._decrementJobCountIfLayerExists(t,e)})}};try{const t=await this._getInitialPromise(e,n,d,s,o,i,a);if(3===t.status&&"integrated-mesh-3dtiles"===s.type){a===s.session&&null!==s.session&&await s.requestRootAndSession(i);h(await this._getInitialPromise(e,n,d,s,o,i,s.session))}else h(t)}catch(_){_&&this._debugLog(1,1,_.toString(),!1),this._lyr3DMain?this._pendingJobFailed.push(i=>{try{i.on_job_failed(e.jobId,e.desc)}finally{this._decrementJobCountIfLayerExists(t,e)}}):this._decrementJobCountIfLayerExists(t,e)}}_onNewRenderable(){const e=this._lyr3DMain.get_next_renderable(),{meshData:t}=e;t.data&&t.data.byteLength>0&&(t.data=t.data.slice());const i=this._layers.get(e.layerId);i&&(this._incrementRenderableCount(i),i.layerView.createRenderable(e).then(t=>{!this._lyr3DMain||i.layerView.destroyed?this._decrementRenderableCountIfLayerExists(i):this._pendingRenderableCreated.push(s=>{try{const{layerId:i,handle:r}=e,a=t();s.on_renderable_created(!0,i,r,a.memUsageBytes,a.numGaussians??0)}finally{this._decrementRenderableCountIfLayerExists(i)}})}).catch(t=>{l(t)||this._debugLog(2,1,`createRenderable failed with error ${t}.`),!this._lyr3DMain||i.layerView.destroyed?this._decrementRenderableCountIfLayerExists(i):this._pendingRenderableCreated.push(t=>{try{const{layerId:i,handle:s}=e;t.on_renderable_created(!1,i,s,0,0)}finally{this._decrementRenderableCountIfLayerExists(i)}})}))}_freeRenderables(e,t,i){if(i<1)return;const s=this._layers.get(e);if(!s)return;const r=s.layerView,a=[],n=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,i);for(let o=0;o<i;++o)a.push(n[o]);for(let o=0;o<i;++o)r.freeRenderable(a[o])}_setRenderableVisibility(e,t,i,s){if(s<1)return;const r=this._layers.get(e);if(!r)return;const a=r.layerView,n=[],o=[],l=new Uint32Array(this._lyr3DMain.HEAPU32.buffer,t,s),d=new Uint8Array(this._lyr3DMain.HEAPU8.buffer,i,s);for(let h=0;h<s;++h)n.push(l[h]),o.push(!!(1&d[h]));a.setRenderableVisibility(n,o,s)}_onWasmError(e,t,i,s){this._lyr3DMain&&this._debugLog(i,s,this._lyr3DMain.UTF8ToString(e,t),!1)}_onElevQueryComplete(e){const t=this._elevationQueries.get(e),i=this._lyr3DMain.get_elevation_query_result(e);if(t)if(i.succeeded&&i.zs){const s=i.zs.slice(),r=t.descriptor.clone();for(let e=0;e<s.length;++e)r.coordinates[e].z=s[e];this._debugLog(2,3,`Success EQ ${e}, number points ${s.length}.`),t.resolveCallback(r),this._elevationQueries.delete(e)}else t.rejectCallback(new s("elevation-query:error",i?.error??"Elevation query failed")),this._elevationQueries.delete(e);else this._debugLog(2,1,`_onElevQueryComplete called for unknown queryId ${e}.`)}_doRemoveLayerView(e){const t=this._layers.get(e.wasmLayerId);return!!t&&(t.abortController.abort(),this._lyr3DMain.remove_layer(e.wasmLayerId),this._is3DTilesIMLayerView(e)&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!1,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")),this._layers.delete(e.wasmLayerId),!0)}_is3DTilesIMLayerView(e){return"integrated-mesh-3dtiles"===e.layer.type}_is3DTilesIMLayer(e){return"integrated-mesh-3dtiles"===e.type}_isGaussianSplatLayerView(e){return"gaussian-splat"===e.layer.type}_isGaussianSplatLayer(e){return"gaussian-splat"===e.type}_toWasmQuality(e){switch(e){case"low":return 1;case"medium":return 2;case"high":return 3}}_addLayerView(e){const t=e.layer;if(!t.url||!t.rootTilesetJSON)return{wasmLayerId:f};const i="integrated-mesh-3dtiles"===t.type?0:2,s=this._lyr3DMain.validate_root_tileset(JSON.stringify(t.rootTilesetJSON),i);if(0!==s.errorCode)return{wasmLayerId:f,check:s};const a=this._lyr3DMain.get_next_layer_id(),n=new AbortController;this._layers.set(a,{layerView:e,abortController:n,needMemoryUsageUpdate:!1,outstandingJobCount:0,outstandingRenderableCount:0,customParameters:t.customParameters,apiKey:t.apiKey,needFrame:!0});const o=D(t.elevationInfo),l=this._toWasmQuality(this.view?.qualityProfile),d=e=>r.getLogger(this).error("add-spatial-reference-error","Error when adding SR:",e);let h=!1;if(this._isGaussianSplatLayerView(e)&&this._isGaussianSplatLayer(t)||this._is3DTilesIMLayerView(e)&&this._is3DTilesIMLayer(t)){let i=t.spatialReference;if(e.useEsriCrs&&t.esriCrsSpatialReference){i=t.esriCrsSpatialReference;const s=u(i);let r=1,a=1;!s&&i.wkid&&-1!==i.wkid&&(r=c.values[c[i.wkid]],a=e.metersPerVCSUnit),this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(i)),s,r,a).catch(d),!this._haveAddedViewSRForNoOpPrj&&i.vcsWkid&&this._viewSR.vcsWkid&&-1!==this._viewSR.vcsWkid&&this._viewSR.vcsWkid!==i.vcsWkid&&(this._workerHandle.addSpatialReferenceInfo(this._cleanUpSR(this._makeSRWasmSerializable(this._viewSR)),!1,1,1).catch(d),this._haveAddedViewSRForNoOpPrj=!0)}this._isGaussianSplatLayerView(e)?h=this._lyr3DMain.add_gaussian_splat_layer(l,t.url,a,o):this._is3DTilesIMLayerView(e)&&(h=this._lyr3DMain.add_3dtiles_layer(l,t.url,a,o,e.layer.replacesTerrain),h&&e.layer.replacesTerrain&&(this._hasLayerThatReplacesTerrain=!0,this._isTerrainReady=!1,this.notifyChange("isTerrainReady")))}return h?(this._updateWasmCamera(),e.updatingFlagChanged(),{wasmLayerId:a}):(this._layers.delete(a),{wasmLayerId:f})}_updateWasmCamera(){const e=this.view.state?.contentCamera;e&&this._lyr3DMain&&(this._cameraDirty=!0,this._markAllLayerViewsUpdating())}_markAllLayerViewsUpdating(){this._layers.forEach(e=>{const t=this._isUpdating(e);e.needFrame=!0,t||e.layerView.updatingFlagChanged()})}_makeSRWasmSerializable(e){return{wkid:e?.wkid??-1,latestWkid:e?.latestWkid??-1,vcsWkid:e?.vcsWkid??-1,latestVcsWkid:e?.latestVcsWkid??-1,wkt:e?.wkt??""}}_cleanUpSR(e){return-1===e?.wkid&&e.latestWkid&&-1!==e.latestWkid?e.wkid=e.latestWkid:-1===e?.latestWkid&&e.wkid&&-1!==e.wkid&&(e.latestWkid=e.wkid),-1===e?.vcsWkid&&e.latestVcsWkid&&-1!==e.latestVcsWkid?e.vcsWkid=e.latestVcsWkid:-1===e?.latestVcsWkid&&e.vcsWkid&&-1!==e.vcsWkid&&(e.latestVcsWkid=e.vcsWkid),e}};e([h({constructOnly:!0})],I.prototype,"view",void 0),e([h({readOnly:!0})],I.prototype,"isTerrainReady",null),I=e([_("esri.layers.Lyr3DWasmPerSceneView")],I);const j=I;export{j as default};
@@ -266,6 +266,28 @@ export default class PointCloudLayer extends PointCloudLayerSuperclass {
266
266
  * @since 4.5
267
267
  */
268
268
  accessor legendEnabled: boolean;
269
+ /**
270
+ * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent
271
+ * transparent and `1` is completely opaque.
272
+ *
273
+ * > [!WARNING]
274
+ * >
275
+ * > **Known Limitations**
276
+ * >
277
+ * > In a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), modifying opacity is not supported for
278
+ * > [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/),
279
+ * > [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/),
280
+ * > [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMesh3DTilesLayer/),
281
+ * > [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMeshLayer/),
282
+ * > [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/),
283
+ * > [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/), and [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/).
284
+ *
285
+ * @default 1
286
+ * @example
287
+ * // Makes the layer 50% transparent
288
+ * layer.opacity = 0.5;
289
+ */
290
+ get opacity(): number;
269
291
  /**
270
292
  * An array of field names from the service to include with each feature.
271
293
  * To fetch the values from all fields in the layer, use `["*"]`. Fields specified in
@@ -109,6 +109,28 @@ export default class ViewshedLayer extends ViewshedLayerSuperclass {
109
109
  * });
110
110
  */
111
111
  get fullExtent(): Extent | null | undefined;
112
+ /**
113
+ * The opacity of the layer. This value can range between `1` and `0`, where `0` is 100 percent
114
+ * transparent and `1` is completely opaque.
115
+ *
116
+ * > [!WARNING]
117
+ * >
118
+ * > **Known Limitations**
119
+ * >
120
+ * > In a 3D [SceneView](https://developers.arcgis.com/javascript/latest/references/core/views/SceneView/), modifying opacity is not supported for
121
+ * > [DimensionLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/DimensionLayer/),
122
+ * > [GaussianSplatLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/GaussianSplatLayer/),
123
+ * > [IntegratedMesh3DTilesLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMesh3DTilesLayer/),
124
+ * > [IntegratedMeshLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/IntegratedMeshLayer/),
125
+ * > [LineOfSightLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/LineOfSightLayer/), [PointCloudLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/PointCloudLayer/),
126
+ * > [ViewshedLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/ViewshedLayer/), and [VoxelLayer](https://developers.arcgis.com/javascript/latest/references/core/layers/VoxelLayer/).
127
+ *
128
+ * @default 1
129
+ * @example
130
+ * // Makes the layer 50% transparent
131
+ * layer.opacity = 0.5;
132
+ */
133
+ get opacity(): number;
112
134
  /**
113
135
  * The [ViewshedAnalysis](https://developers.arcgis.com/javascript/latest/references/core/analysis/ViewshedAnalysis/) associated with the layer that stores the viewsheds.
114
136
  * Assigning a null value will create a new empty analysis.
@@ -173,6 +173,7 @@ export default class Field extends JSONSupport {
173
173
  * | phone-number | Text that represents a phone number. |
174
174
  * | type-or-category | Types or categories that group features based on common characteristics. |
175
175
  * | unique-identifier | The values in this field are used to positively distinguish one feature or entity from another. |
176
+ * | url | Text that represents a web address. |
176
177
  *
177
178
  * @since 4.12
178
179
  * @see [Blog - Describing layer attributes with field descriptions](https://www.esri.com/arcgis-blog/products/arcgis-online/data-management/describing-layer-attributes-with-field-descriptions-march-2019/)
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{Integer as n}from"../../core/accessorSupport/ensureType.js";import{fromJSON as l,types as a}from"./domains.js";import{kebabDict as s}from"./fieldType.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{enumeration as d}from"../../core/accessorSupport/decorators/enumeration.js";var u;const c=new t({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=class extends o{static{u=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?.value??null}readValueType(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?c.fromJSON(o.fieldValueType):null}clone(){return new u({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};e([r({type:String,json:{write:!0}})],m.prototype,"alias",void 0),e([r({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),e([r()],m.prototype,"description",void 0),e([p("description")],m.prototype,"readDescription",null),e([r({types:a,json:{read:{reader:l},write:!0}})],m.prototype,"domain",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([r({type:n,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),e([r({type:String,json:{write:!0}})],m.prototype,"name",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),e([d(s)],m.prototype,"type",void 0),e([r()],m.prototype,"valueType",void 0),e([p("valueType",["description"])],m.prototype,"readValueType",null),e([r({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=u=e([i("esri.layers.support.Field")],m);export{m as default};
2
+ import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import{property as r,subclass as i}from"../../core/accessorSupport/decorators.js";import{Integer as n}from"../../core/accessorSupport/ensureType.js";import{fromJSON as l,types as a}from"./domains.js";import{kebabDict as s}from"./fieldType.js";import{reader as p}from"../../core/accessorSupport/decorators/reader.js";import{enumeration as d}from"../../core/accessorSupport/decorators/enumeration.js";var u;const c=new t({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",currency:"currency",dateAndTime:"date-and-time",description:"description",emailAddress:"email-address",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",phoneNumber:"phone-number",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier",url:"url"});let m=class extends o{static{u=this}constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=void 0,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?.value??null}readValueType(e,{description:t}){let o=null;try{o=t?JSON.parse(t):null}catch(r){}return o?c.fromJSON(o.fieldValueType):null}clone(){return new u({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain?.clone()??null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};e([r({type:String,json:{write:!0}})],m.prototype,"alias",void 0),e([r({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),e([r()],m.prototype,"description",void 0),e([p("description")],m.prototype,"readDescription",null),e([r({types:a,json:{read:{reader:l},write:!0}})],m.prototype,"domain",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),e([r({type:n,json:{write:{overridePolicy:e=>({enabled:Number.isFinite(e)})}}})],m.prototype,"length",void 0),e([r({type:String,json:{write:!0}})],m.prototype,"name",void 0),e([r({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),e([d(s)],m.prototype,"type",void 0),e([r()],m.prototype,"valueType",void 0),e([p("valueType",["description"])],m.prototype,"readValueType",null),e([r({type:Boolean,json:{read:!1}})],m.prototype,"visible",void 0),m=u=e([i("esri.layers.support.Field")],m);export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{JSONSupport as r}from"../../core/JSONSupport.js";import{clone as t}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{persistable as a}from"../../core/accessorSupport/decorators/persistable.js";import n from"../../geometry/Polygon.js";import{canProjectWithoutEngine as p,projectPolygon as c}from"../../geometry/projectionUtils.js";import l from"../../geometry/SpatialReference.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{isInitialized as f,switchMeshModificationPolygonVCSSync as y}from"../../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as d,fromWasmModification as u}from"../../views/3d/layers/SceneLayerWorkerHandle.js";import{writer as g}from"../../core/accessorSupport/decorators/writer.js";var S;let h=S=class extends r{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,r,t,s){if(this._needWGS84Conversion(s))this._doWGS84Conversion(r,t,s);else if(s.layer?.spatialReference&&!s.layer.spatialReference.equals(this.geometry.spatialReference)){if(!p(e.spatialReference,s.layer.spatialReference))return void(s?.messages&&s.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:s.layer.spatialReference,context:s})));const i=new n;c(e,i,s.layer.spatialReference),r[t]=i.toJSON(s)}else r[t]=e.toJSON(s)}_needWGS84Conversion(e){if("integrated-mesh-3dtiles"===e.layer?.type){const r=e.layer;return!r.esriCrsSpatialReference||!m(r.esriCrsSpatialReference,this.geometry.spatialReference)}return!1}_doWGS84Conversion(e,r,t){let s=!0;if(f()){const o=d(null,[this],l.WGS84);if(o.length>1){const i=y({modifications:o,inVCS:5773});if(i.success&&i.modifications){const o=[this.clone()];u(i.modifications,o),1===o.length&&o[0].geometry&&(o[0].geometry.spatialReference=t.layer?.spatialReference,e[r]=o[0].geometry.toJSON(t),s=!1)}}}s&&t?.messages&&t.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:t.layer?.spatialReference,context:t}))}clone(){return new S({geometry:t(this.geometry),type:this.type})}};e([s({type:n}),a()],h.prototype,"geometry",void 0),e([g(["web-scene","portal-item"],"geometry")],h.prototype,"writeGeometry",null),e([s({type:["clip","mask","replace"],nonNullable:!0}),a()],h.prototype,"type",void 0),h=S=e([i("esri.layers.support.SceneModification")],h);export{h as default};
2
+ import{__decorate as e}from"tslib";import{JSONSupport as t}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import o from"../../core/Warning.js";import{property as s,subclass as i}from"../../core/accessorSupport/decorators.js";import{persistable as a}from"../../core/accessorSupport/decorators/persistable.js";import n from"../../geometry/Polygon.js";import{canProjectWithoutEngine as p,projectPolygon as c}from"../../geometry/projectionUtils.js";import l from"../../geometry/SpatialReference.js";import{equals as m}from"../../geometry/support/spatialReferenceUtils.js";import{default3DTilesSpatialReference as f}from"./tiles3DUtils.js";import{isInitialized as y,switchMeshModificationPolygonVCSSync as d}from"../../views/3d/layers/Lyr3DWorker.js";import{toWasmModification as u,fromWasmModification as g}from"../../views/3d/layers/SceneLayerWorkerHandle.js";import{writer as S}from"../../core/accessorSupport/decorators/writer.js";var h;let R=h=class extends t{constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,t,r,s){if(this._needWGS84Conversion(s))this._doWGS84Conversion(t,r,s);else if(s.layer?.spatialReference&&!s.layer.spatialReference.equals(this.geometry.spatialReference)){if(!p(e.spatialReference,s.layer.spatialReference))return void(s?.messages&&s.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:s.layer.spatialReference,context:s})));const i=new n;c(e,i,s.layer.spatialReference),t[r]=i.toJSON(s)}else t[r]=e.toJSON(s)}_needWGS84Conversion(e){if("integrated-mesh-3dtiles"===e.layer?.type){const t=e.layer;return!t.esriCrsSpatialReference||!m(t.esriCrsSpatialReference,this.geometry.spatialReference)}return!1}_doWGS84Conversion(e,t,r){let s=!0;if(y()){const o=u(null,[this],l.WGS84);if(o.length>1){const i=d({modifications:o,inVCS:5773});if(i.success&&i.modifications){const o=[this.clone()];g(i.modifications,o),1===o.length&&o[0].geometry&&(o[0].geometry.spatialReference=f,e[t]=o[0].geometry.toJSON(r),s=!1)}}}s&&r?.messages&&r.messages.push(new o("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:this.geometry.spatialReference,context:r}))}clone(){return new h({geometry:r(this.geometry),type:this.type})}};e([s({type:n}),a()],R.prototype,"geometry",void 0),e([S(["web-scene","portal-item"],"geometry")],R.prototype,"writeGeometry",null),e([s({type:["clip","mask","replace"],nonNullable:!0}),a()],R.prototype,"type",void 0),R=h=e([i("esri.layers.support.SceneModification")],R);export{R as default};
@@ -27,7 +27,7 @@ export type FieldType = "small-integer" | "integer" | "single" | "double" | "lon
27
27
  *
28
28
  * @since 5.0
29
29
  */
30
- export type FieldValueType = "binary" | "coordinate" | "count-or-amount" | "currency" | "date-and-time" | "description" | "email-address" | "location-or-place-name" | "measurement" | "name-or-title" | "none" | "ordered-or-ranked" | "percentage-or-ratio" | "phone-number" | "type-or-category" | "unique-identifier";
30
+ export type FieldValueType = "binary" | "coordinate" | "count-or-amount" | "currency" | "date-and-time" | "description" | "email-address" | "location-or-place-name" | "measurement" | "name-or-title" | "none" | "ordered-or-ranked" | "percentage-or-ratio" | "phone-number" | "type-or-category" | "unique-identifier" | "url";
31
31
 
32
32
  /**
33
33
  * Supported field formatting types.
package/layers/types.d.ts CHANGED
@@ -398,6 +398,7 @@ export interface QueryCapabilities {
398
398
  * for the individual features contributing to each [aggregated](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
399
399
  * statistics query result.
400
400
  *
401
+ * @internal
401
402
  * @since 5.1
402
403
  * @see [Query.returnStatisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/rest/support/Query/#returnStatisticsAggregatedIds)
403
404
  * @see [Graphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#statisticsAggregatedIds)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/core",
3
- "version": "5.1.0-next.113",
3
+ "version": "5.1.0-next.114",
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": [
@@ -801,6 +801,7 @@ export default class Query extends JSONSupport {
801
801
  * @default false
802
802
  * @see [QueryCapabilities](https://developers.arcgis.com/javascript/latest/references/core/layers/types/#QueryCapabilities)
803
803
  * @see [Graphic.statisticsAggregatedIds](https://developers.arcgis.com/javascript/latest/references/core/Graphic/#statisticsAggregatedIds)
804
+ * @internal
804
805
  * @since 5.1
805
806
  * @example
806
807
  * // query for the count of trees in each park and include the IDs of
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- const d="20260528",a="8731dde7deda889f9afea85983890b9983a7f4bd";export{d as buildDate,a as commitHash};
2
+ const b="20260529",e="185565f08aebb728d6723e786706d41673f85beb";export{b as buildDate,e as commitHash};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import t from"../../core/Logger.js";import{animationDebugFlags as n}from"./animationDebugFlags.js";import{defaultCIMValues as e}from"./defaultCIMValues.js";import{getExtent as o}from"./SDFHelper.js";import{getProcessParam as i,hasProcessParam as r,getSize as a,getValue as s}from"./utils.js";function l(t,n,e){return{transform:b(t,n,e.transform),fromColor:T(t,n,e.fromColor),toColor:I(t,n,e.toColor),colorMix:k(t,n,e.colorMix),toOpacity:O(t,n,e.toOpacity),opacityMix:x(t,n,e.opacityMix),shift:D(t,n,e.shift),hasAnimations:e.hasAnimations||c(n),hasShiftAnimation:e.hasShiftAnimation||m(n),hasMotionAnimations:e.hasMotionAnimations||f(n)}}function c(t){return"animations"in t&&!!t.animations&&t.animations.length>0}function m(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>"CIMSymbolAnimationMoveAlongLine"===t.type)}const p=new Set(["CIMSymbolAnimationOffset","CIMSymbolAnimationRotation","CIMSymbolAnimationSize","CIMSymbolAnimationScale"]);function f(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>p.has(t.type))}function y(t){return!n.forceStaticPath&&(n.forceAnimatedPath||t.hasAnimations)}function u(n,e,o){if("CIMCharacterMarker"===e.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const r=i(n,e,"OffsetX"),a=i(n,e,"OffsetY");if("CIMPictureMarker"===e.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:F([r,a]),rotation:F(0),scale:F(i(n,e,"Size")),parent:o.transform}};const s=e.frame,l=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:F([r,a]),rotation:F(0),scale:F({type:"Process",op:"Divide",left:i(n,e,"Size"),right:l}),parent:o.transform}}}function d(t,n){let e=0,o=0;const i="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(e=-t.anchorPoint.x,o=-t.anchorPoint.y),{...n,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:F([e,o]),rotation:F(0),scale:F(1),parent:n.transform}}}function C(t,n){return"Absolute"===t.anchorPointUnits?n:d(t,n)}function S(t,n){return"Absolute"!==t.anchorPointUnits?n:d(t,n)}function M(t,n,e){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:F([n,e]),rotation:F(0),scale:F(1),parent:t.transform}}}function A(t,n){const e=n?.5*-(n.xmin+n.xmax):0,i=n?.5*-(n.ymin+n.ymax):0;let r=0,a=0;if("x"in t&&"y"in t)r=t.x+e,a=t.y+i;else{const n=o(t);if(n){r=(n[0]+n[2])/2+e,a=(n[1]+n[3])/2+i}}return[r,a]}function h(t,n){switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,n,"Rotation")}return 0}function g(t,n){switch(n.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,n,"RotateClockwise")}return 0}function P(t,n){switch(n.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return i(t,n,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return i(t,n,"TintColor")}return[1,1,1,1]}function b(t,n,e){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:z(t,n),rotation:j(t,n),scale:R(t,n),parent:e}}function T(t,n,e){return{type:"AnimatedColor",color:F(P(t,n)),opacity:F(1),parent:e,applyToChildren:!1}}function I(t,n,e){const o=w(n);let r,a=v(e);if(a)r=[1,1,1,1];else{r=P(t,n);const e=o?.find(t=>"CIMSymbolAnimationColor"===t.type);e&&(r=i(t,e,"ToColor"),a="Override"===e.colorMode)}return{type:"AnimatedColor",color:F(r),opacity:F(1),parent:e,applyToChildren:a}}function k(t,n,e){const o=w(n),i=o?.find(t=>"CIMSymbolAnimationColor"===t.type);return i?{type:"AnimatedColor",color:F([1,1,1,1]),opacity:{from:0,to:1,timing:L(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:e}function v(t){return"object"==typeof t&&"applyToChildren"in t&&t.applyToChildren}function O(t,n,e){const o=w(n);let r=F(1);const a=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);if(a){r=F({type:"Process",op:"Transparency",value:i(t,a,"ToTransparency")})}return{type:"AnimatedColor",color:F([1,1,1,1]),opacity:r,parent:e,applyToChildren:!1}}function x(t,n,e){const o=w(n),i=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);return i?{type:"AnimatedColor",color:F([1,1,1,1]),opacity:{from:0,to:1,timing:L(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:e}function D(t,n,e){const o=w(n),a=o?.find(t=>"CIMSymbolAnimationMoveAlongLine"===t.type);if(!a)return e;let s,l;const c=L(t,a.animatedSymbolProperties),m=r(t,a,"DistanceAlong"),p=r(t,a,"Speed"),f=m&&i(t,a,"DistanceAlong"),y=p&&i(t,a,"Speed"),u=!0===a.continuous;if(!1!==f)s={type:"Process",op:"Divide",left:f,right:100},l=!0;else if(!1!==y)s={type:"Process",op:"Multiply",left:y,right:c.duration},l=!1;else{if(!u)throw new Error("Either distanceAlong, speed or continuous must be specified.");s=1,l=!0}return{type:"AnimatedShift",multiplyByLineLength:l,shift:{from:0,to:s,timing:c},parent:e}}function L(t,n){if(!n)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0};const o=i(t,n,"Duration");let r;if(i(t,n,"RandomizeStartTime")){r={type:"Process",op:"Random",min:0,max:o,seed:i(t,n,"RandomizeStartSeed")}}else r=i(t,n,"StartTimeOffset");const a=i(t,n,"RepeatDelay"),l=i(t,n,"PlayAnimation"),c=i(t,n,"ReverseAnimation"),m=s(n.repeatType,e.CIMAnimatedSymbolProperties.repeattype);return{duration:o,startTimeOffset:r,repeatDelay:a,timeOriginSelector:"None"===m?"Local":"Global",repeatType:m,easing:s(n.easing,e.CIMAnimatedSymbolProperties.easing),playAnimation:l,reverseAnimation:c}}function R(t,n){const e=w(n);let o;o="CIMPictureMarker"===n.type||"CIMVectorMarker"===n.type?i(t,n,"Size"):"CIMSolidStroke"===n.type||"CIMPictureStroke"===n.type?i(t,n,"Width"):a(n)||10;const r=e?.find(t=>"CIMSymbolAnimationScale"===t.type);if(!r){const n=e?.find(t=>"CIMSymbolAnimationSize"===t.type);if(!n)return F(1);return{from:1,to:{type:"Process",op:"Divide",left:i(t,n,"ToSize"),right:o},timing:L(t,n.animatedSymbolProperties)}}return{from:1,to:i(t,r,"ScaleFactor"),timing:L(t,r.animatedSymbolProperties)}}function w(t){return"animations"in t&&t.animations||[]}function z(t,n){const e=w(n),o=e?.find(t=>"CIMSymbolAnimationOffset"===t.type);if(!o)return F([0,0]);return{from:[0,0],to:[i(t,o,"OffsetX"),i(t,o,"OffsetY")],timing:L(t,o.animatedSymbolProperties)}}function j(t,n){const e=w(n),o=g(t,n),r={type:"Process",op:"Divide",left:h(t,n),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},a=e?.find(t=>"CIMSymbolAnimationRotation"===t.type);if(!a)return F(r);const s={type:"Process",op:"Add",left:i(t,a,"ToRotation"),right:{type:"Process",op:"Divide",left:r,right:-1}};return{from:r,to:{type:"Process",op:"Add",left:r,right:{type:"Process",op:"Cond",condition:i(t,a,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:L(t,a.animatedSymbolProperties)}}function F(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0}}}function V(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const n in t)if(V(t[n]))return!0;return!1}export{V as checkForAnimations,l as getAnimationParams,A as getFrameTranslation,F as getStaticParam,S as handleAbsoluteAnchor,d as handleAnchor,u as handleMarker,C as handleRelativeAnchor,y as shouldUseAnimatedPath,M as translate};
2
+ import t from"../../core/Logger.js";import{animationDebugFlags as e}from"./animationDebugFlags.js";import{defaultCIMValues as n}from"./defaultCIMValues.js";import{getExtent as o}from"./SDFHelper.js";import{getProcessParam as i,getValue as r,hasProcessParam as a,getSize as s}from"./utils.js";function l(t,e,n){return{transform:T(t,e,n.transform),fromColor:b(t,e,n.fromColor),toColor:I(t,e,n.toColor),colorMix:v(t,e,n.colorMix),toOpacity:k(t,e,n.toOpacity),opacityMix:L(t,e,n.opacityMix),shift:w(t,e,n.shift),hasAnimations:n.hasAnimations||m(e),hasShiftAnimation:n.hasShiftAnimation||c(e),hasMotionAnimations:n.hasMotionAnimations||f(e)}}function m(t){return"animations"in t&&!!t.animations&&t.animations.length>0}function c(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>"CIMSymbolAnimationMoveAlongLine"===t.type)}const p=new Set(["CIMSymbolAnimationOffset","CIMSymbolAnimationRotation","CIMSymbolAnimationSize","CIMSymbolAnimationScale"]);function f(t){return"animations"in t&&!!t.animations&&t.animations.some(t=>p.has(t.type))}function y(t){return!e.forceStaticPath&&(e.forceAnimatedPath||t.hasAnimations)}function u(e,n,o){if("CIMCharacterMarker"===n.type)return t.getLogger("animationUtils").error("#handleMarker()","CIM character markers do not support animations"),o;const r=i(e,n,"OffsetX"),a=i(e,n,"OffsetY");if("CIMPictureMarker"===n.type)return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!0,translation:V([r,a]),rotation:V(0),scale:V(i(e,n,"Size")),parent:o.transform}};const s=n.frame,l=s.ymax-s.ymin;return{...o,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:V([r,a]),rotation:V(0),scale:V({type:"Process",op:"Divide",left:i(e,n,"Size"),right:l}),parent:o.transform}}}function d(t,e){let n=0,o=0;const i="Absolute"!==t.anchorPointUnits;return t.anchorPoint&&(n=-t.anchorPoint.x,o=-t.anchorPoint.y),{...e,transform:{type:"AnimatedTransform",relativeTranslation:i,absoluteScale:!1,translation:V([n,o]),rotation:V(0),scale:V(1),parent:e.transform}}}function S(t,e){return"Absolute"===t.anchorPointUnits?e:d(t,e)}function C(t,e){return"Absolute"!==t.anchorPointUnits?e:d(t,e)}function M(t,e,n){return{...t,transform:{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:V([e,n]),rotation:V(0),scale:V(1),parent:t.transform}}}function h(t,e){const n=e?.5*-(e.xmin+e.xmax):0,i=e?.5*-(e.ymin+e.ymax):0;let r=0,a=0;if("x"in t&&"y"in t)r=t.x+n,a=t.y+i;else{const e=o(t);if(e){r=(e[0]+e[2])/2+n,a=(e[1]+e[3])/2+i}}return[r,a]}function A(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"Rotation")}return 0}function g(t,e){switch(e.type){case"CIMPictureMarker":case"CIMVectorMarker":return i(t,e,"RotateClockwise")}return 0}function P(t,e){switch(e.type){case"CIMPointSymbol":case"CIMVectorMarker":return[1,1,1,1];case"CIMSolidStroke":case"CIMSolidFill":return i(t,e,"Color");case"CIMPictureMarker":case"CIMPictureStroke":case"CIMPictureFill":return i(t,e,"TintColor")}return[1,1,1,1]}function T(t,e,n){return{type:"AnimatedTransform",relativeTranslation:!1,absoluteScale:!1,translation:j(t,e),rotation:F(t,e),scale:R(t,e),parent:n}}function b(t,e,n){return{type:"AnimatedColor",color:V(P(t,e)),opacity:V(1),parent:n,applyToChildren:!1}}function I(t,e,n){const o=z(e);let r,a=D(n);if(a)r=[1,1,1,1];else{r=P(t,e);const n=o?.find(t=>"CIMSymbolAnimationColor"===t.type);n&&(r=i(t,n,"ToColor"),a="Override"===n.colorMode)}return{type:"AnimatedColor",color:V(r),opacity:V(1),parent:n,applyToChildren:a}}function v(t,e,n){const o=z(e),i=o?.find(t=>"CIMSymbolAnimationColor"===t.type);return i?{type:"AnimatedColor",color:V([1,1,1,1]),opacity:{from:0,to:1,timing:x(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}function D(t){return"object"==typeof t&&"applyToChildren"in t&&t.applyToChildren}function k(t,e,n){const o=z(e);let r=V(1);const a=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);if(a){r=V({type:"Process",op:"Transparency",value:i(t,a,"ToTransparency")})}return{type:"AnimatedColor",color:V([1,1,1,1]),opacity:r,parent:n,applyToChildren:!1}}function L(t,e,n){const o=z(e),i=o?.find(t=>"CIMSymbolAnimationTransparency"===t.type);return i?{type:"AnimatedColor",color:V([1,1,1,1]),opacity:{from:0,to:1,timing:x(t,i?.animatedSymbolProperties)},parent:[1,1,1,1],applyToChildren:!1}:n}const O=120;function w(t,e,o){const s=z(e),l=s?.find(t=>"CIMSymbolAnimationMoveAlongLine"===t.type);if(!l)return o;const m=r(l.movementType,n.CIMSymbolAnimationMoveAlongLine.movementtype);let c,p=!1,f=!1,y=x(t,l.animatedSymbolProperties);const u=a(t,l,"DistanceAlong"),d=a(t,l,"Speed"),S=u&&i(t,l,"DistanceAlong"),C=d&&i(t,l,"Speed"),M=!0===l.continuous;if("Distance"===m){if(!1===S)throw new Error("distanceAlong must be specified when movementType is 'Distance'.");c={type:"Process",op:"Divide",left:S,right:100},p=!0,C&&(f=!0,y={...y,duration:{type:"Process",op:"Divide",left:c,right:C}})}else{if("Speed"!==m)throw new Error("movementType is required; allowed values are 'Distance' and 'Speed'.");if(!1===C)throw new Error("speed must be specified when movementType is 'Speed'.");c={type:"Process",op:"Multiply",left:C,right:y.duration}}return M&&(c={type:"Process",op:"Multiply",left:c,right:O},y={...y,duration:{type:"Process",op:"Multiply",left:y.duration,right:O}}),{type:"AnimatedShift",multiplyToByLineLength:p,multiplyDurationByLineLength:f,shift:{from:0,to:c,timing:y},parent:o}}function x(t,e){if(!e)return{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0};const o=i(t,e,"Duration");let a;if(i(t,e,"RandomizeStartTime")){a={type:"Process",op:"Random",min:0,max:o,seed:i(t,e,"RandomizeStartSeed")}}else a=i(t,e,"StartTimeOffset");const s=i(t,e,"RepeatDelay"),l=i(t,e,"PlayAnimation"),m=i(t,e,"ReverseAnimation"),c=r(e.repeatType,n.CIMAnimatedSymbolProperties.repeattype);return{duration:o,startTimeOffset:a,repeatDelay:s,timeOriginSelector:"None"===c?"Local":"Global",repeatType:c,easing:r(e.easing,n.CIMAnimatedSymbolProperties.easing),playAnimation:l,reverseAnimation:m}}function R(t,e){const n=z(e);let o;o="CIMPictureMarker"===e.type||"CIMVectorMarker"===e.type?i(t,e,"Size"):"CIMSolidStroke"===e.type||"CIMPictureStroke"===e.type?i(t,e,"Width"):s(e)||10;const r=n?.find(t=>"CIMSymbolAnimationScale"===t.type);if(!r){const e=n?.find(t=>"CIMSymbolAnimationSize"===t.type);if(!e)return V(1);return{from:1,to:{type:"Process",op:"Divide",left:i(t,e,"ToSize"),right:o},timing:x(t,e.animatedSymbolProperties)}}return{from:1,to:i(t,r,"ScaleFactor"),timing:x(t,r.animatedSymbolProperties)}}function z(t){return"animations"in t&&t.animations||[]}function j(t,e){const n=z(e),o=n?.find(t=>"CIMSymbolAnimationOffset"===t.type);if(!o)return V([0,0]);return{from:[0,0],to:[i(t,o,"OffsetX"),i(t,o,"OffsetY")],timing:x(t,o.animatedSymbolProperties)}}function F(t,e){const n=z(e),o=g(t,e),r={type:"Process",op:"Divide",left:A(t,e),right:{type:"Process",op:"Cond",condition:o,ifTrue:-1,ifFalse:1}},a=n?.find(t=>"CIMSymbolAnimationRotation"===t.type);if(!a)return V(r);const s={type:"Process",op:"Add",left:i(t,a,"ToRotation"),right:{type:"Process",op:"Divide",left:r,right:-1}};return{from:r,to:{type:"Process",op:"Add",left:r,right:{type:"Process",op:"Cond",condition:i(t,a,"RotateClockwise"),ifTrue:{type:"Process",op:"MatchWinding",sign:-1,angle:s},ifFalse:{type:"Process",op:"MatchWinding",sign:1,angle:s}}},timing:x(t,a.animatedSymbolProperties)}}function V(t){return{from:t,to:t,timing:{duration:1,startTimeOffset:0,repeatDelay:0,timeOriginSelector:"Local",repeatType:"Loop",easing:"Linear",playAnimation:1,reverseAnimation:0}}}function U(t){if(null==t)return!1;if("object"!=typeof t)return!1;if(t.animations&&Array.isArray(t.animations)&&t.animations.length>0)return!0;for(const e in t)if(U(t[e]))return!0;return!1}export{U as checkForAnimations,l as getAnimationParams,h as getFrameTranslation,V as getStaticParam,C as handleAbsoluteAnchor,d as handleAnchor,u as handleMarker,S as handleRelativeAnchor,y as shouldUseAnimatedPath,M as translate};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{CIMSymbolUnits as e}from"./types.js";const t={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},o={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry",width:25},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRadial:{angle:0,length:5},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:"Loop",repeatdelay:0,easing:"Linear"},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1],colormode:"Multiply"},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0},CIMSymbolAnimationMoveAlongLine:{speed:30,distanceAlong:100}};export{t as defaultCIMColor,o as defaultCIMValues};
2
+ import{CIMSymbolUnits as e}from"./types.js";const t={color:[128,128,128,1],outlinecolor:[0,0,0,1],backgroundcolor:[128,128,128,1],borderlinecolor:[0,0,0,1],tintcolor:[255,255,255,1]},o={CIMVectorMarker:{scalesymbolsproportionally:!1,respectframe:!0,anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMPictureMarker:{scalex:1,texturefilter:"Draft",anchorpointunits:"Relative",offsetx:0,offsety:0,rotateclockwise:!1,rotation:0,size:10,enable:!0,colorlocked:!1},CIMTextSymbol:{angle:0,anglex:0,angley:0,halosize:1,height:10,horizontalalignment:"Left",kerning:!0,letterspacing:0,letterwidth:100,ligatures:!0,linegap:0,offsetx:0,offsety:0,strikethrough:!1,textcase:"Normal",textstring:"",underline:!1,verticalalignment:"Bottom",enable:!0,colorlocked:!1},CIMSolidStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMPictureStroke:{texturefilter:"Draft",capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1},CIMGradientStroke:{capstyle:"Round",joinstyle:"Round",miterlimit:4,width:4,enable:!0,colorlocked:!1,gradientMethod:"AcrossLine",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMSolidFill:{enable:!0,colorlocked:!1},CIMPictureFill:{offsetx:0,offsety:0,rotation:0,scalex:1,height:10,texturefilter:"Draft",enable:!0,colorlocked:!1},CIMHatchFill:{offsetx:0,offsety:0,rotation:0,separation:4,enable:!0,colorlocked:!1},CIMGradientFill:{enable:!0,angle:90,gradientMethod:"Linear",gradientSize:75,gradientSizeUnits:e.Relative,gradientType:"Discrete",interval:5},CIMGeometricEffectAddControlPoints:{angletolerance:120},CIMGeometricEffectArrow:{arrowtype:"OpenEnded",width:5},CIMGeometricEffectBuffer:{size:1},CIMGeometricEffectCut:{begincut:1,endcut:1,middlecut:0,invert:!1},CIMGeometricEffectDashes:{customendingoffset:0,linedashending:"NoConstraint",offsetalongline:0},CIMGeometricEffectDonut:{method:"Mitered",option:"Accurate",width:2},CIMGeometricEffectJog:{angle:225,length:20,position:50},CIMGeometricEffectControlMeasureLine:{rule:"FullGeometry",width:25},CIMGeometricEffectMove:{offsetx:1,offsety:-1},CIMGeometricEffectOffset:{method:"Square",offset:1,option:"Fast"},CIMGeometricEffectRadial:{angle:0,length:5},CIMGeometricEffectRotate:{angle:15},CIMGeometricEffectScale:{xscalefactor:1.15,yscalefactor:1.15},CIMGeometricEffectWave:{amplitude:2,period:3,seed:1,waveform:"Sinus"},CIMMarkerPlacementAlongLine:{customendingoffset:0,endings:"WithHalfGap",offsetalongline:0,placeperpart:!0,angletoline:!0,offset:0},CIMMarkerPlacementAtExtremities:{extremityplacement:"Both",offsetalongline:0,angletoline:!0,offset:0},CIMMarkerPlacementAtRatioPositions:{beginposition:0,endposition:0,flipfirst:!0,angletoline:!0,offset:0},CIMMarkerPlacementInsidePolygon:{gridangle:0,gridtype:"Fixed",offsetx:0,offsety:0,randomness:100,seed:0,shiftoddrows:!1,stepx:16,stepy:16,clipping:"ClipAtBoundary"},CIMMarkerPlacementOnLine:{relativeto:"LineMiddle",startpointoffset:0,angletoline:!0,offset:0},CIMMarkerPlacementOnVertices:{placeperpart:!0,placeoncontrolpoints:!0,placeonendpoints:!0,placeonregularvertices:!0,angletoline:!0,offset:0},CIMMarkerPlacementPolygonCenter:{method:"OnPolygon",offsetx:0,offsety:0,clipatboundary:!1},CIMAnimatedSymbolProperties:{playanimation:!1,reverseanimation:!1,randomizestarttime:!1,randomizestartseed:0,starttimeoffset:0,duration:3,endingduration:3,useendingduration:!1,repeattype:"Loop",repeatdelay:0,easing:"Linear"},CIMSymbolAnimationSize:{tosize:10},CIMSymbolAnimationScale:{scalefactor:1},CIMSymbolAnimationColor:{tocolor:[255,255,255,1],colormode:"Multiply"},CIMSymbolAnimationTransparency:{totransparency:0},CIMSymbolAnimationRotation:{torotation:0,rotateclockwise:!1},CIMSymbolAnimationOffset:{offsetx:0,offsety:0},CIMSymbolAnimationMoveAlongLine:{speed:30,distancealong:100,movementtype:"Distance"}};export{t as defaultCIMColor,o as defaultCIMValues};