@arcgis/core 4.33.0-next.20250210 → 4.33.0-next.20250212

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 (562) hide show
  1. package/AttributeBinsGraphic.js +1 -1
  2. package/Graphic.js +1 -1
  3. package/Ground.js +1 -1
  4. package/WebMap.js +1 -1
  5. package/WebScene.js +1 -1
  6. package/arcade/ArcadeModuleResolver.js +1 -1
  7. package/arcade/featureset/actions/Adapted.js +1 -1
  8. package/arcade/featureset/support/FeatureSet.js +1 -1
  9. package/arcade/featureset/support/Guid.js +1 -1
  10. package/arcade/featureset/support/cache.js +1 -1
  11. package/assets/esri/core/workers/RemoteClient.js +1 -1
  12. package/assets/esri/core/workers/chunks/{d31f7598629f7cc50233.js → 004853abf357f865b4fa.js} +1 -1
  13. package/assets/esri/core/workers/chunks/00e374e3b4781c4f9a3e.js +1 -0
  14. package/assets/esri/core/workers/chunks/{746c964cf07e4306f21f.js → 03f51ea011ffbcfb7c7d.js} +1 -1
  15. package/assets/esri/core/workers/chunks/{ad3e692681b50bd1acc2.js → 03fac4c79641603d8cba.js} +1 -1
  16. package/assets/esri/core/workers/chunks/{0167cf867d8e46c818b0.js → 09260bbe1fd6ce5a53e6.js} +1 -1
  17. package/assets/esri/core/workers/chunks/{3c23e567cfb7372c44ba.js → 0a5689348d544090006d.js} +1 -1
  18. package/assets/esri/core/workers/chunks/0b8bf1966653c326e95a.js +1 -0
  19. package/assets/esri/core/workers/chunks/{d1718ad93e3271b0525e.js → 0e4350fda5328862f2fb.js} +1 -1
  20. package/assets/esri/core/workers/chunks/{c26ffbff1115e76bcb0f.js → 1249fd2f83caeaefd8ce.js} +1 -1
  21. package/assets/esri/core/workers/chunks/135fb580d8afd8d60811.js +1 -0
  22. package/assets/esri/core/workers/chunks/{946a9890f3621d1dfbc5.js → 144e534d4ac1aafab60d.js} +1 -1
  23. package/assets/esri/core/workers/chunks/{cee3a38b92a48a58c4d0.js → 152becae48572299b07f.js} +1 -1
  24. package/assets/esri/core/workers/chunks/{f200dca22f9f9bbb8670.js → 17213c3fc63f580e5b73.js} +1 -1
  25. package/assets/esri/core/workers/chunks/1a286d43daa3b811c30d.js +1 -0
  26. package/assets/esri/core/workers/chunks/{e5e3b6d00d27b5bb354f.js → 1d282700e76285a1684c.js} +1 -1
  27. package/assets/esri/core/workers/chunks/2130e0c8d2410c87f880.js +1 -0
  28. package/assets/esri/core/workers/chunks/24e6476f32ad2014d39d.js +1 -0
  29. package/assets/esri/core/workers/chunks/2530e5d1f438db8a7b5c.js +1 -0
  30. package/assets/esri/core/workers/chunks/272662e4e28341419b4f.js +1 -0
  31. package/assets/esri/core/workers/chunks/{dfaf1da323906ee60549.js → 2876419a32537e24b7da.js} +1 -1
  32. package/assets/esri/core/workers/chunks/2b733e8043659466e194.js +1 -0
  33. package/assets/esri/core/workers/chunks/{5fbdb5fea7d6676fcf19.js → 2c1a85a801cb4d9d737e.js} +1 -1
  34. package/assets/esri/core/workers/chunks/{7f87cf3d6a365d987f69.js → 30bd5b3204e09f516ea2.js} +1 -1
  35. package/assets/esri/core/workers/chunks/311c85bd94d5fb28e272.js +1 -0
  36. package/assets/esri/core/workers/chunks/33c6fd524711efd8ef13.js +1 -0
  37. package/assets/esri/core/workers/chunks/{594d923400fd74881833.js → 35392bf8f21005ad6170.js} +1 -1
  38. package/assets/esri/core/workers/chunks/{c04091eea7089dc2e864.js → 35bcb0622234b38d85b4.js} +1 -1
  39. package/assets/esri/core/workers/chunks/{92984981afcbb95828cd.js → 37cfd102b6ab5b959f9d.js} +1 -1
  40. package/assets/esri/core/workers/chunks/3835c2884c55e73dc202.js +1 -0
  41. package/assets/esri/core/workers/chunks/{de1f3c4b8000c2d73013.js → 39dca492cc5f089e1609.js} +1 -1
  42. package/assets/esri/core/workers/chunks/3ba85f1d660b8887f963.js +314 -0
  43. package/assets/esri/core/workers/chunks/{1d51c064045e9c47bd2e.js → 3bad184751fcb26c003c.js} +1 -1
  44. package/assets/esri/core/workers/chunks/{5b85f9da022742f602e2.js → 3c8e5b5fb52611e30ed6.js} +1 -1
  45. package/assets/esri/core/workers/chunks/{e468bf4ec7402942ad8c.js → 3ebdd0701e77bb28c75d.js} +1 -1
  46. package/assets/esri/core/workers/chunks/{a559db8654b4f83fd79b.js → 3f6516af411256d90a03.js} +1 -1
  47. package/assets/esri/core/workers/chunks/{c83b26ff96e39266adc2.js → 4300c80fa10c5d9141e8.js} +1 -1
  48. package/assets/esri/core/workers/chunks/4848a3e31632d15dc4ce.js +1 -0
  49. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js → 486df1e042204b90b0dd.js} +2 -2
  50. package/assets/esri/core/workers/chunks/{77764ca90bdd13ee2167.js.LICENSE.txt → 486df1e042204b90b0dd.js.LICENSE.txt} +1 -1
  51. package/assets/esri/core/workers/chunks/491effb2c681493cc3a6.js +1 -0
  52. package/assets/esri/core/workers/chunks/{e93dea6b112ce8e2779b.js → 4b47549614d53ce1e384.js} +1 -1
  53. package/assets/esri/core/workers/chunks/52f61e1f5972a72b6b54.js +1 -0
  54. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js → 5693d9ce4472a4c5959f.js} +2 -2
  55. package/assets/esri/core/workers/chunks/{354531dc2f0dea2ad96f.js.LICENSE.txt → 5693d9ce4472a4c5959f.js.LICENSE.txt} +1 -1
  56. package/assets/esri/core/workers/chunks/{e56647e61296643c5f84.js → 5719471414810b6a9aec.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{1accbc048b74857269e4.js → 57924f4909f2cbe5d64c.js} +1 -1
  58. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js → 5b56b271afb0fadf48b4.js} +2 -2
  59. package/assets/esri/core/workers/chunks/{b21b152fa15896577242.js.LICENSE.txt → 5b56b271afb0fadf48b4.js.LICENSE.txt} +1 -1
  60. package/assets/esri/core/workers/chunks/{b3aeda290470dcb2bdd2.js → 5cf08ee5114273163e09.js} +1 -1
  61. package/assets/esri/core/workers/chunks/{2971266a49226e769360.js → 5e5045add6567588b90a.js} +1 -1
  62. package/assets/esri/core/workers/chunks/{5721557a1d8eab23a55b.js → 5eceedac9b2b4d1ef133.js} +1 -1
  63. package/assets/esri/core/workers/chunks/{76794184ba8c2e66745e.js → 629f4621ba6ffdcaa2f9.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js → 6518954889df2e781c47.js} +2 -2
  65. package/assets/esri/core/workers/chunks/{32d3657dcae89b740f8b.js.LICENSE.txt → 6518954889df2e781c47.js.LICENSE.txt} +1 -1
  66. package/assets/esri/core/workers/chunks/6a9a1cd8134a903dd05a.js +1 -0
  67. package/assets/esri/core/workers/chunks/{220b12654b94c94f8d8a.js → 6fa1f1e431aae1794ce3.js} +1 -1
  68. package/assets/esri/core/workers/chunks/7485588bd24217669578.js +1 -0
  69. package/assets/esri/core/workers/chunks/74e0116ae84def626c87.js +1 -0
  70. package/assets/esri/core/workers/chunks/{c4374b6bc5c8dc6435c7.js → 7c81e08fc8a67dcd9dad.js} +1 -1
  71. package/assets/esri/core/workers/chunks/{433576983754f690bcc7.js → 7e3b374f906441cd7fb0.js} +1 -1
  72. package/assets/esri/core/workers/chunks/{8c32cee395da0a7b9a8e.js → 80d3aa3f27ad5b2b969b.js} +1 -1
  73. package/assets/esri/core/workers/chunks/82facb23dfaba2819bc7.js +1 -0
  74. package/assets/esri/core/workers/chunks/{de4384b5833a60e88e31.js → 84c1c3336011a1b79669.js} +1 -1
  75. package/assets/esri/core/workers/chunks/8722d05ae9b0aa5162a4.js +1 -0
  76. package/assets/esri/core/workers/chunks/8939479cd433cc53f6c1.js +1 -0
  77. package/assets/esri/core/workers/chunks/{28dd172faa85080511c5.js → 8a2f3ce46eeac853b3a9.js} +1 -1
  78. package/assets/esri/core/workers/chunks/8b6580329e1e35ea4190.js +1 -0
  79. package/assets/esri/core/workers/chunks/8bfeef7cffe1e65c9dab.js +1 -0
  80. package/assets/esri/core/workers/chunks/8de4280080296adb1757.js +1 -0
  81. package/assets/esri/core/workers/chunks/{b44cf0e4c2f93408cabc.js → 9205115bdb5bc03d0c02.js} +1 -1
  82. package/assets/esri/core/workers/chunks/92d76d59113b4139befe.js +1 -0
  83. package/assets/esri/core/workers/chunks/9421ae38fdf986b9b107.js +1 -0
  84. package/assets/esri/core/workers/chunks/{1f443b99653708470f31.js → 96d7f47ea8fbf345101c.js} +1 -1
  85. package/assets/esri/core/workers/chunks/99c136b800e5fc7e04f4.js +1 -0
  86. package/assets/esri/core/workers/chunks/{d339dee99c4820b63f39.js → 9b74635d80d029498da1.js} +1 -1
  87. package/assets/esri/core/workers/chunks/{c2336d1f5b2b7bf6e7a7.js → 9bd6a4bf8150a6f618ea.js} +1 -1
  88. package/assets/esri/core/workers/chunks/9e7895e8201127ffe0a8.js +1 -0
  89. package/assets/esri/core/workers/chunks/{e6087eda5e3b7e5ad3e1.js → a12afed58acff17708ca.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{7b367bb0ed9c218ca595.js → a52690a27f8732739c02.js} +1 -1
  91. package/assets/esri/core/workers/chunks/{cdd8983cf3a301805680.js → a52c282609a7e9c8ca9e.js} +1 -1
  92. package/assets/esri/core/workers/chunks/a56b3dffd9f38973f350.js +1 -0
  93. package/assets/esri/core/workers/chunks/{95ad76e58452b60fb79f.js → a864ef9b584c83ebf6ae.js} +1 -1
  94. package/assets/esri/core/workers/chunks/a9274c9132e7a2691abb.js +1 -0
  95. package/assets/esri/core/workers/chunks/{df3d1a8d3f11d52eb30d.js → afdbdc1569b56489c14d.js} +1 -1
  96. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js → b0952b81d5be214262dd.js} +2 -2
  97. package/assets/esri/core/workers/chunks/{308ec51ff4a66f7fcb0d.js.LICENSE.txt → b0952b81d5be214262dd.js.LICENSE.txt} +1 -1
  98. package/assets/esri/core/workers/chunks/b253cf42e53f957b4b4e.js +1 -0
  99. package/assets/esri/core/workers/chunks/{89e3f7880abd014a62c0.js → b42d26123784997c66e8.js} +1 -1
  100. package/assets/esri/core/workers/chunks/b50176897ffadc53573e.js +1 -0
  101. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js → b83151b03bbeba466f82.js} +2 -2
  102. package/assets/esri/core/workers/chunks/{4040158835f9036967cd.js.LICENSE.txt → b83151b03bbeba466f82.js.LICENSE.txt} +1 -1
  103. package/assets/esri/core/workers/chunks/bf0bf2b912d668575a9b.js +1 -0
  104. package/assets/esri/core/workers/chunks/{94490937dca566fe2640.js → c061cad8323f0469e7e4.js} +1 -1
  105. package/assets/esri/core/workers/chunks/c3dc355d0f8d89b9b7b8.js +1 -0
  106. package/assets/esri/core/workers/chunks/{fef135e55706d84d1947.js → c4ce3c35b52b7999e877.js} +1 -1
  107. package/assets/esri/core/workers/chunks/c77ade444aa2f3f2b599.js +1 -0
  108. package/assets/esri/core/workers/chunks/ca6180e572e69540c183.js +1 -0
  109. package/assets/esri/core/workers/chunks/{16f82e9d98371431b46d.js → cc085918c63da416e59d.js} +1 -1
  110. package/assets/esri/core/workers/chunks/cc8eb975a543556f88ae.js +1 -0
  111. package/assets/esri/core/workers/chunks/{8e90c5fee4ad7c7275dc.js → cccd215b0a4890551957.js} +1 -1
  112. package/assets/esri/core/workers/chunks/ce88224af357957dd83a.js +1 -0
  113. package/assets/esri/core/workers/chunks/{07c5f3fc475c57f5a7a7.js → cf00df122df3db3b0c23.js} +1 -1
  114. package/assets/esri/core/workers/chunks/d074c916b414432a7b6a.js +1 -0
  115. package/assets/esri/core/workers/chunks/d342c56558f164e9e786.js +1 -0
  116. package/assets/esri/core/workers/chunks/{3c591f76e7d6204b7780.js → d3f7ff03ab5b40062d89.js} +1 -1
  117. package/assets/esri/core/workers/chunks/{6e6422eda398774acbc7.js → d60da671aba70485050e.js} +1 -1
  118. package/assets/esri/core/workers/chunks/{9d61590c4d21c7421925.js → d7b260d6187f29e0c136.js} +1 -1
  119. package/assets/esri/core/workers/chunks/de638753a30c9aa41bad.js +1 -0
  120. package/assets/esri/core/workers/chunks/de87009542886fad9a2f.js +2 -0
  121. package/assets/esri/core/workers/chunks/{b765670b47d209d7655a.js.LICENSE.txt → de87009542886fad9a2f.js.LICENSE.txt} +1 -1
  122. package/assets/esri/core/workers/chunks/{bb73cd34fbae935ccbcc.js → dff4a9d656b84fe3e052.js} +1 -1
  123. package/assets/esri/core/workers/chunks/e03e237e7e6ffc8b7f0d.js +1 -0
  124. package/assets/esri/core/workers/chunks/{0b62871b89dcb4c70457.js → e21941260bae30061c2c.js} +1 -1
  125. package/assets/esri/core/workers/chunks/e490f70f192780d7ad50.js +1 -0
  126. package/assets/esri/core/workers/chunks/e6633f0326a44477f630.js +1 -0
  127. package/assets/esri/core/workers/chunks/e71b780d1e6a32f303b7.js +1 -0
  128. package/assets/esri/core/workers/chunks/eac28b0f6fccfabcc3ca.js +1 -0
  129. package/assets/esri/core/workers/chunks/{01c3507d78398baaf61b.js → eb0ce7937813d1be1284.js} +1 -1
  130. package/assets/esri/core/workers/chunks/{f198f4ba7d3d52882d98.js → efded84870064c3d8210.js} +1 -1
  131. package/assets/esri/core/workers/chunks/f088e7db4e7ac85aaff1.js +1 -0
  132. package/assets/esri/core/workers/chunks/{15e08e8a8a72b177d74c.js → f0d28fe4deb7cd894765.js} +1 -1
  133. package/assets/esri/core/workers/chunks/{c8a0089e080140db9076.js → f285ed5425b31123d2bc.js} +1 -1
  134. package/assets/esri/core/workers/chunks/f4ba823c8acd60c7c82d.js +1 -0
  135. package/assets/esri/core/workers/chunks/f52ed527b46c316eb369.js +1 -0
  136. package/assets/esri/core/workers/chunks/{140d0c4285c6978103ea.js → f5ce6af342c02a4b0d15.js} +7 -7
  137. package/assets/esri/core/workers/chunks/{1cbeac3301b6943bb28a.js → fc07d47d44c04f123650.js} +1 -1
  138. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  139. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  140. package/assets/esri/themes/base/_core.scss +4 -0
  141. package/assets/esri/themes/base/widgets/_BasemapGallery.scss +0 -5
  142. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationLayers.scss +80 -0
  143. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationList.scss +14 -0
  144. package/assets/esri/themes/base/widgets/_FeatureFormUtilityNetworkAssociationSettings.scss +41 -0
  145. package/assets/esri/themes/base/widgets/_FilterBuilder.scss +1 -6
  146. package/assets/esri/themes/dark/main.css +1 -1
  147. package/assets/esri/themes/light/main.css +1 -1
  148. package/assets/esri/themes/light/view.css +1 -1
  149. package/chunks/Bufferer-B-V7yYm-.js +5 -0
  150. package/chunks/Distance2DCalculator-Coa0qAFt.js +5 -0
  151. package/chunks/Envelope.js +1 -1
  152. package/chunks/{GeodeticDistanceCalculator-BsWHOuqE.js → GeodeticDistanceCalculator-D4iQ-_NX.js} +1 -1
  153. package/chunks/Geometry.js +1 -1
  154. package/chunks/OperatorClip.js +1 -1
  155. package/chunks/OperatorCut.js +1 -1
  156. package/chunks/OperatorGeneralize.js +1 -1
  157. package/chunks/OperatorGeodesicBuffer.js +1 -1
  158. package/chunks/OperatorGeodeticArea.js +1 -1
  159. package/chunks/OperatorGeodeticDistance.js +1 -1
  160. package/chunks/OperatorMultiPartToSinglePart.js +1 -1
  161. package/chunks/OperatorProximity.js +1 -1
  162. package/chunks/OperatorProximityGeodesic.js +1 -1
  163. package/chunks/OperatorShapePreservingLength.js +1 -1
  164. package/chunks/OperatorShapePreservingProject.js +1 -1
  165. package/chunks/Point2D.js +1 -1
  166. package/chunks/ProjectionTransformation.js +1 -1
  167. package/chunks/QuadraticBezier.js +1 -1
  168. package/chunks/ShadowHighlight.glsl.js +2 -4
  169. package/chunks/SideCalculator2D-BNwb5gvz.js +1 -1
  170. package/chunks/disjointOperator.js +1 -1
  171. package/chunks/distanceOperator.js +1 -1
  172. package/chunks/lyr3DWorker.js +1 -1
  173. package/core/Accessor.js +1 -1
  174. package/core/Collection.js +1 -1
  175. package/core/Logger.js +1 -1
  176. package/core/ObjectPool.js +1 -1
  177. package/core/RandomLCG.js +1 -1
  178. package/core/XHRAdapter.js +1 -1
  179. package/core/accessorSupport/watch.js +1 -1
  180. package/core/pbf.js +1 -1
  181. package/core/sql/UnknownTimeZone.js +1 -1
  182. package/core/sql.js +1 -1
  183. package/core/workers/RemoteClient.js +1 -1
  184. package/editing/sharedTemplates/SharedTemplate.d.ts +4 -0
  185. package/editing/sharedTemplates/SharedTemplate.js +1 -1
  186. package/editing/sharedTemplates/SharedTemplateMetadata.js +1 -1
  187. package/editing/sharedTemplates/SharedTemplateProvider.js +1 -1
  188. package/editing/sharedTemplates/executor/builders/bufferLineToPolygon.js +1 -1
  189. package/editing/sharedTemplates/executor/builders/bufferPointToPolygon.js +1 -1
  190. package/editing/sharedTemplates/executor/builders/bufferPolygonToPolygon.js +1 -1
  191. package/editing/sharedTemplates/executor/builders/equallySpaced.js +1 -1
  192. package/editing/sharedTemplates/executor/builders/offsetLine.js +1 -1
  193. package/editing/sharedTemplates/executor/builders/offsetPrimaryLine.js +1 -1
  194. package/editing/sharedTemplates/executor/builders/pointAtAllVerticesOfLine.js +1 -1
  195. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfLine.js +1 -1
  196. package/editing/sharedTemplates/executor/builders/pointAtBeginningOfRadial.js +1 -1
  197. package/editing/sharedTemplates/executor/builders/pointAtEndOfLine.js +1 -1
  198. package/editing/sharedTemplates/executor/builders/pointAtInteriorVertices.js +1 -1
  199. package/editing/sharedTemplates/executor/builders/pointAtIntersectionVerticesOfLine.js +1 -1
  200. package/editing/sharedTemplates/executor/builders/pointAtNotBeginningOfLine.js +1 -1
  201. package/editing/sharedTemplates/executor/builders/pointAtNotEndOfLine.js +1 -1
  202. package/editing/sharedTemplates/executor/builders/pointAtPolygonCentroid.js +1 -1
  203. package/editing/sharedTemplates/executor/builders/pointAtPolygonNotStart.js +1 -1
  204. package/editing/sharedTemplates/executor/builders/pointAtPolygonStart.js +1 -1
  205. package/editing/sharedTemplates/executor/builders/pointIdentity.js +1 -1
  206. package/editing/sharedTemplates/executor/builders/pointPrimaryIdentity.js +1 -1
  207. package/editing/sharedTemplates/executor/builders/polygonBoundary.js +1 -1
  208. package/editing/sharedTemplates/executor/builders/polygonBoundaryTwoPoint.js +1 -1
  209. package/editing/sharedTemplates/executor/builders/polygonIdentity.js +1 -1
  210. package/editing/sharedTemplates/executor/builders/polygonPrimaryIdentity.js +1 -1
  211. package/editing/sharedTemplates/executor/builders/polygonVertices.js +1 -1
  212. package/editing/sharedTemplates/executor/builders/support/builderUtils.js +1 -1
  213. package/editing/sharedTemplates/executor/builders/twoPointLines.js +1 -1
  214. package/editing/sharedTemplates/executor/createTemplateExecutor.js +1 -1
  215. package/editing/sharedTemplates/executor/support/createServiceEdit.js +1 -1
  216. package/editing/sharedTemplates/executor/support/executorUtils.js +1 -1
  217. package/editing/sharedTemplates/templateDefinitions/GroupTemplateDefinition.js +1 -1
  218. package/editing/sharedTemplates/templateDefinitions/PresetTemplateDefinition.js +1 -1
  219. package/editing/sharedTemplates/templateDefinitions/parts/builders/builderUtils.js +1 -1
  220. package/editing/templateUtils.js +1 -1
  221. package/geometry/SpatialReference.js +1 -1
  222. package/geometry/operators/extendOperator.js +1 -1
  223. package/geometry/operators/gx/operatorAlphaShape.js +1 -1
  224. package/geometry/operators/gx/operatorAutoComplete.js +1 -1
  225. package/geometry/operators/gx/operatorBuffer.js +1 -1
  226. package/geometry/operators/gx/operatorGraphicBuffer.js +1 -1
  227. package/geometry/operators/gx/operatorIntegrate.js +1 -1
  228. package/geometry/operators/gx/operatorLabelPoint.js +1 -1
  229. package/geometry/operators/gx/operatorLinesToPolygons.js +1 -1
  230. package/geometry/operators/gx/operatorOffset.js +1 -1
  231. package/geometry/operators/gx/operatorPolygonOverlay.js +1 -1
  232. package/geometry/operators/gx/operatorSimplify.js +1 -1
  233. package/geometry/operators/gx/operatorSymmetricDifference.js +1 -1
  234. package/geometry/operators/gx/operatorUnion.js +1 -1
  235. package/geometry/operators/isNearOperator.js +1 -1
  236. package/geometry/operators/json/disjointOperator.js +1 -1
  237. package/geometry/operators/projectOperator.js +1 -1
  238. package/geometry/operators/reshapeOperator.js +1 -1
  239. package/geometry/operators/shapePreservingProjectOperator.js +1 -1
  240. package/geometry/operators/support/apiConverter.js +1 -1
  241. package/geometry/operators/support/initNoPeFactory.js +1 -1
  242. package/geometry/operators/support/jsonConverter.js +1 -1
  243. package/geometry/support/DoubleArray.js +1 -1
  244. package/geometry/support/MeshGeoreferencedVertexSpace.js +1 -1
  245. package/geometry/support/MeshTexture.js +1 -1
  246. package/geometry/support/MeshTransform.js +1 -1
  247. package/geometry/support/UCharArray.js +5 -0
  248. package/geometry/support/UShortArray.js +5 -0
  249. package/geometry/support/buffer/BufferPool.js +1 -1
  250. package/geometry/support/buffer/BufferView.js +1 -1
  251. package/geometry/support/buffer/internals/Mat3.js +1 -1
  252. package/geometry/support/buffer/internals/Mat4.js +1 -1
  253. package/geometry/support/buffer/internals/Scalar.js +1 -1
  254. package/geometry/support/buffer/internals/Vec2.js +1 -1
  255. package/geometry/support/buffer/internals/Vec3.js +1 -1
  256. package/geometry/support/buffer/internals/Vec4.js +1 -1
  257. package/geometry/support/meshUtils/exporters/gltf/glb.js +1 -1
  258. package/identity/OAuthInfo.js +1 -1
  259. package/interfaces.d.ts +124 -68
  260. package/layers/VectorTileLayer.js +1 -1
  261. package/layers/graphics/controllers/I3SOnDemandController.js +1 -1
  262. package/layers/mixins/EditBusLayer.js +1 -1
  263. package/layers/mixins/PublishableLayer.js +1 -1
  264. package/layers/mixins/operationalLayers.js +1 -1
  265. package/layers/save/featureLayerUtils.js +1 -1
  266. package/layers/save/utils.js +1 -1
  267. package/layers/support/AggregateField.js +1 -1
  268. package/layers/support/CodedValueDomain.js +1 -1
  269. package/layers/support/Field.js +1 -1
  270. package/layers/support/ImageElement.js +1 -1
  271. package/layers/support/InheritedDomain.js +1 -1
  272. package/layers/support/LOD.js +1 -1
  273. package/layers/support/LabelClass.js +1 -1
  274. package/layers/support/LabelExpressionInfo.js +1 -1
  275. package/layers/support/OrderByInfo.js +1 -1
  276. package/layers/support/PurgeOptions.js +1 -1
  277. package/layers/support/RangeDomain.js +1 -1
  278. package/layers/support/Sublayer.js +1 -1
  279. package/layers/support/SubtypeSublayer.js +1 -1
  280. package/layers/support/TileInfo.js +1 -1
  281. package/layers/support/TilemapCache.js +1 -1
  282. package/layers/support/VideoElement.js +1 -1
  283. package/layers/support/commonProperties.js +1 -1
  284. package/layers/support/rasterFunctions/stretchUtils.js +1 -1
  285. package/layers/support/source/DataLayerSource.js +1 -1
  286. package/layers/support/wmsUtils.js +1 -1
  287. package/networks/Network.js +1 -1
  288. package/networks/RulesTable.js +1 -1
  289. package/networks/UtilityNetwork.js +1 -1
  290. package/networks/support/typeUtils.js +1 -1
  291. package/package.json +3 -3
  292. package/portal/Portal.js +1 -1
  293. package/renderers/support/RasterSymbolizer.js +1 -1
  294. package/rest/print.js +1 -1
  295. package/rest/support/AttachmentQuery.js +1 -1
  296. package/rest/support/ClosestFacilityParameters.js +1 -1
  297. package/rest/support/DirectionLine.js +1 -1
  298. package/rest/support/DirectionPoint.js +1 -1
  299. package/rest/support/JobInfo.js +1 -1
  300. package/rest/support/NetworkFeatureSet.js +1 -1
  301. package/rest/support/PointBarrier.js +1 -1
  302. package/rest/support/PolygonBarrier.js +1 -1
  303. package/rest/support/PolylineBarrier.js +1 -1
  304. package/rest/support/Query.js +1 -1
  305. package/rest/support/RelationshipQuery.js +1 -1
  306. package/rest/support/RouteInfo.js +1 -1
  307. package/rest/support/RouteParameters.js +1 -1
  308. package/rest/support/ServiceAreaParameters.js +1 -1
  309. package/rest/support/Stop.js +1 -1
  310. package/rest/support/TopFeaturesQuery.js +1 -1
  311. package/support/revision.js +1 -1
  312. package/symbols/ExtrudeSymbol3DLayer.js +1 -1
  313. package/symbols/FillSymbol3DLayer.js +1 -1
  314. package/symbols/IconSymbol3DLayer.js +1 -1
  315. package/symbols/LineSymbol3DLayer.js +1 -1
  316. package/symbols/ObjectSymbol3DLayer.js +1 -1
  317. package/symbols/PathSymbol3DLayer.js +1 -1
  318. package/symbols/TextSymbol3DLayer.js +1 -1
  319. package/symbols/WaterSymbol3DLayer.js +1 -1
  320. package/symbols/cim/OverrideHelper.js +1 -1
  321. package/symbols/cim/effects/EffectAddControlPoints.js +1 -1
  322. package/symbols/cim/effects/EffectArrow.js +1 -1
  323. package/symbols/cim/effects/EffectBuffer.js +1 -1
  324. package/symbols/cim/effects/EffectControlMeasureLine.js +1 -1
  325. package/symbols/cim/effects/EffectCut.js +1 -1
  326. package/symbols/cim/effects/EffectDashes.js +1 -1
  327. package/symbols/cim/effects/EffectDonut.js +1 -1
  328. package/symbols/cim/effects/EffectJog.js +1 -1
  329. package/symbols/cim/effects/EffectMove.js +1 -1
  330. package/symbols/cim/effects/EffectOffset.js +1 -1
  331. package/symbols/cim/effects/EffectReverse.js +1 -1
  332. package/symbols/cim/effects/EffectRotate.js +1 -1
  333. package/symbols/cim/effects/EffectScale.js +1 -1
  334. package/symbols/cim/effects/EffectWave.js +1 -1
  335. package/symbols/cim/placements/PlacementAlongLineSameSize.js +1 -1
  336. package/symbols/cim/placements/PlacementAtExtremities.js +1 -1
  337. package/symbols/cim/placements/PlacementAtRatioPositions.js +1 -1
  338. package/symbols/cim/placements/PlacementInsidePolygon.js +1 -1
  339. package/symbols/cim/placements/PlacementOnLine.js +1 -1
  340. package/symbols/cim/placements/PlacementOnVertices.js +1 -1
  341. package/symbols/cim/placements/PlacementPolygonCenter.js +1 -1
  342. package/symbols/support/ElevationInfo.js +1 -1
  343. package/time/TimeExtent.js +1 -1
  344. package/views/2d/engine/vectorTiles/buckets/SymbolBucket.js +1 -1
  345. package/views/2d/engine/vectorTiles/expression/expression.js +1 -1
  346. package/views/2d/engine/vectorTiles/shaders/VTLBackgroundMaterial.js +1 -1
  347. package/views/2d/engine/vectorTiles/shaders/VTLCircleMaterial.js +1 -1
  348. package/views/2d/engine/vectorTiles/shaders/VTLFillMaterial.js +1 -1
  349. package/views/2d/engine/vectorTiles/shaders/VTLLineMaterial.js +1 -1
  350. package/views/2d/engine/vectorTiles/shaders/VTLMaterial.js +1 -1
  351. package/views/2d/engine/vectorTiles/shaders/VTLSymbolMaterial.js +1 -1
  352. package/views/2d/engine/vectorTiles/style/StyleDefinition.js +1 -1
  353. package/views/2d/engine/webgl/AttributeStoreView.js +1 -1
  354. package/views/2d/engine/webgl/DisplayEntity.js +1 -1
  355. package/views/2d/engine/webgl/DisplayRecord.js +1 -1
  356. package/views/2d/engine/webgl/meshing/Mesh.js +1 -1
  357. package/views/2d/engine/webgl/shaderGraph/GraphShaderModule.js +1 -1
  358. package/views/2d/engine/webgl/shaderGraph/graph/ShaderGraphNode.js +1 -1
  359. package/views/2d/engine/webgl/shaderGraph/graph/glsl.js +1 -1
  360. package/views/2d/engine/webgl/shaderGraph/techniques/line/GradientStrokeTechnique.js +1 -1
  361. package/views/2d/layers/FeatureLayerView2D.js +1 -1
  362. package/views/2d/layers/LayerView2D.js +1 -1
  363. package/views/2d/layers/MapNotesLayerView2D.js +1 -1
  364. package/views/2d/layers/RouteLayerView2D.js +1 -1
  365. package/views/2d/layers/features/FeatureContainer.js +1 -1
  366. package/views/2d/layers/features/FeaturePipelineWorker.js +1 -1
  367. package/views/2d/layers/features/FeatureStoreQueryAdapter.js +1 -1
  368. package/views/2d/layers/features/sources/FeatureSource.js +1 -1
  369. package/views/2d/layers/features/sources/strategies/chunks/Overrides.js +1 -1
  370. package/views/2d/layers/features/sources/strategies/chunks/SourceChunkStore.js +1 -1
  371. package/views/2d/layers/features/support/FeatureSetReader.js +1 -1
  372. package/views/2d/layers/support/HighlightCounter.js +1 -1
  373. package/views/2d/tiling/TileCoverage.js +1 -1
  374. package/views/2d/tiling/TileKey.js +1 -1
  375. package/views/3d/analysis/Slice/SliceTool.js +1 -1
  376. package/views/3d/environment/ChapmanAtmosphere.js +1 -1
  377. package/views/3d/environment/SceneViewEnvironment.js +1 -1
  378. package/views/3d/layers/I3SMeshView3D.js +1 -1
  379. package/views/3d/layers/MediaLayerView3D.js +1 -1
  380. package/views/3d/layers/PointCloudLayerView3D.js +1 -1
  381. package/views/3d/layers/SceneLayerGraphicsView3D.js +1 -1
  382. package/views/3d/layers/graphics/Graphics3DCore.js +1 -1
  383. package/views/3d/layers/graphics/Graphics3DIconSymbolLayer.js +1 -1
  384. package/views/3d/layers/graphics/Graphics3DLineCalloutSymbolLayer.js +1 -1
  385. package/views/3d/layers/graphics/Graphics3DLineSymbolLayer.js +1 -1
  386. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  387. package/views/3d/layers/graphics/Graphics3DPolygonFillSymbolLayer.js +1 -1
  388. package/views/3d/layers/graphics/Graphics3DWaterSymbolLayer.js +1 -1
  389. package/views/3d/layers/graphics/GraphicsCorePerformanceInfo.js +1 -1
  390. package/views/3d/layers/graphics/pipeline/featureSet/TiledFeatureStore.js +1 -1
  391. package/views/3d/layers/graphics/pipeline/rendering/DirectRenderer.js +1 -1
  392. package/views/3d/layers/graphics/pipeline/rendering/FeaturePipelineRenderManager.js +1 -1
  393. package/views/3d/layers/graphics/pipeline/rendering/LodRenderer.js +1 -1
  394. package/views/3d/layers/graphics/pipeline/rendering/RenderCommandEncoder.js +1 -1
  395. package/views/3d/layers/graphics/pipeline/symbolization/TestObjectSymbol.js +1 -1
  396. package/views/3d/layers/i3s/I3SBinaryReader.js +1 -1
  397. package/views/3d/layers/i3s/I3SClientMaterialUtil.js +1 -1
  398. package/views/3d/layers/i3s/I3SIndex.js +1 -1
  399. package/views/3d/layers/i3s/I3SNodeLoader.js +1 -1
  400. package/views/3d/layers/i3s/PointCloudWorkerUtil.js +1 -1
  401. package/views/3d/layers/support/DefinitionExpressionSceneLayerView.js +1 -1
  402. package/views/3d/layers/support/HeatmapFeatureProcessor.js +1 -1
  403. package/views/3d/state/Frustum.js +1 -1
  404. package/views/3d/support/DisplayQualityProfile.js +1 -1
  405. package/views/3d/support/QualitySettings.js +1 -1
  406. package/views/3d/terrain/OverlayManager.js +1 -1
  407. package/views/3d/terrain/TerrainSurface.js +1 -1
  408. package/views/3d/terrain/TextureFader.js +1 -1
  409. package/views/3d/terrain/TilingScheme.js +1 -1
  410. package/views/3d/webgl-engine/collections/Component/ComponentIntersectionData.js +1 -1
  411. package/views/3d/webgl-engine/effects/haze/Haze.js +1 -1
  412. package/views/3d/webgl-engine/lib/DepthRange.js +1 -1
  413. package/views/3d/webgl-engine/lib/Octree.js +1 -1
  414. package/views/3d/webgl-engine/lib/ShadowAccumulator.js +1 -1
  415. package/views/3d/webgl-engine/lib/ShadowMap.js +1 -1
  416. package/views/3d/webgl-engine/lib/TextTextureAtlas.js +1 -1
  417. package/views/3d/webgl-engine/lib/Texture.js +1 -1
  418. package/views/3d/webgl-engine/lib/ViewshedShadowMap.js +1 -1
  419. package/views/3d/webgl-engine/lib/edgeRendering/edgeBufferWriters.js +1 -1
  420. package/views/3d/webgl-engine/lib/lodRendering/LodResources.js +1 -1
  421. package/views/3d/webgl-engine/lib/textureUtils.js +1 -1
  422. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  423. package/views/SceneView.js +1 -1
  424. package/views/View.js +1 -1
  425. package/views/View2D.js +1 -1
  426. package/views/draw/DrawAction.js +1 -1
  427. package/views/draw/drawSurfaces.js +1 -1
  428. package/views/input/BrowserEventSource.js +1 -1
  429. package/views/interactive/editGeometry/operations/UndoGroup.js +1 -1
  430. package/views/interactive/snapping/featureSources/sceneLayerSource/SceneLayerSnappingSourceWorker.js +1 -1
  431. package/views/layers/LayerView.js +1 -1
  432. package/views/support/Scheduler.js +1 -1
  433. package/views/support/imageReprojection.js +1 -1
  434. package/views/webgl/FramebufferObject.js +1 -1
  435. package/views/webgl/Parameters.js +1 -1
  436. package/views/webgl/RenderingContext.js +1 -1
  437. package/views/webgl/ShaderBuilder.js +1 -1
  438. package/views/webgl/Texture.js +1 -1
  439. package/webscene/Environment.js +1 -1
  440. package/webscene/SunLighting.js +1 -1
  441. package/webscene/VirtualLighting.js +1 -1
  442. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  443. package/widgets/AreaMeasurement2D/AreaMeasurement2DViewModel.js +1 -1
  444. package/widgets/AreaMeasurement2D.js +1 -1
  445. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  446. package/widgets/BatchAttributeForm/ReactiveGraphic.js +1 -1
  447. package/widgets/BatchAttributeForm/inputs/EditableInput.js +1 -1
  448. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  449. package/widgets/BatchAttributeForm/inputs/GroupInput.js +1 -1
  450. package/widgets/BatchAttributeForm/inputs/InputBase.js +1 -1
  451. package/widgets/BatchAttributeForm/inputs/support/inputUtils.js +1 -1
  452. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  453. package/widgets/BatchAttributeForm.js +1 -1
  454. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  455. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesTree.js +1 -1
  456. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DTool.js +1 -1
  457. package/widgets/DistanceMeasurement2D/DistanceMeasurement2DViewModel.js +1 -1
  458. package/widgets/DistanceMeasurement2D.js +1 -1
  459. package/widgets/Editor/AddAssociationWorkflow.js +5 -0
  460. package/widgets/Editor/AddAssociationWorkflowData.js +5 -0
  461. package/widgets/Editor/CreateFeaturesWorkflow.js +1 -1
  462. package/widgets/Editor/CreateFeaturesWorkflowData.js +1 -1
  463. package/widgets/Editor/EditorViewModel.js +1 -1
  464. package/widgets/Editor/UpdateRecordWorkflow.js +1 -1
  465. package/widgets/Editor/UpdateWorkflow.js +1 -1
  466. package/widgets/Editor/UpdateWorkflowData.js +1 -1
  467. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  468. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  469. package/widgets/Editor/modelUploadUtils.js +1 -1
  470. package/widgets/Editor/workflowUtils.js +1 -1
  471. package/widgets/Editor.js +1 -1
  472. package/widgets/Feature/FeatureUtilityNetworkAssociationList.js +1 -1
  473. package/widgets/Feature/FeatureUtilityNetworkAssociations.js +1 -1
  474. package/widgets/Feature/FeatureViewModel.js +1 -1
  475. package/widgets/Feature/support/featureUtils.js +1 -1
  476. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  477. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +5 -0
  478. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationSettings.js +5 -0
  479. package/widgets/FeatureForm/FeatureFormViewModel.js +1 -1
  480. package/widgets/FeatureForm/UtilityNetworkAssociationAddAssociationViewModel.js +5 -0
  481. package/widgets/FeatureForm/UtilityNetworkAssociationInput.js +1 -1
  482. package/widgets/FeatureForm.js +1 -1
  483. package/widgets/FeatureTable/support/FeatureStore.js +1 -1
  484. package/widgets/LayerList/LayerListItem.js +1 -1
  485. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  486. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  487. package/widgets/OrientedImageryViewer/constants.js +1 -1
  488. package/widgets/OrientedImageryViewer/galleryUtils.js +5 -0
  489. package/widgets/OrientedImageryViewer/utils.js +1 -1
  490. package/widgets/OrientedImageryViewer.js +1 -1
  491. package/widgets/ScaleRangeSlider/ScaleRanges.js +1 -1
  492. package/widgets/Search/SearchViewModel.js +1 -1
  493. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  494. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  495. package/widgets/Sketch/support/sketchUtils.js +1 -1
  496. package/widgets/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +2 -2
  497. package/widgets/Widget.js +1 -1
  498. package/widgets/support/FilterBuilder/FilterBuilderViewModel.js +1 -1
  499. package/widgets/support/FilterBuilder.js +1 -1
  500. package/widgets/support/FilterCondition/FilterConditionViewModel.js +1 -1
  501. package/widgets/support/FilterCondition.js +1 -1
  502. package/widgets/support/UtilityNetworkAssociations/FeatureUtilityNetworkAssociationsViewModel.js +5 -0
  503. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationList.js +1 -1
  504. package/widgets/support/UtilityNetworkAssociations/utilityNetworkUtils.js +1 -1
  505. package/widgets/support/forms/expressions/FormExpressionArcadeExecutor.js +1 -1
  506. package/assets/esri/core/workers/chunks/00e0c53d89e074399f04.js +0 -1
  507. package/assets/esri/core/workers/chunks/08c4b585290efc98ca5d.js +0 -1
  508. package/assets/esri/core/workers/chunks/117e7a12af77c761efb5.js +0 -1
  509. package/assets/esri/core/workers/chunks/12d6baeffd55a98a7c75.js +0 -1
  510. package/assets/esri/core/workers/chunks/207c040b0e42358a5389.js +0 -1
  511. package/assets/esri/core/workers/chunks/21c12edc0632eb911e73.js +0 -1
  512. package/assets/esri/core/workers/chunks/24c94f97a76646d415ae.js +0 -1
  513. package/assets/esri/core/workers/chunks/2611adb4f328f95ee508.js +0 -1
  514. package/assets/esri/core/workers/chunks/26a2bd432e7a1b3870c3.js +0 -1
  515. package/assets/esri/core/workers/chunks/2def7db73a776e759dae.js +0 -1
  516. package/assets/esri/core/workers/chunks/2ff63a71213f618377d6.js +0 -1
  517. package/assets/esri/core/workers/chunks/324a5547c64a3bae670d.js +0 -1
  518. package/assets/esri/core/workers/chunks/369a2b8484a8807bde38.js +0 -1
  519. package/assets/esri/core/workers/chunks/44abd2cd17aae3299ede.js +0 -1
  520. package/assets/esri/core/workers/chunks/4b56c0c109e10d7409b8.js +0 -1
  521. package/assets/esri/core/workers/chunks/5660f13d78e9e4240034.js +0 -1
  522. package/assets/esri/core/workers/chunks/568bcf809fcfd4d9c713.js +0 -1
  523. package/assets/esri/core/workers/chunks/5be7cf1564e756c24066.js +0 -1
  524. package/assets/esri/core/workers/chunks/5e889a675cbaff03ad5a.js +0 -1
  525. package/assets/esri/core/workers/chunks/61795bde00f2e16d04f1.js +0 -1
  526. package/assets/esri/core/workers/chunks/62a1d60ad4bf6469c4dd.js +0 -1
  527. package/assets/esri/core/workers/chunks/6d79ec15d1858839f576.js +0 -1
  528. package/assets/esri/core/workers/chunks/6ea02ff25f051c08e6c3.js +0 -1
  529. package/assets/esri/core/workers/chunks/7966c245a073c85f04b1.js +0 -1
  530. package/assets/esri/core/workers/chunks/7bf08823f861628144a1.js +0 -1
  531. package/assets/esri/core/workers/chunks/86149b4a5a148744c7d1.js +0 -1
  532. package/assets/esri/core/workers/chunks/8bd51b5b392dfacc922f.js +0 -1
  533. package/assets/esri/core/workers/chunks/9b2fab133786e5d47631.js +0 -1
  534. package/assets/esri/core/workers/chunks/9bfb091cec7eed6c8111.js +0 -1
  535. package/assets/esri/core/workers/chunks/9c6380af3bc3130658e1.js +0 -1
  536. package/assets/esri/core/workers/chunks/a2409d4921c02614169a.js +0 -1
  537. package/assets/esri/core/workers/chunks/b18620fc15707e4413a1.js +0 -1
  538. package/assets/esri/core/workers/chunks/b1baf39daf5725404be5.js +0 -1
  539. package/assets/esri/core/workers/chunks/b43d88b6e7dc4ab13599.js +0 -1
  540. package/assets/esri/core/workers/chunks/b765670b47d209d7655a.js +0 -2
  541. package/assets/esri/core/workers/chunks/b9d9a1dc3c5d799e2685.js +0 -1
  542. package/assets/esri/core/workers/chunks/c1970657a287ec96001e.js +0 -1
  543. package/assets/esri/core/workers/chunks/c249ad935f54d3b49ae3.js +0 -1
  544. package/assets/esri/core/workers/chunks/cc75bbfd779f409943a3.js +0 -1
  545. package/assets/esri/core/workers/chunks/d27a199fd8e2ade69254.js +0 -1
  546. package/assets/esri/core/workers/chunks/d35efcbe439500bf18bc.js +0 -1
  547. package/assets/esri/core/workers/chunks/d599ba865da87b487b1b.js +0 -1
  548. package/assets/esri/core/workers/chunks/da1157e288dbc6ba842a.js +0 -1
  549. package/assets/esri/core/workers/chunks/ddc30044f61a2c2df3fe.js +0 -1
  550. package/assets/esri/core/workers/chunks/e37e5d2e233d7f6ccd52.js +0 -314
  551. package/assets/esri/core/workers/chunks/f14b318bab5efcf43419.js +0 -1
  552. package/assets/esri/core/workers/chunks/f29715459ecd46180829.js +0 -1
  553. package/assets/esri/core/workers/chunks/f4e48bbdbc9da10ec71a.js +0 -1
  554. package/assets/esri/core/workers/chunks/f62f657f9fef28f492e0.js +0 -1
  555. package/assets/esri/core/workers/chunks/f9070edd8e0b2a57af79.js +0 -1
  556. package/assets/esri/core/workers/chunks/faf9063420262ea40fd8.js +0 -1
  557. package/chunks/Bufferer-DjC-SKTJ.js +0 -5
  558. package/chunks/Distance2DCalculator-8-JrFGHH.js +0 -5
  559. package/editing/sharedTemplates/support/sharedTemplateUtils.js +0 -5
  560. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationSettings.js +0 -5
  561. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.d.ts +0 -4
  562. package/widgets/support/UtilityNetworkAssociations/UtilityNetworkAssociationsViewModel.js +0 -5
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{signal as s}from"../../core/signal.js";import{getTextureCompressionWorker as o,isCompressible as a}from"../support/TextureCompressionHelper.js";import{checkWebGLError as n}from"./checkWebGLError.js";import{TextureType as l,ResourceType as p,CompressedTextureFormat as m,TextureSamplingMode as h}from"./enums.js";import{GLObjectType as _}from"./GLObjectType.js";import{estimateMemory as d}from"./TextureDescriptor.js";import{isCompressedData as c,deriveInternalFormat as u,isTexImageSource as g,getDimensions as T,is3DTarget as x,validateTexture as E,isCompressedFormat as M,calcMipmapLevels as A,isSizedPixelFormat as f}from"./textureUtils.js";import{ValidatedTextureDescriptor as I}from"./ValidatedTextureDescriptor.js";const w=null,D=()=>e.getLogger("esri/views/webgl/Texture");let R=class e{constructor(e,i=null,r=null){if(this.type=_.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=s(null),"context"in e)this._descriptor=e,r=i;else{const r=I.validate(e,i);if(!r)throw new t("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===l.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return d(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._glName&&this._descriptor.context.instanceCounter.decrement(p.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===l.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.shouldCompress=t}setData(t){return this.abortCompression(),!c(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in m&&(this._descriptor.internalFormat=void 0),this._setData(t),o()&&!c(t)&&a(t)&&this._descriptor.shouldCompress&&this.compressOnWorker(t),this.isCompressing}updateData(i,r,s,o,a,n,l=0){n||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=u(p);const{context:m,pixelFormat:h,dataType:_,target:d,isImmutable:x}=p;if(x&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");const E=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>p.width||s+a>p.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=m;if(l&&(o&&a||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),M.pixelStorei(M.UNPACK_SKIP_ROWS,l)),g(n)){const{width:t,height:e}=T(n);t===o&&e===a||D().warn("The size of the data does not match the provided dimensions"),M.texSubImage2D(d,i,r,s,o,a,h,_,n)}else c(n)?M.compressedTexSubImage2D(d,i,r,s,o,a,p.internalFormat,n.levels[i]):M.texSubImage2D(d,i,r,s,o,a,h,_,n);l&&M.pixelStorei(M.UNPACK_SKIP_ROWS,0),m.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,l,p){p||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=u(m);const{context:h,pixelFormat:_,dataType:d,isImmutable:g,target:T}=m;if(g&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");x(T)||D().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+l>m.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(c(p))p=p.levels[i],M.compressedTexSubImage3D(T,i,r,s,o,a,n,l,m.internalFormat,p);else{const t=p;M.texSubImage3D(T,i,r,s,o,a,n,l,_,d,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,E(i)}i.samplingMode===h.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=h.LINEAR_MIPMAP_NEAREST):i.samplingMode===h.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=h.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,E(e)}e.samplingMode===h.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=h.LINEAR):e.samplingMode===h.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=h.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,E(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=i(this._compressionAbortController.value))}_setData(i,r){const s=this._descriptor,o=s.context?.gl;if(!o)return;n(o),this._glName||(this._glName=o.createTexture(),this._glName&&s.context.instanceCounter.increment(p.Texture,this)),E(s);const a=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),n(o);const l=r??s.target,m=x(l);if(g(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:a}=s;if(null==e||null==r)throw new t("Width and height must be specified!");if(m&&null==a)throw new t("Depth must be specified!");if(s.internalFormat=u(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,s.internalFormat,s.hasMipmap,e,r,a),c(i)){if(!M(s.internalFormat))throw new t("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,l)}else this._texImage(l,0,s.internalFormat,e,r,a,i),n(o),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),n(o),s.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=l.TEXTURE_CUBE_MAP_POSITIVE_X;e<=l.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=u(r);const s=x(e),{width:o,height:a,depth:l}=T(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=a),s&&r.depth,s&&(r.depth=l),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,a,l),this._texImage(e,0,r.internalFormat,o,a,l,t),n(i),r.hasMipmap&&(this.generateMipmap(),n(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,l=A(i,s,o,a),p=Math.min(l,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,r.context.gl.TEXTURE_MAX_LEVEL,p),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),p)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!f(i))throw new t("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?A(e,s,o,a):1;if(x(e)){if(null==a)throw new t("Missing depth dimension for 3D texture upload");n.texStorage3D(e,l,i,s,o,a)}else n.texStorage2D(e,l,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=x(e),{isImmutable:m,pixelFormat:h,dataType:_}=this._descriptor;if(m){if(null!=n){const r=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,i,0,0,0,s,o,a,h,_,r)}else l.texSubImage2D(e,i,0,0,s,o,h,_,r)}}else{const m=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texImage3D(e,i,r,s,o,a,0,h,_,m)}else l.texImage2D(e,i,r,s,o,0,h,_,m)}}_compressedTexImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=x(e);if(this._descriptor.isImmutable){if(null!=n)if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else l.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,i,r,s,o,a,0,n)}else l.compressedTexImage2D(e,i,r,s,o,0,n)}async compressOnWorker(t){const e=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc"),s=o();if(s&&(e||i)){const o=new AbortController;this._compressionAbortController.value=o;const a={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!e,hasS3TC:!!i};s.invoke(a,this._compressionAbortController.value.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture)),o===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((t=>{r(t)||o!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=n===l.TEXTURE_3D;if(null==r||null==s||p&&null==o)throw new t("Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===h.LINEAR_MIPMAP_NEAREST||i===h.LINEAR_MIPMAP_LINEAR?(i=h.LINEAR,t.hasMipmap||(r=h.LINEAR)):i!==h.NEAREST_MIPMAP_NEAREST&&i!==h.NEAREST_MIPMAP_LINEAR||(i=h.NEAREST,t.hasMipmap||(r=h.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};R.TEXTURE_UNIT_FOR_UPDATES=0;export{R as Texture,w as tracer};
5
+ import t from"../../core/Error.js";import"../../core/has.js";import e from"../../core/Logger.js";import{abortMaybe as i}from"../../core/maybe.js";import{isAbortError as r}from"../../core/promiseUtils.js";import{signal as s}from"../../core/signal.js";import{getTextureCompressionWorker as o,isCompressible as a}from"../support/TextureCompressionHelper.js";import{checkWebGLError as n}from"./checkWebGLError.js";import{TextureType as l,ResourceType as p,CompressedTextureFormat as m,TextureSamplingMode as h}from"./enums.js";import{GLObjectType as _}from"./GLObjectType.js";import{estimateMemory as d}from"./TextureDescriptor.js";import{isCompressedData as c,deriveInternalFormat as u,isTexImageSource as g,getDimensions as T,is3DTarget as x,validateTexture as E,isCompressedFormat as M,calcMipmapLevels as A,isSizedPixelFormat as f}from"./textureUtils.js";import{ValidatedTextureDescriptor as I}from"./ValidatedTextureDescriptor.js";const w=null,D=()=>e.getLogger("esri/views/webgl/Texture");let R=class e{static{this.TEXTURE_UNIT_FOR_UPDATES=0}constructor(e,i=null,r=null){if(this.type=_.Texture,this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,this._compressionAbortController=s(null),"context"in e)this._descriptor=e,r=i;else{const r=I.validate(e,i);if(!r)throw new t("Texture descriptor invalid");this._descriptor=r}this._descriptor.target===l.TEXTURE_CUBE_MAP?this._setDataCubeMap(r):this.setData(r)}get glName(){return this._glName}get descriptor(){return this._descriptor}get usedMemory(){return d(this._descriptor)}get cachedMemory(){return this.usedMemory}get isDirty(){return this._samplingModeDirty||this._wrapModeDirty}get isCompressing(){return null!==this._compressionAbortController.value}dispose(){this.abortCompression(),this._glName&&this._descriptor.context.instanceCounter.decrement(p.Texture,this),this._descriptor.context.gl&&this._glName&&(this._descriptor.context.unbindTexture(this),this._descriptor.context.gl.deleteTexture(this._glName),this._glName=null)}release(){this.dispose()}resize(e,i){const r=this._descriptor;if(r.width!==e||r.height!==i){if(this._wasImmutablyAllocated)throw new t("Immutable textures can't be resized!");r.width=e,r.height=i,this._descriptor.target===l.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}enableCompression(t){this._descriptor.shouldCompress=t}setData(t){return this.abortCompression(),!c(t)&&this._descriptor.internalFormat&&this._descriptor.internalFormat in m&&(this._descriptor.internalFormat=void 0),this._setData(t),o()&&!c(t)&&a(t)&&this._descriptor.shouldCompress&&this.compressOnWorker(t),this.isCompressing}updateData(i,r,s,o,a,n,l=0){n||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update uninitialized texture!");const p=this._descriptor;p.internalFormat=u(p);const{context:m,pixelFormat:h,dataType:_,target:d,isImmutable:x}=p;if(x&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");const E=m.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES,!0);(r<0||s<0||r+o>p.width||s+a>p.height)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=m;if(l&&(o&&a||D().warn("Must pass width and height if `UNPACK_SKIP_ROWS` is used"),M.pixelStorei(M.UNPACK_SKIP_ROWS,l)),g(n)){const{width:t,height:e}=T(n);t===o&&e===a||D().warn("The size of the data does not match the provided dimensions"),M.texSubImage2D(d,i,r,s,o,a,h,_,n)}else c(n)?M.compressedTexSubImage2D(d,i,r,s,o,a,p.internalFormat,n.levels[i]):M.texSubImage2D(d,i,r,s,o,a,h,_,n);l&&M.pixelStorei(M.UNPACK_SKIP_ROWS,0),m.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(i,r,s,o,a,n,l,p){p||D().error("An attempt to use uninitialized data!"),this._glName||D().error("An attempt to update an uninitialized texture!");const m=this._descriptor;m.internalFormat=u(m);const{context:h,pixelFormat:_,dataType:d,isImmutable:g,target:T}=m;if(g&&!this._wasImmutablyAllocated)throw new t("Cannot update immutable texture before allocation!");x(T)||D().warn("Attempting to set 3D texture data on a non-3D texture");const E=h.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);h.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),(r<0||s<0||o<0||r+a>m.width||s+n>m.height||o+l>m.depth)&&D().error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage();const{gl:M}=h;if(c(p))p=p.levels[i],M.compressedTexSubImage3D(T,i,r,s,o,a,n,l,m.internalFormat,p);else{const t=p;M.texSubImage3D(T,i,r,s,o,a,n,l,_,d,t)}h.bindTexture(E,e.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const i=this._descriptor;if(!i.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot add mipmaps to immutable texture after allocation");i.hasMipmap=!0,this._samplingModeDirty=!0,E(i)}i.samplingMode===h.LINEAR?(this._samplingModeDirty=!0,i.samplingMode=h.LINEAR_MIPMAP_NEAREST):i.samplingMode===h.NEAREST&&(this._samplingModeDirty=!0,i.samplingMode=h.NEAREST_MIPMAP_NEAREST);const r=this._descriptor.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);this._descriptor.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._descriptor.context.gl.generateMipmap(i.target),this._descriptor.context.bindTexture(r,e.TEXTURE_UNIT_FOR_UPDATES)}clearMipmap(){const e=this._descriptor;if(e.hasMipmap){if(this._wasImmutablyAllocated)throw new t("Cannot delete mipmaps to immutable texture after allocation");e.hasMipmap=!1,this._samplingModeDirty=!0,E(e)}e.samplingMode===h.LINEAR_MIPMAP_NEAREST?(this._samplingModeDirty=!0,e.samplingMode=h.LINEAR):e.samplingMode===h.NEAREST_MIPMAP_NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=h.NEAREST)}setSamplingMode(t){t!==this._descriptor.samplingMode&&(this._descriptor.samplingMode=t,this._samplingModeDirty=!0)}setWrapMode(t){t!==this._descriptor.wrapMode&&(this._descriptor.wrapMode=t,E(this._descriptor),this._wrapModeDirty=!0)}applyChanges(){this._samplingModeDirty&&(this._applySamplingMode(),this._samplingModeDirty=!1),this._wrapModeDirty&&(this._applyWrapMode(),this._wrapModeDirty=!1)}abortCompression(){this.isCompressing&&(this._compressionAbortController.value=i(this._compressionAbortController.value))}_setData(i,r){const s=this._descriptor,o=s.context?.gl;if(!o)return;n(o),this._glName||(this._glName=o.createTexture(),this._glName&&s.context.instanceCounter.increment(p.Texture,this)),E(s);const a=s.context.bindTexture(this,e.TEXTURE_UNIT_FOR_UPDATES);s.context.setActiveTexture(e.TEXTURE_UNIT_FOR_UPDATES),this._configurePixelStorage(),n(o);const l=r??s.target,m=x(l);if(g(i))this._setDataFromTexImageSource(i,l);else{const{width:e,height:r,depth:a}=s;if(null==e||null==r)throw new t("Width and height must be specified!");if(m&&null==a)throw new t("Depth must be specified!");if(s.internalFormat=u(s),s.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(l,s.internalFormat,s.hasMipmap,e,r,a),c(i)){if(!M(s.internalFormat))throw new t("Attempting to use compressed data with an uncompressed format!");this._setDataFromCompressedSource(i,s.internalFormat,l)}else this._texImage(l,0,s.internalFormat,e,r,a,i),n(o),s.hasMipmap&&this.generateMipmap()}this._applySamplingMode(),this._applyWrapMode(),this._applyAnisotropicFilteringParameters(),n(o),s.context.bindTexture(a,e.TEXTURE_UNIT_FOR_UPDATES)}_setDataCubeMap(t=null){for(let e=l.TEXTURE_CUBE_MAP_POSITIVE_X;e<=l.TEXTURE_CUBE_MAP_NEGATIVE_Z;e++)this._setData(t,e)}_configurePixelStorage(){const t=this._descriptor.context.gl,{unpackAlignment:e,flipped:i,preMultiplyAlpha:r}=this._descriptor;t.pixelStorei(t.UNPACK_ALIGNMENT,e),t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,i?1:0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_setDataFromTexImageSource(t,e){const{gl:i}=this._descriptor.context,r=this._descriptor;r.internalFormat=u(r);const s=x(e),{width:o,height:a,depth:l}=T(t);r.width&&r.height,r.width||(r.width=o),r.height||(r.height=a),s&&r.depth,s&&(r.depth=l),r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(e,r.internalFormat,r.hasMipmap,o,a,l),this._texImage(e,0,r.internalFormat,o,a,l,t),n(i),r.hasMipmap&&(this.generateMipmap(),n(i))}_setDataFromCompressedSource(t,e,i){const r=this._descriptor,{width:s,height:o,depth:a}=r,n=t.levels,l=A(i,s,o,a),p=Math.min(l,n.length)-1;this._descriptor.context.gl.texParameteri(r.target,r.context.gl.TEXTURE_MAX_LEVEL,p),this._forEachMipmapLevel(((t,r,s,o)=>{const a=n[Math.min(t,n.length-1)];this._compressedTexImage(i,t,e,r,s,o,a)}),p)}_texStorage(e,i,r,s,o,a){const{gl:n}=this._descriptor.context;if(!f(i))throw new t("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const l=r?A(e,s,o,a):1;if(x(e)){if(null==a)throw new t("Missing depth dimension for 3D texture upload");n.texStorage3D(e,l,i,s,o,a)}else n.texStorage2D(e,l,i,s,o);this._wasImmutablyAllocated=!0}_texImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=x(e),{isImmutable:m,pixelFormat:h,dataType:_}=this._descriptor;if(m){if(null!=n){const r=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,i,0,0,0,s,o,a,h,_,r)}else l.texSubImage2D(e,i,0,0,s,o,h,_,r)}}else{const m=n;if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.texImage3D(e,i,r,s,o,a,0,h,_,m)}else l.texImage2D(e,i,r,s,o,0,h,_,m)}}_compressedTexImage(e,i,r,s,o,a,n){const l=this._descriptor.context.gl,p=x(e);if(this._descriptor.isImmutable){if(null!=n)if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,i,0,0,0,s,o,a,r,n)}else l.compressedTexSubImage2D(e,i,0,0,s,o,r,n)}else if(p){if(null==a)throw new t("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,i,r,s,o,a,0,n)}else l.compressedTexImage2D(e,i,r,s,o,0,n)}async compressOnWorker(t){const e=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_etc"),i=this._descriptor.context?.gl.getExtension("WEBGL_compressed_texture_s3tc"),s=o();if(s&&(e||i)){const o=new AbortController;this._compressionAbortController.value=o;const a={data:await createImageBitmap(t),flipped:this.descriptor.flipped,width:t.width,height:t.height,hasMipmap:this._descriptor.hasMipmap,hasETC:!!e,hasS3TC:!!i};s.invoke(a,this._compressionAbortController.value.signal).then((t=>{t&&this.isCompressing&&this.glName&&(this._descriptor.internalFormat=t.internalFormat,this._setData(t.compressedTexture)),o===this._compressionAbortController.value&&(this._compressionAbortController.value=null)})).catch((t=>{r(t)||o!==this._compressionAbortController.value||(this._compressionAbortController.value=null)}))}}_forEachMipmapLevel(e,i=1/0){let{width:r,height:s,depth:o,hasMipmap:a,target:n}=this._descriptor;const p=n===l.TEXTURE_3D;if(null==r||null==s||p&&null==o)throw new t("Missing texture dimensions for mipmap calculation");for(let t=0;e(t,r,s,o),a&&(1!==r||1!==s||p&&1!==o)&&!(t>=i);++t)r=Math.max(1,r>>1),s=Math.max(1,s>>1),p&&(o=Math.max(1,o>>1))}_applySamplingMode(){const t=this._descriptor,e=t.context?.gl;let i=t.samplingMode,r=t.samplingMode;i===h.LINEAR_MIPMAP_NEAREST||i===h.LINEAR_MIPMAP_LINEAR?(i=h.LINEAR,t.hasMipmap||(r=h.LINEAR)):i!==h.NEAREST_MIPMAP_NEAREST&&i!==h.NEAREST_MIPMAP_LINEAR||(i=h.NEAREST,t.hasMipmap||(r=h.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}_applyWrapMode(){const t=this._descriptor,e=t.context?.gl;"number"==typeof t.wrapMode?(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode)):(e.texParameteri(t.target,e.TEXTURE_WRAP_S,t.wrapMode.s),e.texParameteri(t.target,e.TEXTURE_WRAP_T,t.wrapMode.t))}_applyAnisotropicFilteringParameters(){const t=this._descriptor,e=t.context.capabilities.textureFilterAnisotropic;if(!e)return;t.context.gl.texParameterf(t.target,e.TEXTURE_MAX_ANISOTROPY,t.maxAnisotropy??1)}};export{R as Texture,w as tracer};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/JSONSupport.js";import{clone as o}from"../core/lang.js";import r from"../core/Logger.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import n from"../views/3d/environment/SunnyWeather.js";import{weatherTypes as l,validateWeatherType as a}from"../views/3d/environment/weather.js";import{lightingTypes as p}from"./lightingTypes.js";import h from"./SunLighting.js";import c from"./VirtualLighting.js";import{backgroundProperty as m}from"./background/utils.js";var g;const u=(e,t,o)=>({enabled:!o?.isPresentation});let d=g=class extends t{constructor(e){super(e),this.lighting=new h,this.background=null,this.atmosphereEnabled=!0,this.starsEnabled=!0}set weather(e){a(e?.type,r.getLogger(this))&&this._set("weather",e)}clone(){return new g(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&"virtual"===this.lighting.type?c.prototype.clone.call(this.lighting):h.prototype.clone.call(this.lighting),background:o(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};e([s({types:p,nonNullable:!0,json:{write:!0}})],d.prototype,"lighting",void 0),e([s(m)],d.prototype,"background",void 0),e([s({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"atmosphereEnabled",void 0),e([s({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"starsEnabled",void 0),e([s({types:l,nonNullable:!0,json:{write:!0},value:new n})],d.prototype,"weather",null),d=g=e([i("esri.webscene.Environment")],d);const b=d;export{b as default};
5
+ import{_ as t}from"../chunks/tslib.es6.js";import e from"../core/JSONSupport.js";import{clone as o}from"../core/lang.js";import r from"../core/Logger.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import n from"../views/3d/environment/SunnyWeather.js";import{weatherTypes as l,validateWeatherType as a}from"../views/3d/environment/weather.js";import{lightingTypes as p}from"./lightingTypes.js";import h from"./SunLighting.js";import c from"./VirtualLighting.js";import{backgroundProperty as m}from"./background/utils.js";var g;const u=(t,e,o)=>({enabled:!o?.isPresentation});let d=class extends e{static{g=this}constructor(t){super(t),this.lighting=new h,this.background=null,this.atmosphereEnabled=!0,this.starsEnabled=!0}set weather(t){a(t?.type,r.getLogger(this))&&this._set("weather",t)}clone(){return new g(this.cloneConstructProperties())}cloneConstructProperties(){return{lighting:this.lighting&&"virtual"===this.lighting.type?c.prototype.clone.call(this.lighting):h.prototype.clone.call(this.lighting),background:o(this.background),atmosphereEnabled:this.atmosphereEnabled,starsEnabled:this.starsEnabled,weather:this.weather.clone()}}};t([s({types:p,nonNullable:!0,json:{write:!0}})],d.prototype,"lighting",void 0),t([s(m)],d.prototype,"background",void 0),t([s({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"atmosphereEnabled",void 0),t([s({type:Boolean,nonNullable:!0,json:{write:{overridePolicy:u}}})],d.prototype,"starsEnabled",void 0),t([s({types:l,nonNullable:!0,json:{write:!0},value:new n})],d.prototype,"weather",null),d=g=t([i("esri.webscene.Environment")],d);const b=d;export{b as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/JSONSupport.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../core/accessorSupport/decorators/writer.js";var d;let i=d=class extends t{constructor(e){super(e),this.type="sun",this.date=null,this.directShadowsEnabled=!1,this.displayUTCOffset=null}readDate(e,t){return null!=t.datetime&&new Date(t.datetime)||null}writeDate(e,t,r){t[r]=e.getTime()}readDirectShadowsEnabled(e,t){return!!t.directShadows}writedirectShadowsEnabled(e,t,r){e&&(t[r]=e)}writeDisplayUTCOffset(e,t){null!=e&&(t.displayUTCOffset=e)}clone(){return new d(this.cloneConstructProperties())}cloneConstructProperties(){const e={directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:null!=this.displayUTCOffset?this.displayUTCOffset:null};return null!=this.date&&(e.date=new Date(this.date.getTime())),e}};e([r({readOnly:!0,type:["sun"],json:{write:!0}})],i.prototype,"type",void 0),e([r({type:Date,json:{type:Number,write:{target:"datetime"}}})],i.prototype,"date",void 0),e([o("date",["datetime"])],i.prototype,"readDate",null),e([a("date")],i.prototype,"writeDate",null),e([r({type:Boolean,json:{default:!1,write:{target:"directShadows"}}})],i.prototype,"directShadowsEnabled",void 0),e([o("directShadowsEnabled",["directShadows"])],i.prototype,"readDirectShadowsEnabled",null),e([a("directShadowsEnabled")],i.prototype,"writedirectShadowsEnabled",null),e([r({type:Number,json:{write:!0}})],i.prototype,"displayUTCOffset",void 0),e([a("displayUTCOffset")],i.prototype,"writeDisplayUTCOffset",null),i=d=e([s("esri.webscene.SunLighting")],i);const p=i;export{p as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import t from"../core/JSONSupport.js";import{property as r}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{reader as o}from"../core/accessorSupport/decorators/reader.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{writer as a}from"../core/accessorSupport/decorators/writer.js";var d;let i=class extends t{static{d=this}constructor(e){super(e),this.type="sun",this.date=null,this.directShadowsEnabled=!1,this.displayUTCOffset=null}readDate(e,t){return null!=t.datetime&&new Date(t.datetime)||null}writeDate(e,t,r){t[r]=e.getTime()}readDirectShadowsEnabled(e,t){return!!t.directShadows}writedirectShadowsEnabled(e,t,r){e&&(t[r]=e)}writeDisplayUTCOffset(e,t){null!=e&&(t.displayUTCOffset=e)}clone(){return new d(this.cloneConstructProperties())}cloneConstructProperties(){const e={directShadowsEnabled:this.directShadowsEnabled,displayUTCOffset:null!=this.displayUTCOffset?this.displayUTCOffset:null};return null!=this.date&&(e.date=new Date(this.date.getTime())),e}};e([r({readOnly:!0,type:["sun"],json:{write:!0}})],i.prototype,"type",void 0),e([r({type:Date,json:{type:Number,write:{target:"datetime"}}})],i.prototype,"date",void 0),e([o("date",["datetime"])],i.prototype,"readDate",null),e([a("date")],i.prototype,"writeDate",null),e([r({type:Boolean,json:{default:!1,write:{target:"directShadows"}}})],i.prototype,"directShadowsEnabled",void 0),e([o("directShadowsEnabled",["directShadows"])],i.prototype,"readDirectShadowsEnabled",null),e([a("directShadowsEnabled")],i.prototype,"writedirectShadowsEnabled",null),e([r({type:Number,json:{write:!0}})],i.prototype,"displayUTCOffset",void 0),e([a("displayUTCOffset")],i.prototype,"writeDisplayUTCOffset",null),i=d=e([s("esri.webscene.SunLighting")],i);const p=i;export{p as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as r}from"../chunks/tslib.es6.js";import e from"../core/JSONSupport.js";import{property as o}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as t}from"../core/accessorSupport/decorators/subclass.js";var s;let i=s=class extends e{constructor(r){super(r),this.type="virtual",this.directShadowsEnabled=!1}clone(){return new s(this.cloneConstructProperties())}cloneConstructProperties(){return{directShadowsEnabled:this.directShadowsEnabled}}};r([o({readOnly:!0,type:["virtual"],json:{write:{isRequired:!0}}})],i.prototype,"type",void 0),r([o({type:Boolean,json:{default:!1,name:"directShadows",write:!0}})],i.prototype,"directShadowsEnabled",void 0),i=s=r([t("esri.webscene.VirtualLighting")],i);const c=i;export{c as default};
5
+ import{_ as r}from"../chunks/tslib.es6.js";import e from"../core/JSONSupport.js";import{property as t}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";var s;let i=class extends e{static{s=this}constructor(r){super(r),this.type="virtual",this.directShadowsEnabled=!1}clone(){return new s(this.cloneConstructProperties())}cloneConstructProperties(){return{directShadowsEnabled:this.directShadowsEnabled}}};r([t({readOnly:!0,type:["virtual"],json:{write:{isRequired:!0}}})],i.prototype,"type",void 0),r([t({type:Boolean,json:{default:!1,name:"directShadows",write:!0}})],i.prototype,"directShadowsEnabled",void 0),i=s=r([o("esri.webscene.VirtualLighting")],i);const c=i;export{c as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import{multiplyOpacity as r,getContrast as s,BrightnessThreshold as i}from"../../core/colorUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as n,initial as o}from"../../core/reactiveUtils.js";import{formatDecimal as m,formatImperialArea as l,formatMetricArea as p,formatImperialLength as c,formatMetricLength as u}from"../../core/unitFormatUtils.js";import{convertUnit as h}from"../../core/unitUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as g}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as v}from"../../core/support/UpdatingHandles.js";import{geodesicDensify as y,simplify as f,geodesicLength as _,geodesicArea as w,planarLength as L,planarArea as b}from"../../geometry/geometryEngine.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import G from"../../geometry/Polyline.js";import{isLoaded as M,project as A}from"../../geometry/projection.js";import x from"../../geometry/SpatialReference.js";import{isSupported as k,geodesicDensify as q,geodesicLengths as C,geodesicAreas as R}from"../../geometry/support/geodesicUtils.js";import H from"../../layers/GraphicsLayer.js";import U from"../../symbols/Font.js";import O from"../../symbols/SimpleFillSymbol.js";import T from"../../symbols/SimpleLineSymbol.js";import z from"../../symbols/SimpleMarkerSymbol.js";import D from"../../symbols/TextSymbol.js";import{ViewingMode as E}from"../../views/ViewingMode.js";import{SnappingVisualizer2D as P}from"../../views/2d/interactive/SnappingVisualizer2D.js";import W from"../../views/draw/Draw.js";import{createCoordinateHelper as V}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as F,screenToMap as I,dragManipulatedObject as B}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as J}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as K}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as N}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Q}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as X}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Y}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{acquire as Z}from"../../views/interactive/snapping/SnappingManagerPool.js";import{setupSnappingToggleHandles as $}from"../../views/interactive/snapping/snappingUtils.js";import{fetchMessageBundle as ee}from"../../intl/messages.js";import{onLocaleChange as te}from"../../intl/locale.js";const re=1e5;let se=class extends K{constructor(e){super(e),this._drawActive=!1,this._measurementLayer=new H({internal:!0,listMode:"hide",visible:!1}),this._manipulatorLayer=new H({internal:!0,listMode:"hide",visible:!1}),this._snappingLayer=new H({internal:!0,listMode:"hide",visible:!1}),this._updatingHandles=new v,this._vertices=[],this.measurement=null,this.measurementLabel=null}initialize(){ee("esri/core/t9n/Units").then((e=>{this.messages=e}));const e=this.view;this._draw=new W({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this._snappingManagerResult=Z(e),this.addHandles([te((async()=>{this.messages=await ee("esri/core/t9n/Units")})),n((()=>[this.unit,this.messages]),(()=>{this._updateGraphics()}),o),n((()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor]),(()=>{if(!this._vertices.length)return;const e=this._vertices.map((({coord:e})=>e));for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)})),n((()=>this.snappingOptions.featureSources),(e=>{for(const t of e)t.layer!==this._measurementLayer&&t.layer!==this._manipulatorLayer||(t.enabled=!1)}),o),this._snappingManagerResult]),$(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=a(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=a(this._measurementLayer),this._manipulatorLayer=a(this._manipulatorLayer),this._snappingLayer=a(this._snappingLayer),this._updatingHandles=a(this._updatingHandles),this._resetVertices()}get _snappingManager(){return this._snappingManagerResult.snappingManager}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this._snappingManager.options}get updating(){return this._updatingHandles.updating||this._snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new X({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Q(new N("point",V(!1,!1,this.view.spatialReference)),E.Local),visualizer:new P(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const e=this._snappingManager,t=this._draw.create("polyline",{mode:"click",snappingManager:e});t.on(["vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],(e=>this._updateSketch(e.vertices))),t.on("draw-complete",(()=>this._stopSketch()))}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach((({manipulator:e})=>{e.interactive=!0})),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const t=this.view.spatialReference;if(t&&(!oe(t)||M())){for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[s,i]=e[r],a=new j({x:s,y:i,spatialReference:t}),n=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=Q.fromGeometry(a,E.Local);o.on("vertex-update",(e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())}));const m=F(n,((e,t,r,s)=>{const i=this._getSnappingContext(s),a=this._snappingManager,n=this._updatingHandles,{snappingStep:m}=Y({snappingContext:i,snappingManager:a,updatingHandles:n});t.next(I(this.view)).next((t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t})).next(...m).next(B({operations:o})).next((()=>{e.graphic.geometry=o.data.geometry}))}));this._vertices.push({manipulator:n,coord:[s,i],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,s=this._vertices[r],[i,a]=e[r];s.coord[0]===i&&s.coord[1]===a||(s.coord=[i,a],s.manipulator.graphic.geometry=new j({x:i,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach((({manipulator:e})=>{e.interactive=null==n||e!==n}))}this._updateGraphics()}}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=ae(this._vertices.map((({coord:e})=>e)),this.view.spatialReference);if(!e)return;const{measurement:a,fillGeometry:n,outlineGeometry:o}=e;this._set("measurement",a);const m=a?me(this.messages,a,this.unit):null;if(this._set("measurementLabel",m),!n&&!o)return;let l,p,c;const{graphics:u}=this._measurementLayer,h=3===u.length,{effectiveTheme:d}=this.view;h?(l=u.at(0),p=u.at(1),c=u.at(2)):(l=new t({symbol:new O({color:r(d.accentColor,.3),outline:null})}),p=new t({symbol:new T({color:d.accentColor,width:2})}),c=new t({symbol:new D({color:d.textColor,font:new U({size:14,family:"sans-serif"}),haloColor:r(s(d.textColor,i.Low),.5),haloSize:2})}),u.removeAll(),u.addMany([l,p,c])),l.geometry=n,p.geometry=o,c.geometry=n?.centroid,c.symbol.text=m?.area??""}};function ie(e,s,i){const a=8,n={style:"circle",color:r(s.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new z({...n,size:a}),m=new z({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new J({view:s,layer:i,graphic:l,focusedSymbol:m})}function ae(e,t){if(2===e.length){const r=new G({paths:[e],spatialReference:t});let s;if(t.isGeographic)if(k(t))s=q(r,re);else{const e=A(r,x.WGS84),i=q(e,re);s=A(i,t)}else s=t.isWebMercator?y(r,re,"meters"):r;return{measurement:null,fillGeometry:null,outlineGeometry:s}}e.push(e[0]);const r=new G({paths:[e],spatialReference:t}),s=new S({rings:[e],spatialReference:t});let i,a,n=null,o=null;if(t.isGeographic)if(k(t)){if(n=q(r,re),o=q(s,re),o=f(o),!o)return null;i=C([r],"meters")[0],a=R([o],"square-meters")[0]}else{const e=x.WGS84,m=A(r,e),l=A(s,e);if(n=q(m,re),o=q(l,re),o=f(o),!o)return null;i=C([m],"meters")[0],a=R([o],"square-meters")[0],n=A(n,t),o=A(o,t)}else if(t.isWebMercator){if(n=y(r,re,"meters"),o=y(s,re,"meters"),o=f(o),!o)return null;i=_(r,"meters"),a=w(o,"square-meters")}else{if(n=r,o=f(s),!o)return null;i=L(r,"meters"),a=b(o,"square-meters")}return{measurement:{geometry:o,area:a,perimeter:i},fillGeometry:o,outlineGeometry:n}}function ne(e){return null!=e}function oe(e){if(!e)return!1;const{isGeographic:t,isWebMercator:r,isWGS84:s}=e;return t&&!s&&!k(e)||!t&&!r}function me(e,t,r){if(!t||!e)return null;const s={area:null,perimeter:null},{area:i,perimeter:a}=t;switch(r){case"metric":s.area=p(e,i,"square-meters");break;case"imperial":s.area=l(e,i,"square-meters");break;default:{const t=h(i,"square-meters",r);s.area=m(e,t,r);break}}const n=le(r);if(n)switch(n){case"metric":s.perimeter=u(e,a,"meters");break;case"imperial":s.perimeter=c(e,a,"meters");break;default:{const t=h(a,"meters",n);s.perimeter=m(e,t,n);break}}else s.perimeter="";return s}function le(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([d()],se.prototype,"_drawActive",void 0),e([d({readOnly:!0})],se.prototype,"cursor",null),e([d({value:!0})],se.prototype,"editable",null),e([d({readOnly:!0})],se.prototype,"measurement",void 0),e([d({readOnly:!0})],se.prototype,"measurementLabel",void 0),e([d()],se.prototype,"messages",void 0),e([d()],se.prototype,"unit",void 0),e([d()],se.prototype,"updating",null),e([d({constructOnly:!0})],se.prototype,"view",void 0),se=e([g("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],se);export{se as AreaMeasurement2DTool,ae as createAreaMeasurementInfo2D,me as createAreaMeasurementLabel,oe as isProjectionEngineRequired,ne as isSupported};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import t from"../../Graphic.js";import"../../intl.js";import{multiplyOpacity as r,getContrast as i,BrightnessThreshold as s}from"../../core/colorUtils.js";import{destroyMaybe as a}from"../../core/maybe.js";import{watch as n,initial as o}from"../../core/reactiveUtils.js";import{formatDecimal as m,formatImperialArea as l,formatMetricArea as p,formatImperialLength as c,formatMetricLength as u}from"../../core/unitFormatUtils.js";import{convertUnit as h}from"../../core/unitUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as v}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as y}from"../../core/support/UpdatingHandles.js";import{geodesicDensify as f,simplify as g,geodesicLength as _,geodesicArea as w,planarLength as L,planarArea as b}from"../../geometry/geometryEngine.js";import j from"../../geometry/Point.js";import S from"../../geometry/Polygon.js";import G from"../../geometry/Polyline.js";import{isLoaded as A,project as x}from"../../geometry/projection.js";import M from"../../geometry/SpatialReference.js";import{isSupported as k,geodesicDensify as q,geodesicLengths as C,geodesicAreas as H}from"../../geometry/support/geodesicUtils.js";import R from"../../layers/GraphicsLayer.js";import U from"../../symbols/Font.js";import O from"../../symbols/SimpleFillSymbol.js";import T from"../../symbols/SimpleLineSymbol.js";import z from"../../symbols/SimpleMarkerSymbol.js";import D from"../../symbols/TextSymbol.js";import{ViewingMode as E}from"../../views/ViewingMode.js";import{SnappingVisualizer2D as W}from"../../views/2d/interactive/SnappingVisualizer2D.js";import P from"../../views/draw/Draw.js";import{createCoordinateHelper as V}from"../../views/interactive/coordinateHelper.js";import{createManipulatorDragEventPipeline as F,screenToMap as I,dragManipulatedObject as B}from"../../views/interactive/dragEventPipeline.js";import{GraphicManipulator as J}from"../../views/interactive/GraphicManipulator.js";import{InteractiveToolBase as K}from"../../views/interactive/InteractiveToolBase.js";import{EditGeometry as N}from"../../views/interactive/editGeometry/EditGeometry.js";import{EditGeometryOperations as Q}from"../../views/interactive/editGeometry/EditGeometryOperations.js";import{SnappingContext as X}from"../../views/interactive/snapping/SnappingContext.js";import{createSnapDragEventPipelineStep as Y}from"../../views/interactive/snapping/SnappingDragPipelineStep.js";import{setupSnappingToggleHandles as Z}from"../../views/interactive/snapping/snappingUtils.js";import{fetchMessageBundle as $}from"../../intl/messages.js";import{onLocaleChange as ee}from"../../intl/locale.js";const te=1e5;let re=class extends K{constructor(e){super(e),this._measurementLayer=new R({internal:!0,listMode:"hide",visible:!1}),this._manipulatorLayer=new R({internal:!0,listMode:"hide",visible:!1}),this._snappingLayer=new R({internal:!0,listMode:"hide",visible:!1}),this._updatingHandles=new y,this._vertices=[],this._drawActive=!1,this.measurement=null,this.measurementLabel=null}initialize(){$("esri/core/t9n/Units").then((e=>{this.messages=e}));const e=this.view;this._draw=new P({view:e}),e.map.addMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),e.focus(),this.addHandles([ee((async()=>{this.messages=await $("esri/core/t9n/Units")})),n((()=>[this.unit,this.messages]),(()=>{this._updateGraphics()}),o),n((()=>[this.view.effectiveTheme.accentColor,this.view.effectiveTheme.textColor]),(()=>{if(!this._vertices.length)return;const e=this._vertices.map((({coord:e})=>e));for(const{handle:t}of this._vertices)t.remove();this._vertices=[],this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this.manipulators.removeAll(),this._updateSketch(e)}))]),Z(this)}destroy(){const{map:e}=this.view;this._draw.view=null,this._draw=a(this._draw),e.removeMany([this._measurementLayer,this._manipulatorLayer,this._snappingLayer]),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._snappingLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._measurementLayer=a(this._measurementLayer),this._manipulatorLayer=a(this._manipulatorLayer),this._snappingLayer=a(this._snappingLayer),this._updatingHandles=a(this._updatingHandles),this._resetVertices()}get cursor(){return this._drawActive?"crosshair":null}set editable(e){this._set("editable",e),e||this._draw.reset()}get snappingOptions(){return this.snappingManager.options}get updating(){return this._updatingHandles.updating||this.snappingManager.updating}onActivate(){this._drawActive||0!==this._vertices.length||this._startSketch()}onShow(){this._measurementLayer.visible=!0,this._manipulatorLayer.visible=!0,this._snappingLayer.visible=!0}onHide(){this._measurementLayer.visible=!1,this._manipulatorLayer.visible=!1,this._snappingLayer.visible=!1}reset(){this.manipulators.removeAll(),this._resetVertices(),this._measurementLayer.removeAll(),this._manipulatorLayer.removeAll(),this._set("measurement",null),this._set("measurementLabel",null),this._draw.reset(),this._drawActive=!1}_getSnappingContext(e){return new X({elevationInfo:{mode:"on-the-ground",offset:0},pointer:e,editGeometryOperations:new Q(new N("point",V(!1,!1,this.view.spatialReference)),E.Local),visualizer:new W(this._snappingLayer)})}_resetVertices(){for(const{handle:e}of this._vertices)e.remove();this._vertices=[]}_startSketch(){this._drawActive=!0;const{snappingManager:e}=this,t=this._draw.create("polyline",{mode:"click",snappingManager:e});t.on(["vertex-add","vertex-update","vertex-remove","cursor-update","undo","redo"],(e=>this._updateSketch(e.vertices))),t.on("draw-complete",(()=>this._stopSketch()))}_stopSketch(){if(this._vertices.length<3)return this.reset(),void this._startSketch();this.manipulators.forEach((({manipulator:e})=>{e.interactive=!0})),this._drawActive=!1,this.finishToolCreation()}_updateSketch(e){const t=this.view.spatialReference;if(t&&(!ne(t)||A())){for(;this._vertices.length>e.length;){const{handle:e,manipulator:t}=this._vertices.pop();e.remove(),this.manipulators.remove(t)}for(let r=this._vertices.length;r<e.length;r++){const[i,s]=e[r],a=new j({x:i,y:s,spatialReference:t}),n=ie(a,this.view,this._manipulatorLayer);this.manipulators.add(n);const o=Q.fromGeometry(a,E.Local);o.on("vertex-update",(e=>{const t=e.vertices.at(0);t&&(this._vertices[r].coord=[t.pos[0],t.pos[1]],this._updateGraphics())}));const m=F(n,((e,t,r,i)=>{const s=this._getSnappingContext(i),{snappingManager:a}=this,n=this._updatingHandles,{snappingStep:m}=Y({snappingContext:s,snappingManager:a,updatingHandles:n});t.next(I(this.view)).next((t=>{if("start"===t.action){const r=new j(t.mapStart);e.graphic.geometry=r,o.trySetGeometry(r)}return t})).next(...m).next(B({operations:o})).next((()=>{e.graphic.geometry=o.data.geometry}))}));this._vertices.push({manipulator:n,coord:[i,s],handle:m})}if(this._vertices.length){const r=this._vertices.length-1,i=this._vertices[r],[s,a]=e[r];i.coord[0]===s&&i.coord[1]===a||(i.coord=[s,a],i.manipulator.graphic.geometry=new j({x:s,y:a,spatialReference:t}));const n=this._drawActive?this._vertices[r].manipulator:null;this.manipulators.forEach((({manipulator:e})=>{e.interactive=null==n||e!==n}))}this._updateGraphics()}}_updateGraphics(){if(this._vertices.length<2)return void this._measurementLayer.removeAll();const e=se(this._vertices.map((({coord:e})=>e)),this.view.spatialReference);if(!e)return;const{measurement:a,fillGeometry:n,outlineGeometry:o}=e;this._set("measurement",a);const m=a?oe(this.messages,a,this.unit):null;if(this._set("measurementLabel",m),!n&&!o)return;let l,p,c;const{graphics:u}=this._measurementLayer,h=3===u.length,{effectiveTheme:d}=this.view;h?(l=u.at(0),p=u.at(1),c=u.at(2)):(l=new t({symbol:new O({color:r(d.accentColor,.3),outline:null})}),p=new t({symbol:new T({color:d.accentColor,width:2})}),c=new t({symbol:new D({color:d.textColor,font:new U({size:14,family:"sans-serif"}),haloColor:r(i(d.textColor,s.Low),.5),haloSize:2})}),u.removeAll(),u.addMany([l,p,c])),l.geometry=n,p.geometry=o,c.geometry=n?.centroid,c.symbol.text=m?.area??""}};function ie(e,i,s){const a=8,n={style:"circle",color:r(i.effectiveTheme.accentColor,.5),outline:{type:"simple-line",width:0}},o=new z({...n,size:a}),m=new z({...n,size:1.5*a}),l=new t({geometry:e,symbol:o});return new J({view:i,layer:s,graphic:l,focusedSymbol:m})}function se(e,t){if(2===e.length){const r=new G({paths:[e],spatialReference:t});let i;if(t.isGeographic)if(k(t))i=q(r,te);else{const e=x(r,M.WGS84),s=q(e,te);i=x(s,t)}else i=t.isWebMercator?f(r,te,"meters"):r;return{measurement:null,fillGeometry:null,outlineGeometry:i}}e.push(e[0]);const r=new G({paths:[e],spatialReference:t}),i=new S({rings:[e],spatialReference:t});let s,a,n=null,o=null;if(t.isGeographic)if(k(t)){if(n=q(r,te),o=q(i,te),o=g(o),!o)return null;s=C([r],"meters")[0],a=H([o],"square-meters")[0]}else{const e=M.WGS84,m=x(r,e),l=x(i,e);if(n=q(m,te),o=q(l,te),o=g(o),!o)return null;s=C([m],"meters")[0],a=H([o],"square-meters")[0],n=x(n,t),o=x(o,t)}else if(t.isWebMercator){if(n=f(r,te,"meters"),o=f(i,te,"meters"),o=g(o),!o)return null;s=_(r,"meters"),a=w(o,"square-meters")}else{if(n=r,o=g(i),!o)return null;s=L(r,"meters"),a=b(o,"square-meters")}return{measurement:{geometry:o,area:a,perimeter:s},fillGeometry:o,outlineGeometry:n}}function ae(e){return null!=e}function ne(e){if(!e)return!1;const{isGeographic:t,isWebMercator:r,isWGS84:i}=e;return t&&!i&&!k(e)||!t&&!r}function oe(e,t,r){if(!t||!e)return null;const i={area:null,perimeter:null},{area:s,perimeter:a}=t;switch(r){case"metric":i.area=p(e,s,"square-meters");break;case"imperial":i.area=l(e,s,"square-meters");break;default:{const t=h(s,"square-meters",r);i.area=m(e,t,r);break}}const n=me(r);if(n)switch(n){case"metric":i.perimeter=u(e,a,"meters");break;case"imperial":i.perimeter=c(e,a,"meters");break;default:{const t=h(a,"meters",n);i.perimeter=m(e,t,n);break}}else i.perimeter="";return i}function me(e){switch(e){case"metric":case"ares":case"hectares":return"metric";case"imperial":case"acres":return"imperial";case"square-inches":return"inches";case"square-feet":return"feet";case"square-yards":return"yards";case"square-miles":return"miles";case"square-nautical-miles":return"nautical-miles";case"square-us-feet":return"us-feet";case"square-meters":return"meters";case"square-kilometers":return"kilometers";case"square-millimeters":return"millimeters";case"square-centimeters":return"centimeters";case"square-decimeters":return"decimeters";default:return null}}e([d()],re.prototype,"_drawActive",void 0),e([d({readOnly:!0})],re.prototype,"cursor",null),e([d({value:!0})],re.prototype,"editable",null),e([d({readOnly:!0})],re.prototype,"measurement",void 0),e([d({readOnly:!0})],re.prototype,"measurementLabel",void 0),e([d()],re.prototype,"messages",void 0),e([d({constructOnly:!0})],re.prototype,"snappingManager",void 0),e([d()],re.prototype,"unit",void 0),e([d()],re.prototype,"updating",null),e([d({constructOnly:!0})],re.prototype,"view",void 0),re=e([v("esri.widgets.AreaMeasurement2D.AreaMeasurement2DTool")],re);export{re as AreaMeasurement2DTool,se as createAreaMeasurementInfo2D,oe as createAreaMeasurementLabel,ne as isProjectionEngineRequired,ae as isSupported};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import{watch as e,initial as i,whenOnce as r}from"../../core/reactiveUtils.js";import{measurementAreaUnits as s}from"../../core/unitUtils.js";import{property as o}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as n}from"../../core/accessorSupport/decorators/subclass.js";import{load as l}from"../../geometry/projection.js";import{defaultUnitPropertyMetadata as a}from"../../properties/defaultUnit.js";import{isSupported as u,isProjectionEngineRequired as p,AreaMeasurement2DTool as m}from"./AreaMeasurement2DTool.js";import{InteractiveToolViewModel as d}from"../support/InteractiveToolViewModel.js";let c=class extends d{constructor(t){super(t),this.supportedViewType="2d",this.unsupportedErrorMessage="AreaMeasurement2DViewModel is only supported in 2D views."}initialize(){this.addHandles([e((()=>this.view?.spatialReference),(()=>this.clear())),e((()=>this.unit),(t=>{null!=this.tool&&(this.tool.unit=t)}),i)])}get measurement(){return null!=this.tool?this.tool.measurement:null}get measurementLabel(){return null!=this.tool?this.tool.measurementLabel:null}get state(){return this.disabled||null==this.view||!u(this.view.spatialReference)?"disabled":this.tool?.measurement?this.tool.active?"measuring":"measured":"ready"}get unit(){return this._validateUnit(this.defaultUnit)}set unit(t){this._overrideIfSome("unit",this._validateUnit(t))}get unitOptions(){return s}set unitOptions(t){this._overrideIfSome("unitOptions",this._validateUnits(t))}async start(){const t=this.view;null!=t&&(await r((()=>t.ready)),p(t.spatialReference)&&await l()),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new m({view:this.view,visible:this.visible,unit:this.unit})}_validateUnit(t){const{unitOptions:e,defaultUnit:i}=this;return null!=t&&e.includes(t)?t:e.includes(i)?i:e.length>0?e[0]:i}_validateUnits(t){if(null==t)return[];const e=t.filter((t=>s.includes(t)));return 0===e.length?s.slice():e}};t([o(a)],c.prototype,"defaultUnit",void 0),t([o({readOnly:!0})],c.prototype,"measurement",null),t([o({readOnly:!0})],c.prototype,"measurementLabel",null),t([o({readOnly:!0})],c.prototype,"state",null),t([o({type:String})],c.prototype,"unit",null),t([o({type:[String]})],c.prototype,"unitOptions",null),c=t([n("esri.widgets.AreaMeasurement2D.AreaMeasurement2DViewModel")],c);const h=c;export{h as default};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import{destroyMaybe as e}from"../../core/maybe.js";import{watch as i,initial as s,syncAndInitial as n,whenOnce as r}from"../../core/reactiveUtils.js";import{measurementAreaUnits as o}from"../../core/unitUtils.js";import{property as a}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as p}from"../../core/accessorSupport/decorators/subclass.js";import{load as l}from"../../geometry/projection.js";import{defaultUnitPropertyMetadata as u}from"../../properties/defaultUnit.js";import{SnappingManager as m}from"../../views/interactive/snapping/SnappingManager.js";import g from"../../views/interactive/snapping/SnappingOptions.js";import{isSupported as h,isProjectionEngineRequired as d,AreaMeasurement2DTool as c}from"./AreaMeasurement2DTool.js";import{InteractiveToolViewModel as v}from"../support/InteractiveToolViewModel.js";let f=class extends v{constructor(t){super(t),this.supportedViewType="2d",this.unsupportedErrorMessage="AreaMeasurement2DViewModel is only supported in 2D views.",this._snappingManager=null,this.snappingOptions=new g}initialize(){this.addHandles([i((()=>this.view?.spatialReference),(()=>this.clear())),i((()=>this.unit),(t=>{null!=this.tool&&(this.tool.unit=t)}),s),i((()=>this.view),(t=>{this._snappingManager=e(this._snappingManager),t&&(this._snappingManager=new m({view:t,options:this.snappingOptions}))}),n),i((()=>this.snappingOptions),(t=>{this._snappingManager&&t&&(this._snappingManager.options=t)}))])}destroy(){this._snappingManager=e(this._snappingManager)}get measurement(){return this.tool?.measurement??null}get measurementLabel(){return this.tool?.measurementLabel??null}get state(){return this.disabled||null==this.view||!h(this.view.spatialReference)?"disabled":this.tool?.measurement?this.tool.active?"measuring":"measured":"ready"}get unit(){return this._validateUnit(this.defaultUnit)}set unit(t){this._overrideIfSome("unit",this._validateUnit(t))}get unitOptions(){return o}set unitOptions(t){this._overrideIfSome("unitOptions",this._validateUnits(t))}async start(){const t=this.view;null!=t&&(await r((()=>t.ready)),d(t.spatialReference)&&await l()),this.createTool({interactive:!0})}clear(){this.removeTool()}constructTool(){return new c({snappingManager:this._snappingManager,unit:this.unit,view:this.view,visible:this.visible})}_validateUnit(t){const{unitOptions:e,defaultUnit:i}=this;return null!=t&&e.includes(t)?t:e.includes(i)?i:e.length>0?e[0]:i}_validateUnits(t){if(null==t)return[];const e=t.filter((t=>o.includes(t)));return 0===e.length?o.slice():e}};t([a()],f.prototype,"_snappingManager",void 0),t([a(u)],f.prototype,"defaultUnit",void 0),t([a({readOnly:!0})],f.prototype,"measurement",null),t([a({readOnly:!0})],f.prototype,"measurementLabel",null),t([a({type:g,nonNullable:!0})],f.prototype,"snappingOptions",void 0),t([a({readOnly:!0})],f.prototype,"state",null),t([a({type:String})],f.prototype,"unit",null),t([a({type:[String]})],f.prototype,"unitOptions",null),f=t([p("esri.widgets.AreaMeasurement2D.AreaMeasurement2DViewModel")],f);const y=f;export{y as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as o}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import r from"./AreaMeasurement2D/AreaMeasurement2DViewModel.js";import{globalCss as n}from"./support/globalCss.js";import{MeasurementWidgetContent as a}from"./support/MeasurementWidgetContent.js";import"./support/widgetUtils.js";import{messageBundle as l}from"./support/decorators/messageBundle.js";import{tsx as p}from"./support/jsxFactory.js";const u="esri-area-measurement-2d",m={base:u,newMeasurementButton:`${u}__clear-button`};let d=class extends i{constructor(e,t){super(e,t),this.messages=null,this.messagesUnits=null,this.messagesCommon=null,this.viewModel=new r}get active(){return this.viewModel.active}get icon(){return"measure-area"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const{messages:e,messagesCommon:s,messagesUnits:o,unit:i,unitOptions:r,viewModel:l,visible:u}=this,{active:d,measurementLabel:c,state:v,supported:g}=l;return p("div",{"aria-label":e.widgetLabel,class:this.classes(m.base,n.widget,n.panel),key:this,role:"region"},u?p(a,{active:d,measurementItems:[{key:"area",title:o?.measures.area,value:c?.area},{key:"perimeter",title:e.perimeter,value:c?.perimeter}],messages:{...e,notApplicable:s.notApplicable},newMeasurementButtonClass:m.newMeasurementButton,state:v,supported:g,unit:i,unitOptions:r,onNewMeasurementClick:()=>{t(l.start())},onUnitChange:e=>{this.unit=e}}):null)}};e([s({readOnly:!0})],d.prototype,"active",null),e([s()],d.prototype,"icon",null),e([s()],d.prototype,"label",null),e([s(),l("esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D")],d.prototype,"messages",void 0),e([s(),l("esri/core/t9n/Units")],d.prototype,"messagesUnits",void 0),e([s(),l("esri/t9n/common")],d.prototype,"messagesCommon",void 0),e([s()],d.prototype,"uiStrings",void 0),e([s()],d.prototype,"unit",null),e([s()],d.prototype,"unitOptions",null),e([s()],d.prototype,"view",null),e([s({type:r})],d.prototype,"viewModel",void 0),e([s({type:Boolean})],d.prototype,"visible",null),d=e([o("esri.widgets.AreaMeasurement2D")],d);const c=d;export{c as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import{ignoreAbortErrors as t}from"../core/promiseUtils.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/has.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as i}from"../core/accessorSupport/decorators/subclass.js";import o from"./Widget.js";import r from"./AreaMeasurement2D/AreaMeasurement2DViewModel.js";import{globalCss as n}from"./support/globalCss.js";import{MeasurementWidgetContent as p}from"./support/MeasurementWidgetContent.js";import"./support/widgetUtils.js";import{messageBundle as a}from"./support/decorators/messageBundle.js";import{tsx as l}from"./support/jsxFactory.js";const u="esri-area-measurement-2d",m={base:u,newMeasurementButton:`${u}__clear-button`};let d=class extends o{constructor(e,t){super(e,t),this.messages=null,this.messagesUnits=null,this.messagesCommon=null,this.viewModel=new r}get active(){return this.viewModel.active}get icon(){return"measure-area"}set icon(e){this._overrideIfSome("icon",e)}get label(){return this.messages?.widgetLabel??""}set label(e){this._overrideIfSome("label",e)}get snappingOptions(){return this.viewModel.snappingOptions}set snappingOptions(e){this.viewModel.snappingOptions=e}get unit(){return this.viewModel.unit}set unit(e){this.viewModel.unit=e}get unitOptions(){return this.viewModel.unitOptions}set unitOptions(e){this.viewModel.unitOptions=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}render(){const{messages:e,messagesCommon:s,messagesUnits:i,unit:o,unitOptions:r,viewModel:a,visible:u}=this,{active:d,measurementLabel:v,state:c,supported:g}=a;return l("div",{"aria-label":e.widgetLabel,class:this.classes(m.base,n.widget,n.panel),key:this,role:"region"},u?l(p,{active:d,measurementItems:[{key:"area",title:i?.measures.area,value:v?.area},{key:"perimeter",title:e.perimeter,value:v?.perimeter}],messages:{...e,notApplicable:s.notApplicable},newMeasurementButtonClass:m.newMeasurementButton,state:c,supported:g,unit:o,unitOptions:r,onNewMeasurementClick:()=>{t(a.start())},onUnitChange:e=>{this.unit=e}}):null)}};e([s({readOnly:!0})],d.prototype,"active",null),e([s()],d.prototype,"icon",null),e([s()],d.prototype,"label",null),e([s(),a("esri/widgets/AreaMeasurement2D/t9n/AreaMeasurement2D")],d.prototype,"messages",void 0),e([s(),a("esri/core/t9n/Units")],d.prototype,"messagesUnits",void 0),e([s(),a("esri/t9n/common")],d.prototype,"messagesCommon",void 0),e([s()],d.prototype,"snappingOptions",null),e([s()],d.prototype,"uiStrings",void 0),e([s()],d.prototype,"unit",null),e([s()],d.prototype,"unitOptions",null),e([s()],d.prototype,"view",null),e([s({type:r})],d.prototype,"viewModel",void 0),e([s({type:Boolean})],d.prototype,"visible",null),d=e([i("esri.widgets.AreaMeasurement2D")],d);const v=d;export{v as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Evented.js";import o from"../../core/Logger.js";import{abortMaybe as a}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as l,watch as u,sync as m}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as h}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as c}from"../../core/support/UpdatingHandles.js";import f from"../../geometry/SpatialReference.js";import{system as _}from"../../time/timeZoneUtils.js";import{createReactiveGraphic as F}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as y}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as g}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as v}from"./expressions/ExpressionsModel.js";import{BatchFormInputs as I}from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as E}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as x,InputVisibilityCode as w}from"./inputs/support/inputUtils.js";import T from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as M}from"./templates/support/createBatchFormTemplate.js";let b=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new r,this.map=null,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new y,this._activeFormInputsByElementId=new Map,this._emptyForm=new I({inputs:[]}),this._emptyFormTemplate=new T({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._updatingHandles=new c,this._layerTemplateMap=new p,this._workingFeatures=new r,this._expressionsManager=new g({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:_}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([l((()=>this.features),"after-changes",(()=>this._prepare()),{sync:!0}),u((()=>[this.features,this.map,this.timeZone,this.editType]),(()=>{this._prepare()}),m),u((()=>this.activeForm),(()=>this._activeFormInputsByElementId.clear()),m)]),this._prepare()}destroy(){this._prepareTask=a(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const r=this._makeBatchFormInputsForFeature(e);return r!==this._emptyForm&&this._featureFormMap.set(e,r),r}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some((t=>t!==e))}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.activeForm.inputs.filter((e=>e.visible)).length>0}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return x.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case w.HIDDEN_NOT_IN_ALL_LAYERS:case w.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(x.noElementsInCommon);break;case w.HIDDEN_FIELD_DEFINITION:case w.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case w.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(x.allElementsHidden);break;case w.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case w.HIDDEN_VISIBILITY_EXPRESSION_SOME:return x.elementsHiddenInSome}return e.has(x.allElementsHidden)?x.allElementsHidden:x.noElementsInCommon}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach((t=>{const r=t.sourceLayer??t.layer;e.add(r)})),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const r=this.activeForm.allFieldInputs.find((t=>t.template.elementId===e));return void 0!==r?(t.set(e,r),r):void 0}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._workingFeatures.find((({original:t})=>t===e));if(!t)throw new s("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}setFieldInputValue(e,t){e.setValueFromUser(t),this.emit("value-change",{features:e.features.toArray().map((e=>e.original)),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const r=this.findFieldInput(e);if(null==r)throw new s("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(r,t)}validate(){return!1}getCodedValueOptions(e){return e.codedValues.map((({name:e,code:t})=>({name:e,value:t})))}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?E(t,new r([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._prepareTask=a(this._prepareTask),this._updateWorkingFeatures(),a(this._expressionsManager),this._expressionsManager=new g({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??f.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const r=t((async t=>{try{n(t);const r=new Map;for(const t of e){const e=await M(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,e),this._expressionsManager.layerExpressionsModelMap.set(t,new v({preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,executorMap:e.getExpressionExecutorsForLayer(t)}));for(const t of e.elements){const{elementId:e}=t;r.has(e)?r.get(e).foldIn(t):r.set(e,t.clone())}}const s=new T({elements:Array.from(r.values())});this.sharedFormTemplate=s,this.sharedForm=E(s,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures)}catch(r){throw o.getLogger(this).error("Failed preparing form",r),r}}));this._updatingHandles.addPromise(r.promise),this._prepareTask=r}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;0!==e.length&&this._workingFeatures.addMany(e.map(F))}};e([d()],b.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],b.prototype,"activeFeature",null),e([d()],b.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],b.prototype,"activeForm",null),e([d()],b.prototype,"disabled",void 0),e([d()],b.prototype,"calculating",null),e([d()],b.prototype,"editType",void 0),e([d()],b.prototype,"features",void 0),e([d()],b.prototype,"expressionEvaluationFailed",null),e([d()],b.prototype,"hasNonActiveInvalidFeatures",null),e([d()],b.prototype,"invalidFeatures",null),e([d()],b.prototype,"hasVisibleInputs",null),e([d()],b.prototype,"map",void 0),e([d()],b.prototype,"noVisibleElementsReason",null),e([d()],b.prototype,"spatialReference",void 0),e([d()],b.prototype,"submitHasBeenAttempted",void 0),e([d()],b.prototype,"timeZone",void 0),e([d()],b.prototype,"updating",null),e([d()],b.prototype,"valid",null),e([d()],b.prototype,"layers",null),e([d()],b.prototype,"mode",null),e([d()],b.prototype,"submit",null),e([d()],b.prototype,"sharedForm",void 0),e([d()],b.prototype,"sharedFormTemplate",void 0),e([d()],b.prototype,"userHasChangedValues",void 0),e([d()],b.prototype,"_arcadeExecutorProvider",void 0),e([d()],b.prototype,"_prepareTask",void 0),e([d()],b.prototype,"_layerTemplateMap",void 0),e([d()],b.prototype,"_workingFeatures",void 0),e([d()],b.prototype,"_expressionsManager",void 0),b=e([h("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],b);const j=b;export{j as default};
5
+ import{_ as e}from"../../chunks/tslib.es6.js";import{createTask as t}from"../../core/asyncUtils.js";import r from"../../core/Collection.js";import s from"../../core/Error.js";import i from"../../core/Evented.js";import a from"../../core/Logger.js";import{abortMaybe as o}from"../../core/maybe.js";import{throwIfAborted as n}from"../../core/promiseUtils.js";import p from"../../core/ReactiveMap.js";import{on as l,watch as u,whenOnce as m,sync as h}from"../../core/reactiveUtils.js";import{property as d}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/RandomLCG.js";import{subclass as c}from"../../core/accessorSupport/decorators/subclass.js";import{UpdatingHandles as _}from"../../core/support/UpdatingHandles.js";import f from"../../geometry/SpatialReference.js";import{system as v}from"../../time/timeZoneUtils.js";import{createReactiveGraphic as F}from"./batchAttributeFormUtils.js";import{ArcadeExecutorProvider as g}from"./expressions/ArcadeExecutorProvider.js";import{ExpressionsManager as y}from"./expressions/ExpressionsManager.js";import{ExpressionsModel as I}from"./expressions/ExpressionsModel.js";import{BatchFormInputs as E}from"./inputs/BatchFormInputs.js";import{createBatchFormInputsFromBatchFormTemplate as w}from"./inputs/support/createBatchFormInputs.js";import{NoVisibleElementCodes as x,InputVisibilityCode as M}from"./inputs/support/inputUtils.js";import T from"./templates/BatchFormTemplate.js";import{createBatchFormTemplate as k}from"./templates/support/createBatchFormTemplate.js";let b=class extends i.EventedAccessor{constructor(e){super(e),this.activeFeatureIndex=-1,this.disabled=!1,this.editType="NA",this.features=new r,this.map=null,this.spatialReference=null,this.submitHasBeenAttempted=!1,this.timeZone=null,this.userHasChangedValues=!1,this._arcadeExecutorProvider=new g,this._activeFormInputsByElementId=new Map,this._emptyForm=new E({inputs:[]}),this._emptyFormTemplate=new T({elements:[]}),this._featureFormMap=new Map,this._prepareTask=null,this._reactiveGraphicLookup=new p,this._updatingHandles=new _,this._layerTemplateMap=new p,this._workingFeatures=new r,this._expressionsManager=new y({arcadeContext:{editType:"NA",spatialReference:null,map:null,timeZone:v}}),this.sharedForm=this._emptyForm,this.sharedFormTemplate=this._emptyFormTemplate}initialize(){this.addHandles([l((()=>this.features),"after-changes",(()=>this._prepare()),{sync:!0}),u((()=>[this.features,this.map,this.timeZone,this.editType]),(()=>{this._prepare()}),h),u((()=>this.activeForm),(()=>this._activeFormInputsByElementId.clear()),h)]),this._prepare()}destroy(){this._prepareTask=o(this._prepareTask),this._workingFeatures.destroyAll(),this._expressionsManager&&this._expressionsManager.abort(),this._reactiveGraphicLookup=new p,this._emptyForm.destroy(),this._emptyFormTemplate.destroy()}get _effectiveTimeZone(){return this.timeZone??"system"}get activeFeature(){const e=this.activeFeatureIndex;return e<0?null:this.features.at(e)}get activeForm(){if("batch"===this.mode)return this.sharedForm;const e=this._workingFeatures.at(this.activeFeatureIndex);if(!e)return this._emptyForm;const t=this._featureFormMap.get(e);if(t)return t;const r=this._makeBatchFormInputsForFeature(e);return r!==this._emptyForm&&this._featureFormMap.set(e,r),r}get calculating(){return this._expressionsManager.calculating}get expressionEvaluationFailed(){return this._expressionsManager.expressionEvaluationFailed}get hasNonActiveInvalidFeatures(){if("batch"===this.mode)return!1;const{activeFeature:e}=this;return this.invalidFeatures.some((t=>t!==e))}get invalidFeatures(){return this.sharedForm.invalidFeatures}get hasVisibleInputs(){return this.activeForm.inputs.filter((e=>e.visible)).length>0}get noVisibleElementsReason(){if(this.hasVisibleInputs)return null;if(0===this.activeForm.inputs.length)return x.noElements;const e=new Set;for(const t of this.activeForm.inputs)switch(t.visibilityCode){case M.HIDDEN_NOT_IN_ALL_LAYERS:case M.HIDDEN_NO_DOMAIN_IN_COMMON:e.add(x.noElementsInCommon);break;case M.HIDDEN_FIELD_DEFINITION:case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:case M.HIDDEN_VISIBILITY_EXPRESSION_ALL:e.add(x.allElementsHidden);break;case M.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:case M.HIDDEN_VISIBILITY_EXPRESSION_SOME:return x.elementsHiddenInSome}return e.has(x.allElementsHidden)?x.allElementsHidden:x.noElementsInCommon}get status(){const e=this._prepareTask;return null==e?"not-loaded":e.finished?null!=e.error?"failed":"loaded":"loading"}get submittable(){return this.valid,!0}get updating(){return this._updatingHandles.updating||this.calculating}get valid(){return this.sharedForm.valid}get layers(){const e=new Set;return this.features.forEach((t=>{const r=t.sourceLayer??t.layer;e.add(r)})),Array.from(e)}get mode(){return this.activeFeatureIndex>-1?"single":"batch"}submit(){this.submitHasBeenAttempted=!0,this.emit("submit",{})}findFieldInput(e){if(null==e)return;const t=this._activeFormInputsByElementId;if(t.has(e))return t.get(e);const r=this.activeForm.allFieldInputs.find((t=>t.template.elementId===e));return void 0!==r?(t.set(e,r),r):void 0}getFieldInputValue(e){return this.findFieldInput(e)?.value}getValues(e){const t=this._workingFeatures.find((({original:t})=>t===e));if(!t)throw new s("feature-not-found","The given feature is not present in the BatchAttributeForm");return{...t.attributes}}setFieldInputValue(e,t){const r=new Set(this.invalidFeatures);e.setValueFromUser(t),this.userHasChangedValues=!0,this._trackValidityChange(r),this.emit("value-change",{features:e.features.toArray().map((e=>e.original)),fieldName:e.fieldName,name:"value-change",value:t})}setValue(e,t){const r=this.findFieldInput(e);if(null==r)throw new s("no-FieldInput-found",`Cannot set the value of FieldInput with ID: ${e} because none was found in the active form`);this.setFieldInputValue(r,t)}userChangesHaveMadeFeatureInvalid(e){return!!this._reactiveGraphicLookup.get(e)?.userChangesHaveMadeInvalid}async _trackValidityChange(e){await m((()=>!1===this.calculating));const t=this.invalidFeatures;for(const r of t)!1===e.has(r)&&this._reactiveGraphicLookup.has(r)&&(this._reactiveGraphicLookup.get(r).userChangesHaveMadeInvalid=!0)}validate(){return!1}getCodedValueOptions(e){return e.codedValues.map((({name:e,code:t})=>({name:e,value:t})))}_makeBatchFormInputsForFeature(e){const t=this._layerTemplateMap.get(e.layer);return t?w(t,new r([e]),this._expressionsManager):this._emptyForm}async _prepare(){this._prepareTask=o(this._prepareTask),this._updateWorkingFeatures(),o(this._expressionsManager),this.userHasChangedValues=!1,this._expressionsManager=new y({arcadeContext:{editType:this.editType,spatialReference:this.spatialReference??f.WebMercator,map:this.map,timeZone:this._effectiveTimeZone}});const{layers:e}=this;if(0===e.length)return;const r=t((async t=>{try{n(t);const r=new Map;for(const t of e){const e=await k(t,{arcadeExecutorProvider:this._arcadeExecutorProvider,formTimeZone:this._effectiveTimeZone});this._layerTemplateMap.set(t,e),this._expressionsManager.layerExpressionsModelMap.set(t,new I({preserveFieldValuesWhenHidden:e.preserveFieldValuesWhenHidden,executorMap:e.getExpressionExecutorsForLayer(t)}));for(const t of e.elements){const{elementId:e}=t;r.has(e)?r.get(e).foldIn(t):r.set(e,t.clone())}}const s=new T({elements:Array.from(r.values())});this.sharedFormTemplate=s,this.sharedForm=w(s,this._workingFeatures,this._expressionsManager),await this._expressionsManager.runAllExpressions(this._workingFeatures)}catch(r){throw a.getLogger(this).error("Failed preparing form",r),r}}));this._updatingHandles.addPromise(r.promise),this._prepareTask=r}_updateWorkingFeatures(){this._workingFeatures.destroyAll();const{features:e}=this;if(this._reactiveGraphicLookup=new p,0!==e.length){this._workingFeatures.addMany(e.map(F));for(const e of this._workingFeatures)this._reactiveGraphicLookup.set(e.original,e)}}};e([d()],b.prototype,"_effectiveTimeZone",null),e([d({readOnly:!0})],b.prototype,"activeFeature",null),e([d()],b.prototype,"activeFeatureIndex",void 0),e([d({readOnly:!0})],b.prototype,"activeForm",null),e([d()],b.prototype,"disabled",void 0),e([d()],b.prototype,"calculating",null),e([d()],b.prototype,"editType",void 0),e([d()],b.prototype,"features",void 0),e([d()],b.prototype,"expressionEvaluationFailed",null),e([d()],b.prototype,"hasNonActiveInvalidFeatures",null),e([d()],b.prototype,"invalidFeatures",null),e([d()],b.prototype,"hasVisibleInputs",null),e([d()],b.prototype,"map",void 0),e([d()],b.prototype,"noVisibleElementsReason",null),e([d()],b.prototype,"spatialReference",void 0),e([d()],b.prototype,"submitHasBeenAttempted",void 0),e([d()],b.prototype,"timeZone",void 0),e([d()],b.prototype,"updating",null),e([d()],b.prototype,"valid",null),e([d()],b.prototype,"layers",null),e([d()],b.prototype,"mode",null),e([d()],b.prototype,"sharedForm",void 0),e([d()],b.prototype,"sharedFormTemplate",void 0),e([d()],b.prototype,"userHasChangedValues",void 0),e([d()],b.prototype,"_arcadeExecutorProvider",void 0),e([d()],b.prototype,"_prepareTask",void 0),e([d()],b.prototype,"_reactiveGraphicLookup",void 0),e([d()],b.prototype,"_layerTemplateMap",void 0),e([d()],b.prototype,"_workingFeatures",void 0),e([d()],b.prototype,"_expressionsManager",void 0),b=e([c("esri.widgets.BatchAttributeForm.BatchAttributeFormViewModel")],b);const H=b;export{H as default};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import{createObservableProxy as o}from"../../core/proxy.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{valuesAreEquivalent as i}from"../support/forms/formUtils.js";let a=class extends r{constructor(t){super(t);const r=t.original.attributes??{},e=o({...r});this.attributes=e;const s=t.original.cloneShallow();s.attributes=e,this.plainGraphic=s}get geometry(){return this.original.geometry}get layer(){return this.original.sourceLayer??this.original.layer}attributeHasChanged(t){return!i(this.attributes[t],this.original.attributes?.[t])}getAttribute(t){return this.attributes[t]??null}setAttribute(t,r){this.attributes[t]=r}};t([e()],a.prototype,"attributes",void 0),t([e()],a.prototype,"geometry",null),t([e()],a.prototype,"plainGraphic",void 0),t([e()],a.prototype,"layer",null),t([e({constructOnly:!0})],a.prototype,"original",void 0),a=t([s("esri.widgets.BatchAttributeForm.ReactiveGraphic")],a);export{a as ReactiveGraphic};
5
+ import{_ as t}from"../../chunks/tslib.es6.js";import r from"../../core/Accessor.js";import{createObservableProxy as o}from"../../core/proxy.js";import{property as e}from"../../core/accessorSupport/decorators/property.js";import"../../core/has.js";import"../../core/Logger.js";import"../../core/RandomLCG.js";import{subclass as s}from"../../core/accessorSupport/decorators/subclass.js";import{valuesAreEquivalent as i}from"../support/forms/formUtils.js";let a=class extends r{constructor(t){super(t),this.userChangesHaveMadeInvalid=!1;const r=t.original.attributes??{},e=o({...r});this.attributes=e;const s=t.original.cloneShallow();s.attributes=e,this.plainGraphic=s}get geometry(){return this.original.geometry}get layer(){return this.original.sourceLayer??this.original.layer}attributeHasChanged(t){return!i(this.attributes[t],this.original.attributes?.[t])}getAttribute(t){return this.attributes[t]??null}setAttribute(t,r){this.attributes[t]=r}};t([e()],a.prototype,"attributes",void 0),t([e()],a.prototype,"geometry",null),t([e()],a.prototype,"plainGraphic",void 0),t([e()],a.prototype,"layer",null),t([e({constructOnly:!0})],a.prototype,"original",void 0),t([e()],a.prototype,"userChangesHaveMadeInvalid",void 0),a=t([s("esri.widgets.BatchAttributeForm.ReactiveGraphic")],a);export{a as ReactiveGraphic};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as r}from"./InputBase.js";import{makeUseId as o}from"./support/inputUtils.js";let i=class extends r{constructor(){super(...arguments),this.editType="NA"}get editable(){return this._evaluatedEditableExpression??!0}get _evaluatedEditableExpression(){let e=!0,t=!0;for(const s of this.features){if(null==this.template.getExpressionExecutorsForLayer(s.layer)?.editableExpression){e=e&&!0;continue}t=!1;const r=this.expressionsManager.evaluatedExpressions.get(s)?.get(o(this.template.elementId,"editable"));"success"===r?.status?e=e&&!0===r.result:e=!1}return t?null:e}};e([t()],i.prototype,"editable",null),e([t()],i.prototype,"editType",void 0),e([t()],i.prototype,"_evaluatedEditableExpression",null),i=e([s("esri.widgets.BatchAttributeForm.inputs.EditableInput")],i);export{i as EditableInput};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{property as t}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as s}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as r}from"./InputBase.js";let o=class extends r{constructor(){super(...arguments),this.editType="NA"}get editable(){return this._evaluatedEditableExpression??!0}get _evaluatedEditableExpression(){let e=!0,t=!0;for(const s of this.features){if(null==this.template.getExpressionExecutorsForLayer(s.layer)?.editableExpression){e=e&&!0;continue}t=!1;const r=this._lookupEvaluatedExpression(s,"editable");"success"===r?.status?e=e&&!0===r.result:e=!1}return t?null:e}};e([t()],o.prototype,"editable",null),e([t()],o.prototype,"editType",void 0),e([t()],o.prototype,"_evaluatedEditableExpression",null),o=e([s("esri.widgets.BatchAttributeForm.inputs.EditableInput")],o);export{o as EditableInput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import{isSome as t}from"../../../core/arrayUtils.js";import i from"../../../core/Collection.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{CodedValue as a}from"../../../layers/support/CodedValue.js";import l from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import s from"../../../layers/support/RangeDomain.js";import{getDomainRange as o,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as m}from"../../../layers/support/domainUtils.js";import{isNumericField as p,isStringField as d,isTimeOnlyField as f,getFieldRange as h,isDateOnlyField as c,isTimestampOffsetField as g}from"../../../layers/support/fieldUtils.js";import{isAnyDateField as y}from"../../../smartMapping/support/utils.js";import{isNumber as _}from"../../../support/guards.js";import{EditableInput as x}from"./EditableInput.js";import{MultiFeatureError as V,visibilityCodeToBoolean as b,InputVisibilityCode as D,differentValuesString as v,makeUseId as I}from"./support/inputUtils.js";import{FieldInputDataTypes as E,getMaxLength as M,getMinLength as N,isEmptyValue as R,dateIsValid as w,validateFormValue as S}from"../../support/forms/formUtils.js";let T=class extends x{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return V.DIFFERENT_ERRORS;const t=e[0];for(const i of e)if(i.error!==t.error)return V.DIFFERENT_ERRORS;return t.error}get dataType(){const{field:e}=this;return p(e)?E.Number:d(e)?E.Text:y(e)||f(e)?E.Date:E.Unsupported}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get effectiveVisible(){return b(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if(e!==D.VISIBLE)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return i===D.HIDDEN_VISIBILITY_EXPRESSION_ALL?D.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:i===D.HIDDEN_VISIBILITY_EXPRESSION_SOME?D.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every((i=>i.getAttribute(e)===t))}get field(){return this.template.field}get fieldName(){return this.field.name}get invalidFeatures(){return this.errors.map((e=>e.feature))}get isSubtypeField(){return this.layers.some((e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}))}get includeTime(){const{template:e,field:t}=this;return this.dataType===E.Date&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.template.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return M({dataType:this.dataType,field:this.field,input:this.template.input})}get minLength(){return N({dataType:this.dataType,field:this.field,input:this.template.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=o(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every((e=>!e))?h(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){if(this.required&&this.distinctValues.some((e=>R(e))))return!1;if(this.valid)return!0;const{fieldName:e}=this;return this.features.every((t=>!t.attributeHasChanged(e)))}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:v}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?D.HIDDEN_NO_DOMAIN_IN_COMMON:this._baseVisibilityCode:D.HIDDEN_FIELD_DEFINITION}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this.expressionsManager.evaluatedExpressions.get(r)?.get(I(i.elementId,"required"));"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map((t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i}))}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const e=this.template.input;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"datetimeoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&w(t)?t.getTime():null,min:null!=r&&w(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=o(i,r),{max:a,min:l,rawMax:s,rawMin:u}=e,{type:m}=t.field;if("date"===m){const{max:e,min:t}=n;return{max:_(a)&&(null===e||null!=e&&a<=e)?a:e??null,min:_(l)&&(null===t||null!=t&&l>=t)?l:t??null}}if("date-only"===m||"time-only"===m||"timestamp-offset"===m){const{max:e,min:t,rawMax:i,rawMin:r}=n,o=_(a)&&s&&(null==e||a<e),m=_(l)&&u&&(null==t||l>t);return{max:o?a:e,min:m?l:t,rawMax:o?s:i,rawMin:m?u:r}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=new i,r=this.fieldName;for(const i of this.features)i.getAttribute(r)!==e&&t.push(i);this._setValue(e),await this.expressionsManager.valueChanged(r,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n,required:a}=this,l=[];for(const s of this.features){const{layer:o}=s,u=o.getField(t)??this.field,m=o.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([m]),d=s.getAttribute(t),f=S(d,{dataType:e,domain:p,field:u,maxLength:i,minLength:r,range:n,required:a});f&&l.push({error:f,feature:s.original})}return l}calculateDomain(e){const t=e.find((e=>null!=e)),i=this.template.domain;if(!t)return i&&m(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some((e=>!e))){if(!i)return null;e=e.filter((e=>null!==e))}break;case"range":e=e.filter((e=>null!==e))}if(!e.every((e=>e?.type===t?.type)))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map((({code:e,name:t})=>[e,t]))),i=this.template.domain?new Map(this.template.domain.codedValues.map((({code:e,name:t})=>[e,t]))):null;for(const a of e)for(const[e,i]of t){a.codedValues.some((t=>t.code===e&&t.name===i))||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const n=Array.from(r.entries()).map((([e,t])=>new a({code:e,name:t})));return n.length?new l({codedValues:n}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];if(e.length>1&&(t=e.reduce(((e,t)=>{const i=this._findMinMaxValuesBetweenTwoDomains(e,t);return i||null}),t)),t&&!m(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof s){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return c(r)||f(r)||g(r)?u(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new s,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:a}=this,l=this._getValidRangeValue(r.min,-1/0),o=this._getValidRangeValue(r.max,1/0),u=this._getValidRangeValue(n.min,-1/0),m=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(l,u),i.maxValue=Math.min(o,m),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((c(a)||f(a)||g(a))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return _(e)?e:t}};e([r()],T.prototype,"dataType",null),e([r()],T.prototype,"domain",null),e([r()],T.prototype,"distinctValues",null),e([r()],T.prototype,"editable",null),e([r()],T.prototype,"effectiveVisible",null),e([r()],T.prototype,"effectiveVisibilityCode",null),e([r()],T.prototype,"errors",null),e([r()],T.prototype,"featuresHaveSameValue",null),e([r()],T.prototype,"field",null),e([r()],T.prototype,"fieldName",null),e([r()],T.prototype,"group",void 0),e([r()],T.prototype,"invalidFeatures",null),e([r()],T.prototype,"isSubtypeField",null),e([r()],T.prototype,"includeTime",null),e([r()],T.prototype,"includeTimeOffset",null),e([r()],T.prototype,"maxLength",null),e([r()],T.prototype,"minLength",null),e([r()],T.prototype,"range",null),e([r()],T.prototype,"required",null),e([r()],T.prototype,"submittable",null),e([r({readOnly:!0})],T.prototype,"type",void 0),e([r()],T.prototype,"userHasChangedValue",void 0),e([r()],T.prototype,"valid",null),e([r()],T.prototype,"value",null),e([r()],T.prototype,"visibilityCode",null),e([r()],T.prototype,"_evaluatedRequiredExpression",null),e([r()],T.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([r()],T.prototype,"_allDomains",null),e([r()],T.prototype,"_fieldShouldHaveDomain",null),e([r()],T.prototype,"_dateFormRange",null),e([r()],T.prototype,"_dateRange",null),T=e([n("esri.widgets.BatchAttributeForm.inputs.FieldInput")],T);export{T as FieldInput};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import{isSome as t}from"../../../core/arrayUtils.js";import i from"../../../core/Collection.js";import{property as r}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import{subclass as n}from"../../../core/accessorSupport/decorators/subclass.js";import{CodedValue as a}from"../../../layers/support/CodedValue.js";import s from"../../../layers/support/CodedValueDomain.js";import"../../../layers/support/Domain.js";import"../../../layers/support/InheritedDomain.js";import l from"../../../layers/support/RangeDomain.js";import{getDomainRange as o,dateTimeFieldValuesToNumericRange as u,isDomainValidForField as p}from"../../../layers/support/domainUtils.js";import{isNumericField as m,isStringField as d,isTimeOnlyField as f,getFieldRange as h,isDateOnlyField as c,isTimestampOffsetField as g}from"../../../layers/support/fieldUtils.js";import{isAnyDateField as y}from"../../../smartMapping/support/utils.js";import{isNumber as _}from"../../../support/guards.js";import{EditableInput as x}from"./EditableInput.js";import{MultiFeatureError as b,visibilityCodeToBoolean as V,InputVisibilityCode as E,isFieldInputWithShowNoValueOptionInput as v,differentValuesString as D}from"./support/inputUtils.js";import{FieldInputDataTypes as F,getMaxLength as I,getMinLength as M,isEmptyValue as N,dateIsValid as w,validateFormValue as R}from"../../support/forms/formUtils.js";let S=class extends x{constructor(e){super(e),this.group=null,this.type="field",this.userHasChangedValue=!1,this._hasIntersectionWithElementFieldDomain=!1}get compositeError(){if(this.valid)return null;const{errors:e}=this;if(e.length<this.features.length)return b.DIFFERENT_ERRORS;const t=e[0];for(const i of e)if(i.error!==t.error)return b.DIFFERENT_ERRORS;return t.error}get dataType(){const{field:e}=this;return m(e)?F.Number:d(e)?F.Text:y(e)||f(e)?F.Date:F.Unsupported}get domain(){const e=this._allDomains.toArray();return this.calculateDomain(e)}get distinctValues(){if(this.featuresHaveSameValue)return[this.value];const e=new Set;for(const t of this.features)e.add(t.getAttribute(this.fieldName));return Array.from(e)}get editable(){return!!this.field.editable&&(this._evaluatedEditableExpression??!0)}get effectiveVisible(){return V(this.effectiveVisibilityCode)}get effectiveVisibilityCode(){const{visibilityCode:e}=this;if(e!==E.VISIBLE)return e;const{group:t}=this;if(null==t)return e;const i=t.visibilityCode;return i===E.HIDDEN_VISIBILITY_EXPRESSION_ALL?E.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL:i===E.HIDDEN_VISIBILITY_EXPRESSION_SOME?E.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME:e}get errors(){return this._validate()}get featuresHaveSameValue(){const{fieldName:e}=this,t=this.features.at(0)?.getAttribute(e);return this.features.every((i=>i.getAttribute(e)===t))}get field(){return this.template.field}get fieldName(){return this.field.name}get invalidFeatures(){return this.errors.map((e=>e.feature))}get isSubtypeField(){return this.layers.some((e=>{if(e&&"subtypeField"in e){const{subtypeField:t,fieldsIndex:i}=e;return(i.get(t)?.name??t)===this.fieldName}return!1}))}get showNoValueOptionEnabled(){const{input:e}=this.template;return!this.required&&(!v(e)||!0===e?.showNoValueOption)}get showNoValueLabel(){const{input:e}=this.template;return v(e)?e?.noValueOptionLabel:null}get includeTime(){const{template:e,field:t}=this;return this.dataType===F.Date&&("time-only"===t.type||"date-only"!==t.type&&("datetime-picker"!==e.input?.type||e.input.includeTime))}get includeTimeOffset(){if("timestamp-offset"!==this.field.type)return!1;const e=this.template.input;return!e||"datetimeoffset-picker"===e.type&&e.includeTimeOffset}get maxLength(){return I({dataType:this.dataType,field:this.field,input:this.template.input})}get minLength(){return M({dataType:this.dataType,field:this.field,input:this.template.input})}get range(){if("date"===this.dataType)return this._dateRange;const{domain:e,field:t}=this;if(e){const i=o(t,e);return{max:i?.max,min:i?.min}}const i=this._allDomains.toArray().every((e=>!e))?h(t):null;return{max:i?.max===Number.MAX_VALUE?null:i?.max??null,min:i?.min===-Number.MAX_VALUE?null:i?.min??null}}get required(){if(!this.editable)return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const e=this.visible&&!1!==this.group?.visible,t=this._evaluatedRequiredExpression;return!(!e||null==t)&&t}get submittable(){return(!this.required||!this.distinctValues.some((e=>N(e))))&&!!this.valid}get valid(){return 0===this.errors.length}get value(){return this.featuresHaveSameValue?this.features.at(0)?.getAttribute(this.fieldName)??null:D}get visibilityCode(){return this.field.visible?this._fieldShouldHaveDomain&&null==this.domain?E.HIDDEN_NO_DOMAIN_IN_COMMON:this._baseVisibilityCode:E.HIDDEN_FIELD_DEFINITION}get _evaluatedRequiredExpression(){let e=!1,t=!0;const i=this.template;for(const r of this.features){if(null==i.getExpressionExecutorsForLayer(r.layer)?.requiredExpression)continue;t=!1;const n=this._lookupEvaluatedExpression(r,"required");"success"===n?.status?e=e||!0===n.result:e=!0}return t?null:e}get _allDomains(){const e=this.template.domain;return this.features.map((t=>{const i=t.layer.getFieldDomain(this.fieldName,{feature:t.plainGraphic});return"range"===i?.type||"range"===e?.type?i??this.template.domain:i}))}get _fieldShouldHaveDomain(){return!!this._hasIntersectionWithElementFieldDomain||this._allDomains.some(t)}get _dateFormRange(){if("date"!==this.dataType)return{};const e=this.template.input;if(!e)return{};const{type:t}=e;let i={};if("date-picker"!==t&&"time-picker"!==t&&"datetimeoffset-picker"!==t||(i=u(this.field,e.max,e.min)),"datetime-picker"===t){const{max:t,min:r}=e;i={max:null!=t&&w(t)?t.getTime():null,min:null!=r&&w(r)?r.getTime():null}}return{min:i.min,max:i.max,rawMax:i?.rawMax??null,rawMin:i?.rawMin??null}}get _dateRange(){const{_dateFormRange:e,template:t,field:i,domain:r}=this;if("date"!==this.dataType)return{};if(!r)return this._fieldShouldHaveDomain?{}:e;const n=o(i,r);if(!n)return e;const{max:a,min:s,rawMax:l,rawMin:u}=e,{type:p}=t.field;if("date"===p){const{max:e,min:t}=n;return{max:_(a)&&(null===e||null!=e&&a<=e)?a:e??null,min:_(s)&&(null===t||null!=t&&s>=t)?s:t??null}}if("date-only"===p||"time-only"===p||"timestamp-offset"===p){const{max:e,min:t,rawMax:i,rawMin:r}=n,o=_(a)&&l&&(null==e||a<e),p=_(s)&&u&&(null==t||s>t);return{max:o?a:e,min:p?s:t,rawMax:o?l:i,rawMin:p?u:r}}return{}}async setValueFromUser(e){this.userHasChangedValue=!0;const t=new i,r=this.fieldName;for(const i of this.features)i.getAttribute(r)!==e&&t.push(i);this._setValue(e),await this.expressionsManager.valueChanged(r,t)}_setValue(e){const{fieldName:t}=this;for(const i of this.features)i.setAttribute(t,e)}_validate(){const{dataType:e,fieldName:t,maxLength:i,minLength:r,range:n}=this,a=[];for(const s of this.features){const{layer:l}=s,o=l.getField(t)??this.field,u=l.getFieldDomain(t,{feature:s.plainGraphic}),p=this.calculateDomain([u]),m=this._requiredForFeature(s),d=s.getAttribute(t),f=R(d,{dataType:e,domain:p,field:o,maxLength:i,minLength:r,range:n,required:m});f&&a.push({error:f,feature:s.original})}return a}_editableForFeature(e){if(!this.field.editable)return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.editableExpression)return!0;const t=this._lookupEvaluatedExpression(e,"editable");return"success"===t?.status&&!0===t.result}_effectiveVisibleFeature(e){if(this.group&&!this.group.visibleForFeature(e))return!1;if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.visibilityExpression)return!0;const t=this._lookupEvaluatedExpression(e,"visibility");return"success"===t?.status&&!0===t.result}_requiredForFeature(e){if(!this._editableForFeature(e))return!1;if(!this.field.nullable||this.isSubtypeField)return!0;const t=this._effectiveVisibleFeature(e);if(null==this.template.getExpressionExecutorsForLayer(e.layer)?.requiredExpression)return!1;const i=this._lookupEvaluatedExpression(e,"required");return"success"!==i?.status?t:t&&!0===i.result}calculateDomain(e){const t=e.find((e=>null!=e)),i=this.template.domain;if(!t)return i&&p(this.field,i)?i:null;switch(t.type){case"coded-value":if(e.some((e=>!e))){if(!i)return null;e=e.filter((e=>null!==e))}break;case"range":e=e.filter((e=>null!==e))}if(!e.every((e=>e?.type===t?.type)))return null;let r=null;switch(t?.type){case"range":r=this._intersectRangeDomains(e);break;case"coded-value":r=this._intersectCodedValueDomains(e)}return r}_intersectCodedValueDomains(e){if(!e.length)return null;const t=new Map(e[0].codedValues.map((({code:e,name:t})=>[e,t]))),i=this.template.domain?new Map(this.template.domain.codedValues.map((({code:e,name:t})=>[e,t]))):null;for(const a of e)for(const[e,i]of t){a.codedValues.some((t=>t.code===e&&t.name===i))||t.delete(e)}let r=t;if(i){r=new Map;for(const[e,n]of i)t.has(e)&&r.set(e,n)}const n=Array.from(r.entries()).map((([e,t])=>new a({code:e,name:t})));return n.length?new s({codedValues:n}):null}_intersectRangeDomains(e){if(!e.length)return null;let t=e[0];if(e.length>1&&(t=e.reduce(((e,t)=>{const i=this._findMinMaxValuesBetweenTwoDomains(e,t);return i||null}),t)),t&&!p(this.field,t))return null;const{domain:i}=this.template;if(t&&i&&i instanceof l){const e=this._findMinMaxValuesBetweenTwoDomains(t,i);return this._hasIntersectionWithElementFieldDomain=!!e,e}return t}_getMinMaxFromRangeDomain(e){const t=e.minValue,i=e.maxValue,{field:r}=this;return c(r)||f(r)||g(r)?u(r,i,t):{min:null!=t&&"number"==typeof t?t:null,max:null!=i&&"number"==typeof i?i:null}}_findMinMaxValuesBetweenTwoDomains(e,t){const i=new l,r=this._getMinMaxFromRangeDomain(e),n=this._getMinMaxFromRangeDomain(t),{field:a}=this,s=this._getValidRangeValue(r.min,-1/0),o=this._getValidRangeValue(r.max,1/0),u=this._getValidRangeValue(n.min,-1/0),p=this._getValidRangeValue(n.max,1/0);return i.minValue=Math.max(s,u),i.maxValue=Math.min(o,p),i.minValue===-1/0||i.maxValue===1/0||i.minValue>i.maxValue?null:((c(a)||f(a)||g(a))&&(i.minValue=Number(r.min)>Number(n.min)?r.rawMin:n.rawMin,i.maxValue=Number(r.max)<Number(n.max)?r.rawMax:n.rawMax),i.name="intersection",i)}_getValidRangeValue(e,t){return _(e)?e:t}};e([r()],S.prototype,"dataType",null),e([r()],S.prototype,"domain",null),e([r()],S.prototype,"distinctValues",null),e([r()],S.prototype,"editable",null),e([r()],S.prototype,"effectiveVisible",null),e([r()],S.prototype,"effectiveVisibilityCode",null),e([r()],S.prototype,"errors",null),e([r()],S.prototype,"featuresHaveSameValue",null),e([r()],S.prototype,"field",null),e([r()],S.prototype,"fieldName",null),e([r()],S.prototype,"group",void 0),e([r()],S.prototype,"invalidFeatures",null),e([r()],S.prototype,"isSubtypeField",null),e([r()],S.prototype,"showNoValueOptionEnabled",null),e([r()],S.prototype,"includeTime",null),e([r()],S.prototype,"includeTimeOffset",null),e([r()],S.prototype,"maxLength",null),e([r()],S.prototype,"minLength",null),e([r()],S.prototype,"range",null),e([r()],S.prototype,"required",null),e([r()],S.prototype,"submittable",null),e([r({readOnly:!0})],S.prototype,"type",void 0),e([r()],S.prototype,"userHasChangedValue",void 0),e([r()],S.prototype,"valid",null),e([r()],S.prototype,"value",null),e([r()],S.prototype,"visibilityCode",null),e([r()],S.prototype,"_evaluatedRequiredExpression",null),e([r()],S.prototype,"_hasIntersectionWithElementFieldDomain",void 0),e([r()],S.prototype,"_allDomains",null),e([r()],S.prototype,"_fieldShouldHaveDomain",null),e([r()],S.prototype,"_dateFormRange",null),e([r()],S.prototype,"_dateRange",null),S=e([n("esri.widgets.BatchAttributeForm.inputs.FieldInput")],S);export{S as FieldInput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as t}from"../../../chunks/tslib.es6.js";import{property as o}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as s}from"./InputBase.js";import{visibilityCodeToBoolean as e}from"./support/inputUtils.js";let i=class extends s{constructor(t){super(t),this.inputs=[],this.type="group"}initialize(){for(const t of this.inputs)t.group=this}get open(){return"expanded"===this.template.initialState}set open(t){this._override("open",t)}get visible(){return e(this.visibilityCode)&&this.inputs.some((t=>t.visible))}};t([o()],i.prototype,"inputs",void 0),t([o({readOnly:!0})],i.prototype,"type",void 0),t([o()],i.prototype,"open",null),t([o()],i.prototype,"visible",null),i=t([r("esri.widgets.BatchAttributeForm.inputs.GroupInput")],i);export{i as GroupInput};
5
+ import{_ as t}from"../../../chunks/tslib.es6.js";import{property as s}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as e}from"../../../core/accessorSupport/decorators/subclass.js";import{InputBase as o}from"./InputBase.js";import{visibilityCodeToBoolean as r}from"./support/inputUtils.js";let i=class extends o{constructor(t){super(t),this.inputs=[],this.type="group"}initialize(){for(const t of this.inputs)t.group=this}get open(){return"expanded"===this.template.initialState}set open(t){this._override("open",t)}get visible(){return r(this.visibilityCode)&&this.inputs.some((t=>t.visible))}visibleForFeature(t){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression)return!0;const s=this._lookupEvaluatedExpression(t,"visibility");return"success"===s?.status&&!0===s.result}};t([s()],i.prototype,"inputs",void 0),t([s({readOnly:!0})],i.prototype,"type",void 0),t([s()],i.prototype,"open",null),t([s()],i.prototype,"visible",null),i=t([e("esri.widgets.BatchAttributeForm.inputs.GroupInput")],i);export{i as GroupInput};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import s from"../../../core/Collection.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{visibilityCodeToBoolean as o,InputVisibilityCode as l,makeUseId as a}from"./support/inputUtils.js";let p=class extends t{constructor(e){super(e),this.existsInAllLayers=!0,this.features=new s}get description(){return this.template.description}get featuresHaveSameCalculatedVisibility(){return!0}get label(){return this.template.label}get layers(){return Array.from(new Set(this.features.map((e=>e.layer))))}get visibilityCode(){return this._baseVisibilityCode}get visible(){return o(this.visibilityCode)}get _baseVisibilityCode(){return this.existsInAllLayers?this.featuresHaveSameCalculatedVisibility?!1===this._evaluatedVisibilityExpression?l.HIDDEN_VISIBILITY_EXPRESSION_ALL:l.VISIBLE:l.HIDDEN_VISIBILITY_EXPRESSION_SOME:l.HIDDEN_NOT_IN_ALL_LAYERS}get _evaluatedVisibilityExpression(){let e=!0,t=!0;for(const s of this.features){if(null==this.template.getExpressionExecutorsForLayer(s.layer)?.visibilityExpression){e=e&&!0;continue}t=!1;const i=this.expressionsManager.evaluatedExpressions.get(s)?.get(a(this.template.elementId,"visibility"));"success"===i?.status?e=e&&!0===i.result:e=!1}return t?null:e}};e([i({constructOnly:!0})],p.prototype,"expressionsManager",void 0),e([i()],p.prototype,"description",null),e([i()],p.prototype,"existsInAllLayers",void 0),e([i()],p.prototype,"features",void 0),e([i()],p.prototype,"featuresHaveSameCalculatedVisibility",null),e([i()],p.prototype,"label",null),e([i()],p.prototype,"layers",null),e([i({constructOnly:!0})],p.prototype,"template",void 0),e([i()],p.prototype,"visibilityCode",null),e([i()],p.prototype,"visible",null),e([i()],p.prototype,"_baseVisibilityCode",null),e([i()],p.prototype,"_evaluatedVisibilityExpression",null),p=e([r("esri.widgets.BatchAttributeForm.inputs.InputBase")],p);export{p as InputBase};
5
+ import{_ as e}from"../../../chunks/tslib.es6.js";import t from"../../../core/Accessor.js";import s from"../../../core/Collection.js";import{property as i}from"../../../core/accessorSupport/decorators/property.js";import"../../../core/has.js";import"../../../core/Logger.js";import"../../../core/RandomLCG.js";import{subclass as r}from"../../../core/accessorSupport/decorators/subclass.js";import{visibilityCodeToBoolean as o,InputVisibilityCode as l,makeUseId as a}from"./support/inputUtils.js";let p=class extends t{constructor(e){super(e),this.existsInAllLayers=!0,this.features=new s}get description(){return this.template.description}get featuresHaveSameCalculatedVisibility(){const e=new Set;for(const t of this.features){if(null==this.template.getExpressionExecutorsForLayer(t.layer)?.visibilityExpression){e.add(!0);continue}const s=this._lookupEvaluatedExpression(t,"visibility");if("success"===s?.status){if(e.add(!0===s.result),e.size>1)return!1}else e.add(!1)}return e.size<=1}get label(){return this.template.label}get layers(){return Array.from(new Set(this.features.map((e=>e.layer))))}get visibilityCode(){return this._baseVisibilityCode}get visible(){return o(this.visibilityCode)}get _baseVisibilityCode(){return this.existsInAllLayers?this.featuresHaveSameCalculatedVisibility?!1===this._evaluatedVisibilityExpression?l.HIDDEN_VISIBILITY_EXPRESSION_ALL:l.VISIBLE:l.HIDDEN_VISIBILITY_EXPRESSION_SOME:l.HIDDEN_NOT_IN_ALL_LAYERS}get _evaluatedVisibilityExpression(){let e=!0,t=!0;for(const s of this.features){if(null==this.template.getExpressionExecutorsForLayer(s.layer)?.visibilityExpression){e=e&&!0;continue}t=!1;const i=this._lookupEvaluatedExpression(s,"visibility");"success"===i?.status?e=e&&!0===i.result:e=!1}return t?null:e}_lookupEvaluatedExpression(e,t){return this.expressionsManager.evaluatedExpressions.get(e)?.get(a(this.template.elementId,t))}};e([i({constructOnly:!0})],p.prototype,"expressionsManager",void 0),e([i()],p.prototype,"description",null),e([i()],p.prototype,"existsInAllLayers",void 0),e([i()],p.prototype,"features",void 0),e([i()],p.prototype,"featuresHaveSameCalculatedVisibility",null),e([i()],p.prototype,"label",null),e([i()],p.prototype,"layers",null),e([i({constructOnly:!0})],p.prototype,"template",void 0),e([i()],p.prototype,"visibilityCode",null),e([i()],p.prototype,"visible",null),e([i()],p.prototype,"_baseVisibilityCode",null),e([i()],p.prototype,"_evaluatedVisibilityExpression",null),p=e([r("esri.widgets.BatchAttributeForm.inputs.InputBase")],p);export{p as InputBase};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- const e="esri_BatchAttributeForm_different_values";var n,i,t;function I(e){return e===t.VISIBLE}function o(e){return"field"===e.type}function r(e){return"group"===e.type}function s(e,n){return`${e}:${n}`}!function(e){e.DIFFERENT_ERRORS="batch-attribute-form-validation::features-have-different-errors"}(n||(n={})),function(e){e.noElementsInCommon="noElementsInCommon",e.noElements="noElements",e.elementsHiddenInSome="elementsHiddenInSome",e.allElementsHidden="allElementsHidden"}(i||(i={})),function(e){e.HIDDEN_FIELD_DEFINITION="hidden:field-definition",e.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL="hidden:group-visibility-expression:all-features",e.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME="hidden:group-visibility-expression:some-features",e.HIDDEN_NO_DOMAIN_IN_COMMON="hidden:no-domain-in-common",e.HIDDEN_NOT_IN_ALL_LAYERS="hidden:not-in-all-layers",e.HIDDEN_VISIBILITY_EXPRESSION_ALL="hidden:visibility-expression:all-features",e.HIDDEN_VISIBILITY_EXPRESSION_SOME="hidden:visibility-expression:some-features",e.VISIBLE="visible"}(t||(t={}));export{t as InputVisibilityCode,n as MultiFeatureError,i as NoVisibleElementCodes,e as differentValuesString,o as isFieldInput,r as isGroupInput,s as makeUseId,I as visibilityCodeToBoolean};
5
+ const e="esri_BatchAttributeForm_different_values";var n,i,t;function o(e){return e===t.VISIBLE}function I(e){return"field"===e.type}function r(e){return"group"===e.type}function s(e,n){return`${e}:${n}`}!function(e){e.DIFFERENT_ERRORS="batch-attribute-form-validation::features-have-different-errors"}(n||(n={})),function(e){e.noElementsInCommon="noElementsInCommon",e.noElements="noElements",e.elementsHiddenInSome="elementsHiddenInSome",e.allElementsHidden="allElementsHidden"}(i||(i={})),function(e){e.HIDDEN_FIELD_DEFINITION="hidden:field-definition",e.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL="hidden:group-visibility-expression:all-features",e.HIDDEN_GROUP_VISIBILITY_EXPRESSION_SOME="hidden:group-visibility-expression:some-features",e.HIDDEN_NO_DOMAIN_IN_COMMON="hidden:no-domain-in-common",e.HIDDEN_NOT_IN_ALL_LAYERS="hidden:not-in-all-layers",e.HIDDEN_VISIBILITY_EXPRESSION_ALL="hidden:visibility-expression:all-features",e.HIDDEN_VISIBILITY_EXPRESSION_SOME="hidden:visibility-expression:some-features",e.VISIBLE="visible"}(t||(t={}));const E=e=>null!=e&&(d(e,"combo-box")||d(e,"radio-buttons"));function d(e,n){return e?.type===n}export{t as InputVisibilityCode,n as MultiFeatureError,i as NoVisibleElementCodes,e as differentValuesString,I as isFieldInput,E as isFieldInputWithShowNoValueOptionInput,r as isGroupInput,d as isInputWithInputType,s as makeUseId,o as visibilityCodeToBoolean};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import{isFieldElement as t,isGroupElement as n}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as o,isFieldVisibleByDefault as i}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as s}from"../../../../layers/support/layerUtils.js";import{unknown as a,utc as m}from"../../../../time/timeZoneUtils.js";import{makeExpressionInfosMap as l,makeExecutorSetForFormElement as d}from"../../expressions/expressionUtils.js";import p from"../BatchFormTemplate.js";import{FieldElementTemplate as c}from"../FieldElementTemplate.js";import{GroupElementTemplate as f}from"../GroupElementTemplate.js";const u=()=>r.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function y(e,r){return e.formTemplate?.elements&&e.formTemplate?.elements.length>0?T(e,r):w(e,r)}async function w(e,{arcadeExecutorProvider:r,formTimeZone:t}){const n=new Set(o(e)),i={arcadeExecutorProvider:r,editTrackingFields:n,formTimeZone:t,layer:e},s=[];for(const o of e.fields)b(o,e,n)&&s.push(Z(o,i));const a=await Promise.all(s);return new p({elements:a,preserveFieldValuesWhenHidden:!0})}async function T(e,r){const t=e.formTemplate;if(!t)return w(e,r);const n=l(t.expressionInfos),o={description:t.description,elements:new Array,title:t.title,preserveFieldValuesWhenHidden:t.preserveFieldValuesWhenHidden},{elements:i}=t;if(!i)return new p(o);const{arcadeExecutorProvider:s,formTimeZone:a}=r;for(const l of i)try{o.elements.push(await h(l,{arcadeExecutorProvider:s,expressionInfos:n,layer:e,formTimeZone:a}))}catch(m){u().warn(m)}return new p(o)}async function h(r,o){if(t(r))return x(r,o);if(n(r))return v(r,o);throw new e("batch-attribute-form:unsupported-element-type",`Form elements of type ${r.type} are not supported`)}async function x(r,{arcadeExecutorProvider:t,expressionInfos:n,layer:o,formTimeZone:i}){const{fieldsIndex:s}=o,{description:a,domain:m,fieldName:l,hint:p,input:f,label:u}=r;if(null==l||!s.has(l))throw new e("batch-attribute-form:invalid-form-element",`Field element with label '${u}' does not refer to a valid field`);const y={description:a,domain:m,field:s.get(l),hint:p,input:f,formTimeZone:i,layerTimeZone:E(o),label:u},w=new c(y),T=await d({element:r,expressionInfos:n,provider:t});return w.addLayer(o,T),w}async function v(e,r){const{arcadeExecutorProvider:t,expressionInfos:n,layer:o}=r,{description:i,label:s,initialState:a}=e,m={description:i,elements:[],label:s,initialState:a??"expanded"};for(const d of e.elements)try{m.elements.push(await h(d,r))}catch{continue}const l=new f(m),p=await d({element:e,expressionInfos:n,provider:t});return l.addLayer(o,p),l}async function Z(e,{arcadeExecutorProvider:r,layer:t,formTimeZone:n}){const o=new c({field:e,label:e.alias??e.name,formTimeZone:n,layerTimeZone:E(t)}),i={};return e.editable&&t.userHasUpdateItemPrivileges&&(i.editableExpression=await r.getArcadeExecutor("true")),o.addLayer(t,i),o}function b(e,r,t){return!t.has(e.name.toLowerCase())&&i(e,r)}function E(e){return s(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?a:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:m}export{T as convertFormTemplateToBatchFormTemplate,y as createBatchFormTemplate,w as createBatchFormTemplateFromFields};
5
+ import e from"../../../../core/Error.js";import r from"../../../../core/Logger.js";import t from"../../../../form/ExpressionInfo.js";import{isFieldElement as o,isGroupElement as n}from"../../../../form/support/formUtils.js";import{getLowerCaseEditTrackingFields as i,isFieldVisibleByDefault as s}from"../../../../layers/support/fieldUtils.js";import{isSubtypeSublayer as a,isSubtypeGroupLayer as l}from"../../../../layers/support/layerUtils.js";import{unknown as m,utc as d}from"../../../../time/timeZoneUtils.js";import{makeExpressionInfosMap as p,makeExecutorSetForFormElement as f}from"../../expressions/expressionUtils.js";import c from"../BatchFormTemplate.js";import{FieldElementTemplate as u}from"../FieldElementTemplate.js";import{GroupElementTemplate as y}from"../GroupElementTemplate.js";const w="expression/dea57012-47ca4b55a000-8df62742ed0c",x=()=>r.getLogger("esri.widgets.BatchAttributeForm.templates.templateUtils");async function b(e,r){return e.formTemplate?.elements&&e.formTemplate?.elements.length>0?E(e,r):T(e,r)}async function T(e,{arcadeExecutorProvider:r,formTimeZone:t}){const o=new Set(i(e)),n={arcadeExecutorProvider:r,editTrackingFields:o,formTimeZone:t,layer:e},s=[];for(const i of e.fields)I(i,e,o)&&s.push(g(i,n));const a=await Promise.all(s);return new c({elements:a,preserveFieldValuesWhenHidden:!0})}function h(e,r){for(const t of e??[])if("group"!==t.type){if("field"===t.type){if(!1===t.editable&&!t.editableExpression)return!0;if(r.subtypeField&&(a(r)||l(r))&&t.fieldName?.toLowerCase()===r.subtypeField.toLowerCase())return!0}}else if(h(t.elements??[],r))return!0;return!1}async function E(e,r){const o=e.formTemplate;if(!o)return T(e,r);let n=null;h(o.elements??[],e)&&(n=new t({title:"",name:w,expression:"false"}));const i=p(n?[...o.expressionInfos??[],n]:o.expressionInfos),s={description:o.description,elements:new Array,title:o.title,preserveFieldValuesWhenHidden:o.preserveFieldValuesWhenHidden},{elements:a}=o;if(!a)return new c(s);const{arcadeExecutorProvider:l,formTimeZone:m}=r;for(const t of a)try{s.elements.push(await v(t,{arcadeExecutorProvider:l,expressionInfos:i,layer:e,formTimeZone:m}))}catch(d){x().warn(d)}return new c(s)}async function v(r,t){if(o(r))return F(r,t);if(n(r))return Z(r,t);throw new e("batch-attribute-form:unsupported-element-type",`Form elements of type ${r.type} are not supported`)}async function F(r,{arcadeExecutorProvider:t,expressionInfos:o,layer:n,formTimeZone:i}){const{fieldsIndex:s}=n,{description:m,domain:d,fieldName:p,hint:c,input:y,label:x}=r;if(null==p||!s.has(p))throw new e("batch-attribute-form:invalid-form-element",`Field element with label '${x}' does not refer to a valid field`);const b={description:m,domain:d,field:s.get(p),hint:c,input:y,formTimeZone:i,layerTimeZone:L(n),label:x};!1!==r.editable||r.editableExpression||((r=r.clone()).editableExpression=w),n.subtypeField&&(a(n)||l(n))&&r.fieldName?.toLowerCase()===n.subtypeField.toLowerCase()&&((r=r.clone()).editableExpression=w);const T=new u(b),h=await f({element:r,expressionInfos:o,provider:t});return T.addLayer(n,h),T}async function Z(e,r){const{arcadeExecutorProvider:t,expressionInfos:o,layer:n}=r,{description:i,label:s,initialState:a}=e,l={description:i,elements:[],label:s,initialState:a??"expanded"};for(const p of e.elements)try{l.elements.push(await v(p,r))}catch{continue}const m=new y(l),d=await f({element:e,expressionInfos:o,provider:t});return m.addLayer(n,d),m}async function g(e,{arcadeExecutorProvider:r,layer:t,formTimeZone:o}){const n=new u({field:e,label:e.alias??e.name,formTimeZone:o,layerTimeZone:L(t)}),i={},s=(l(t)||a(t))&&t.subtypeField&&t.subtypeField.toLowerCase()===e.name.toLowerCase();return!s&&e.editable&&t.userHasUpdateItemPrivileges&&(i.editableExpression=await r.getArcadeExecutor("true")),s&&(i.editableExpression=await r.getArcadeExecutor("false")),n.addLayer(t,i),n}function I(e,r,t){return!t.has(e.name.toLowerCase())&&s(e,r)}function L(e){return a(e)&&e.parent&&(e=e.parent),e&&"datesInUnknownTimezone"in e&&e.datesInUnknownTimezone?m:e&&"preferredTimeZone"in e&&e.preferredTimeZone?e.preferredTimeZone:d}export{E as convertFormTemplateToBatchFormTemplate,b as createBatchFormTemplate,T as createBatchFormTemplateFromFields};
@@ -2,4 +2,4 @@
2
2
  All material copyright ESRI, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
4
4
  */
5
- import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as n}from"../core/MapUtils.js";import{watch as i,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isString as r}from"../support/guards.js";import l from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as d,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as u}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as m}from"./BatchAttributeForm/css.js";import{VisibleElements as h}from"./BatchAttributeForm/VisibleElements.js";import{isGroupInput as v,isFieldInput as b,differentValuesString as f}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as C}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as _,prepareISOFieldValueForDateComponents as g,prepareUnixFieldValueForDateComponents as I,normalizeTimeOnlyString as y,getISOFieldValueFromDateComponents as F,getUnixFieldValueFromDateComponents as w}from"./support/dateUtils.js";import{globalCss as x}from"./support/globalCss.js";import{setFocus as k}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as M}from"./support/decorators/vmEvent.js";import{tsx as O}from"./support/jsxFactory.js";import{substitute as T}from"../intl/substitute.js";const S="data-element-id";let V=class extends l{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.readOnly=!1,this.viewModel=new c,this.visibleElements=new h,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([i((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),i((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return C({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}render(){const{status:e}=this.viewModel;return"failed"===e?O("div",null,this.messages.formFailedToLoad):this.viewModel.expressionEvaluationFailed?O("div",null,this.messages.expressionEvaluationFailed):O("div",{class:this.classes(m.base,x.widget,x.panel)},"loaded"===e?this._renderForm():"loading"===e?O("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:i}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=n(this._dateComponentMap,`${i}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const n=e.shadowRoot;return n?"timeZone"===t?n.querySelector("calcite-combobox"):n.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:n,elementId:i}=e.dataset,o=this._dateComponentMap.get(`${i}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,n);if(a)switch(n){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[n];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[n])}}_renderForm(){return O("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{hasNonActiveInvalidFeatures:e,activeForm:t}=this.viewModel;let n;return t.invalidHiddenInputs.length>0?n=d(t,this.viewModel.mode,this.messages):e&&(n=this.messages.validationErrors.featuresInError),n?O("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},O("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[O("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},O("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return v(e)?this._renderGroupInput(e):b(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:n,open:i}=e,o=t.filter((e=>e.visible)),a=n.label??"";return O("calcite-block",{class:this.classes(m.group,"sequential"===this.groupDisplay?m.groupSequential:null,this.disabled?m.inputDisabled:null),collapsible:!0,description:n.description??void 0,disabled:this._effectiveDisabled,heading:a,headingLevel:this.headingLevel,key:`{${n.elementId}-key}`,label:a,open:i,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:n}=e.template,{required:i,dataType:o}=e,a=i?T(this.messages.requiredFieldLabel,{name:t}):t;return O("calcite-label",{"aria-label":a,class:m.label,key:`field--${n}`},O("div",{class:m.labelTextContent,key:"labelTextContainer"},t,i?O("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:n}=e;if("date"===n)return this._renderDateComponents(e,t);if("coded-value"===e.domain?.type){const n=e.domain;return this._renderCodedInputs({input:e,domain:n,props:t})}return"number"===n?this._renderNumberComponent(t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:n,submittable:i}=e,o=!i&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?p(e,t,this.messages):null;return o?O("calcite-input-message",{icon:!0,status:"invalid"},o):n?O("calcite-input-message",{class:m.description},n):null}_renderCodedInputs({input:e,domain:t,props:n}){const i=e.template.input?.type??null,o=this.viewModel.getCodedValueOptions(t);switch(i){case"switch":return this._renderSwitchField({input:e,props:n,options:o});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o,props:n});default:return this._renderComboBoxComponent({options:o,props:n})}}_renderSwitchField({input:e,props:t,options:n}){if((this._batchSwitchInputInitialValues.get(e)===f||e.value===f)&&"batch"===this.viewModel.mode){n.unshift({name:this.messages.differentValues,value:f,disabled:!0,selected:!0});const i={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[S]:t[S]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:i,options:n})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return O("calcite-switch",{...t,checked:!!u(e.template,"switch")&&e.value===e.template.input.onValue,class:m.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:n}){const{trigger:i,dropdown:o,group:a}=n;return O("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},O("calcite-button",{...i},e===f?this.messages.differentValues:e),O("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>O("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({options:e,props:t}){const n=e.map((e=>this.renderComboboxItem({value:`${e.value}`,text:e.name,selected:t.value===e.value})));return O("calcite-combobox",{...t,selectionMode:"single",value:String(t.value),onCalciteComboboxChange:({currentTarget:e})=>{this._saveInput(e)}},n)}renderComboboxItem({text:e,value:t,selected:n}){return O("calcite-combobox-item",{key:t,selected:n,textLabel:e,value:t})}_renderRadioButtonGroupComponent({input:e,options:t,props:n}){const i=t.map((({name:t,value:i})=>this._renderRadioButtons({label:t,value:i,selected:i===e.value,props:n})));return O("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:m.inputRadioGroup,disabled:n.readOnly,key:`${n.key}-radio-group`,layout:"vertical",name:n.name,required:n.required},n.placeholder===this.messages.differentValues?O("calcite-label",{class:m.placeholderRadio,key:n.label,layout:"inline"},O("calcite-radio-button",{checked:!0,disabled:!0,name:n.placeholder,value:n.placeholder}),n.placeholder):null,i)}_renderRadioButtons({value:e,selected:t,label:n,props:i}){return O("calcite-label",{class:m.inputRadioLabel,key:i.label,layout:"inline"},O("calcite-radio-button",{...i,checked:t,class:m.inputRadio,disabled:i.readOnly,name:i.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),n)}_renderStringComponent(e,t){const{template:n}=e;return n.field.editable?n.input&&"text-area"===n.input.type?O("calcite-text-area",{...t,class:this.classes(m.group,m.groupSequential,m.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):O("calcite-input",{...t,class:this.classes(m.group,m.groupSequential,m.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e){return O("calcite-input-number",{...e,type:"number",value:null==e.value?"":String(e.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const n=this.getCommonInputProps(e);return O("calcite-input",{...n,class:this.classes(m.fieldInput,m.inputDisabled,m.individualElement),readOnly:!0,type:"text",value:String(t??n.value??"")})}_renderDateComponents(e,t){const{type:n}=e.field;switch(n){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,_(e.field,t.value))}}_renderDateOnlyFieldComponent(e,t){const{class:n,key:i,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return O("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:n,"data-date-part":"date","data-element-id":t[S],key:`${i}-date-input`,max:r(a)?a:void 0,min:r(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===f?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:n,key:i,readOnly:o}=t;return O("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:n,"data-date-part":"time","data-element-id":t[S],key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===f?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:n,key:i,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=g(a),l=g(s),d=g(e.value===f?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return O("div",{class:m.dateInputContainer,key:`${i}-date-time-container`},O("calcite-input-date-picker",{...u,class:n,"data-date-part":"date",key:`${i}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),O("calcite-input-time-picker",{...u,class:n,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?O("calcite-input-time-zone",{...u,class:n,"data-date-part":"timeZone",key:`${i}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:n,key:i,readOnly:o,min:a,max:s}=t,r=I(e.value===f?"":e.value),l=I(s),d=I(a),p=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return O("div",{class:m.dateInputContainer,key:`${i}-date-time-container`},O("calcite-input-date-picker",{...u,class:n,"data-date-part":"date",key:`${i}-date-input`,max:l?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?O("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${i}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:n,valid:i,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,h=!d||t;let v=n.hint??void 0,b=!1;return o===f&&(v=this.messages.differentValues,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":i?"false":"true",class:this.classes(m.fieldInput,h?m.inputDisabled:null),status:p&&!i?"invalid":"idle",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:n.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:h,onblur:this._onComponentBlur,required:r,placeholder:v,value:b?"":o??"",[S]:n.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,n=e.querySelector("calcite-radio-button"),i=t||n;i&&this._afterComponentCreateOrUpdate(i)}_onComponentFocus(e){const t=e.target,n=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(n.template.elementId),this._focusedFieldInput=n}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),n=this._focusedFieldInput;this._attemptFocusOnNextRender&&n===t&&(this._attemptFocusOnNextRender=!1,k(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(u(t.template,"switch"))return"calcite-dropdown"===e.localName?e.selectedItems[0].textContent:e.checked?t.template.input.onValue:t.template.input.offValue;const n=e.value;return null==n||""===n?null:"number"===t.dataType?"-0"===n||"-0."===n||"-0,"===n?n:parseFloat(n):"date"===t.field.type?parseFloat(n):n}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:i}=t.template;if(!t)return;const o=t?.value;if(u(t.template,"switch")&&"single"!==this.viewModel.mode){const e=n(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(i,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===f),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===f),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:n}=e.template,i=e.field.type,o=this._dateComponentMap.get(`${n}`);if(!o)return;let a=e.value===f?void 0:e.value,s=null;"date-only"===i?s=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===i?(a=y(a),s=y(t.value)):s="timestamp-offset"===i?null!=t.value?F({dateComponent:o.date,timeComponent:o.time,oldValue:a,timeZoneComponent:o.timeZone}):null:null!=t.value?w({oldValue:a,dateComponent:o.date,timeComponent:o.time?.value===f?void 0:o.time}):null,a!==s&&(null!==s&&t.value?this.viewModel.setValue(`${n}`,s):this.viewModel.setValue(`${n}`,null))}};e([a()],V.prototype,"activeFeatureIndex",null),e([a()],V.prototype,"disabled",null),e([a()],V.prototype,"_effectiveDisabled",null),e([a()],V.prototype,"features",null),e([a()],V.prototype,"map",null),e([a()],V.prototype,"spatialReference",null),e([a()],V.prototype,"timeZone",null),e([a()],V.prototype,"headingLevel",void 0),e([a()],V.prototype,"icon",null),e([a(),D("esri/t9n/common")],V.prototype,"messagesCommon",void 0),e([a(),D("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],V.prototype,"messages",void 0),e([a()],V.prototype,"readOnly",void 0),e([a(),M(["value-change","submit"])],V.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],V.prototype,"visibleElements",void 0),e([a()],V.prototype,"groupDisplay",void 0),V=e([s("esri.widgets.BatchAttributeForm")],V);const U=V;export{U as default};
5
+ import{_ as e}from"../chunks/tslib.es6.js";import"../intl.js";import"../core/has.js";import{abortHandle as t}from"../core/handleUtils.js";import{getOrCreateMapValue as i}from"../core/MapUtils.js";import{watch as n,whenOnce as o}from"../core/reactiveUtils.js";import{property as a}from"../core/accessorSupport/decorators/property.js";import"../core/Logger.js";import"../core/RandomLCG.js";import{subclass as s}from"../core/accessorSupport/decorators/subclass.js";import{isString as r}from"../support/guards.js";import l from"./Widget.js";import{getHiddenFieldsValidationErrorMessage as d,getVisibleFieldInputValidationErrorMessage as p,isElementTemplateWithInputType as u}from"./BatchAttributeForm/batchAttributeFormUtils.js";import c from"./BatchAttributeForm/BatchAttributeFormViewModel.js";import{css as m}from"./BatchAttributeForm/css.js";import{VisibleElements as h}from"./BatchAttributeForm/VisibleElements.js";import{InputVisibilityCode as v,isGroupInput as b,isFieldInput as f,differentValuesString as C}from"./BatchAttributeForm/inputs/support/inputUtils.js";import{loadCalciteComponents as _}from"./support/componentsUtils.js";import{getLabelForDateFieldValue as g,prepareISOFieldValueForDateComponents as I,prepareUnixFieldValueForDateComponents as y,normalizeTimeOnlyString as w,getISOFieldValueFromDateComponents as F,getUnixFieldValueFromDateComponents as x}from"./support/dateUtils.js";import{globalCss as k}from"./support/globalCss.js";import{setFocus as M}from"./support/widgetUtils.js";import{messageBundle as D}from"./support/decorators/messageBundle.js";import{vmEvent as O}from"./support/decorators/vmEvent.js";import{tsx as T}from"./support/jsxFactory.js";import{isEmptyValue as V}from"./support/forms/formUtils.js";import{substitute as E}from"../intl/substitute.js";const S="data-element-id";let U=class extends l{constructor(e,t){super(e,t),this.headingLevel=2,this.messagesCommon=null,this.messages=null,this.readOnly=!1,this.viewModel=new c,this.visibleElements=new h,this.groupDisplay="all",this._attemptFocusOnNextRender=!1,this._dateComponentMap=new Map,this._touchedInputs=new Set,this._focusedFieldInput=null,this._batchSwitchInputInitialValues=new Map,this._saveInput=this._saveInput.bind(this),this._onFormSubmit=this._onFormSubmit.bind(this),this._onComponentFocus=this._onComponentFocus.bind(this),this._onComponentBlur=this._onComponentBlur.bind(this),this._afterComponentCreateOrUpdate=this._afterComponentCreateOrUpdate.bind(this),this._afterDateComponentCreate=this._afterDateComponentCreate.bind(this),this._afterDateComponentUpdate=this._afterDateComponentUpdate.bind(this),this._afterRadioGroupCreateOrUpdate=this._afterRadioGroupCreateOrUpdate.bind(this)}initialize(){this.addHandles([n((()=>this.features),(()=>{this._dateComponentMap.clear();const e=new AbortController;o((()=>!this.viewModel.updating),e.signal).then((()=>{this._attemptFocusOnNextRender=!0})),this.addHandles(t(e))})),n((()=>this.viewModel.activeForm),(()=>{this._batchSwitchInputInitialValues.clear()}))])}loadDependencies(){return _({input:()=>import("@esri/calcite-components/dist/components/calcite-input"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),button:()=>import("@esri/calcite-components/dist/components/calcite-button"),combobox:()=>import("@esri/calcite-components/dist/components/calcite-combobox"),"combobox-item":()=>import("@esri/calcite-components/dist/components/calcite-combobox-item"),dropdown:()=>import("@esri/calcite-components/dist/components/calcite-dropdown"),"dropdown-group":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-group"),"dropdown-item":()=>import("@esri/calcite-components/dist/components/calcite-dropdown-item"),"input-date-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-date-picker"),"input-number":()=>import("@esri/calcite-components/dist/components/calcite-input-number"),"input-time-picker":()=>import("@esri/calcite-components/dist/components/calcite-input-time-picker"),"input-time-zone":()=>import("@esri/calcite-components/dist/components/calcite-input-time-zone"),label:()=>import("@esri/calcite-components/dist/components/calcite-label"),"input-message":()=>import("@esri/calcite-components/dist/components/calcite-input-message"),loader:()=>import("@esri/calcite-components/dist/components/calcite-loader"),notice:()=>import("@esri/calcite-components/dist/components/calcite-notice"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch"),"text-area":()=>import("@esri/calcite-components/dist/components/calcite-text-area"),"radio-button":()=>import("@esri/calcite-components/dist/components/calcite-radio-button"),"radio-button-group":()=>import("@esri/calcite-components/dist/components/calcite-radio-button-group")})}get activeFeatureIndex(){return this.viewModel.activeFeatureIndex}set activeFeatureIndex(e){this.viewModel.activeFeatureIndex=e}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get _effectiveDisabled(){return this.disabled||this.viewModel.updating}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get timeZone(){return this.viewModel.timeZone}set timeZone(e){this.viewModel.timeZone=e}get icon(){return"edit-attributes"}set icon(e){this._overrideIfSome("icon",e)}gotoClosestError(){}render(){const{status:e}=this.viewModel;return"failed"===e?T("div",{class:this.classes(m.base,k.widget,k.panel)},T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},this.messages.formFailedToLoad))):this.viewModel.expressionEvaluationFailed?T("div",{class:this.classes(m.base,k.widget,k.panel)},T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},this.messages.expressionEvaluationFailed))):T("div",{class:this.classes(m.base,k.widget,k.panel)},"loaded"===e?this._renderForm():"loading"===e?T("calcite-loader",{key:"loader",label:this.messagesCommon?.loading}):null)}_setDateTimeTimeZoneMap(e){const{datePart:t,elementId:n}=e.dataset,o=this._getCalciteElementFromDateTimeTimeZonePicker(e,t);if(!o)return;const a=i(this._dateComponentMap,`${n}`,(()=>({placeholder:{date:"",time:"",timeZone:""}})));switch(a.placeholder[t]=o.placeholder??"",t){case"date":a.date=e;break;case"time":a.time=e;break;case"timeZone":a.timeZone=e,a.defaultComboboxItemElements=o.selectedItems}"timeZone"===t&&(a.defaultComboboxItemElements=o.selectedItems)}_getCalciteElementFromDateTimeTimeZonePicker(e,t){const i=e.shadowRoot;return i?"timeZone"===t?i.querySelector("calcite-combobox"):i.querySelector("calcite-input-text"):null}_updateDateTimeOrTimeZoneShadowDom(e,t){const{datePart:i,elementId:n}=e.dataset,o=this._dateComponentMap.get(`${n}`);if(!o)return;const a=this._getCalciteElementFromDateTimeTimeZonePicker(e,i);if(a)switch(i){case"date":case"time":a.placeholder=t?this.messages.differentValues:o.placeholder[i];break;case"timeZone":t?(a.value="",a.placeholder=this.messages.differentValues):(!a.selectedItems.length&&o.defaultComboboxItemElements?.length&&(a.selectedItems[0]=o.defaultComboboxItemElements[0]),a.placeholder=o.placeholder[i])}}_renderForm(){return T("form",{onsubmit:this._onFormSubmit},this._renderInvisibleFieldsError(),this._renderContent())}_renderInvisibleFieldsError(){const{viewModel:e}=this,{hasNonActiveInvalidFeatures:t,activeForm:i}=e;let n;if(!e.userHasChangedValues&&!e.submitHasBeenAttempted)return null;if(i.invalidHiddenInputs.length>0)if(n=d(i,e.mode,this.messages),"batch"===this.viewModel.mode){const e=i.invalidHiddenInputs.filter((e=>e.effectiveVisibilityCode===v.HIDDEN_GROUP_VISIBILITY_EXPRESSION_ALL||e.visibilityCode===v.HIDDEN_VISIBILITY_EXPRESSION_ALL));e.length>0?n+=` (${e.map((e=>e.label)).join(", ")})`:n=this.messages.validationErrors.featuresInError}else n+=` (${i.invalidHiddenInputs.map((e=>e.label)).join(", ")})`;else if(t)if(this.viewModel.submitHasBeenAttempted)n=this.messages.validationErrors.featuresInError;else{this.viewModel.invalidFeatures.filter((e=>e!==this.viewModel.activeFeature&&!0===this.viewModel.userChangesHaveMadeFeatureInvalid(e))).length>0&&(n=this.messages.validationErrors.featuresInError)}return n?T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},n)):null}_renderContent(){if(!this.viewModel.hasVisibleInputs)return[T("calcite-notice",{class:m.noticeError,icon:!0,kind:"warning",open:!0},T("div",{slot:"message"},this.messages.noVisibleFields[this.viewModel.noVisibleElementsReason]))];const{inputs:e}=this.viewModel.activeForm;return e.filter((e=>e.visible)).map((e=>this._renderInput(e)))}_renderInput(e){return b(e)?this._renderGroupInput(e):f(e)?this._renderLabeledField(e):void 0}_renderGroupInput(e){const{inputs:t,template:i,open:n}=e,o=t.filter((e=>e.visible)),a=i.label??"";return T("calcite-block",{class:this.classes(m.group,"sequential"===this.groupDisplay?m.groupSequential:null,this.disabled?m.inputDisabled:null),collapsible:!0,description:i.description??void 0,disabled:this._effectiveDisabled,heading:a,headingLevel:this.headingLevel,key:`{${i.elementId}-key}`,label:a,open:n,onCalciteBlockClose:()=>{e.open=!1},onCalciteBlockOpen:()=>{e.open=!0}},o.map((e=>this._renderInput(e))))}_renderLabeledField(e){const{label:t,elementId:i}=e.template,{required:n,dataType:o}=e,a=n?E(this.messages.requiredFieldLabel,{name:t}):t;return T("calcite-label",{"aria-label":a,class:m.label,key:`field--${i}`},T("div",{class:m.labelTextContent,key:"labelTextContainer"},t,n?T("span",{"aria-hidden":"true",title:this.messagesCommon.required},"*"):void 0),"unsupported"!==o?this._renderFieldInput(e):this._renderReadOnlyComponent(e),this._renderAuxiliaryText(e))}_renderFieldInput(e){const t=this.getCommonInputProps(e),{dataType:i}=e;if("date"===i)return this._renderDateComponents(e,t);if("coded-value"===e.domain?.type){const i=e.domain;return this._renderCodedInputs({input:e,domain:i,props:t})}return"number"===i?this._renderNumberComponent(t):this._renderStringComponent(e,t)}_renderAuxiliaryText(e){const{compositeError:t,description:i,submittable:n}=e,o=!n&&t&&(this.viewModel.submitHasBeenAttempted||this._touchedInputs.has(e.template.elementId))?p(e,t,this.messages):null;return o?T("calcite-input-message",{icon:!0,status:"invalid"},o):i?T("calcite-input-message",{class:m.description,icon:!1,status:"idle"},i):null}_renderCodedInputs({input:e,domain:t,props:i}){const n=e.template.input?.type??null,o=this.viewModel.getCodedValueOptions(t);switch(n){case"switch":return this._renderSwitchField({input:e,props:i,options:o});case"radio-buttons":return this._renderRadioButtonGroupComponent({input:e,options:o,props:i});default:return this._renderComboBoxComponent({options:o,props:i,input:e})}}_renderSwitchField({input:e,props:t,options:i}){if((this._batchSwitchInputInitialValues.get(e)===C||e.value===C)&&"batch"===this.viewModel.mode){i.unshift({name:this.messages.differentValues,value:C,disabled:!0,selected:!0});const n={dropdown:{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,disabled:t.readOnly,open:!1,[S]:t[S]},trigger:{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral",slot:"trigger",label:t.label},group:{mode:"single"}};return this._renderDropdownComponent({buttonValue:e.value,dropdownProps:n,options:i})}return this._renderSwitchComponent({input:e,props:t})}_renderSwitchComponent({input:e,props:t}){return T("calcite-switch",{...t,checked:!!u(e.template,"switch")&&e.value===e.template.input.onValue,class:m.inputSwitch,disabled:t.readOnly,onblur:()=>{this._focusedFieldInput=null},onCalciteSwitchChange:({currentTarget:e})=>this._saveInput(e)})}_renderDropdownComponent({buttonValue:e,options:t,dropdownProps:i}){const{trigger:n,dropdown:o,group:a}=i;return T("calcite-dropdown",{...o,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,onCalciteDropdownSelect:({currentTarget:e})=>this._saveInput(e)},T("calcite-button",{...n},e===C?this.messages.differentValues:e),T("calcite-dropdown-group",{selectionMode:a.mode},t.map((t=>T("calcite-dropdown-item",{disabled:t.disabled,label:String(t.name),selected:e===t.value},t.name)))))}_renderComboBoxComponent({input:e,options:t,props:i}){const n=t.map((e=>this.renderComboboxItem({value:`${e.value}`,text:e.name,selected:i.value===e.value}))),o=i.placeholder===this.messages.differentValues;o&&n.push(T("calcite-combobox-item",{key:C,selected:!0,textLabel:this.messages.differentValues,value:C}));const a="INSERT"===this.viewModel.editType,s=this._touchedInputs.has(e?.template?.elementId),r=!o&&V(i.value);e.showNoValueOptionEnabled&&n.unshift(T("calcite-combobox-item",{key:"empty-option",selected:r,textLabel:e.showNoValueLabel||this.messages.empty,value:""}));const l=a&&e.showNoValueOptionEnabled&&!s?()=>{}:i.onblur,d={...i,onblur:l};return T("calcite-combobox",{...d,selectionMode:"single",value:o?C:String(i.value),onCalciteComboboxChange:({currentTarget:e})=>{e.value!==C&&this._saveInput(e)}},n)}renderComboboxItem({text:e,value:t,selected:i}){return T("calcite-combobox-item",{key:t,selected:i,textLabel:e,value:t})}_renderRadioButtonGroupComponent({input:e,options:t,props:i}){const n=t.map((({name:t,value:n})=>this._renderRadioButtons({label:t,value:n,selected:n===e.value,props:i})));if(e.showNoValueOptionEnabled){const t="",o=e.showNoValueLabel||this.messages.empty,a=V(e.value);n.unshift(this._renderRadioButtons({label:o,value:t,selected:a,props:i}))}return T("calcite-radio-button-group",{afterCreate:this._afterRadioGroupCreateOrUpdate,afterUpdate:this._afterRadioGroupCreateOrUpdate,class:m.inputRadioGroup,disabled:i.readOnly,key:`${i.key}-radio-group`,layout:"vertical",name:i.name,required:i.required},n,i.placeholder===this.messages.differentValues?T("calcite-label",{class:m.placeholderRadio,key:i.label,layout:"inline"},T("calcite-radio-button",{checked:!0,class:m.inputRadio,disabled:!0,name:i.placeholder,value:i.placeholder}),i.placeholder):null)}_renderRadioButtons({value:e,selected:t,label:i,props:n}){return T("calcite-label",{class:m.inputRadioLabel,key:n.label,layout:"inline"},T("calcite-radio-button",{...n,checked:t,class:m.inputRadio,disabled:n.readOnly,name:n.label,onblur:()=>{this._focusedFieldInput=null},value:e,onCalciteRadioButtonChange:({currentTarget:e})=>{e.checked&&this._saveInput(e)}}),i)}_renderStringComponent(e,t){const{template:i}=e;return i.field.editable?i.input&&"text-area"===i.input.type?T("calcite-text-area",{...t,class:this.classes(m.individualElement),resize:"vertical",value:t.value?String(t.value):"",onCalciteTextAreaInput:({currentTarget:e})=>this._saveInput(e)}):T("calcite-input",{...t,class:this.classes(m.individualElement),type:"text",value:t.value?String(t.value):"",onCalciteInputInput:({currentTarget:e})=>this._saveInput(e)}):this._renderReadOnlyComponent(e)}_renderNumberComponent(e){return T("calcite-input-number",{...e,type:"number",value:null==e.value?"":String(e.value),onCalciteInputNumberInput:({currentTarget:e})=>this._saveInput(e)})}_renderReadOnlyComponent(e,t){const i=this.getCommonInputProps(e);return T("calcite-input",{...i,class:this.classes(m.fieldInput,m.inputDisabled,m.individualElement),readOnly:!0,type:"text",value:String(t??i.value??"")})}_renderDateComponents(e,t){const{type:i}=e.field;switch(i){case"date":return this._renderDateFieldComponents(e,t);case"date-only":return this._renderDateOnlyFieldComponent(e,t);case"time-only":return this._renderTimeOnlyFieldComponent(e,t);case"timestamp-offset":return this._renderTimestampOffsetFieldComponents(e,t);default:return this._renderReadOnlyComponent(e,g(e.field,t.value))}}_renderDateOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range;return T("calcite-input-date-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"date","data-element-id":t[S],key:`${n}-date-input`,max:r(a)?a:void 0,min:r(s)?s:void 0,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimeOnlyFieldComponent(e,t){const{class:i,key:n,readOnly:o}=t;return T("calcite-input-time-picker",{afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,class:i,"data-date-part":"time","data-element-id":t[S],key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},onfocus:this._onComponentFocus,overlayPositioning:"fixed",readOnly:o,value:e.value===C?"":e.value?String(e.value):"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.currentTarget)})}_renderTimestampOffsetFieldComponents(e,t){const{class:i,key:n,readOnly:o}=t,{rawMax:a,rawMin:s}=e.range,r=I(a),l=I(s),d=I(e.value===C?"":e.value),p=e.includeTimeOffset,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return T("div",{class:m.dateInputContainer,key:`${n}-date-time-container`},T("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:r?.date??void 0,min:l?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:d.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),T("calcite-input-time-picker",{...u,class:i,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},value:d.time??"",onCalciteInputTimePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?T("calcite-input-time-zone",{...u,class:i,"data-date-part":"timeZone",key:`${n}-timezone-input`,onblur:()=>{this._focusedFieldInput=null},value:d.timeZoneOffset??"0",onCalciteInputTimeZoneChange:t=>this._saveValueFromDateComponent(e,t.target)}):null)}_renderDateFieldComponents(e,t){const{class:i,key:n,readOnly:o,min:a,max:s}=t,r=y(e.value===C?"":e.value),l=y(s),d=y(a),p=e.includeTime,u={afterCreate:this._afterDateComponentCreate,afterUpdate:this._afterDateComponentUpdate,overlayPositioning:"fixed",readOnly:o,[S]:t[S],onfocus:this._onComponentFocus};return T("div",{class:m.dateInputContainer,key:`${n}-date-time-container`},T("calcite-input-date-picker",{...u,class:i,"data-date-part":"date",key:`${n}-date-input`,max:l?.date??void 0,min:d?.date??void 0,onblur:()=>{this._focusedFieldInput=null},value:r.date??"",onCalciteInputDatePickerChange:t=>this._saveValueFromDateComponent(e,t.target)}),p?T("calcite-input-time-picker",{...u,"data-date-part":"time",key:`${n}-time-input`,onblur:()=>{this._focusedFieldInput=null},step:1,value:r.time??"",onCalciteInputTimePickerChange:t=>{this._saveValueFromDateComponent(e,t.target)}}):null)}getCommonInputProps(e){const{_effectiveDisabled:t}=this,{template:i,valid:n,value:o,minLength:a,maxLength:s,required:r,fieldName:l,editable:d,userHasChangedValue:p,range:{max:u,min:c}}=e,h=!d||t;let v=i.hint??void 0,b=!1;return o===C&&(v=this.messages.differentValues,b=!0),{afterCreate:this._afterComponentCreateOrUpdate,afterUpdate:this._afterComponentCreateOrUpdate,"aria-invalid":n?"false":"true",class:this.classes(m.fieldInput,h?m.inputDisabled:null),status:!p&&!this.viewModel.submitHasBeenAttempted||n?"idle":"invalid",maxLength:s&&s>-1?s:void 0,minLength:a&&a>-1?a:void 0,key:i.elementId,label:l,name:l,max:null!=u?u:void 0,min:null!=c?c:void 0,readOnly:h,onblur:this._onComponentBlur,required:r,placeholder:v,value:b?"":o??"",[S]:i.elementId,onfocus:this._onComponentFocus}}_onFormSubmit(e){e.preventDefault()}_getFieldInputFromHTMLElement(e){return this.viewModel.findFieldInput(e.getAttribute(S))}_afterRadioGroupCreateOrUpdate(e){const t=e.selectedItem,i=e.querySelector("calcite-radio-button"),n=t||i;n&&this._afterComponentCreateOrUpdate(n)}_onComponentFocus(e){const t=e.target,i=this._getFieldInputFromHTMLElement(t);this._touchedInputs.add(i.template.elementId),this._focusedFieldInput=i}_afterComponentCreateOrUpdate(e){const t=this._getFieldInputFromHTMLElement(e),i=this._focusedFieldInput;this._attemptFocusOnNextRender&&i===t&&(this._attemptFocusOnNextRender=!1,M(e))}_onComponentBlur(){this._focusedFieldInput=null}_parseValue(e,t){if(u(t.template,"switch"))return"calcite-dropdown"===e.localName?e.selectedItems[0].textContent:e.checked?t.template.input.onValue:t.template.input.offValue;const i=e.value;return null==i||""===i?null:"number"===t.dataType?"-0"===i||"-0."===i||"-0,"===i?i:parseFloat(i):"date"===t.field.type?parseFloat(i):i}_saveInput(e){const t=this._getFieldInputFromHTMLElement(e),{elementId:n}=t.template;if(!t)return;const o=t?.value;if(u(t.template,"switch")&&"single"!==this.viewModel.mode){const e=i(this._batchSwitchInputInitialValues,t,(()=>t.value));this._batchSwitchInputInitialValues.set(t,null===e?o:e)}const a=this._parseValue(e,t);a!==o&&this.viewModel.setValue(n,a)}async _afterDateComponentCreate(e){const t=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._setDateTimeTimeZoneMap(e),this._updateDateTimeOrTimeZoneShadowDom(e,t.value===C),this._afterComponentCreateOrUpdate(e)}async _afterDateComponentUpdate(e){const{value:t}=this._getFieldInputFromHTMLElement(e);await e.componentOnReady(),this._updateDateTimeOrTimeZoneShadowDom(e,t===C),this._afterComponentCreateOrUpdate(e)}_saveValueFromDateComponent(e,t){const{elementId:i}=e.template,n=e.field.type,o=this._dateComponentMap.get(`${i}`);if(!o)return;let a=e.value===C?void 0:e.value,s=null;"date-only"===n?s=Array.isArray(t.value)?t.value[0]:t.value:"time-only"===n?(a=w(a),s=w(t.value)):s="timestamp-offset"===n?null!=t.value?F({dateComponent:o.date,timeComponent:o.time,oldValue:a,timeZoneComponent:o.timeZone}):null:null!=t.value?x({oldValue:a,dateComponent:o.date,timeComponent:o.time?.value===C?void 0:o.time}):null,a!==s&&(null!==s&&t.value?this.viewModel.setValue(`${i}`,s):this.viewModel.setValue(`${i}`,null))}};e([a()],U.prototype,"activeFeatureIndex",null),e([a()],U.prototype,"disabled",null),e([a()],U.prototype,"_effectiveDisabled",null),e([a()],U.prototype,"features",null),e([a()],U.prototype,"map",null),e([a()],U.prototype,"spatialReference",null),e([a()],U.prototype,"timeZone",null),e([a()],U.prototype,"headingLevel",void 0),e([a()],U.prototype,"icon",null),e([a(),D("esri/t9n/common")],U.prototype,"messagesCommon",void 0),e([a(),D("esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm")],U.prototype,"messages",void 0),e([a()],U.prototype,"readOnly",void 0),e([a(),O(["value-change","submit"])],U.prototype,"viewModel",void 0),e([a({type:h,nonNullable:!0})],U.prototype,"visibleElements",void 0),e([a()],U.prototype,"groupDisplay",void 0),U=e([s("esri.widgets.BatchAttributeForm")],U);const R=U;export{R as default};