@arcgis/core 5.0.0-next.85 → 5.0.0-next.87

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 (992) hide show
  1. package/Basemap.d.ts +2 -2
  2. package/Camera.d.ts +3 -3
  3. package/CameraLayout.d.ts +2 -2
  4. package/Graphic.d.ts +3 -3
  5. package/Ground.d.ts +2 -2
  6. package/Ground.js +1 -1
  7. package/Map.d.ts +2 -2
  8. package/PopupTemplate.d.ts +3 -3
  9. package/Viewpoint.d.ts +2 -2
  10. package/WebDocument2D.d.ts +3 -3
  11. package/WebScene.d.ts +3 -3
  12. package/WebScene.js +1 -1
  13. package/analysis/Analysis.d.ts +3 -3
  14. package/analysis/Dimension/types.d.ts +0 -1
  15. package/analysis/DimensionSimpleStyle.d.ts +3 -3
  16. package/analysis/ElevationProfile/ElevationProfileDisplayUnits.d.ts +2 -2
  17. package/analysis/ElevationProfile/ElevationProfileLine.d.ts +2 -2
  18. package/analysis/ElevationProfile/ElevationProfileLineChartOptions.d.ts +2 -2
  19. package/analysis/ElevationProfile/ElevationProfileLineViewOptions.d.ts +2 -2
  20. package/analysis/ElevationProfile/ElevationProfileViewOptions.d.ts +2 -2
  21. package/analysis/LengthDimension.d.ts +3 -3
  22. package/analysis/LineOfSightAnalysisObserver.d.ts +3 -3
  23. package/analysis/LineOfSightAnalysisTarget.d.ts +3 -3
  24. package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
  25. package/analysis/ShadowCast/MinDurationOptions.d.ts +2 -2
  26. package/analysis/ShadowCast/TotalDurationOptions.d.ts +2 -2
  27. package/analysis/ShadowCast/types.d.ts +0 -1
  28. package/analysis/SlicePlane.d.ts +3 -3
  29. package/analysis/Viewshed.d.ts +3 -3
  30. package/analysis/VolumeMeasurement/VolumeMeasurementCutFillOptions.d.ts +3 -3
  31. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.d.ts +16 -4
  32. package/analysis/VolumeMeasurement/VolumeMeasurementDisplayUnits.js +1 -1
  33. package/analysis/VolumeMeasurement/VolumeMeasurementInputUnits.d.ts +3 -3
  34. package/analysis/VolumeMeasurement/types.d.ts +0 -1
  35. package/analysis/support/AnalysisOriginWebScene.d.ts +2 -2
  36. package/applications/Components/OrientedImageryViewer/galleryUtils.d.ts +80 -0
  37. package/applications/Components/OrientedImageryViewer/galleryUtils.js +5 -0
  38. package/applications/Components/clipboard.d.ts +106 -0
  39. package/applications/Components/clipboard.js +5 -0
  40. package/applications/Components/templateUtils.d.ts +30 -1
  41. package/assets/esri/core/libs/libtess/libtess-f32.wasm +0 -0
  42. package/assets/esri/core/libs/libtess/libtess-f64.wasm +0 -0
  43. package/assets/esri/core/t9n/Units.json +1 -1
  44. package/assets/esri/core/workers/RemoteClient.js +1 -1
  45. package/assets/esri/core/workers/chunks/{3b6fc34b6d92eef030e5.js → 0276e689e1371b40cff3.js} +1 -1
  46. package/assets/esri/core/workers/chunks/045a9cc900bb4ac8afde.js +1 -0
  47. package/assets/esri/core/workers/chunks/048173088bbeb1f6b8b6.js +1 -0
  48. package/assets/esri/core/workers/chunks/09ca0d05b090e9a70e61.js +1 -0
  49. package/assets/esri/core/workers/chunks/0be8b9d9ef56c37e74c3.js +1 -0
  50. package/assets/esri/core/workers/chunks/0bef671165e64f90ac86.js +1 -0
  51. package/assets/esri/core/workers/chunks/0c025d2b0d3162b07feb.js +1 -0
  52. package/assets/esri/core/workers/chunks/{84a4390b1c277c415d44.js → 0c358199ada2ff71e7d9.js} +1 -1
  53. package/assets/esri/core/workers/chunks/0c4ed18d67dea0c99f01.js +1 -0
  54. package/assets/esri/core/workers/chunks/0e0208b87566f4470f1d.js +1 -0
  55. package/assets/esri/core/workers/chunks/{c791e8ebf3ee0805c479.js → 0fc0fd7618ef25dd6b67.js} +1 -1
  56. package/assets/esri/core/workers/chunks/{59e7a0215791b2b51180.js → 126183819921e6025c90.js} +1 -1
  57. package/assets/esri/core/workers/chunks/{a09099697955eb44bfac.js → 15c180deb8d09127ad31.js} +1 -1
  58. package/assets/esri/core/workers/chunks/1616ee2f6dce0203f1d5.js +1 -0
  59. package/assets/esri/core/workers/chunks/1919ed99166e70021917.js +1 -0
  60. package/assets/esri/core/workers/chunks/1c68befc39d39799fcb8.js +1 -0
  61. package/assets/esri/core/workers/chunks/21bb414cb0623ffad577.js +1 -0
  62. package/assets/esri/core/workers/chunks/21c84e014c73bd85f4a3.js +1 -0
  63. package/assets/esri/core/workers/chunks/262677294d8c653e2b0b.js +1 -0
  64. package/assets/esri/core/workers/chunks/{04fddd41a8e6a4c1bc57.js → 28a6a59033baa44bafab.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{f5b32bc3f7ee911e3c59.js → 28c273f34ffde25cebc6.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{b7e40118b4d645e9f8e1.js → 2a12026f1ca9e8900a8b.js} +1 -1
  67. package/assets/esri/core/workers/chunks/2bc9f407f89d554a43ce.js +1 -0
  68. package/assets/esri/core/workers/chunks/2f21c5ae4fbe85c2792b.js +1 -0
  69. package/assets/esri/core/workers/chunks/3332ee9727874953523c.js +1 -0
  70. package/assets/esri/core/workers/chunks/{c477b0ce55211339c4cb.js → 33f44cc192c72064b5b6.js} +1 -1
  71. package/assets/esri/core/workers/chunks/365cb8aab4ca56999b47.js +1 -0
  72. package/assets/esri/core/workers/chunks/{b190a776de4859ac00f8.js → 3672125daca3df24c8ab.js} +1 -1
  73. package/assets/esri/core/workers/chunks/37a607f3835ec6f60834.js +1 -0
  74. package/assets/esri/core/workers/chunks/{c46a4681cbba638b58c1.js → 39dd80c184ac48f877f1.js} +1 -1
  75. package/assets/esri/core/workers/chunks/3a3adf9b6502ad698aea.js +1 -0
  76. package/assets/esri/core/workers/chunks/3b5f24bb824c95996308.js +1 -0
  77. package/assets/esri/core/workers/chunks/{304ea784c28dc78e5e65.js → 3c663035cf872b66cb98.js} +1 -1
  78. package/assets/esri/core/workers/chunks/{055aead7135a2f8bca29.js → 3d924488471601a17915.js} +1 -1
  79. package/assets/esri/core/workers/chunks/{98e04c2382fa5ba382fc.js → 3dc1ae04cfa2c06daf48.js} +1 -1
  80. package/assets/esri/core/workers/chunks/{156c73a948bde11f0d53.js → 42b56932340b6d0bc712.js} +1 -1
  81. package/assets/esri/core/workers/chunks/45c1a3376b138eeee329.js +1 -0
  82. package/assets/esri/core/workers/chunks/{301fa6276f4098521106.js → 476e51284e6ed7dc5c99.js} +1 -1
  83. package/assets/esri/core/workers/chunks/{18cdd268fc921ffd92e2.js → 47bea83ae7fe0e1acee0.js} +1 -1
  84. package/assets/esri/core/workers/chunks/4de93e9f91fd891ed96f.js +1 -0
  85. package/assets/esri/core/workers/chunks/4eb02a03956d1c9c77ee.js +1 -0
  86. package/assets/esri/core/workers/chunks/{1a41c9127ca5a260d5ef.js → 555a252bdb87e340bd02.js} +1 -1
  87. package/assets/esri/core/workers/chunks/5670e430584f020a3530.js +1 -0
  88. package/assets/esri/core/workers/chunks/5734aefbce8b6425630c.js +1 -0
  89. package/assets/esri/core/workers/chunks/{1fe1a131be1d5e1e23ed.js → 5a1921c177580f17ff96.js} +1 -1
  90. package/assets/esri/core/workers/chunks/{70df4331ed29d823bf38.js → 5b297353b058323f8080.js} +1 -1
  91. package/assets/esri/core/workers/chunks/5ef5dcca7c9b376f7f77.js +1 -0
  92. package/assets/esri/core/workers/chunks/{3849dc35941e569fae5f.js → 614c63dae0158da0ed3d.js} +1 -1
  93. package/assets/esri/core/workers/chunks/{c500b59cd7da54fe72ec.js → 641450da2680ae09b8e7.js} +1 -1
  94. package/assets/esri/core/workers/chunks/{ec03d59984782529031a.js → 687677acc05b5e87effe.js} +1 -1
  95. package/assets/esri/core/workers/chunks/{6de843d1809cba61ded3.js → 727321c615f35d708d46.js} +1 -1
  96. package/assets/esri/core/workers/chunks/782c24211daacb47b0b2.js +1 -0
  97. package/assets/esri/core/workers/chunks/79067e7d1ebc46afd775.js +1 -0
  98. package/assets/esri/core/workers/chunks/7a454e4d6df3360e0ab9.js +1 -0
  99. package/assets/esri/core/workers/chunks/7da56ba34c81d2bbaf25.js +1 -0
  100. package/assets/esri/core/workers/chunks/7f15d15c7e2c5d3e70c3.js +1 -0
  101. package/assets/esri/core/workers/chunks/{ce9467dc1ff695d795e5.js → 824b45b04b4f4f91dbce.js} +1 -1
  102. package/assets/esri/core/workers/chunks/836d10ceb93ed19f0aa6.js +1 -0
  103. package/assets/esri/core/workers/chunks/{854adab6a06af861c104.js → 837d39e70880e4310bda.js} +1 -1
  104. package/assets/esri/core/workers/chunks/890833e98e79b8fd3747.js +1 -0
  105. package/assets/esri/core/workers/chunks/{d6e11f05db698d14f21d.js → 8a7f56139b7de0011a37.js} +1 -1
  106. package/assets/esri/core/workers/chunks/8bcb2180ecc88a39b317.js +1 -0
  107. package/assets/esri/core/workers/chunks/8c5d827cbf8869defb87.js +1 -0
  108. package/assets/esri/core/workers/chunks/{db9a9712038df76e3eda.js → 8ef337e25d65670eb73b.js} +1 -1
  109. package/assets/esri/core/workers/chunks/{e201bfe3158c025edc99.js → 93faad2a759b08dce619.js} +1 -1
  110. package/assets/esri/core/workers/chunks/{1779e6eabc299831fc9f.js → 94c4ef224ff38eca7b87.js} +1 -1
  111. package/assets/esri/core/workers/chunks/{9ff1e650ce0912afa780.js → 97155c8ac832d7c46f24.js} +1 -1
  112. package/assets/esri/core/workers/chunks/{14f8215ab716c6d9d5f8.js → 98cb131b62e30aee35e1.js} +1 -1
  113. package/assets/esri/core/workers/chunks/{b586d7e608e8ba8b88fe.js → 9b3b9df0aa0fdcc77aa2.js} +1 -1
  114. package/assets/esri/core/workers/chunks/{841058de8bc6e328fd68.js → 9d77a7d04872b4535e9e.js} +1 -1
  115. package/assets/esri/core/workers/chunks/{338768f94cc49559b209.js → 9ebc4303e29ee0fc1716.js} +1 -1
  116. package/assets/esri/core/workers/chunks/{5543de9a0435c319f4f9.js → 9fa1512baa6e95d3f878.js} +20 -20
  117. package/assets/esri/core/workers/chunks/{e8f6305744f87bbed961.js → a5ed35f53769feb751db.js} +1 -1
  118. package/assets/esri/core/workers/chunks/a6b8ce1c2996ee392bdf.js +1 -0
  119. package/assets/esri/core/workers/chunks/{a2c0c1bb5e775abefc90.js → aa09e261d1f7dffaad8c.js} +1 -1
  120. package/assets/esri/core/workers/chunks/b268b4cbf5b0c856f88e.js +1 -0
  121. package/assets/esri/core/workers/chunks/b2f6cee006788ce3bd16.js +1 -0
  122. package/assets/esri/core/workers/chunks/{9fac9eda0a41f7f4c2c6.js → b46e772e415e2cfca896.js} +1 -1
  123. package/assets/esri/core/workers/chunks/b4ab715a3c506e122f35.js +1 -0
  124. package/assets/esri/core/workers/chunks/{b91a157fb5f729de6597.js → b9756dce0b3af1a9dc54.js} +1 -1
  125. package/assets/esri/core/workers/chunks/baa7e90ec5259057d86b.js +1 -0
  126. package/assets/esri/core/workers/chunks/{52ae2073604deef63ea2.js → c083045d21636b95f26f.js} +1 -1
  127. package/assets/esri/core/workers/chunks/{348560f083350ad0bf2e.js → c38098f7073a10efdb1e.js} +1 -1
  128. package/assets/esri/core/workers/chunks/{4ff3c03cfbec928c0720.js → c4fb3f0b0cfb21e68413.js} +1 -1
  129. package/assets/esri/core/workers/chunks/{adecd31fd64d6753682d.js → c7c865dc1a93e781a3e3.js} +1 -1
  130. package/assets/esri/core/workers/chunks/c8e56dc1239118ac2a60.js +1 -0
  131. package/assets/esri/core/workers/chunks/{181fab86394f1f912490.js → cc464d5a83f8f405e66c.js} +1 -1
  132. package/assets/esri/core/workers/chunks/{d9d2178d436597b1afaf.js → cc6d9b2062b9de629111.js} +1 -1
  133. package/assets/esri/core/workers/chunks/d5386c0e77063c87fddd.js +1 -0
  134. package/assets/esri/core/workers/chunks/d782671235af2db1c458.js +1 -0
  135. package/assets/esri/core/workers/chunks/{f0eb2bfe5a8607b251f5.js → dc2c9b584f8e4627de7f.js} +1 -1
  136. package/assets/esri/core/workers/chunks/de33ce9b6f4e6c0e1389.js +1 -0
  137. package/assets/esri/core/workers/chunks/{0abb084b8a137f4fcdfc.js → e1c5773c12d9947bdc5f.js} +1 -1
  138. package/assets/esri/core/workers/chunks/e55ce8466aa979ac1e6b.js +1 -0
  139. package/assets/esri/core/workers/chunks/{21739c37160061f229ef.js → e585883d0036aa866420.js} +1 -1
  140. package/assets/esri/core/workers/chunks/e6d6d664fc9f2cd6a042.js +1 -0
  141. package/assets/esri/core/workers/chunks/e7cdc2a21104d84aec4a.js +1 -0
  142. package/assets/esri/core/workers/chunks/e9edf3987039def65859.js +1 -0
  143. package/assets/esri/core/workers/chunks/eb063660c37093f85349.js +1 -0
  144. package/assets/esri/core/workers/chunks/{c825ca22894bdb4d01ba.js → edbe52c2848486d64b16.js} +1 -1
  145. package/assets/esri/core/workers/chunks/{4f8895eb57ec6ab4b318.js → f5a61fa75ac877b5bb74.js} +1 -1
  146. package/assets/esri/core/workers/chunks/f9bc4edfdb1590be2d92.js +1 -0
  147. package/assets/esri/core/workers/chunks/fc763ce37d631e006199.js +1 -0
  148. package/assets/esri/core/workers/chunks/ff2a170acd98edfd0e06.js +1 -0
  149. package/assets/esri/libs/lyr3d/lyr3DMain.wasm +0 -0
  150. package/assets/esri/libs/lyr3d/lyr3DWorker.wasm +0 -0
  151. package/assets/esri/libs/parquet/pkg/bundle_bg.wasm +0 -0
  152. package/assets/esri/themes/base/widgets/_FeatureTable.scss +9 -1
  153. package/assets/esri/themes/dark/main.css +1 -1
  154. package/assets/esri/themes/light/main.css +1 -1
  155. package/assets/esri/themes/light/view.css +1 -1
  156. package/chunks/bundle.js +1 -1
  157. package/chunks/libtess-f32.js +1 -1
  158. package/chunks/libtess-f64.js +1 -1
  159. package/config.js +1 -1
  160. package/copyright.txt +84 -0
  161. package/core/Clonable.d.ts +0 -2
  162. package/core/Collection.d.ts +1 -1
  163. package/core/Error.d.ts +0 -1
  164. package/core/Evented.d.ts +0 -2
  165. package/core/Identifiable.d.ts +0 -1
  166. package/core/JSONSupport.d.ts +0 -2
  167. package/core/MultiOriginJSONSupport.d.ts +1 -3
  168. package/core/Promise.d.ts +9 -5
  169. package/core/ReadOnlyMultiOriginJSONSupport.d.ts +0 -2
  170. package/core/Version.d.ts +0 -1
  171. package/core/accessorSupport/types.d.ts +0 -1
  172. package/core/quantity.js +1 -1
  173. package/core/quantityFormatUtils.js +1 -1
  174. package/core/sql/types.d.ts +0 -1
  175. package/core/timeUtils.js +1 -1
  176. package/core/types.d.ts +0 -1
  177. package/core/units.d.ts +2 -2
  178. package/core/units.js +1 -1
  179. package/core/workers/WorkerHandle.js +1 -1
  180. package/editing/Clipboard.js +5 -0
  181. package/editing/sharedTemplates/types.d.ts +0 -1
  182. package/effects/FocusArea.d.ts +3 -3
  183. package/effects/FocusAreaOutline.d.ts +3 -3
  184. package/effects/FocusAreas.d.ts +3 -3
  185. package/effects/types.d.ts +0 -1
  186. package/form/ExpressionInfo.d.ts +2 -2
  187. package/form/FormTemplate.d.ts +2 -2
  188. package/form/elements/Element.d.ts +2 -2
  189. package/form/elements/UtilityNetworkAssociationsElement.d.ts +2 -2
  190. package/geometry/Geometry.d.ts +2 -2
  191. package/geometry/HeightModelInfo.d.ts +2 -2
  192. package/geometry/Mesh.d.ts +3 -3
  193. package/geometry/SpatialReference.d.ts +2 -2
  194. package/geometry/ellipsoidUtils.js +1 -1
  195. package/geometry/geometryEngineTypes.d.ts +0 -1
  196. package/geometry/libtess.js +1 -1
  197. package/geometry/projection/projectors.js +1 -1
  198. package/geometry/projectionUtils.js +1 -1
  199. package/geometry/support/MeshComponent.d.ts +3 -3
  200. package/geometry/support/MeshGeoreferencedVertexSpace.d.ts +3 -3
  201. package/geometry/support/MeshLocalVertexSpace.d.ts +3 -3
  202. package/geometry/support/MeshMaterial.d.ts +3 -3
  203. package/geometry/support/MeshTexture.d.ts +3 -3
  204. package/geometry/support/MeshTextureTransform.d.ts +3 -3
  205. package/geometry/support/MeshTransform.d.ts +3 -3
  206. package/geometry/support/MeshVertexAttributes.d.ts +3 -3
  207. package/geometry/support/meshUtils/projection.js +1 -1
  208. package/geometry/support/meshUtils/vertexSpaceConversion.js +1 -1
  209. package/geometry/support/planetGCSUtils.js +1 -1
  210. package/geometry/support/spatialReferenceUtils.js +1 -1
  211. package/graphic/GraphicOrigin.d.ts +0 -1
  212. package/ground/NavigationConstraint.d.ts +2 -2
  213. package/identity/Credential.d.ts +2 -2
  214. package/identity/IdentityModal.js +1 -1
  215. package/identity/OAuthInfo.d.ts +2 -2
  216. package/identity/ServerInfo.d.ts +2 -2
  217. package/interfaces.d.ts +2 -3
  218. package/intl/locale.d.ts +0 -1
  219. package/intl/messages.d.ts +0 -1
  220. package/intl/number.d.ts +0 -1
  221. package/intl/substitute.d.ts +0 -1
  222. package/intl/t9n.d.ts +0 -1
  223. package/kernel.js +1 -1
  224. package/layers/BaseElevationLayer.d.ts +3 -4
  225. package/layers/BingMapsLayer.d.ts +2 -2
  226. package/layers/BuildingSceneLayer.d.ts +5 -4
  227. package/layers/CatalogLayer.d.ts +3 -3
  228. package/layers/DimensionLayer.d.ts +2 -2
  229. package/layers/ElevationLayer.d.ts +3 -4
  230. package/layers/ElevationLayer.js +1 -1
  231. package/layers/FeatureLayer.d.ts +4 -4
  232. package/layers/GaussianSplatLayer.d.ts +2 -2
  233. package/layers/GeoJSONLayer.d.ts +2 -2
  234. package/layers/GeoRSSLayer.d.ts +2 -2
  235. package/layers/GroupLayer.d.ts +2 -2
  236. package/layers/ImageryLayer.d.ts +3 -3
  237. package/layers/ImageryTileLayer.d.ts +3 -3
  238. package/layers/IntegratedMesh3DTilesLayer.d.ts +2 -2
  239. package/layers/IntegratedMeshLayer.d.ts +5 -4
  240. package/layers/KMLLayer.d.ts +2 -2
  241. package/layers/KnowledgeGraphLayer.d.ts +2 -2
  242. package/layers/Layer.d.ts +2 -2
  243. package/layers/LineOfSightLayer.d.ts +2 -2
  244. package/layers/LinkChartLayer.d.ts +2 -2
  245. package/layers/MapImageLayer.d.ts +2 -2
  246. package/layers/MapNotesLayer.d.ts +2 -2
  247. package/layers/MediaLayer.d.ts +2 -2
  248. package/layers/OGCFeatureLayer.d.ts +2 -2
  249. package/layers/ParquetLayer.d.ts +3 -3
  250. package/layers/PointCloudLayer.d.ts +5 -4
  251. package/layers/RouteLayer.d.ts +2 -2
  252. package/layers/SceneLayer.d.ts +6 -5
  253. package/layers/StreamLayer.d.ts +3 -3
  254. package/layers/SubtypeGroupLayer.d.ts +4 -4
  255. package/layers/TileLayer.d.ts +2 -2
  256. package/layers/UnknownLayer.d.ts +2 -2
  257. package/layers/UnsupportedLayer.d.ts +2 -2
  258. package/layers/VectorTileLayer.d.ts +2 -2
  259. package/layers/VideoLayer.d.ts +2 -2
  260. package/layers/ViewshedLayer.d.ts +2 -2
  261. package/layers/VoxelLayer.d.ts +2 -2
  262. package/layers/WCSLayer.d.ts +3 -3
  263. package/layers/WFSLayer.d.ts +2 -2
  264. package/layers/WMSLayer.d.ts +2 -2
  265. package/layers/WMTSLayer.d.ts +2 -2
  266. package/layers/WebTileLayer.d.ts +2 -2
  267. package/layers/buildingSublayers/BuildingComponentSublayer.d.ts +2 -2
  268. package/layers/buildingSublayers/BuildingGroupSublayer.d.ts +1 -1
  269. package/layers/buildingSublayers/BuildingSublayer.d.ts +2 -2
  270. package/layers/catalog/CatalogDynamicGroupLayer.d.ts +2 -2
  271. package/layers/catalog/CatalogFootprintLayer.d.ts +2 -2
  272. package/layers/effects/types.d.ts +0 -1
  273. package/layers/graphics/sources/support/ParquetSourceWorker.js +1 -1
  274. package/layers/knowledgeGraph/IdTypePair.d.ts +0 -1
  275. package/layers/knowledgeGraph/KnowledgeGraphSublayer.d.ts +2 -2
  276. package/layers/mixins/APIKeyMixin.d.ts +0 -1
  277. package/layers/mixins/ArcGISImageService.d.ts +30 -16
  278. package/layers/mixins/CustomParametersMixin.d.ts +0 -1
  279. package/layers/mixins/EditBusLayer.d.ts +0 -2
  280. package/layers/mixins/ImageryTileMixin.d.ts +2 -1
  281. package/layers/mixins/ImageryTileMixin.js +1 -1
  282. package/layers/mixins/OperationalLayer.d.ts +0 -1
  283. package/layers/mixins/ScaleRangeLayer.d.ts +0 -1
  284. package/layers/mixins/SceneService.d.ts +0 -6
  285. package/layers/orientedImagery/transformations/utils.js +1 -1
  286. package/layers/pointCloudFilters/PointCloudFilter.d.ts +2 -2
  287. package/layers/raster/datasets/pixelReader.d.ts +0 -1
  288. package/layers/raster/datasets/types.d.ts +0 -1
  289. package/layers/raster/functions/SpectralConversionFunction.js +5 -0
  290. package/layers/raster/functions/SpectralConversionFunctionArguments.js +5 -0
  291. package/layers/raster/functions/changeDetectionUtils.d.ts +0 -1
  292. package/layers/raster/functions/conversionUtils.js +1 -1
  293. package/layers/raster/functions/focalStatUtils.d.ts +0 -1
  294. package/layers/raster/functions/rasterFunctionHelper.js +1 -1
  295. package/layers/raster/functions/vectorFieldUtils.js +1 -1
  296. package/layers/scene/types.d.ts +11 -0
  297. package/layers/support/AggregateField.d.ts +2 -2
  298. package/layers/support/BuildingFilter.d.ts +2 -2
  299. package/layers/support/BuildingFilterBlock.d.ts +2 -2
  300. package/layers/support/BuildingSummaryStatistics.d.ts +3 -3
  301. package/layers/support/CodedValue.d.ts +2 -2
  302. package/layers/support/ControlPoint.d.ts +2 -2
  303. package/layers/support/ControlPointsGeoreference.d.ts +2 -2
  304. package/layers/support/DimensionalDefinition.d.ts +2 -2
  305. package/layers/support/DisplayFilter.d.ts +3 -3
  306. package/layers/support/DisplayFilterInfo.d.ts +3 -3
  307. package/layers/support/Domain.d.ts +2 -2
  308. package/layers/support/EditFieldsInfo.d.ts +3 -3
  309. package/layers/support/ElevationQuery.js +1 -1
  310. package/layers/support/ElevationTileData.js +1 -1
  311. package/layers/support/ExpressionInfo.d.ts +3 -3
  312. package/layers/support/FacilityLayerInfo.d.ts +2 -2
  313. package/layers/support/FeatureEffect.d.ts +2 -2
  314. package/layers/support/FeatureFilter.d.ts +2 -2
  315. package/layers/support/FeatureReductionBinning.d.ts +2 -2
  316. package/layers/support/FeatureReductionCluster.d.ts +2 -2
  317. package/layers/support/FeatureReductionSelection.d.ts +2 -2
  318. package/layers/support/FeatureTemplate.d.ts +3 -3
  319. package/layers/support/FeatureType.d.ts +3 -3
  320. package/layers/support/Field.d.ts +2 -2
  321. package/layers/support/FieldConfiguration.d.ts +3 -3
  322. package/layers/support/GeometryFieldsInfo.d.ts +3 -3
  323. package/layers/support/KMLSublayer.d.ts +3 -3
  324. package/layers/support/LOD.d.ts +2 -2
  325. package/layers/support/LabelClass.d.ts +2 -2
  326. package/layers/support/LabelExpressionInfo.d.ts +2 -2
  327. package/layers/support/LayerFloorInfo.d.ts +2 -2
  328. package/layers/support/LevelLayerInfo.d.ts +2 -2
  329. package/layers/support/LocalMediaElementSource.d.ts +3 -3
  330. package/layers/support/MapImage.d.ts +2 -2
  331. package/layers/support/MediaElementBase.d.ts +2 -2
  332. package/layers/support/MosaicRule.d.ts +2 -2
  333. package/layers/support/MultidimensionalSubset.d.ts +13 -4
  334. package/layers/support/OrderByInfo.d.ts +2 -2
  335. package/layers/support/ParquetGeometryEncodingLocation.d.ts +3 -3
  336. package/layers/support/ParquetGeometryEncodingWkb.d.ts +3 -3
  337. package/layers/support/PixelBlock.d.ts +2 -2
  338. package/layers/support/PlaybackInfo.d.ts +3 -3
  339. package/layers/support/PurgeOptions.d.ts +2 -2
  340. package/layers/support/RasterBandInfo.d.ts +2 -2
  341. package/layers/support/RasterFunction.d.ts +2 -2
  342. package/layers/support/RasterInfo.d.ts +2 -2
  343. package/layers/support/RasterSensorInfo.d.ts +2 -2
  344. package/layers/support/Relationship.d.ts +5 -3
  345. package/layers/support/RouteStopSymbols.d.ts +2 -2
  346. package/layers/support/RouteSymbols.d.ts +2 -2
  347. package/layers/support/SceneFilter.d.ts +2 -2
  348. package/layers/support/SceneLayerViewFilter.js +5 -0
  349. package/layers/support/SceneModification.d.ts +2 -2
  350. package/layers/support/SceneModifications.d.ts +1 -1
  351. package/layers/support/SiteLayerInfo.d.ts +2 -2
  352. package/layers/support/Sublayer.d.ts +2 -2
  353. package/layers/support/Subtype.d.ts +3 -3
  354. package/layers/support/SubtypeSublayer.d.ts +3 -3
  355. package/layers/support/TelemetryData.d.ts +3 -3
  356. package/layers/support/TelemetryDisplay.d.ts +3 -3
  357. package/layers/support/TileInfo.d.ts +2 -2
  358. package/layers/support/TileMatrixSet.d.ts +2 -2
  359. package/layers/support/TimeInfo.d.ts +3 -3
  360. package/layers/support/TrackInfo.d.ts +3 -3
  361. package/layers/support/TrackPartInfo.d.ts +3 -3
  362. package/layers/support/VideoTimeExtent.d.ts +3 -3
  363. package/layers/support/WMSSublayer.d.ts +2 -2
  364. package/layers/support/WMTSStyle.d.ts +2 -2
  365. package/layers/support/WMTSSublayer.d.ts +2 -2
  366. package/layers/support/rasterFunctionUtils.d.ts +0 -4
  367. package/layers/support/types.d.ts +32 -0
  368. package/layers/video/types.d.ts +0 -1
  369. package/layers/voxel/VoxelColorStop.d.ts +3 -3
  370. package/layers/voxel/VoxelDynamicSection.d.ts +3 -3
  371. package/layers/voxel/VoxelIsosurface.d.ts +3 -3
  372. package/layers/voxel/VoxelOpacityStop.d.ts +3 -3
  373. package/layers/voxel/VoxelRangeFilter.d.ts +3 -3
  374. package/layers/voxel/VoxelSlice.d.ts +3 -3
  375. package/layers/voxel/VoxelTransferFunctionStyle.d.ts +3 -3
  376. package/layers/voxel/VoxelUniqueValue.d.ts +3 -3
  377. package/layers/voxel/VoxelVariable.d.ts +2 -2
  378. package/layers/voxel/VoxelVariableStyle.d.ts +2 -2
  379. package/layers/voxel/VoxelVolumeStyle.d.ts +2 -2
  380. package/layers/wms/types.d.ts +0 -1
  381. package/layers/wmts/types.d.ts +0 -1
  382. package/linkChart/ChronologicalLayoutSettings.d.ts +3 -3
  383. package/linkChart/LayoutSettings.d.ts +3 -3
  384. package/linkChart/LinkChartProperties.d.ts +3 -3
  385. package/linkChart/NonspatialDataDisplay.d.ts +3 -3
  386. package/linkChart/OrganicLayoutSettings.d.ts +3 -3
  387. package/linkChart/types.d.ts +0 -1
  388. package/networks/CircuitManager.d.ts +2 -2
  389. package/networks/Network.d.ts +2 -2
  390. package/networks/UnitIdentifierManager.d.ts +2 -2
  391. package/networks/support/Circuit.d.ts +2 -2
  392. package/networks/support/CircuitLocation.d.ts +2 -2
  393. package/networks/support/CircuitPath.d.ts +2 -2
  394. package/networks/support/CircuitPathConnectivityElement.d.ts +2 -2
  395. package/networks/support/CircuitSection.d.ts +2 -2
  396. package/networks/support/NamedTraceConfiguration.d.ts +2 -2
  397. package/networks/support/Subcircuit.d.ts +2 -2
  398. package/networks/support/Terminal.d.ts +2 -2
  399. package/networks/support/TerminalConfiguration.d.ts +2 -2
  400. package/networks/support/TraceConfiguration.d.ts +2 -2
  401. package/networks/support/UNTraceConfiguration.d.ts +2 -2
  402. package/networks/support/typeUtils.d.ts +0 -1
  403. package/package.json +1 -1
  404. package/popup/ElementExpressionInfo.d.ts +2 -2
  405. package/popup/ExpressionInfo.d.ts +2 -2
  406. package/popup/FieldInfo.d.ts +3 -3
  407. package/popup/LayerOptions.d.ts +2 -2
  408. package/popup/RelatedRecordsInfo.d.ts +2 -2
  409. package/popup/content/AttachmentsContent.d.ts +2 -2
  410. package/popup/content/Content.d.ts +2 -2
  411. package/popup/content/RelationshipContent.d.ts +2 -2
  412. package/popup/content/UtilityNetworkAssociationsContent.d.ts +2 -2
  413. package/popup/content/mixins/MediaInfo.d.ts +2 -2
  414. package/popup/content/support/ChartMediaInfoValue.d.ts +2 -2
  415. package/popup/content/support/ImageMediaInfoValue.d.ts +2 -2
  416. package/popup/support/AttachmentsOrderByInfo.d.ts +3 -3
  417. package/popup/support/FieldInfoFormat.d.ts +3 -3
  418. package/popup/support/RelatedRecordsInfoFieldOrder.d.ts +2 -2
  419. package/popup/support/UtilityNetworkAssociationType.d.ts +3 -3
  420. package/portal/Portal.d.ts +2 -2
  421. package/portal/PortalFolder.d.ts +2 -2
  422. package/portal/PortalGroup.d.ts +2 -2
  423. package/portal/PortalItem.d.ts +2 -2
  424. package/portal/PortalUser.d.ts +2 -2
  425. package/portal/timeUnitKebabDictionary.js +1 -1
  426. package/renderers/FlowRenderer.d.ts +2 -2
  427. package/renderers/PieChartRenderer.d.ts +2 -2
  428. package/renderers/PointCloudRenderer.d.ts +2 -2
  429. package/renderers/RasterColormapRenderer.d.ts +2 -2
  430. package/renderers/RasterShadedReliefRenderer.d.ts +2 -2
  431. package/renderers/RasterStretchRenderer.d.ts +2 -2
  432. package/renderers/Renderer.d.ts +2 -2
  433. package/renderers/VectorFieldRenderer.d.ts +2 -2
  434. package/renderers/support/AttributeColorInfo.d.ts +2 -2
  435. package/renderers/support/AuthoringInfo.d.ts +2 -2
  436. package/renderers/support/AuthoringInfoClassBreakInfo.d.ts +2 -2
  437. package/renderers/support/AuthoringInfoFieldInfo.d.ts +2 -2
  438. package/renderers/support/AuthoringInfoVisualVariable.d.ts +2 -2
  439. package/renderers/support/ClassBreakInfo.d.ts +2 -2
  440. package/renderers/support/ColormapInfo.d.ts +2 -2
  441. package/renderers/support/DotDensityLegendOptions.d.ts +2 -2
  442. package/renderers/support/HeatmapColorStop.d.ts +2 -2
  443. package/renderers/support/HeatmapLegendOptions.d.ts +3 -3
  444. package/renderers/support/OthersCategory.d.ts +3 -3
  445. package/renderers/support/RasterPresetRenderer.d.ts +3 -3
  446. package/renderers/support/RendererLegendOptions.d.ts +3 -3
  447. package/renderers/support/UniqueValue.d.ts +3 -3
  448. package/renderers/support/UniqueValueClass.d.ts +3 -3
  449. package/renderers/support/UniqueValueGroup.d.ts +3 -3
  450. package/renderers/support/UniqueValueInfo.d.ts +2 -2
  451. package/renderers/support/pointCloud/ColorClassBreakInfo.d.ts +2 -2
  452. package/renderers/support/pointCloud/ColorModulation.d.ts +2 -2
  453. package/renderers/support/pointCloud/ColorUniqueValueInfo.d.ts +2 -2
  454. package/renderers/visualVariables/VisualVariable.d.ts +2 -2
  455. package/renderers/visualVariables/support/ColorSizeStop.d.ts +2 -2
  456. package/renderers/visualVariables/support/ColorStop.d.ts +2 -2
  457. package/renderers/visualVariables/support/OpacityStop.d.ts +2 -2
  458. package/renderers/visualVariables/support/SizeStop.d.ts +2 -2
  459. package/renderers/visualVariables/support/VisualVariableLegendOptions.d.ts +3 -3
  460. package/rest/featureService/FeatureService.d.ts +2 -2
  461. package/rest/geoprocessor/GPOptions.d.ts +2 -2
  462. package/rest/geoprocessor/utils.js +1 -1
  463. package/rest/imageService.d.ts +36 -19
  464. package/rest/imageService.js +1 -1
  465. package/rest/knowledgeGraph/DataModel.d.ts +2 -2
  466. package/rest/knowledgeGraph/FieldIndex.d.ts +2 -2
  467. package/rest/knowledgeGraph/GraphObject.d.ts +2 -2
  468. package/rest/knowledgeGraph/GraphObjectType.d.ts +2 -2
  469. package/rest/knowledgeGraph/GraphProperty.d.ts +2 -2
  470. package/rest/knowledgeGraph/KnowledgeGraph.d.ts +2 -2
  471. package/rest/knowledgeGraph/Path.d.ts +2 -2
  472. package/rest/knowledgeGraph/ServiceDefinition.d.ts +2 -2
  473. package/rest/knowledgeGraph/SourceTypeValueBehavior.d.ts +2 -2
  474. package/rest/knowledgeGraph/toolService/findPaths/CIMFilteredFindPathsConfiguration.d.ts +2 -2
  475. package/rest/knowledgeGraph/toolService/findPaths/CIMFilteredFindPathsEntity.d.ts +2 -2
  476. package/rest/knowledgeGraph/toolService/findPaths/CIMFilteredFindPathsPathFilter.d.ts +2 -2
  477. package/rest/knowledgeGraph/toolService/findPaths/CIMFilteredFindPathsResultJSON.d.ts +0 -1
  478. package/rest/knowledgeGraph/toolService/findPaths/CIMKGTraversalDirection.d.ts +2 -2
  479. package/rest/knowledgeGraph/wasmInterface/WasmDataModelWrapperInterfaces.d.ts +0 -1
  480. package/rest/lastMileDelivery/types.d.ts +0 -1
  481. package/rest/layerSources/DynamicDataLayer.d.ts +2 -2
  482. package/rest/layerSources/DynamicMapLayer.d.ts +2 -2
  483. package/rest/layerSources/JoinTableDataSource.d.ts +2 -2
  484. package/rest/layerSources/QueryTableDataSource.d.ts +2 -2
  485. package/rest/layerSources/RasterDataSource.d.ts +2 -2
  486. package/rest/layerSources/TableDataSource.d.ts +2 -2
  487. package/rest/networks/circuits/support/CircuitTraceResult.d.ts +2 -2
  488. package/rest/networks/circuits/support/ExportCircuitsParameters.d.ts +2 -2
  489. package/rest/networks/circuits/support/QueryCircuitsParameters.d.ts +2 -2
  490. package/rest/networks/support/AggregatedGeometry.d.ts +2 -2
  491. package/rest/networks/support/Association.d.ts +2 -2
  492. package/rest/networks/support/AssociationGeometriesResult.d.ts +2 -2
  493. package/rest/networks/support/FunctionResult.d.ts +2 -2
  494. package/rest/networks/support/NetworkElement.d.ts +2 -2
  495. package/rest/networks/support/QueryAssociationsParameters.d.ts +2 -2
  496. package/rest/networks/support/QueryAssociationsResult.d.ts +2 -2
  497. package/rest/networks/support/QueryNamedTraceConfigurationsParameters.d.ts +2 -2
  498. package/rest/networks/support/SynthesizeAssociationGeometriesParameters.d.ts +2 -2
  499. package/rest/networks/support/TraceLocation.d.ts +3 -3
  500. package/rest/networks/support/TraceParameters.d.ts +2 -2
  501. package/rest/networks/support/TraceResult.d.ts +2 -2
  502. package/rest/networks/support/ValidateNetworkTopologyParameters.d.ts +2 -2
  503. package/rest/networks/support/ValidateNetworkTopologyResult.d.ts +2 -2
  504. package/rest/query/support/AttachmentInfo.d.ts +2 -2
  505. package/rest/support/AddressCandidate.d.ts +2 -2
  506. package/rest/support/AddressToLocationsParameters.d.ts +2 -2
  507. package/rest/support/AddressesToLocationsParameters.d.ts +2 -2
  508. package/rest/support/ArealUnit.d.ts +2 -2
  509. package/rest/support/AreasAndLengthsParameters.d.ts +2 -2
  510. package/rest/support/AttachmentQuery.d.ts +2 -2
  511. package/rest/support/AttributeBinsFeatureSet.d.ts +2 -2
  512. package/rest/support/AttributeBinsGrouping.d.ts +3 -3
  513. package/rest/support/AttributeBinsQuery.d.ts +3 -3
  514. package/rest/support/BaseImageMeasureParameters.d.ts +2 -2
  515. package/rest/support/BaseImageMeasureResult.d.ts +2 -2
  516. package/rest/support/BaseImageMeasureResultValue.d.ts +2 -2
  517. package/rest/support/BinParametersBase.d.ts +3 -3
  518. package/rest/support/BufferParameters.d.ts +2 -2
  519. package/rest/support/CameraInfo.d.ts +2 -2
  520. package/rest/support/CameraInfoMixin.d.ts +0 -1
  521. package/rest/support/ClosestFacilityParameters.d.ts +3 -3
  522. package/rest/support/ClosestFacilitySolveResult.d.ts +2 -2
  523. package/rest/support/ColorRamp.d.ts +2 -2
  524. package/rest/support/DataFile.d.ts +2 -2
  525. package/rest/support/DataLayer.d.ts +3 -3
  526. package/rest/support/DateBinTimeInterval.d.ts +3 -3
  527. package/rest/support/DensifyParameters.d.ts +2 -2
  528. package/rest/support/DirectionLine.d.ts +3 -3
  529. package/rest/support/DirectionPoint.d.ts +3 -3
  530. package/rest/support/DirectionsEvent.d.ts +2 -2
  531. package/rest/support/DirectionsString.d.ts +2 -2
  532. package/rest/support/FeatureSet.d.ts +2 -2
  533. package/rest/support/FindImagesParameters.d.ts +3 -3
  534. package/rest/support/FindImagesResult.d.ts +2 -2
  535. package/rest/support/FindParameters.d.ts +2 -2
  536. package/rest/support/FindResult.d.ts +2 -2
  537. package/rest/support/GPMessage.d.ts +2 -2
  538. package/rest/support/GeneralizeParameters.d.ts +2 -2
  539. package/rest/support/IdentifyParameters.d.ts +2 -2
  540. package/rest/support/IdentifyResult.d.ts +2 -2
  541. package/rest/support/ImageAngleParameters.d.ts +2 -2
  542. package/rest/support/ImageAngleResult.d.ts +2 -2
  543. package/rest/support/ImageBoundaryParameters.d.ts +3 -3
  544. package/rest/support/ImageBoundaryResult.d.ts +2 -2
  545. package/rest/support/ImageGPSInfo.d.ts +2 -2
  546. package/rest/support/ImageGPSInfoParameters.d.ts +3 -3
  547. package/rest/support/ImageGPSInfoResult.d.ts +2 -2
  548. package/rest/support/ImageHistogramParameters.d.ts +2 -2
  549. package/rest/support/ImageIdentifyParameters.d.ts +2 -2
  550. package/rest/support/ImageIdentifyResult.d.ts +2 -2
  551. package/rest/support/ImageInspectionInfo.d.ts +2 -2
  552. package/rest/support/ImagePixelLocationParameters.d.ts +2 -2
  553. package/rest/support/ImagePixelLocationResult.d.ts +2 -2
  554. package/rest/support/ImageSample.d.ts +2 -2
  555. package/rest/support/ImageSampleParameters.d.ts +2 -2
  556. package/rest/support/ImageSampleResult.d.ts +2 -2
  557. package/rest/support/ImageToMapMultirayParameters.d.ts +3 -3
  558. package/rest/support/ImageToMapParameters.d.ts +3 -3
  559. package/rest/support/ImageUrlParameters.d.ts +3 -3
  560. package/rest/support/ImageUrlResult.d.ts +2 -2
  561. package/rest/support/ImageVolume.d.ts +2 -2
  562. package/rest/support/ImageVolumeParameters.d.ts +3 -3
  563. package/rest/support/ImageVolumeResult.d.ts +2 -2
  564. package/rest/support/JobInfo.d.ts +2 -2
  565. package/rest/support/LastMileDeliveryParameters.d.ts +3 -3
  566. package/rest/support/LegendLayer.d.ts +2 -2
  567. package/rest/support/LengthsParameters.d.ts +2 -2
  568. package/rest/support/LinearUnit.d.ts +2 -2
  569. package/rest/support/LocateSettingBase.d.ts +3 -3
  570. package/rest/support/LocateSettingSource.d.ts +3 -3
  571. package/rest/support/LocateSettings.d.ts +3 -3
  572. package/rest/support/LocateSettingsOverrides.d.ts +3 -3
  573. package/rest/support/LocationToAddressParameters.d.ts +2 -2
  574. package/rest/support/MapToImageParameters.d.ts +3 -3
  575. package/rest/support/MeasureAreaFromImageResult.d.ts +2 -2
  576. package/rest/support/MeasureFromImageParameters.d.ts +2 -2
  577. package/rest/support/MeasureLengthFromImageResult.d.ts +2 -2
  578. package/rest/support/NetworkUrl.d.ts +3 -3
  579. package/rest/support/NormalizationBinParametersMixin.d.ts +0 -1
  580. package/rest/support/OffsetParameters.d.ts +2 -2
  581. package/rest/support/ParameterValue.d.ts +4 -2
  582. package/rest/support/PointBarrier.d.ts +3 -3
  583. package/rest/support/PolygonBarrier.d.ts +3 -3
  584. package/rest/support/PolylineBarrier.d.ts +3 -3
  585. package/rest/support/ProjectParameters.d.ts +2 -2
  586. package/rest/support/QuantizationParameters.d.ts +2 -2
  587. package/rest/support/Query.d.ts +2 -2
  588. package/rest/support/RasterData.d.ts +2 -2
  589. package/rest/support/RelationParameters.d.ts +2 -2
  590. package/rest/support/RelationshipQuery.d.ts +2 -2
  591. package/rest/support/RouteInfo.d.ts +3 -3
  592. package/rest/support/RouteParameters.d.ts +3 -3
  593. package/rest/support/RouteResult.d.ts +2 -2
  594. package/rest/support/RouteSolveResult.d.ts +2 -2
  595. package/rest/support/ServiceAreaParameters.d.ts +3 -3
  596. package/rest/support/ServiceAreaSolveResult.d.ts +2 -2
  597. package/rest/support/StatisticDefinition.d.ts +2 -2
  598. package/rest/support/Stop.d.ts +3 -3
  599. package/rest/support/SuggestLocationsParameters.d.ts +2 -2
  600. package/rest/support/TimeUnit.d.ts +42 -0
  601. package/rest/support/TimeUnit.js +5 -0
  602. package/rest/support/TopFeaturesQuery.d.ts +2 -2
  603. package/rest/support/TopFilter.d.ts +2 -2
  604. package/rest/support/TravelMode.d.ts +3 -3
  605. package/rest/support/TrimExtendParameters.d.ts +2 -2
  606. package/rest/support/parameterValueUtils.js +1 -1
  607. package/rest/types.d.ts +1 -1
  608. package/rest/versionManagement/gdbVersion/support/AlterVersionParameters.d.ts +2 -2
  609. package/rest/versionManagement/gdbVersion/support/ReconcileParameters.d.ts +2 -2
  610. package/rest/versionManagement/support/CreateVersionParameters.d.ts +2 -2
  611. package/rest/versionManagement/support/GetVersionInfosParameters.d.ts +2 -2
  612. package/smartMapping/raster/support/adapters/ImageryLayerAdapter.js +1 -1
  613. package/smartMapping/support/adapters/FeatureLayerAdapter.js +1 -1
  614. package/statistics/types.d.ts +0 -1
  615. package/support/MapFloorInfo.d.ts +2 -2
  616. package/support/revision.js +1 -1
  617. package/symbols/Font.d.ts +2 -2
  618. package/symbols/LineStyleMarker3D.d.ts +3 -3
  619. package/symbols/LineSymbolMarker.d.ts +2 -2
  620. package/symbols/Symbol.d.ts +2 -2
  621. package/symbols/Symbol3DLayer.d.ts +2 -2
  622. package/symbols/callouts/Callout3D.d.ts +2 -2
  623. package/symbols/callouts/LineCallout3DBorder.d.ts +2 -2
  624. package/symbols/edges/Edges3D.d.ts +2 -2
  625. package/symbols/patterns/LinePattern3D.d.ts +2 -2
  626. package/symbols/patterns/Pattern3D.d.ts +2 -2
  627. package/symbols/support/ElevationInfo.d.ts +10 -4
  628. package/symbols/support/FeatureExpressionInfo.d.ts +2 -2
  629. package/symbols/support/IconSymbol3DLayerResource.d.ts +2 -2
  630. package/symbols/support/ObjectSymbol3DLayerResource.d.ts +2 -2
  631. package/symbols/support/OccludedVisibility.d.ts +3 -3
  632. package/symbols/support/Symbol3DFillMaterial.js +1 -1
  633. package/symbols/support/Symbol3DHalo.d.ts +2 -2
  634. package/symbols/support/Symbol3DIconOutline.d.ts +2 -2
  635. package/symbols/support/Symbol3DMaterial.d.ts +6 -4
  636. package/symbols/support/Symbol3DMaterial.js +1 -1
  637. package/symbols/support/Symbol3DOutline.d.ts +2 -2
  638. package/symbols/support/Symbol3DTextBackground.d.ts +3 -3
  639. package/symbols/support/Symbol3DVerticalOffset.d.ts +2 -2
  640. package/symbols/support/types.d.ts +0 -1
  641. package/tables/AttributeTableTemplate.d.ts +2 -2
  642. package/tables/elements/AttributeTableAttachmentElement.d.ts +2 -2
  643. package/tables/elements/AttributeTableElement.d.ts +2 -2
  644. package/tables/elements/AttributeTableFieldElement.d.ts +2 -2
  645. package/tables/elements/AttributeTableGroupElement.d.ts +2 -2
  646. package/tables/elements/AttributeTableRelationshipElement.d.ts +2 -2
  647. package/tables/support/FieldOrder.d.ts +3 -3
  648. package/time/TimeExtent.d.ts +2 -2
  649. package/time/TimeExtent.js +1 -1
  650. package/time/TimeInterval.d.ts +3 -3
  651. package/time/types.d.ts +0 -1
  652. package/versionManagement/VersionManagementService.d.ts +2 -2
  653. package/versionManagement/VersioningState.d.ts +2 -2
  654. package/versionManagement/support/type.d.ts +0 -1
  655. package/views/2d/ViewState.d.ts +2 -2
  656. package/views/2d/engine/imagery/RasterVFContainer.js +1 -1
  657. package/views/2d/engine/imagery/RasterVFDisplayObject.js +1 -1
  658. package/views/2d/engine/imagery/RasterVFTileContainer.js +1 -1
  659. package/views/2d/engine/rasterBrushes.js +1 -1
  660. package/views/2d/engine/webgl/shaderGraph/techniques/raster/VectorFieldTechnique.js +5 -0
  661. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/AspectTechnique.js +1 -1
  662. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/BandArithmeticTechnique.js +1 -1
  663. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ColormapToRGBTechnique.js +1 -1
  664. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CompositeBandTechnique.js +1 -1
  665. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ComputeChangeTechnique.js +1 -1
  666. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ContrastBrightnessTechnique.js +1 -1
  667. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ConvolutionTechnique.js +1 -1
  668. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/CurvatureTechnique.js +1 -1
  669. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ExtractBandTechnique.js +1 -1
  670. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/FocalStatisticsTechnique.js +1 -1
  671. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/GrayscaleTechnique.js +1 -1
  672. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/HillshadeTechnique.js +1 -1
  673. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/LocalTechnique.js +1 -1
  674. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/MaskTechnique.js +1 -1
  675. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/NDVITechnique.js +1 -1
  676. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/RemapTechnique.js +1 -1
  677. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ReprojectTechnique.js +1 -1
  678. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/ShadedReliefTechnique.js +1 -1
  679. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/SlopeTechnique.js +1 -1
  680. package/views/2d/engine/webgl/shaderGraph/techniques/raster/processor/StretchTechnique.js +1 -1
  681. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/MagDirShader.js +5 -0
  682. package/views/2d/engine/webgl/shaderGraph/techniques/shaders/raster/ScalarShader.js +5 -0
  683. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  684. package/views/2d/layers/MediaLayerView2D.js +1 -1
  685. package/views/2d/layers/TileLayerView2D.js +1 -1
  686. package/views/2d/layers/imagery/ImageryVFStrategy.js +1 -1
  687. package/views/2d/layers/imagery/VectorFieldTileView2D.js +1 -1
  688. package/views/2d/layers/support/MediaLayerInteractionOptions.d.ts +0 -1
  689. package/views/3d/analysis/AreaMeasurement/support/AreaMeasurementVisualization.js +1 -1
  690. package/views/3d/analysis/AreaMeasurement/support/MeasurementData.js +1 -1
  691. package/views/3d/analysis/AreaMeasurementAnalysisView3D.js +1 -1
  692. package/views/3d/analysis/Dimension/types.d.ts +0 -1
  693. package/views/3d/analysis/Slice/types.d.ts +0 -1
  694. package/views/3d/analysis/Viewshed/types.d.ts +0 -1
  695. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementCutFillController.js +1 -1
  696. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementRawResult.js +5 -0
  697. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.d.ts +5 -1
  698. package/views/3d/analysis/VolumeMeasurement/VolumeMeasurementResult.js +1 -1
  699. package/views/3d/analysis/VolumeMeasurementAnalysisView3D.js +1 -1
  700. package/views/3d/constraints/AltitudeConstraint.d.ts +2 -2
  701. package/views/3d/constraints/ClipDistanceConstraint.d.ts +2 -2
  702. package/views/3d/constraints/Constraints.d.ts +2 -2
  703. package/views/3d/constraints/TiltConstraint.d.ts +2 -2
  704. package/views/3d/environment/CloudyWeather.d.ts +2 -2
  705. package/views/3d/environment/EnvironmentManager.js +1 -1
  706. package/views/3d/environment/FoggyWeather.d.ts +2 -2
  707. package/views/3d/environment/RainyWeather.d.ts +2 -2
  708. package/views/3d/environment/SnowyWeather.d.ts +2 -2
  709. package/views/3d/environment/SunLighting.d.ts +2 -2
  710. package/views/3d/environment/SunnyWeather.d.ts +2 -2
  711. package/views/3d/environment/VirtualLighting.d.ts +2 -2
  712. package/views/3d/layers/ElevationLayerView3D.js +1 -1
  713. package/views/3d/layers/FlowSubView3D.js +1 -1
  714. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  715. package/views/3d/layers/graphics/Graphics3DExtrudeSymbolLayer.js +1 -1
  716. package/views/3d/layers/graphics/Graphics3DMeshFillSymbolLayer.js +1 -1
  717. package/views/3d/layers/graphics/Graphics3DObjectSymbolLayer.js +1 -1
  718. package/views/3d/layers/graphics/emissiveUtils.js +5 -0
  719. package/views/3d/layers/support/layerUtils.js +1 -1
  720. package/views/3d/support/flow/FlowSubViewTiles3D.js +1 -1
  721. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  722. package/views/3d/support/mathUtils.js +1 -1
  723. package/views/3d/support/pointsOfInterest/StableSurfaceCenter.js +1 -1
  724. package/views/3d/support/supportedSpatialReference.js +1 -1
  725. package/views/3d/terrain/terrainUtils.js +1 -1
  726. package/views/3d/webgl/ManagedFBO.js +1 -1
  727. package/views/3d/webgl/ManagedFBOResource.d.ts +0 -1
  728. package/views/3d/webgl/RenderNode.d.ts +1 -1
  729. package/views/3d/webgl/RenderNode.js +1 -1
  730. package/views/3d/webgl/types.d.ts +0 -1
  731. package/views/3d/webgl-engine/collections/Component/Material/ComponentMaterial.js +1 -1
  732. package/views/3d/webgl-engine/core/shaderLibrary/util/EllipsoidMode.js +1 -1
  733. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizerNode.js +1 -1
  734. package/views/3d/webgl-engine/effects/focusArea/FocusAreaMaskNode.js +1 -1
  735. package/views/3d/webgl-engine/effects/highlight/ShadowHighlight.js +1 -1
  736. package/views/3d/webgl-engine/effects/smaa/SMAA.js +1 -1
  737. package/views/3d/webgl-engine/lib/CutFillColor.js +1 -1
  738. package/views/3d/webgl-engine/lib/CutFillDepth.js +1 -1
  739. package/views/3d/webgl-engine/lib/GPUPointOcclusionQuery.js +1 -1
  740. package/views/3d/webgl-engine/lib/GaussianSplatRenderNode.js +1 -1
  741. package/views/3d/webgl-engine/lib/Renderer.js +1 -1
  742. package/views/3d/webgl-engine/parts/RenderView.js +1 -1
  743. package/views/3d/webgl-engine/shaders/AnimatedLine.glsl.js +31 -23
  744. package/views/3d/webgl-engine/statistics/RendererPerformanceInfo.js +1 -1
  745. package/views/3d/webgl.d.ts +16 -8
  746. package/views/3d/webgl.js +1 -1
  747. package/views/Theme.d.ts +2 -2
  748. package/views/VideoView.d.ts +4 -4
  749. package/views/VideoView.js +1 -1
  750. package/views/View.d.ts +3 -3
  751. package/views/View2D.d.ts +2 -2
  752. package/views/ViewAnimation.d.ts +2 -2
  753. package/views/Viewport2DMixin.d.ts +0 -2
  754. package/views/analysis/ElevationProfile/ElevationProfileResult.d.ts +2 -2
  755. package/views/animation/types.d.ts +0 -1
  756. package/views/draw/CursorUpdateEvent.d.ts +0 -1
  757. package/views/draw/DrawAction.d.ts +3 -3
  758. package/views/draw/DrawCompleteEvent.d.ts +0 -1
  759. package/views/draw/VertexAddEvent.d.ts +0 -1
  760. package/views/draw/VertexRemoveEvent.d.ts +0 -1
  761. package/views/draw/support/managers/{DrawTooltipManager.js → TooltipManager.js} +1 -1
  762. package/views/draw/types.d.ts +0 -1
  763. package/views/input/ViewEvents.js +1 -1
  764. package/views/input/recognizers/VerticalTwoFingerDrag.js +1 -1
  765. package/views/input/types.d.ts +94 -0
  766. package/views/interactive/Tooltip.d.ts +2 -2
  767. package/views/interactive/tooltip/components/DrawHeaderActions.js +1 -1
  768. package/views/interactive/tooltip/types.d.ts +0 -1
  769. package/views/layers/ImageryTileLayerViewMixin.d.ts +0 -1
  770. package/views/layers/LayerView.d.ts +3 -3
  771. package/views/layers/SceneLayerView.js +1 -1
  772. package/views/layers/types.d.ts +0 -1
  773. package/views/navigation/types.d.ts +0 -1
  774. package/views/support/AttributionItem.d.ts +0 -1
  775. package/views/support/MeasurementWorker.js +1 -1
  776. package/views/support/MeasurementWorkerHandle.js +1 -1
  777. package/views/support/measurementUtils.js +1 -1
  778. package/views/support/screenUtils.js +1 -1
  779. package/views/ui/UI.d.ts +2 -2
  780. package/webdoc/GeotriggersInfo.d.ts +3 -3
  781. package/webdoc/IPSInfo.d.ts +3 -3
  782. package/webdoc/Widgets.d.ts +2 -2
  783. package/webdoc/applicationProperties/Search.d.ts +2 -2
  784. package/webdoc/applicationProperties/SearchLayer.d.ts +2 -2
  785. package/webdoc/applicationProperties/SearchLayerField.d.ts +2 -2
  786. package/webdoc/applicationProperties/SearchTable.d.ts +2 -2
  787. package/webdoc/applicationProperties/SearchTableField.d.ts +2 -2
  788. package/webdoc/applicationProperties/Viewing.d.ts +2 -2
  789. package/webdoc/geotriggersInfo/DeviceLocationFeed.d.ts +3 -3
  790. package/webdoc/geotriggersInfo/ExpressionInfo.d.ts +3 -3
  791. package/webdoc/geotriggersInfo/FeatureFenceParameters.d.ts +3 -3
  792. package/webdoc/geotriggersInfo/FeatureFilter.d.ts +3 -3
  793. package/webdoc/geotriggersInfo/FeatureLayerSource.d.ts +3 -3
  794. package/webdoc/geotriggersInfo/Geotrigger.d.ts +3 -3
  795. package/webdoc/geotriggersInfo/GeotriggerNotificationOptions.d.ts +3 -3
  796. package/webdoc/geotriggersInfo/support/typeUtils.d.ts +0 -1
  797. package/webdoc/ips/AppleIPSProperties.d.ts +3 -3
  798. package/webdoc/ips/Configuration.d.ts +3 -3
  799. package/webdoc/ips/GNSSProperties.d.ts +3 -3
  800. package/webdoc/ips/PathSnappingProperties.d.ts +3 -3
  801. package/webdoc/ips/PositioningService.d.ts +3 -3
  802. package/webdoc/ips/SmoothingProperties.d.ts +3 -3
  803. package/webdoc/support/SlideThumbnail.d.ts +3 -3
  804. package/webdoc/support/types.d.ts +0 -1
  805. package/webdoc/widgets/FloorFilter.d.ts +2 -2
  806. package/webdoc/widgets/TimeSlider.d.ts +2 -2
  807. package/webmap/ApplicationProperties.d.ts +2 -2
  808. package/webmap/Bookmark.d.ts +2 -2
  809. package/webmap/InitialViewProperties.d.ts +2 -2
  810. package/webmap/background/ColorBackground.d.ts +2 -2
  811. package/webscene/ApplicationProperties.d.ts +2 -2
  812. package/webscene/Environment.d.ts +2 -2
  813. package/webscene/InitialViewProperties.d.ts +3 -3
  814. package/webscene/Presentation.d.ts +3 -3
  815. package/webscene/Slide.d.ts +4 -4
  816. package/webscene/SlideLegendInfo.d.ts +3 -3
  817. package/webscene/SunLighting.d.ts +2 -2
  818. package/webscene/VirtualLighting.d.ts +2 -2
  819. package/webscene/background/Background.d.ts +2 -2
  820. package/webscene/support/Description.d.ts +3 -3
  821. package/webscene/support/FeatureReference.d.ts +3 -3
  822. package/webscene/support/FeatureReferenceId.d.ts +3 -3
  823. package/webscene/support/LayerReference.d.ts +3 -3
  824. package/webscene/support/SlideElements.d.ts +3 -3
  825. package/webscene/support/SlideEnvironment.d.ts +3 -3
  826. package/webscene/support/SlideGround.d.ts +3 -3
  827. package/webscene/support/SlidePopupInfo.d.ts +3 -3
  828. package/webscene/support/SlideVisibleLayer.d.ts +3 -3
  829. package/webscene/support/Title.d.ts +3 -3
  830. package/widgets/AreaMeasurement2D/AreaMeasurement2DTool.js +1 -1
  831. package/widgets/AreaMeasurement2D.d.ts +1 -0
  832. package/widgets/AreaMeasurement2D.js +1 -1
  833. package/widgets/Attachments/types.d.ts +0 -1
  834. package/widgets/BasemapGallery/support/PortalBasemapsSource.d.ts +2 -2
  835. package/widgets/BasemapLayerList/BasemapLayerListViewModel.d.ts +2 -2
  836. package/widgets/BasemapLayerList/types.d.ts +0 -1
  837. package/widgets/BasemapLayerList.d.ts +1 -0
  838. package/widgets/BasemapLayerList.js +1 -1
  839. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +2 -2
  840. package/widgets/Bookmarks/BookmarksViewModel.d.ts +2 -2
  841. package/widgets/CatalogLayerList/CatalogLayerListViewModel.d.ts +2 -2
  842. package/widgets/CatalogLayerList/types.d.ts +0 -1
  843. package/widgets/CatalogLayerList.d.ts +1 -0
  844. package/widgets/CatalogLayerList.js +1 -1
  845. package/widgets/CoordinateConversion/CoordinateConversionViewModel.d.ts +2 -2
  846. package/widgets/Daylight/DaylightViewModel.d.ts +2 -2
  847. package/widgets/Daylight/types.d.ts +0 -1
  848. package/widgets/DirectionalPad/DirectionalPadViewModel.d.ts +2 -2
  849. package/widgets/DirectionalPad/types.d.ts +0 -1
  850. package/widgets/Directions/DirectionsViewModel.d.ts +2 -2
  851. package/widgets/Directions.d.ts +1 -0
  852. package/widgets/Directions.js +1 -1
  853. package/widgets/DistanceMeasurement2D.d.ts +1 -0
  854. package/widgets/DistanceMeasurement2D.js +1 -1
  855. package/widgets/Editor/EditorViewModel.d.ts +2 -2
  856. package/widgets/Editor/UpdateFeaturesWorkflowData.d.ts +2 -2
  857. package/widgets/Editor/Workflow.d.ts +2 -2
  858. package/widgets/Editor.d.ts +1 -0
  859. package/widgets/Editor.js +1 -1
  860. package/widgets/ElevationProfile/ElevationProfileLine.d.ts +2 -2
  861. package/widgets/FeatureForm/FeatureFormViewModel.d.ts +3 -3
  862. package/widgets/FeatureForm.d.ts +1 -0
  863. package/widgets/FeatureForm.js +1 -1
  864. package/widgets/FeatureTable/Grid/GridViewModel.d.ts +2 -2
  865. package/widgets/FeatureTable/support/ColumnTemplateBase.d.ts +3 -3
  866. package/widgets/FeatureTable/support/EditableColumnTemplateMixin.d.ts +0 -1
  867. package/widgets/FeatureTable/support/TableTemplate.d.ts +3 -3
  868. package/widgets/FeatureTable.d.ts +1 -0
  869. package/widgets/FeatureTable.js +1 -1
  870. package/widgets/FeatureTemplates/FeatureTemplatesViewModel.d.ts +2 -2
  871. package/widgets/Features/FeaturesViewModel.d.ts +2 -2
  872. package/widgets/FloorFilter.d.ts +1 -0
  873. package/widgets/FloorFilter.js +1 -1
  874. package/widgets/Histogram/types.d.ts +0 -1
  875. package/widgets/HistogramRangeSlider/types.d.ts +0 -1
  876. package/widgets/Home/HomeViewModel.d.ts +2 -2
  877. package/widgets/Home.d.ts +1 -2
  878. package/widgets/LayerList/LayerListViewModel.d.ts +2 -2
  879. package/widgets/LayerList.d.ts +1 -0
  880. package/widgets/LayerList.js +1 -1
  881. package/widgets/LinkChartLayoutSwitcher/LinkChartLayoutSwitcherViewModel.d.ts +2 -2
  882. package/widgets/Measurement/types.d.ts +0 -1
  883. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.d.ts +3 -3
  884. package/widgets/OrientedImageryViewer/OrientedImageryViewerViewModel.js +1 -1
  885. package/widgets/OrientedImageryViewer/adapters/sketch/DataCaptureAdapter.js +1 -1
  886. package/widgets/OrientedImageryViewer/adapters/sketch/TriangulatedMeasurementAdapter.js +1 -1
  887. package/widgets/OrientedImageryViewer/adapters/view/MapViewAdapter.js +1 -1
  888. package/widgets/OrientedImageryViewer/adapters/view/SceneViewAdapter.js +1 -1
  889. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  890. package/widgets/OrientedImageryViewer/components/OverlayLayersListViewModel.js +1 -1
  891. package/widgets/OrientedImageryViewer/services/TransformationService.js +5 -0
  892. package/widgets/OrientedImageryViewer/support/dataCaptureUtils.js +5 -0
  893. package/widgets/OrientedImageryViewer/support/geometryUtils.js +5 -0
  894. package/widgets/OrientedImageryViewer/support/typeUtils.js +5 -0
  895. package/widgets/OrientedImageryViewer/types.d.ts +0 -1
  896. package/widgets/Print/CustomTemplate.d.ts +2 -2
  897. package/widgets/Print/PrintViewModel.d.ts +3 -3
  898. package/widgets/ScaleRangeSlider/types.d.ts +0 -1
  899. package/widgets/ScaleRangeSlider.d.ts +1 -0
  900. package/widgets/ScaleRangeSlider.js +1 -1
  901. package/widgets/Search/SearchSource.d.ts +2 -2
  902. package/widgets/Search/SearchViewModel.d.ts +3 -4
  903. package/widgets/ShadowCast/types.d.ts +0 -1
  904. package/widgets/Sketch/SketchViewModel.d.ts +2 -2
  905. package/widgets/Sketch.d.ts +1 -0
  906. package/widgets/Sketch.js +1 -1
  907. package/widgets/Swipe/types.d.ts +0 -1
  908. package/widgets/TableList/TableListViewModel.d.ts +2 -2
  909. package/widgets/TableList.d.ts +1 -0
  910. package/widgets/TableList.js +1 -1
  911. package/widgets/TimeSlider/TimeSliderViewModel.d.ts +2 -2
  912. package/widgets/TimeSlider.d.ts +1 -0
  913. package/widgets/TimeSlider.js +1 -1
  914. package/widgets/Track/types.d.ts +0 -1
  915. package/widgets/UtilityNetworkAssociations.d.ts +1 -0
  916. package/widgets/UtilityNetworkAssociations.js +1 -1
  917. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceViewModel.d.ts +2 -2
  918. package/widgets/UtilityNetworkTrace.d.ts +1 -0
  919. package/widgets/UtilityNetworkTrace.js +1 -1
  920. package/widgets/UtilityNetworkValidateTopology.d.ts +1 -0
  921. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  922. package/widgets/ValuePicker/types.d.ts +0 -1
  923. package/widgets/ValuePicker.d.ts +1 -0
  924. package/widgets/ValuePicker.js +1 -1
  925. package/widgets/Weather/types.d.ts +0 -1
  926. package/widgets/Widget.d.ts +3 -3
  927. package/widgets/support/GeolocationPositioning.d.ts +2 -2
  928. package/widgets/support/GridControls/GridControlsViewModel.d.ts +2 -2
  929. package/widgets/support/GridControls/types.d.ts +0 -1
  930. package/widgets/support/forms/types.d.ts +0 -1
  931. package/widgets/types.d.ts +1 -2
  932. package/assets/esri/core/workers/chunks/00e135dc1b4cb024973d.js +0 -1
  933. package/assets/esri/core/workers/chunks/03da31c7635d077e8d99.js +0 -1
  934. package/assets/esri/core/workers/chunks/185c97bc63ce546995ce.js +0 -1
  935. package/assets/esri/core/workers/chunks/1a13b472e0cf9f88e8de.js +0 -1
  936. package/assets/esri/core/workers/chunks/1a62c456e791c82050fe.js +0 -1
  937. package/assets/esri/core/workers/chunks/25dead73dfc5a4c19285.js +0 -1
  938. package/assets/esri/core/workers/chunks/2767b69085c9f7a1e1af.js +0 -1
  939. package/assets/esri/core/workers/chunks/3606fc5537c4d11b9554.js +0 -1
  940. package/assets/esri/core/workers/chunks/3ad7ec46adecf00ae1c2.js +0 -1
  941. package/assets/esri/core/workers/chunks/3b67aa46a60e35469bf8.js +0 -1
  942. package/assets/esri/core/workers/chunks/43e9eaedf65921b58eb2.js +0 -1
  943. package/assets/esri/core/workers/chunks/4b09d92c51c4619b548a.js +0 -1
  944. package/assets/esri/core/workers/chunks/4caec60ac0a5851730c6.js +0 -1
  945. package/assets/esri/core/workers/chunks/5119e3159617b8e1ea13.js +0 -1
  946. package/assets/esri/core/workers/chunks/52684c2abc9e8ce793cf.js +0 -1
  947. package/assets/esri/core/workers/chunks/532935f420ed5f13c011.js +0 -1
  948. package/assets/esri/core/workers/chunks/5348e4dc55428de9bba7.js +0 -1
  949. package/assets/esri/core/workers/chunks/53a1c6e008287d1f12f0.js +0 -1
  950. package/assets/esri/core/workers/chunks/59d3f3fbae775fd7686e.js +0 -1
  951. package/assets/esri/core/workers/chunks/5a706eecd8a988fae6b7.js +0 -1
  952. package/assets/esri/core/workers/chunks/5ba2bbbb42ef1920579d.js +0 -1
  953. package/assets/esri/core/workers/chunks/5cc731f161012b63c77a.js +0 -1
  954. package/assets/esri/core/workers/chunks/5fa8fe6353dbdda0b06a.js +0 -1
  955. package/assets/esri/core/workers/chunks/5fc6cada83bf8462d54c.js +0 -1
  956. package/assets/esri/core/workers/chunks/6107b58457a70c8de9da.js +0 -1
  957. package/assets/esri/core/workers/chunks/654eef3ad30f34c42e12.js +0 -1
  958. package/assets/esri/core/workers/chunks/7130b09300032d3a5925.js +0 -1
  959. package/assets/esri/core/workers/chunks/7a1ec6ac88d974cc5074.js +0 -1
  960. package/assets/esri/core/workers/chunks/7f76566d9b3801742387.js +0 -1
  961. package/assets/esri/core/workers/chunks/7f7c4ffbdf7b20dc7a54.js +0 -1
  962. package/assets/esri/core/workers/chunks/81e395a93c67749c6487.js +0 -1
  963. package/assets/esri/core/workers/chunks/8deae3a426eceae73186.js +0 -1
  964. package/assets/esri/core/workers/chunks/97ad3eb25ad003c16148.js +0 -1
  965. package/assets/esri/core/workers/chunks/9919b3c345785e910c38.js +0 -1
  966. package/assets/esri/core/workers/chunks/a4ee92867ad5cde25aed.js +0 -1
  967. package/assets/esri/core/workers/chunks/a56a5e00964d4cd59a66.js +0 -1
  968. package/assets/esri/core/workers/chunks/a774b4fc7df801503bea.js +0 -1
  969. package/assets/esri/core/workers/chunks/ab3e457c82fa9bd0203f.js +0 -1
  970. package/assets/esri/core/workers/chunks/ac0949ea3d2cf3eb7383.js +0 -1
  971. package/assets/esri/core/workers/chunks/af3d4eba6fe24db3ceba.js +0 -1
  972. package/assets/esri/core/workers/chunks/b1015e1f25b60c08d2cf.js +0 -1
  973. package/assets/esri/core/workers/chunks/b1085fa91724e2d3b24f.js +0 -1
  974. package/assets/esri/core/workers/chunks/b48b0f512a1cd7226bdc.js +0 -1
  975. package/assets/esri/core/workers/chunks/bbb409e54db77bfabdee.js +0 -1
  976. package/assets/esri/core/workers/chunks/c0265669fb616f052b65.js +0 -1
  977. package/assets/esri/core/workers/chunks/c18a2948ae3cb527d8bb.js +0 -1
  978. package/assets/esri/core/workers/chunks/d3c69c9cb3d9c3f5c67a.js +0 -1
  979. package/assets/esri/core/workers/chunks/d477def8bfd8482596d1.js +0 -1
  980. package/assets/esri/core/workers/chunks/d4f4c0201d8b641709c0.js +0 -1
  981. package/assets/esri/core/workers/chunks/dd30c1f5da0af72becd1.js +0 -1
  982. package/assets/esri/core/workers/chunks/dedd9d47ccc019ffc484.js +0 -1
  983. package/assets/esri/core/workers/chunks/dfef6e3d7bbf099de498.js +0 -1
  984. package/assets/esri/core/workers/chunks/ecf7d34b37ce6f0877af.js +0 -1
  985. package/assets/esri/core/workers/chunks/f3fdf9970b3c7acd071d.js +0 -1
  986. package/layers/support/ElevationTileData.d.ts +0 -32
  987. package/rest/geoprocessor/execute.d.ts +0 -6
  988. package/views/2d/engine/imagery/BrushVectorField.js +0 -5
  989. package/views/3d/analysis/AreaMeasurement/support/utils.js +0 -5
  990. package/views/3d/analysis/VolumeMeasurement/volumeMeasurementUtils.js +0 -5
  991. package/widgets/OrientedImageryViewer/dataCaptureUtils.js +0 -5
  992. /package/layers/buildingSublayers/{utils.d.ts → types.d.ts} +0 -0
@@ -2,4 +2,4 @@
2
2
  All material copyright Esri, All Rights Reserved, unless otherwise specified.
3
3
  See https://js.arcgis.com/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{equals as a,isSome as i}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import{deprecatedProperty as o}from"../../core/deprecate.js";import n from"../../core/Error.js";import{EventedMixin as c}from"../../core/Evented.js";import{makeHandle as l}from"../../core/handleUtils.js";import{equalsShallow as h}from"../../core/lang.js";import u from"../../core/Logger.js";import{clamp as d}from"../../core/mathUtils.js";import{destroyMaybe as m,abortMaybe as p}from"../../core/maybe.js";import{EsriPromise as g}from"../../core/Promise.js";import{isAbortError as y,throwIfAborted as v,waitTick as f}from"../../core/promiseUtils.js";import w from"../../core/ReactiveMap.js";import{whenOnce as F,on as _,watch as M,syncAndInitial as b,initial as I}from"../../core/reactiveUtils.js";import{sqlAnd as P}from"../../core/sql.js";import{getMetersPerUnitForSR as V}from"../../core/units.js";import{property as S,subclass as k}from"../../core/accessorSupport/decorators.js";import{isSerializable as A}from"../../core/support/jsonUtils.js";import{UpdatingHandles as C}from"../../core/support/UpdatingHandles.js";import L from"../../geometry/Extent.js";import G from"../../geometry/Multipoint.js";import O from"../../geometry/Point.js";import R from"../../geometry/Polygon.js";import T from"../../geometry/Polyline.js";import{projectAsync as j}from"../../geometry/projectionUtils.js";import x from"../../geometry/SpatialReference.js";import{polygonCentroidPoint as B}from"../../geometry/support/centroid.js";import{isClockwise as H}from"../../geometry/support/coordsUtils.js";import{normalizeMapX as E}from"../../geometry/support/normalizeUtils.js";import{geographicToWebMercator as z}from"../../geometry/support/webMercatorUtils.js";import D from"../../layers/GraphicsLayer.js";import N from"../../layers/MediaLayer.js";import{searchImages as U,getSortedLayerFeatures as W}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as q}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as $,computePolygonForInspection as Z,resizePolygon as J,checkIfPolygonContainsSelectedPoint as K}from"../../layers/orientedImagery/core/coverageUtils.js";import{isElevationSource as Q}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{getMetersPerUnitOfSR as X,convertGeographicToWebMercator as Y}from"../../layers/orientedImagery/core/utils.js";import{imageToWorld as ee,imageToWorldPanoramic as te}from"../../layers/orientedImagery/transformations/imageToWorld.js";import ae from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as ie}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{or as re,getInitialAngle as se,convertPixelToHeadingPitch as oe,convertHeadingPitchToSphereVertex as ne,getImageToWorldProperties as ce,getUpdateElevationProps as le,getImageToWorldPanoramicProperties as he,pointToArray as ue,transformGraphicCoordinatesToPixel as de,getWorldToImageProperties as me}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as pe,worldToImagePanoramic as ge}from"../../layers/orientedImagery/transformations/worldToImage.js";import ye from"../../layers/support/ExtentAndRotationGeoreference.js";import{getFloorFilterClause as ve}from"../../layers/support/floorFilterUtils.js";import fe from"../../layers/support/VideoElement.js";import we from"../../views/MapView.js";import Fe from"../../views/draw/Draw.js";import{scale as _e}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as Me}from"../../views/input/InputManager.js";import be from"../PanoramicVideoViewer.js";import Ie from"../PanoramicViewer.js";import{defaultAngleThresholdInDegrees as Pe,clockwiseDirections as Ve,videoExtent as Se,invalidCameraHeading as ke,sectorsInOrder as Ae,sampleExtent as Ce,sectorsRadii as Le}from"./constants.js";import{configureSketchTool as Ge,extractFieldsFromDataCaptureLayer as Oe,isValidDataCaptureLayer as Re,constructGraphicFromImageGeometry as Te}from"./dataCaptureUtils.js";import{isFeatureAttachment as je}from"./galleryUtils.js";import{getModeCorrectedPoint as xe,calculateCorrectedPixel as Be,getUnitRateFromSpatialReference as He,calculateHeightFromTemporaryDistance as Ee,getModeCorrectedPoints as ze,computeTriangulatedVector as De,computeTriangulatedPoint as Ne}from"./imageMeasurementUtils.js";import{crossSymbol as Ue,crossSymbol3D as We,measurementPolygonSymbol as qe,polylineSymbolPanoramic as $e,measurementPolylineSymbol as Ze,cameraOverlaySymbol3D as Je,cameraOverlaySymbol as Ke,diamondSymbol as Qe,diamondSymbol3D as Xe,locationSymbol as Ye,locationSymbol3D as et,activeSourcePointSymbol as tt,sourcePointSymbol as at}from"./symbols.js";import{isNoAttachmentError as it,isTifOrMrf as rt,filterOILLayerView as st,assignElevationSampleToFeatures as ot,calculateDirection as nt,calculateSegment as ct,createPanoramicMedia as lt,createNonPanoramicMedia as ht,isSceneView as ut,isGraphic as dt}from"./utils.js";import{disableVideoZoomAndPan as mt}from"./videoViewerUtils.js";import pt from"./components/ImageViewer.js";import gt from"./components/NavigationNode.js";import yt from"./components/OrientedImageryVideoViewModel.js";import{NoFeatureFoundWithObjectIdError as vt}from"./navigation/errors.js";import{queryFeatureByObjectIds as ft}from"./navigation/queries.js";import{ImageMeasurementService as wt}from"./services/ImageMeasurementService.js";import Ft from"./support/resolveMediaProps.js";import _t from"../Sketch/SketchViewModel.js";const Mt={click:"view-click",imageClick:"image-click",triangularImageClick:"triangular-click",interactionHandles:"interaction-handles",hittestHandles:"hittest-handles",videoPlayerHandles:"video-handles",activeViewerCursorHandles:"active-viewer-cursor-handles",imageViewerCursorHandles:"image-viewer-cursor-handles"},bt=()=>new n("orientedimageryviewer:sketch-not-initialized","Sketch property is not initialized, call loadSketch first");let It=class extends(c(g)){constructor(e){super(e),this.additionalFeatures=new s,this.additionalCameraLocations=new s,this.additionalFootprints=new s,this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.bestFeatureAngle=0,this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null,this.cameraHeadingThreshold=Pe,this.cameraPitchThreshold=Pe,this.clickAction="hittest",this.videoViewModel=null,this.collectionId=null,this.conversionProps=null,this.coverageFrustums=new s,this.coveragePolygons=new s,this.currentBestFeature=null,this.currentBestFeatureMeasurementImage=null,this.currentBestFeatureLocation=null,this.currentCoverageVisible=!0,this.depthImage=null,this.featureCache=[],this.navigationNodes=new s,this.determineWorkflowForFeature=async(e,t,a)=>{const{currentBestFeature:i,selectedPoint:r}=this;if(this.emit("popup-close"),i&&r){this._initialCurrentCoverageUpdate=!0,this._updateGroundElevation=!0;try{await this._updatePointsAndPolygons(a),await this._loadDepthImage(a),await this._loadImage(a)}catch(s){y(s)||(this.loadImageError(s),u.getLogger(this).error("#loadIImage()","error occured while loading image",s))}}},this.determineWorkflowForTriangularMeasurement=async(e,t,a)=>{if(this.emit("popup-close"),this.currentBestFeatureMeasurementImage&&this.selectedPoint)try{await this._loadMeasurementViewerImage(a)}catch(i){y(i)||(this.loadImageError(i),u.getLogger(this).error("#loadIImage()","error occured while loading image",i))}},this.disabled=!1,this.displayMessage={key:"onLoadMessage",type:"info"},this.displayNewMeasurementButton=!0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.dataCaptureLayer=null,this.features=new s,this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.heightMeasurementPixels=[],this.heightGraphic=null,this.heightMeasurementResult=0,this.heightMeasurementAccuracy=0,this.measurementAngle=null,this.tempDistance=null,this.imageGeometryField=null,this.imageLocationToolState=!1,this.imageMeasurementViewer=new pt,this.isAdditionalCoverageVisible=!1,this.isAdditionalPointSourcesVisible=!1,this.measurementVectors=[],this.layer=null,this.localPort=null,this.mapImageConversionToolState=!1,this.measureType=null,this.measurementGraphic=null,this.navigatorCurrentBestFeature=null,this.oiObjectIdField=null,this.overlayedCameraLocations=new s,this.overlayedMapFeatures=new w,this.pixelCoordinates=null,this.preserveAngle="none",this.pointSources=new s,this.preloadMedia=!1,this.preloadMediaSize=5,this.previousFeatureAngle=0,this.selectedPoint=null,this.shouldShowSelectedImage=!1,this.sketch=null,this.sketchTriangular=null,this.sketchTriangularGraphicsLayer=null,this.draw=null,this.sketchAdapter=null,this.triangularMeasurementActive=!1,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedAreaAccuracy=0,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.triangulatedMeasurementAdapter=null,this.updateFootprint=async(e,t,a)=>{"default"===this.mode&&"image-loaded"!==this.state||this.mode.includes("video")&&!this.videoElement?.content||await(this._adapter?.updateFootprint(e,t,a))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this.updatingTriangularMeasurementState=!1,this.videoElement=null,this.videoLayer=null,this.videoMapView=new we({map:new Map}),this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new pt,this._initialCurrentCoverageUpdate=!0,this._locationPointOnImage=null,this._measurementService=null,this._mediaPrefetcher=null,this._navigationManager=null,this._correctedLocationPointOnImage=null,this._overlays=new D({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"},title:"OrentedImageryViewerViewModel overlays layer"}),this._panoramicVideoViewer=new be,this._panoramicViewer=new Ie,this._panoramicMeasurementViewer=new Ie,this._referencePointOnGround=null,this._referencePointOnImage=null,this._sectorData=null,this._featureToSector=null,this._updatingHandles=new C,this._clickTask=null,this._crossSymbol=null,this.footprintExtent=null,this._featureChangedTask=null,this._mediaPrefetchTask=null,this._suitabilities=null,this._transformController=new AbortController,this._updateFootprintTask=null,this._updateGroundElevation=!1,this.addUpdatingPromise=e=>this._updatingHandles.addPromise(e),this.filterCapturedFeatures=e=>{const t=this.currentBestFeature?.attributes.objectId,a=this.layer?.imageReferenceField;if(!t||!e||!a)return;const i=this.overlayedMapFeatures.get(e);i?.forEach(e=>{const i=e.attributes??{},r=Object.keys(i).find(e=>e.toLowerCase()===a.toLowerCase());(r?i[r]:null)!==t&&(e.visible=!e.visible)})},this.hideImageGeometry=e=>{},this.highlight=e=>{if(!this._overlaysView)return;this.removeHighlight();const t=this.additionalFootprints.find(({attributes:{imageID:t}})=>t===Number(e));this._highlightedFeatureHandle=t?this._overlaysView?.highlight(t):null},this.loadDataCaptureAdapter=async e=>{await this.loadSketch(e);const t=import("./adapters/sketch/DataCaptureAdapter.js"),{default:a}=await t;return v(e),this.sketchAdapter=new a({viewModel:this}),this.sketchAdapter},this.loadImageFromFeature=async(e,t,a)=>this._updatingHandles.addPromise(this._loadImageFromFeature(e,t,a)),this.storeImageMeasurementViewer=e=>{this.imageMeasurementViewer=e},this.storePanoramicMeasurementViewer=e=>{this._panoramicMeasurementViewer=e},this.loadImageViewer=e=>{this._imageViewer?.destroy(),this._imageViewer=e},this.loadPanoramicViewer=e=>{this._panoramicViewer?.destroy(),this._panoramicViewer=e},this.loadPanoramicVideoViewer=e=>{this._panoramicVideoViewer?.destroy(),this._panoramicVideoViewer=e},this.loadVideoViewer=e=>{this.videoMapView.container=e},this.showImageByObjectId=async(e,t)=>{const a=this.additionalFeatures.find(({attributes:t})=>t.objectId===e);if(a)this.currentBestFeature=a;else{const{layer:a,layerFloorFilterClause:r}=this;if(!a)return void this.setMessage("noLayerSelected","info");this.beforeLoad();const s=this._updatingHandles.addPromise(this._queryAndLoadByObjectId(a,e,r,t));try{await s,await this.selectBestFeature(e,t)}catch(i){y(i)||(u.getLogger(this).error("oriented-imagery-viewer:show-image",i),"NoFeatureFoundWithObjectIdError"===i.name?this.setMessage("noFeatureFoundWithObjectId","error","",{objectId:e}):this.setMessage("imageLoadError","error",i.message))}}},this.imageToImageTransform=async(e,t,a)=>{const{updateElevationProps:i,...r}=t,{updateElevationProps:s,...o}=a,n=await ee(e,r,i);return pe(n,o)},this.imageToImageTransformPanoramic=async(e,t,a)=>{const{updateElevationProps:i,...r}=t,{updateElevationProps:s,...o}=a,n=await te(e,r,i);return ge(n,o)},this.getSectorFeatureById=e=>this._suitabilities?.find(({feature:{attributes:{objectId:t}}})=>t===e),this.getFeatureSectorById=e=>this._featureToSector?.[`${e}`],this.navigate=async(e,t)=>{const{mode:a}=this;if("default"!==a&&"panoramic"!==a)throw new n("NavigationError","Navigation is only supported in 'default' and 'panoramic' modes.");const i=e=>"default"===a&&e.declaredClass.endsWith("NavigationManager")||"panoramic"===a&&e.declaredClass.endsWith("NavigationManagerPanoramic");if(null==this._navigationManager||!i(this._navigationManager)){m(this._navigationManager);const e="default"===a?import("./navigation/NavigationManager.js"):import("./navigation/NavigationManagerPanoramic.js");this._navigationManager=new(await e).default({viewModel:this})}return this._navigationManager.navigate(e,t)},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.revealImageGeometry=e=>{},this.selectBestFeature=async(e,t)=>(v(t),this.currentBestFeature=this.features?.find(({attributes:t})=>`${t.objectId}`==`${e}`),F(()=>"image-loaded"===this.state,t)),this.toggleImageAttributes=()=>{const{currentBestFeature:e,popupEnabled:a,layer:i,view:r}=this;if(this.emit("popup-close"),!(r&&e&&a&&i))return;const{attributes:s,geometry:o}=e,n=new t({geometry:o,attributes:s.toJSON(),layer:i,sourceLayer:i});this.emit("popup-open",{features:[n],location:s.location.clone()})},this.updateSuitabilities=(e,t=!0)=>{e.sort((e,t)=>e.suitability-t.suitability),this._suitabilities=e;const a=this._suitabilities.map(({feature:e})=>e);this._initialCurrentCoverageUpdate=!0,this._updateFeatures(a,t),this._groupFeaturesBySectors()},this._createViewClickHandle=()=>{if(this.removeHandles(Mt.click),this.disabled||null==this.view)return;const e=this.mapImageConversionToolState&&"image-loaded"===this.state?this._mapImageConversionToolViewClickHandler:this._viewClickHandler;this.addHandles(this.view.on("click",e,Me.DEFAULT),Mt.click)},this._createImageClickHandle=()=>{this.removeHandles(Mt.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&i))return;const n=a.clickAction;this.clickAction="pixel-location";const c=l(()=>{this.clickAction=n});let h=null;const u=_(()=>a,"pixel-location",e=>{this.plotReferencePointOnImage(e),h?.abort(),h=r(async a=>{if(!e)return;const r=await this.getMapPoint(e,{feature:i,imageSize:o,mode:t}).then(e=>{const t=this.view?.spatialReference;return re(!t,e.spatialReference.equals(t))?e:j(e,t)});v(a),this.plotReferencePointOnGround(r)})});this.addHandles([u,c],Mt.imageClick)},this._createTriangularImageClickHandle=()=>{this.removeHandles(Mt.triangularImageClick),this.triangularMeasurementActive&&"none"!==this.mode&&this.currentBestFeature&&this.currentBestFeatureMeasurementImage&&this.activeTriangulatedViewer&&this.addHandles(this.activeTriangulatedViewer.imageRenderer.on("double-click",this._measurementImageClickHandler),Mt.triangularImageClick)},this._createTriangularImageLocationHandle=()=>{this.removeHandles(Mt.triangularImageClick);const{imageLocationToolState:e,mode:t,activeTriangulatedViewer:a}=this,i=a?.imageSize;if(!e||"none"===t||!i)return;this.clickAction="pixel-location";let s=null;const o=_(()=>a,"pixel-location",e=>{1===this.measurementVectors.length&&(this.plotLocationPointOnImage(e,!0),s?.abort(),s=r(async a=>{if(!e||this.triangulatedPoint||2===this.measurementVectors?.length||!this.currentBestFeatureMeasurementImage)return;let r=await this.getMapPoint(e,{feature:this.currentBestFeatureMeasurementImage,imageSize:i,mode:t});v(a);const s=this.view?.spatialReference;s&&!r.spatialReference.equals(s)&&(r=await j(r,s),v(a)),await this._calculateTriangulatedPointFromGroundPoint(r,{signal:a}),v(a)}))});this.addHandles(o,Mt.triangularImageClick)},this._createImageLocationHandle=()=>{this.removeHandles(Mt.imageClick);const{imageLocationToolState:e,mode:t,activeViewer:a,currentBestFeature:i,footprintExtent:s}=this,o=a?.imageSize;if(!(e&&"none"!==t&&o&&s&&i))return;this.clickAction="pixel-location";let n=null;const c=_(()=>a,"pixel-location",e=>{const{currentBestFeatureMeasurementImage:a,triangularMeasurementActive:s,activeTriangulatedViewer:c}=this;this.pixelCoordinates=e;const l=null!=a&&!c?.state.includes("loading");re(!s,l)&&this.plotLocationPointOnImage(e),n?.abort(),n=r(async a=>{if(!e)return;let r=await this.getMapPoint(e,{feature:i,imageSize:o,mode:t});v(a);const n=this.view?.spatialReference;n&&!r.spatialReference.equals(n)&&(r=await j(r,n),v(a)),this.groundCoordinates=r,s&&r&&l&&await this.triangulatedLocationWorkflow(r,a);const c=await this.calculateLocationAccuracy(e,r,t,a);v(a),c&&(this.groundCoordinatesAccuracy=c)})});this.addHandles(c,Mt.imageClick)},this._handleImageHitTestResponse=async e=>{const{layer:t,overlayedCameraLocations:a}=this;if(!t)return;const i=e.results.find(({graphic:e,graphic:{attributes:i}})=>a.includes(e)&&i&&!i[t.imageReferenceField]&&!i[t.imageGeometryField]);if(!i)return;const r=i.graphic.attributes[t.objectIdField];await this.showImageByObjectId(r)},this._loadDepthImage=async e=>{const{currentBestFeature:t,layer:a,depthImageNotSupported:i}=this;if(this.depthImage?.destroy(),this.depthImage=null,!a||!t||i)return;const{depthImage:r}=t.attributes;if(!r)return;const s=(await import("./services/DepthImageService.js")).default;v(e),this.depthImage=new s({url:r});try{await this.depthImage.load(e)}catch(o){y(o)||(u.getLogger(this).error("error occurred while loading depth image",o),this.depthImage?.destroy(),this.depthImage=null)}},this._loadImage=async e=>{const{currentBestFeature:t,layer:a,mode:i}=this;if(this.clearGraphics(),a&&t&&"none"!==i&&"video"!==i&&"panoramic-video"!==i)try{await this.loadImageFromFeature(a,t,e),v(e),await this.transformAndPlotSelectedLocation(e)}catch(r){y(r)||this.loadImageError(r)}},this._loadVideo=async e=>{const{currentBestFeature:t,layer:a,mode:i,selectedPoint:r}=this,s=t?.attributes.imagePath;if(!a||!t||"panoramic-video"!==i||!s)return;const{attributes:o}=t,{cameraPitch:n,cameraOrientation:c,location:l}=o,h=l.spatialReference.isWGS84&&4!==c?.type?z(l):new O(l);try{this._panoramicVideoViewer.viewModel.video&&this._panoramicVideoViewer.viewModel.video.pause(),this._panoramicVideoViewer.videoSource=s;let t=0;h&&r&&(t=await se(h,r)-t),this._panoramicVideoViewer.pitch=n??0,this._panoramicVideoViewer.yaw=t,await this._panoramicVideoViewer.loadVideo(e),v(e)}catch(u){y(u)||this.loadImageError(u)}},this._loadImageFromFeature=async(e,t,a)=>{const{mode:i}=this;if("default"!==i&&"panoramic"!==i)return;let r;try{r=await Ft(t.attributes,e,a),v(a)}catch(f){if(y(f))return;return it(f)?(u.getLogger(this).error(f),void this.setMessage("noAttachment","error",`${e.objectIdField}: ${t.attributes.objectId}`)):(u.getLogger(this).error(f,{[e.objectIdField]:t.attributes.objectId,layer:e}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${e.objectIdField} ${t.attributes.objectId}`))}if(!r)return;const{mediaUrl:s,datasetFormat:o,rotation:n,searchParams:c,location:l,cameraHeading:h,matrix:d,cameraPitch:m,getDataSetFormatError:p}=r,g=`${t.attributes.objectId}`;try{let r=this._mediaPrefetcher?.getCachedMedia(g);if(!r){const a=this.navigationNodes.find(e=>e.id===t.attributes.objectId);if(a){try{await(this._mediaPrefetcher?.startPrefetchForNode(a,e))}catch(w){}r=this._mediaPrefetcher?.getCachedMedia(g)}}if(r){if("panoramic"===i){const e=this.triangularMeasurementActive?this._panoramicMeasurementViewer:this._panoramicViewer;let i=0;return l&&this.selectedPoint&&(i=await se(l,this.selectedPoint)-i),await e.loadMedia(r,a),void(this.selectedPoint?e.set({yaw:i,pitch:m}):"viewAngle"in t.attributes&&Number.isFinite(t.attributes.viewAngle)&&e.set({yaw:t.attributes.viewAngle,pitch:m}))}return void await this._setImageSource(this.triangularMeasurementActive?this.imageMeasurementViewer:this._imageViewer,r,a)}}catch(w){}p&&u.getLogger(this).warn("error occurred while getting dataset format",p),"panoramic"===i?await this.loadPanoramicMediaSource({lookAt:{yaw:this.selectedPoint?await se(l,this.selectedPoint):"viewAngle"in t.attributes&&Number.isFinite(t.attributes.viewAngle)?t.attributes.viewAngle:0,pitch:m},extension:o?.toUpperCase(),url:s,cameraHeading:h,matrix:d},a):await this.loadMediaSource({datasetFormat:o?.toUpperCase(),url:s,customParameters:c,rotation:n},a)},this._loadMeasurementViewerImage=async e=>{const{currentBestFeatureMeasurementImage:t,layer:a,mode:i}=this;if(this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics(),a&&t&&"none"!==i&&"video"!==i&&"panoramic-video"!==i)try{await this.loadImageFromFeature(a,t,e),v(e)}catch(r){y(r)||this.loadImageError(r)}},this._loadMediaPrefetcher=async e=>{if(!this._mediaPrefetcher){const{default:t}=await import("./support/MediaPrefetcher.js");v(e),this._mediaPrefetcher=new t({maxEntries:this.preloadMediaSize*Ve.length})}return this._mediaPrefetcher},this._loadViewAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/view/MapViewAdapter.js");v(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/view/SceneViewAdapter.js");v(e),this._adapter=new t(this);break}}else this._adapter=null},this._mapImageConversionToolViewClickHandler=e=>{if(e.stopPropagation(),e.preventDefault(),e.mapPoint){const t=e.mapPoint;t.x=E(t.x,t.spatialReference),this.plotMapPoint(e.mapPoint)}},this._measurementImageClickHandler=e=>{e.stopPropagation(),e.preventDefault();const{sketchTriangular:t,triangularMeasurementActive:a,currentBestFeatureMeasurementImage:i,triangulatedMeasurementGraphic:r}=this;t&&a&&i&&r&&"active"!==t.state&&(t.update([r],{tool:"reshape"}),this.updatingTriangularMeasurementState=!0)},this._viewClickHandler=e=>{this._clickTask?.abort(),this._clickTask=r(async t=>{const{pointerType:a,button:i,mapPoint:r}=e;if(("mouse"!==a||0===i)&&r)return e.stopPropagation(),e.preventDefault(),this._updatingHandles.addPromise(this.loadBestImage(r,{signal:t}))})},this.plotSelectedPointOnImage=async(e,a)=>{if(await f(a),!e)return;const i=new O({...A(e)?e.toJSON():e});if("default"===this.mode)i.x-=.5,i.y=.5-i.y,i.spatialReference=this._imageViewer.imageRenderer.spatialReference.clone(),this._crossSymbol=new t({geometry:i,symbol:Ue}),this._imageViewer.addGraphic(this._crossSymbol,0);else if("panoramic"===this.mode){const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:o}=oe(e,i,r),n=ne(s,o);this._crossSymbol=new t({geometry:new O(n,x.WebMercator),symbol:We}),this._panoramicViewer.addGraphic(this._crossSymbol,0)}},this.handleSectorClick=this.handleSectorClick.bind(this),this.searchBestImage=this.searchBestImage.bind(this),this.transformAndPlotReferencePointOnImage=this.transformAndPlotReferencePointOnImage.bind(this)}initialize(){this.addHandles([M(()=>this.view,()=>this.load(),b),M(()=>this.view?.map,(e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)},I),M(()=>this.view?.map?.allLayers?.length,e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)},I),M(()=>[this.state,this.mapImageConversionToolState,this.view,this.disabled],()=>{this._createViewClickHandle(),this._createImageClickHandle()},b),M(()=>[this.triangularMeasurementActive,this.currentBestFeatureMeasurementImage],()=>{this._createTriangularImageClickHandle()},b),M(()=>[this.state,this.imageLocationToolState,this.view],(e,t)=>{if(this._initializeMeasurementService(),this._createImageLocationHandle(),!this.imageLocationToolState)return this.clearPreviousGroundLocation(),void this._resetCursor();e[1]!==t?.[1]&&this._setMeasurementCursor()},b),M(()=>this.measureType,()=>{this.clearPreviousMeasurements(),this._initializeMeasurementService()},b),M(()=>this.bestFeatureAngle,(e,t)=>{this.previousFeatureAngle=t??0},b),M(()=>this.currentBestFeature,async(e,t)=>{p(this._featureChangedTask),this._featureChangedTask=r(async a=>this.determineWorkflowForFeature.apply(this,[e,t,{signal:a}])),await this._featureChangedTask.promise},{sync:!0}),M(()=>[this.currentNode,this.preloadMedia,this.navigationMode],()=>{this._mediaPrefetchTask?.abort(),this._mediaPrefetchTask=r(async e=>{this.preloadMedia?(this._mediaPrefetcher??=await this._loadMediaPrefetcher({signal:e}),v(e),this._mediaPrefetcher.enqueueDirectionalPrefetch(this.layer,this.currentNode,this.preloadMediaSize)):this._mediaPrefetcher?.clear()})},b),M(()=>this.currentBestFeatureMeasurementImage,(e,t)=>{p(this._featureChangedTask),t&&e!==t&&(this.measurementVectors=[],this.triangulatedPoint=null,this.sketchTriangularGraphicsLayer?.graphics.destroyAll()),this._featureChangedTask=r(async a=>{await this.determineWorkflowForTriangularMeasurement(e,t,{signal:a}),v(a),this._reorderTriangularSketchLayer()})},b),M(()=>this.triangularMeasurementActive,(e,t)=>{t&&!e&&(this.measurementVectors=[],this.currentBestFeatureMeasurementImage=null,this.triangulatedDistanceMeasurement=null,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaAccuracy=0,this.sketchTriangularGraphicsLayer?.graphics.destroyAll(),this.clearReferencePointOnImage(),this.imageMeasurementViewer.clearImage(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearImage(),this._panoramicMeasurementViewer.clearGraphics())}),M(()=>this.mode,e=>{switch(this.removeHandles(Mt.interactionHandles),e){case"default":this.addHandles(M(()=>{const{state:e}=this;return"image-loaded"===e?this._imageViewer.imagePointsInView:null},e=>{e&&(p(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e,void 0,{signal:t})}))},{...b,equals:(e,t)=>a(e,t,h)}),Mt.interactionHandles);break;case"video":this.addHandles(M(()=>{const{footprintExtent:e,videoElement:t,bestFeatureFootprint:a}=this;if(e&&t?.loaded&&a)return{videoExtent:Se,bestFeatureFootprint:a}},e=>{e?.videoExtent&&e?.bestFeatureFootprint&&(p(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e.videoExtent,void 0,{signal:t})}))},{...b,equals:(e,t)=>a(e?.videoExtent,t?.videoExtent,h)&&e?.bestFeatureFootprint===t?.bestFeatureFootprint}),Mt.interactionHandles);break;case"panoramic":this.addHandles(M(()=>{const{currentBestFeature:e,state:t,_panoramicViewer:a}=this,{imageSize:i,vfov:r,hfov:s,pitch:o,yaw:n}=a;return e&&i&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o]:null},e=>{if(!e||this.state.includes("loading"))return;const[t,a,i,s]=e;this.currentNode&&(this.currentNode.currentHeading=i,this.currentNode.currentPitch=s),p(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:i,pitch:s},{signal:e}),this._updateFootprintTask=null})},{equals:(e,t)=>a(e,t,h)}),Mt.interactionHandles);break;case"panoramic-video":this.addHandles(M(()=>{const{currentBestFeature:e,state:t,_panoramicVideoViewer:a}=this,{imageSize:i,vfov:r,hfov:s,pitch:o,yaw:n,viewModel:c}=a,l=c.closestFeature??e;return l&&i&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o,l]:null},e=>{if(!e)return;const[t,a,i,s,o]=e;p(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:a,yaw:i,pitch:s,feature:o},{signal:e}),v(e),this._updateFootprintTask=null})},{equals:(e,t)=>a(e,t,h)}),Mt.interactionHandles)}},b),M(()=>[this.brightness,this.contrast,this.sharpness],()=>{const{_imageViewer:e,brightness:t,contrast:a,mode:i,sharpness:r}=this;"default"===i&&(e.brightness=t,e.contrast=a,e.sharpness=r)},b),M(()=>this.activeViewer?.imageRenderer,()=>{this.sketch&&(this.sketch.view=this.activeViewer?.imageRenderer)}),M(()=>this.activeViewer,e=>{this.removeHandles(Mt.hittestHandles),e&&this.addHandles(_(()=>e,"hittest-response",this._handleImageHitTestResponse),Mt.hittestHandles)})]),this.when().finally(()=>{this.notifyChange("state")})}destroy(){this.currentBestFeature=null,this._updateFootprintTask=p(this._updateFootprintTask),this._clickTask=p(this._clickTask),this.coverageFrustums.destroy(),this.coveragePolygons.destroy(),this.pointSources.destroy(),this.additionalFootprints.destroy(),this.additionalCameraLocations.destroy(),this.bestFeatureFootprint=m(this.bestFeatureFootprint),this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint),this.videoViewModel=m(this.videoViewModel),this._crossSymbol=m(this._crossSymbol),this._referencePointOnGround=m(this._referencePointOnGround),this._referencePointOnImage=m(this._referencePointOnImage),this._locationPointOnImage=m(this._locationPointOnImage),this._overlays&&this.view?.map?.remove(this._overlays),this._overlays.destroy(),this._imageViewer.destroy(),this.imageMeasurementViewer.destroy(),this._panoramicViewer.destroy(),this._panoramicMeasurementViewer.destroy(),this._mediaPrefetcher?.destroy()}get activeLayer(){return o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeViewer(){const{_imageViewer:e,_panoramicViewer:t,mode:a}=this;switch(a){case"default":return e;case"panoramic":return t;default:return null}}get activeTriangulatedViewer(){switch(this.mode){case"default":return this.imageMeasurementViewer;case"panoramic":return this._panoramicMeasurementViewer;default:return null}}get accuracyParametersMissing(){return this.layer?.orientationAccuracy?.every(e=>0===e)??!0}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",d(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",d(e,-10,10))}get currentNode(){const{currentBestFeature:e,navigationNodes:t}=this;return t.find(t=>t.id===e?.attributes.objectId)}get depthImageNotSupported(){if(this.currentBestFeature?.attributes.depthImage)return!rt(this.currentBestFeature.attributes.depthImage)}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){const{currentBestFeature:e}=this;if(!e)return!1;const t=e.attributes.imagePath?.trim();return rt(t)||je(t)}get imageLoaded(){return o(u.getLogger(this),"imageLoaded",{replacement:'Use OrientedImageryViewer.state === "image-loaded"',version:"4.29",warnOnce:!0}),"image-loaded"===this.state}get invalidCameraHeading(){return this.currentBestFeature?.attributes?.cameraHeading===ke}get imagePointsInView(){const{mode:e,_imageViewer:t}=this;return"default"===e?t.imagePointsInView:null}get layerView(){const{layer:e,view:t}=this;if(e&&t)return t.allLayerViews.find(st(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?ve(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const t=e.orientedImageryType;if(t?.includes("video"))return t.includes("360")?"panoramic-video":"video";const{horizontalFieldOfView:a,isSpherical:i}=e;return 360===a||i?"panoramic":"default"}get panoramicVideoLoaded(){const{mode:e,_panoramicVideoViewer:t}=this,{videoLoaded:a}=t.viewModel;return("panoramic-video"===e&&!0===a)??!1}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?Ae.map(t=>e[t]):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",d(e,0,1))}get sketchGraphicsLayer(){const{sketch:e}=this;return"graphics"===e?.layer?.type?e.layer:void 0}get state(){const{mode:e,_updatingHandles:{updating:t},_featureChangedTask:a}=this;if(!this.isFulfilled()||t||!1===a?.finished)return"loading";if(this.isRejected())return"error";if("error"===this.displayMessage?.type)return"image-load-error";switch(e){case"default":return this._imageViewer.state;case"panoramic":return this._panoramicViewer.state;case"video":return this.videoElement?.loaded?"video-loaded":"video-not-loaded"}return"ready"}get thumbnails(){const{features:e}=this;return e?new s(e.map(({attributes:{imagePath:e,objectId:t,cameraRoll:a,imageRotation:i}})=>{const r=e?.trim();return rt(r)||je(r)?{url:r,objectId:t,rotation:(a??0)+(i??0)}:null}).filter(i)):null}set view(e){this._set("view",e)}get _defaultGraphicsLayer(){const e={blendMode:"source-atop"};switch(this.mode){case"panoramic":return new D({...e,elevationInfo:{mode:"absolute-height"}});case"default":return new D({...e});default:return}}get _overlaysView(){return this.view?.layerViews.find(({layer:e})=>e===this._overlays)}beforeLoad(e=!0){this.emit("popup-close"),e&&(this.displayMessage=null),this.clearPreviousGroundLocation(),this.triangularMeasurementActive=!1,this.currentBestFeatureMeasurementImage=null,this.measureType=null,this.imageLocationToolState=!1,this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint),this._overlays?.removeAll()}async computeHeight(e,t,a=!0){return this._measurementService?.computeHeight(e,t,a)}async calculateAreaMeasurement(e,t,a){return this._measurementService?.calculateAreaMeasurement(e,t,a)}async calculateDistanceMeasurement(e,t,a){return this._measurementService?.calculateDistanceMeasurement(e,t,a)}async calculateAccuracy(e,t,a){return this._measurementService?.calculateAccuracy(e,t,a)}async calculateLocationAccuracy(e,t,a="default",i){return this._measurementService?.calculateLocationAccuracy(e,t,a,i)}async calculateAccuracyPanoramic(e,t,a=!1,i){return this._measurementService?.calculateAccuracyPanoramic(e,t,a,i)}async calculateHeightMeasurementInfo(e,t,a){return this._measurementService?.calculateHeightMeasurementInfo(e,t,a)}async calculateTriangulatedMeasurements(e){await(this._measurementService?.calculateTriangulatedMeasurements(e))}clearPreviousMeasurements(){this.clearMeasurementGraphics(),this.resetMeasurementData(),this.stopMeasurement()}clearPreviousGroundLocation(){this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.pixelCoordinates=null,this.clearLocationPointOnImage()}clearMeasurementGraphics(){this.measurementGraphic&&(this.activeViewer?.removeGraphic(this.measurementGraphic),this.measurementGraphic=null),this.heightGraphic&&(this.activeViewer?.removeGraphic(this.heightGraphic),this.heightGraphic=null),this.triangularMeasurementActive&&this.sketchTriangularGraphicsLayer?.graphics.destroyAll()}digitizeCancel(){return this.sketch?.cancel()}digitizeCanRedo(){return this.sketch?.canRedo()??!1}digitizeCanUndo(){return this.sketch?.canUndo()??!1}digitizeComplete(){return this.sketch?.complete()}async digitizeCreate(e,t){const{sketch:a,dataCaptureLayer:i}=this;if(!a)throw bt();Ge(i,e,a),await a.create(e,{...t,defaultZ:0})}digitizeDelete(){if(!this.sketch)throw bt();return this.sketch.delete()}digitizeDuplicate(){if(!this.sketch)throw bt();return this.sketch.duplicate()}digitizePlace(e,t){if(!this.sketch)throw bt();return this.sketch.place(e,t)}digitizeRedo(){if(!this.sketch)throw bt();return this.sketch.redo()}digitizeUndo(){if(!this.sketch)throw bt();return this.sketch.undo()}digitizeUpdate(e,t){if(!this.sketch)throw bt();return this.sketch.update(e,t)}async displayHeightResults(){const{currentBestFeature:e,activeViewer:t,heightMeasurementPixels:a,mode:i}=this,r=t?.imageSize,s=e?.attributes;if(!s||!r)return;const o=await this.computeHeight(a,i);o?.value&&o?.accuracy&&(this.heightMeasurementResult=o.value,this.heightMeasurementAccuracy=o.accuracy)}filterByFootprints(e,t,a=!1){const i=[],r=[],s=[];return e.forEach(e=>{const{layer:{coveragePercent:o},attributes:n}=e;let c;const{polygon:l,frustum:h}=$(n);if(c=l.clone(),n.isInspection&&(c=Z(n)),o&&(c=J(c,o)),a||!t||K(c,t)){s.push(e);const{geometry:t,objectId:a,cameraHeight:o,cameraHeading:c}=n,u=t.clone();u.z=o/X(t.spatialReference),u.imageID=a,this.pointSources.push(u),c!==ke&&(i.push(l),h&&r.push(h))}}),{features:s,polygons:i,frustums:r}}getMeasurementProperties(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,o=ce(i,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?j(n,x.WebMercator):Promise.resolve(n)).then(e=>(n=e,le(n.spatialReference,n.z??0,s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}getMeasurementPropertiesPanoramic(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:a,attributes:i}=e,{elevationSource:r,cameraHeight:s}=i,o=he(i,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?j(n,x.WebMercator):Promise.resolve(n)).then(e=>(n=e,le(n.spatialReference,n.z??0,s,{elevationSample:a,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}async deleteDataCaptureFeatures(e){const{dataCaptureLayer:t}=this;if(!t)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");return t.queryFeatures({objectIds:e}).then(({features:e})=>t.applyEdits({deleteFeatures:e}))}handleSectorClick(e){if(isNaN(e))return;const t=this._sectorData?.[Ae[e]],a=t?.at(0);a&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(a):this._updateCurrentBestFeature(a))}handleFeatureClick(e){const{sector:t,featureIndexInSector:a}=e;if(isNaN(a))return;const i=this._sectorData?.[t],r=i?.at(a);r&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(r):this._updateCurrentBestFeature(r))}handleDrawCursorUpdateEvents(e){const{measurementAngle:t,tempDistance:a,heightMeasurementPixels:i,mode:r,activeViewer:s,currentBestFeature:o}=this,n=s?.imageSize;if(!e.vertices||!n||!o)return;const c=xe(e.vertices.at(-1),r,n);if(i.length<1||!c||!a||!t||"none"===r)return;const l=Be(i[0],c,t);if(!l?.length)return;this.heightMeasurementPixels.push(l),"panoramic"===r?this.createPolylineGraphicPano():this.createPolylineGraphic();const h=He(o.attributes.location.spatialReference),u=Ee(this.heightMeasurementPixels,a,h);u&&(this.heightMeasurementResult=u)}async handleDrawVertexAddEvents(e,t){const{currentBestFeature:a,activeViewer:i,heightMeasurementPixels:r,mode:s}=this;if(!a||!i||!e.vertices?.length||"none"===s)return;const o=i?.imageSize;if(!r.length&&o){const a=xe(e.vertices.at(-1),s,o);this.heightMeasurementPixels.push(a);const i=await this.calculateHeightMeasurementInfo(a,s,t);if(!i?.measurementAngle||!i?.tempDistance)return;this.measurementAngle=i.measurementAngle,this.tempDistance=i.tempDistance}}load(e){return this.addResolvingPromise(this._loadViewAdapter(e).catch(e=>{if(!y(e))throw e})),this}async loadBestImage(e,t){return this.selectedPoint=Y(e),this.beforeLoad(),this._fetchFeaturesWithController(e,t)}loadImageError(e){u.getLogger(this).error("oriented-imagery-viewer:load-image",e),this.setMessage("imageLoadError","error",e.message)}async loadSketch(e){if(!this.sketch){const t=import("../Sketch/SketchViewModel.js"),{default:a}=await t;v(e),this.sketch=new a({layer:this._defaultGraphicsLayer,view:this.activeViewer?.imageRenderer,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{edgeOperation:"none",shapeOperation:"none",vertexOperation:void 0},enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"transform"}})}return this.sketch}async loadMeasurementAdapter(e){if(!this.sketchAdapter){const t=import("./adapters/sketch/MeasurementAdapter.js"),{default:a}=await t;if(v(e),this.sketchAdapter=new a({viewModel:this}),!this.sketchAdapter.viewModel.isResolved())return}return this.sketchAdapter}async loadTriangulatedMeasurementAdapter(e){if(!this.triangulatedMeasurementAdapter){const t=import("./adapters/sketch/TriangulatedMeasurementAdapter.js"),{default:a}=await t;if(v(e),this.triangulatedMeasurementAdapter=new a({viewModel:this}),!this.triangulatedMeasurementAdapter.viewModel.isResolved())return}return this.triangulatedMeasurementAdapter}async processFeatureResponse(e,t,a){const{features:i}=e;if(this._clearFeatureGeometries(),!this._checkFeatures(i))return;const{features:r,polygons:s,frustums:o}=this.filterByFootprints(i,t,a?.skipFilter);if(!this._checkFeatures(r))return;this.coveragePolygons.addMany(s),this.coverageFrustums.addMany(o);const n=await this.processElevationSample(s,r,a);v(a),await this._updateElevationOfSelectedPointAndLocations(r,t,n),v(a),ot(r,n);const c=this._processSuitableFeatures(r,t);this.updateSuitabilities(c,a?.loadBestImage)}async processFeatureElevation(e,t,a){if(!t)return;const{features:i,polygons:r}=this.filterByFootprints(e,t,!0);if(!i?.length)return;const s=await this.processElevationSample(r,i,a);return v(a),s}async startMeasurement(e,t){this.sketch||await this.loadSketch(t),await this.loadMeasurementAdapter(t);const{sketch:a,sketchAdapter:i,activeViewer:r,mode:s}=this;if(!a||!i||!r||"none"===s)return;if(this.displayNewMeasurementButton=!1,"panoramic"===s&&(a.defaultCreateOptions.defaultZ=0),await a.create(e),"panoramic"===s){const{drawOperation:e}=a.view.activeTool;e.constraintsEnabled=!1,e._set("elevationDrawSurface",null)}const o=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;o&&this.sketch&&(this.sketch.polygonSymbol=qe(o),this.sketch.polylineSymbol="panoramic"===s?$e:Ze(o,2.5))}startHeightMeasurement(){this.heightMeasurementPixels=[],this.displayNewMeasurementButton=!1,this.draw??=new Fe({view:this.activeViewer?.imageRenderer});this.draw.create("polyline").on(["cursor-update","vertex-add","draw-complete"],e=>this.handleDrawEvents(e))}createPolylineGraphic(){const e=[this.heightMeasurementPixels[0],this.heightMeasurementPixels.at(-1)],a=this.activeViewer?.imageRenderer.spatialReference;if(this.heightGraphic)this.heightGraphic.geometry=new T({paths:[e],spatialReference:a});else{const i=new T({paths:[e],spatialReference:a}),r=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;this.heightGraphic=new t({geometry:i,symbol:Ze(r,2.5)}),this.activeViewer?.addGraphic(this.heightGraphic)}}createPolylineGraphicPano(){const e=this.activeViewer?.imageRenderer.spatialReference,a=this.activeViewer?.imageSize;if(!a)return;const i={x:this.heightMeasurementPixels[0][0],y:this.heightMeasurementPixels[0][1]},r={x:this.heightMeasurementPixels.at(-1)[0],y:this.heightMeasurementPixels.at(-1)[1]},{heading:s,pitch:o}=oe(i,a[0],a[1]),{heading:n,pitch:c}=oe(r,a[0],a[1]),l=[[...ne(s,o)],[...ne(n,c)]];if(this.heightGraphic)this.heightGraphic.geometry=new T({paths:[l],spatialReference:e});else{const a=new T({paths:[l],spatialReference:e});this.heightGraphic=new t({geometry:a,symbol:$e}),this._panoramicViewer.addGraphic(this.heightGraphic,0)}}async editOverlayedGraphics(e){this.sketchTriangularGraphicsLayer||this._initializeSketchTriangularGraphicsLayer(),this.sketchTriangularGraphicsLayer?.destroyed&&this._handleDestroyedTriangularSketchLayer(),this.sketchTriangularGraphicsLayer.add(e),this.sketchTriangular||(this._initializeSketchTriangular(),await this.loadTriangulatedMeasurementAdapter()),this.updateOverlayedGeometry(e)}updateOverlayedGeometry(e){this.sketchTriangular?.update([e],{tool:"reshape"})}async processMeasurementVectors(e){this.triangularMeasurementActive&&this.currentBestFeature&&(this.measurementVectors?.length<2&&await this.updateMeasurementVectorsArray(e),2===this.measurementVectors.length&&await this.calculateTriangulatedMeasurements(e))}async updateMeasurementVectorsArray(e){const t=this.measurementVectors.length?this.currentBestFeatureMeasurementImage:this.currentBestFeature;if(t){const a=await this.computeMeasurementVector(e,t);a&&this.measurementVectors.push(a)}}async computeMeasurementVector(e,t){const{activeViewer:a,mode:i}=this,r=a?.imageSize;if(!e||!t||!r)return;const s=ze(e,i,r),o=this.view?.spatialReference,n=[];for(let c=0;c<s.length;c++){const e={x:s[c][0],y:s[c][1]};let a=await this.getMapPoint(e,{feature:t,imageSize:r,mode:i});o&&!a.spatialReference.equals(o)&&(a=await j(a,o)),n.push(a)}return De(n,t)}async handleDrawEvents(e,t){if(this.draw)switch(e.type){case"cursor-update":this.handleDrawCursorUpdateEvents(e);break;case"vertex-add":await this.handleDrawVertexAddEvents(e,t);break;case"draw-complete":await this.displayHeightResults()}}initializeMeasurement(e){switch(this.clearMeasurementGraphics(),this.resetMeasurementData(),e){case"distance":this.startMeasurement("polyline");break;case"area":this.startMeasurement("polygon");break;case"height":this.startHeightMeasurement()}}async overlayCameraLocations(e){const{activeViewer:a,currentBestFeature:i,overlayedCameraLocations:r,layer:s,mode:o,state:n,layerFloorFilterClause:c}=this,l=a?.imageSize;if(!l||!i||!s||"none"===o||n.includes("loading"))return;const{polygon:h}=$(i.attributes);if(a.removeManyGraphics(r.toArray()),r.removeAll(),e){const{features:e}=await s.queryFeatures({where:P(`${s.objectIdField} <> ${i.attributes.objectId}`,P(s.definitionExpression,c)),geometry:h,returnGeometry:!0,outFields:[s.objectIdField]}),n=await Promise.all(e.map(async e=>{const{attributes:a,geometry:r}=e,s=await this.getPixels(r,{feature:i,imageSize:l,mode:o}),n="panoramic"===o?Je():Ke();return new t({attributes:a,symbol:n,geometry:s})}));r.addMany(n),a.addManyGraphics(r.toArray())}}overlayGraphicsOnImage(e,t){this.removeOverlayedGraphicsOnImage(e),this.overlayedMapFeatures.set(e,t),this.activeViewer?.addManyGraphics(t.toArray())}async overlayMapFeatures(e,a=!1){const{activeViewer:r,currentBestFeature:o,mode:n,state:c,layer:l}=this,h=r?.imageSize;if(!h||!o||"none"===n||"video"===n||"panoramic-video"===n||c.includes("loading")||!l)return;const{polygon:d}=$(o.attributes);try{const{imageGeometryField:t,oiObjectIdField:a}=Oe(e,l.imageGeometryField,l.imageReferenceField);this.imageGeometryField=t.name,this.oiObjectIdField=a.name}catch(g){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features",g)}const{features:m}=await e.queryFeatures({geometry:d,returnGeometry:!0,outFields:["*"]}),p=new s((await Promise.all(m.map(async i=>{const r=i.symbol?.clone()??e.renderer?.getSymbol(i)?.clone(),{attributes:s,geometry:c}=i,l=c,{imageGeometryField:d,oiObjectIdField:m}=this;if(d&&m&&Re(e,d,m)&&`${s[m]}`==`${o.attributes.objectId}`)try{return Te(s,d,e,a,h,n,r)}catch(g){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features","couldn't create graphic from attributes, geometry will be used",{error:g,feature:i,layer:e,imageGeometryField:this.imageGeometryField,imageReferenceField:this.oiObjectIdField})}switch(l?.type){case"point":{const i=await this.getPixels(l,{feature:o,imageSize:h,mode:n});return new t({attributes:s,layer:e,symbol:r,geometry:i,visible:e.visible&&a})}case"polygon":{const{rings:i,spatialReference:c}=l,u=i.map(e=>e.map(([e,t,a])=>new O({x:e,y:t,z:a,spatialReference:c}))),d=await Promise.all(u.map(async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then(e=>e.map(ue))));return new t({attributes:s,layer:e,symbol:r,geometry:new R({rings:d,spatialReference:x.WebMercator}),visible:e.visible&&a})}case"polyline":{const{paths:i,spatialReference:c}=l,u=i.map(e=>e.map(([e,t,a])=>new O({x:e,y:t,z:a,spatialReference:c}))),d=await Promise.all(u.map(async e=>this.getPixels(e,{feature:o,imageSize:h,mode:n}).then(e=>e.map(ue))));return new t({attributes:s,layer:e,symbol:r,geometry:new T({paths:d,spatialReference:x.WebMercator}),visible:e.visible&&a})}case"multipoint":{const{points:i,spatialReference:c}=l,u=i.map(([e,t,a])=>new O({x:e,y:t,z:a,spatialReference:c})),d=await this.getPixels(u,{feature:o,imageSize:h,mode:n}).then(e=>e.map(ue));return new t({attributes:s,layer:e,symbol:r,geometry:new G({points:d,spatialReference:x.WebMercator}),visible:e.visible&&a})}}return null}))).filter(i));this.overlayGraphicsOnImage(`${e.id}`,p)}getDepthAt(e){const{activeViewer:t,currentBestFeature:a,mode:i,state:r,depthImage:s}=this,o=t?.imageSize;if(!o||!a||"none"===i||r.includes("loading"))return u.getLogger(this).warnOnce("oriented-imagery-viewer:get-depth-at","Load an image to use depth"),null;if(!s?.loaded)return u.getLogger(this).error("oriented-imagery-viewer:get-depth-at","Depth image is not loaded"),this.emit("depth-image-service:not-loaded"),null;const n=(Array.isArray(e)?e:[e]).map(e=>s.depthAt(e,{width:o[0],height:o[1]})??null);return Array.isArray(e)?n:n[0]}async getPixels(e,t){const{imageSize:a,mode:i,feature:r}=t,s=(await this.worldToImage(Array.isArray(e)?e:[e],r)).map(e=>{if("default"===i)return new O({x:e.x-.5,y:.5-e.y,spatialReference:x.WebMercator});const[t,r]=a,{heading:s,pitch:o}=oe(e,t,r),n=ne(s,o);return new O(n,x.WebMercator)});return Array.isArray(e)?s:s[0]}async getMapPoint(e,t){const{feature:a,mode:i,imageSize:r}=t,{elevationSample:s,attributes:o}=a,{elevationSource:n,location:c,cameraHeight:l}=o;let h=c.clone();h.spatialReference.isGeographic&&(h=await j(h,x.WebMercator));const u=await le(c.spatialReference,c.z??0,l,{elevationSample:s,elevationSource:n,extent:this.footprintExtent});let d;"elevationSample"in u&&(a.elevationSample=u.elevationSample);const m=Array.isArray(e)?e:[e];if(this.depthImage?.loaded)for(const p of m){const e=this.getDepthAt(p);null!=e&&(p.depth=e)}if("default"===i){const e=ce(o,r[0],r[1]);d=await ee(m,{...e,cameraLocation:h},u)}else{const e=he(o,r[0],r[1]);d=await te(m,{...e,cameraLocation:h},u)}return Array.isArray(e)?d:d[0]}getActiveSectors(){return Ae.filter(e=>this._sectorData?.[e]?.length)}async plotMapPoint(e){return this.plotReferencePoint(e),this.transformAndPlotReferencePointOnImage({feature:this.currentBestFeature,selectedLocation:e,options:{signal:this._transformController?.signal}})}plotReferencePointOnGround(e){this._referencePointOnGround&&(this._overlays?.remove(this._referencePointOnGround),this._referencePointOnGround.destroy()),null!=e&&(this._referencePointOnGround=new t({geometry:new O({...e.toJSON()}),symbol:Qe}),this.view?this._overlays?.add(this._referencePointOnGround):this.emit("plot-ground-point",{data:{point:this._referencePointOnGround?.geometry}}))}plotReferencePointOnImage(e){if("image-loaded"===this.state)switch(this.clearReferencePointOnImage(),this.mode){case"default":{const a=A(e)?e.toJSON():e;a.x-=.5,a.y=.5-a.y,this._referencePointOnImage=new t({geometry:new O({spatialReference:this._imageViewer.imageRenderer.spatialReference,...a}),symbol:Qe}),this._imageViewer.addGraphic(this._referencePointOnImage,0);break}case"panoramic":{const{imageSize:a}=this._panoramicViewer;if(!a)return;const[i,r]=a,{heading:s,pitch:o}=oe(e,i,r),n=ne(s,o);this._referencePointOnImage=new t({geometry:new O(n,x.WebMercator),symbol:Xe}),this._panoramicViewer.addGraphic(this._referencePointOnImage,0);break}}}plotLocationPointOnImage(e,t=!1){if("image-loaded"===this.state)switch(this.clearLocationPointOnImage(t),this.mode){case"default":this._plotLocationPointOnDefaultImage(e,t);break;case"panoramic":this._plotLocationPointOnPanoramicImage(e,t)}}removeAllOverlayMapFeatures(){this.overlayedMapFeatures.forEach(e=>{this._imageViewer.removeManyGraphics(e.toArray())}),this.overlayedMapFeatures.clear()}removeOverlayedGraphicsOnImage(e){const t=this.overlayedMapFeatures.get(e);t?.length&&(this.activeViewer?.removeManyGraphics(t.toArray()),this.overlayedMapFeatures.delete(e))}reset(){const{mode:e}=this;"default"===e||"panoramic"===e?this.resetImage():"video"===e?this.resetVideo():"panoramic-video"===e&&this.resetVideoPanoramic(),this.beforeLoad(!1)}resetImage(){switch(this.setMessage("onLoadMessage","info"),this.mode){case"default":this._imageViewer.clearImage(),this._imageViewer.clearGraphics();break;case"panoramic":this._panoramicViewer.clearGraphics()}this._clickTask=p(this._clickTask)}resetVideo(){this.setMessage("onLoadMessage","info"),this.videoViewModel?.resetVideoHandler(),this._overlays?.removeAll(),this.videoViewModel=null,this.featureCache=[],this.currentBestFeature=null}resetVideoPanoramic(){this.setMessage("onLoadMessage","info"),this._overlays?.removeAll(),this.currentBestFeature=null}resetMeasurementData(){this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.heightMeasurementPixels=[],this.measurementVectors=[],this.heightMeasurementResult=0,this.tempDistance=null,this.measurementAngle=null,this.heightMeasurementAccuracy=0,this.heightGraphic=null,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedMeasurementGraphic=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaAccuracy=0}async saveDrawing(){const{dataCaptureLayer:e,sketchAdapter:t}=this;if(!e||"data-capture"!==t?.type)return;const{pendingGraphics:a,savedGraphics:i}=t,r=a.get(e.id),s=r?.toArray();if(!r||!s?.length)return;const{addFeatureResults:o}=await this.saveDataCaptureFeatures(s),n=o.reduce((t,{objectId:a,globalId:i,error:r},o)=>{const n=s[o],{attributes:c}=n;return r?t.error.push(n):(a&&(c[e.objectIdField]=a),i&&e.globalIdField&&(c[e.globalIdField]=i),t.success.push(n)),t},{success:[],error:[]});i.addMany(n.success),r.removeAll(),r.addMany(n.error)}async saveDataCaptureFeatures(e){const{activeViewer:t,currentBestFeature:a,dataCaptureLayer:r,mode:s}=this,o=t?.imageSize;if(!o||!a||"none"===s||"video"===s||"panoramic-video"===s)throw new n("orientedimageryviewer:missing-input","Image size, current best feature and mode are required to save data capture features");if(!r)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");const c=await Promise.all(e.map(async e=>{const t=e.clone(),{geometry:i}=t;if(!i)return;const n=i.type,c=r.hasZ,l=r.geometryType,h=n!==l,u=h?await import("./transformers.js"):null,d=u?.default[l],m=h?d?.(i):i;if(m)switch(m.type){case"point":return t.geometry=await this.getMapPoint(de(s,m,o),{feature:a,imageSize:o,mode:s}),c||(delete t.geometry.z,t.geometry.hasZ=!1),t.geometry.hasM=!1,t;case"polygon":{const e=await Promise.all(m.rings.map(async e=>this.getMapPoint(e.map(([e,t,a])=>de(s,{x:e,y:t,z:a},o)),{feature:a,imageSize:o,mode:s})));return t.geometry=new R({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,rings:e.map(e=>e.map(ue))}),t}case"polyline":{const e=await Promise.all(m.paths.map(async e=>this.getMapPoint(e.map(([e,t,a])=>de(s,{x:e,y:t,z:a},o)),{feature:a,imageSize:o,mode:s})));return t.geometry=new T({spatialReference:e[0][0].spatialReference,hasZ:c,hasM:!1,paths:e.map(e=>e.map(ue))}),t}}})),l=c.filter(i);return r.applyEdits({addFeatures:l}).then(e=>{const{addFeatureResults:t}=e;let a=0;const i=c.map(e=>{const i=t[a++];return e?i:{error:new n("orientedimageryviewer:save-unsucccessful","Error in saving data capture features"),objectId:null,globalId:null}});return{...e,addFeatureResults:i}})}async searchBestImage(e,t){try{const a=await U(e,t);a&&await this.processFeatureResponse(a,e.point,t)}catch(a){y(a)||(this.setMessage("imageLoadError","error",a.message),u.getLogger(this).error("error occurred while finding best image",a))}}selectTriangularMeasurementFeature(e){this.currentBestFeatureMeasurementImage=this.features?.find(({attributes:t})=>t.objectId===Number(e))}setAdditionalCameraLocationsVisibility(e){this.additionalCameraLocations.forEach(t=>{t.visible=e})}setAdditionalCoverageVisibility(e){this.additionalFootprints.forEach(t=>{t.visible=e})}setCurrentCoverageVisibility(e){this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.visible=e),this.currentBestFeatureLocation&&(this.currentBestFeatureLocation.visible=e)}setMapImageConversionToolState(e){this.mapImageConversionToolState=e}setCurrentPanoramaView(e,t){this._panoramicViewer?.set({yaw:e,pitch:t})}async startDataCapture(e,t){const a=this.activeViewer?.imageRenderer,{oiObjectIdField:i,currentBestFeature:r}=this;if(!a||!r||!i)return;const{attributes:{objectId:o}}=r,n=this.overlayedMapFeatures.get(e.id)?.toArray()??[],c=[],l=[];for(const s of n)`${s.getAttribute(i)}`==`${o}`?c.push(s):l.push(s);this.overlayGraphicsOnImage(e.id,new s(l)),this.collectionId=e.id;const h=await this.loadSketch(t),u=await this.loadDataCaptureAdapter(t);v(t),h.addGraphics(c),u.savedGraphics.addMany(c);a.ui.find("zoom").visible=!1,a.map.layers.add(this.sketchGraphicsLayer)}async stopDataCapture(e=!1){this.sketch?.cancel(),this.sketchGraphicsLayer?.removeAll(),this.sketchAdapter=m(this.sketchAdapter),this.sketch=m(this.sketch),this.collectionId=null;const{dataCaptureLayer:t}=this,a=this.activeViewer?.imageRenderer;if(!a||a.destroyed)return;a.map.layers.remove(this.sketchGraphicsLayer),e&&t&&await this.overlayMapFeatures(t,!0);const i=a.ui.find("zoom");i&&(i.visible=!0)}stopMeasurement(){this.heightMeasurementPixels=[],this.draw?.reset(),this.sketch?.cancel()}async toggleAllOverlayMapFeatures(e){!e&&this.dataCaptureLayer&&(await this.stopDataCapture(!0),this.dataCaptureLayer=null),this.overlayedMapFeatures.forEach(t=>{this._toggleVisiblity(t,e)})}toggleOverlayMapFeatures(e,t,a){const i=this.overlayedMapFeatures.get(e);i&&a&&this._toggleVisiblity(i,t)}toggleSelection(e){const{sketch:t}=this;t&&(t.updateOnGraphicClick=e,t.cancel())}async transformAndPlotReferencePointOnImage(e){const{feature:t,selectedLocation:a,options:i}=e;let r=!1,s=!1;const o=this.bestFeatureFootprint?.geometry;switch(o?.type){case"polygon":{const e=a.spatialReference.equals(o.spatialReference)?a:await j(a,o.spatialReference);r=o.contains(e);break}case"mesh":{const e=a.spatialReference.equals(o.spatialReference)?a:await j(a,o.spatialReference);s=o.extent.contains(e);break}}if(!r&&!s)return void this.clearReferencePointOnImage();const n=await this.worldToImage(a,t,i);if(n)return v(i),this.plotReferencePointOnImage(n),{x:n.x,y:n.y};this.clearReferencePointOnImage()}async triangulatedLocationWorkflow(e,t){if(this.currentBestFeature&&e){const{currentBestFeature:a}=this;this.triangulatedPoint&&(this.measurementVectors=[],this.triangulatedPoint=null,this.clearLocationPointOnImage(!0));const i=De(e,a);if(!i)return;this.measurementVectors.push(i),await this.plotReferenceLocationPoint(e,t),v(t),this._createTriangularImageLocationHandle()}}async updateFeatureCache(e,t){const a=await W(e,t);a.features?.length&&(this.featureCache=a.features)}async _calculateTriangulatedPointFromGroundPoint(e,t){if(this.currentBestFeatureMeasurementImage&&e){const{currentBestFeatureMeasurementImage:a,view:i}=this,r=De(e,a);r&&this.measurementVectors.push(r);let s=await Ne(this.measurementVectors);v(t),s?.spatialReference&&i?.spatialReference&&!s.spatialReference.equals(i.spatialReference)&&(s=await j(s,i.spatialReference)),this.triangulatedPoint=s??this.triangulatedPoint}}async _fetchFeatures(e,t){if(!this.view)return;const a=this.layer;if(a){const i={include:a},r=this.view.toScreen(e);if(!r)return;const s=await this.view.hitTest(r,i);return this._processHitTestResults(a,s,t)}}async _fetchFeaturesWithController(e,t){try{await this._fetchFeatures(e,t)}catch(a){if(y(a))return;this.setMessage("imageLoadError","error"),u.getLogger(this).error("error occurred while fetching features",a)}}_groupFeaturesBySectors(){const{_suitabilities:e,additionalFeatures:t,features:a,invalidCameraHeading:i}=this,r=a.at(0);if(!e||!t||!r||!a||i)return void(this._sectorData=null);this._sectorData={};const o={};this._featureToSector=o;for(const h of Ae)this._sectorData[h]=new s;const n=e.map((e,t)=>({...e,featureIndex:t}));n.sort((e,t)=>e.trueSuitability-t.trueSuitability);const c=n.map(({distance:e})=>e),l=Math.max(...c);n.forEach(e=>{const{distance:t,angle:i,featureIndex:s}=e,n=t/l*Le[2],c=ct(t,l),h=nt(i);if(!this._sectorData)return;const u=Le[3]+n*Math.sin(i*Math.PI/180),d=Le[3]+n*Math.cos(i*Math.PI/180);let m;const p=a.at(s),g=p===r,{cameraPitch:y}=p.attributes,v=y<5;if(g&&v)m=-90;else{const e=u-Le[3],t=d-Le[3],a=t/Math.sqrt(e**2+t**2);let i=180*Math.acos(a)/Math.PI;(e<0&&t<0||e<0&&t>0)&&(i*=-1),m=i}const f=""===c?h:`${c}_${h}`;g&&(m===this.bestFeatureAngle?this.previousFeatureAngle=m:this.bestFeatureAngle=m,this.navigatorCurrentBestFeature=v?null:{x:u,y:d,direction:h}),o[`${p.attributes.objectId}`]=f;const w=this._sectorData[f];w.add({angle:i,featureIndex:s,x:u,y:d,objectID:p.attributes.objectId,sector:f,featureIndexInSector:w.length})})}_handleDestroyedTriangularSketchLayer(){this.sketchTriangularGraphicsLayer&&this.activeTriangulatedViewer&&(this.activeTriangulatedViewer.imageRenderer.map.layers.remove(this.sketchTriangularGraphicsLayer),this.sketchTriangularGraphicsLayer=new D,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer),this.sketchTriangular&&(this.sketchTriangular.layer=this.sketchTriangularGraphicsLayer,this.sketchTriangular.view=this.activeTriangulatedViewer.imageRenderer))}_initializeMeasurementService(){this._measurementService||(this._measurementService=new wt(this))}_initializeSketchTriangular(){if(!this.activeTriangulatedViewer)return;const e="panoramic"===this.mode;this.sketchTriangular=new _t({view:this.activeTriangulatedViewer.imageRenderer,layer:this.sketchTriangularGraphicsLayer,updateOnGraphicClick:!1,defaultUpdateOptions:{toggleToolOnClick:!1,enableZ:!e}}),e&&(this.sketchTriangular.defaultUpdateOptions.reshapeOptions={edgeOperation:"offset",shapeOperation:"move-xy",vertexOperation:"move-xy"})}_initializeSketchTriangularGraphicsLayer(){this.activeTriangulatedViewer&&(this.sketchTriangularGraphicsLayer=new D,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer))}_initializeVideo(){if(this.videoElement||!this.currentBestFeature)return;this.removeHandles(Mt.videoPlayerHandles),this.videoElement=new fe({video:this.currentBestFeature.attributes.imagePath,georeference:new ye({extent:new L(Ce)}),autoplay:!1}),this.videoElement.content?.loop&&(this.videoElement.content.loop=!1);const e=new N({source:this.videoElement,title:this.layer?.title,copyright:this.layer?.copyright});this.videoLayer=e,e&&this.videoMapView.map.layers.add(e),this.addHandles(mt(this.videoMapView),Mt.videoPlayerHandles),this.videoViewModel=new yt({oiViewModel:this})}async loadPanoramicMediaSource(e,t){const{lookAt:a,...i}=e,r=lt(i);try{await r.load(t)}catch(o){if(y(o))return;"unsupported-type"===o.name&&this.setMessage("unsupportedPanoramicImageryError","error",void 0,{extension:r?.extension??"UNKNOWN FORMAT"})}const s=this.triangularMeasurementActive?this._panoramicMeasurementViewer:this._panoramicViewer;await s.loadMedia(r,t),a&&s.set(a)}async loadMediaSource(e,t){const a=ht(e);await this._setImageSource(this.triangularMeasurementActive?this.imageMeasurementViewer:this._imageViewer,a,t)}_plotLocationPointOnDefaultImage(e,a=!1){const i=A(e)?e.toJSON():e;i.x-=.5,i.y=.5-i.y,a?(this._correctedLocationPointOnImage=new t({geometry:new O({spatialReference:x.WebMercator,...i}),symbol:Ye}),this.imageMeasurementViewer.addGraphic(this._correctedLocationPointOnImage,0)):(this._locationPointOnImage=new t({geometry:new O({spatialReference:x.WebMercator,...i}),symbol:Ye}),this._imageViewer.addGraphic(this._locationPointOnImage,0))}_plotLocationPointOnPanoramicImage(e,a=!1){const i=a?this._panoramicMeasurementViewer:this._panoramicViewer,{imageSize:r}=i;if(!r)return;const[s,o]=r,{heading:n,pitch:c}=oe(e,s,o),l=ne(n,c),h=new t({geometry:new O(l,x.WebMercator),symbol:et});a?this._correctedLocationPointOnImage=h:this._locationPointOnImage=h,i.addGraphic(h,0)}_clearFeatureGeometries(){this.coveragePolygons.removeAll(),this.coverageFrustums.removeAll(),this.pointSources.removeAll()}_checkFeatures(e){return!!e?.length||(this.setMessage("noImageError","error"),this.videoElement?.content?.pause(),this.currentBestFeature=null,!1)}async _getElevationSampleFromGround(e,t,a){if(!e[0])return;const i=(await import("../../geometry/operators/unionOperator.js")).executeMany(e);if(this._updateFootprintWithFeatures(t,i),"3d"===this.view?.type)try{return await this.view.map.ground.createElevationSampler(this.footprintExtent,a)}catch(r){y(r)||u.getLogger(this).error(r)}}async processElevationSample(e,t,a){const{elevationSource:i}=t[0].attributes,r=await this._getElevationSampleFromGround(e,t,a);return r||(i&&this.footprintExtent&&Q(i)?await ie({extent:this.footprintExtent,lod:i.lod,url:i.url,rasterFunction:i.rasterFunction}):void 0)}_processSuitableFeatures(e,t){return q({features:e,selectedPoint:t,camera:ut(this.view)?this.view.camera:null,currentImage:this.currentBestFeature})}async _processHitTestResults(e,t,a){const{screenPoint:i,results:[r]}=t,s="graphic"===r?.type&&this.shouldShowSelectedImage,o=r?.mapPoint??this.view?.toMap(i);if(!o)return;o.x=E(o.x,o.spatialReference);const{layerFloorFilterClause:n}=this,c=e.spatialReference.equals(o.spatialReference)?o:await j(o,e.spatialReference),l=c.spatialReference.isGeographic?z(c):c,h=P("1=1",P(e.definitionExpression,n)),u=l.spatialReference.isGeographic?1:V(l.spatialReference),d={layerInstanceOrURL:e,point:l,queryParams:{where:h,maximumDistance:e.maximumDistance?e.maximumDistance/u:void 0,objectIds:s?[r.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(d,a)}async _queryAndLoadByObjectId(e,t,a,i){this.displayMessage=null;const{response:r}=await ft(e,t,a,i);if(v(i),!r?.features?.length)throw new vt(t);const s=$(r.features[0].attributes).polygon,o=O.fromJSON(B(s)),n=Y(o),c=V(n.spatialReference);this.selectedPoint=n;const l={layerInstanceOrURL:e,point:n,queryParams:{where:P(P("1=1",P(e.definitionExpression,a)),`${e.objectIdField} <> ${t}`),maximumDistance:e.maximumDistance?e.maximumDistance/c:void 0}},h=await U(l,i);v(i);const{features:u}=h;return u.push(r.features[0]),await this.processFeatureResponse(h,n,{...i,loadBestImage:!1})}_reorderTriangularSketchLayer(){const e=this.imageMeasurementViewer.imageRenderer.map.layers?.length;this.sketchTriangularGraphicsLayer&&e&&this.imageMeasurementViewer.imageRenderer.map.layers.reorder(this.sketchTriangularGraphicsLayer,e-1)}_resetCursor(){const{activeViewer:e,imageMeasurementViewer:t}=this;e&&this.removeHandles(Mt.activeViewerCursorHandles),t&&this.removeHandles(Mt.imageViewerCursorHandles)}async _setImageSource(e,t,a){e.media=t,await e.loadMedia(t,a)}_setMeasurementCursor(){const{activeViewer:e,imageMeasurementViewer:t,triangularMeasurementActive:a}=this;e&&this.addHandles(e.imageRenderer.acquireCursor("crosshair","high"),Mt.activeViewerCursorHandles),t&&a&&this.addHandles(t.imageRenderer.acquireCursor("crosshair","high"),Mt.activeViewerCursorHandles)}_toggleVisiblity(e,t){e.forEach(e=>{e.visible=t})}async _updateElevationOfSelectedPointAndLocations(e,t,a,i){const{location:r,cameraHeight:s}=e[0].attributes,o=await le(r.spatialReference,r.z,s,{elevationSample:a,elevationSource:a?void 0:e[0].attributes.elevationSource,extent:this.footprintExtent},i);v(i);const[n,...c]=await ae([t,...e.map(e=>e.attributes.geometry.clone())],o);v(i),t.elevation=n.z,e.forEach((e,t)=>{e.attributes.elevation=c[t].z})}_updateFeatures(e,t=!0){if(!e.length)return this.currentBestFeature=null,void this.additionalFeatures.removeAll();this.features.removeAll(),this.features.addMany(e),this.navigationNodes.removeAll(),this.navigationNodes.addMany(e.map(e=>{const{geometry:t,attributes:a}=e,{isSpherical:i,cameraHeading:r,cameraPitch:s}=a;return new gt({geometry:t,attributes:a,currentHeading:i?0:r,currentPitch:i?0:s})})),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this._updateGroundElevation=!0,t&&(this.currentBestFeature=e[0]),"video"===this.mode&&(this._initializeVideo(),this.videoElement?.loaded&&this.videoViewModel?.playVideoFromSelectedLocation(e[0])),"panoramic-video"===this.mode&&this._loadVideo()}_updateFootprintWithFeatures(e,t){const a=[];for(const{attributes:{geometry:i}}of e)t.contains(i)||a.push([i.x,i.y]);a.sort((e,t)=>+H([e,t])),t.addRing(a),this.footprintExtent=_e(t.extent,2,2)}async _updatePointsAndPolygons(e){const{pointSources:a,currentBestFeature:i,currentCoverageVisible:r,isAdditionalPointSourcesVisible:s,mode:o,layer:n}=this;if(i&&(this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.destroy(),this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null),!this.invalidCameraHeading)){await(this._adapter?.createFootprints(e)),v(e);for(const o of a){const a=this.view&&!this.view.spatialReference?.equals(o.spatialReference)?await j(o.clone(),this.view?.spatialReference,e):o.clone();o.imageID===i.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:o.imageID},geometry:a,symbol:tt,visible:r}):this.additionalCameraLocations.push(new t({attributes:{imageID:o.imageID},geometry:a,symbol:at,visible:s}))}"video"!==o&&"panoramic-video"!==o||!n||this.featureCache.length||await this.updateFeatureCache(n,i.geometry.spatialReference)}}_updateCurrentBestFeature(e){if(!e)return;if(this.currentBestFeature=this.features?.at(e.featureIndex),"video"===this.mode)return void(this.currentBestFeature&&this.videoViewModel?.playVideoFromSelectedLocation(this.currentBestFeature));if("panoramic-video"===this.mode)return void(this.currentBestFeature&&this._panoramicVideoViewer.viewModel.playPanoramicVideoFromSelectedLocation(this.currentBestFeature));const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let a;if(t)a=-90;else{const t=e.x-Le[3],i=e.y-Le[3],r=i/Math.sqrt(t**2+i**2);let s=180*Math.acos(r)/Math.PI;(t<0&&i<0||t<0&&i>0)&&(s*=-1),a=s}a===this.bestFeatureAngle?this.previousFeatureAngle=a:this.bestFeatureAngle=a,this.navigatorCurrentBestFeature=t?null:{x:e.x,y:e.y,direction:e.sector.includes("_")?e.sector.split("_")[1]:e.sector}}_updateImageMeasurementBestFeature(e){e&&(this.currentBestFeatureMeasurementImage=this.features?.at(e.featureIndex))}clearGraphics(){this._imageViewer.clearGraphics(),this._panoramicViewer.clearGraphics(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics()}clearReferencePointOnImage(){this._referencePointOnImage&&(this._imageViewer.removeGraphic(this._referencePointOnImage),this._panoramicViewer.removeGraphic(this._referencePointOnImage),this._referencePointOnImage=m(this._referencePointOnImage))}clearLocationPointOnImage(e=!1){this._locationPointOnImage&&!e&&(this._imageViewer.removeGraphic(this._locationPointOnImage),this._panoramicViewer.removeGraphic(this._locationPointOnImage),this._locationPointOnImage=m(this._locationPointOnImage)),this._correctedLocationPointOnImage&&(this.imageMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._panoramicMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._correctedLocationPointOnImage=m(this._correctedLocationPointOnImage))}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}async plotReferenceLocationPoint(e,t){if(this.currentBestFeatureMeasurementImage){const a=await this.worldToImage(e,this.currentBestFeatureMeasurementImage,{signal:t});v(t),a&&this.plotLocationPointOnImage(a,!0)}}setMessage(e,t,a,i){this.displayMessage={key:e,type:t,data:a,map:i}}async transformAndPlotSelectedLocation(e){const{currentBestFeature:t,invalidCameraHeading:a,selectedPoint:i,activeViewer:r}=this;if(this._crossSymbol&&(this._panoramicViewer.removeGraphic(this._crossSymbol),this._imageViewer.removeGraphic(this._crossSymbol),this._crossSymbol=m(this._crossSymbol)),!i||!t||"image-loaded"!==r?.state||a)return;let s;try{s=await this.worldToImage(i,t,e),v(e),await this.plotSelectedPointOnImage(s,e)}catch(o){y(o)||u.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:o,selectedPoint:i,feature:t})}}async worldToImage(e,t,a){const{footprintExtent:i}=this,{imageSize:r}=this.activeViewer;if("none"===this.mode||!t||!r||!i)return;const{attributes:{location:s,elevationSource:o,cameraHeading:n,cameraHeight:c},elevationSample:l}=t;let h=s.clone();const u=await le(s.spatialReference,s.z??0,c,{elevationSample:l,elevationSource:o});t.elevationSample=u.elevationSample;const d=Array.isArray(e)?e:[e];let m,p=await Promise.all(d.map(e=>new Promise(t=>{if(!e.hasZ)return t(ae(e,u));t(e)})));if(s.spatialReference.isGeographic&&(h=await j(h,x.WebMercator,a)),p=await Promise.all(p.map(async e=>h.spatialReference.equals(e.spatialReference)?e:await j(e,h.spatialReference,a))),v(a),"panoramic"===this.mode)m=ge(p,{imageHeight:r[1],imageWidth:r[0],cameraHeading:n,cameraLocation:h});else{const e=me(t.attributes,r[0],r[1]);m=pe(p,{...e,cameraLocation:h})}return Array.isArray(e)?m:m[0]}updateCurrentCoveragePolygon(e){const{additionalFootprints:a,additionalCameraLocations:i,currentBestFeature:r,currentBestFeatureLocation:s,currentCoverageVisible:o,selectedPoint:n,view:c,_adapter:l,mode:h}=this;if(!r)return;const{attributes:{objectId:u},elevationSample:d}=r;if(this._initialCurrentCoverageUpdate){if(this._overlays?.removeAll(),this._initialCurrentCoverageUpdate=!1,this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint),e&&!this.invalidCameraHeading&&(e.visible=o,this.bestFeatureCurrentFootprint=e),c){const e=[...a,...i,s].filter(dt);"3d"===c?.type&&d&&l?.updateGroundElevation&&(this._updateGroundElevation&&l.updateGroundElevation(e),"panoramic"===h&&l.updateGroundElevation([this.bestFeatureCurrentFootprint])),this._updateGroundElevation=!1,n&&(e.splice(-2,0,this.bestFeatureCurrentFootprint),e.push(new t({geometry:n.clone(),symbol:Ue.clone(),attributes:{imageID:u}}))),this._overlays.graphics.addMany(e)}}else if(c){if(this.invalidCameraHeading)return;this.bestFeatureCurrentFootprint&&(this._overlays?.remove(this.bestFeatureCurrentFootprint),this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint));const t=this.bestFeatureCurrentFootprint&&this._overlays?this._overlays.graphics.indexOf(this.bestFeatureCurrentFootprint):-1;e&&(this.bestFeatureCurrentFootprint=e,"3d"===c?.type&&d&&l?.updateGroundElevation&&"panoramic"===h&&l.updateGroundElevation([e]),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([S()],It.prototype,"activeLayer",null),e([S({readOnly:!0})],It.prototype,"activeViewer",null),e([S()],It.prototype,"activeTriangulatedViewer",null),e([S()],It.prototype,"accuracyParametersMissing",null),e([S()],It.prototype,"additionalFeatures",void 0),e([S({type:s.ofType(t)})],It.prototype,"additionalCameraLocations",void 0),e([S({type:s.ofType(t)})],It.prototype,"additionalFootprints",void 0),e([S()],It.prototype,"areaMeasurementResult",void 0),e([S()],It.prototype,"areaMeasurementAccuracy",void 0),e([S()],It.prototype,"bestFeatureAngle",void 0),e([S()],It.prototype,"bestFeatureCurrentFootprint",void 0),e([S({type:t})],It.prototype,"bestFeatureFootprint",void 0),e([S({type:Number})],It.prototype,"brightness",null),e([S()],It.prototype,"cameraHeadingThreshold",void 0),e([S()],It.prototype,"cameraPitchThreshold",void 0),e([S()],It.prototype,"clickAction",void 0),e([S()],It.prototype,"videoViewModel",void 0),e([S()],It.prototype,"collectionId",void 0),e([S({type:Number})],It.prototype,"contrast",null),e([S()],It.prototype,"conversionProps",void 0),e([S()],It.prototype,"coverageFrustums",void 0),e([S()],It.prototype,"coveragePolygons",void 0),e([S()],It.prototype,"currentBestFeature",void 0),e([S()],It.prototype,"currentBestFeatureMeasurementImage",void 0),e([S()],It.prototype,"currentBestFeatureLocation",void 0),e([S()],It.prototype,"currentCoverageVisible",void 0),e([S()],It.prototype,"currentNode",null),e([S()],It.prototype,"depthImage",void 0),e([S()],It.prototype,"depthImageNotSupported",null),e([S()],It.prototype,"featureCache",void 0),e([S()],It.prototype,"navigationNodes",void 0),e([S({json:{write:!1}})],It.prototype,"determineWorkflowForFeature",void 0),e([S({json:{write:!1}})],It.prototype,"determineWorkflowForTriangularMeasurement",void 0),e([S()],It.prototype,"disabled",void 0),e([S()],It.prototype,"displayMessage",void 0),e([S()],It.prototype,"displayNewMeasurementButton",void 0),e([S()],It.prototype,"distanceMeasurementResult",void 0),e([S()],It.prototype,"distanceAccuracyArray",void 0),e([S()],It.prototype,"dataCaptureLayer",void 0),e([S({readOnly:!0})],It.prototype,"featureCount",null),e([S()],It.prototype,"features",void 0),e([S()],It.prototype,"groundCoordinates",void 0),e([S()],It.prototype,"groundCoordinatesAccuracy",void 0),e([S()],It.prototype,"heightMeasurementPixels",void 0),e([S()],It.prototype,"heightGraphic",void 0),e([S()],It.prototype,"heightMeasurementResult",void 0),e([S()],It.prototype,"heightMeasurementAccuracy",void 0),e([S()],It.prototype,"measurementAngle",void 0),e([S()],It.prototype,"tempDistance",void 0),e([S({readOnly:!0})],It.prototype,"imageGalleryEnabled",null),e([S()],It.prototype,"imageGeometryField",void 0),e([S({readOnly:!0})],It.prototype,"imageLoaded",null),e([S()],It.prototype,"imageLocationToolState",void 0),e([S({readOnly:!0})],It.prototype,"invalidCameraHeading",null),e([S()],It.prototype,"imagePointsInView",null),e([S()],It.prototype,"imageMeasurementViewer",void 0),e([S()],It.prototype,"isAdditionalCoverageVisible",void 0),e([S()],It.prototype,"isAdditionalPointSourcesVisible",void 0),e([S()],It.prototype,"measurementVectors",void 0),e([S()],It.prototype,"layer",void 0),e([S()],It.prototype,"layerView",null),e([S({readOnly:!0})],It.prototype,"layerFloorFilterClause",null),e([S({type:Number})],It.prototype,"localPort",void 0),e([S()],It.prototype,"mapImageConversionToolState",void 0),e([S()],It.prototype,"measureType",void 0),e([S()],It.prototype,"measurementGraphic",void 0),e([S({readOnly:!0,value:"none"})],It.prototype,"mode",null),e([S()],It.prototype,"navigationMode",void 0),e([S()],It.prototype,"navigatorCurrentBestFeature",void 0),e([S()],It.prototype,"oiObjectIdField",void 0),e([S({type:s.ofType(t)})],It.prototype,"overlayedCameraLocations",void 0),e([S()],It.prototype,"overlayedMapFeatures",void 0),e([S()],It.prototype,"panoramicVideoLoaded",null),e([S()],It.prototype,"pixelCoordinates",void 0),e([S()],It.prototype,"preserveAngle",void 0),e([S()],It.prototype,"pointSources",void 0),e([S({readOnly:!0})],It.prototype,"popupEnabled",null),e([S()],It.prototype,"preloadMedia",void 0),e([S()],It.prototype,"preloadMediaSize",void 0),e([S()],It.prototype,"previousFeatureAngle",void 0),e([S()],It.prototype,"referencePoint",null),e([S({readOnly:!0})],It.prototype,"sectorData",null),e([S()],It.prototype,"selectedPoint",void 0),e([S({type:Number})],It.prototype,"sharpness",null),e([S()],It.prototype,"shouldShowSelectedImage",void 0),e([S()],It.prototype,"sketch",void 0),e([S()],It.prototype,"sketchTriangular",void 0),e([S()],It.prototype,"sketchTriangularGraphicsLayer",void 0),e([S()],It.prototype,"draw",void 0),e([S()],It.prototype,"sketchAdapter",void 0),e([S({readOnly:!0})],It.prototype,"sketchGraphicsLayer",null),e([S({readOnly:!0})],It.prototype,"state",null),e([S({readOnly:!0})],It.prototype,"thumbnails",null),e([S()],It.prototype,"triangularMeasurementActive",void 0),e([S()],It.prototype,"triangulatedDistanceMeasurement",void 0),e([S()],It.prototype,"triangulatedDistanceAccuracy",void 0),e([S()],It.prototype,"triangulatedAreaMeasurement",void 0),e([S()],It.prototype,"triangulatedAreaAccuracy",void 0),e([S()],It.prototype,"triangulatedMeasurementGraphic",void 0),e([S()],It.prototype,"triangulatedPoint",void 0),e([S()],It.prototype,"triangulatedMeasurementAdapter",void 0),e([S()],It.prototype,"updateFootprint",void 0),e([S()],It.prototype,"updateFootprintPanorama",void 0),e([S()],It.prototype,"updatingTriangularMeasurementState",void 0),e([S({value:null})],It.prototype,"view",null),e([S()],It.prototype,"videoElement",void 0),e([S()],It.prototype,"videoLayer",void 0),e([S()],It.prototype,"videoMapView",void 0),e([S()],It.prototype,"_adapter",void 0),e([S()],It.prototype,"_defaultGraphicsLayer",null),e([S()],It.prototype,"_highlightedFeatureHandle",void 0),e([S()],It.prototype,"_imageViewer",void 0),e([S()],It.prototype,"_initialCurrentCoverageUpdate",void 0),e([S()],It.prototype,"_locationPointOnImage",void 0),e([S()],It.prototype,"_measurementService",void 0),e([S()],It.prototype,"_mediaPrefetcher",void 0),e([S()],It.prototype,"_navigationManager",void 0),e([S()],It.prototype,"_correctedLocationPointOnImage",void 0),e([S()],It.prototype,"_overlays",void 0),e([S({readOnly:!0})],It.prototype,"_overlaysView",null),e([S()],It.prototype,"_panoramicVideoViewer",void 0),e([S()],It.prototype,"_panoramicViewer",void 0),e([S()],It.prototype,"_panoramicMeasurementViewer",void 0),e([S()],It.prototype,"_referencePointOnGround",void 0),e([S()],It.prototype,"_referencePointOnImage",void 0),e([S()],It.prototype,"_sectorData",void 0),e([S()],It.prototype,"_featureToSector",void 0),e([S({readOnly:!0})],It.prototype,"_updatingHandles",void 0),e([S()],It.prototype,"footprintExtent",void 0),e([S()],It.prototype,"_featureChangedTask",void 0),It=e([k("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],It);const Pt=It;export{Pt as default};
5
+ import{__decorate as e}from"tslib";import t from"../../Graphic.js";import{equals as i,isSome as a}from"../../core/arrayUtils.js";import{createTask as r}from"../../core/asyncUtils.js";import s from"../../core/Collection.js";import{deprecatedProperty as o}from"../../core/deprecate.js";import n from"../../core/Error.js";import{EventedMixin as c}from"../../core/Evented.js";import{makeHandle as l}from"../../core/handleUtils.js";import{equalsShallow as h}from"../../core/lang.js";import u from"../../core/Logger.js";import{clamp as d}from"../../core/mathUtils.js";import{destroyMaybe as m,abortMaybe as p}from"../../core/maybe.js";import{EsriPromise as g}from"../../core/Promise.js";import{isAbortError as y,throwIfAborted as v,waitTick as f}from"../../core/promiseUtils.js";import w from"../../core/ReactiveMap.js";import{whenOnce as _,on as F,watch as M,syncAndInitial as b,initial as I}from"../../core/reactiveUtils.js";import{sqlAnd as P}from"../../core/sql.js";import{getMetersPerUnitForSR as V}from"../../core/units.js";import{property as S,subclass as k}from"../../core/accessorSupport/decorators.js";import{isSerializable as C}from"../../core/support/jsonUtils.js";import{UpdatingHandles as A}from"../../core/support/UpdatingHandles.js";import T from"../../geometry/Extent.js";import L from"../../geometry/Point.js";import G from"../../geometry/Polyline.js";import{projectAsync as O}from"../../geometry/projectionUtils.js";import R from"../../geometry/SpatialReference.js";import{polygonCentroidPoint as j}from"../../geometry/support/centroid.js";import{isClockwise as B}from"../../geometry/support/coordsUtils.js";import{normalizeMapX as x}from"../../geometry/support/normalizeUtils.js";import{geographicToWebMercator as E}from"../../geometry/support/webMercatorUtils.js";import H from"../../layers/GraphicsLayer.js";import D from"../../layers/MediaLayer.js";import{searchImages as z,getSortedLayerFeatures as N}from"../../layers/orientedImagery/queries.js";import{calculateSuitabilities as U}from"../../layers/orientedImagery/core/bestImageUtils.js";import{createCoveragePolygon as q,computePolygonForInspection as W,resizePolygon as $,checkIfPolygonContainsSelectedPoint as J}from"../../layers/orientedImagery/core/coverageUtils.js";import{isElevationSource as Z}from"../../layers/orientedImagery/core/ElevationSourceDefinitions.js";import{convertGeographicToWebMercator as K,getMetersPerUnitOfSR as Q}from"../../layers/orientedImagery/core/utils.js";import{imageToWorld as X,imageToWorldPanoramic as Y}from"../../layers/orientedImagery/transformations/imageToWorld.js";import ee from"../../layers/orientedImagery/transformations/updateElevation.js";import{getElevationSampler as te}from"../../layers/orientedImagery/transformations/updateElevationUtils.js";import{or as ie,getInitialAngle as ae,convertPixelToHeadingPitch as re,convertHeadingPitchToSphereVertex as se,getImageToWorldProperties as oe,getImageToWorldPanoramicProperties as ne,getUpdateElevationProps as ce}from"../../layers/orientedImagery/transformations/utils.js";import{worldToImage as le,worldToImagePanoramic as he}from"../../layers/orientedImagery/transformations/worldToImage.js";import ue from"../../layers/support/ExtentAndRotationGeoreference.js";import{getFloorFilterClause as de}from"../../layers/support/floorFilterUtils.js";import me from"../../layers/support/VideoElement.js";import pe from"../../views/MapView.js";import ge from"../../views/draw/Draw.js";import{scale as ye}from"../../views/draw/support/drawUtils.js";import{ViewEventPriorities as ve}from"../../views/input/InputManager.js";import fe from"../PanoramicVideoViewer.js";import we from"../PanoramicViewer.js";import{defaultAngleThresholdInDegrees as _e,clockwiseDirections as Fe,videoExtent as Me,invalidCameraHeading as be,sectorsInOrder as Ie,sampleExtent as Pe,sectorsRadii as Ve}from"./constants.js";import{isFeatureAttachment as Se}from"./galleryUtils.js";import{getModeCorrectedPoint as ke,calculateCorrectedPixel as Ce,getUnitRateFromSpatialReference as Ae,calculateHeightFromTemporaryDistance as Te,getModeCorrectedPoints as Le,computeTriangulatedVector as Ge,computeTriangulatedPoint as Oe}from"./imageMeasurementUtils.js";import{crossSymbol as Re,crossSymbol3D as je,measurementPolygonSymbol as Be,polylineSymbolPanoramic as xe,measurementPolylineSymbol as Ee,cameraOverlaySymbol3D as He,cameraOverlaySymbol as De,diamondSymbol as ze,diamondSymbol3D as Ne,locationSymbol as Ue,locationSymbol3D as qe,activeSourcePointSymbol as We,sourcePointSymbol as $e}from"./symbols.js";import{isNoAttachmentError as Je,isTifOrMrf as Ze,filterOILLayerView as Ke,assignElevationSampleToFeatures as Qe,calculateDirection as Xe,calculateSegment as Ye,createPanoramicMedia as et,createNonPanoramicMedia as tt,isSceneView as it,isGraphic as at}from"./utils.js";import{disableVideoZoomAndPan as rt}from"./videoViewerUtils.js";import st from"./components/ImageViewer.js";import ot from"./components/NavigationNode.js";import nt from"./components/OrientedImageryVideoViewModel.js";import{NoFeatureFoundWithObjectIdError as ct}from"./navigation/errors.js";import{queryFeatureByObjectIds as lt}from"./navigation/queries.js";import{ImageMeasurementService as ht}from"./services/ImageMeasurementService.js";import{configureSketchTool as ut,extractFieldsFromDataCaptureLayer as dt,constructGraphicFromImageGeometry as mt}from"./support/dataCaptureUtils.js";import{imageSpaceToPoint as pt,removeZFromGeometry as gt}from"./support/geometryUtils.js";import yt from"./support/resolveMediaProps.js";import{isValidDataCaptureLayer as vt}from"./support/typeUtils.js";import ft from"../Sketch/SketchViewModel.js";const wt={click:"view-click",imageClick:"image-click",triangularImageClick:"triangular-click",interactionHandles:"interaction-handles",hittestHandles:"hittest-handles",videoPlayerHandles:"video-handles",activeViewerCursorHandles:"active-viewer-cursor-handles",imageViewerCursorHandles:"image-viewer-cursor-handles"},_t=()=>new n("orientedimageryviewer:sketch-not-initialized","Sketch property is not initialized, call loadSketch first");let Ft=class extends(c(g)){constructor(e){super(e),this._transformationService=null,this._referenceTransformationService=null,this.additionalFeatures=new s,this.additionalCameraLocations=new s,this.additionalFootprints=new s,this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.bestFeatureAngle=0,this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null,this.cameraHeadingThreshold=_e,this.cameraPitchThreshold=_e,this.clickAction="hittest",this.videoViewModel=null,this.collectionId=null,this.conversionProps=null,this.coverageFrustums=new s,this.coveragePolygons=new s,this.currentBestFeature=null,this.currentBestFeatureMeasurementImage=null,this.currentBestFeatureLocation=null,this.currentCoverageVisible=!0,this.depthImage=null,this.featureCache=[],this.navigationNodes=new s,this.determineWorkflowForFeature=async(e,t,i)=>{const{currentBestFeature:a,selectedPoint:r}=this;if(this.emit("popup-close"),a&&r){this._initialCurrentCoverageUpdate=!0,this._updateGroundElevation=!0;try{await this._updatePointsAndPolygons(i),await this._loadDepthImage(i),await this._loadImage(i)}catch(s){y(s)||(this.loadImageError(s),u.getLogger(this).error("#loadIImage()","error occured while loading image",s))}}},this.determineWorkflowForTriangularMeasurement=async(e,t,i)=>{if(this.emit("popup-close"),this.currentBestFeatureMeasurementImage&&this.selectedPoint)try{await this._loadMeasurementViewerImage(i)}catch(a){y(a)||(this.loadImageError(a),u.getLogger(this).error("#loadIImage()","error occured while loading image",a))}},this.disabled=!1,this.displayMessage={key:"onLoadMessage",type:"info"},this.displayNewMeasurementButton=!0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.dataCaptureLayer=null,this.features=new s,this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.heightMeasurementPixels=[],this.heightGraphic=null,this.heightMeasurementResult=0,this.heightMeasurementAccuracy=0,this.measurementAngle=null,this.tempDistance=null,this.imageGeometryField=null,this.imageLocationToolState=!1,this.imageMeasurementViewer=new st,this.isAdditionalCoverageVisible=!1,this.isAdditionalPointSourcesVisible=!1,this.measurementVectors=[],this.layer=null,this.localPort=null,this.mapImageConversionToolState=!1,this.measureType=null,this.measurementGraphic=null,this.navigatorCurrentBestFeature=null,this.oiObjectIdField=null,this.overlayedCameraLocations=new s,this.overlayedMapFeatures=new w,this.pixelCoordinates=null,this.preserveAngle="none",this.pointSources=new s,this.preloadMedia=!1,this.preloadMediaSize=5,this.previousFeatureAngle=0,this.selectedPoint=null,this.shouldShowSelectedImage=!1,this.sketch=null,this.sketchTriangular=null,this.sketchTriangularGraphicsLayer=null,this.draw=null,this.sketchAdapter=null,this.triangularMeasurementActive=!1,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedAreaAccuracy=0,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.triangulatedMeasurementAdapter=null,this.updateFootprint=async(e,t,i)=>{"default"===this.mode&&"image-loaded"!==this.state||this.mode.includes("video")&&!this.videoElement?.content||await(this._adapter?.updateFootprint(e,t,i))},this.updateFootprintPanorama=async(e,t)=>{await(this._adapter?.updateFootprintPanorama(e,t))},this.updatingTriangularMeasurementState=!1,this.videoElement=null,this.videoLayer=null,this.videoMapView=new pe({map:new Map}),this._adapter=null,this._highlightedFeatureHandle=null,this._imageViewer=new st,this._initialCurrentCoverageUpdate=!0,this._locationPointOnImage=null,this._measurementService=null,this._mediaPrefetcher=null,this._navigationManager=null,this._correctedLocationPointOnImage=null,this._overlays=new H({listMode:"hide",internal:!0,elevationInfo:{mode:"absolute-height"},title:"OrentedImageryViewerViewModel overlays layer"}),this._panoramicVideoViewer=new fe,this._panoramicViewer=new we,this._panoramicMeasurementViewer=new we,this._referencePointOnGround=null,this._referencePointOnImage=null,this._sectorData=null,this._featureToSector=null,this._updatingHandles=new A,this._clickTask=null,this._crossSymbol=null,this.footprintExtent=null,this._featureChangedTask=null,this._mediaPrefetchTask=null,this._suitabilities=null,this._transformController=new AbortController,this._updateFootprintTask=null,this._updateGroundElevation=!1,this.addUpdatingPromise=e=>this._updatingHandles.addPromise(e),this.filterCapturedFeatures=e=>{const t=this.currentBestFeature?.attributes.objectId,i=this.layer?.imageReferenceField;if(!t||!e||!i)return;const a=this.overlayedMapFeatures.get(e);a?.forEach(e=>{const a=e.attributes??{},r=Object.keys(a).find(e=>e.toLowerCase()===i.toLowerCase());(r?a[r]:null)!==t&&(e.visible=!e.visible)})},this.hideImageGeometry=e=>{},this.highlight=e=>{if(!this._overlaysView)return;this.removeHighlight();const t=this.additionalFootprints.find(({attributes:{imageID:t}})=>t===Number(e));this._highlightedFeatureHandle=t?this._overlaysView?.highlight(t):null},this.loadDataCaptureAdapter=async e=>{await this.loadSketch(e);const t=import("./adapters/sketch/DataCaptureAdapter.js"),{default:i}=await t;return v(e),this.sketchAdapter=new i({viewModel:this}),this.sketchAdapter},this.loadImageFromFeature=async(e,t,i)=>this._updatingHandles.addPromise(this._loadImageFromFeature(e,t,i)),this.storeImageMeasurementViewer=e=>{this.imageMeasurementViewer=e},this.storePanoramicMeasurementViewer=e=>{this._panoramicMeasurementViewer=e},this.loadImageViewer=e=>{this._imageViewer?.destroy(),this._imageViewer=e},this.loadPanoramicViewer=e=>{this._panoramicViewer?.destroy(),this._panoramicViewer=e},this.loadPanoramicVideoViewer=e=>{this._panoramicVideoViewer?.destroy(),this._panoramicVideoViewer=e},this.loadVideoViewer=e=>{this.videoMapView.container=e},this.showImageByObjectId=async(e,t)=>{const i=this.additionalFeatures.find(({attributes:t})=>t.objectId===e);if(i)this.currentBestFeature=i;else{const{layer:i,layerFloorFilterClause:r}=this;if(!i)return void this.setMessage("noLayerSelected","info");this.beforeLoad();const s=this._updatingHandles.addPromise(this._queryAndLoadByObjectId(i,e,r,t));try{await s,await this.selectBestFeature(e,t)}catch(a){y(a)||(u.getLogger(this).error("oriented-imagery-viewer:show-image",a),"NoFeatureFoundWithObjectIdError"===a.name?this.setMessage("noFeatureFoundWithObjectId","error","",{objectId:e}):this.setMessage("imageLoadError","error",a.message))}}},this.imageToImageTransform=async(e,t,i)=>{const{updateElevationProps:a,...r}=t,{updateElevationProps:s,...o}=i,n=await X(e,r,a);return le(n,o)},this.imageToImageTransformPanoramic=async(e,t,i)=>{const{updateElevationProps:a,...r}=t,{updateElevationProps:s,...o}=i,n=await Y(e,r,a);return he(n,o)},this.getSectorFeatureById=e=>this._suitabilities?.find(({feature:{attributes:{objectId:t}}})=>t===e),this.getFeatureSectorById=e=>this._featureToSector?.[`${e}`],this.navigate=async(e,t)=>{const{mode:i}=this;if("default"!==i&&"panoramic"!==i)throw new n("NavigationError","Navigation is only supported in 'default' and 'panoramic' modes.");const a=e=>"default"===i&&e.declaredClass.endsWith("NavigationManager")||"panoramic"===i&&e.declaredClass.endsWith("NavigationManagerPanoramic");if(null==this._navigationManager||!a(this._navigationManager)){m(this._navigationManager);const e="default"===i?import("./navigation/NavigationManager.js"):import("./navigation/NavigationManagerPanoramic.js");this._navigationManager=new(await e).default({viewModel:this})}return this._navigationManager.navigate(e,t)},this.removeHighlight=()=>this._highlightedFeatureHandle?.remove(),this.revealImageGeometry=e=>{},this.selectBestFeature=async(e,t)=>(v(t),this.currentBestFeature=this.features?.find(({attributes:t})=>`${t.objectId}`==`${e}`),_(()=>"image-loaded"===this.state,t)),this.toggleImageAttributes=()=>{const{currentBestFeature:e,popupEnabled:i,layer:a,view:r}=this;if(this.emit("popup-close"),!(r&&e&&i&&a))return;const{attributes:s,geometry:o}=e,n=new t({geometry:o,attributes:s.toJSON(),layer:a,sourceLayer:a});this.emit("popup-open",{features:[n],location:s.location.clone()})},this.updateSuitabilities=(e,t=!0)=>{e.sort((e,t)=>e.suitability-t.suitability),this._suitabilities=e;const i=this._suitabilities.map(({feature:e})=>e);this._initialCurrentCoverageUpdate=!0,this._updateFeatures(i,t),this._groupFeaturesBySectors()},this._createViewClickHandle=()=>{if(this.removeHandles(wt.click),this.disabled||null==this.view)return;const e=this.mapImageConversionToolState&&"image-loaded"===this.state?this._mapImageConversionToolViewClickHandler:this._viewClickHandler;this.addHandles(this.view.on("click",e,ve.DEFAULT),wt.click)},this._createImageClickHandle=()=>{this.removeHandles(wt.imageClick);const{mapImageConversionToolState:e,mode:t,activeViewer:i,currentBestFeature:a,footprintExtent:s}=this,o=i?.imageSize;if(!(e&&"none"!==t&&o&&s&&a))return;const n=i.clickAction;this.clickAction="pixel-location";const c=l(()=>{this.clickAction=n});let h=null;const u=F(()=>i,"pixel-location",e=>{this.plotReferencePointOnImage(e),h?.abort(),h=r(async t=>{if(!e)return;const i=await this._transformationService.pixelToMapPoint(e).then(e=>{const t=this.view?.spatialReference;return ie(!t,e.spatialReference.equals(t))?e:O(e,t)});v(t),this.plotReferencePointOnGround(i)})});this.addHandles([u,c],wt.imageClick)},this._createTriangularImageClickHandle=()=>{this.removeHandles(wt.triangularImageClick),this.triangularMeasurementActive&&"none"!==this.mode&&this.currentBestFeature&&this.currentBestFeatureMeasurementImage&&this.activeTriangulatedViewer&&this.addHandles(this.activeTriangulatedViewer.imageRenderer.on("double-click",this._measurementImageClickHandler),wt.triangularImageClick)},this._createTriangularImageLocationHandle=()=>{this.removeHandles(wt.triangularImageClick);const{imageLocationToolState:e,mode:t,activeTriangulatedViewer:i}=this,a=i?.imageSize;if(!e||"none"===t||!a)return;this.clickAction="pixel-location";let s=null;const o=F(()=>i,"pixel-location",e=>{1===this.measurementVectors.length&&(this.plotLocationPointOnImage(e,!0),s?.abort(),s=r(async t=>{if(!e||this.triangulatedPoint||2===this.measurementVectors?.length||!this.currentBestFeatureMeasurementImage)return;let i=await this._transformationService.pixelToMapPoint(e);v(t);const a=this.view?.spatialReference;a&&!i.spatialReference.equals(a)&&(i=await O(i,a),v(t)),await this._calculateTriangulatedPointFromGroundPoint(i,{signal:t}),v(t)}))});this.addHandles(o,wt.triangularImageClick)},this._createImageLocationHandle=()=>{this.removeHandles(wt.imageClick);const{imageLocationToolState:e,mode:t,activeViewer:i,currentBestFeature:a,footprintExtent:s}=this,o=i?.imageSize;if(!(e&&"none"!==t&&o&&s&&a))return;this.clickAction="pixel-location";let n=null;const c=F(()=>i,"pixel-location",e=>{const{currentBestFeatureMeasurementImage:i,triangularMeasurementActive:a,activeTriangulatedViewer:s}=this;this.pixelCoordinates=e;const o=null!=i&&!s?.state.includes("loading");ie(!a,o)&&this.plotLocationPointOnImage(e),n?.abort(),n=r(async i=>{if(!e)return;let r=await this._transformationService.pixelToMapPoint(e);v(i);const s=this.view?.spatialReference;s&&!r.spatialReference.equals(s)&&(r=await O(r,s),v(i)),this.groundCoordinates=r,a&&r&&o&&await this.triangulatedLocationWorkflow(r,i);const n=await this.calculateLocationAccuracy(e,r,t,i);v(i),n&&(this.groundCoordinatesAccuracy=n)})});this.addHandles(c,wt.imageClick)},this._handleImageHitTestResponse=async e=>{const{layer:t,overlayedCameraLocations:i}=this;if(!t)return;const a=e.results.find(({graphic:e,graphic:{attributes:a}})=>i.includes(e)&&a&&!a[t.imageReferenceField]&&!a[t.imageGeometryField]);if(!a)return;const r=a.graphic.attributes[t.objectIdField];await this.showImageByObjectId(r)},this._loadDepthImage=async e=>{const{currentBestFeature:t,layer:i,depthImageNotSupported:a}=this;if(this.depthImage?.destroy(),this.depthImage=null,!i||!t||a)return;const{depthImage:r}=t.attributes;if(!r)return;const s=(await import("./services/DepthImageService.js")).default;v(e),this.depthImage=new s({url:r});try{await this.depthImage.load(e)}catch(o){y(o)||(u.getLogger(this).error("error occurred while loading depth image",o),this.depthImage?.destroy(),this.depthImage=null)}},this._loadImage=async e=>{const{currentBestFeature:t,layer:i,mode:a}=this;if(this.clearGraphics(),i&&t&&"none"!==a&&"video"!==a&&"panoramic-video"!==a)try{await this.loadImageFromFeature(i,t,e),v(e),await this.transformAndPlotSelectedLocation(e)}catch(r){y(r)||this.loadImageError(r)}},this._loadVideo=async e=>{const{currentBestFeature:t,layer:i,mode:a,selectedPoint:r}=this,s=t?.attributes.imagePath;if(!i||!t||"panoramic-video"!==a||!s)return;const{attributes:o}=t,{cameraPitch:n,cameraOrientation:c,location:l}=o,h=l.spatialReference.isWGS84&&4!==c?.type?E(l):new L(l);try{this._panoramicVideoViewer.viewModel.video&&this._panoramicVideoViewer.viewModel.video.pause(),this._panoramicVideoViewer.videoSource=s;let t=0;h&&r&&(t=await ae(h,r)-t),this._panoramicVideoViewer.pitch=n??0,this._panoramicVideoViewer.yaw=t,await this._panoramicVideoViewer.loadVideo(e),v(e)}catch(u){y(u)||this.loadImageError(u)}},this._loadImageFromFeature=async(e,t,i)=>{const{mode:a}=this;if("default"!==a&&"panoramic"!==a)return;let r;try{r=await yt(t.attributes,e,i),v(i)}catch(f){if(y(f))return;return Je(f)?(u.getLogger(this).error(f),void this.setMessage("noAttachment","error",`${e.objectIdField}: ${t.attributes.objectId}`)):(u.getLogger(this).error(f,{[e.objectIdField]:t.attributes.objectId,layer:e}),void this.setMessage("imageLoadError","error",`query-attachments-failed:${e.objectIdField} ${t.attributes.objectId}`))}if(!r)return;const{mediaUrl:s,datasetFormat:o,rotation:n,searchParams:c,location:l,cameraHeading:h,matrix:d,cameraPitch:m,getDataSetFormatError:p}=r,g=`${t.attributes.objectId}`;try{let r=this._mediaPrefetcher?.getCachedMedia(g);if(!r){const i=this.navigationNodes.find(e=>e.id===t.attributes.objectId);if(i){try{await(this._mediaPrefetcher?.startPrefetchForNode(i,e))}catch(w){}r=this._mediaPrefetcher?.getCachedMedia(g)}}if(r){if("panoramic"===a){const e=this.triangularMeasurementActive?this._panoramicMeasurementViewer:this._panoramicViewer;let a=0;return l&&this.selectedPoint&&(a=await ae(l,this.selectedPoint)-a),await e.loadMedia(r,i),this.selectedPoint?e.set({yaw:a,pitch:m}):"viewAngle"in t.attributes&&Number.isFinite(t.attributes.viewAngle)&&e.set({yaw:t.attributes.viewAngle,pitch:m}),void(this.triangularMeasurementActive?await this.initializeReferenceTransformationService(i):await this.initializeTransformationService(i))}return await this._setImageSource(this.triangularMeasurementActive?this.imageMeasurementViewer:this._imageViewer,r,i),void(this.triangularMeasurementActive?await this.initializeReferenceTransformationService(i):await this.initializeTransformationService(i))}}catch(w){}p&&u.getLogger(this).warn("error occurred while getting dataset format",p),"panoramic"===a?await this.loadPanoramicMediaSource({lookAt:{yaw:this.selectedPoint?await ae(l,this.selectedPoint):"viewAngle"in t.attributes&&Number.isFinite(t.attributes.viewAngle)?t.attributes.viewAngle:0,pitch:m},extension:o?.toUpperCase(),url:s,cameraHeading:h,matrix:d},i):await this.loadMediaSource({datasetFormat:o?.toUpperCase(),url:s,customParameters:c,rotation:n},i),this.triangularMeasurementActive?await this.initializeReferenceTransformationService(i):await this.initializeTransformationService(i)},this._loadMeasurementViewerImage=async e=>{const{currentBestFeatureMeasurementImage:t,layer:i,mode:a}=this;if(this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics(),i&&t&&"none"!==a&&"video"!==a&&"panoramic-video"!==a)try{await this.loadImageFromFeature(i,t,e),v(e)}catch(r){y(r)||this.loadImageError(r)}},this._loadMediaPrefetcher=async e=>{if(!this._mediaPrefetcher){const{default:t}=await import("./support/MediaPrefetcher.js");v(e),this._mediaPrefetcher=new t({maxEntries:this.preloadMediaSize*Fe.length})}return this._mediaPrefetcher},this._loadViewAdapter=async e=>{const{view:t}=this;if(t)switch(t.type){case"2d":{const{default:t}=await import("./adapters/view/MapViewAdapter.js");v(e),this._adapter=new t(this);break}case"3d":{const{default:t}=await import("./adapters/view/SceneViewAdapter.js");v(e),this._adapter=new t(this);break}}else this._adapter=null},this._mapImageConversionToolViewClickHandler=e=>{if(e.stopPropagation(),e.preventDefault(),e.mapPoint){const t=e.mapPoint;t.x=x(t.x,t.spatialReference),this.plotMapPoint(e.mapPoint)}},this._measurementImageClickHandler=e=>{e.stopPropagation(),e.preventDefault();const{sketchTriangular:t,triangularMeasurementActive:i,currentBestFeatureMeasurementImage:a,triangulatedMeasurementGraphic:r}=this;t&&i&&a&&r&&"active"!==t.state&&(t.update([r],{tool:"reshape"}),this.updatingTriangularMeasurementState=!0)},this._viewClickHandler=e=>{this._clickTask?.abort(),this._clickTask=r(async t=>{const{pointerType:i,button:a,mapPoint:r}=e;if(("mouse"!==i||0===a)&&r)return e.stopPropagation(),e.preventDefault(),this._updatingHandles.addPromise(this.loadBestImage(r,{signal:t}))})},this.plotSelectedPointOnImage=async(e,i)=>{if(await f(i),!e)return;const a=new L({...C(e)?e.toJSON():e});if("default"===this.mode)a.x-=.5,a.y=.5-a.y,a.spatialReference=this._imageViewer.imageRenderer.spatialReference.clone(),this._crossSymbol=new t({geometry:a,symbol:Re}),this._imageViewer.addGraphic(this._crossSymbol,0);else if("panoramic"===this.mode){const{imageSize:i}=this._panoramicViewer;if(!i)return;const[a,r]=i,{heading:s,pitch:o}=re(e,a,r),n=se(s,o);this._crossSymbol=new t({geometry:new L(n,R.WebMercator),symbol:je}),this._panoramicViewer.addGraphic(this._crossSymbol,0)}},this.handleSectorClick=this.handleSectorClick.bind(this),this.searchBestImage=this.searchBestImage.bind(this),this.transformAndPlotReferencePointOnImage=this.transformAndPlotReferencePointOnImage.bind(this)}async initializeReferenceTransformationService(e){const{currentBestFeatureMeasurementImage:t,activeTriangulatedViewer:i,mode:a}=this;if(!t||!i||!i.imageSize||"panoramic"!==a&&"default"!==a)return;const{imageSize:r}=i,{attributes:s,elevationSample:o}=t,{location:{spatialReference:n,z:c},cameraHeight:l,elevationSource:h}=s;let u=s.location;u.spatialReference.isGeographic&&(u=K(u));const d="default"===a?oe(s,r[0],r[1]):ne(s,r[0],r[1]),m=await ce(n,c??0,l,{elevationSample:o,elevationSource:h,extent:this.footprintExtent},e),p=(await import("./services/TransformationService.js")).default,g={imageToWorldProperties:d,updateElevationProps:m,mode:a,imageSize:r,depthImageService:this.depthImage};this._referenceTransformationService=new p(g)}async initializeTransformationService(e){const{currentBestFeature:t,activeViewer:i,mode:a}=this;if(!t||!i||!i.imageSize||"panoramic"!==a&&"default"!==a)return;const{imageSize:r}=i,{attributes:s,elevationSample:o}=t,{location:{spatialReference:n,z:c},cameraHeight:l,elevationSource:h}=s;let u=s.location;u.spatialReference.isGeographic&&(u=K(u));const d={..."default"===a?oe(s,r[0],r[1]):ne(s,r[0],r[1]),cameraLocation:u},m=await ce(n,c??0,l,{elevationSample:o,elevationSource:h,extent:this.footprintExtent},e),p=(await import("./services/TransformationService.js")).default,g={imageToWorldProperties:d,updateElevationProps:m,mode:a,imageSize:r,depthImageService:this.depthImage};this._transformationService=new p(g)}initialize(){this.addHandles([M(()=>this.view,()=>this.load(),b),M(()=>this.view?.map,(e,t)=>{t?.layers.remove(this._overlays),e?.layers.add(this._overlays)},I),M(()=>this.view?.map?.allLayers?.length,e=>{e&&this.view?.map?.layers.reorder(this._overlays,e-1)},I),M(()=>[this.state,this.mapImageConversionToolState,this.view,this.disabled],()=>{this._createViewClickHandle(),this._createImageClickHandle()},b),M(()=>[this.triangularMeasurementActive,this.currentBestFeatureMeasurementImage],()=>{this._createTriangularImageClickHandle()},b),M(()=>[this.state,this.imageLocationToolState,this.view],(e,t)=>{if(this._initializeMeasurementService(),this._createImageLocationHandle(),!this.imageLocationToolState)return this.clearPreviousGroundLocation(),void this._resetCursor();e[1]!==t?.[1]&&this._setMeasurementCursor()},b),M(()=>this.measureType,()=>{this.clearPreviousMeasurements(),this._initializeMeasurementService()},b),M(()=>this.bestFeatureAngle,(e,t)=>{this.previousFeatureAngle=t??0},b),M(()=>this.currentBestFeature,async(e,t)=>{p(this._featureChangedTask),this._featureChangedTask=r(async i=>this.determineWorkflowForFeature.apply(this,[e,t,{signal:i}])),await this._featureChangedTask.promise},{sync:!0}),M(()=>[this.currentNode,this.preloadMedia,this.navigationMode],()=>{this._mediaPrefetchTask?.abort(),this._mediaPrefetchTask=r(async e=>{this.preloadMedia?(this._mediaPrefetcher??=await this._loadMediaPrefetcher({signal:e}),v(e),this._mediaPrefetcher.enqueueDirectionalPrefetch(this.layer,this.currentNode,this.preloadMediaSize)):this._mediaPrefetcher?.clear()})},b),M(()=>this.currentBestFeatureMeasurementImage,(e,t)=>{p(this._featureChangedTask),t&&e!==t&&(this.measurementVectors=[],this.triangulatedPoint=null,this.sketchTriangularGraphicsLayer?.graphics.destroyAll()),this._featureChangedTask=r(async i=>{await this.determineWorkflowForTriangularMeasurement(e,t,{signal:i}),v(i),this._reorderTriangularSketchLayer()})},b),M(()=>this.triangularMeasurementActive,(e,t)=>{t&&!e&&(this.measurementVectors=[],this.currentBestFeatureMeasurementImage=null,this.triangulatedDistanceMeasurement=null,this.triangulatedMeasurementGraphic=null,this.triangulatedPoint=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaAccuracy=0,this.sketchTriangularGraphicsLayer?.graphics.destroyAll(),this.clearReferencePointOnImage(),this.imageMeasurementViewer.clearImage(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearImage(),this._panoramicMeasurementViewer.clearGraphics())}),M(()=>this.mode,e=>{switch(this.removeHandles(wt.interactionHandles),e){case"default":this.addHandles(M(()=>{const{state:e}=this;return"image-loaded"===e?this._imageViewer.imagePointsInView:null},e=>{e&&(p(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e,void 0,{signal:t})}))},{...b,equals:(e,t)=>i(e,t,h)}),wt.interactionHandles);break;case"video":this.addHandles(M(()=>{const{footprintExtent:e,videoElement:t,bestFeatureFootprint:i}=this;if(e&&t?.loaded&&i)return{videoExtent:Me,bestFeatureFootprint:i}},e=>{e?.videoExtent&&e?.bestFeatureFootprint&&(p(this._updateFootprintTask),this._updateFootprintTask=r(async t=>{await this.updateFootprint(e.videoExtent,void 0,{signal:t})}))},{...b,equals:(e,t)=>i(e?.videoExtent,t?.videoExtent,h)&&e?.bestFeatureFootprint===t?.bestFeatureFootprint}),wt.interactionHandles);break;case"panoramic":this.addHandles(M(()=>{const{currentBestFeature:e,state:t,_panoramicViewer:i}=this,{imageSize:a,vfov:r,hfov:s,pitch:o,yaw:n}=i;return e&&a&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o]:null},e=>{if(!e||this.state.includes("loading"))return;const[t,i,a,s]=e;this.currentNode&&(this.currentNode.currentHeading=a,this.currentNode.currentPitch=s),p(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:i,yaw:a,pitch:s},{signal:e}),this._updateFootprintTask=null})},{equals:(e,t)=>i(e,t,h)}),wt.interactionHandles);break;case"panoramic-video":this.addHandles(M(()=>{const{currentBestFeature:e,state:t,_panoramicVideoViewer:i}=this,{imageSize:a,vfov:r,hfov:s,pitch:o,yaw:n,viewModel:c}=i,l=c.closestFeature??e;return l&&a&&!t.includes("loading")&&null!=r&&null!=s&&null!=o&&null!=n?[r,s,n,o,l]:null},e=>{if(!e)return;const[t,i,a,s,o]=e;p(this._updateFootprintTask),this._updateFootprintTask=r(async e=>{await this.updateFootprintPanorama({verticalFieldOfView:t,horizontalFieldOfView:i,yaw:a,pitch:s,feature:o},{signal:e}),v(e),this._updateFootprintTask=null})},{equals:(e,t)=>i(e,t,h)}),wt.interactionHandles)}},b),M(()=>[this.brightness,this.contrast,this.sharpness],()=>{const{_imageViewer:e,brightness:t,contrast:i,mode:a,sharpness:r}=this;"default"===a&&(e.brightness=t,e.contrast=i,e.sharpness=r)},b),M(()=>this.activeViewer?.imageRenderer,()=>{this.sketch&&(this.sketch.view=this.activeViewer?.imageRenderer)}),M(()=>this.activeViewer,e=>{this.removeHandles(wt.hittestHandles),e&&this.addHandles(F(()=>e,"hittest-response",this._handleImageHitTestResponse),wt.hittestHandles)})]),this.when().finally(()=>{this.notifyChange("state")})}destroy(){this.currentBestFeature=null,this._updateFootprintTask=p(this._updateFootprintTask),this._clickTask=p(this._clickTask),this.coverageFrustums.destroy(),this.coveragePolygons.destroy(),this.pointSources.destroy(),this.additionalFootprints.destroy(),this.additionalCameraLocations.destroy(),this.bestFeatureFootprint=m(this.bestFeatureFootprint),this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint),this.videoViewModel=m(this.videoViewModel),this._crossSymbol=m(this._crossSymbol),this._referencePointOnGround=m(this._referencePointOnGround),this._referencePointOnImage=m(this._referencePointOnImage),this._locationPointOnImage=m(this._locationPointOnImage),this._overlays&&this.view?.map?.remove(this._overlays),this._overlays.destroy(),this._imageViewer.destroy(),this.imageMeasurementViewer.destroy(),this._panoramicViewer.destroy(),this._panoramicMeasurementViewer.destroy(),this._mediaPrefetcher?.destroy()}get activeLayer(){return o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){o(u.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeViewer(){const{_imageViewer:e,_panoramicViewer:t,mode:i}=this;switch(i){case"default":return e;case"panoramic":return t;default:return null}}get activeTriangulatedViewer(){switch(this.mode){case"default":return this.imageMeasurementViewer;case"panoramic":return this._panoramicMeasurementViewer;default:return null}}get accuracyParametersMissing(){return this.layer?.orientationAccuracy?.every(e=>0===e)??!0}get brightness(){return this._get("brightness")??0}set brightness(e){this._set("brightness",d(e,-10,10))}get contrast(){return this._get("contrast")??0}set contrast(e){this._set("contrast",d(e,-10,10))}get currentNode(){const{currentBestFeature:e,navigationNodes:t}=this;return t.find(t=>t.id===e?.attributes.objectId)}get depthImageNotSupported(){if(this.currentBestFeature?.attributes.depthImage)return!Ze(this.currentBestFeature.attributes.depthImage)}get featureCount(){return this.features?.length??0}get imageGalleryEnabled(){const{currentBestFeature:e}=this;if(!e)return!1;const t=e.attributes.imagePath?.trim();return Ze(t)||Se(t)}get imageLoaded(){return o(u.getLogger(this),"imageLoaded",{replacement:'Use OrientedImageryViewer.state === "image-loaded"',version:"4.29",warnOnce:!0}),"image-loaded"===this.state}get invalidCameraHeading(){return this.currentBestFeature?.attributes?.cameraHeading===be}get imagePointsInView(){const{mode:e,_imageViewer:t}=this;return"default"===e?t.imagePointsInView:null}get layerView(){const{layer:e,view:t}=this;if(e&&t)return t.allLayerViews.find(Ke(e))}get layerFloorFilterClause(){const{layerView:e}=this;return e?de(e):null}get mode(){const e=this.currentBestFeature?.attributes;if(!e)return"none";const t=e.orientedImageryType;if(t?.includes("video"))return t.includes("360")?"panoramic-video":"video";const{horizontalFieldOfView:i,isSpherical:a}=e;return 360===i||a?"panoramic":"default"}get panoramicVideoLoaded(){const{mode:e,_panoramicVideoViewer:t}=this,{videoLoaded:i}=t.viewModel;return("panoramic-video"===e&&!0===i)??!1}get popupEnabled(){return!0===this.layer?.popupEnabled}get referencePoint(){return this._referencePointOnGround?.geometry}get sectorData(){const{_sectorData:e}=this;return e?Ie.map(t=>e[t]):null}get sharpness(){return this._get("sharpness")??0}set sharpness(e){this._set("sharpness",d(e,0,1))}get sketchGraphicsLayer(){const{sketch:e}=this;return"graphics"===e?.layer?.type?e.layer:void 0}get state(){const{mode:e,_updatingHandles:{updating:t},_featureChangedTask:i}=this;if(!this.isFulfilled()||t||!1===i?.finished)return"loading";if(this.isRejected())return"error";if("error"===this.displayMessage?.type)return"image-load-error";switch(e){case"default":return this._imageViewer.state;case"panoramic":return this._panoramicViewer.state;case"video":return this.videoElement?.loaded?"video-loaded":"video-not-loaded"}return"ready"}get thumbnails(){const{features:e}=this;return e?new s(e.map(({attributes:{imagePath:e,objectId:t,cameraRoll:i,imageRotation:a}})=>{const r=e?.trim();return Ze(r)||Se(r)?{url:r,objectId:t,rotation:(i??0)+(a??0)}:null}).filter(a)):null}set view(e){this._set("view",e)}get _defaultGraphicsLayer(){const e={blendMode:"source-atop"};switch(this.mode){case"panoramic":return new H({...e,elevationInfo:{mode:"absolute-height"}});case"default":return new H({...e});default:return}}get _overlaysView(){return this.view?.layerViews.find(({layer:e})=>e===this._overlays)}beforeLoad(e=!0){this.emit("popup-close"),e&&(this.displayMessage=null),this.clearPreviousGroundLocation(),this.triangularMeasurementActive=!1,this.currentBestFeatureMeasurementImage=null,this.measureType=null,this.imageLocationToolState=!1,this.features.removeAll(),this.currentBestFeature=null,this.additionalFeatures.removeAll(),this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint),this._overlays?.removeAll()}async computeHeight(e,t,i=!0){return this._measurementService?.computeHeight(e,t,i)}async calculateAreaMeasurement(e,t,i){return this._measurementService?.calculateAreaMeasurement(e,t,i)}async calculateDistanceMeasurement(e,t,i){return this._measurementService?.calculateDistanceMeasurement(e,t,i)}async calculateAccuracy(e,t,i){return this._measurementService?.calculateAccuracy(e,t,i)}async calculateLocationAccuracy(e,t,i="default",a){return this._measurementService?.calculateLocationAccuracy(e,t,i,a)}async calculateAccuracyPanoramic(e,t,i=!1,a){return this._measurementService?.calculateAccuracyPanoramic(e,t,i,a)}async calculateHeightMeasurementInfo(e,t,i){return this._measurementService?.calculateHeightMeasurementInfo(e,t,i)}async calculateTriangulatedMeasurements(e){await(this._measurementService?.calculateTriangulatedMeasurements(e))}clearPreviousMeasurements(){this.clearMeasurementGraphics(),this.resetMeasurementData(),this.stopMeasurement()}clearPreviousGroundLocation(){this.groundCoordinates=null,this.groundCoordinatesAccuracy=null,this.pixelCoordinates=null,this.clearLocationPointOnImage()}clearMeasurementGraphics(){this.measurementGraphic&&(this.activeViewer?.removeGraphic(this.measurementGraphic),this.measurementGraphic=null),this.heightGraphic&&(this.activeViewer?.removeGraphic(this.heightGraphic),this.heightGraphic=null),this.triangularMeasurementActive&&this.sketchTriangularGraphicsLayer?.graphics.destroyAll()}digitizeCancel(){return this.sketch?.cancel()}digitizeCanRedo(){return this.sketch?.canRedo()??!1}digitizeCanUndo(){return this.sketch?.canUndo()??!1}digitizeComplete(){return this.sketch?.complete()}async digitizeCreate(e,t){const{sketch:i,dataCaptureLayer:a}=this;if(!i)throw _t();ut(a,e,i),await i.create(e,{...t,defaultZ:0})}digitizeDelete(){if(!this.sketch)throw _t();return this.sketch.delete()}digitizeDuplicate(){if(!this.sketch)throw _t();return this.sketch.duplicate()}digitizePlace(e,t){if(!this.sketch)throw _t();return this.sketch.place(e,t)}digitizeRedo(){if(!this.sketch)throw _t();return this.sketch.redo()}digitizeUndo(){if(!this.sketch)throw _t();return this.sketch.undo()}digitizeUpdate(e,t){if(!this.sketch)throw _t();return this.sketch.update(e,t)}async displayHeightResults(){const{currentBestFeature:e,activeViewer:t,heightMeasurementPixels:i,mode:a}=this,r=t?.imageSize,s=e?.attributes;if(!s||!r)return;const o=await this.computeHeight(i,a);o?.value&&o?.accuracy&&(this.heightMeasurementResult=o.value,this.heightMeasurementAccuracy=o.accuracy)}filterByFootprints(e,t,i=!1){const a=[],r=[],s=[];return e.forEach(e=>{const{layer:{coveragePercent:o},attributes:n}=e;let c;const{polygon:l,frustum:h}=q(n);if(c=l.clone(),n.isInspection&&(c=W(n)),o&&(c=$(c,o)),i||!t||J(c,t)){s.push(e);const{geometry:t,objectId:i,cameraHeight:o,cameraHeading:c}=n,u=t.clone();u.z=o/Q(t.spatialReference),u.imageID=i,this.pointSources.push(u),c!==be&&(a.push(l),h&&r.push(h))}}),{features:s,polygons:a,frustums:r}}getMeasurementProperties(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:i,attributes:a}=e,{elevationSource:r,cameraHeight:s}=a,o=oe(a,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?O(n,R.WebMercator):Promise.resolve(n)).then(e=>(n=e,ce(n.spatialReference,n.z??0,s,{elevationSample:i,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}getMeasurementPropertiesPanoramic(e=this.currentBestFeature,t=this.activeViewer){if(!e||!t?.imageSize)return;const{elevationSample:i,attributes:a}=e,{elevationSource:r,cameraHeight:s}=a,o=ne(a,t.imageSize[0],t.imageSize[1]);let n=o.cameraLocation;return(n.spatialReference.isGeographic?O(n,R.WebMercator):Promise.resolve(n)).then(e=>(n=e,ce(n.spatialReference,n.z??0,s,{elevationSample:i,elevationSource:r,extent:this.footprintExtent}))).then(t=>("elevationSample"in t&&(e.elevationSample=t.elevationSample),{...o,cameraLocation:n,updateElevationProps:t}))}async deleteDataCaptureFeatures(e){const{dataCaptureLayer:t}=this;if(!t)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");return t.queryFeatures({objectIds:e}).then(({features:e})=>t.applyEdits({deleteFeatures:e}))}handleSectorClick(e){if(isNaN(e))return;const t=this._sectorData?.[Ie[e]],i=t?.at(0);i&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(i):this._updateCurrentBestFeature(i))}handleFeatureClick(e){const{sector:t,featureIndexInSector:i}=e;if(isNaN(i))return;const a=this._sectorData?.[t],r=a?.at(i);r&&(this.triangularMeasurementActive&&this.currentBestFeature?this._updateImageMeasurementBestFeature(r):this._updateCurrentBestFeature(r))}handleDrawCursorUpdateEvents(e){const{measurementAngle:t,tempDistance:i,heightMeasurementPixels:a,mode:r,activeViewer:s,currentBestFeature:o}=this,n=s?.imageSize;if(!e.vertices||!n||!o)return;const c=ke(e.vertices.at(-1),r,n);if(a.length<1||!c||!i||!t||"none"===r)return;const l=Ce(a[0],c,t);if(!l?.length)return;this.heightMeasurementPixels.push(l),"panoramic"===r?this.createPolylineGraphicPano():this.createPolylineGraphic();const h=Ae(o.attributes.location.spatialReference),u=Te(this.heightMeasurementPixels,i,h);u&&(this.heightMeasurementResult=u)}async handleDrawVertexAddEvents(e,t){const{currentBestFeature:i,activeViewer:a,heightMeasurementPixels:r,mode:s}=this;if(!i||!a||!e.vertices?.length||"none"===s)return;const o=a?.imageSize;if(!r.length&&o){const i=ke(e.vertices.at(-1),s,o);this.heightMeasurementPixels.push(i);const a=await this.calculateHeightMeasurementInfo(i,s,t);if(!a?.measurementAngle||!a?.tempDistance)return;this.measurementAngle=a.measurementAngle,this.tempDistance=a.tempDistance}}load(e){return this.addResolvingPromise(this._loadViewAdapter(e).catch(e=>{if(!y(e))throw e})),this}async loadBestImage(e,t){return this.selectedPoint=K(e),this.beforeLoad(),this._fetchFeaturesWithController(e,t)}loadImageError(e){u.getLogger(this).error("oriented-imagery-viewer:load-image",e),this.setMessage("imageLoadError","error",e.message)}async loadSketch(e){if(!this.sketch){const t=import("../Sketch/SketchViewModel.js"),{default:i}=await t;v(e),this.sketch=new i({layer:this._defaultGraphicsLayer,view:this.activeViewer?.imageRenderer,updateOnGraphicClick:!1,defaultUpdateOptions:{reshapeOptions:{edgeOperation:"none",shapeOperation:"none",vertexOperation:void 0},enableMoveAllGraphics:!1,enableRotation:!1,enableScaling:!1,multipleSelectionEnabled:!1,toggleToolOnClick:!1,tool:"transform"}})}return this.sketch}async loadMeasurementAdapter(e){if(!this.sketchAdapter){const t=import("./adapters/sketch/MeasurementAdapter.js"),{default:i}=await t;if(v(e),this.sketchAdapter=new i({viewModel:this}),!this.sketchAdapter.viewModel.isResolved())return}return this.sketchAdapter}async loadTriangulatedMeasurementAdapter(e){if(!this.triangulatedMeasurementAdapter){const t=import("./adapters/sketch/TriangulatedMeasurementAdapter.js"),{default:i}=await t;if(v(e),this.triangulatedMeasurementAdapter=new i({viewModel:this}),!this.triangulatedMeasurementAdapter.viewModel.isResolved())return}return this.triangulatedMeasurementAdapter}async processFeatureResponse(e,t,i){const{features:a}=e;if(this._clearFeatureGeometries(),!this._checkFeatures(a))return;const{features:r,polygons:s,frustums:o}=this.filterByFootprints(a,t,i?.skipFilter);if(!this._checkFeatures(r))return;this.coveragePolygons.addMany(s),this.coverageFrustums.addMany(o);const n=await this.processElevationSample(s,r,i);v(i),await this._updateElevationOfSelectedPointAndLocations(r,t,n),v(i),Qe(r,n);const c=this._processSuitableFeatures(r,t);this.updateSuitabilities(c,i?.loadBestImage)}async processFeatureElevation(e,t,i){if(!t)return;const{features:a,polygons:r}=this.filterByFootprints(e,t,!0);if(!a?.length)return;const s=await this.processElevationSample(r,a,i);return v(i),s}async startMeasurement(e,t){this.sketch||await this.loadSketch(t),await this.loadMeasurementAdapter(t);const{sketch:i,sketchAdapter:a,activeViewer:r,mode:s}=this;if(!i||!a||!r||"none"===s)return;if(this.displayNewMeasurementButton=!1,"panoramic"===s&&(i.defaultCreateOptions.defaultZ=0),await i.create(e),"panoramic"===s){const{drawOperation:e}=i.view.activeTool;e.constraintsEnabled=!1,e._set("elevationDrawSurface",null)}const o=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;o&&this.sketch&&(this.sketch.polygonSymbol=Be(o),this.sketch.polylineSymbol="panoramic"===s?xe:Ee(o,2.5))}startHeightMeasurement(){this.heightMeasurementPixels=[],this.displayNewMeasurementButton=!1,this.draw??=new ge({view:this.activeViewer?.imageRenderer});this.draw.create("polyline").on(["cursor-update","vertex-add","draw-complete"],e=>this.handleDrawEvents(e))}createPolylineGraphic(){const e=[this.heightMeasurementPixels[0],this.heightMeasurementPixels.at(-1)],i=this.activeViewer?.imageRenderer.spatialReference;if(this.heightGraphic)this.heightGraphic.geometry=new G({paths:[e],spatialReference:i});else{const a=new G({paths:[e],spatialReference:i}),r=this.activeViewer?.imageRenderer.effectiveTheme.accentColor;this.heightGraphic=new t({geometry:a,symbol:Ee(r,2.5)}),this.activeViewer?.addGraphic(this.heightGraphic)}}createPolylineGraphicPano(){const e=this.activeViewer?.imageRenderer.spatialReference,i=this.activeViewer?.imageSize;if(!i)return;const a={x:this.heightMeasurementPixels[0][0],y:this.heightMeasurementPixels[0][1]},r={x:this.heightMeasurementPixels.at(-1)[0],y:this.heightMeasurementPixels.at(-1)[1]},{heading:s,pitch:o}=re(a,i[0],i[1]),{heading:n,pitch:c}=re(r,i[0],i[1]),l=[[...se(s,o)],[...se(n,c)]];if(this.heightGraphic)this.heightGraphic.geometry=new G({paths:[l],spatialReference:e});else{const i=new G({paths:[l],spatialReference:e});this.heightGraphic=new t({geometry:i,symbol:xe}),this._panoramicViewer.addGraphic(this.heightGraphic,0)}}async editOverlayedGraphics(e){this.sketchTriangularGraphicsLayer||this._initializeSketchTriangularGraphicsLayer(),this.sketchTriangularGraphicsLayer?.destroyed&&this._handleDestroyedTriangularSketchLayer(),this.sketchTriangularGraphicsLayer.add(e),this.sketchTriangular||(this._initializeSketchTriangular(),await this.loadTriangulatedMeasurementAdapter()),this.updateOverlayedGeometry(e)}updateOverlayedGeometry(e){this.sketchTriangular?.update([e],{tool:"reshape"})}async processMeasurementVectors(e){this.triangularMeasurementActive&&this.currentBestFeature&&(this.measurementVectors?.length<2&&await this.updateMeasurementVectorsArray(e),2===this.measurementVectors.length&&await this.calculateTriangulatedMeasurements(e))}async updateMeasurementVectorsArray(e){const t=this.measurementVectors.length?this.currentBestFeatureMeasurementImage:this.currentBestFeature;if(t){const i=await this.computeMeasurementVector(e,t);i&&this.measurementVectors.push(i)}}async computeMeasurementVector(e,t){const{activeViewer:i,mode:a}=this,r=i?.imageSize;if(!e||!t||!r)return;const s=Le(e,a,r),o=this.view?.spatialReference,n=[];for(let c=0;c<s.length;c++){const e={x:s[c][0],y:s[c][1]};let t=await this._transformationService.pixelToMapPoint(e);o&&!t.spatialReference.equals(o)&&(t=await O(t,o)),n.push(t)}return Ge(n,t)}async handleDrawEvents(e,t){if(this.draw)switch(e.type){case"cursor-update":this.handleDrawCursorUpdateEvents(e);break;case"vertex-add":await this.handleDrawVertexAddEvents(e,t);break;case"draw-complete":await this.displayHeightResults()}}initializeMeasurement(e){switch(this.clearMeasurementGraphics(),this.resetMeasurementData(),e){case"distance":this.startMeasurement("polyline");break;case"area":this.startMeasurement("polygon");break;case"height":this.startHeightMeasurement()}}async overlayCameraLocations(e){const{activeViewer:i,currentBestFeature:a,overlayedCameraLocations:r,layer:s,mode:o,state:n,layerFloorFilterClause:c}=this,l=i?.imageSize;if(!l||!a||!s||"default"!==o&&"panoramic"!==o||n.includes("loading"))return;const{polygon:h}=q(a.attributes);if(i.removeManyGraphics(r.toArray()),r.removeAll(),e){const{features:e}=await s.queryFeatures({where:P(`${s.objectIdField} <> ${a.attributes.objectId}`,P(s.definitionExpression,c)),geometry:h,returnGeometry:!0,outFields:[s.objectIdField]}),n=await Promise.all(e.map(async e=>{const{attributes:i,geometry:a}=e,r=await this._transformationService.pointToImageGeometry(a),s="panoramic"===o?He():De();return new t({attributes:i,symbol:s,geometry:r})}));r.addMany(n),i.addManyGraphics(r.toArray())}}overlayGraphicsOnImage(e,t){this.removeOverlayedGraphicsOnImage(e),this.overlayedMapFeatures.set(e,t),this.activeViewer?.addManyGraphics(t.toArray())}async overlayMapFeatures(e,i=!1){const{activeViewer:a,currentBestFeature:r,mode:o,state:n,layer:c}=this,l=a?.imageSize;if(!l||!r||"none"===o||"video"===o||"panoramic-video"===o||n.includes("loading")||!c)return;const{polygon:h}=q(r.attributes);try{const{imageGeometryField:t,oiObjectIdField:i}=dt(e,c.imageGeometryField,c.imageReferenceField);this.imageGeometryField=t.name,this.oiObjectIdField=i.name}catch(p){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features",p)}const{features:d}=await e.queryFeatures({geometry:h,returnGeometry:!0,outFields:["*"]}),m=new s(await Promise.all(d.map(async a=>{const s=a.symbol?.clone()??e.renderer?.getSymbol(a)?.clone(),{attributes:n,geometry:c}=a,{imageGeometryField:h,oiObjectIdField:d}=this;if(h&&d&&vt(e,h,d)&&`${n[d]}`==`${r.attributes.objectId}`)try{return mt(n,h,e,i,l,o,s)}catch(p){u.getLogger(this).warn("oriented-imagery-viewer:overlay-map-features","couldn't create graphic from attributes, geometry will be used",{error:p,feature:a,layer:e,imageGeometryField:this.imageGeometryField,imageReferenceField:this.oiObjectIdField})}const m=await this._transformationService.geometryToImageGeometry(c);return new t({attributes:n,layer:e,symbol:s,geometry:m,visible:e.visible&&i})})));this.overlayGraphicsOnImage(`${e.id}`,m)}getDepthAt(e){const{activeViewer:t,currentBestFeature:i,mode:a,state:r,depthImage:s}=this,o=t?.imageSize;if(!o||!i||"none"===a||r.includes("loading"))return u.getLogger(this).warnOnce("oriented-imagery-viewer:get-depth-at","Load an image to use depth"),null;if(!s?.loaded)return u.getLogger(this).error("oriented-imagery-viewer:get-depth-at","Depth image is not loaded"),this.emit("depth-image-service:not-loaded"),null;const n=(Array.isArray(e)?e:[e]).map(e=>s.depthAt(e,{width:o[0],height:o[1]})??null);return Array.isArray(e)?n:n[0]}getActiveSectors(){return Ie.filter(e=>this._sectorData?.[e]?.length)}async plotMapPoint(e){return this.plotReferencePoint(e),this.transformAndPlotReferencePointOnImage({feature:this.currentBestFeature,selectedLocation:e,options:{signal:this._transformController?.signal}})}plotReferencePointOnGround(e){this._referencePointOnGround&&(this._overlays?.remove(this._referencePointOnGround),this._referencePointOnGround.destroy()),null!=e&&(this._referencePointOnGround=new t({geometry:new L({...e.toJSON()}),symbol:ze}),this.view?this._overlays?.add(this._referencePointOnGround):this.emit("plot-ground-point",{data:{point:this._referencePointOnGround?.geometry}}))}plotReferencePointOnImage(e){const{state:i,mode:a,activeViewer:r}=this;if("image-loaded"!==i||!r?.imageSize||"default"!==a&&"panoramic"!==a)return;this.clearReferencePointOnImage();const s=pt(e,a,r.imageSize);this._referencePointOnImage=new t({geometry:s,symbol:"panoramic"===a?Ne.clone():ze.clone()}),r.addGraphic(this._referencePointOnImage,0)}plotLocationPointOnImage(e,t=!1){if("image-loaded"===this.state)switch(this.clearLocationPointOnImage(t),this.mode){case"default":this._plotLocationPointOnDefaultImage(e,t);break;case"panoramic":this._plotLocationPointOnPanoramicImage(e,t)}}removeAllOverlayMapFeatures(){this.overlayedMapFeatures.forEach(e=>{this._imageViewer.removeManyGraphics(e.toArray())}),this.overlayedMapFeatures.clear()}removeOverlayedGraphicsOnImage(e){const t=this.overlayedMapFeatures.get(e);t?.length&&(this.activeViewer?.removeManyGraphics(t.toArray()),this.overlayedMapFeatures.delete(e))}reset(){const{mode:e}=this;"default"===e||"panoramic"===e?this.resetImage():"video"===e?this.resetVideo():"panoramic-video"===e&&this.resetVideoPanoramic(),this.beforeLoad(!1)}resetImage(){switch(this.setMessage("onLoadMessage","info"),this.mode){case"default":this._imageViewer.clearImage(),this._imageViewer.clearGraphics();break;case"panoramic":this._panoramicViewer.clearGraphics()}this._clickTask=p(this._clickTask)}resetVideo(){this.setMessage("onLoadMessage","info"),this.videoViewModel?.resetVideoHandler(),this._overlays?.removeAll(),this.videoViewModel=null,this.featureCache=[],this.currentBestFeature=null}resetVideoPanoramic(){this.setMessage("onLoadMessage","info"),this._overlays?.removeAll(),this.currentBestFeature=null}resetMeasurementData(){this.areaMeasurementResult=0,this.areaMeasurementAccuracy=0,this.distanceMeasurementResult=0,this.distanceAccuracyArray=[],this.heightMeasurementPixels=[],this.measurementVectors=[],this.heightMeasurementResult=0,this.tempDistance=null,this.measurementAngle=null,this.heightMeasurementAccuracy=0,this.heightGraphic=null,this.triangulatedDistanceMeasurement=null,this.triangulatedDistanceAccuracy=null,this.triangulatedAreaMeasurement=null,this.triangulatedMeasurementGraphic=null,this.updatingTriangularMeasurementState=!1,this.triangulatedAreaAccuracy=0}async saveDrawing(){const{dataCaptureLayer:e,sketchAdapter:t}=this;if(!e||"data-capture"!==t?.type)return;const{pendingGraphics:i,savedGraphics:a}=t,r=i.get(e.id),s=r?.toArray();if(!r||!s?.length)return;const{addFeatureResults:o}=await this.saveDataCaptureFeatures(s),n=o.reduce((t,{objectId:i,globalId:a,error:r},o)=>{const n=s[o],{attributes:c}=n;return r?t.error.push(n):(i&&(c[e.objectIdField]=i),a&&e.globalIdField&&(c[e.globalIdField]=a),t.success.push(n)),t},{success:[],error:[]});a.addMany(n.success),r.removeAll(),r.addMany(n.error)}async saveDataCaptureFeatures(e,t){const{activeViewer:i,currentBestFeature:r,dataCaptureLayer:s,mode:o}=this,c=i?.imageSize;if(!c||!r||"none"===o||"video"===o||"panoramic-video"===o)throw new n("orientedimageryviewer:missing-input","Image size, current best feature and mode are required to save data capture features");if(!s)throw new n("orientedimageryviewer:missing-featurelayer","Data capture layer is not available");const l=await Promise.all(e.map(async e=>{const i=e.clone(),{geometry:a}=i;if(!a)return;const r=a.type,o=s.hasZ,n=s.geometryType,c=r!==n,l=c?await import("./transformers.js"):null,h=l?.default[n],u=c?h?.(a):a;return u&&(i.geometry=await this._transformationService.imageGeometryToMapGeometry(u,t),i.geometry)?(o||gt(i.geometry),i):void 0})),h=l.filter(a);return s.applyEdits({addFeatures:h}).then(e=>{const{addFeatureResults:t}=e;let i=0;const a=l.map(e=>{const a=t[i++];return e?a:{error:new n("orientedimageryviewer:save-unsucccessful","Error in saving data capture features"),objectId:null,globalId:null}});return{...e,addFeatureResults:a}})}async searchBestImage(e,t){try{const i=await z(e,t);i&&await this.processFeatureResponse(i,e.point,t)}catch(i){y(i)||(this.setMessage("imageLoadError","error",i.message),u.getLogger(this).error("error occurred while finding best image",i))}}selectTriangularMeasurementFeature(e){this.currentBestFeatureMeasurementImage=this.features?.find(({attributes:t})=>t.objectId===Number(e))}setAdditionalCameraLocationsVisibility(e){this.additionalCameraLocations.forEach(t=>{t.visible=e})}setAdditionalCoverageVisibility(e){this.additionalFootprints.forEach(t=>{t.visible=e})}setCurrentCoverageVisibility(e){this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.visible=e),this.currentBestFeatureLocation&&(this.currentBestFeatureLocation.visible=e)}setMapImageConversionToolState(e){this.mapImageConversionToolState=e}setCurrentPanoramaView(e,t){this._panoramicViewer?.set({yaw:e,pitch:t})}async startDataCapture(e,t){const i=this.activeViewer?.imageRenderer,{oiObjectIdField:a,currentBestFeature:r}=this;if(!i||!r||!a)return;const{attributes:{objectId:o}}=r,n=this.overlayedMapFeatures.get(e.id)?.toArray()??[],c=[],l=[];for(const s of n)`${s.getAttribute(a)}`==`${o}`?c.push(s):l.push(s);this.overlayGraphicsOnImage(e.id,new s(l)),this.collectionId=e.id;const h=await this.loadSketch(t),u=await this.loadDataCaptureAdapter(t);v(t),h.addGraphics(c),u.savedGraphics.addMany(c);i.ui.find("zoom").visible=!1,i.map.layers.add(this.sketchGraphicsLayer)}async stopDataCapture(e=!1){this.sketch?.cancel(),this.sketchGraphicsLayer?.removeAll(),this.sketchAdapter=m(this.sketchAdapter),this.sketch=m(this.sketch),this.collectionId=null;const{dataCaptureLayer:t}=this,i=this.activeViewer?.imageRenderer;if(!i||i.destroyed)return;i.map.layers.remove(this.sketchGraphicsLayer),e&&t&&await this.overlayMapFeatures(t,!0);const a=i.ui.find("zoom");a&&(a.visible=!0)}stopMeasurement(){this.heightMeasurementPixels=[],this.draw?.reset(),this.sketch?.cancel()}async toggleAllOverlayMapFeatures(e){!e&&this.dataCaptureLayer&&(await this.stopDataCapture(!0),this.dataCaptureLayer=null),this.overlayedMapFeatures.forEach(t=>{this._toggleVisiblity(t,e)})}toggleOverlayMapFeatures(e,t,i){const a=this.overlayedMapFeatures.get(e);a&&i&&this._toggleVisiblity(a,t)}toggleSelection(e){const{sketch:t}=this;t&&(t.updateOnGraphicClick=e,t.cancel())}async transformAndPlotReferencePointOnImage(e){const{selectedLocation:t,options:i}=e;let a=!1,r=!1;const s=this.bestFeatureFootprint?.geometry;switch(s?.type){case"polygon":{const e=t.spatialReference.equals(s.spatialReference)?t:await O(t,s.spatialReference);a=s.contains(e);break}case"mesh":{const e=t.spatialReference.equals(s.spatialReference)?t:await O(t,s.spatialReference);r=s.extent.contains(e);break}}if(!a&&!r)return void this.clearReferencePointOnImage();const o=await this._transformationService.pointToPixel(t,i);if(o)return v(i),this.plotReferencePointOnImage(o),{x:o.x,y:o.y};this.clearReferencePointOnImage()}async triangulatedLocationWorkflow(e,t){if(this.currentBestFeature&&e){const{currentBestFeature:i}=this;this.triangulatedPoint&&(this.measurementVectors=[],this.triangulatedPoint=null,this.clearLocationPointOnImage(!0));const a=Ge(e,i);if(!a)return;this.measurementVectors.push(a),await this.plotReferenceLocationPoint(e,t),v(t),this._createTriangularImageLocationHandle()}}async updateFeatureCache(e,t){const i=await N(e,t);i.features?.length&&(this.featureCache=i.features)}async _calculateTriangulatedPointFromGroundPoint(e,t){if(this.currentBestFeatureMeasurementImage&&e){const{currentBestFeatureMeasurementImage:i,view:a}=this,r=Ge(e,i);r&&this.measurementVectors.push(r);let s=await Oe(this.measurementVectors);v(t),s?.spatialReference&&a?.spatialReference&&!s.spatialReference.equals(a.spatialReference)&&(s=await O(s,a.spatialReference)),this.triangulatedPoint=s??this.triangulatedPoint}}async _fetchFeatures(e,t){if(!this.view)return;const i=this.layer;if(i){const a={include:i},r=this.view.toScreen(e);if(!r)return;const s=await this.view.hitTest(r,a);return this._processHitTestResults(i,s,t)}}async _fetchFeaturesWithController(e,t){try{await this._fetchFeatures(e,t)}catch(i){if(y(i))return;this.setMessage("imageLoadError","error"),u.getLogger(this).error("error occurred while fetching features",i)}}_groupFeaturesBySectors(){const{_suitabilities:e,additionalFeatures:t,features:i,invalidCameraHeading:a}=this,r=i.at(0);if(!e||!t||!r||!i||a)return void(this._sectorData=null);this._sectorData={};const o={};this._featureToSector=o;for(const h of Ie)this._sectorData[h]=new s;const n=e.map((e,t)=>({...e,featureIndex:t}));n.sort((e,t)=>e.trueSuitability-t.trueSuitability);const c=n.map(({distance:e})=>e),l=Math.max(...c);n.forEach(e=>{const{distance:t,angle:a,featureIndex:s}=e,n=t/l*Ve[2],c=Ye(t,l),h=Xe(a);if(!this._sectorData)return;const u=Ve[3]+n*Math.sin(a*Math.PI/180),d=Ve[3]+n*Math.cos(a*Math.PI/180);let m;const p=i.at(s),g=p===r,{cameraPitch:y}=p.attributes,v=y<5;if(g&&v)m=-90;else{const e=u-Ve[3],t=d-Ve[3],i=t/Math.sqrt(e**2+t**2);let a=180*Math.acos(i)/Math.PI;(e<0&&t<0||e<0&&t>0)&&(a*=-1),m=a}const f=""===c?h:`${c}_${h}`;g&&(m===this.bestFeatureAngle?this.previousFeatureAngle=m:this.bestFeatureAngle=m,this.navigatorCurrentBestFeature=v?null:{x:u,y:d,direction:h}),o[`${p.attributes.objectId}`]=f;const w=this._sectorData[f];w.add({angle:a,featureIndex:s,x:u,y:d,objectID:p.attributes.objectId,sector:f,featureIndexInSector:w.length})})}_handleDestroyedTriangularSketchLayer(){this.sketchTriangularGraphicsLayer&&this.activeTriangulatedViewer&&(this.activeTriangulatedViewer.imageRenderer.map.layers.remove(this.sketchTriangularGraphicsLayer),this.sketchTriangularGraphicsLayer=new H,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer),this.sketchTriangular&&(this.sketchTriangular.layer=this.sketchTriangularGraphicsLayer,this.sketchTriangular.view=this.activeTriangulatedViewer.imageRenderer))}_initializeMeasurementService(){this._measurementService||(this._measurementService=new ht(this))}_initializeSketchTriangular(){if(!this.activeTriangulatedViewer)return;const e="panoramic"===this.mode;this.sketchTriangular=new ft({view:this.activeTriangulatedViewer.imageRenderer,layer:this.sketchTriangularGraphicsLayer,updateOnGraphicClick:!1,defaultUpdateOptions:{toggleToolOnClick:!1,enableZ:!e}}),e&&(this.sketchTriangular.defaultUpdateOptions.reshapeOptions={edgeOperation:"offset",shapeOperation:"move-xy",vertexOperation:"move-xy"})}_initializeSketchTriangularGraphicsLayer(){this.activeTriangulatedViewer&&(this.sketchTriangularGraphicsLayer=new H,this.activeTriangulatedViewer.imageRenderer.map.layers.add(this.sketchTriangularGraphicsLayer))}_initializeVideo(){if(this.videoElement||!this.currentBestFeature)return;this.removeHandles(wt.videoPlayerHandles),this.videoElement=new me({video:this.currentBestFeature.attributes.imagePath,georeference:new ue({extent:new T(Pe)}),autoplay:!1}),this.videoElement.content?.loop&&(this.videoElement.content.loop=!1);const e=new D({source:this.videoElement,title:this.layer?.title,copyright:this.layer?.copyright});this.videoLayer=e,e&&this.videoMapView.map.layers.add(e),this.addHandles(rt(this.videoMapView),wt.videoPlayerHandles),this.videoViewModel=new nt({oiViewModel:this})}async getMapPoint(e,t){const i=await this._transformationService.pixelToMapPoint(Array.isArray(e)?e:[e],t);return Array.isArray(e)?i:i[0]}async loadPanoramicMediaSource(e,t){const{lookAt:i,...a}=e,r=et(a);try{await r.load(t)}catch(o){if(y(o))return;"unsupported-type"===o.name&&this.setMessage("unsupportedPanoramicImageryError","error",void 0,{extension:r?.extension??"UNKNOWN FORMAT"})}const s=this.triangularMeasurementActive?this._panoramicMeasurementViewer:this._panoramicViewer;await s.loadMedia(r,t),i&&s.set(i)}async loadMediaSource(e,t){const i=tt(e);await this._setImageSource(this.triangularMeasurementActive?this.imageMeasurementViewer:this._imageViewer,i,t)}_plotLocationPointOnDefaultImage(e,i=!1){const a=C(e)?e.toJSON():e;a.x-=.5,a.y=.5-a.y,i?(this._correctedLocationPointOnImage=new t({geometry:new L({spatialReference:R.WebMercator,...a}),symbol:Ue}),this.imageMeasurementViewer.addGraphic(this._correctedLocationPointOnImage,0)):(this._locationPointOnImage=new t({geometry:new L({spatialReference:R.WebMercator,...a}),symbol:Ue}),this._imageViewer.addGraphic(this._locationPointOnImage,0))}_plotLocationPointOnPanoramicImage(e,i=!1){const a=i?this._panoramicMeasurementViewer:this._panoramicViewer,{imageSize:r}=a;if(!r)return;const[s,o]=r,{heading:n,pitch:c}=re(e,s,o),l=se(n,c),h=new t({geometry:new L(l,R.WebMercator),symbol:qe});i?this._correctedLocationPointOnImage=h:this._locationPointOnImage=h,a.addGraphic(h,0)}_clearFeatureGeometries(){this.coveragePolygons.removeAll(),this.coverageFrustums.removeAll(),this.pointSources.removeAll()}_checkFeatures(e){return!!e?.length||(this.setMessage("noImageError","error"),this.videoElement?.content?.pause(),this.currentBestFeature=null,!1)}async _getElevationSampleFromGround(e,t,i){if(!e[0])return;const a=(await import("../../geometry/operators/unionOperator.js")).executeMany(e);if(this._updateFootprintWithFeatures(t,a),"3d"===this.view?.type)try{return await this.view.map.ground.createElevationSampler(this.footprintExtent,i)}catch(r){y(r)||u.getLogger(this).error(r)}}async processElevationSample(e,t,i){const{elevationSource:a}=t[0].attributes,r=await this._getElevationSampleFromGround(e,t,i);return r||(a&&this.footprintExtent&&Z(a)?await te({extent:this.footprintExtent,lod:a.lod,url:a.url,rasterFunction:a.rasterFunction}):void 0)}_processSuitableFeatures(e,t){return U({features:e,selectedPoint:t,camera:it(this.view)?this.view.camera:null,currentImage:this.currentBestFeature})}async _processHitTestResults(e,t,i){const{screenPoint:a,results:[r]}=t,s="graphic"===r?.type&&this.shouldShowSelectedImage,o=r?.mapPoint??this.view?.toMap(a);if(!o)return;o.x=x(o.x,o.spatialReference);const{layerFloorFilterClause:n}=this,c=e.spatialReference.equals(o.spatialReference)?o:await O(o,e.spatialReference),l=c.spatialReference.isGeographic?E(c):c,h=P("1=1",P(e.definitionExpression,n)),u=l.spatialReference.isGeographic?1:V(l.spatialReference),d={layerInstanceOrURL:e,point:l,queryParams:{where:h,maximumDistance:e.maximumDistance?e.maximumDistance/u:void 0,objectIds:s?[r.graphic.getAttribute(e.objectIdField)]:void 0}};await this.searchBestImage(d,i)}async _queryAndLoadByObjectId(e,t,i,a){this.displayMessage=null;const{response:r}=await lt(e,t,i,a);if(v(a),!r?.features?.length)throw new ct(t);const s=q(r.features[0].attributes).polygon,o=L.fromJSON(j(s)),n=K(o),c=V(n.spatialReference);this.selectedPoint=n;const l={layerInstanceOrURL:e,point:n,queryParams:{where:P(P("1=1",P(e.definitionExpression,i)),`${e.objectIdField} <> ${t}`),maximumDistance:e.maximumDistance?e.maximumDistance/c:void 0}},h=await z(l,a);v(a);const{features:u}=h;return u.push(r.features[0]),await this.processFeatureResponse(h,n,{...a,loadBestImage:!1})}_reorderTriangularSketchLayer(){const e=this.imageMeasurementViewer.imageRenderer.map.layers?.length;this.sketchTriangularGraphicsLayer&&e&&this.imageMeasurementViewer.imageRenderer.map.layers.reorder(this.sketchTriangularGraphicsLayer,e-1)}_resetCursor(){const{activeViewer:e,imageMeasurementViewer:t}=this;e&&this.removeHandles(wt.activeViewerCursorHandles),t&&this.removeHandles(wt.imageViewerCursorHandles)}async _setImageSource(e,t,i){e.media=t,await e.loadMedia(t,i)}_setMeasurementCursor(){const{activeViewer:e,imageMeasurementViewer:t,triangularMeasurementActive:i}=this;e&&this.addHandles(e.imageRenderer.acquireCursor("crosshair","high"),wt.activeViewerCursorHandles),t&&i&&this.addHandles(t.imageRenderer.acquireCursor("crosshair","high"),wt.activeViewerCursorHandles)}_toggleVisiblity(e,t){e.forEach(e=>{e.visible=t})}async _updateElevationOfSelectedPointAndLocations(e,t,i,a){const{location:r,cameraHeight:s}=e[0].attributes,o=await ce(r.spatialReference,r.z,s,{elevationSample:i,elevationSource:i?void 0:e[0].attributes.elevationSource,extent:this.footprintExtent},a);v(a);const[n,...c]=await ee([t,...e.map(e=>e.attributes.geometry.clone())],o);v(a),t.elevation=n.z,e.forEach((e,t)=>{e.attributes.elevation=c[t].z})}_updateFeatures(e,t=!0){if(!e.length)return this.currentBestFeature=null,void this.additionalFeatures.removeAll();this.features.removeAll(),this.features.addMany(e),this.navigationNodes.removeAll(),this.navigationNodes.addMany(e.map(e=>{const{geometry:t,attributes:i}=e,{isSpherical:a,cameraHeading:r,cameraPitch:s}=i;return new ot({geometry:t,attributes:i,currentHeading:a?0:r,currentPitch:a?0:s})})),e.length>1?this.additionalFeatures.addMany(e.slice(1)):this.additionalFeatures.removeAll(),this._updateGroundElevation=!0,t&&(this.currentBestFeature=e[0]),"video"===this.mode&&(this._initializeVideo(),this.videoElement?.loaded&&this.videoViewModel?.playVideoFromSelectedLocation(e[0])),"panoramic-video"===this.mode&&this._loadVideo()}_updateFootprintWithFeatures(e,t){const i=[];for(const{attributes:{geometry:a}}of e)t.contains(a)||i.push([a.x,a.y]);i.sort((e,t)=>+B([e,t])),t.addRing(i),this.footprintExtent=ye(t.extent,2,2)}async _updatePointsAndPolygons(e){const{pointSources:i,currentBestFeature:a,currentCoverageVisible:r,isAdditionalPointSourcesVisible:s,mode:o,layer:n}=this;if(a&&(this.additionalFootprints.removeAll(),this.additionalCameraLocations.removeAll(),this.bestFeatureCurrentFootprint&&(this.bestFeatureCurrentFootprint.destroy(),this.bestFeatureCurrentFootprint=null,this.bestFeatureFootprint=null),!this.invalidCameraHeading)){await(this._adapter?.createFootprints(e)),v(e);for(const o of i){const i=this.view&&!this.view.spatialReference?.equals(o.spatialReference)?await O(o.clone(),this.view?.spatialReference,e):o.clone();o.imageID===a.attributes.objectId?this.currentBestFeatureLocation=new t({attributes:{imageID:o.imageID},geometry:i,symbol:We,visible:r}):this.additionalCameraLocations.push(new t({attributes:{imageID:o.imageID},geometry:i,symbol:$e,visible:s}))}"video"!==o&&"panoramic-video"!==o||!n||this.featureCache.length||await this.updateFeatureCache(n,a.geometry.spatialReference)}}_updateCurrentBestFeature(e){if(!e)return;if(this.currentBestFeature=this.features?.at(e.featureIndex),"video"===this.mode)return void(this.currentBestFeature&&this.videoViewModel?.playVideoFromSelectedLocation(this.currentBestFeature));if("panoramic-video"===this.mode)return void(this.currentBestFeature&&this._panoramicVideoViewer.viewModel.playPanoramicVideoFromSelectedLocation(this.currentBestFeature));const t=this.currentBestFeature?.attributes.cameraPitch&&this.currentBestFeature?.attributes.cameraPitch<5;let i;if(t)i=-90;else{const t=e.x-Ve[3],a=e.y-Ve[3],r=a/Math.sqrt(t**2+a**2);let s=180*Math.acos(r)/Math.PI;(t<0&&a<0||t<0&&a>0)&&(s*=-1),i=s}i===this.bestFeatureAngle?this.previousFeatureAngle=i:this.bestFeatureAngle=i,this.navigatorCurrentBestFeature=t?null:{x:e.x,y:e.y,direction:e.sector.includes("_")?e.sector.split("_")[1]:e.sector}}_updateImageMeasurementBestFeature(e){e&&(this.currentBestFeatureMeasurementImage=this.features?.at(e.featureIndex))}clearGraphics(){this._imageViewer.clearGraphics(),this._panoramicViewer.clearGraphics(),this.imageMeasurementViewer.clearGraphics(),this._panoramicMeasurementViewer.clearGraphics()}clearReferencePointOnImage(){this._referencePointOnImage&&(this._imageViewer.removeGraphic(this._referencePointOnImage),this._panoramicViewer.removeGraphic(this._referencePointOnImage),this._referencePointOnImage=m(this._referencePointOnImage))}clearLocationPointOnImage(e=!1){this._locationPointOnImage&&!e&&(this._imageViewer.removeGraphic(this._locationPointOnImage),this._panoramicViewer.removeGraphic(this._locationPointOnImage),this._locationPointOnImage=m(this._locationPointOnImage)),this._correctedLocationPointOnImage&&(this.imageMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._panoramicMeasurementViewer.removeGraphic(this._correctedLocationPointOnImage),this._correctedLocationPointOnImage=m(this._correctedLocationPointOnImage))}plotReferencePoint(e){"mapPoint"in e?this.plotReferencePointOnGround(e.mapPoint):this.plotReferencePointOnGround(e)}async plotReferenceLocationPoint(e,t){if(this.currentBestFeatureMeasurementImage){const i=await this._referenceTransformationService.pointToPixel(e,{signal:t});v(t),i&&this.plotLocationPointOnImage(i,!0)}}setMessage(e,t,i,a){this.displayMessage={key:e,type:t,data:i,map:a}}async transformAndPlotSelectedLocation(e){const{currentBestFeature:t,invalidCameraHeading:i,selectedPoint:a,activeViewer:r}=this;if(this._crossSymbol&&(this._panoramicViewer.removeGraphic(this._crossSymbol),this._imageViewer.removeGraphic(this._crossSymbol),this._crossSymbol=m(this._crossSymbol)),!a||!t||"image-loaded"!==r?.state||i)return;let s;try{s=await this._transformationService.pointToPixel(a,{signal:e?.signal}),v(e),await this.plotSelectedPointOnImage(s,e)}catch(o){y(o)||u.getLogger(this).error("failed to transform map point to pixel, cross symbol will not be plotted on image",{error:o,selectedPoint:a,feature:t})}}updateCurrentCoveragePolygon(e){const{additionalFootprints:i,additionalCameraLocations:a,currentBestFeature:r,currentBestFeatureLocation:s,currentCoverageVisible:o,selectedPoint:n,view:c,_adapter:l,mode:h}=this;if(!r)return;const{attributes:{objectId:u},elevationSample:d}=r;if(this._initialCurrentCoverageUpdate){if(this._overlays?.removeAll(),this._initialCurrentCoverageUpdate=!1,this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint),e&&!this.invalidCameraHeading&&(e.visible=o,this.bestFeatureCurrentFootprint=e),c){const e=[...i,...a,s].filter(at);"3d"===c?.type&&d&&l?.updateGroundElevation&&(this._updateGroundElevation&&l.updateGroundElevation(e),"panoramic"===h&&l.updateGroundElevation([this.bestFeatureCurrentFootprint])),this._updateGroundElevation=!1,n&&(e.splice(-2,0,this.bestFeatureCurrentFootprint),e.push(new t({geometry:n.clone(),symbol:Re.clone(),attributes:{imageID:u}}))),this._overlays.graphics.addMany(e)}}else if(c){if(this.invalidCameraHeading)return;this.bestFeatureCurrentFootprint&&(this._overlays?.remove(this.bestFeatureCurrentFootprint),this.bestFeatureCurrentFootprint=m(this.bestFeatureCurrentFootprint));const t=this.bestFeatureCurrentFootprint&&this._overlays?this._overlays.graphics.indexOf(this.bestFeatureCurrentFootprint):-1;e&&(this.bestFeatureCurrentFootprint=e,"3d"===c?.type&&d&&l?.updateGroundElevation&&"panoramic"===h&&l.updateGroundElevation([e]),e.visible=this.currentCoverageVisible,this._overlays?.graphics.add(this.bestFeatureCurrentFootprint,t>=0?t:this._overlays.graphics.length-1))}}};e([S()],Ft.prototype,"_transformationService",void 0),e([S()],Ft.prototype,"_referenceTransformationService",void 0),e([S()],Ft.prototype,"activeLayer",null),e([S({readOnly:!0})],Ft.prototype,"activeViewer",null),e([S()],Ft.prototype,"activeTriangulatedViewer",null),e([S()],Ft.prototype,"accuracyParametersMissing",null),e([S()],Ft.prototype,"additionalFeatures",void 0),e([S({type:s.ofType(t)})],Ft.prototype,"additionalCameraLocations",void 0),e([S({type:s.ofType(t)})],Ft.prototype,"additionalFootprints",void 0),e([S()],Ft.prototype,"areaMeasurementResult",void 0),e([S()],Ft.prototype,"areaMeasurementAccuracy",void 0),e([S()],Ft.prototype,"bestFeatureAngle",void 0),e([S()],Ft.prototype,"bestFeatureCurrentFootprint",void 0),e([S({type:t})],Ft.prototype,"bestFeatureFootprint",void 0),e([S({type:Number})],Ft.prototype,"brightness",null),e([S()],Ft.prototype,"cameraHeadingThreshold",void 0),e([S()],Ft.prototype,"cameraPitchThreshold",void 0),e([S()],Ft.prototype,"clickAction",void 0),e([S()],Ft.prototype,"videoViewModel",void 0),e([S()],Ft.prototype,"collectionId",void 0),e([S({type:Number})],Ft.prototype,"contrast",null),e([S()],Ft.prototype,"conversionProps",void 0),e([S()],Ft.prototype,"coverageFrustums",void 0),e([S()],Ft.prototype,"coveragePolygons",void 0),e([S()],Ft.prototype,"currentBestFeature",void 0),e([S()],Ft.prototype,"currentBestFeatureMeasurementImage",void 0),e([S()],Ft.prototype,"currentBestFeatureLocation",void 0),e([S()],Ft.prototype,"currentCoverageVisible",void 0),e([S()],Ft.prototype,"currentNode",null),e([S()],Ft.prototype,"depthImage",void 0),e([S()],Ft.prototype,"depthImageNotSupported",null),e([S()],Ft.prototype,"featureCache",void 0),e([S()],Ft.prototype,"navigationNodes",void 0),e([S({json:{write:!1}})],Ft.prototype,"determineWorkflowForFeature",void 0),e([S({json:{write:!1}})],Ft.prototype,"determineWorkflowForTriangularMeasurement",void 0),e([S()],Ft.prototype,"disabled",void 0),e([S()],Ft.prototype,"displayMessage",void 0),e([S()],Ft.prototype,"displayNewMeasurementButton",void 0),e([S()],Ft.prototype,"distanceMeasurementResult",void 0),e([S()],Ft.prototype,"distanceAccuracyArray",void 0),e([S()],Ft.prototype,"dataCaptureLayer",void 0),e([S({readOnly:!0})],Ft.prototype,"featureCount",null),e([S()],Ft.prototype,"features",void 0),e([S()],Ft.prototype,"groundCoordinates",void 0),e([S()],Ft.prototype,"groundCoordinatesAccuracy",void 0),e([S()],Ft.prototype,"heightMeasurementPixels",void 0),e([S()],Ft.prototype,"heightGraphic",void 0),e([S()],Ft.prototype,"heightMeasurementResult",void 0),e([S()],Ft.prototype,"heightMeasurementAccuracy",void 0),e([S()],Ft.prototype,"measurementAngle",void 0),e([S()],Ft.prototype,"tempDistance",void 0),e([S({readOnly:!0})],Ft.prototype,"imageGalleryEnabled",null),e([S()],Ft.prototype,"imageGeometryField",void 0),e([S({readOnly:!0})],Ft.prototype,"imageLoaded",null),e([S()],Ft.prototype,"imageLocationToolState",void 0),e([S({readOnly:!0})],Ft.prototype,"invalidCameraHeading",null),e([S()],Ft.prototype,"imagePointsInView",null),e([S()],Ft.prototype,"imageMeasurementViewer",void 0),e([S()],Ft.prototype,"isAdditionalCoverageVisible",void 0),e([S()],Ft.prototype,"isAdditionalPointSourcesVisible",void 0),e([S()],Ft.prototype,"measurementVectors",void 0),e([S()],Ft.prototype,"layer",void 0),e([S()],Ft.prototype,"layerView",null),e([S({readOnly:!0})],Ft.prototype,"layerFloorFilterClause",null),e([S({type:Number})],Ft.prototype,"localPort",void 0),e([S()],Ft.prototype,"mapImageConversionToolState",void 0),e([S()],Ft.prototype,"measureType",void 0),e([S()],Ft.prototype,"measurementGraphic",void 0),e([S({readOnly:!0,value:"none"})],Ft.prototype,"mode",null),e([S()],Ft.prototype,"navigationMode",void 0),e([S()],Ft.prototype,"navigatorCurrentBestFeature",void 0),e([S()],Ft.prototype,"oiObjectIdField",void 0),e([S({type:s.ofType(t)})],Ft.prototype,"overlayedCameraLocations",void 0),e([S()],Ft.prototype,"overlayedMapFeatures",void 0),e([S()],Ft.prototype,"panoramicVideoLoaded",null),e([S()],Ft.prototype,"pixelCoordinates",void 0),e([S()],Ft.prototype,"preserveAngle",void 0),e([S()],Ft.prototype,"pointSources",void 0),e([S({readOnly:!0})],Ft.prototype,"popupEnabled",null),e([S()],Ft.prototype,"preloadMedia",void 0),e([S()],Ft.prototype,"preloadMediaSize",void 0),e([S()],Ft.prototype,"previousFeatureAngle",void 0),e([S()],Ft.prototype,"referencePoint",null),e([S({readOnly:!0})],Ft.prototype,"sectorData",null),e([S()],Ft.prototype,"selectedPoint",void 0),e([S({type:Number})],Ft.prototype,"sharpness",null),e([S()],Ft.prototype,"shouldShowSelectedImage",void 0),e([S()],Ft.prototype,"sketch",void 0),e([S()],Ft.prototype,"sketchTriangular",void 0),e([S()],Ft.prototype,"sketchTriangularGraphicsLayer",void 0),e([S()],Ft.prototype,"draw",void 0),e([S()],Ft.prototype,"sketchAdapter",void 0),e([S({readOnly:!0})],Ft.prototype,"sketchGraphicsLayer",null),e([S({readOnly:!0})],Ft.prototype,"state",null),e([S({readOnly:!0})],Ft.prototype,"thumbnails",null),e([S()],Ft.prototype,"triangularMeasurementActive",void 0),e([S()],Ft.prototype,"triangulatedDistanceMeasurement",void 0),e([S()],Ft.prototype,"triangulatedDistanceAccuracy",void 0),e([S()],Ft.prototype,"triangulatedAreaMeasurement",void 0),e([S()],Ft.prototype,"triangulatedAreaAccuracy",void 0),e([S()],Ft.prototype,"triangulatedMeasurementGraphic",void 0),e([S()],Ft.prototype,"triangulatedPoint",void 0),e([S()],Ft.prototype,"triangulatedMeasurementAdapter",void 0),e([S()],Ft.prototype,"updateFootprint",void 0),e([S()],Ft.prototype,"updateFootprintPanorama",void 0),e([S()],Ft.prototype,"updatingTriangularMeasurementState",void 0),e([S({value:null})],Ft.prototype,"view",null),e([S()],Ft.prototype,"videoElement",void 0),e([S()],Ft.prototype,"videoLayer",void 0),e([S()],Ft.prototype,"videoMapView",void 0),e([S()],Ft.prototype,"_adapter",void 0),e([S()],Ft.prototype,"_defaultGraphicsLayer",null),e([S()],Ft.prototype,"_highlightedFeatureHandle",void 0),e([S()],Ft.prototype,"_imageViewer",void 0),e([S()],Ft.prototype,"_initialCurrentCoverageUpdate",void 0),e([S()],Ft.prototype,"_locationPointOnImage",void 0),e([S()],Ft.prototype,"_measurementService",void 0),e([S()],Ft.prototype,"_mediaPrefetcher",void 0),e([S()],Ft.prototype,"_navigationManager",void 0),e([S()],Ft.prototype,"_correctedLocationPointOnImage",void 0),e([S()],Ft.prototype,"_overlays",void 0),e([S({readOnly:!0})],Ft.prototype,"_overlaysView",null),e([S()],Ft.prototype,"_panoramicVideoViewer",void 0),e([S()],Ft.prototype,"_panoramicViewer",void 0),e([S()],Ft.prototype,"_panoramicMeasurementViewer",void 0),e([S()],Ft.prototype,"_referencePointOnGround",void 0),e([S()],Ft.prototype,"_referencePointOnImage",void 0),e([S()],Ft.prototype,"_sectorData",void 0),e([S()],Ft.prototype,"_featureToSector",void 0),e([S({readOnly:!0})],Ft.prototype,"_updatingHandles",void 0),e([S()],Ft.prototype,"footprintExtent",void 0),e([S()],Ft.prototype,"_featureChangedTask",void 0),Ft=e([k("esri.widgets.OrientedImageryViewer.OrientedImageryViewerViewModel")],Ft);const Mt=Ft;export{Mt 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import i from"../../../../core/Collection.js";import r from"../../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{mapSpaceToImageSpace as s}from"../../dataCaptureUtils.js";import{SketchHandlerMixin as c}from"../../mixins/SketchHandlerMixin.js";let d=class extends(c(t)){constructor(e){super(e),this.savedGraphics=new i,this.type="data-capture",this.pendingGraphics=new r}get collectionId(){return this.viewModel.collectionId}handleCreate(e){const{state:t,graphic:i,tool:r}=e,a=i?.geometry;if("complete"!==t||!i||!a)return;const{collectionId:o,viewModel:{dataCaptureLayer:s,currentBestFeature:c,imageGeometryField:d,oiObjectIdField:n,activeViewer:l,mode:h},pendingGraphics:u}=this,m=l?.imageSize;c&&d&&o&&n&&s&&m&&"none"!==h&&"video"!==h&&"panoramic-video"!==h&&(p(i,a,d,n,c,u,o,m,h,s),this.viewModel.emit("after-data-capture-complete",{pendingGraphics:u.get(o)?.toArray()??null}),this.viewModel.sketch?.create(r))}handleDelete(e){const{dataCaptureLayer:t}=this.viewModel;if(!t)return;const{graphics:i}=e;this.pendingGraphics.get(t.id)?.removeMany(i),this.savedGraphics.removeMany(i),this.viewModel.deleteDataCaptureFeatures(n(i,t.objectIdField))}handleDestroy(){const{dataCaptureLayer:e}=this.viewModel;e&&(this.viewModel.stopDataCapture(),this.savedGraphics.removeAll(),this.pendingGraphics=null)}handleUpdate(e){const{toolEventInfo:t,state:i,graphics:r}=e;if(t)this.viewModel.sketch?.undo();else switch(i){case"complete":this.viewModel.emit("deselect-data-capture-features",{graphics:r});break;case"start":this.viewModel.emit("select-data-capture-features",{graphics:r})}}};function p(e,t,r,a,o,c,d,p,n,l){e.sourceLayer=l,e.attributes=e.attributes??{},e.attributes[r]=btoa(JSON.stringify({geometry:s(t.clone(),n,p).toJSON()})),e.attributes[a]=o.attributes.objectId,c.has(d)||c.set(d,new i);c.get(d).add(e)}function n(e,t){return e.map(({attributes:e})=>t?e[t]:null).filter(Boolean)}e([a()],d.prototype,"collectionId",null),e([a()],d.prototype,"savedGraphics",void 0),e([a()],d.prototype,"type",void 0),e([a()],d.prototype,"pendingGraphics",void 0),d=e([o("esri.widgets.OrientedImageryViewer.adapters.sketch.DataCaptureAdapter")],d);const l=d;export{l as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../../core/Accessor.js";import r from"../../../../core/Collection.js";import i from"../../../../core/ReactiveMap.js";import{property as a,subclass as o}from"../../../../core/accessorSupport/decorators.js";import{SketchHandlerMixin as s}from"../../mixins/SketchHandlerMixin.js";import{mapSpaceToImageSpace as c}from"../../support/dataCaptureUtils.js";let p=class extends(s(t)){constructor(e){super(e),this.savedGraphics=new r,this.type="data-capture",this.pendingGraphics=new i}get collectionId(){return this.viewModel.collectionId}handleCreate(e){const{state:t,graphic:r,tool:i}=e,a=r?.geometry;if("complete"!==t||!r||!a)return;const{collectionId:o,viewModel:{dataCaptureLayer:s,currentBestFeature:c,imageGeometryField:p,oiObjectIdField:n,activeViewer:l,mode:h},pendingGraphics:u}=this,m=l?.imageSize;c&&p&&o&&n&&s&&m&&"none"!==h&&"video"!==h&&"panoramic-video"!==h&&(d(r,a,p,n,c,u,o,m,h,s),this.viewModel.emit("after-data-capture-complete",{pendingGraphics:u.get(o)?.toArray()??null}),this.viewModel.sketch?.create(i))}handleDelete(e){const{dataCaptureLayer:t}=this.viewModel;if(!t)return;const{graphics:r}=e;this.pendingGraphics.get(t.id)?.removeMany(r),this.savedGraphics.removeMany(r),this.viewModel.deleteDataCaptureFeatures(n(r,t.objectIdField))}handleDestroy(){const{dataCaptureLayer:e}=this.viewModel;e&&(this.viewModel.stopDataCapture(),this.savedGraphics.removeAll(),this.pendingGraphics=null)}handleUpdate(e){const{toolEventInfo:t,state:r,graphics:i}=e;if(t)this.viewModel.sketch?.undo();else switch(r){case"complete":this.viewModel.emit("deselect-data-capture-features",{graphics:i});break;case"start":this.viewModel.emit("select-data-capture-features",{graphics:i})}}};function d(e,t,i,a,o,s,p,d,n,l){e.sourceLayer=l,e.attributes=e.attributes??{},e.attributes[i]=btoa(JSON.stringify({geometry:c(t.clone(),n,d).toJSON()})),e.attributes[a]=o.attributes.objectId,s.has(p)||s.set(p,new r);s.get(p).add(e)}function n(e,t){return e.map(({attributes:e})=>t?e[t]:null).filter(Boolean)}e([a()],p.prototype,"collectionId",null),e([a()],p.prototype,"savedGraphics",void 0),e([a()],p.prototype,"type",void 0),e([a()],p.prototype,"pendingGraphics",void 0),p=e([o("esri.widgets.OrientedImageryViewer.adapters.sketch.DataCaptureAdapter")],p);const l=p;export{l 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{EsriPromise as t}from"../../../../core/Promise.js";import{throwIfAborted as a}from"../../../../core/promiseUtils.js";import{property as i,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../../geometry/projectionUtils.js";import{convertSphereVertexToPixelLocation as n}from"../../../../layers/orientedImagery/transformations/utils.js";import{getModeCorrectedPoints as o,computeTriangulatedVector as c,computeTriangulatedAreaMeasurement as m,computeTriangulatedDistanceMeasurement as u}from"../../imageMeasurementUtils.js";import{TriangulatedSketchHandlerMixin as l}from"../../mixins/TriangulatedSketchHandlerMixin.js";let d=[],p=class extends(l(t)){constructor(e){super(e),this.type="measurement"}async handleUpdate(e){const{measureType:t,updatingTriangularMeasurementState:a}=this.viewModel;if(this._preventLeftMouseDrag(),"distance"===t){const t=e.graphics[0].geometry;d=t.paths[0]}else if("area"===t){const t=e.graphics[0].geometry;d=t.rings[0]}"complete"===e.state&&(this.viewModel.triangulatedMeasurementGraphic=e.graphics.at(-1),a?await this._updateTriangularMeasurements(d):await this.viewModel.processMeasurementVectors(d))}async _computeMeasurementVector(e,t){const{activeViewer:a,mode:i,view:r}=this.viewModel,n=a?.imageSize;if(!e||!t||!n)return;const m=o(e,i,n),u=r?.spatialReference,l=[];for(let o=0;o<m.length;o++){const e={x:m[o][0],y:m[o][1]};let a=await this.viewModel.getMapPoint(e,{feature:t,imageSize:n,mode:i});u&&!a.spatialReference.equals(u)&&(a=await s(a,u)),l.push(a)}return c(l,t)}async _updateTriangularMeasurements(e,t){const{measureType:i,mode:r,activeTriangulatedViewer:s,triangularMeasurementActive:o,currentBestFeatureMeasurementImage:c,updatingTriangularMeasurementState:l}=this.viewModel;if(!(o&&c&&l&&s?.imageSize&&2===this.viewModel.measurementVectors?.length))return;const[d,p]=s.imageSize;this.viewModel.measurementVectors.splice(-1);const g=await this._computeMeasurementVector(e,c);if(a(t),g&&this.viewModel.measurementVectors.push(g),2===this.viewModel.measurementVectors.length){switch(i){case"distance":{this.viewModel.triangulatedDistanceMeasurement=await u(this.viewModel.measurementVectors),a(t);const i=e.map(([e,t,a])=>{const{x:i,y:r}=n({x:e,y:t,z:a},d,p);return[i,r]}),s="default"===r?await this.viewModel.calculateAccuracy(e,"distance"):await this.viewModel.calculateAccuracyPanoramic(i,"distance",!0);if(a(t),s&&this.viewModel.triangulatedDistanceMeasurement?.distance){const e=Math.atan(s/this.viewModel.triangulatedDistanceMeasurement.distance);this.viewModel.triangulatedDistanceAccuracy={distanceAccuracy:s,angleAccuracy:e}}break}case"area":if(c?.geometry.spatialReference){const e=await m(this.viewModel.measurementVectors,c.geometry.spatialReference);a(t),this.viewModel.triangulatedAreaMeasurement=e}}if(this.viewModel.updatingTriangularMeasurementState=!1,"panoramic"===this.viewModel.mode){this.viewModel.activeTriangulatedViewer.viewModel.restoreNavigationHandles()}}}_preventLeftMouseDrag(){const{mode:e,activeTriangulatedViewer:t}=this.viewModel;if("panoramic"!==e||!t)return;let a=null;t.imageRenderer.on("pointer-down",e=>{a=e.button}),t.imageRenderer.on("drag",e=>{0===a&&e.stopPropagation()})}};e([i()],p.prototype,"type",void 0),p=e([r("esri.widgets.OrientedImageryViewer.adapters.sketch.TriangulatedMeasurementAdapter")],p);const g=p;export{g as default};
5
+ import{__decorate as e}from"tslib";import{EsriPromise as t}from"../../../../core/Promise.js";import{throwIfAborted as a}from"../../../../core/promiseUtils.js";import{property as i,subclass as r}from"../../../../core/accessorSupport/decorators.js";import{projectAsync as s}from"../../../../geometry/projectionUtils.js";import{convertSphereVertexToPixelLocation as n}from"../../../../layers/orientedImagery/transformations/utils.js";import{getModeCorrectedPoints as o,computeTriangulatedVector as c,computeTriangulatedAreaMeasurement as m,computeTriangulatedDistanceMeasurement as u}from"../../imageMeasurementUtils.js";import{TriangulatedSketchHandlerMixin as l}from"../../mixins/TriangulatedSketchHandlerMixin.js";let d=[],p=class extends(l(t)){constructor(e){super(e),this.type="measurement"}async handleUpdate(e){const{measureType:t,updatingTriangularMeasurementState:a}=this.viewModel;if(this._preventLeftMouseDrag(),"distance"===t){const t=e.graphics[0].geometry;d=t.paths[0]}else if("area"===t){const t=e.graphics[0].geometry;d=t.rings[0]}"complete"===e.state&&(this.viewModel.triangulatedMeasurementGraphic=e.graphics.at(-1),a?await this._updateTriangularMeasurements(d):await this.viewModel.processMeasurementVectors(d))}async _computeMeasurementVector(e,t){const{activeViewer:a,mode:i,view:r}=this.viewModel,n=a?.imageSize;if(!e||!t||!n)return;const m=o(e,i,n),u=r?.spatialReference,l=[];for(let o=0;o<m.length;o++){const e={x:m[o][0],y:m[o][1]};let t=await this.viewModel.getMapPoint(e);u&&!t.spatialReference.equals(u)&&(t=await s(t,u)),l.push(t)}return c(l,t)}async _updateTriangularMeasurements(e,t){const{measureType:i,mode:r,activeTriangulatedViewer:s,triangularMeasurementActive:o,currentBestFeatureMeasurementImage:c,updatingTriangularMeasurementState:l}=this.viewModel;if(!(o&&c&&l&&s?.imageSize&&2===this.viewModel.measurementVectors?.length))return;const[d,p]=s.imageSize;this.viewModel.measurementVectors.splice(-1);const g=await this._computeMeasurementVector(e,c);if(a(t),g&&this.viewModel.measurementVectors.push(g),2===this.viewModel.measurementVectors.length){switch(i){case"distance":{this.viewModel.triangulatedDistanceMeasurement=await u(this.viewModel.measurementVectors),a(t);const i=e.map(([e,t,a])=>{const{x:i,y:r}=n({x:e,y:t,z:a},d,p);return[i,r]}),s="default"===r?await this.viewModel.calculateAccuracy(e,"distance"):await this.viewModel.calculateAccuracyPanoramic(i,"distance",!0);if(a(t),s&&this.viewModel.triangulatedDistanceMeasurement?.distance){const e=Math.atan(s/this.viewModel.triangulatedDistanceMeasurement.distance);this.viewModel.triangulatedDistanceAccuracy={distanceAccuracy:s,angleAccuracy:e}}break}case"area":if(c?.geometry.spatialReference){const e=await m(this.viewModel.measurementVectors,c.geometry.spatialReference);a(t),this.viewModel.triangulatedAreaMeasurement=e}}if(this.viewModel.updatingTriangularMeasurementState=!1,"panoramic"===this.viewModel.mode){this.viewModel.activeTriangulatedViewer.viewModel.restoreNavigationHandles()}}}_preventLeftMouseDrag(){const{mode:e,activeTriangulatedViewer:t}=this.viewModel;if("panoramic"!==e||!t)return;let a=null;t.imageRenderer.on("pointer-down",e=>{a=e.button}),t.imageRenderer.on("drag",e=>{0===a&&e.stopPropagation()})}};e([i()],p.prototype,"type",void 0),p=e([r("esri.widgets.OrientedImageryViewer.adapters.sketch.TriangulatedMeasurementAdapter")],p);const g=p;export{g 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Graphic.js";import{isSome as t}from"../../../../core/arrayUtils.js";import i from"../../../../core/Logger.js";import{waitTick as o,throwIfAborted as r,isAbortError as a}from"../../../../core/promiseUtils.js";import s from"../../../../geometry/Polygon.js";import{projectAsync as n}from"../../../../geometry/projectionUtils.js";import{convertOrientationToPixelLocation as l}from"../../../../layers/orientedImagery/transformations/utils.js";import{fixedImageSize as c}from"../../constants.js";import{activePolygonSymbol as p,polygonSymbol as u}from"../../symbols.js";class m{constructor(m){this.viewModel=m,this.createFootprints=async t=>{await o(t);const{coveragePolygons:i,currentBestFeature:r,isAdditionalCoverageVisible:a}=this.viewModel;for(const o of i)o?.imageID===r.attributes.objectId?this.viewModel.bestFeatureFootprint=new e({attributes:{imageID:o?.imageID},geometry:o,symbol:p,visible:!1}):this.viewModel.additionalFootprints.push(new e({attributes:{imageID:o?.imageID},geometry:o,symbol:u.clone(),visible:a}))},this.updateFootprint=async(o,l,u)=>{const{activeViewer:m,mode:d,currentBestFeature:g,currentCoverageVisible:v,footprintExtent:f}=this.viewModel,w="video"===d?c:m?.imageSize,h=l??g;if(g&&w&&f&&h)try{const i=await this.viewModel.getMapPoint(o,{feature:h,mode:"default",imageSize:w});r(u);const a=i.filter(t);if(!a.length)return;const l=[a.map(({x:e,y:t})=>[e,t,1])];l[0].push(l[0][0]);const c=new s({rings:l,spatialReference:a[0].spatialReference}),m=this.viewModel.view?.spatialReference.equals(c.spatialReference)?c:await n(c,this.viewModel.view.spatialReference,u);this.viewModel.updateCurrentCoveragePolygon(new e({geometry:m,attributes:{imageID:h.attributes.objectId},symbol:p,visible:v}))}catch(y){a(y)||i.getLogger(this.viewModel).error("update-footprint",y)}else this.viewModel.updateCurrentCoveragePolygon(null)},this.updateFootprintPanorama=async(t,i)=>{const{horizontalFieldOfView:o,pitch:a,verticalFieldOfView:u,yaw:m,feature:d}=t,{activeViewer:g,currentBestFeature:v,currentCoverageVisible:f,footprintExtent:w,mode:h}=this.viewModel,y="video"===h||"panoramic-video"===h?c:g?.imageSize,b=d??v;if(!b||!y||!w)return void this.viewModel.updateCurrentCoveragePolygon(null);const{cameraPitch:M,objectId:C}=b.attributes;if(a+M-u/2>180)return void this.viewModel.updateCurrentCoveragePolygon(null);const j=[],P=u/2,F=o/2,I=a-P,R=M+I,D=M+(a+P);if(R>180)return void this.viewModel.updateCurrentCoveragePolygon(null);const V=I<0,x=[-F,P],z=[F,P],S=[F,-P],B=[-F,-P];if(R<180&&D>180){j.push(V?S:B);const e=Math.floor(o/5),t=o/e;for(let i=0;i<=e;i++)j.push([i*t-F,90-a]);j.push(V?B:S)}D<180&&(j.push(x,z),V?j.push(B,S):j.push(S,B));const U=j.map(([e,t])=>l(m+e,a+t,y[0],y[1])),q=await this.viewModel.getMapPoint(U,{feature:b,mode:"panorama",imageSize:y});r(i);const E=[q.map(({x:e,y:t})=>[e,t,1])];E[0].push(E[0][0]);const L=new s({rings:E,spatialReference:q[0].spatialReference}),O=this.viewModel.view?.spatialReference.equals(L.spatialReference)?L:await n(L,this.viewModel.view.spatialReference,i);this.viewModel.updateCurrentCoveragePolygon(new e({geometry:O,attributes:{imageID:C},symbol:p.clone(),visible:f}))}}}export{m as default};
5
+ import e from"../../../../Graphic.js";import{isSome as t}from"../../../../core/arrayUtils.js";import i from"../../../../core/Logger.js";import{waitTick as o,throwIfAborted as r,isAbortError as s}from"../../../../core/promiseUtils.js";import a from"../../../../geometry/Polygon.js";import{projectAsync as n}from"../../../../geometry/projectionUtils.js";import{convertOrientationToPixelLocation as l}from"../../../../layers/orientedImagery/transformations/utils.js";import{fixedImageSize as c}from"../../constants.js";import{activePolygonSymbol as p,polygonSymbol as u}from"../../symbols.js";class m{constructor(m){this.viewModel=m,this.createFootprints=async t=>{await o(t);const{coveragePolygons:i,currentBestFeature:r,isAdditionalCoverageVisible:s}=this.viewModel;for(const o of i)o?.imageID===r.attributes.objectId?this.viewModel.bestFeatureFootprint=new e({attributes:{imageID:o?.imageID},geometry:o,symbol:p,visible:!1}):this.viewModel.additionalFootprints.push(new e({attributes:{imageID:o?.imageID},geometry:o,symbol:u.clone(),visible:s}))},this.updateFootprint=async(o,l,u)=>{const{activeViewer:m,mode:d,currentBestFeature:v,currentCoverageVisible:g,footprintExtent:w}=this.viewModel,f=l??v;if(v&&("video"===d?c:m?.imageSize)&&w&&f)try{const i=await this.viewModel.getMapPoint(o);r(u);const s=i.filter(t);if(!s.length)return;const l=[s.map(({x:e,y:t})=>[e,t,1])];l[0].push(l[0][0]);const c=new a({rings:l,spatialReference:s[0].spatialReference}),m=this.viewModel.view?.spatialReference.equals(c.spatialReference)?c:await n(c,this.viewModel.view.spatialReference,u);this.viewModel.updateCurrentCoveragePolygon(new e({geometry:m,attributes:{imageID:f.attributes.objectId},symbol:p,visible:g}))}catch(h){s(h)||i.getLogger(this.viewModel).error("update-footprint",h)}else this.viewModel.updateCurrentCoveragePolygon(null)},this.updateFootprintPanorama=async(t,i)=>{const{horizontalFieldOfView:o,pitch:s,verticalFieldOfView:u,yaw:m,feature:d}=t,{activeViewer:v,currentBestFeature:g,currentCoverageVisible:w,footprintExtent:f,mode:h}=this.viewModel,y="video"===h||"panoramic-video"===h?c:v?.imageSize,b=d??g;if(!b||!y||!f)return void this.viewModel.updateCurrentCoveragePolygon(null);const{cameraPitch:M,objectId:C}=b.attributes;if(s+M-u/2>180)return void this.viewModel.updateCurrentCoveragePolygon(null);const j=[],P=u/2,F=o/2,I=s-P,R=M+I,D=M+(s+P);if(R>180)return void this.viewModel.updateCurrentCoveragePolygon(null);const V=I<0,x=[-F,P],z=[F,P],B=[F,-P],U=[-F,-P];if(R<180&&D>180){j.push(V?B:U);const e=Math.floor(o/5),t=o/e;for(let i=0;i<=e;i++)j.push([i*t-F,90-s]);j.push(V?U:B)}D<180&&(j.push(x,z),V?j.push(U,B):j.push(B,U));const q=j.map(([e,t])=>l(m+e,s+t,y[0],y[1])),E=await this.viewModel.getMapPoint(q);r(i);const L=[E.map(({x:e,y:t})=>[e,t,1])];L[0].push(L[0][0]);const O=new a({rings:L,spatialReference:E[0].spatialReference}),S=this.viewModel.view?.spatialReference.equals(O.spatialReference)?O:await n(O,this.viewModel.view.spatialReference,i);this.viewModel.updateCurrentCoveragePolygon(new e({geometry:S,attributes:{imageID:C},symbol:p.clone(),visible:w}))}}}export{m 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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import e from"../../../../Graphic.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{throwIfAborted as i,waitTick as o}from"../../../../core/promiseUtils.js";import a from"../../../../geometry/Mesh.js";import r from"../../../../geometry/Point.js";import{projectAsync as s}from"../../../../geometry/projectionUtils.js";import n from"../../../../geometry/support/MeshVertexAttributes.js";import{projectVertices as l,updateFrustum as c,createCoveragePolygon as p}from"../../../../layers/orientedImagery/core/coverageUtils.js";import{getMetersPerUnitOfSR as m}from"../../../../layers/orientedImagery/core/utils.js";import{fixedImageSize as u}from"../../constants.js";import{activeFrustumSymbol as f,additionalFrustumSymbol as d}from"../../symbols.js";class v{constructor(r){this.viewModel=r,this._updateBestFeatureFootprintElevation=!1,this._updatedElevationSampler=null,this.createFootprints=async o=>{const{coverageFrustums:r,currentBestFeature:c,isAdditionalCoverageVisible:p,view:m}=this.viewModel,u=r.filter(t);for(const t of u){let r=t.clone();if(!m.spatialReference.equals(r.spatialReference)){const{components:e,spatialReference:t,origin:c,vertexAttributes:p,vertexSpace:u}=r;if("local"===u.type){const e=await s(c,m.spatialReference,o);i(o),r.centerAt(e)}else{const s=p.position,c=Float64Array.from(await l([...s],t.clone(),m.spatialReference.clone(),o));i(o),r=new a({vertexAttributes:new n({position:c}),components:e,spatialReference:m.spatialReference.clone()})}}t.imageID===c.attributes.objectId?(this._updateBestFeatureFootprintElevation=!0,this.viewModel.bestFeatureFootprint=new e({attributes:{imageID:t.imageID},geometry:r,symbol:f.clone(),visible:!1})):this.viewModel.additionalFootprints.push(new e({attributes:{imageID:t.imageID},geometry:r,symbol:d.clone(),visible:p}))}},this.updateFootprint=async(o,a,r)=>{const{bestFeatureFootprint:n,currentBestFeature:l,activeViewer:p,footprintExtent:m,view:d,mode:v}=this.viewModel,y="video"===v?u:p?.imageSize,b=a??l;if(!(l&&n?.geometry&&y&&m&&b&&d?.spatialReference))return void this.viewModel.updateCurrentCoveragePolygon(null);const{attributes:{cameraHeight:F,location:R,cameraPitch:M,horizontalFieldOfView:A,verticalFieldOfView:x,cameraRoll:E},elevationSample:S}=b;let j=null;if(a&&(this._updatedElevationSampler=l.elevationSample,j=await h(a,d.spatialReference),this._updatedElevationSampler)){const e=this._updatedElevationSampler?.extent,t=a.attributes.geometry;if(e&&!e.contains(t)){const e=this.viewModel.selectedPoint;if(!e)return;e.x=a.geometry.x,e.y=a.geometry.y;const t=await this.viewModel.processFeatureElevation([a],e);t&&(this._updatedElevationSampler=t)}const[i]=g([j],this._updatedElevationSampler,a);i&&(j=i)}S&&this._updateBestFeatureFootprintElevation&&(this.updateGroundElevation([n]),this._updateBestFeatureFootprintElevation=!1);const I=R.toArray(),V=a&&j?j:n,{vertexAttributes:{position:P},spatialReference:z}=V.geometry,C=await w(P,z,R.spatialReference),_=await this.viewModel.getMapPoint(o,{feature:b,mode:"default",imageSize:y});i(r);let D=_.filter(t);if(!D.length)return;D[0].spatialReference.equals(R.spatialReference)||(D=await Promise.all(D.map(async e=>{const t=await s(e,R.spatialReference,r);return i(r),t})));const B=await c(o.map(({x:e,y:t})=>[e,t]),D.map(e=>e.toArray()),{cameraHeight:F,cameraLocation:I,cameraPitch:M,frustumVertices:C,horizontalFieldOfView:A,imageHeight:y[1],imageWidth:y[0],inSRS:{wkid:R.spatialReference.wkid},outSRS:{wkid:d.spatialReference.wkid},verticalFieldOfView:x,cameraRoll:E??0,options:r});this.viewModel.updateCurrentCoveragePolygon(new e({attributes:{imageID:b.attributes.objectId},geometry:B,symbol:f.clone(),visible:this.viewModel.currentCoverageVisible}))},this.updateFootprintPanorama=async(t,i)=>{await o(i);const{horizontalFieldOfView:a,pitch:r,verticalFieldOfView:n,yaw:l,feature:c}=t,m=c?.clone()??this.viewModel.currentBestFeature?.clone();if(!m)return;const{attributes:u}=m;u.orientedImageryType=null,u.cameraHeading=(l+u.cameraHeading)%360,u.cameraPitch=r,u.horizontalFieldOfView=a,u.verticalFieldOfView=n,u.cameraRoll=0;const{frustum:d}=p(u);if(!d)return void this.viewModel.updateCurrentCoveragePolygon(null);const v=this.viewModel.view?.spatialReference.equals(d.spatialReference)?d.clone():await s(d.clone(),this.viewModel.view?.spatialReference,i);this.viewModel.updateCurrentCoveragePolygon(new e({attributes:{imageID:u.objectId},geometry:v,symbol:f.clone(),visible:this.viewModel.currentCoverageVisible}))}}updateGroundElevation(e){const{geometry:t,attributes:{elevation:i}}=this.viewModel.currentBestFeature,o=(i??0)*m(t.spatialReference);e.forEach(e=>{const{geometry:t}=e;switch(t?.type){case"mesh":{const{vertexAttributes:{position:e}}=t,i=Math.floor(e.length/3);for(let a=0;a<i;a+=1)e[3*a+2]+=o/m(t.spatialReference);break}case"point":t.z=(t.z??0)+o/m(t.spatialReference)}})}}async function w(e,t,i,o){return Float64Array.from((await Promise.all(e.reduce((e,t,i)=>{const o=Math.floor(i/3);return e[o]=e[o]??[],e[o].push(t),e},new Array).map(async e=>(await s(new r(e,t),i,o)).toArray()))).flat())}const h=async(t,o,r)=>{const{frustum:c}=p(t.attributes);let m=c.clone();if(!o.equals(m.spatialReference)){const{components:e,spatialReference:t,origin:o,vertexAttributes:c,vertexSpace:p}=m;if("local"===p.type){const e=await s(o,t,r);i(r),m.centerAt(e)}else{const o=c.position,s=Float64Array.from(await l([...o],t.clone(),t.clone(),r));i(r),m=new a({vertexAttributes:new n({position:s}),components:e,spatialReference:t.clone()})}}return new e({attributes:{imageID:c.imageID},geometry:m,symbol:f.clone(),visible:!1})},g=(e,t,i)=>{const{geometry:o}=i,a=t.queryElevation(o);for(const r of e){const{geometry:e}=r;switch(e?.type){case"mesh":{const{vertexAttributes:{position:t}}=e,i=Math.floor(t.length/3);for(let e=0;e<i;e++)t[3*e+2]+=a?.z??0;break}case"point":e.z=(e.z??0)+(a?.z??0)}}return e};export{v as default};
5
+ import e from"../../../../Graphic.js";import{isSome as t}from"../../../../core/arrayUtils.js";import{throwIfAborted as i,waitTick as o}from"../../../../core/promiseUtils.js";import a from"../../../../geometry/Mesh.js";import r from"../../../../geometry/Point.js";import{projectAsync as s}from"../../../../geometry/projectionUtils.js";import n from"../../../../geometry/support/MeshVertexAttributes.js";import{projectVertices as l,updateFrustum as c,createCoveragePolygon as p}from"../../../../layers/orientedImagery/core/coverageUtils.js";import{getMetersPerUnitOfSR as m}from"../../../../layers/orientedImagery/core/utils.js";import{fixedImageSize as u}from"../../constants.js";import{activeFrustumSymbol as f,additionalFrustumSymbol as d}from"../../symbols.js";class v{constructor(r){this.viewModel=r,this._updateBestFeatureFootprintElevation=!1,this._updatedElevationSampler=null,this.createFootprints=async o=>{const{coverageFrustums:r,currentBestFeature:c,isAdditionalCoverageVisible:p,view:m}=this.viewModel,u=r.filter(t);for(const t of u){let r=t.clone();if(!m.spatialReference.equals(r.spatialReference)){const{components:e,spatialReference:t,origin:c,vertexAttributes:p,vertexSpace:u}=r;if("local"===u.type){const e=await s(c,m.spatialReference,o);i(o),r.centerAt(e)}else{const s=p.position,c=Float64Array.from(await l([...s],t.clone(),m.spatialReference.clone(),o));i(o),r=new a({vertexAttributes:new n({position:c}),components:e,spatialReference:m.spatialReference.clone()})}}t.imageID===c.attributes.objectId?(this._updateBestFeatureFootprintElevation=!0,this.viewModel.bestFeatureFootprint=new e({attributes:{imageID:t.imageID},geometry:r,symbol:f.clone(),visible:!1})):this.viewModel.additionalFootprints.push(new e({attributes:{imageID:t.imageID},geometry:r,symbol:d.clone(),visible:p}))}},this.updateFootprint=async(o,a,r)=>{const{bestFeatureFootprint:n,currentBestFeature:l,activeViewer:p,footprintExtent:m,view:d,mode:v}=this.viewModel,g="video"===v?u:p?.imageSize,b=a??l;if(!(l&&n?.geometry&&g&&m&&b&&d?.spatialReference))return void this.viewModel.updateCurrentCoveragePolygon(null);const{attributes:{cameraHeight:F,location:R,cameraPitch:M,horizontalFieldOfView:A,verticalFieldOfView:x,cameraRoll:E},elevationSample:j}=b;let I=null;if(a&&(this._updatedElevationSampler=l.elevationSample,I=await h(a,d.spatialReference),this._updatedElevationSampler)){const e=this._updatedElevationSampler?.extent,t=a.attributes.geometry;if(e&&!e.contains(t)){const e=this.viewModel.selectedPoint;if(!e)return;e.x=a.geometry.x,e.y=a.geometry.y;const t=await this.viewModel.processFeatureElevation([a],e);t&&(this._updatedElevationSampler=t)}const[i]=y([I],this._updatedElevationSampler,a);i&&(I=i)}j&&this._updateBestFeatureFootprintElevation&&(this.updateGroundElevation([n]),this._updateBestFeatureFootprintElevation=!1);const S=R.toArray(),V=a&&I?I:n,{vertexAttributes:{position:P},spatialReference:z}=V.geometry,C=await w(P,z,R.spatialReference),_=await this.viewModel.getMapPoint(o);i(r);let D=_.filter(t);if(!D.length)return;D[0].spatialReference.equals(R.spatialReference)||(D=await Promise.all(D.map(async e=>{const t=await s(e,R.spatialReference,r);return i(r),t})));const B=await c(o.map(({x:e,y:t})=>[e,t]),D.map(e=>e.toArray()),{cameraHeight:F,cameraLocation:S,cameraPitch:M,frustumVertices:C,horizontalFieldOfView:A,imageHeight:g[1],imageWidth:g[0],inSRS:{wkid:R.spatialReference.wkid},outSRS:{wkid:d.spatialReference.wkid},verticalFieldOfView:x,cameraRoll:E??0,options:r});this.viewModel.updateCurrentCoveragePolygon(new e({attributes:{imageID:b.attributes.objectId},geometry:B,symbol:f.clone(),visible:this.viewModel.currentCoverageVisible}))},this.updateFootprintPanorama=async(t,i)=>{await o(i);const{horizontalFieldOfView:a,pitch:r,verticalFieldOfView:n,yaw:l,feature:c}=t,m=c?.clone()??this.viewModel.currentBestFeature?.clone();if(!m)return;const{attributes:u}=m;u.orientedImageryType=null,u.cameraHeading=(l+u.cameraHeading)%360,u.cameraPitch=r,u.horizontalFieldOfView=a,u.verticalFieldOfView=n,u.cameraRoll=0;const{frustum:d}=p(u);if(!d)return void this.viewModel.updateCurrentCoveragePolygon(null);const v=this.viewModel.view?.spatialReference.equals(d.spatialReference)?d.clone():await s(d.clone(),this.viewModel.view?.spatialReference,i);this.viewModel.updateCurrentCoveragePolygon(new e({attributes:{imageID:u.objectId},geometry:v,symbol:f.clone(),visible:this.viewModel.currentCoverageVisible}))}}updateGroundElevation(e){const{geometry:t,attributes:{elevation:i}}=this.viewModel.currentBestFeature,o=(i??0)*m(t.spatialReference);e.forEach(e=>{const{geometry:t}=e;switch(t?.type){case"mesh":{const{vertexAttributes:{position:e}}=t,i=Math.floor(e.length/3);for(let a=0;a<i;a+=1)e[3*a+2]+=o/m(t.spatialReference);break}case"point":t.z=(t.z??0)+o/m(t.spatialReference)}})}}async function w(e,t,i,o){return Float64Array.from((await Promise.all(e.reduce((e,t,i)=>{const o=Math.floor(i/3);return e[o]=e[o]??[],e[o].push(t),e},new Array).map(async e=>(await s(new r(e,t),i,o)).toArray()))).flat())}const h=async(t,o,r)=>{const{frustum:c}=p(t.attributes);let m=c.clone();if(!o.equals(m.spatialReference)){const{components:e,spatialReference:t,origin:o,vertexAttributes:c,vertexSpace:p}=m;if("local"===p.type){const e=await s(o,t,r);i(r),m.centerAt(e)}else{const o=c.position,s=Float64Array.from(await l([...o],t.clone(),t.clone(),r));i(r),m=new a({vertexAttributes:new n({position:s}),components:e,spatialReference:t.clone()})}}return new e({attributes:{imageID:c.imageID},geometry:m,symbol:f.clone(),visible:!1})},y=(e,t,i)=>{const{geometry:o}=i,a=t.queryElevation(o);for(const r of e){const{geometry:e}=r;switch(e?.type){case"mesh":{const{vertexAttributes:{position:t}}=e,i=Math.floor(t.length/3);for(let e=0;e<i;e++)t[3*e+2]+=a?.z??0;break}case"point":e.z=(e.z??0)+(a?.z??0)}}return e};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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{IdentifiableMixin as s}from"../../../core/Identifiable.js";import{watch as a,syncAndInitial as i,on as o}from"../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isEditableLayer as n}from"../../../layers/support/editableLayers.js";import c from"../../../support/actions/ActionToggle.js";import d from"../../Widget.js";import{css as h}from"../css.js";import{isValidDataCaptureLayer as p}from"../dataCaptureUtils.js";import m from"./OverlayLayersList.js";import{loadCalciteComponents as u}from"../../support/componentsUtils.js";import{globalCss as y}from"../../support/globalCss.js";import{tsx as g}from"../../support/widget.js";let L=class extends(s(d)){constructor(e){super(e),this._previousAction=null,this.closed=!1,this.dataCaptureEnabled=!1,this.dataCaptureLayer=null,this.imageGeometryField=null,this.imageReferenceField=null,this.layerList=new m({selectionMode:"multiple"}),this.messages=null,this.overlayedLayers=new t,this.showCameraLocations=!1,this.showMapFeatures=!1,this._createSelectedItemsHandle=()=>{this.removeHandles("selected-items"),this.addHandles(this._trackLayerSelectionChanges(),"selected-items")},this._createDataCaptureLayerHandle=()=>a(()=>({dataCaptureLayer:this.dataCaptureLayer,operationalItems:this.layerList.operationalItems}),({dataCaptureLayer:e,operationalItems:t},s)=>{if(!e&&s?.dataCaptureLayer){const e=t.find(e=>e.layer===s.dataCaptureLayer);e&&e.actionsSections?.items.forEach(e=>{e.items.forEach(e=>{"create-features"===e.id&&(e.value=!1)})})}},i),this._handleSelectedItemsChange=({added:e,removed:t})=>{e.forEach(e=>{this.overlayedLayers.includes(e.layer)||this.onLayerSelected?.(e)}),t.forEach(e=>{this.overlayedLayers.includes(e.layer)&&this.onLayerDeselected?.(e)}),this.overlayedLayers.removeAll(),this.overlayedLayers.addMany(this.layerList.selectedItems.items.map(e=>e.layer))},this._layerListTriggerActionHandle=()=>o(()=>this.layerList,"trigger-action",e=>{const{action:t,item:{layer:s}}=e;switch(this._resetPreviousAction(t),t.id){case"create-features":this._toggleDataCaptureLayer(t,s);break;case"show-all-features":{const e=s?.id;e&&this.onFilterCapturedFeatures?.(e);break}}}),this._resetPreviousAction=e=>{"toggle"===this._previousAction?.type&&this._previousAction!==e&&(this._previousAction.value=!1,this._previousAction=null)},this._toggleDataCaptureLayer=(e,t)=>{this._previousAction=e;const s=e.value;this.dataCaptureLayer=s?t:null,this.onDataCaptureLayerChanged?.(this.dataCaptureLayer)},this._trackLayerSelectionChanges=()=>o(()=>this.layerList.selectedItems,"change",this._handleSelectedItemsChange),this._watchLayerListForListItemCreatedFunction=()=>a(()=>({layerList:this.layerList,listItemCreatedFunction:this._listItemCreatedFunction}),()=>{this.layerList.listItemCreatedFunction=this._listItemCreatedFunction},i),this._watchSelectedItems=()=>a(()=>this.layerList.selectedItems,this._createSelectedItemsHandle,i)}initialize(){this.addHandles([this._watchSelectedItems(),this._layerListTriggerActionHandle(),this._watchLayerListForListItemCreatedFunction(),this._createDataCaptureLayerHandle()])}loadDependencies(){return u({list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}get _listItemCreatedFunction(){const{dataCaptureEnabled:e,imageGeometryField:t,imageReferenceField:s}=this;return e&&t&&s?async e=>{const{item:a}=e,i=a.layer,{dataCaptureLayer:o,overlayedLayers:r,messages:{createFeaturesFromImage:l,showFeatures:c},layerList:d}=this,h=r.includes(i),{selectedItems:m}=d;if(C(h,m,a),await(i?.load()),!i||!p(i,t,s)||!n(i))return;const u=o===i,y=_([l,c],a,m,u);u&&(this._previousAction=y)}:null}get view(){return this.layerList?.view}set view(e){this.layerList.view=e}_renderCameraLocationsSwitch(e){return g("calcite-list-item",{bind:this,label:this.messages.overlayCameraLocations,onclick:this._toggleShowCameraLocations},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowCameraLocations,scale:"s",slot:"actions-end"}))}_renderOverlayMapFeatures(e){return g("calcite-list-item",{bind:this,label:this.messages?.overlayMapFeatures,onclick:this._toggleShowMapFeatures},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowMapFeatures,scale:"s",slot:"actions-end"}))}_renderList(e){return e?g("div",{class:h.imageOverlaysLayerList},this.layerList.render()):null}_renderPanel(){const{closed:e,messages:t,showCameraLocations:s,showMapFeatures:a}=this;return g("calcite-panel",{bind:this,closable:!0,closed:e,heading:t.imageOverlays,onCalcitePanelClose:this.onImageOverlaysClosed},g("calcite-list",{label:t.imageOverlays},this._renderCameraLocationsSwitch(s),this._renderOverlayMapFeatures(a)),this._renderList(a))}_toggleShowCameraLocations(e){e.stopPropagation(),this.showCameraLocations=!this.showCameraLocations,this.onShowCameraLocationsChanged?.(this.showCameraLocations)}_toggleShowMapFeatures(e){e.stopPropagation(),this.showMapFeatures=!this.showMapFeatures,this.onShowMapFeaturesChanged?.(this.showMapFeatures)}render(){const e=this.layerList.operationalItems.items.length,t=this.showMapFeatures&&0===e,s=this.showMapFeatures&&e>0,a={[y.widget]:!0,[h.imageOverlaysNoResult]:t,[h.imageOverlaysIncreasedHeight]:s,[h.imageOverlays]:!t&&!s};return g("div",{class:this.classes(a)},this._renderPanel())}};e([r()],L.prototype,"_previousAction",void 0),e([r()],L.prototype,"_listItemCreatedFunction",null),e([r()],L.prototype,"closed",void 0),e([r()],L.prototype,"dataCaptureEnabled",void 0),e([r()],L.prototype,"dataCaptureLayer",void 0),e([r()],L.prototype,"imageGeometryField",void 0),e([r()],L.prototype,"imageReferenceField",void 0),e([r()],L.prototype,"layerList",void 0),e([r()],L.prototype,"messages",void 0),e([r()],L.prototype,"onDataCaptureLayerChanged",void 0),e([r()],L.prototype,"onFilterCapturedFeatures",void 0),e([r()],L.prototype,"onImageOverlaysClosed",void 0),e([r()],L.prototype,"onLayerDeselected",void 0),e([r()],L.prototype,"onLayerSelected",void 0),e([r()],L.prototype,"onShowCameraLocationsChanged",void 0),e([r()],L.prototype,"onShowMapFeaturesChanged",void 0),e([r()],L.prototype,"overlayedLayers",void 0),e([r()],L.prototype,"showCameraLocations",void 0),e([r()],L.prototype,"showMapFeatures",void 0),e([r()],L.prototype,"view",null),L=e([l("esri.widgets.OrientedImageryViewer.components.ImageOverlays")],L);const v=L;function C(e,t,s){e&&t.push(s)}function w(e,s){const a=new t;a.add(e[0]),a.add(e[1]),s.actionsSections=new t([a])}function _(e,t,s,o=!1){const r=new c({icon:"pencil",id:"create-features",title:e[0],value:o}),l=new c({icon:"list-show-all",id:"show-all-features",title:e[1],value:o});return t.addHandles(a(()=>s.includes(t),e=>{r.visible=e,l.visible=e},i)),w([r,l],t),r}export{v as default};
5
+ import{__decorate as e}from"tslib";import t from"../../../core/Collection.js";import{IdentifiableMixin as s}from"../../../core/Identifiable.js";import{watch as a,syncAndInitial as i,on as o}from"../../../core/reactiveUtils.js";import{property as r,subclass as l}from"../../../core/accessorSupport/decorators.js";import{isEditableLayer as n}from"../../../layers/support/editableLayers.js";import c from"../../../support/actions/ActionToggle.js";import d from"../../Widget.js";import{css as h}from"../css.js";import p from"./OverlayLayersList.js";import{isValidDataCaptureLayer as m}from"../support/typeUtils.js";import{loadCalciteComponents as u}from"../../support/componentsUtils.js";import{globalCss as y}from"../../support/globalCss.js";import{tsx as g}from"../../support/widget.js";let L=class extends(s(d)){constructor(e){super(e),this._previousAction=null,this.closed=!1,this.dataCaptureEnabled=!1,this.dataCaptureLayer=null,this.imageGeometryField=null,this.imageReferenceField=null,this.layerList=new p({selectionMode:"multiple"}),this.messages=null,this.overlayedLayers=new t,this.showCameraLocations=!1,this.showMapFeatures=!1,this._createSelectedItemsHandle=()=>{this.removeHandles("selected-items"),this.addHandles(this._trackLayerSelectionChanges(),"selected-items")},this._createDataCaptureLayerHandle=()=>a(()=>({dataCaptureLayer:this.dataCaptureLayer,operationalItems:this.layerList.operationalItems}),({dataCaptureLayer:e,operationalItems:t},s)=>{if(!e&&s?.dataCaptureLayer){const e=t.find(e=>e.layer===s.dataCaptureLayer);e&&e.actionsSections?.items.forEach(e=>{e.items.forEach(e=>{"create-features"===e.id&&(e.value=!1)})})}},i),this._handleSelectedItemsChange=({added:e,removed:t})=>{e.forEach(e=>{this.overlayedLayers.includes(e.layer)||this.onLayerSelected?.(e)}),t.forEach(e=>{this.overlayedLayers.includes(e.layer)&&this.onLayerDeselected?.(e)}),this.overlayedLayers.removeAll(),this.overlayedLayers.addMany(this.layerList.selectedItems.items.map(e=>e.layer))},this._layerListTriggerActionHandle=()=>o(()=>this.layerList,"trigger-action",e=>{const{action:t,item:{layer:s}}=e;switch(this._resetPreviousAction(t),t.id){case"create-features":this._toggleDataCaptureLayer(t,s);break;case"show-all-features":{const e=s?.id;e&&this.onFilterCapturedFeatures?.(e);break}}}),this._resetPreviousAction=e=>{"toggle"===this._previousAction?.type&&this._previousAction!==e&&(this._previousAction.value=!1,this._previousAction=null)},this._toggleDataCaptureLayer=(e,t)=>{this._previousAction=e;const s=e.value;this.dataCaptureLayer=s?t:null,this.onDataCaptureLayerChanged?.(this.dataCaptureLayer)},this._trackLayerSelectionChanges=()=>o(()=>this.layerList.selectedItems,"change",this._handleSelectedItemsChange),this._watchLayerListForListItemCreatedFunction=()=>a(()=>({layerList:this.layerList,listItemCreatedFunction:this._listItemCreatedFunction}),()=>{this.layerList.listItemCreatedFunction=this._listItemCreatedFunction},i),this._watchSelectedItems=()=>a(()=>this.layerList.selectedItems,this._createSelectedItemsHandle,i)}initialize(){this.addHandles([this._watchSelectedItems(),this._layerListTriggerActionHandle(),this._watchLayerListForListItemCreatedFunction(),this._createDataCaptureLayerHandle()])}loadDependencies(){return u({list:()=>import("@esri/calcite-components/dist/components/calcite-list"),"list-item":()=>import("@esri/calcite-components/dist/components/calcite-list-item"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),switch:()=>import("@esri/calcite-components/dist/components/calcite-switch")})}get _listItemCreatedFunction(){const{dataCaptureEnabled:e,imageGeometryField:t,imageReferenceField:s}=this;return e&&t&&s?async e=>{const{item:a}=e,i=a.layer,{dataCaptureLayer:o,overlayedLayers:r,messages:{createFeaturesFromImage:l,showFeatures:c},layerList:d}=this,h=r.includes(i),{selectedItems:p}=d;if(C(h,p,a),await(i?.load()),!i||!m(i,t,s)||!n(i))return;const u=o===i,y=_([l,c],a,p,u);u&&(this._previousAction=y)}:null}get view(){return this.layerList?.view}set view(e){this.layerList.view=e}_renderCameraLocationsSwitch(e){return g("calcite-list-item",{bind:this,label:this.messages.overlayCameraLocations,onclick:this._toggleShowCameraLocations},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowCameraLocations,scale:"s",slot:"actions-end"}))}_renderOverlayMapFeatures(e){return g("calcite-list-item",{bind:this,label:this.messages?.overlayMapFeatures,onclick:this._toggleShowMapFeatures},g("calcite-switch",{bind:this,checked:e,class:h.overlaysSwitch,onchange:this._toggleShowMapFeatures,scale:"s",slot:"actions-end"}))}_renderList(e){return e?g("div",{class:h.imageOverlaysLayerList},this.layerList.render()):null}_renderPanel(){const{closed:e,messages:t,showCameraLocations:s,showMapFeatures:a}=this;return g("calcite-panel",{bind:this,closable:!0,closed:e,heading:t.imageOverlays,onCalcitePanelClose:this.onImageOverlaysClosed},g("calcite-list",{label:t.imageOverlays},this._renderCameraLocationsSwitch(s),this._renderOverlayMapFeatures(a)),this._renderList(a))}_toggleShowCameraLocations(e){e.stopPropagation(),this.showCameraLocations=!this.showCameraLocations,this.onShowCameraLocationsChanged?.(this.showCameraLocations)}_toggleShowMapFeatures(e){e.stopPropagation(),this.showMapFeatures=!this.showMapFeatures,this.onShowMapFeaturesChanged?.(this.showMapFeatures)}render(){const e=this.layerList.operationalItems.items.length,t=this.showMapFeatures&&0===e,s=this.showMapFeatures&&e>0,a={[y.widget]:!0,[h.imageOverlaysNoResult]:t,[h.imageOverlaysIncreasedHeight]:s,[h.imageOverlays]:!t&&!s};return g("div",{class:this.classes(a)},this._renderPanel())}};e([r()],L.prototype,"_previousAction",void 0),e([r()],L.prototype,"_listItemCreatedFunction",null),e([r()],L.prototype,"closed",void 0),e([r()],L.prototype,"dataCaptureEnabled",void 0),e([r()],L.prototype,"dataCaptureLayer",void 0),e([r()],L.prototype,"imageGeometryField",void 0),e([r()],L.prototype,"imageReferenceField",void 0),e([r()],L.prototype,"layerList",void 0),e([r()],L.prototype,"messages",void 0),e([r()],L.prototype,"onDataCaptureLayerChanged",void 0),e([r()],L.prototype,"onFilterCapturedFeatures",void 0),e([r()],L.prototype,"onImageOverlaysClosed",void 0),e([r()],L.prototype,"onLayerDeselected",void 0),e([r()],L.prototype,"onLayerSelected",void 0),e([r()],L.prototype,"onShowCameraLocationsChanged",void 0),e([r()],L.prototype,"onShowMapFeaturesChanged",void 0),e([r()],L.prototype,"overlayedLayers",void 0),e([r()],L.prototype,"showCameraLocations",void 0),e([r()],L.prototype,"showMapFeatures",void 0),e([r()],L.prototype,"view",null),L=e([l("esri.widgets.OrientedImageryViewer.components.ImageOverlays")],L);const v=L;function C(e,t,s){e&&t.push(s)}function w(e,s){const a=new t;a.add(e[0]),a.add(e[1]),s.actionsSections=new t([a])}function _(e,t,s,o=!1){const r=new c({icon:"pencil",id:"create-features",title:e[0],value:o}),l=new c({icon:"list-show-all",id:"show-all-features",title:e[1],value:o});return t.addHandles(a(()=>s.includes(t),e=>{r.visible=e,l.visible=e},i)),w([r,l],t),r}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/5.0/esri/copyright.txt for details.
4
4
  */
5
- import{__decorate as e}from"tslib";import{subclass as t}from"../../../core/accessorSupport/decorators.js";import s from"../../LayerList/LayerListViewModel.js";import{isValidOverlayLayer as r}from"../dataCaptureUtils.js";let i=class extends s{_compileList(){const e=this.view?.map?.allLayers;if(!e)return;const t=e.filter(r);this._watchLayersListMode(t);const s=this._getViewableLayers(t);s?.length?(this._createNewItems(s),this._removeItems(s),this._sortItems(s)):this._removeAllItems()}};i=e([t("esri.widgets.OrientedImageryViewer.components.OverlayLayersListViewModel")],i);export{i as default};
5
+ import{__decorate as e}from"tslib";import{subclass as t}from"../../../core/accessorSupport/decorators.js";import s from"../../LayerList/LayerListViewModel.js";import{isValidOverlayLayer as r}from"../support/typeUtils.js";let i=class extends s{_compileList(){const e=this.view?.map?.allLayers;if(!e)return;const t=e.filter(r);this._watchLayersListMode(t);const s=this._getViewableLayers(t);s?.length?(this._createNewItems(s),this._removeItems(s),this._sortItems(s)):this._removeAllItems()}};i=e([t("esri.widgets.OrientedImageryViewer.components.OverlayLayersListViewModel")],i);export{i as default};