@arcgis/core 5.1.0-next.110 → 5.1.0-next.112

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 (312) hide show
  1. package/analysis/ElevationProfile/ElevationProfileGroup.d.ts +3 -0
  2. package/analysis/ElevationProfile/ElevationProfileLineQuery.d.ts +1 -0
  3. package/analysis/ElevationProfileAnalysis.d.ts +5 -0
  4. package/analysis/ShadowCast/DiscreteOptions.d.ts +2 -2
  5. package/analysis/ShadowCast/TotalDurationOptions.d.ts +13 -4
  6. package/analysis/ShadowCastAnalysis.d.ts +8 -5
  7. package/arcade/Dictionary.js +1 -1
  8. package/arcade/Feature.js +1 -1
  9. package/arcade/Pixel.js +1 -1
  10. package/arcade/Voxel.js +1 -1
  11. package/arcade/arcade.js +1 -1
  12. package/arcade/arcadeAsyncRuntime.js +1 -1
  13. package/arcade/arcadeCompiler.js +1 -1
  14. package/arcade/arcadeEnvironment.js +1 -1
  15. package/arcade/arcadeRuntime.js +1 -1
  16. package/arcade/compilerUtils.js +1 -1
  17. package/arcade/containerUtils.js +1 -1
  18. package/arcade/debug.js +1 -1
  19. package/arcade/enum.js +1 -1
  20. package/arcade/executionError.js +1 -1
  21. package/arcade/functions/convertdirection.js +1 -1
  22. package/arcade/functions/date.js +1 -1
  23. package/arcade/functions/feature.js +1 -1
  24. package/arcade/functions/featuresetbase.js +1 -1
  25. package/arcade/functions/featuresetgeom.js +1 -1
  26. package/arcade/functions/featuresetstats.js +1 -1
  27. package/arcade/functions/featuresetstring.js +1 -1
  28. package/arcade/functions/geomasync.js +1 -1
  29. package/arcade/functions/geometry.js +1 -1
  30. package/arcade/functions/geomsync.js +1 -1
  31. package/arcade/functions/knowledgegraph.js +1 -1
  32. package/arcade/functions/maths.js +1 -1
  33. package/arcade/functions/stats.js +1 -1
  34. package/arcade/functions/string.js +1 -1
  35. package/arcade/functions/track.js +1 -1
  36. package/arcade/geometry/constructors.js +1 -1
  37. package/arcade/geometry/functions.js +1 -1
  38. package/arcade/geometry/unitConversion.js +1 -1
  39. package/arcade.js +1 -1
  40. package/assets/components/assets/icon/returnToDefault16.json +1 -0
  41. package/assets/components/assets/icon/returnToDefault24.json +1 -0
  42. package/assets/components/assets/icon/returnToDefault32.json +1 -0
  43. package/assets/components/assets/icon/reviewMap16.json +1 -0
  44. package/assets/components/assets/icon/reviewMap24.json +1 -0
  45. package/assets/components/assets/icon/reviewMap32.json +1 -0
  46. package/assets/esri/core/workers/RemoteClient.js +1 -1
  47. package/assets/esri/core/workers/chunks/03babc21d1781142a974.js +1 -0
  48. package/assets/esri/core/workers/chunks/08efd64acdfe46985293.js +1 -0
  49. package/assets/esri/core/workers/chunks/0b76534b60014d74ecb9.js +1 -0
  50. package/assets/esri/core/workers/chunks/{622bdd1b9d5d292ec12b.js → 0e6a388d51d9dbae46ba.js} +1 -1
  51. package/assets/esri/core/workers/chunks/{34e026549ba2822b8ebd.js → 13d43a0683c42b94feb6.js} +1 -1
  52. package/assets/esri/core/workers/chunks/{4f9ea7544b2d0e88a05c.js → 13f0e08de2dfab07d212.js} +1 -1
  53. package/assets/esri/core/workers/chunks/{35bbd63319d8aa9f31cc.js → 169c9eb6cd000e067c4b.js} +1 -1
  54. package/assets/esri/core/workers/chunks/{d4014213c476bf8099af.js → 18c4207b1cb0777560ba.js} +1 -1
  55. package/assets/esri/core/workers/chunks/{58c15c42e6a618386a2f.js → 1c8c8050d60205cf2156.js} +1 -1
  56. package/assets/esri/core/workers/chunks/1f537c05c2f643acb5e7.js +1 -0
  57. package/assets/esri/core/workers/chunks/241aeff6afd074ce105b.js +1 -0
  58. package/assets/esri/core/workers/chunks/{ddebc1dc10a2d207389f.js → 282f3d364411efac7b80.js} +1 -1
  59. package/assets/esri/core/workers/chunks/{d6d5ee9d0d998d730f81.js → 2bd334f9ab89334df713.js} +1 -1
  60. package/assets/esri/core/workers/chunks/340c68d09d2e8bef6727.js +2 -0
  61. package/assets/esri/core/workers/chunks/{17604cbd4d24158e2c16.js → 3835097520296b0517af.js} +1 -1
  62. package/assets/esri/core/workers/chunks/481dc7503587972a6bd2.js +2 -0
  63. package/assets/esri/core/workers/chunks/{9f4a9b193485f88d4461.js → 4afe76de6e82e86fe697.js} +1 -1
  64. package/assets/esri/core/workers/chunks/{ac408c62565e2c8b5975.js → 4c5cdd2712c938fafc5d.js} +1 -1
  65. package/assets/esri/core/workers/chunks/{ece30bfd5c49b8d99752.js → 5e5c7cc74ff1c9603aff.js} +1 -1
  66. package/assets/esri/core/workers/chunks/{502c3da8c49bf885f51d.js → 63ea9035dcf9ce45560c.js} +1 -1
  67. package/assets/esri/core/workers/chunks/{33ec193e6d7a0cb9d8dd.js → 6b66a6f69aa03338c346.js} +1 -1
  68. package/assets/esri/core/workers/chunks/{56b6b68d9459b1edea43.js → 6c97b5bc408f051606d2.js} +1 -1
  69. package/assets/esri/core/workers/chunks/{94eab215bab3e4e0e5b5.js → 711d1873c760313e287f.js} +1 -1
  70. package/assets/esri/core/workers/chunks/{4e13d639419ac64f7563.js → 7c077e1a63ab97bf3e87.js} +1 -1
  71. package/assets/esri/core/workers/chunks/86f2de7dda7992ae706c.js +1 -0
  72. package/assets/esri/core/workers/chunks/{a29cd1f5c7bb4f6a5a4f.js → 8d4881c879c86b353e08.js} +1 -1
  73. package/assets/esri/core/workers/chunks/{6e21675bbd7a44070771.js → 8ff83c59462dea6e3427.js} +1 -1
  74. package/assets/esri/core/workers/chunks/979bab62cad788180770.js +1 -0
  75. package/assets/esri/core/workers/chunks/9890c85a238879490926.js +1 -0
  76. package/assets/esri/core/workers/chunks/9ebc461529d5286fa2c2.js +2 -0
  77. package/assets/esri/core/workers/chunks/a95398214e530f896a2d.js +1 -0
  78. package/assets/esri/core/workers/chunks/{fc1fe1f58a65a1694c09.js → b02a68bbab07557cf02d.js} +1 -1
  79. package/assets/esri/core/workers/chunks/ba31616de9d73d83d867.js +1 -0
  80. package/assets/esri/core/workers/chunks/c7662455252b48531da1.js +1 -0
  81. package/assets/esri/core/workers/chunks/ca92176d5348e2c533d7.js +1 -0
  82. package/assets/esri/core/workers/chunks/cd5206e19d86c60e3cf0.js +1 -0
  83. package/assets/esri/core/workers/chunks/{bfb417d72d0c90e116fe.js → cedf3e316d6f89cf7005.js} +1 -1
  84. package/assets/esri/core/workers/chunks/d02aa7438f46c1c2167a.js +2 -0
  85. package/assets/esri/core/workers/chunks/d33a08e5f589355c57a3.js +1 -0
  86. package/assets/esri/core/workers/chunks/dd29fd1b3da90d3ca6b1.js +1 -0
  87. package/assets/esri/core/workers/chunks/e0036fa0324a96a88248.js +1 -0
  88. package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js → e5854a3f69dffaf9464d.js} +2 -2
  89. package/assets/esri/core/workers/chunks/ed939fd5d3827a3f70e0.js +1 -0
  90. package/assets/esri/core/workers/chunks/fe8334352d256d691a95.js +1 -0
  91. package/assets/esri/themes/base/widgets/_BatchAttributeForm.scss +7 -0
  92. package/assets/esri/themes/dark/main.css +1 -1
  93. package/assets/esri/themes/light/main.css +1 -1
  94. package/assets/esri/themes/light/view.css +1 -1
  95. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis.json +1 -1
  96. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_ar.json +1 -1
  97. package/assets/esri/views/3d/analysis/ShadowCast/t9n/ShadowCastAnalysis_en.json +1 -1
  98. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm.json +1 -1
  99. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ar.json +1 -1
  100. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bg.json +1 -1
  101. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_bs.json +1 -1
  102. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ca.json +1 -1
  103. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_cs.json +1 -1
  104. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_da.json +1 -1
  105. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_de.json +1 -1
  106. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_el.json +1 -1
  107. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_en.json +1 -1
  108. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_es.json +1 -1
  109. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_et.json +1 -1
  110. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fi.json +1 -1
  111. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_fr.json +1 -1
  112. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_he.json +1 -1
  113. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hr.json +1 -1
  114. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_hu.json +1 -1
  115. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_id.json +1 -1
  116. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_it.json +1 -1
  117. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ja.json +1 -1
  118. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ko.json +1 -1
  119. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lt.json +1 -1
  120. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_lv.json +1 -1
  121. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_nl.json +1 -1
  122. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_no.json +1 -1
  123. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pl.json +1 -1
  124. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-BR.json +1 -1
  125. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_pt-PT.json +1 -1
  126. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ro.json +1 -1
  127. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_ru.json +1 -1
  128. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sk.json +1 -1
  129. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sl.json +1 -1
  130. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sr.json +1 -1
  131. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_sv.json +1 -1
  132. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_th.json +1 -1
  133. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_tr.json +1 -1
  134. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_uk.json +1 -1
  135. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_vi.json +1 -1
  136. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-CN.json +1 -1
  137. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-HK.json +1 -1
  138. package/assets/esri/widgets/BatchAttributeForm/t9n/BatchAttributeForm_zh-TW.json +1 -1
  139. package/chunks/aiServices.js +1 -1
  140. package/chunks/arcade.js +1 -1
  141. package/chunks/array.js +1 -1
  142. package/chunks/languageUtils.js +1 -1
  143. package/config.js +1 -1
  144. package/identity/IdentityModal.js +1 -1
  145. package/kernel.js +1 -1
  146. package/layers/IntegratedMesh3DTilesLayer.js +1 -1
  147. package/layers/Lyr3DWasmPerSceneView.js +1 -1
  148. package/layers/graphics/data/QueryEngineCapabilities.js +1 -1
  149. package/layers/graphics/sources/parquet/PortalParquetLayerFileProvider.js +1 -1
  150. package/layers/support/SceneModification.js +1 -1
  151. package/layers/support/SceneModifications.js +1 -1
  152. package/layers/support/parquetUtils.js +1 -1
  153. package/package.json +2 -2
  154. package/renderers/ClassBreaksRenderer.js +1 -1
  155. package/renderers/UniqueValueRenderer.js +1 -1
  156. package/rest/print.js +1 -1
  157. package/rest/support/TranslateContent.js +1 -1
  158. package/rest/support/TranslateParameters.js +1 -1
  159. package/rest/support/TranslateResult.js +1 -1
  160. package/rest/translate.js +1 -1
  161. package/rest/utils.js +1 -1
  162. package/support/arcadeUtils.js +1 -1
  163. package/support/revision.js +1 -1
  164. package/views/2d/engine/webgl/shaders/sources/shaderRepository.js +1 -1
  165. package/views/3d/analysis/ShadowCast/ShadowCastTooltip.js +1 -1
  166. package/views/3d/analysis/ShadowCastAnalysisView3D.js +1 -1
  167. package/views/3d/layers/GaussianSplatLayerView3D.js +1 -1
  168. package/views/3d/layers/IntegratedMesh3DTilesLayerView3D.js +1 -1
  169. package/views/3d/layers/graphics/Graphics3DPathSymbolLayer.js +1 -1
  170. package/views/3d/layers/support/Tiles3DMeshIntersectionHandler.js +1 -1
  171. package/views/3d/state/controllers/PinchAndPanControllerGlobal.js +1 -1
  172. package/views/3d/state/controllers/PinchAndPanControllerLocal.js +1 -1
  173. package/views/3d/state/utils/navigationUtils.js +1 -1
  174. package/views/3d/support/QualityProfile.js +1 -1
  175. package/views/3d/support/gaussianSplatting/GaussianSplatFadeHelper.js +1 -1
  176. package/views/3d/webgl-engine/effects/debug/RenderNodeVisualizer.js +1 -1
  177. package/views/3d/webgl-engine/lib/PathBuilder.js +1 -1
  178. package/views/3d/webgl-engine/lib/PathCapBuilder.js +1 -1
  179. package/views/3d/webgl-engine/lib/PathEvaluator.js +2 -0
  180. package/views/3d/webgl-engine/lib/PathExtruder.js +1 -1
  181. package/views/3d/webgl-engine/lib/PathFrame2D.js +2 -0
  182. package/views/3d/webgl-engine/lib/PathGeometryData.js +1 -1
  183. package/views/3d/webgl-engine/lib/PathVertex.js +1 -1
  184. package/views/3d/webgl-engine/lib/PathVertexInfo.js +2 -0
  185. package/views/3d/webgl-engine/shaders/GaussianSplatTechniqueConfiguration.js +1 -1
  186. package/views/DOMContainer.d.ts +2 -0
  187. package/views/LinkChartView.d.ts +47 -0
  188. package/views/MapView.d.ts +1 -85
  189. package/views/VideoView.d.ts +8 -1
  190. package/views/View2D.d.ts +78 -2
  191. package/views/draw/support/Reshape.js +1 -1
  192. package/views/interactive/tooltip/components/TooltipEditableField.js +1 -1
  193. package/views/interactive/tooltip/content/TooltipContent.js +1 -1
  194. package/views/types.d.ts +2 -3
  195. package/views/ui/DefaultUI.d.ts +1 -0
  196. package/widgets/Attachments.js +1 -1
  197. package/widgets/BasemapGallery.js +1 -1
  198. package/widgets/BasemapLayerList.js +1 -1
  199. package/widgets/BasemapToggle.js +1 -1
  200. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.d.ts +10 -1
  201. package/widgets/BatchAttributeForm/BatchAttributeFormViewModel.js +1 -1
  202. package/widgets/BatchAttributeForm/css.js +1 -1
  203. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.d.ts +25 -1
  204. package/widgets/BatchAttributeForm/inputs/AttachmentElementInput.js +1 -1
  205. package/widgets/BatchAttributeForm/inputs/FieldInput.js +1 -1
  206. package/widgets/BatchAttributeForm/inputs/support/createBatchFormInputs.js +1 -1
  207. package/widgets/BatchAttributeForm/templates/support/createBatchFormTemplate.js +1 -1
  208. package/widgets/BatchAttributeForm.js +1 -1
  209. package/widgets/Bookmarks.js +1 -1
  210. package/widgets/BuildingExplorer/BuildingDisciplinesTree/BuildingDisciplinesNode.js +1 -1
  211. package/widgets/BuildingExplorer/BuildingLevelPicker/BuildingLevelPicker.js +1 -1
  212. package/widgets/BuildingExplorer/BuildingLevelPicker/Label.js +1 -1
  213. package/widgets/BuildingExplorer/BuildingLevelPicker/LevelItem.js +1 -1
  214. package/widgets/BuildingExplorer/BuildingPhasePicker/BuildingPhasePicker.js +1 -1
  215. package/widgets/CatalogLayerList.js +1 -1
  216. package/widgets/Compass.js +1 -1
  217. package/widgets/CoordinateConversion.js +1 -1
  218. package/widgets/Daylight.js +1 -1
  219. package/widgets/DirectionalPad.js +1 -1
  220. package/widgets/Directions.js +1 -1
  221. package/widgets/Editor/components/FeatureList.js +1 -1
  222. package/widgets/Editor/components/FooterActions.js +1 -1
  223. package/widgets/Editor/components/PendingFeatureList.js +1 -1
  224. package/widgets/Editor/components/Prompt.js +1 -1
  225. package/widgets/Editor/components/UpdateFeaturePanelContent.js +1 -1
  226. package/widgets/ElevationProfile/components/LegendItem.js +1 -1
  227. package/widgets/ElevationProfile.js +1 -1
  228. package/widgets/Expand.js +1 -1
  229. package/widgets/Feature/FeatureMedia.js +1 -1
  230. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/FeatureFormUtilityNetworkAssociationList.js +1 -1
  231. package/widgets/FeatureForm/FeatureFormUtilityNetworkAssociations/UtilityNetworkAssociationItemList.js +1 -1
  232. package/widgets/FeatureForm.js +1 -1
  233. package/widgets/FeatureTable.js +1 -1
  234. package/widgets/Features/FeaturesDrillIn.js +1 -1
  235. package/widgets/Features.js +1 -1
  236. package/widgets/FloorFilter.js +1 -1
  237. package/widgets/FovOverlay.js +1 -1
  238. package/widgets/Fullscreen.js +1 -1
  239. package/widgets/Home.js +1 -1
  240. package/widgets/LayerList/LayerListItem.js +1 -1
  241. package/widgets/LayerList.js +1 -1
  242. package/widgets/Locate.js +1 -1
  243. package/widgets/NavigationToggle.js +1 -1
  244. package/widgets/OrientedImageryViewer/components/ImageLocationWidget.js +1 -1
  245. package/widgets/OrientedImageryViewer/components/ImageMeasurementWidget.js +1 -1
  246. package/widgets/OrientedImageryViewer/components/ImageOverlays.js +1 -1
  247. package/widgets/OrientedImageryViewer/components/NavigationActions.js +1 -1
  248. package/widgets/OrientedImageryViewer/components/NavigationUI360.js +1 -1
  249. package/widgets/OrientedImageryViewer/components/SequentialNavigationUI.js +1 -1
  250. package/widgets/OrientedImageryViewer/components/SketchTools.js +1 -1
  251. package/widgets/OrientedImageryViewer/components/VideoEnhancementTools.js +1 -1
  252. package/widgets/OrientedImageryViewer.js +1 -1
  253. package/widgets/PanoramicVideoViewer.js +1 -1
  254. package/widgets/Print/PrintViewModel.js +1 -1
  255. package/widgets/Print.js +1 -1
  256. package/widgets/Search.js +1 -1
  257. package/widgets/Sketch/support/ResponsiveToolbar/OverflowGroup.js +1 -1
  258. package/widgets/Sketch/support/ResponsiveToolbar/SplitButton.js +1 -1
  259. package/widgets/Sketch.js +1 -1
  260. package/widgets/Slice.js +1 -1
  261. package/widgets/Slider.js +1 -1
  262. package/widgets/Swipe.js +1 -1
  263. package/widgets/TableList.js +1 -1
  264. package/widgets/TimeSlider.js +1 -1
  265. package/widgets/TimeZoneLabel.js +1 -1
  266. package/widgets/Track.js +1 -1
  267. package/widgets/UtilityNetworkAssociations.js +1 -1
  268. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeature.js +1 -1
  269. package/widgets/UtilityNetworkTrace/UtilityNetworkTraceFeaturesDrillIn.js +1 -1
  270. package/widgets/UtilityNetworkTrace.js +1 -1
  271. package/widgets/UtilityNetworkValidateTopology.js +1 -1
  272. package/widgets/ValuePicker.js +1 -1
  273. package/widgets/VideoPlayer/components/PlayerActionsGroup.js +1 -1
  274. package/widgets/VideoPlayer/components/PlayerControlsGroup.js +1 -1
  275. package/widgets/VideoPlayer/components/SettingsButton.js +1 -1
  276. package/widgets/Weather.js +1 -1
  277. package/widgets/Zoom.js +1 -1
  278. package/widgets/smartMapping/SmartMappingSliderBase.js +1 -1
  279. package/widgets/support/ColorPicker.js +1 -1
  280. package/widgets/support/ContingentValuesManager.js +1 -1
  281. package/widgets/support/FilterBuilder.js +1 -1
  282. package/widgets/support/GridControls.js +1 -1
  283. package/widgets/support/ItemList.js +1 -1
  284. package/widgets/support/LabeledSwitch.js +1 -1
  285. package/widgets/support/SelectionList.js +1 -1
  286. package/assets/esri/core/workers/chunks/1d1929f98d941179be29.js +0 -2
  287. package/assets/esri/core/workers/chunks/286bf3be9f524bde9529.js +0 -1
  288. package/assets/esri/core/workers/chunks/36ecb0082b8804b10fbf.js +0 -1
  289. package/assets/esri/core/workers/chunks/41a95ad470ec42ecd5a2.js +0 -1
  290. package/assets/esri/core/workers/chunks/547dc6ccb989bd962661.js +0 -1
  291. package/assets/esri/core/workers/chunks/549d348ca181d06aefb7.js +0 -2
  292. package/assets/esri/core/workers/chunks/56d9d3f108ff6e719dd4.js +0 -1
  293. package/assets/esri/core/workers/chunks/5c44638670e40e092ce3.js +0 -1
  294. package/assets/esri/core/workers/chunks/63934843c9f4ef779a07.js +0 -1
  295. package/assets/esri/core/workers/chunks/69c9eb93553b006b640d.js +0 -2
  296. package/assets/esri/core/workers/chunks/8330302096d4312a4393.js +0 -1
  297. package/assets/esri/core/workers/chunks/885eac78a76184efa1e5.js +0 -1
  298. package/assets/esri/core/workers/chunks/95dee5853c6e89f15ea9.js +0 -1
  299. package/assets/esri/core/workers/chunks/9da2f2b67837b491cfa3.js +0 -1
  300. package/assets/esri/core/workers/chunks/a913a1c83a667ed0e711.js +0 -1
  301. package/assets/esri/core/workers/chunks/b69d1d528e271568cbd8.js +0 -2
  302. package/assets/esri/core/workers/chunks/bc249bb667f0564ad093.js +0 -1
  303. package/assets/esri/core/workers/chunks/c8b96104641cb4afd4df.js +0 -1
  304. package/assets/esri/core/workers/chunks/cdb48d198145493f76f3.js +0 -1
  305. package/assets/esri/core/workers/chunks/e2bb95d601789bbda73b.js +0 -1
  306. package/assets/esri/core/workers/chunks/f1bb426400dac02880f1.js +0 -1
  307. package/assets/esri/core/workers/chunks/f3f984c62311c20a9db8.js +0 -1
  308. /package/assets/esri/core/workers/chunks/{69c9eb93553b006b640d.js.LICENSE.txt → 340c68d09d2e8bef6727.js.LICENSE.txt} +0 -0
  309. /package/assets/esri/core/workers/chunks/{549d348ca181d06aefb7.js.LICENSE.txt → 481dc7503587972a6bd2.js.LICENSE.txt} +0 -0
  310. /package/assets/esri/core/workers/chunks/{1d1929f98d941179be29.js.LICENSE.txt → 9ebc461529d5286fa2c2.js.LICENSE.txt} +0 -0
  311. /package/assets/esri/core/workers/chunks/{b69d1d528e271568cbd8.js.LICENSE.txt → d02aa7438f46c1c2167a.js.LICENSE.txt} +0 -0
  312. /package/assets/esri/core/workers/chunks/{55334ad3618899cdbf78.js.LICENSE.txt → e5854a3f69dffaf9464d.js.LICENSE.txt} +0 -0
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import{prefersRTL as t,substitute as i}from"../intl.js";import{prefersReducedMotion as a}from"../core/a11yUtils.js";import{createTask as s}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecateWidget as n,deprecatedProperty as r}from"../core/deprecate.js";import l from"../core/Logger.js";import{isAbortError as d}from"../core/promiseUtils.js";import{watch as c,initial as g,syncAndInitial as h,on as m,sync as u}from"../core/reactiveUtils.js";import{throttle as p}from"../core/throttle.js";import{property as v,subclass as y}from"../core/accessorSupport/decorators.js";import{or as w}from"../layers/orientedImagery/transformations/utils.js";import _ from"./Expand.js";import T from"./PanoramicVideoViewer.js";import M from"./PanoramicViewer.js";import b from"./Widget.js";import{getAllArcPath as C}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as f,defaultImageGeometryField as I,defaultOIObjectIDField as S,segmentArcs as A,featureCircleRadius as k,navigationToolDimensionLength as V,sectorsRadii as L}from"./OrientedImageryViewer/constants.js";import{css as E,navigation as O,navigationToolRotationFrom as P,navigationToolRotationTo as F,root as x}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as G,loadImageForAttachment as N,getThumbnailPixelBlock as D,renderImageWithRotation as H}from"./OrientedImageryViewer/galleryUtils.js";import j from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import $ from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as B,Alert as R}from"./OrientedImageryViewer/components/Alert.js";import q from"./OrientedImageryViewer/components/ImageLocationWidget.js";import W from"./OrientedImageryViewer/components/ImageViewer.js";import U from"./OrientedImageryViewer/components/NavigationUI.js";import Z from"./OrientedImageryViewer/components/NavigationUI360.js";import{SequentialNavigationUI as z}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import{loadVideoEnhancementComponents as J,renderEnhancementSlider as K,VideoEnhancementTools as Q}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as X}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as Y}from"./support/componentsUtils.js";import{globalCss as ee}from"./support/globalCss.js";import{vmEvent as te,messageBundle as ie,tsx as ae}from"./support/widget.js";const se={overlayed:"overlayed"};let oe=class extends b{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new j,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.selectedGroup=null,this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new $,this._defaultSuperimposeZOffsetPercentage=100,this._panoramicSuperimposeRadiusOffsetPercentage=100,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._navigationTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._createNavigationTask=async e=>(this._navigationTask?.abort(),this._navigationTask=s(async t=>await this.navigate({...e,signal:t})),this._navigationTask.promise),this._navigateNext=async()=>await this._createNavigationTask({step:1}),this._navigatePrevious=async()=>await this._createNavigationTask({step:-1}),this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._closeImageSequenceAlert=()=>{this._set("noImageInSequenceError",!1)},this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(c(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${se.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&w(n,o&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=e=>{e.stopPropagation(),this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new _({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=p(this.viewModel.toggleImageAttributes.bind(this.viewModel)),this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new X;t=await this.viewModel.navigate(i,e)}catch(i){d(i)||l.getLogger(this).error("Error occurred while navigating",i),["NoImageInSequenceError","NoSequenceFoundError"].includes(i.name)&&this._set("noImageInSequenceError",!0)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._handleSuperimposeZOffsetChange=this._handleSuperimposeZOffsetChange.bind(this),this._toggleSuperimposeCameraLock=this._toggleSuperimposeCameraLock.bind(this),this._resetSuperimposeOffset=this._resetSuperimposeOffset.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this),this.announceDeprecation=()=>{n(l.getLogger(this),"Oriented Imagery Viewer","arcgis-oriented-imagery-viewer",{version:"5.0"})}}initialize(){this.addHandles([c(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},g),c(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),c(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),c(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),c(()=>this.superimposeViewEnabled,e=>{e?(this._closeAllImageTools(),this.selectedGroup=null,this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1):this._resetSuperimposeOffset()}),c(()=>({features:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showCameraLocations:this.showCameraLocations}),({overlaysEnabled:e,showCameraLocations:t})=>{e&&this.viewModel.overlayCameraLocations(t)},h),c(()=>({feature:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showMapFeatures:this.showMapFeatures}),async(e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures);const i=e.feature&&e.feature!==t?.feature,a=e.overlaysEnabled&&!t?.overlaysEnabled;(i||a)&&(i&&this.viewModel.removeAllOverlayMapFeatures(),e.overlaysEnabled&&(this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),this.dataCaptureLayer&&(await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null))))},g),m(()=>this.viewModel,"popup-open",async e=>{await(this.view?.openPopup(e))},u),m(()=>this.viewModel,"popup-close",()=>{this.view?.closePopup()},u),this._toggleImageAttributes])}loadDependencies(){return Promise.all([J(),Y({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),B()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){return!!this.layer?.effectiveSequenceOrderField?.length}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.setMapImageConversionToolState(e)}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get preloadMedia(){return this.viewModel.preloadMedia}set preloadMedia(e){this.viewModel.preloadMedia=e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}get shouldShowSelectedImage(){return this.viewModel.shouldShowSelectedImage}set shouldShowSelectedImage(e){this.viewModel.shouldShowSelectedImage=e}get superimposeViewEnabled(){return this.viewModel.superimposeViewEnabled}set superimposeViewEnabled(e){this.viewModel.superimposeViewEnabled=e}get defaultSuperimposeCameraLockEnabled(){return this.viewModel.defaultSuperimposeCameraLockEnabled}set defaultSuperimposeCameraLockEnabled(e){this.viewModel.defaultSuperimposeCameraLockEnabled=e}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}get verticalFilterEnabled(){return this.viewModel.verticalFilterEnabled}set verticalFilterEnabled(e){this.viewModel.verticalFilterEnabled=e}_renderActionBar(){const{selectedGroup:e,superimposeViewEnabled:i}=this;if(i)return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ae("calcite-action-group",null,this._superimposeViewToggle()));const a=t();return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},!e&&ae("calcite-action-group",null,this._searchGroupToggle(),this._overlaysGroupToggle(),this._navigationGroupToggle(),this._measurementsGroupToggle(),this._utilitiesGroupToggle()),this._renderGroupBackAction(a),"overlays"===e&&ae("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle(),this._mapImageConversionToggle(),this._imageOverlaysToggle()),"navigation"===e&&ae("calcite-action-group",null,this._directionToolsToggle(),this._navigationToolToggle(),this._imageGalleryToggle()),"measurements"===e&&ae("calcite-action-group",null,this._measurementToolToggle()),"utilities"===e&&ae("calcite-action-group",null,this._imageEnhancementsToggle(),this._videoEnhancementsToggle(),this._superimposeViewToggle(),this._openPopupAction()),"search"===e&&ae("calcite-action-group",null,this._exploreImagesToggle(),this._exploreImages3DToggle(),this._showSelectedImageToggle()))}_renderGroupBackAction(e){return this.selectedGroup?ae("calcite-action",{bind:this,icon:e?"arrow-right":"arrow-left",key:"back-arrow",onclick:()=>this._toggleGroupSelection(null),text:this.messages.previous,title:this.messages.previous}):null}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleAdditionalCoverage,text:this.messages.additionalFootprints,title:this.messages.additionalFootprints}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addExpPoints,disabled:t,icon:"circle-area",onclick:this._toggleAdditionalCameraLocations,text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${s}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ae(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ae("calcite-panel",{bind:this,class:t?E.viewerContainerMeasurement:E.viewerContainer,heading:this.visibleElements.header?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ae("calcite-shell",null,ae("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._superimposeTools,this._renderSketch(),this._navigationUI),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null,this.noImageInSequenceError?this._renderWarning(this.messages.sequentialNavigationWarning,this.messages.sequentialNavigationWarning,this._closeImageSequenceAlert):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ae("calcite-action",{active:e,bind:this,class:E.currentCoverage,disabled:t,icon:"trapezoid-area",onclick:this._toggleCurrentCoverage,text:this.messages.currentFootprint,title:this.messages.currentFootprint}):null}_exploreImagesToggle(){const{exploreImages:e}=this.messages;return this.visibleElements.exploreImages?ae("calcite-action",{active:!this.disabled,bind:this,icon:"oriented-imagery-widget",onclick:this._toggleExploreImages,text:e,title:e}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?ae("calcite-panel",{bind:this,class:E.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ae("div",{class:E.imageEnhancementTools},K({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),K({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),K({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetImageTools,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ae(Q,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:s,contrast:o,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}get _superimposeTools(){const{superimposeViewEnabled:e,view:t,viewModel:{state:i,mode:a},messages:{superimposeSettings:s,superimposeSliderTitle:o,superimposeSliderTooltip:n}}=this,r="panoramic"===a;return e&&"3d"===t?.type&&"image-loaded"===i?ae("calcite-panel",{bind:this,class:this.classes(E.imageEnhancementWrapper,E.superimposeTools),heading:s,key:"superimpose-settings"},ae("div",{class:E.imageEnhancementTools},K({title:o,tooltip:n,value:r?this._panoramicSuperimposeRadiusOffsetPercentage:this._defaultSuperimposeZOffsetPercentage,max:100,min:0,ticks:10,step:1,handleChange:this._handleSuperimposeZOffsetChange})),ae("calcite-action",{bind:this,icon:"reset",onclick:this._resetSuperimposeOffset,slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{enhancementTool:i}=this.visibleElements;return i&&"video"!==t?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:this.messages.imageEnhancement,title:this.messages.imageEnhancement}):null}_exploreImages3DToggle(){const{exploreImages3D:e}=this.messages,t="3d"!==this.view?.type||!this.layer?.verticalSearchRange;return this.visibleElements.exploreImages3D?ae("calcite-action",{active:this.verticalFilterEnabled,bind:this,disabled:t,icon:"i3DSearch",onclick:this._toggleVerticalSearchFilter,text:e,title:e}):null}_showSelectedImageToggle(){const{displayImages:e}=this.messages,t=this.viewModel.mode.includes("video");return this.visibleElements.showSelectedImage?ae("calcite-action",{active:this.shouldShowSelectedImage,bind:this,disabled:t,icon:"show-oriented-imagery",onclick:this._toggleShowSelectedImage,text:e,title:e}):null}_superimposeViewToggle(){const{superimposeView:e}=this.messages,{mode:t,accuracyParametersMissing:i}=this.viewModel,a=!this.superimposeViewEnabled&&("3d"!==this.view?.type||t.includes("video")||i);return this.visibleElements.superimpose?ae("calcite-action",{active:this.superimposeViewEnabled,bind:this,disabled:a,icon:"superimpose",onclick:this._toggleSuperimposeView,text:e,title:e}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages,{enhancementTool:i}=this.visibleElements;return i&&"video"===e?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",onclick:this._toggleEnhancementToolState,text:t,title:t}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ae("calcite-panel",{bind:this,class:E.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ae("div",{class:E.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ae("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",onclick:this._toggleImageGallery,text:this.messages.imageGallery,title:this.messages.imageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:a,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:I,h=c.imageReferenceField?.length?c.imageReferenceField:S;t||(this._imageOverlaysLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ae(m,{closed:!n,dataCaptureEnabled:a,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _navigationUI(){const{navigationMode:e,viewModel:t}=this,{mode:i,state:a}=t;if(e&&("default"===i||"panoramic"===i)&&"image-loaded"===a)return"directional"===e?"default"===i?ae(U,{cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes,preserveAngle:this.viewModel.preserveAngle}):ae(Z,{currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes}):ae(z,{layout:"horizontal",uiStrings:{end:this.messages.end,next:this.messages.next,previous:this.messages.previous,start:this.messages.start},onNext:this._navigateNext,onPrev:this._navigatePrevious})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesCommon,...this.messagesSketch}}_imageOverlaysPanel(){const{imageOverlaysOpened:e}=this,t=this.classes({[E.imageOverlaysContainer]:!0,[ee.hidden]:!e||!this._imageOverlaysEnabled});return ae("div",{class:t,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{imageOverlaysOpened:e,invalidCameraHeading:t,visibleElements:{imageOverlays:i}}=this;return i?ae("calcite-action",{active:e,bind:this,disabled:!this._imageOverlaysEnabled||t,icon:"layers",onclick:this._toggleImageOverlays,text:this.messages.imageOverlays,title:this.messages.imageOverlays}):null}get _imageOverlaysEnabled(){return this.viewModel.overlayGraphicsEnabled}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading");return ae(W,{afterCreate:t,clickAction:a,visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:s,mode:o,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===o||"video"===o,d=this.classes({[E.viewer]:!l,[E.viewerHidden]:l});return t?ae("calcite-panel",{class:E.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ae("calcite-panel",{bind:this,class:d},"default"===o?ae(W,{afterCreate:a,clickAction:r,uiStrings:e}):ae(M,{afterCreate:s,clickAction:r,uiStrings:e}))):null}_utilitiesGroupToggle(){const{utilityTools:e}=this.messages;return this.visibleElements.utilityTools?ae("calcite-action",{bind:this,icon:"tools",key:"utilities-group-toggle",onclick:()=>this._toggleGroupSelection("utilities"),text:e,title:e}):null}_searchGroupToggle(){const{searchTools:e}=this.messages;return this.visibleElements.searchTools?ae("calcite-action",{bind:this,icon:"search",key:"search-group-toggle",onclick:()=>this._toggleGroupSelection("search"),text:e,title:e}):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[E.viewer]:!r,[E.viewerHidden]:r}),d="esri-image-viewer",c=`${d}__slider-container`;return ae("calcite-panel",{bind:this,class:l},ae("calcite-panel",{afterCreate:t,class:this.classes(ee.widget,d)}),ae("calcite-block",{class:c,expanded:!0},ae("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>i?.playVideoHandler(),text:"Play",title:i?.videoPaused?a.play:a.pause})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:"refresh",onclick:()=>i?.rewindVideoHandler(),text:"Rewind",title:s})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>i?.toggleAudio(),text:"Audio",title:i?.videoMuted?o:n}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ae(q,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},videoLoaded:a,invalidCameraHeading:s,visibleElements:{mapImageConversionTool:o}}=this,n=!("video"!==this.viewModel.mode||!a||!this.viewModel.videoViewModel?.videoPaused),r="panoramic-video"===this.viewModel.mode&&this.viewModel.panoramicVideoLoaded&&this.viewModel.panoramicVideoPaused;return o?ae("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t&&!n&&!r||s||i,icon:"image-pin",onclick:this._toggleMapImageConversionToolState,text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool}):null}_measurementToolToggle(){const{measureType:e,viewModel:t,accuracyParametersMissing:i,messages:a,triangularMeasurementActive:s}=this,{state:o}=t,{groundDistance:n,groundArea:r,heightAboveGround:l,groundLocation:d,triangulatedDistanceHeading:c,triangulatedAreaHeading:g,triangulatedLocationHeading:h}=a,m="image-loaded"!==o||i;return ae("calcite-action-group",{key:"measurement-tools",scale:"m"},ae("calcite-action",{active:"distance"===e&&!s,bind:this,disabled:m,icon:"measure-line",key:"distance-measurement",onclick:e=>this._toggleMeasurementSketch(e,"distance"),text:n,title:n}),ae("calcite-action",{active:"area"===e&&!s,bind:this,disabled:m,icon:"measure-area",key:"area-measurement",onclick:e=>this._toggleMeasurementSketch(e,"area"),text:r,title:r}),ae("calcite-action",{active:"height"===e,bind:this,disabled:m,icon:"measure-building-height-top-base",key:"height-measurement",onclick:e=>this._toggleMeasurementSketch(e,"height"),text:l,title:l}),ae("calcite-action",{active:!!this.imageLocationToolActive&&!s,bind:this,disabled:m,icon:"pin-tear",key:"surface-location",onclick:this._toggleLocationTool,text:d,title:d}),ae("calcite-action",{active:!!s&&this.imageLocationToolActive,bind:this,disabled:m,icon:"dual-image-location",key:"triangular-location",onclick:this._toggleTriangularLocation,text:h,title:h}),ae("calcite-action",{active:!!s&&"distance"===this.measureType,bind:this,disabled:m,icon:"dual-image-distance",key:"triangular-distance",onclick:this._toggleTriangularDistanceMeasurements,text:c,title:c}),ae("calcite-action",{active:!!s&&"area"===this.measureType,bind:this,disabled:m,icon:"dual-image-area",key:"triangular-area",onclick:this._toggleTriangularAreaMeasurements,text:g,title:g}))}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:a}}=this;if(!t||"video"===a)return null;const{data:s,key:o,map:n}=t,r=`${n?i(e[o],n):e[o]}`;return ae("span",{class:E.messageBox},s?`${r} ${s}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_measurementsGroupToggle(){const{measurementTools:e}=this.messages,{state:t,accuracyParametersMissing:i}=this.viewModel,a="image-loaded"!==t||i;return this.visibleElements.measurementTools?ae("calcite-action",{bind:this,disabled:a,icon:"measure-line",key:"measurements-group-toggle",onclick:()=>this._toggleGroupSelection("measurements"),text:e,title:e}):null}_navigationGroupToggle(){const{imageNavigation:e}=this.messages;return this.visibleElements.imageNavigationTools?ae("calcite-action",{bind:this,icon:"absolute-direction",key:"navigation-group-toggle",onclick:()=>this._toggleGroupSelection("navigation"),text:e,title:e}):null}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ae("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",onclick:this._toggleNavigationTool,text:this.messages.navigationTool,title:this.messages.navigationTool}):null}_directionToolsToggle(){const{messages:e,viewModel:t,visibleElements:i}=this,{directionalNavigation:a,sequentialNavigation:s}=i,{state:o}=t,{directionalNavigation:n,directionalNavigationDescription:r,sequentialNavigation:l,sequentialNavigationDescription:d}=e;return ae("calcite-action-group",{key:"navigation-tools",scale:"m"},a?ae("calcite-action",{active:"directional"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading,icon:"directional-navigation",onclick:()=>{this._toggleImageNavigation("directional")},text:r,title:n}):null,s?ae("calcite-action",{active:"sequential"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",onclick:()=>{this._toggleImageNavigation("sequential")},text:d,title:l}):null)}_overlaysGroupToggle(){const{overlays:e}=this.messages;return this.visibleElements.overlays?ae("calcite-action",{bind:this,icon:"oriented-imagery-overlays",key:"overlays-group-toggle",onclick:()=>this._toggleGroupSelection("overlays"),text:e,title:e}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ae("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",onclick:this._toggleImageAttributes,text:this.messages.showPopups,title:this.messages.showPopups}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:s,currentBestFeature:o}=this.viewModel,n=o?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||s.includes("loading")||!n;return ae(T,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"panoramic"!==i||s.includes("loading");return ae(M,{afterCreate:t,clickAction:a,visible:!o})}get noImageInSequenceError(){return this._get("noImageInSequenceError")??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){const t=e.currentTarget.value??0;if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=t,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(100-t);this._panoramicSuperimposeRadiusOffsetPercentage=t,this.viewModel.setPanoramicSuperimposeRadiusPercentage(100-t)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),o=a.getAttribute("data-rotation"),n=a.getAttribute("data-objectid"),r=o?parseFloat(o)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!n)return;let h;try{h=G(s)?await N(c,n,{signal:g}):await D(s,{signal:g})}catch(i){d(i)||l.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;H(h,a,r)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=s(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,i){const{viewModel:{state:a}}=this;return"image-loaded"===a?ae(R,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:i}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:i,state:s}}=this;if(!this.container||!i)return null;let o,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[s,c,g,h]=A[a];o=`M ${e} ${i} L ${s} ${c} A ${L[2]} ${L[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=A[a][4],d=A[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=i.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>ae("circle",{afterRemoved:h,class:this.classes(E.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${E.feature}-${i}`,onclick:g,r:k}))),p=e=>{e.removeEventListener("click",c)},v=this.classes({[E.navigationWrapper]:!0,[E.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===s||this.videoLoaded)?ae("div",{bind:this,class:v,key:this.messages.navigationTool},ae("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:a()?O:E.rotateWithAnimation,focusable:"false",height:V,role:"img",width:V,xmlns:"http://www.w3.org/2000/svg"},ae("defs",null,ae("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ae("stop",{class:E.navigationPathOffset0,offset:0}),ae("stop",{class:E.navigationPathOffset1,offset:1}))),ae("g",null,ae("circle",{class:this.classes(E.sector,E.outerSector),cx:L[3],cy:L[3],onclick:this._scaleNavigationTool,r:L[3]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[2]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[1]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[0]}),ae("path",{class:E.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${E.pointer}-west`}),ae("path",{class:this.classes(E.pointer,E.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${E.pointer}-north`}),ae("path",{class:E.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${E.pointer}-east`}),ae("path",{class:E.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${E.pointer}-south`}),ae("path",{class:this.classes(E.sector,E.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:E.sectorSeparator}),C([L[2],L[1],L[0]],L[3],L[3]).map((t,i)=>ae("path",{afterRemoved:p,class:this.classes(E.sector,e?.[i]?.length?E.sectorEnabled:E.sectorDisabled),d:t,"data-sector":`${i}`,key:`${E.sector}-${i}`,onclick:c})),ae("path",{class:this.classes(E.sector,E.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:E.sectorCross}),u,i.attributes.cameraPitch>=5&&o?ae("path",{class:E.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:E.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return ae("div",{class:E.sketchTools},ae(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ae("div",{class:E.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>ae("div",{class:`${E.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${E.carouselItemWrapper}-${s}`},ae("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:E.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){this.shouldShowSelectedImage=!this.shouldShowSelectedImage,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=100,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(0);this._panoramicSuperimposeRadiusOffsetPercentage=100,this.viewModel.setPanoramicSuperimposeRadiusPercentage(0)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_toggleVerticalSearchFilter(){this.verticalFilterEnabled=!this.verticalFilterEnabled,this._toggleDisabledViewer(this.verticalFilterEnabled)}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1)}_toggleGroupSelection(e){this.selectedGroup=e}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(P,`${t}deg`),e.style.setProperty(F,`${t+a}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,i){return"default"===e?this.viewModel.loadMediaSource(t,i):this.viewModel.loadPanoramicMediaSource(t,i)}async overlayMapFeatures(e,t){return this.removeHandles(`${se.overlayed}-${e.id}`),this.addHandles(c(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${se.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${se.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ae("div",{class:this.classes(ee.widget,x)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([v({readOnly:!0})],oe.prototype,"accuracyParametersMissing",null),e([v()],oe.prototype,"activeLayer",null),e([v()],oe.prototype,"activeVideoIcon",null),e([v()],oe.prototype,"activeAudioIcon",null),e([v()],oe.prototype,"cameraHeadingThreshold",null),e([v()],oe.prototype,"cameraPitchThreshold",null),e([v()],oe.prototype,"canNavigateSequentially",null),e([v()],oe.prototype,"currentBestFeature",null),e([v()],oe.prototype,"currentCoverageVisible",null),e([v()],oe.prototype,"dataCaptureEnabled",void 0),e([v()],oe.prototype,"dataCaptureLayer",null),e([v()],oe.prototype,"depthImageNotSupported",null),e([v()],oe.prototype,"disabled",null),e([v()],oe.prototype,"enhancementToolActive",null),e([v()],oe.prototype,"features",null),e([v()],oe.prototype,"imagePointsInView",null),e([v()],oe.prototype,"galleryOpened",void 0),e([v()],oe.prototype,"icon",null),e([v()],oe.prototype,"imageEnhancementToolActive",void 0),e([v()],oe.prototype,"videoEnhancementToolActive",void 0),e([v({readOnly:!0})],oe.prototype,"imageGalleryEnabled",null),e([v()],oe.prototype,"imageLocationToolActive",null),e([v()],oe.prototype,"imageOverlaysOpened",void 0),e([v({readOnly:!0})],oe.prototype,"invalidCameraHeading",null),e([v()],oe.prototype,"isAdditionalCoverageVisible",null),e([v()],oe.prototype,"isAdditionalPointSourcesVisible",null),e([v()],oe.prototype,"mapImageConversionToolState",null),e([v()],oe.prototype,"measureType",null),e([v()],oe.prototype,"layer",null),e([v()],oe.prototype,"navigationToolActive",void 0),e([v()],oe.prototype,"navigationMode",null),e([te(f()),v({type:j})],oe.prototype,"viewModel",void 0),e([v(),ie("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],oe.prototype,"messages",void 0),e([v(),ie("esri/core/t9n/Units")],oe.prototype,"measurementUnitMessages",void 0),e([v(),ie("esri/t9n/common")],oe.prototype,"messagesCommon",void 0),e([v(),ie("esri/widgets/Sketch/t9n/Sketch")],oe.prototype,"messagesSketch",void 0),e([v()],oe.prototype,"pixelMeasurementUnit",void 0),e([v()],oe.prototype,"pixelAreaMeasurementUnit",void 0),e([v({readOnly:!0})],oe.prototype,"popupEnabled",null),e([v()],oe.prototype,"preloadMedia",null),e([v()],oe.prototype,"referencePoint",null),e([v()],oe.prototype,"selectedGroup",void 0),e([v()],oe.prototype,"showCameraLocations",void 0),e([v()],oe.prototype,"showMapFeatures",void 0),e([te(["create","delete","redo","undo","update"]),v({readOnly:!0})],oe.prototype,"sketchViewModel",null),e([v()],oe.prototype,"triangularMeasurementActive",null),e([v()],oe.prototype,"videoLoaded",null),e([v()],oe.prototype,"view",null),e([v({type:$,nonNullable:!0})],oe.prototype,"visibleElements",void 0),e([v()],oe.prototype,"determineWorkflowForFeature",null),e([v()],oe.prototype,"shouldShowSelectedImage",null),e([v()],oe.prototype,"superimposeViewEnabled",null),e([v()],oe.prototype,"defaultSuperimposeCameraLockEnabled",null),e([v()],oe.prototype,"updateFootprint",null),e([v()],oe.prototype,"verticalFilterEnabled",null),e([v()],oe.prototype,"_defaultSuperimposeZOffsetPercentage",void 0),e([v()],oe.prototype,"_panoramicSuperimposeRadiusOffsetPercentage",void 0),e([v()],oe.prototype,"_activeMeasurementHeading",null),e([v()],oe.prototype,"_imageOverlaysLoaderTask",void 0),e([v()],oe.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([v()],oe.prototype,"_navigationSettingsLoaderTask",void 0),e([v()],oe.prototype,"_navigationTask",void 0),e([v()],oe.prototype,"_measurementToggle",null),e([v()],oe.prototype,"_renderRoot",null),e([v()],oe.prototype,"_imageEnhancementTools",null),e([v()],oe.prototype,"_videoEnhancementTools",null),e([v()],oe.prototype,"_superimposeTools",null),e([v()],oe.prototype,"_imageGalleryPanel",null),e([v()],oe.prototype,"_imageGalleryContext",null),e([v()],oe.prototype,"_imageOverlaysComponent",null),e([v()],oe.prototype,"_navigationUI",null),e([v()],oe.prototype,"_imageOverlayMessages",null),e([v()],oe.prototype,"_imageSketchToolsMessages",null),e([v()],oe.prototype,"_imageOverlaysEnabled",null),e([v()],oe.prototype,"_imageViewer",null),e([v()],oe.prototype,"_imageViewerTriangular",null),e([v()],oe.prototype,"_videoViewer",null),e([v()],oe.prototype,"_locationToggle",null),e([v()],oe.prototype,"_messageBox",null),e([v()],oe.prototype,"_navigationToolExpanded",void 0),e([v()],oe.prototype,"_navigationTool",void 0),e([v()],oe.prototype,"_panoramicVideoViewer",null),e([v()],oe.prototype,"_panoramicViewer",null),e([v({readOnly:!0})],oe.prototype,"noImageInSequenceError",null),e([v()],oe.prototype,"_renderNavigation",null),e([v()],oe.prototype,"_renderThumbnails",null),e([v()],oe.prototype,"_sketchLoaderTask",void 0),oe=e([y("esri.widgets.OrientedImageryViewer")],oe);const ne=oe;export{ne as default};
2
+ import{__decorate as e}from"tslib";import{prefersRTL as t,substitute as i}from"../intl.js";import{prefersReducedMotion as a}from"../core/a11yUtils.js";import{createTask as s}from"../core/asyncUtils.js";import o from"../core/Collection.js";import{deprecateWidget as n,deprecatedProperty as r}from"../core/deprecate.js";import l from"../core/Logger.js";import{isAbortError as d}from"../core/promiseUtils.js";import{watch as c,initial as g,syncAndInitial as h,on as m,sync as u}from"../core/reactiveUtils.js";import{throttle as p}from"../core/throttle.js";import{property as v,subclass as y}from"../core/accessorSupport/decorators.js";import{or as w}from"../layers/orientedImagery/transformations/utils.js";import _ from"./Expand.js";import T from"./PanoramicVideoViewer.js";import M from"./PanoramicViewer.js";import b from"./Widget.js";import{getAllArcPath as C}from"./OrientedImageryViewer/arcUtils.js";import{getDelegatedEvents as f,defaultImageGeometryField as I,defaultOIObjectIDField as S,segmentArcs as A,featureCircleRadius as k,navigationToolDimensionLength as V,sectorsRadii as L}from"./OrientedImageryViewer/constants.js";import{css as E,navigation as O,navigationToolRotationFrom as P,navigationToolRotationTo as F,root as x}from"./OrientedImageryViewer/css.js";import{isFeatureAttachment as G,loadImageForAttachment as N,getThumbnailPixelBlock as D,renderImageWithRotation as H}from"./OrientedImageryViewer/galleryUtils.js";import j from"./OrientedImageryViewer/OrientedImageryViewerViewModel.js";import $ from"./OrientedImageryViewer/OrientedImageryViewerVisibleElements.js";import{loadAlertComponents as B,Alert as R}from"./OrientedImageryViewer/components/Alert.js";import q from"./OrientedImageryViewer/components/ImageLocationWidget.js";import W from"./OrientedImageryViewer/components/ImageViewer.js";import U from"./OrientedImageryViewer/components/NavigationUI.js";import Z from"./OrientedImageryViewer/components/NavigationUI360.js";import{SequentialNavigationUI as z}from"./OrientedImageryViewer/components/SequentialNavigationUI.js";import{loadVideoEnhancementComponents as J,renderEnhancementSlider as K,VideoEnhancementTools as Q}from"./OrientedImageryViewer/components/VideoEnhancementTools.js";import{NoImageLoadedError as X}from"./OrientedImageryViewer/navigation/errors.js";import{loadCalciteComponents as Y}from"./support/componentsUtils.js";import{globalCss as ee}from"./support/globalCss.js";import{vmEvent as te,messageBundle as ie,tsx as ae}from"./support/widget.js";const se={overlayed:"overlayed"};let oe=class extends b{constructor(e,t){super(e,t),this.dataCaptureEnabled=!1,this.galleryOpened=!1,this.imageEnhancementToolActive=!1,this.videoEnhancementToolActive=!1,this.imageOverlaysOpened=!1,this.navigationToolActive=!1,this.viewModel=new j,this.messagesCommon=null,this.messagesSketch=null,this.pixelMeasurementUnit="meters",this.pixelAreaMeasurementUnit="square-meters",this.selectedGroup=null,this.showCameraLocations=!1,this.showMapFeatures=!1,this.visibleElements=new $,this._defaultSuperimposeZOffsetPercentage=100,this._panoramicSuperimposeRadiusOffsetPercentage=100,this._imageOverlaysLoaderTask=null,this._imageMeasurementToolsLoaderTask=null,this._navigationSettingsLoaderTask=null,this._navigationTask=null,this._clearMeasurements=()=>{this.viewModel.measureType=null,this.viewModel.triangularMeasurementActive=!1,this.viewModel.clearPreviousMeasurements()},this._clearImageLocation=()=>{this.imageLocationToolActive=!1,this.triangularMeasurementActive=!1},this._createNavigationTask=async e=>(this._navigationTask?.abort(),this._navigationTask=s(async t=>await this.navigate({...e,signal:t})),this._navigationTask.promise),this._navigateNext=async()=>await this._createNavigationTask({step:1}),this._navigatePrevious=async()=>await this._createNavigationTask({step:-1}),this._navigationToolExpanded=!1,this._navigationTool=null,this._galleryController=new AbortController,this._galleryObserver=new IntersectionObserver(this._lazyLoadImage.bind(this)),this._overlayedLayers=new o,this._previousAction=null,this._closeImageSequenceAlert=()=>{this._set("noImageInSequenceError",!1)},this._handleDataCaptureLayerChange=async e=>{if(this.dataCaptureLayer&&await this.stopDataCapture(!0),this.dataCaptureLayer=this.dataCaptureLayer===e?null:e,this.dataCaptureLayer)return this.startDataCapture(this.dataCaptureLayer)},this._handleNavigationSettingsInputChange=(e,t)=>{this.set(`${e}Threshold`,t)},this._handleNavigationSettingsToggle=e=>{this.viewModel.preserveAngle=e},this._handleOverlayLayerDeselect=e=>{const t=e.layer;t===this.dataCaptureLayer&&(this.stopDataCapture(),this.dataCaptureLayer=null),this.removeOverlayedGraphicsOnImage(`${t.id}`)},this._handleOverlayLayerSelect=e=>{const t=e.layer;this.viewModel.overlayMapFeatures(t,this.showMapFeatures),this.addHandles(c(()=>t.visible,()=>{this.viewModel.toggleOverlayMapFeatures(t.id,t.visible,this.showMapFeatures)}),`${se.overlayed}-${t.id}`)},this._highlight=e=>{const t=e.target?.dataset.objectid;t&&this.viewModel.highlight(t)},this._onAction=e=>{const{target:t}=e,{dataset:{action:i}}=t,{_previousAction:a}=this,s=a?.dataset.action,o=s?.includes("draw")??!1,n="select-feature"===s,r=s!==i;switch(i){case"draw-point":case"draw-polygon":case"draw-polyline":{a&&w(n,o&&r)&&(a.active=!1),t.active=!t.active;const e=i.replace("draw-","");this.viewModel.digitizeCreate(e),this._previousAction=t.active?t:null;break}case"save":this.viewModel.saveDrawing();break;case"select-feature":o&&(this._previousAction.active=!1),t.active=!t.active,this.viewModel.toggleSelection(t.active),this._previousAction=t.active?t:null;break;case"delete-feature":this.viewModel.digitizeDelete()}},this._onImageOverlayClosed=e=>{e.stopPropagation(),this.imageOverlaysOpened=!1},this._onShowCameraLocationsChanged=e=>{this.showCameraLocations=e},this._onShowMapFeaturesChanged=e=>{this.showMapFeatures=e},this._removeHighlight=()=>this.viewModel.removeHighlight(),this._restoreOverlays=async()=>Promise.all(this._overlayedLayers.map(e=>this.viewModel.overlayMapFeatures(e,this.showMapFeatures))),this._scaleNavigationTool=()=>{this._navigationToolExpanded=!this._navigationToolExpanded},this._sketchLoaderTask=null,this._settingsToggle=null,this._toggleImageNavigation=async e=>{const t=this.navigationMode;this._closeAllImageTools(),this.navigationMode=t!==e?e:null;const{activeViewer:i}=this.viewModel;if(!i)return;const{mode:a,preserveAngle:s}=this.viewModel;if("default"===a)if("directional"===this.navigationMode){const e=await this._loadNavigationSettings(),t="heading"===s||"both"===s,i="pitch"===s||"both"===s,{messages:a,messagesCommon:o}=this,n=new e({cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,uiStrings:{configureNavigation:a.configureNavigation,preserveHeading:a.preserveHeading,preserveHeadingDescription:a.preserveHeadingDescription,preservePitch:a.preservePitch,preservePitchDescription:a.preservePitchDescription,settings:o.settings,thresholdLabel:a.thresholdLabel},onInputChange:this._handleNavigationSettingsInputChange,onToggle:this._handleNavigationSettingsToggle,preserveHeading:t,preservePitch:i});this._settingsToggle=new _({content:n,expandIcon:"configure"}),this.viewModel.activeViewer?.ui.add(this._settingsToggle,{position:"top-left"})}else this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))},this._toggleImageAttributes=p(this.viewModel.toggleImageAttributes.bind(this.viewModel)),this.navigate=async e=>{let t=null;try{const{currentNode:i}=this.viewModel;if(!i)throw new X;t=await this.viewModel.navigate(i,e)}catch(i){d(i)||l.getLogger(this).error("Error occurred while navigating",i),["NoImageInSequenceError","NoSequenceFoundError"].includes(i.name)&&this._set("noImageInSequenceError",!0)}return t},this.reset=()=>{this._closeAllImageTools(),this.viewModel.reset()},this._loadImageFromGallery=this._loadImageFromGallery.bind(this),this._registerGalleryItem=this._registerGalleryItem.bind(this),this._unregisterGalleryItem=this._unregisterGalleryItem.bind(this),this.loadImageFromSource=this.loadImageFromSource.bind(this),this.updateSuitabilities=this.updateSuitabilities.bind(this),this._handleVideoBrightnessChange=this._handleVideoBrightnessChange.bind(this),this._handleVideoContrastChange=this._handleVideoContrastChange.bind(this),this._handleBrightnessChange=this._handleBrightnessChange.bind(this),this._handleContrastChange=this._handleContrastChange.bind(this),this._handleSharpnessChange=this._handleSharpnessChange.bind(this),this._handleSuperimposeZOffsetChange=this._handleSuperimposeZOffsetChange.bind(this),this._toggleSuperimposeCameraLock=this._toggleSuperimposeCameraLock.bind(this),this._resetSuperimposeOffset=this._resetSuperimposeOffset.bind(this),this._resetVideoTools=this._resetVideoTools.bind(this),this._toggleEnhancementToolState=this._toggleEnhancementToolState.bind(this),this.announceDeprecation=()=>{n(l.getLogger(this),"Oriented Imagery Viewer","arcgis-oriented-imagery-viewer",{version:"5.0"})}}initialize(){this.addHandles([c(()=>[this.viewModel?.bestFeatureAngle,this._navigationTool],([e,t])=>{t&&this._updateNavigationTool(t)},g),c(()=>this.currentCoverageVisible,e=>this._onCurrentCoverageVisibilityChange(e)),c(()=>this.isAdditionalCoverageVisible,e=>this._onAdditionalCoverageVisibilityChange(e)),c(()=>this.isAdditionalPointSourcesVisible,e=>this._onAdditionalCameraLocationsVisibility(e)),c(()=>this.superimposeViewEnabled,e=>{e?(this._closeAllImageTools(),this.selectedGroup=null,this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1):this._resetSuperimposeOffset()}),c(()=>({features:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showCameraLocations:this.showCameraLocations}),({overlaysEnabled:e,showCameraLocations:t})=>{e&&this.viewModel.overlayCameraLocations(t)},h),c(()=>({feature:this.currentBestFeature,overlaysEnabled:this._imageOverlaysEnabled,showMapFeatures:this.showMapFeatures}),async(e,t)=>{e.showMapFeatures!==t?.showMapFeatures&&await this.viewModel.toggleAllOverlayMapFeatures(e.showMapFeatures);const i=e.feature&&e.feature!==t?.feature,a=e.overlaysEnabled&&!t?.overlaysEnabled;(i||a)&&(i&&this.viewModel.removeAllOverlayMapFeatures(),e.overlaysEnabled&&(this.dataCaptureLayer&&this.stopDataCapture(),await this._restoreOverlays(),this.dataCaptureLayer&&(await this.startDataCapture(this.dataCaptureLayer),this._previousAction?.active&&(this._previousAction.active=!1,this._previousAction=null))))},g),m(()=>this.viewModel,"popup-open",async e=>{await(this.view?.openPopup(e))},u),m(()=>this.viewModel,"popup-close",()=>{this.view?.closePopup()},u),this._toggleImageAttributes])}loadDependencies(){return Promise.all([J(),Y({"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),shell:()=>import("@esri/calcite-components/dist/components/calcite-shell"),dialog:()=>import("@esri/calcite-components/dist/components/calcite-dialog"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")}),B()])}destroy(){this._galleryController.abort(),this._galleryObserver.disconnect(),this.currentBestFeature=null}get accuracyParametersMissing(){return this.viewModel.accuracyParametersMissing}get activeLayer(){return r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer}set activeLayer(e){r(l.getLogger(this),"activeLayer",{replacement:"layer"}),this.layer=e}get activeVideoIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?t.videoPaused?"play":"pause":"play"}get activeAudioIcon(){const{videoElement:e,videoViewModel:t}=this.viewModel;return e?.loaded&&t?.videoMuted?"sound-off":"sound"}get cameraHeadingThreshold(){return this.viewModel.cameraHeadingThreshold}set cameraHeadingThreshold(e){this.viewModel.cameraHeadingThreshold=e}get cameraPitchThreshold(){return this.viewModel.cameraPitchThreshold}set cameraPitchThreshold(e){this.viewModel.cameraPitchThreshold=e}get canNavigateSequentially(){return!!this.layer?.effectiveSequenceOrderField?.length}get currentBestFeature(){return this.viewModel.currentBestFeature}set currentBestFeature(e){this.viewModel.currentBestFeature=e}get currentCoverageVisible(){return this.viewModel.currentCoverageVisible}set currentCoverageVisible(e){this.viewModel.currentCoverageVisible=e}get dataCaptureLayer(){return this.viewModel.dataCaptureLayer}set dataCaptureLayer(e){this.viewModel.dataCaptureLayer=e}get depthImageNotSupported(){return this.viewModel.depthImageNotSupported}get disabled(){return this.viewModel.disabled}set disabled(e){this.viewModel.disabled=e}get displayMessage(){return this.viewModel.displayMessage}get enhancementToolActive(){return"video"===this.viewModel.mode?this.videoEnhancementToolActive:this.imageEnhancementToolActive}set enhancementToolActive(e){"video"===this.viewModel.mode?this.videoEnhancementToolActive=e:this.imageEnhancementToolActive=e}get features(){return this.viewModel.features}get imagePointsInView(){return this.viewModel.imagePointsInView}get icon(){return"oriented-imagery-widget"}set icon(e){this._overrideIfSome("icon",e)}get imageGalleryEnabled(){return this.viewModel.imageGalleryEnabled}get imageLocationToolActive(){return this.viewModel.imageLocationToolState}set imageLocationToolActive(e){this.viewModel.imageLocationToolState=e}get invalidCameraHeading(){return this.viewModel.invalidCameraHeading}get isAdditionalCoverageVisible(){return this.viewModel.isAdditionalCoverageVisible}set isAdditionalCoverageVisible(e){this.viewModel.isAdditionalCoverageVisible=e}get isAdditionalPointSourcesVisible(){return this.viewModel.isAdditionalPointSourcesVisible}set isAdditionalPointSourcesVisible(e){this.viewModel.isAdditionalPointSourcesVisible=e}get mapImageConversionToolState(){return this.viewModel.mapImageConversionToolState}set mapImageConversionToolState(e){this.viewModel.setMapImageConversionToolState(e)}get measureType(){return this.viewModel.measureType}set measureType(e){this.viewModel.measureType=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get navigationMode(){return this.viewModel.navigationMode}set navigationMode(e){this.viewModel.navigationMode=e}get popupEnabled(){const{popupEnabled:e,state:t}=this.viewModel;return("image-loaded"===t||this.videoLoaded)&&e}get preloadMedia(){return this.viewModel.preloadMedia}set preloadMedia(e){this.viewModel.preloadMedia=e}get referencePoint(){return this.viewModel.referencePoint??null}get sketchViewModel(){return this.viewModel.sketch}get triangularMeasurementActive(){return this.viewModel.triangularMeasurementActive}set triangularMeasurementActive(e){this.viewModel.triangularMeasurementActive=e}get videoLoaded(){const{mode:e,videoElement:t,panoramicVideoLoaded:i}=this.viewModel;return("video"===e&&!0===t?.loaded||i)??!1}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}set determineWorkflowForFeature(e){this.viewModel.determineWorkflowForFeature=e}get determineWorkflowForFeature(){return this.viewModel.determineWorkflowForFeature}get shouldShowSelectedImage(){return this.viewModel.shouldShowSelectedImage}set shouldShowSelectedImage(e){this.viewModel.shouldShowSelectedImage=e}get superimposeViewEnabled(){return this.viewModel.superimposeViewEnabled}set superimposeViewEnabled(e){this.viewModel.superimposeViewEnabled=e}get defaultSuperimposeCameraLockEnabled(){return this.viewModel.defaultSuperimposeCameraLockEnabled}set defaultSuperimposeCameraLockEnabled(e){this.viewModel.defaultSuperimposeCameraLockEnabled=e}set updateFootprint(e){this.viewModel.updateFootprint=e}get updateFootprint(){return this.viewModel.updateFootprint}get verticalFilterEnabled(){return this.viewModel.verticalFilterEnabled}set verticalFilterEnabled(e){this.viewModel.verticalFilterEnabled=e}_renderActionBar(){const{selectedGroup:e,superimposeViewEnabled:i}=this;if(i)return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},ae("calcite-action-group",null,this._superimposeViewToggle()));const a=t();return ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal",slot:"action-bar"},!e&&ae("calcite-action-group",null,this._searchGroupToggle(),this._overlaysGroupToggle(),this._navigationGroupToggle(),this._measurementsGroupToggle(),this._utilitiesGroupToggle()),this._renderGroupBackAction(a),"overlays"===e&&ae("calcite-action-group",null,this._currentFootprintToggle(),this._additionalFootprintToggle(),this._additionalPointSourcesToggle(),this._mapImageConversionToggle(),this._imageOverlaysToggle()),"navigation"===e&&ae("calcite-action-group",null,this._directionToolsToggle(),this._navigationToolToggle(),this._imageGalleryToggle()),"measurements"===e&&ae("calcite-action-group",null,this._measurementToolToggle()),"utilities"===e&&ae("calcite-action-group",null,this._imageEnhancementsToggle(),this._videoEnhancementsToggle(),this._superimposeViewToggle(),this._openPopupAction()),"search"===e&&ae("calcite-action-group",null,this._exploreImagesToggle(),this._exploreImages3DToggle(),this._showSelectedImageToggle()))}_renderGroupBackAction(e){return this.selectedGroup?ae("calcite-action",{bind:this,icon:e?"arrow-right":"arrow-left",key:"back-arrow",text:this.messages.previous,title:this.messages.previous,onclick:()=>this._toggleGroupSelection(null)}):null}get _activeMeasurementHeading(){const{measureType:e,messages:t,triangularMeasurementActive:i}=this,{groundArea:a,heightAboveGround:s,groundDistance:o,triangulatedAreaHeading:n,triangulatedDistanceHeading:r}=t;if(i)return"area"===e?n:r;switch(e){case"area":return a;case"height":return s;default:return o}}_additionalFootprintToggle(){const{isAdditionalCoverageVisible:e,invalidCameraHeading:t,visibleElements:{additionalFootprintToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addCoverage,disabled:t,icon:"trapezoid-area",text:this.messages.additionalFootprints,title:this.messages.additionalFootprints,onclick:this._toggleAdditionalCoverage}):null}_additionalPointSourcesToggle(){const{isAdditionalPointSourcesVisible:e,invalidCameraHeading:t,visibleElements:{additionalCameraLocationsToggle:i}}=this;return i?ae("calcite-action",{active:e,bind:this,class:E.addExpPoints,disabled:t,icon:"circle-area",text:this.messages.additionalCameraLocations,title:this.messages.additionalCameraLocations,onclick:this._toggleAdditionalCameraLocations}):null}get _measurementToggle(){const{viewModel:{state:e,measureType:t,currentBestFeatureMeasurementImage:i},triangularMeasurementActive:a,id:s}=this;if("image-loaded"!==e||!t||a&&!i)return;this._imageMeasurementToolsLoaderTask||this._loadImageMeasurementResources();const o=this._imageMeasurementToolsLoaderTask?.value;return o?ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:this._activeMeasurementHeading,id:`${s}-${t}-measurement`,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearMeasurements},ae(o,{measurementType:t,measurementUnitMessages:this.measurementUnitMessages,messages:this.messages,oiViewModel:this.viewModel})):null}get _renderRoot(){const{viewModel:{state:e},triangularMeasurementActive:t}=this;return ae("calcite-panel",{bind:this,class:t?E.viewerContainerMeasurement:E.viewerContainer,heading:this.visibleElements.header?this.messages.title:void 0,loading:e.includes("loading")&&!t},this.visibleElements.menu?this._renderActionBar():null,ae("calcite-shell",null,ae("calcite-panel",null,this._imageViewer,this._panoramicViewer,this._panoramicVideoViewer,this._videoViewer,this._messageBox,this.invalidCameraHeading?null:[this._imageGalleryPanel,this._renderNavigation,this._imageOverlaysPanel()],this._imageEnhancementTools,this._videoEnhancementTools,this._superimposeTools,this._renderSketch(),this._navigationUI),this._imageViewerTriangular,this._measurementToggle,this._locationToggle,this.invalidCameraHeading?this._renderWarning(this.messages.invalidCameraHeadingWarningTitle,this.messages.invalidCameraHeadingWarningDescription):null,this.depthImageNotSupported?this._renderWarning(this.messages.depthImageNotSupportedTitle,this.messages.depthImageNotSupportedDescription):null,this.noImageInSequenceError?this._renderWarning(this.messages.sequentialNavigationWarning,this.messages.sequentialNavigationWarning,this._closeImageSequenceAlert):null))}_currentFootprintToggle(){const{currentCoverageVisible:e,invalidCameraHeading:t}=this,{currentFootprintToggle:i}=this.visibleElements;return i?ae("calcite-action",{active:e,bind:this,class:E.currentCoverage,disabled:t,icon:"trapezoid-area",text:this.messages.currentFootprint,title:this.messages.currentFootprint,onclick:this._toggleCurrentCoverage}):null}_exploreImagesToggle(){const{exploreImages:e}=this.messages;return this.visibleElements.exploreImages?ae("calcite-action",{active:!this.disabled,bind:this,icon:"oriented-imagery-widget",text:e,title:e,onclick:this._toggleExploreImages}):null}get _imageEnhancementTools(){const{enhancementToolActive:e,viewModel:{brightness:t,contrast:i,sharpness:a,state:s}}=this;return e&&"image-loaded"===s?ae("calcite-panel",{bind:this,class:E.imageEnhancementWrapper,closable:!0,closed:!e,heading:this.messages.imageEnhancement,key:this.messages.imageEnhancement,onCalcitePanelClose:this._toggleEnhancementToolState},ae("div",{class:E.imageEnhancementTools},K({title:this.messages.brightness,value:t,max:10,min:-10,ticks:5,handleChange:this._handleBrightnessChange}),K({title:this.messages.contrast,value:i,max:10,min:-10,ticks:5,handleChange:this._handleContrastChange}),K({title:this.messages.sharpness,value:a,max:1,min:0,ticks:.5,step:.1,handleChange:this._handleSharpnessChange})),ae("calcite-action",{bind:this,icon:"reset",slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset,onclick:this._resetImageTools})):null}get _videoEnhancementTools(){const{enhancementToolActive:e,viewModel:{videoViewModel:t,mode:i},messages:{videoEnhancement:a,brightness:s,contrast:o},messagesCommon:{reset:n}}=this;return e&&"video"===i&&t?ae(Q,{brightness:t.videoBrightness,constrast:t.videoContrast,handleBrightnessChange:this._handleVideoBrightnessChange,handleContrastChange:this._handleVideoContrastChange,resetTools:this._resetVideoTools,uiStrings:{videoEnhancement:a,brightness:s,contrast:o,reset:n},videoEnhancementToolActive:e,onClose:this._toggleEnhancementToolState}):null}get _superimposeTools(){const{superimposeViewEnabled:e,view:t,viewModel:{state:i,mode:a},messages:{superimposeSettings:s,superimposeSliderTitle:o,superimposeSliderTooltip:n}}=this,r="panoramic"===a;return e&&"3d"===t?.type&&"image-loaded"===i?ae("calcite-panel",{bind:this,class:this.classes(E.imageEnhancementWrapper,E.superimposeTools),heading:s,key:"superimpose-settings"},ae("div",{class:E.imageEnhancementTools},K({title:o,tooltip:n,value:r?this._panoramicSuperimposeRadiusOffsetPercentage:this._defaultSuperimposeZOffsetPercentage,max:100,min:0,ticks:10,step:1,handleChange:this._handleSuperimposeZOffsetChange})),ae("calcite-action",{bind:this,icon:"reset",slot:"header-actions-end",text:this.messagesCommon.reset,title:this.messagesCommon.reset,onclick:this._resetSuperimposeOffset})):null}_imageEnhancementsToggle(){const{state:e,mode:t}=this.viewModel,{enhancementTool:i}=this.visibleElements;return i&&"video"!==t?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"default"!==t||"image-loaded"!==e,icon:"sliders-horizontal",text:this.messages.imageEnhancement,title:this.messages.imageEnhancement,onclick:this._toggleEnhancementToolState}):null}_exploreImages3DToggle(){const{exploreImages3D:e}=this.messages,t="3d"!==this.view?.type||!this.layer?.verticalSearchRange;return this.visibleElements.exploreImages3D?ae("calcite-action",{active:this.verticalFilterEnabled,bind:this,disabled:t,icon:"i3DSearch",text:e,title:e,onclick:this._toggleVerticalSearchFilter}):null}_showSelectedImageToggle(){const{displayImages:e}=this.messages,t=this.viewModel.mode.includes("video");return this.visibleElements.showSelectedImage?ae("calcite-action",{active:this.shouldShowSelectedImage,bind:this,disabled:t,icon:"show-oriented-imagery",text:e,title:e,onclick:this._toggleShowSelectedImage}):null}_superimposeViewToggle(){const{superimposeView:e}=this.messages,{mode:t,accuracyParametersMissing:i}=this.viewModel,a=!this.superimposeViewEnabled&&("3d"!==this.view?.type||t.includes("video")||i);return this.visibleElements.superimpose?ae("calcite-action",{active:this.superimposeViewEnabled,bind:this,disabled:a,icon:"superimpose",text:e,title:e,onclick:this._toggleSuperimposeView}):null}_videoEnhancementsToggle(){const{mode:e}=this.viewModel,{videoEnhancement:t}=this.messages,{enhancementTool:i}=this.visibleElements;return i&&"video"===e?ae("calcite-action",{active:this.enhancementToolActive,bind:this,disabled:"video"!==e,icon:"sliders-horizontal",text:t,title:t,onclick:this._toggleEnhancementToolState}):null}get _imageGalleryPanel(){const{container:e,galleryOpened:t,imageGalleryEnabled:i}=this;return i&&t&&e?this._imageGalleryContext:null}get _imageGalleryContext(){const{galleryOpened:e,invalidCameraHeading:t}=this;return ae("calcite-panel",{bind:this,class:E.carousel,closable:!0,closed:!e,disabled:t,heading:this.messages.imageGallery,key:this.messages.imageGallery,onCalcitePanelClose:this._toggleImageGallery},ae("div",{class:E.carouselContainer},this._renderThumbnails))}_imageGalleryToggle(){const{imageGalleryEnabled:e,invalidCameraHeading:t,visibleElements:{imageGallery:i}}=this;return i?ae("calcite-action",{active:this.galleryOpened,bind:this,disabled:!e||t,icon:"images",text:this.messages.imageGallery,title:this.messages.imageGallery,onclick:this._toggleImageGallery}):null}get _imageOverlaysComponent(){const{_imageOverlayMessages:e,_imageOverlaysLoaderTask:t,_overlayedLayers:i,dataCaptureEnabled:a,dataCaptureLayer:o,imageOverlaysOpened:n,showCameraLocations:r,showMapFeatures:l,view:d,layer:c}=this;if(!c)return null;const g=c.imageGeometryField?.length?c.imageGeometryField:I,h=c.imageReferenceField?.length?c.imageReferenceField:S;t||(this._imageOverlaysLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/ImageOverlays.js")).default));const m=this._imageOverlaysLoaderTask?.value;return m?ae(m,{closed:!n,dataCaptureEnabled:a,dataCaptureLayer:o,imageGeometryField:g,imageReferenceField:h,messages:e,overlayedLayers:i,showCameraLocations:r,showMapFeatures:l,view:d,onDataCaptureLayerChanged:this._handleDataCaptureLayerChange,onFilterCapturedFeatures:this.viewModel.filterCapturedFeatures,onImageOverlaysClosed:this._onImageOverlayClosed,onLayerDeselected:this._handleOverlayLayerDeselect,onLayerSelected:this._handleOverlayLayerSelect,onShowCameraLocationsChanged:this._onShowCameraLocationsChanged,onShowMapFeaturesChanged:this._onShowMapFeaturesChanged}):null}get _navigationUI(){const{navigationMode:e,viewModel:t}=this,{mode:i,state:a}=t;if(e&&("default"===i||"panoramic"===i)&&"image-loaded"===a)return"directional"===e?"default"===i?ae(U,{cameraHeadingThreshold:this.cameraHeadingThreshold,cameraPitchThreshold:this.cameraPitchThreshold,currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes,preserveAngle:this.viewModel.preserveAngle}):ae(Z,{currentNode:this.viewModel.currentNode,navigate:this._createNavigationTask,nodes:this.viewModel.navigationNodes}):ae(z,{layout:"horizontal",uiStrings:{end:this.messages.end,next:this.messages.next,previous:this.messages.previous,start:this.messages.start},onNext:this._navigateNext,onPrev:this._navigatePrevious})}get _imageOverlayMessages(){return{...this.messages,...this.messagesSketch}}get _imageSketchToolsMessages(){return{...this.messagesCommon,...this.messagesSketch}}_imageOverlaysPanel(){const{imageOverlaysOpened:e}=this,t=this.classes({[E.imageOverlaysContainer]:!0,[ee.hidden]:!e||!this._imageOverlaysEnabled});return ae("div",{class:t,key:this.messages.imageOverlays},this._imageOverlaysComponent)}_imageOverlaysToggle(){const{imageOverlaysOpened:e,invalidCameraHeading:t,visibleElements:{imageOverlays:i}}=this;return i?ae("calcite-action",{active:e,bind:this,disabled:!this._imageOverlaysEnabled||t,icon:"layers",text:this.messages.imageOverlays,title:this.messages.imageOverlays,onclick:this._toggleImageOverlays}):null}get _imageOverlaysEnabled(){return this.viewModel.overlayGraphicsEnabled}get _imageViewer(){const{displayMessage:e,loadImageViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"default"!==i||s.includes("loading");return ae(W,{afterCreate:t,clickAction:a,visible:!o})}get _imageViewerTriangular(){const{messages:e,triangularMeasurementActive:t}=this,{displayMessage:i,storeImageMeasurementViewer:a,storePanoramicMeasurementViewer:s,mode:o,state:n,clickAction:r}=this.viewModel,l=null!=i||"none"===o||"video"===o,d=this.classes({[E.viewer]:!l,[E.viewerHidden]:l});return t?ae("calcite-panel",{class:E.viewerContainerMeasurement,heading:e.measurementViewerHeading,loading:n.includes("loading")},ae("calcite-panel",{bind:this,class:d},"default"===o?ae(W,{afterCreate:a,clickAction:r,uiStrings:e}):ae(M,{afterCreate:s,clickAction:r,uiStrings:e}))):null}_utilitiesGroupToggle(){const{utilityTools:e}=this.messages;return this.visibleElements.utilityTools?ae("calcite-action",{bind:this,icon:"tools",key:"utilities-group-toggle",text:e,title:e,onclick:()=>this._toggleGroupSelection("utilities")}):null}_searchGroupToggle(){const{searchTools:e}=this.messages;return this.visibleElements.searchTools?ae("calcite-action",{bind:this,icon:"search",key:"search-group-toggle",text:e,title:e,onclick:()=>this._toggleGroupSelection("search")}):null}get _videoViewer(){const{mode:e,loadVideoViewer:t,videoViewModel:i}=this.viewModel,{control:a,reset:s}=this.messagesCommon,{mute:o,unmute:n}=this.messages,r="video"!==e,l=this.classes({[E.viewer]:!r,[E.viewerHidden]:r}),d="esri-image-viewer",c=`${d}__slider-container`;return ae("calcite-panel",{bind:this,class:l},ae("calcite-panel",{afterCreate:t,class:this.classes(ee.widget,d)}),ae("calcite-block",{class:c,expanded:!0},ae("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:i?.videoDuration,minLabel:"0",value:i?.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),ae("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeVideoIcon,text:"Play",title:i?.videoPaused?a.play:a.pause,onclick:()=>i?.playVideoHandler()})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:"refresh",text:"Rewind",title:s,onclick:()=>i?.rewindVideoHandler()})),ae("calcite-action-group",null,ae("calcite-action",{bind:this,icon:this.activeAudioIcon,text:"Audio",title:i?.videoMuted?o:n,onclick:()=>i?.toggleAudio()}))))}get _locationToggle(){const{viewModel:{state:e,groundCoordinates:t,groundCoordinatesAccuracy:i,triangulatedPoint:a},imageLocationToolActive:s,triangularMeasurementActive:o,messages:{groundLocation:n,triangulatedLocationHeading:r}}=this;if("image-loaded"!==e||!t||!s)return;let l=t;if(o){if(!a)return;l=a}return ae("calcite-dialog",{bind:this,dragEnabled:!0,escapeDisabled:!0,heading:o?r:n,id:n,open:!0,placement:"bottom-start",resizable:!0,scale:"s",slot:"dialogs",width:"s",onCalciteDialogBeforeClose:this._clearImageLocation},ae(q,{accuracy:i,groundCoordinates:l,messages:this.messages}))}_mapImageConversionToggle(){const{mapImageConversionToolState:e,viewModel:{state:t,disabled:i},videoLoaded:a,invalidCameraHeading:s,visibleElements:{mapImageConversionTool:o}}=this,n=!("video"!==this.viewModel.mode||!a||!this.viewModel.videoViewModel?.videoPaused),r="panoramic-video"===this.viewModel.mode&&this.viewModel.panoramicVideoLoaded&&this.viewModel.panoramicVideoPaused;return o?ae("calcite-action",{active:e,bind:this,disabled:"image-loaded"!==t&&!n&&!r||s||i,icon:"image-pin",text:this.messages.mapImageConversionTool,title:this.messages.mapImageConversionTool,onclick:this._toggleMapImageConversionToolState}):null}_measurementToolToggle(){const{measureType:e,viewModel:t,accuracyParametersMissing:i,messages:a,triangularMeasurementActive:s}=this,{state:o}=t,{groundDistance:n,groundArea:r,heightAboveGround:l,groundLocation:d,triangulatedDistanceHeading:c,triangulatedAreaHeading:g,triangulatedLocationHeading:h}=a,m="image-loaded"!==o||i;return ae("calcite-action-group",{key:"measurement-tools",scale:"m"},ae("calcite-action",{active:"distance"===e&&!s,bind:this,disabled:m,icon:"measure-line",key:"distance-measurement",text:n,title:n,onclick:e=>this._toggleMeasurementSketch(e,"distance")}),ae("calcite-action",{active:"area"===e&&!s,bind:this,disabled:m,icon:"measure-area",key:"area-measurement",text:r,title:r,onclick:e=>this._toggleMeasurementSketch(e,"area")}),ae("calcite-action",{active:"height"===e,bind:this,disabled:m,icon:"measure-building-height-top-base",key:"height-measurement",text:l,title:l,onclick:e=>this._toggleMeasurementSketch(e,"height")}),ae("calcite-action",{active:!!this.imageLocationToolActive&&!s,bind:this,disabled:m,icon:"pin-tear",key:"surface-location",text:d,title:d,onclick:this._toggleLocationTool}),ae("calcite-action",{active:!!s&&this.imageLocationToolActive,bind:this,disabled:m,icon:"dual-image-location",key:"triangular-location",text:h,title:h,onclick:this._toggleTriangularLocation}),ae("calcite-action",{active:!!s&&"distance"===this.measureType,bind:this,disabled:m,icon:"dual-image-distance",key:"triangular-distance",text:c,title:c,onclick:this._toggleTriangularDistanceMeasurements}),ae("calcite-action",{active:!!s&&"area"===this.measureType,bind:this,disabled:m,icon:"dual-image-area",key:"triangular-area",text:g,title:g,onclick:this._toggleTriangularAreaMeasurements}))}get _messageBox(){const{messages:e,viewModel:{displayMessage:t,mode:a}}=this;if(!t||"video"===a)return null;const{data:s,key:o,map:n}=t,r=`${n?i(e[o],n):e[o]}`;return ae("span",{class:E.messageBox},s?`${r} ${s}`:r)}async _loadNavigationSettings(){return this._navigationSettingsLoaderTask||(this._navigationSettingsLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/NavigationSettings.js")).default)),await this._navigationSettingsLoaderTask.promise}_measurementsGroupToggle(){const{measurementTools:e}=this.messages,{state:t,accuracyParametersMissing:i}=this.viewModel,a="image-loaded"!==t||i;return this.visibleElements.measurementTools?ae("calcite-action",{bind:this,disabled:a,icon:"measure-line",key:"measurements-group-toggle",text:e,title:e,onclick:()=>this._toggleGroupSelection("measurements")}):null}_navigationGroupToggle(){const{imageNavigation:e}=this.messages;return this.visibleElements.imageNavigationTools?ae("calcite-action",{bind:this,icon:"absolute-direction",key:"navigation-group-toggle",text:e,title:e,onclick:()=>this._toggleGroupSelection("navigation")}):null}_navigationToolToggle(){const{state:e}=this.viewModel,{visibleElements:{navigationTool:t},videoLoaded:i}=this;return t?ae("calcite-action",{active:this.navigationToolActive,bind:this,disabled:"image-loaded"!==e&&!i||this.invalidCameraHeading,icon:"explore",text:this.messages.navigationTool,title:this.messages.navigationTool,onclick:this._toggleNavigationTool}):null}_directionToolsToggle(){const{messages:e,viewModel:t,visibleElements:i}=this,{directionalNavigation:a,sequentialNavigation:s}=i,{state:o}=t,{directionalNavigation:n,directionalNavigationDescription:r,sequentialNavigation:l,sequentialNavigationDescription:d}=e;return ae("calcite-action-group",{key:"navigation-tools",scale:"m"},a?ae("calcite-action",{active:"directional"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading,icon:"directional-navigation",text:r,title:n,onclick:()=>{this._toggleImageNavigation("directional")}}):null,s?ae("calcite-action",{active:"sequential"===this.navigationMode,bind:this,disabled:"image-loaded"!==o||this.invalidCameraHeading||!this.canNavigateSequentially,icon:"sequential-navigation",text:d,title:l,onclick:()=>{this._toggleImageNavigation("sequential")}}):null)}_overlaysGroupToggle(){const{overlays:e}=this.messages;return this.visibleElements.overlays?ae("calcite-action",{bind:this,icon:"oriented-imagery-overlays",key:"overlays-group-toggle",text:e,title:e,onclick:()=>this._toggleGroupSelection("overlays")}):null}_openPopupAction(){const{showPopupsAction:e}=this.visibleElements;return e?ae("calcite-action",{bind:this,disabled:!this.popupEnabled,icon:"popup",text:this.messages.showPopups,title:this.messages.showPopups,onclick:this._toggleImageAttributes}):null}get _panoramicVideoViewer(){const{displayMessage:e,loadPanoramicVideoViewer:t,mode:i,clickAction:a,state:s,currentBestFeature:o}=this.viewModel,n=o?.attributes.imagePath,r=null!=e||"panoramic-video"!==i||s.includes("loading")||!n;return ae(T,{afterCreate:t,clickAction:a,oiViewModel:this.viewModel,videoSource:n,visible:!r})}get _panoramicViewer(){const{displayMessage:e,loadPanoramicViewer:t,mode:i,clickAction:a,state:s}=this.viewModel,o=null!=e||"panoramic"!==i||s.includes("loading");return ae(M,{afterCreate:t,clickAction:a,visible:!o})}get noImageInSequenceError(){return this._get("noImageInSequenceError")??!1}_activateTriangulatedImageLocationTool(){this.navigationToolActive=!0,this.imageLocationToolActive=!0}_activateTriangulatedImageLocationWorkflow(e,t){this._closeAllImageTools(),this.imageLocationToolActive=!0,this.triangularMeasurementActive=!e,this.navigationToolActive=!!t||!t}_closeImageToolsAndToggleNavigation(e,t){this._closeAllImageTools(),this.triangularMeasurementActive=!e,this.navigationToolActive=!t}_resetMeasureTypeAndActivateImageLocationTool(){this.measureType=null,this.imageLocationToolActive=!0}_closeAllImageTools(){this.enhancementToolActive=!1,this.navigationToolActive=!1,this.imageOverlaysOpened=!1,this.galleryOpened=!1,this.measureType=null,this.imageLocationToolActive=!1,this.navigationMode=null,this.triangularMeasurementActive=!1,this._settingsToggle&&(this._settingsToggle.expanded=!1,this.viewModel.activeViewer?.ui.remove(this._settingsToggle))}_handleBrightnessChange(e){this.viewModel.brightness=e.currentTarget.value??0}_handleVideoBrightnessChange(e){this.viewModel.videoViewModel?.handleVideoBrightnessChange(e.target.value)}_handleContrastChange(e){this.viewModel.contrast=e.currentTarget.value??0}_handleVideoContrastChange(e){this.viewModel.videoViewModel?.handleVideoContrastChange(e.target.value)}_handleVideoSeek(e){const t=this.viewModel?.videoElement?.content;t&&(t.currentTime=e.target.value,t.play())}_handleSharpnessChange(e){this.viewModel.sharpness=e.currentTarget.value??0}_handleSuperimposeZOffsetChange(e){const t=e.currentTarget.value??0;if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=t,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(100-t);this._panoramicSuperimposeRadiusOffsetPercentage=t,this.viewModel.setPanoramicSuperimposeRadiusPercentage(100-t)}_lazyLoadImage(e,t){e.forEach(async e=>{if(e.isIntersecting){const a=e.target,s=a.getAttribute("data-src"),o=a.getAttribute("data-rotation"),n=a.getAttribute("data-objectid"),r=o?parseFloat(o)%360:0,{layer:c,_galleryController:{signal:g}}=this;if(!s||!n)return;let h;try{h=G(s)?await N(c,n,{signal:g}):await D(s,{signal:g})}catch(i){d(i)||l.getLogger("esri.widgets.OrientedImageryViewer").error("#lazyLoadImage()",i)}finally{t.unobserve(a)}if(!h)return;H(h,a,r)}})}_loadImageFromGallery(e){const{target:t}=e;if(!t)return;const i=t.getAttribute("data-objectid");i&&this.viewModel.currentBestFeature?.attributes.objectId!==Number(i)&&this.viewModel.selectBestFeature(i)}_loadImageMeasurementResources(){this._imageMeasurementToolsLoaderTask=s(async()=>{const{default:e}=await import("./OrientedImageryViewer/components/ImageMeasurementWidget.js");return e})}_loadSketchResources(){this._sketchLoaderTask=s(async()=>(await import("./OrientedImageryViewer/components/SketchTools.js")).default)}_onAdditionalCoverageVisibilityChange(e){this.viewModel.setAdditionalCoverageVisibility(e)}_onAdditionalCameraLocationsVisibility(e){this.viewModel.setAdditionalCameraLocationsVisibility(e)}_onCurrentCoverageVisibilityChange(e){this.viewModel.setCurrentCoverageVisibility(e)}_registerGalleryItem(e){this._galleryObserver.observe(e)}_renderWarning(e,t,i){const{viewModel:{state:a}}=this;return"image-loaded"===a?ae(R,{icon:"exclamation-mark-triangle-f",kind:"warning",message:t,open:!0,title:e,tooltip:t,topLayerDisabled:this.topLayerDisabled,onClose:i}):null}get _renderNavigation(){const{viewModel:{sectorData:e,navigatorCurrentBestFeature:t,currentBestFeature:i,state:s}}=this;if(!this.container||!i)return null;let o,n,r,l,d;if(t){const{x:e,y:i,direction:a}=t,[s,c,g,h]=A[a];o=`M ${e} ${i} L ${s} ${c} A ${L[2]} ${L[2]} 0 0 1 ${g} ${h} Z`,n=e,l=i,r=A[a][4],d=A[a][5]}const c=e=>{const t=e.target.dataset?.sector;t&&this.viewModel.handleSectorClick(+t)},g=e=>{const t=e.target.dataset;if(!t)return;const{featureIndexInSector:i,sector:a}=t;i&&a&&this.viewModel.handleFeatureClick({sector:a,featureIndexInSector:+i})},h=e=>{e.removeEventListener("click",g)},m=i.attributes.objectId,u=e?.map(e=>e?.items).filter(Boolean).flatMap(e=>e?.map(({x:e,y:t,objectID:i,featureIndexInSector:a,sector:s})=>ae("circle",{afterRemoved:h,class:this.classes(E.feature,{selected:m===i}),cx:e,cy:t,"data-feature-index-in-sector":a,"data-sector":s,key:`${E.feature}-${i}`,r:k,onclick:g}))),p=e=>{e.removeEventListener("click",c)},v=this.classes({[E.navigationWrapper]:!0,[E.navigationZoomed]:this._navigationToolExpanded});return this.navigationToolActive&&("image-loaded"===s||this.videoLoaded)?ae("div",{bind:this,class:v,key:this.messages.navigationTool},ae("svg",{afterCreate:e=>this._storeNavigationToolReference(e),class:a()?O:E.rotateWithAnimation,focusable:"false",height:V,role:"img",width:V,xmlns:"http://www.w3.org/2000/svg"},ae("defs",null,ae("linearGradient",{gradientUnits:"userSpaceOnUse",id:`${this.id}-coverage-fill`,x1:n,x2:r,y1:l,y2:d},ae("stop",{class:E.navigationPathOffset0,offset:0}),ae("stop",{class:E.navigationPathOffset1,offset:1}))),ae("g",null,ae("circle",{class:this.classes(E.sector,E.outerSector),cx:L[3],cy:L[3],r:L[3],onclick:this._scaleNavigationTool}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[2]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[1]}),ae("circle",{class:E.sector,cx:L[3],cy:L[3],r:L[0]}),ae("path",{class:E.pointer,d:"M 56.5 6.06217782649107 L 60 0 L 63.5 6.06217782649107 Z",key:`${E.pointer}-west`}),ae("path",{class:this.classes(E.pointer,E.north),d:"M 113.93782217350893 56.5 L 120 60 L 113.93782217350893 63.5 Z",key:`${E.pointer}-north`}),ae("path",{class:E.pointer,d:"M 56.5 113.93782217350893 L 60 120 L 63.5 113.93782217350893 Z",key:`${E.pointer}-east`}),ae("path",{class:E.pointer,d:"M 6.06217782649107 56.5 L 0 60 L 6.06217782649107 63.5 Z",key:`${E.pointer}-south`}),ae("path",{class:this.classes(E.sector,E.sectorSeparator),d:"M 23.937554159486076 23.937554159486076 L 96.06244584051393 96.06244584051393 M 23.937554159486076 96.06244584051393 L 96.06244584051393 23.937554159486076",key:E.sectorSeparator}),C([L[2],L[1],L[0]],L[3],L[3]).map((t,i)=>ae("path",{afterRemoved:p,class:this.classes(E.sector,e?.[i]?.length?E.sectorEnabled:E.sectorDisabled),d:t,"data-sector":`${i}`,key:`${E.sector}-${i}`,onclick:c})),ae("path",{class:this.classes(E.sector,E.sectorCross),d:"M 56.4 56.4 L 63.53 63.53 M 63.53 56.4 L 56.4 63.53",key:E.sectorCross}),u,i.attributes.cameraPitch>=5&&o?ae("path",{class:E.selectedFeaturePath,d:o,fill:`url(#${this.id}-coverage-fill)`,key:E.selectedFeaturePath}):null))):null}_renderSketch(){const{dataCaptureLayer:e,imageOverlaysOpened:t}=this;if(!e||t)return null;if(this._sketchLoaderTask||this._loadSketchResources(),!this._sketchLoaderTask?.value)return null;const{geometryType:i}=e,a="point"===i?"pin":"polyline"===i?"line":"polygon",s=this._sketchLoaderTask.value;return ae("div",{class:E.sketchTools},ae(s,{icon:a,messages:this._imageSketchToolsMessages,type:i,onAction:this._onAction}))}get _renderThumbnails(){const{currentBestFeature:e,thumbnails:t}=this.viewModel;return e?ae("div",{class:E.carouselContent},t?.items.map(({url:t,objectId:i,rotation:a},s)=>ae("div",{class:`${E.carouselItemWrapper}${e.attributes.objectId===i?"--selected":""}`,key:`${E.carouselItemWrapper}-${s}`},ae("canvas",{afterCreate:this._registerGalleryItem,afterRemoved:this._unregisterGalleryItem,alt:`thumbnail-${i}`,class:E.carouselItem,"data-objectid":`${i}`,"data-rotation":`${a}`,"data-src":t,onclick:this._loadImageFromGallery,onmouseenter:this._highlight,onmouseleave:this._removeHighlight})))):null}_resetImageTools(){this.viewModel.sharpness=this.viewModel.brightness=this.viewModel.contrast=0}_resetVideoTools(){this.viewModel.videoViewModel?.resetVideoEnhancementTools()}_storeNavigationToolReference(e){this._navigationTool=e}_toggleAdditionalCameraLocations(){this.isAdditionalPointSourcesVisible=!this.isAdditionalPointSourcesVisible}_toggleAdditionalCoverage(){this.isAdditionalCoverageVisible=!this.isAdditionalCoverageVisible}_toggleCurrentCoverage(){this.currentCoverageVisible=!this.currentCoverageVisible}_toggleShowSelectedImage(){this.shouldShowSelectedImage=!this.shouldShowSelectedImage,this._toggleDisabledViewer(this.shouldShowSelectedImage)}_resetSuperimposeOffset(){if("default"===this.viewModel.mode)return this._defaultSuperimposeZOffsetPercentage=100,void this.viewModel.setDefaultSuperimposeZOffsetPercentage(0);this._panoramicSuperimposeRadiusOffsetPercentage=100,this.viewModel.setPanoramicSuperimposeRadiusPercentage(0)}_toggleSuperimposeCameraLock(){this.viewModel.updateDefaultSuperimposeCameraLock(!this.defaultSuperimposeCameraLockEnabled)}_toggleSuperimposeView(){this.superimposeViewEnabled=!this.superimposeViewEnabled}_toggleVerticalSearchFilter(){this.verticalFilterEnabled=!this.verticalFilterEnabled,this._toggleDisabledViewer(this.verticalFilterEnabled)}_toggleDisabledViewer(e){e&&(this.disabled=!1)}_toggleEnhancementToolState(e){e.stopPropagation();const t=this.enhancementToolActive;this._closeAllImageTools(),this.enhancementToolActive=!t}_toggleExploreImages(){this.disabled=!this.disabled,this.disabled&&(this.shouldShowSelectedImage=!1,this.verticalFilterEnabled=!1)}_toggleGroupSelection(e){this.selectedGroup=e}_toggleImageOverlays(e){e.stopPropagation();const t=this.imageOverlaysOpened;this._closeAllImageTools(),this.imageOverlaysOpened=!t}_toggleImageGallery(e){e.stopPropagation();const t=this.galleryOpened;this._closeAllImageTools(),this.galleryOpened=!!this.imageGalleryEnabled&&!t}_toggleLocationTool(e){const t=this.imageLocationToolActive,i=this.triangularMeasurementActive&&t;this._closeAllImageTools(),this.imageLocationToolActive=i||!t,e.stopPropagation()}_toggleMeasurementSketch(e,t){e.stopPropagation();const i=this.measureType,a=this.triangularMeasurementActive;this._closeAllImageTools(),this.measureType=i!==t||a?t:null,this.measureType===t&&(this.viewModel.displayNewMeasurementButton=!0)}_toggleNavigationTool(){const e=this.navigationToolActive;this._closeAllImageTools(),this.navigationToolActive=!e}_toggleMapImageConversionToolState(){this.mapImageConversionToolState=!this.mapImageConversionToolState}_toggleTriangularAreaMeasurements(){this._toggleTriangularMeasurements("area")}_toggleTriangularDistanceMeasurements(){this._toggleTriangularMeasurements("distance")}_toggleTriangularLocation(){const e=this.triangularMeasurementActive,t=this.navigationToolActive;e?null===this.measureType?this.imageLocationToolActive?this._closeImageToolsAndToggleNavigation(e,t):this._activateTriangulatedImageLocationTool():this._resetMeasureTypeAndActivateImageLocationTool():this._activateTriangulatedImageLocationWorkflow(e,t)}_toggleTriangularMeasurements(e){const t=this.triangularMeasurementActive,i=this.viewModel.measureType,a=this.navigationToolActive;t?e===i?(this._closeAllImageTools(),this.triangularMeasurementActive=!t,this.navigationToolActive=!a):(this.imageLocationToolActive=!1,this.measureType=e):(this._closeAllImageTools(),this.measureType=e,this.triangularMeasurementActive=!t,this.navigationToolActive=!!a||!a)}_unregisterGalleryItem(e){this._galleryObserver.unobserve(e)}_updateNavigationTool(e){const{previousFeatureAngle:t,bestFeatureAngle:i}=this.viewModel,a=(i-t+540)%360-180;e.style.setProperty(P,`${t}deg`),e.style.setProperty(F,`${t+a}deg`)}async loadBestImage(e,t){return this.viewModel.loadBestImage(e,t)}loadImageFromSource(e,t,i){return"default"===e?this.viewModel.loadMediaSource(t,i):this.viewModel.loadPanoramicMediaSource(t,i)}async overlayMapFeatures(e,t){return this.removeHandles(`${se.overlayed}-${e.id}`),this.addHandles(c(()=>e.visible,()=>{this.viewModel.toggleOverlayMapFeatures(e.id,e.visible,this.showMapFeatures)}),`${se.overlayed}-${e.id}`),this._overlayedLayers.add(e),this.viewModel.overlayMapFeatures(e,t&&this.showMapFeatures)}async plotMapPoint(e){return this.viewModel.plotMapPoint(e)}plotReferencePointOnGround(e){this.viewModel.plotReferencePointOnGround(e)}plotReferencePointOnImage(e){this.viewModel.plotReferencePointOnImage(e)}removeOverlayedGraphicsOnImage(e){this.removeHandles(`${se.overlayed}-${e}`),this._overlayedLayers.remove(this._overlayedLayers.find(t=>t.id===e)),this.viewModel.removeOverlayedGraphicsOnImage(e)}resetImage(){this.viewModel.resetImage()}render(){return ae("div",{class:this.classes(ee.widget,x)},this._renderRoot)}async showImageByObjectId(e,t){return this.viewModel.showImageByObjectId(e,t)}async startDataCapture(e){return this.viewModel.startDataCapture(e)}async stopDataCapture(e){return this.viewModel.stopDataCapture(e)}updateSuitabilities(e){this.viewModel.updateSuitabilities(e)}};e([v({readOnly:!0})],oe.prototype,"accuracyParametersMissing",null),e([v()],oe.prototype,"activeLayer",null),e([v()],oe.prototype,"activeVideoIcon",null),e([v()],oe.prototype,"activeAudioIcon",null),e([v()],oe.prototype,"cameraHeadingThreshold",null),e([v()],oe.prototype,"cameraPitchThreshold",null),e([v()],oe.prototype,"canNavigateSequentially",null),e([v()],oe.prototype,"currentBestFeature",null),e([v()],oe.prototype,"currentCoverageVisible",null),e([v()],oe.prototype,"dataCaptureEnabled",void 0),e([v()],oe.prototype,"dataCaptureLayer",null),e([v()],oe.prototype,"depthImageNotSupported",null),e([v()],oe.prototype,"disabled",null),e([v()],oe.prototype,"enhancementToolActive",null),e([v()],oe.prototype,"features",null),e([v()],oe.prototype,"imagePointsInView",null),e([v()],oe.prototype,"galleryOpened",void 0),e([v()],oe.prototype,"icon",null),e([v()],oe.prototype,"imageEnhancementToolActive",void 0),e([v()],oe.prototype,"videoEnhancementToolActive",void 0),e([v({readOnly:!0})],oe.prototype,"imageGalleryEnabled",null),e([v()],oe.prototype,"imageLocationToolActive",null),e([v()],oe.prototype,"imageOverlaysOpened",void 0),e([v({readOnly:!0})],oe.prototype,"invalidCameraHeading",null),e([v()],oe.prototype,"isAdditionalCoverageVisible",null),e([v()],oe.prototype,"isAdditionalPointSourcesVisible",null),e([v()],oe.prototype,"mapImageConversionToolState",null),e([v()],oe.prototype,"measureType",null),e([v()],oe.prototype,"layer",null),e([v()],oe.prototype,"navigationToolActive",void 0),e([v()],oe.prototype,"navigationMode",null),e([te(f()),v({type:j})],oe.prototype,"viewModel",void 0),e([v(),ie("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],oe.prototype,"messages",void 0),e([v(),ie("esri/core/t9n/Units")],oe.prototype,"measurementUnitMessages",void 0),e([v(),ie("esri/t9n/common")],oe.prototype,"messagesCommon",void 0),e([v(),ie("esri/widgets/Sketch/t9n/Sketch")],oe.prototype,"messagesSketch",void 0),e([v()],oe.prototype,"pixelMeasurementUnit",void 0),e([v()],oe.prototype,"pixelAreaMeasurementUnit",void 0),e([v({readOnly:!0})],oe.prototype,"popupEnabled",null),e([v()],oe.prototype,"preloadMedia",null),e([v()],oe.prototype,"referencePoint",null),e([v()],oe.prototype,"selectedGroup",void 0),e([v()],oe.prototype,"showCameraLocations",void 0),e([v()],oe.prototype,"showMapFeatures",void 0),e([te(["create","delete","redo","undo","update"]),v({readOnly:!0})],oe.prototype,"sketchViewModel",null),e([v()],oe.prototype,"triangularMeasurementActive",null),e([v()],oe.prototype,"videoLoaded",null),e([v()],oe.prototype,"view",null),e([v({type:$,nonNullable:!0})],oe.prototype,"visibleElements",void 0),e([v()],oe.prototype,"determineWorkflowForFeature",null),e([v()],oe.prototype,"shouldShowSelectedImage",null),e([v()],oe.prototype,"superimposeViewEnabled",null),e([v()],oe.prototype,"defaultSuperimposeCameraLockEnabled",null),e([v()],oe.prototype,"updateFootprint",null),e([v()],oe.prototype,"verticalFilterEnabled",null),e([v()],oe.prototype,"_defaultSuperimposeZOffsetPercentage",void 0),e([v()],oe.prototype,"_panoramicSuperimposeRadiusOffsetPercentage",void 0),e([v()],oe.prototype,"_activeMeasurementHeading",null),e([v()],oe.prototype,"_imageOverlaysLoaderTask",void 0),e([v()],oe.prototype,"_imageMeasurementToolsLoaderTask",void 0),e([v()],oe.prototype,"_navigationSettingsLoaderTask",void 0),e([v()],oe.prototype,"_navigationTask",void 0),e([v()],oe.prototype,"_measurementToggle",null),e([v()],oe.prototype,"_renderRoot",null),e([v()],oe.prototype,"_imageEnhancementTools",null),e([v()],oe.prototype,"_videoEnhancementTools",null),e([v()],oe.prototype,"_superimposeTools",null),e([v()],oe.prototype,"_imageGalleryPanel",null),e([v()],oe.prototype,"_imageGalleryContext",null),e([v()],oe.prototype,"_imageOverlaysComponent",null),e([v()],oe.prototype,"_navigationUI",null),e([v()],oe.prototype,"_imageOverlayMessages",null),e([v()],oe.prototype,"_imageSketchToolsMessages",null),e([v()],oe.prototype,"_imageOverlaysEnabled",null),e([v()],oe.prototype,"_imageViewer",null),e([v()],oe.prototype,"_imageViewerTriangular",null),e([v()],oe.prototype,"_videoViewer",null),e([v()],oe.prototype,"_locationToggle",null),e([v()],oe.prototype,"_messageBox",null),e([v()],oe.prototype,"_navigationToolExpanded",void 0),e([v()],oe.prototype,"_navigationTool",void 0),e([v()],oe.prototype,"_panoramicVideoViewer",null),e([v()],oe.prototype,"_panoramicViewer",null),e([v({readOnly:!0})],oe.prototype,"noImageInSequenceError",null),e([v()],oe.prototype,"_renderNavigation",null),e([v()],oe.prototype,"_renderThumbnails",null),e([v()],oe.prototype,"_sketchLoaderTask",void 0),oe=e([y("esri.widgets.OrientedImageryViewer")],oe);const ne=oe;export{ne as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as e}from"tslib";import i from"../Camera.js";import{property as t,subclass as o}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import a from"./PanoramicViewer/PanoramicVideoViewerViewModel.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as n}from"./support/globalCss.js";import{tsx as s,messageBundle as c,vmEvent as d}from"./support/widget.js";const p="esri-panoramic-viewer",u=`${p}__slider-container`;let h=class extends r{constructor(e){super(e),this.messagesCommon=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,i)=>{this.viewModel.addGraphic(e,i)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadVideo=e=>this.viewModel.loadVideo(e),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return l({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}get activeAudioIcon(){const{videoMuted:e}=this.viewModel;return e?"sound-off":"sound"}get activeVideoIcon(){const{videoPaused:e,videoLoaded:i}=this.viewModel;return i&&!1===e?"pause":"play"}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get fov(){return this.camera?.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get horizonAngles(){return this.viewModel.horizonAngles}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get oiViewModel(){return this.viewModel.oiViewModel}set oiViewModel(e){this.viewModel.oiViewModel=e}get video(){return this.viewModel.video}get videoSource(){return this.viewModel.videoSource}set videoSource(e){this.viewModel.videoSource=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}_handleVideoSeek(e){const i=this.viewModel?.video;i&&(i.currentTime=e.target.value,i.play())}render(){const{control:e,reset:i}=this.messagesCommon,{mute:t,unmute:o}=this.messages;return s("calcite-panel",null,s("calcite-panel",{loading:this.viewModel.updating},s("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(n.widget,p)}),s("calcite-block",{class:u,expanded:!0},s("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:this.viewModel?.videoDuration,minLabel:"0",value:this.viewModel.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),s("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},s("calcite-action-group",null,s("calcite-action",{bind:this,icon:this.activeVideoIcon,onclick:()=>this.viewModel.playPanoramicVideoHandler(),text:"Play",title:this.viewModel.videoPaused?e.play:e.pause})),s("calcite-action-group",null,s("calcite-action",{bind:this,icon:"refresh",onclick:()=>this.viewModel.rewindPanoramicVideoHandler(),text:"Rewind",title:i})),s("calcite-action-group",null,s("calcite-action",{bind:this,icon:this.activeAudioIcon,onclick:()=>this.viewModel.togglePanoramicAudio(),text:"Audio",title:this.viewModel.videoMuted?t:o})))))}static{this.vnodeSelector="calcite-panel"}};e([t()],h.prototype,"activeAudioIcon",null),e([t()],h.prototype,"activeVideoIcon",null),e([t({type:Boolean})],h.prototype,"autoLoad",null),e([t({type:i})],h.prototype,"camera",null),e([t()],h.prototype,"clickAction",null),e([t({type:Number})],h.prototype,"fov",null),e([t({readOnly:!0,type:Number})],h.prototype,"hfov",null),e([t()],h.prototype,"horizonAngles",null),e([t()],h.prototype,"icon",null),e([t({readOnly:!0})],h.prototype,"imageRenderer",null),e([t({readOnly:!0})],h.prototype,"imageSize",null),e([t()],h.prototype,"oiViewModel",null),e([t(),c("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],h.prototype,"messages",void 0),e([t(),c("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"video",null),e([t()],h.prototype,"videoSource",null),e([t({type:Number})],h.prototype,"pitch",null),e([t({readOnly:!0})],h.prototype,"state",null),e([t()],h.prototype,"ui",null),e([t({readOnly:!0,type:Number})],h.prototype,"vfov",null),e([d(["click","hittest-response","pixel-location"]),t({type:a})],h.prototype,"viewModel",void 0),e([t({type:Number})],h.prototype,"yaw",null),h=e([o("esri.widgets.PanoramicVideoViewer")],h);const m=h;export{m as default};
2
+ import{__decorate as e}from"tslib";import i from"../Camera.js";import{property as t,subclass as o}from"../core/accessorSupport/decorators.js";import r from"./Widget.js";import a from"./PanoramicViewer/PanoramicVideoViewerViewModel.js";import{loadCalciteComponents as l}from"./support/componentsUtils.js";import{globalCss as n}from"./support/globalCss.js";import{tsx as s,messageBundle as c,vmEvent as d}from"./support/widget.js";const p="esri-panoramic-viewer",u=`${p}__slider-container`;let h=class extends r{constructor(e){super(e),this.messagesCommon=null,this.viewModel=new a,this._afterContainerCreate=e=>{this.imageRenderer.container=e},this.addGraphic=(e,i)=>{this.viewModel.addGraphic(e,i)},this.addManyGraphics=e=>{this.viewModel.addManyGraphics(e)},this.clearGraphics=()=>{this.viewModel.clearGraphics()},this.clearImage=()=>{this.viewModel.clearImage()},this.loadVideo=e=>this.viewModel.loadVideo(e),this.removeGraphic=e=>{this.viewModel.removeGraphic(e)},this.removeManyGraphics=e=>{this.viewModel.removeManyGraphics(e)}}loadDependencies(){return l({panel:()=>import("@esri/calcite-components/dist/components/calcite-panel"),"action-bar":()=>import("@esri/calcite-components/dist/components/calcite-action-bar"),"action-group":()=>import("@esri/calcite-components/dist/components/calcite-action-group"),action:()=>import("@esri/calcite-components/dist/components/calcite-action"),block:()=>import("@esri/calcite-components/dist/components/calcite-block"),slider:()=>import("@esri/calcite-components/dist/components/calcite-slider")})}get activeAudioIcon(){const{videoMuted:e}=this.viewModel;return e?"sound-off":"sound"}get activeVideoIcon(){const{videoPaused:e,videoLoaded:i}=this.viewModel;return i&&!1===e?"pause":"play"}get autoLoad(){return this.viewModel.autoLoad}set autoLoad(e){this.viewModel.autoLoad=e}get camera(){return this.viewModel.camera}set camera(e){e&&(this.viewModel.camera=e)}get clickAction(){return this.viewModel.clickAction}set clickAction(e){this.viewModel.clickAction=e}get fov(){return this.camera?.fov}set fov(e){this.viewModel.fov=e}get hfov(){return this.viewModel.hfov}get horizonAngles(){return this.viewModel.horizonAngles}get icon(){return"i360-view"}set icon(e){this._overrideIfSome("icon",e)}get imageRenderer(){return this.viewModel.imageRenderer}get imageSize(){return this.viewModel.imageSize}get oiViewModel(){return this.viewModel.oiViewModel}set oiViewModel(e){this.viewModel.oiViewModel=e}get video(){return this.viewModel.video}get videoSource(){return this.viewModel.videoSource}set videoSource(e){this.viewModel.videoSource=e}get pitch(){return this.viewModel.pitch}set pitch(e){this.viewModel.pitch=e}get state(){return this.viewModel.state}get ui(){return this.imageRenderer.ui}get vfov(){return this.viewModel.vfov}get yaw(){return this.viewModel.yaw}set yaw(e){this.viewModel.yaw=e}_handleVideoSeek(e){const i=this.viewModel?.video;i&&(i.currentTime=e.target.value,i.play())}render(){const{control:e,reset:i}=this.messagesCommon,{mute:t,unmute:o}=this.messages;return s("calcite-panel",null,s("calcite-panel",{loading:this.viewModel.updating},s("calcite-panel",{afterCreate:this._afterContainerCreate,bind:this,class:this.classes(n.widget,p)}),s("calcite-block",{class:u,expanded:!0},s("calcite-slider",{bind:this,labelHandles:!0,labelTicks:!0,max:this.viewModel?.videoDuration,minLabel:"0",value:this.viewModel.currentTime??0,onCalciteSliderChange:this._handleVideoSeek})),s("calcite-action-bar",{expandDisabled:!0,layout:"horizontal"},s("calcite-action-group",null,s("calcite-action",{bind:this,icon:this.activeVideoIcon,text:"Play",title:this.viewModel.videoPaused?e.play:e.pause,onclick:()=>this.viewModel.playPanoramicVideoHandler()})),s("calcite-action-group",null,s("calcite-action",{bind:this,icon:"refresh",text:"Rewind",title:i,onclick:()=>this.viewModel.rewindPanoramicVideoHandler()})),s("calcite-action-group",null,s("calcite-action",{bind:this,icon:this.activeAudioIcon,text:"Audio",title:this.viewModel.videoMuted?t:o,onclick:()=>this.viewModel.togglePanoramicAudio()})))))}static{this.vnodeSelector="calcite-panel"}};e([t()],h.prototype,"activeAudioIcon",null),e([t()],h.prototype,"activeVideoIcon",null),e([t({type:Boolean})],h.prototype,"autoLoad",null),e([t({type:i})],h.prototype,"camera",null),e([t()],h.prototype,"clickAction",null),e([t({type:Number})],h.prototype,"fov",null),e([t({readOnly:!0,type:Number})],h.prototype,"hfov",null),e([t()],h.prototype,"horizonAngles",null),e([t()],h.prototype,"icon",null),e([t({readOnly:!0})],h.prototype,"imageRenderer",null),e([t({readOnly:!0})],h.prototype,"imageSize",null),e([t()],h.prototype,"oiViewModel",null),e([t(),c("esri/widgets/OrientedImageryViewer/t9n/OrientedImageryViewer")],h.prototype,"messages",void 0),e([t(),c("esri/t9n/common")],h.prototype,"messagesCommon",void 0),e([t()],h.prototype,"video",null),e([t()],h.prototype,"videoSource",null),e([t({type:Number})],h.prototype,"pitch",null),e([t({readOnly:!0})],h.prototype,"state",null),e([t()],h.prototype,"ui",null),e([t({readOnly:!0,type:Number})],h.prototype,"vfov",null),e([d(["click","hittest-response","pixel-location"]),t({type:a})],h.prototype,"viewModel",void 0),e([t({type:Number})],h.prototype,"yaw",null),h=e([o("esri.widgets.PanoramicVideoViewer")],h);const m=h;export{m as default};
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{__decorate as t}from"tslib";import{isSome as e}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import s from"../../core/Error.js";import{EventedAccessor as o}from"../../core/Evented.js";import{JSONMap as a}from"../../core/jsonMap.js";import{clone as r}from"../../core/lang.js";import{LoadableMixin as l}from"../../core/Loadable.js";import{EsriPromiseMixin as n}from"../../core/Promise.js";import p from"../../core/ReactiveMap.js";import{watch as m,initial as h,whenOnce as d}from"../../core/reactiveUtils.js";import{createScreenPoint as u}from"../../core/screenUtils.js";import{unitType as c,convertUnit as f,getMetersPerUnitForSR as y,inchesPerMeter as v}from"../../core/units.js";import{property as T,subclass as w}from"../../core/accessorSupport/decorators.js";import _ from"../../geometry/Extent.js";import I from"../../geometry/SpatialReference.js";import{formatDate as g,convertDateFormatToIntlOptions as x}from"../../intl/date.js";import{getLocaleLanguage as b}from"../../intl/locale.js";import O from"../../portal/Portal.js";import E from"../../portal/PortalQueryParams.js";import{execute as L,getTaskInfo as P}from"../../rest/print.js";import{formatJsonMap as S}from"../../rest/support/fileFormat.js";import{fromJSON as k}from"../../rest/support/layoutTemplate.js";import U from"../../rest/support/LegendLayer.js";import C from"../../rest/support/PrintParameters.js";import{getVisibleLayerViews as j}from"../../rest/support/printTaskUtils.js";import F from"../../rest/support/PrintTemplate.js";import{getExtent as M}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as H}from"../../views/input/InputManager.js";import A from"../../views/overlay/BoxOverlayItem.js";import D from"./CustomTemplate.js";import W from"./FileLink.js";import N from"./TemplateOptions.js";import{fetchLayoutTemplateInfos as R,valueUnitKebabDict as V}from"./utils.js";const z=[30,144,255,255],B=[237,211,23,255],q=[216,48,32,255],G=/(\/GPServer\/).+/i,$=96,J=i.ofType(D),Q=i.ofType(W),K=new a({Feet:"feet",Miles:"miles",Meters:"meters",Kilometers:"kilometers"});function X(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find(t=>e in t)){const{customTextElements:e}=t.layoutOptions;let i=g(Date.now(),x("short-date"));"ar"===b()&&(i="‏"+i),e.push({date:i})}}function Y(t,e,i){const s=t.visible??!0,o=t.legendEnabled??!0;if(!s||!o)return;const a=0===e,r=t.minScale??0,l=t.maxScale??0;if(!(a||(0===r||e<=r)&&(0===l||e>=l)))return;const n=t.sublayers?.toArray();if(n)for(const p of n)Y(p,e,i);else t.id&&i.push(String(t.id))}function Z(t,e,i,s){if(!e.layoutOptions)return;if(!i)return void(e.layoutOptions.legendLayers=[]);if(!t)return;let o=0;e.scalePreserved&&(o=e.outScale||t.scale);const a=j(t),r=[];for(const l of a)if(l.legendEnabled){const t="sublayers"in l.layer&&l.layer.sublayers?l.layer.sublayers.toArray():void 0,e=[];for(const i of t??[])Y(i,o,e);r.push(new U({layerId:l.layer.id,title:l.layer.title||void 0,subLayerIds:t?e:void 0,dynamicLegend:s}))}e.layoutOptions.legendLayers=r}function tt(t,e,i){if(!e)return;!(e.visible===i)&&t.layoutOptions&&(t.layoutOptions.elementOverrides?t.layoutOptions.elementOverrides[e.name]={visible:i}:t.layoutOptions.elementOverrides={[e.name]:{visible:i}})}let et=class extends(l(n(o))){constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateIdToCustomTemplate=new p,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this._asyncPrintTaskUrl=null,this._layoutInfoTaskUrl=null,this._portalLayoutInfoTaskUrl=null,this._customLayoutOptions=null,this._exportedFileNameMap={},this._layoutTemplateInfosCache=new Map,this._tasksInfoCache=new Map,this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new J,this.defaultTemplates=new J,this.error=null,this.exportedLinks=new Q,this.extraParameters=null,this.includeDefaultTemplates=!0,this.outSpatialReference=null,this.portal=O.getDefault(),this.portalTemplateIds=[],this.printServiceTemplates=new J,this.defaultTemplate=null,this.showPrintAreaEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.saveExportEnabled=!1,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new N}initialize(){this.addHandles([m(()=>[this.showPrintAreaEnabled,this.view],()=>{this.showPrintAreaEnabled?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))}),m(()=>[this.templateOptions.layout,this.templateOptions.layoutItem],()=>{this.loaded&&this._processTemplateOptions()}),m(()=>[this.allowedFormats,this.allowedLayouts],()=>{this.loaded&&this._loadTemplateInfos()}),m(()=>this.exportedLinks,()=>{for(const{name:t,extension:e}of this.exportedLinks)t&&e&&this._updateExportedFileNameMap(`${t}${e}`)},h)])}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=r(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach(e=>{const i=t[e];if(i){const t=this.templateCustomTextElements?.[e];i.forEach(e=>{const[i]=Object.entries(e)[0];t?.forEach(t=>{const[s,o]=Object.entries(t)[0];i===s&&(e[i]=o)})})}}),Object.freeze(t)}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}async print(t){const{view:e,extraParameters:i,updateDelay:o,outSpatialReference:a}=this;if(!e)throw new s("print:view-required","view is not set");X(t);const r=this._getOverlayItem(),l=t.scalePreserved||!this.showPrintAreaEnabled?void 0:M(new _,e.viewpoint,"map-only"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[r.boxWidth,r.boxHeight]),n=new C({view:e,template:t,extent:l,extraParameters:i,updateDelay:o,outSpatialReference:a});try{const e=!!t.layoutItem?.id&&(this.defaultTemplates.some(e=>e.layoutItem?.id===t.layoutItem?.id)||this.browseTemplates.some(e=>e.layoutItem?.id===t.layoutItem?.id));return await L(e&&this._asyncPrintTaskUrl?this._asyncPrintTaskUrl:this.effectivePrintServiceUrl,n,{timeout:this.printTimeout})}catch(p){throw new s("print:export-error","An error occurred while exporting the web map.",{error:p})}}async load(t){return this.addResolvingPromise(this._loadResources(t).catch(t=>this.error=t)),this}toPrintTemplate({attributionEnabled:t,author:e,copyright:i,customTextElements:o,dpi:a,forceFeatureAttributes:r,format:l,height:n,id:p,includeTables:m,layout:h,layoutItem:d,legendEnabled:u,dynamicLegendEnabled:c,northArrowEnabled:f,scale:y,scaleBarEnabled:v,scaleBarUnit:T,scaleEnabled:w,title:_,width:I}){if(!h&&!d)throw new s("print:layout-required","layout is not set");const g=new F({attributionVisible:t,forceFeatureAttributes:r,format:l,includeTables:m,layout:h,layoutItem:d,layoutOptions:{authorText:e||"",copyrightText:i||"",customTextElements:o,titleText:_||"",scalebarUnit:v&&T?K.toJSON(T):void 0},outScale:y??0,scalePreserved:w});if(I&&(g.exportOptions.width=I),n&&(g.exportOptions.height=n),a&&(g.exportOptions.dpi=a),g.layoutOptions){Z(this.view,g,u,c);const t=this.getLayoutTemplateById(p)?.mapSurroundInfoOptions;if(t){const e=t.northArrow;for(const t of e)tt(g,t,f);const i=t.scaleBar;for(const t of i)tt(g,t,v);const s=t.legend;for(const t of s)tt(g,t,u)}}return g}getLayoutTemplateById(t){return t?this._templateIdToCustomTemplate.get(t):null}async addPortalTemplate(t){if(!this.portal||!t?.id)return;try{if("loading"===this.loadStatus&&await d(()=>this.loaded),!this.loaded)throw new s("print:load-required","PrintViewModel must be loaded before adding portal templates.");t.loaded||await t.load()}catch{return void this.applyTemplate(this.defaultTemplate)}const e=new D({type:"browse-template",layoutInfoTaskUrl:this._portalLayoutInfoTaskUrl,label:t.title,layoutItem:t});this._templateIdToCustomTemplate.set(e.id,e),this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem&&this.templateOptions.id===t.layoutItem.id&&(this.defaultTemplate?this.applyTemplate(this.defaultTemplate):this.templateOptions.reset()),this.browseTemplates.remove(t),this._templateIdToCustomTemplate.delete(t.id)}async applyTemplate(t){if(t&&t===this.getLayoutTemplateById(this.templateOptions.id))return;if(this.templateOptions.reset(),!t)return;if("map-only"===t)return void(this.templateOptions.layout="map-only");!t.layout||!this.templatesInfo||this.templatesInfo.layout.choiceList.includes(t.layout)||(this.defaultTemplate?t=this.defaultTemplate:this.templateOptions.reset());const e=t.layout||t.layoutItem?.id,i=e?this.templateCustomTextElements?.[e]:void 0;if(await this.templateOptions.applyTemplate(t,{customTextElements:i,customLayoutOptions:this._customLayoutOptions}),e&&this._serviceTemplateCustomTextElements&&!this._serviceTemplateCustomTextElements[e]&&t.layoutTemplateInfo?.layoutOptions?.customTextElements){const i=r(this._serviceTemplateCustomTextElements);i[e]=t.layoutTemplateInfo.layoutOptions.customTextElements,this._serviceTemplateCustomTextElements=Object.freeze(i)}}createExportedFileLink(t){const e=this.toPrintTemplate(this.templateOptions).format.toLowerCase(),i=e.includes("png")?"png":e,s=t+i;return this._updateExportedFileNameMap(s),new W({name:t,extension:i,count:this._exportedFileNameMap[s]})}export(t){const e=this.createExportedFileLink(t);this.exportedLinks.add(e);const i=this.print(this.toPrintTemplate(this.templateOptions)).then(t=>e.set({url:t?.url,state:"ready"})).catch(t=>e.set({error:t,state:"error"}));return this.emit("submit",{link:e,saveExportEnabled:this.saveExportEnabled}),i.then(t=>this.emit("complete",{link:t,saveExportEnabled:this.saveExportEnabled})),{link:e,promise:i}}async _loadResources(t){this.destroyed||(await this._loadUrls(t),await this._loadTemplateInfos(t),await this._updateOverLayItem())}async _loadTemplateInfos(t){const e=[...this.defaultTemplates,...this.printServiceTemplates];for(const{id:o}of e)this._templateIdToCustomTemplate.delete(o);this.defaultTemplates.removeAll(),this.printServiceTemplates.removeAll();const[i,s]=await Promise.all([this._getLayoutToLayoutTemplateInfos(t),this._getPrintServiceTemplatesInfo(t)]);await this._loadAllTemplates(i,s,t),this._processPrintServiceTemplatesInfo(s),await this._processTemplateOptions()}_updateExportedFileNameMap(t){void 0!==this._exportedFileNameMap[t]?this._exportedFileNameMap[t]++:this._exportedFileNameMap[t]=0}async _processTemplateOptions(){const{layout:t,layoutItem:e}=this.templateOptions;if("map-only"!==t)if(this._customLayoutOptions={legend:this.templateOptions.legendEnabled,northArrow:this.templateOptions.northArrowEnabled,scaleBar:this.templateOptions.scaleBarEnabled},e?.id){try{e.loaded||await e.load()}catch{return void this.applyTemplate(this.defaultTemplate)}let t=this._templateIdToCustomTemplate.get(e.id);t||(t=new D({label:e.title,layoutItem:e,layoutInfoTaskUrl:this._portalLayoutInfoTaskUrl}),this._templateIdToCustomTemplate.set(t.id,t)),await this.applyTemplate(t)}else if(t){const t=this.defaultTemplates.find(t=>t.layout===this.templateOptions.layout)??this.printServiceTemplates.find(t=>t.layout===this.templateOptions.layout);await this.applyTemplate(t??this.defaultTemplate)}}async _loadPortal(t){try{await this.portal.load(t)}catch(e){throw new s("print:could-not-load-portal","Cannot load print resource information from portal",{error:e,url:this.effectivePrintServiceUrl})}}async _loadUrls(t){if(this.printServiceUrl)this._set("effectivePrintServiceUrl",this.printServiceUrl),this._layoutInfoTaskUrl=await this._getLayoutInfoTaskUrl(this.effectivePrintServiceUrl,t);else{await this._loadPortal(t);const{printTask:e,asyncPrintTask:i,layoutInfoTask:s}=this.portal?.helperServices??{};this._set("effectivePrintServiceUrl",e?.url),this._asyncPrintTaskUrl=i?.url,this._layoutInfoTaskUrl=await this._getLayoutInfoTaskUrl(this.effectivePrintServiceUrl,t),s?.url&&this.effectivePrintServiceUrl!==s.url?this._portalLayoutInfoTaskUrl=await this._getLayoutInfoTaskUrl(s.url,t):this._portalLayoutInfoTaskUrl=this._layoutInfoTaskUrl}const e=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!e?.includes("gpserver"))throw new s("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl})}async _getLayoutInfoTaskUrl(t,e){if(!t)return null;const i=await P(t,"GetLayoutTemplatesInfo",e);return i?t.replace(G,`$1${encodeURI(i.displayName)}`):null}_getPortalDefaultTemplates(t,e){return this.portal?.helperServices?.printTask?.templates?.filter(t=>"map_only"!==t.layout.toLowerCase()&&(!e||e.includes(k(t.layout))))?.map(e=>{const i=D.fromJSON(e);if(i.type="default-template",i.layoutInfoTaskUrl=this._layoutInfoTaskUrl,i.layout){const e=t.get(i.layout);e&&i.setLayoutTemplateInfo(e)}return i})??[]}async _getPortalCustomTemplates(t){if(this.printServiceUrl||!this.portal)return[];const{layoutGroupQuery:e}=this.portal;if(!e)return[];const i=new E({query:e,disableExtraQuery:!0}),s=await this.portal.queryGroups(i,t);if(!s.total)return[];const o=s.results[0],a=new E({num:100,query:"type:Layout",sortField:o.sortField,sortOrder:o.sortOrder??void 0}),r=(await o.queryItems(a,t)).results;if(!r.length)return[];return r.map(t=>(this.portalTemplateIds.push(t.id),new D({type:"default-template",label:t.title,layoutItem:t,layoutInfoTaskUrl:this._portalLayoutInfoTaskUrl})))}async _loadAllTemplates(t,e,i){let s=!1;const o=e?.layout?.choiceList;if(this.includeDefaultTemplates&&this.portal&&!this.printServiceUrl){const e=this._getPortalDefaultTemplates(t,o);s=!!e.length,this.defaultTemplates.addMany(e);const a=await this._getPortalCustomTemplates(i);this.defaultTemplates.addMany(a);for(const t of this.defaultTemplates)this._templateIdToCustomTemplate.set(t.id,t)}s||t.forEach((t,e)=>{if(!o||o.includes(e)){const i=new D({type:"print-service-template",layout:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl});i.setLayoutTemplateInfo(t),this.printServiceTemplates.add(i),this._templateIdToCustomTemplate.set(i.id,i)}})}_processPrintServiceTemplatesInfo(t){this._set("templatesInfo",t);const e=t?.layout?.defaultValue;if(e&&"map-only"!==e){const t=this.defaultTemplates.find(t=>t.layout===e)??this.printServiceTemplates.find(t=>t.layout===e)??this.defaultTemplates.at(0)??this.printServiceTemplates.at(0);this._set("defaultTemplate",t)}}async _getLayoutToLayoutTemplateInfos(t){const e=this._layoutInfoTaskUrl,i=e?this._layoutTemplateInfosCache.get(e):void 0,s=i??await R(e,void 0,t);i||this._layoutTemplateInfosCache.set(e,s);const o=new Map,a={};for(const r of s){const t=k(r.layoutTemplate);o.set(t,r),a[t]=r.layoutOptions.customTextElements}return this._serviceTemplateCustomTextElements=Object.freeze(a),o}async _getPrintServiceTemplatesInfo(t){const e=this.effectivePrintServiceUrl?this._tasksInfoCache.get(this.effectivePrintServiceUrl):void 0,i=e??await P(this.effectivePrintServiceUrl,"ExportWebMap",t);if(!i)throw new s("print:unavailable-service-info","Can't fetch templates info from service");e||this._tasksInfoCache.set(this.effectivePrintServiceUrl,i);const{parameters:o}=i,a=o.find(({name:t})=>"Format"===t),r=o.find(({name:t})=>"Layout_Template"===t);return{format:this._getFormat(a),layout:this._getLayout(r)}}_getFormat(t){const i="all"===this.allowedFormats?t.choiceList:t.choiceList.filter(t=>"string"!=typeof this.allowedFormats&&this.allowedFormats.some(e=>new RegExp(`\\b${e}\\b`,"i").test(t))),s=(i.length?i:t.choiceList).map(t=>S.fromJSON(t)).filter(e),o=S.fromJSON(t.defaultValue),a=s.some(t=>new RegExp(`\\b${o}\\b`,"i").test(t))?o:s[0];return{choiceList:s,defaultValue:a}}_getLayout(t){const i=t.choiceList.filter(t=>"map_only"!==t.toLowerCase()),s="all"===this.allowedLayouts?i:i.filter(t=>this.allowedLayouts.includes(k(t))),o=(s.length?s:i).map(k).filter(e),a=k(t.defaultValue),r=o.includes(a)?a:o.find(t=>/(?=.*letter)(?=.*landscape)/i.test(t))??o.find(t=>/(?=.*a4)(?=.*landscape)/i.test(t))??o[0];return{choiceList:o,defaultValue:r}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new A({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([m(()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,t.id,t.state,t.dpi,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding,this.loaded],()=>{this._updateOverLayItem()},h),this.view?.on("drag",["Shift"],t=>this._handleDrag(t),H.WIDGET),this.view?.on("key-down",["Escape"],()=>this._resetDrag(),H.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}async _updateOverLayItem(){if(!this.view)return;await this.view.when();const t=this.templateOptions,e=this._getOverlayItem(),i=t.layoutItem?.id??t.layout,s=this.view,o=s.spatialReference,[a,r]=s.state.paddedViewState.size,l=s.state.padding;let n=0,p=0;if("map-only"===i)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else if(i){const e=t.id?this._templateIdToCustomTemplate.get(t.id):null,{webMapFrameSize:i,pageUnits:s}=e?.layoutTemplateInfo??{};let l=!1;if(i&&s)if(this._isFreeHand){const t=i[0]/i[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=V.fromJSON(s.toLowerCase()),e=o.unit;c(t)===c(e)?(n=f(i[0],t,e),p=f(i[1],t,e)):(l=!0,n=i[0],p=i[1])}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const t=l?Math.min(a/n,r/p):y(o)*v*$;n*=t,p*=t}else if(0===n||0===p)n=a,p=r;else{const t=(a-.1*a)/n,e=(r-.1*r)/p,i=Math.min(t,e);n*=i,p*=i}}const{scaleEnabled:m,scale:h}=t,d=m&&h?h/this.view.scale:1;if(e.boxWidth=n*d||a,e.boxHeight=p*d||r,l&&(e.padding=l),e.backgroundWidth=a??0,e.backgroundHeight=r??0,"loading"===this.loadStatus)e.strokeColor=B;else if("loaded"===this.loadStatus)switch(this.templateOptions.state){case"pending":e.strokeColor=B;break;case"ready":e.strokeColor=z;break;case"error":e.strokeColor=q}}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:i,y:s}=t,{x:o,y:a}=t.origin;i>o?(e.x=o,e.boxWidth=i-o):(e.x=i,e.boxWidth=o-i),s>a?(e.y=a,e.boxHeight=s-a):(e.y=s,e.boxHeight=a-s)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,i=e.toMap(u(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:i}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"map-only"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([T()],et.prototype,"_serviceTemplateCustomTextElements",void 0),t([T()],et.prototype,"_templateIdToCustomTemplate",void 0),t([T()],et.prototype,"allowedFormats",void 0),t([T()],et.prototype,"allowedLayouts",void 0),t([T({type:J})],et.prototype,"browseTemplates",void 0),t([T({type:J})],et.prototype,"defaultTemplates",void 0),t([T()],et.prototype,"error",void 0),t([T({type:Q})],et.prototype,"exportedLinks",void 0),t([T()],et.prototype,"extraParameters",void 0),t([T()],et.prototype,"includeDefaultTemplates",void 0),t([T({readOnly:!0})],et.prototype,"effectivePrintServiceUrl",null),t([T()],et.prototype,"effectiveTemplateCustomTextElements",null),t([T({type:I})],et.prototype,"outSpatialReference",void 0),t([T({type:O})],et.prototype,"portal",void 0),t([T()],et.prototype,"portalTemplateIds",void 0),t([T({type:J})],et.prototype,"printServiceTemplates",void 0),t([T({readOnly:!0})],et.prototype,"defaultTemplate",void 0),t([T()],et.prototype,"showPrintAreaEnabled",void 0),t([T()],et.prototype,"printServiceUrl",void 0),t([T()],et.prototype,"printTimeout",void 0),t([T()],et.prototype,"saveExportEnabled",void 0),t([T({readOnly:!0})],et.prototype,"state",null),t([T({readOnly:!0})],et.prototype,"templatesInfo",void 0),t([T()],et.prototype,"updateDelay",void 0),t([T()],et.prototype,"view",void 0),t([T()],et.prototype,"templateCustomTextElements",void 0),t([T({type:N})],et.prototype,"templateOptions",void 0),et=t([w("esri.widgets.Print.PrintViewModel")],et);const it=et;export{it as default};
2
+ import{__decorate as t}from"tslib";import{isSome as e}from"../../core/arrayUtils.js";import i from"../../core/Collection.js";import s from"../../core/Error.js";import{EventedAccessor as o}from"../../core/Evented.js";import{JSONMap as a}from"../../core/jsonMap.js";import{clone as r}from"../../core/lang.js";import{LoadableMixin as l}from"../../core/Loadable.js";import{EsriPromiseMixin as n}from"../../core/Promise.js";import p from"../../core/ReactiveMap.js";import{watch as m,initial as h,whenOnce as d}from"../../core/reactiveUtils.js";import{createScreenPoint as u}from"../../core/screenUtils.js";import{unitType as c,convertUnit as f,getMetersPerUnitForSR as y,inchesPerMeter as v}from"../../core/units.js";import{property as T,subclass as w}from"../../core/accessorSupport/decorators.js";import _ from"../../geometry/Extent.js";import I from"../../geometry/SpatialReference.js";import{formatDate as g,convertDateFormatToIntlOptions as x}from"../../intl/date.js";import{getLocaleLanguage as b}from"../../intl/locale.js";import O from"../../portal/Portal.js";import E from"../../portal/PortalQueryParams.js";import{execute as L,getTaskInfo as P}from"../../rest/print.js";import{formatJsonMap as S}from"../../rest/support/fileFormat.js";import{fromJSON as k}from"../../rest/support/layoutTemplate.js";import U from"../../rest/support/LegendLayer.js";import C from"../../rest/support/PrintParameters.js";import{getVisibleLayerViews as j}from"../../rest/support/printTaskUtils.js";import F from"../../rest/support/PrintTemplate.js";import{getExtent as M}from"../../views/2d/viewpointUtils.js";import{ViewEventPriorities as H}from"../../views/input/InputManager.js";import A from"../../views/overlay/BoxOverlayItem.js";import D from"./CustomTemplate.js";import W from"./FileLink.js";import N from"./TemplateOptions.js";import{fetchLayoutTemplateInfos as R,valueUnitKebabDict as V}from"./utils.js";const z=[30,144,255,255],B=[237,211,23,255],q=[216,48,32,255],G=/(\/GPServer\/).+/i,$=96,J=i.ofType(D),Q=i.ofType(W),K=new a({Feet:"feet",Miles:"miles",Meters:"meters",Kilometers:"kilometers"});function X(t){t.layoutOptions??={},t.layoutOptions.customTextElements??=[];const e="date";if(!t.layoutOptions.customTextElements.find(t=>e in t)){const{customTextElements:e}=t.layoutOptions;let i=g(Date.now(),x("short-date"));"ar"===b()&&(i="‏"+i),e.push({date:i})}}function Y(t,e,i){const s=t.visible??!0,o=t.legendEnabled??!0;if(!s||!o)return;const a=0===e,r=t.minScale??0,l=t.maxScale??0;if(!(a||(0===r||e<=r)&&(0===l||e>=l)))return;const n=t.sublayers?.toArray();if(n)for(const p of n)Y(p,e,i);else t.id&&i.push(String(t.id))}function Z(t,e,i,s){if(!e.layoutOptions)return;if(!i)return void(e.layoutOptions.legendLayers=[]);if(!t)return;let o=0;e.scalePreserved&&(o=e.outScale||t.scale);const a=j(t),r=[];for(const l of a)if(l.legendEnabled){const t="sublayers"in l.layer&&l.layer.sublayers?l.layer.sublayers.toArray():void 0,e=[];for(const i of t??[])Y(i,o,e);r.push(new U({layerId:l.layer.id,title:l.layer.title||void 0,subLayerIds:t?e:void 0,dynamicLegend:s}))}e.layoutOptions.legendLayers=r}function tt(t,e,i){if(!e)return;!(e.visible===i)&&t.layoutOptions&&(t.layoutOptions.elementOverrides?t.layoutOptions.elementOverrides[e.name]={visible:i}:t.layoutOptions.elementOverrides={[e.name]:{visible:i}})}let et=class extends(l(n(o))){constructor(t){super(t),this._serviceTemplateCustomTextElements=null,this._templateIdToCustomTemplate=new p,this._isFreeHand=!1,this._freeHandWidth=0,this._freehandHeight=0,this._asyncPrintTaskUrl=null,this._layoutInfoTaskUrl=null,this._portalLayoutInfoTaskUrl=null,this._customLayoutOptions=null,this._exportedFileNameMap={},this._layoutTemplateInfosCache=new Map,this._tasksInfoCache=new Map,this.allowedFormats="all",this.allowedLayouts="all",this.browseTemplates=new J,this.defaultTemplates=new J,this.error=null,this.exportedLinks=new Q,this.extraParameters=null,this.includeDefaultTemplates=!0,this.outSpatialReference=null,this.portal=O.getDefault(),this.portalTemplateIds=[],this.printServiceTemplates=new J,this.defaultTemplate=null,this.showPrintAreaEnabled=!1,this.printServiceUrl=null,this.printTimeout=12e4,this.saveExportEnabled=!1,this.templatesInfo=null,this.updateDelay=1e3,this.view=null,this.templateCustomTextElements=null,this.templateOptions=new N}initialize(){this.addHandles([m(()=>[this.showPrintAreaEnabled,this.view],()=>{this.showPrintAreaEnabled?this._enablePrintPreview():(this.removeHandles("overlay-handler"),this.view?.overlay?.removeItem(this._getOverlayItem()))}),m(()=>[this.templateOptions.layout,this.templateOptions.layoutItem],()=>{this.loaded&&this._processTemplateOptions()}),m(()=>[this.allowedFormats,this.allowedLayouts],()=>{this.loaded&&this._loadTemplateInfos()}),m(()=>this.exportedLinks,()=>{for(const{name:t,extension:e}of this.exportedLinks)t&&e&&this._updateExportedFileNameMap(`${t}${e}`)},h)])}destroy(){this.removeHandles("overlay-handler"),this.view&&(this._overlayItem&&(this.view.overlay?.removeItem(this._overlayItem),this._overlayItem.destroy(),this._overlayItem=null),this.view=null)}get effectivePrintServiceUrl(){return this.printServiceUrl??null}get effectiveTemplateCustomTextElements(){if(!this._serviceTemplateCustomTextElements)return{};const t=r(this._serviceTemplateCustomTextElements);return this.templateCustomTextElements&&Object.keys(this.templateCustomTextElements).forEach(e=>{const i=t[e];if(i){const t=this.templateCustomTextElements?.[e];i.forEach(e=>{const[i]=Object.entries(e)[0];t?.forEach(t=>{const[s,o]=Object.entries(t)[0];i===s&&(e[i]=o)})})}}),Object.freeze(t)}get state(){return"loading"===this.loadStatus?"initializing":"failed"===this.loadStatus||this.error?"error":"loaded"===this.loadStatus&&this.view?.ready?"ready":"disabled"}async print(t){const{view:e,extraParameters:i,updateDelay:o,outSpatialReference:a}=this;if(!e)throw new s("print:view-required","view is not set");X(t);const r=this._getOverlayItem(),l=t.scalePreserved||!this.showPrintAreaEnabled?void 0:M(new _,e.viewpoint,"map-only"===t.layout?[t.exportOptions.width,t.exportOptions.height]:[r.boxWidth,r.boxHeight]),n=new C({view:e,template:t,extent:l,extraParameters:i,updateDelay:o,outSpatialReference:a});try{const e=!!t.layoutItem?.id&&(this.defaultTemplates.some(e=>e.layoutItem?.id===t.layoutItem?.id)||this.browseTemplates.some(e=>e.layoutItem?.id===t.layoutItem?.id));return await L(e&&this._asyncPrintTaskUrl?this._asyncPrintTaskUrl:this.effectivePrintServiceUrl,n,{timeout:this.printTimeout})}catch(p){throw new s("print:export-error","An error occurred while exporting the web map.",{error:p})}}async load(t){return this.addResolvingPromise(this._loadResources(t).catch(t=>this.error=t)),this}toPrintTemplate({attributionEnabled:t,author:e,copyright:i,customTextElements:o,dpi:a,forceFeatureAttributes:r,format:l,height:n,id:p,includeTables:m,layout:h,layoutItem:d,legendEnabled:u,dynamicLegendEnabled:c,northArrowEnabled:f,scale:y,scaleBarEnabled:v,scaleBarUnit:T,scaleEnabled:w,title:_,width:I}){if(!h&&!d)throw new s("print:layout-required","layout is not set");const g=new F({attributionVisible:t,forceFeatureAttributes:r,format:l,includeTables:m,layout:h,layoutItem:d,layoutOptions:{authorText:e,copyrightText:i,customTextElements:o,titleText:_,scalebarUnit:v&&T?K.toJSON(T):void 0},outScale:y??0,scalePreserved:w});if(I&&(g.exportOptions.width=I),n&&(g.exportOptions.height=n),a&&(g.exportOptions.dpi=a),g.layoutOptions){Z(this.view,g,u,c);const t=this.getLayoutTemplateById(p)?.mapSurroundInfoOptions;if(t){const e=t.northArrow;for(const t of e)tt(g,t,f);const i=t.scaleBar;for(const t of i)tt(g,t,v);const s=t.legend;for(const t of s)tt(g,t,u)}}return g}getLayoutTemplateById(t){return t?this._templateIdToCustomTemplate.get(t):null}async addPortalTemplate(t){if(!this.portal||!t?.id)return;try{if("loading"===this.loadStatus&&await d(()=>this.loaded),!this.loaded)throw new s("print:load-required","PrintViewModel must be loaded before adding portal templates.");t.loaded||await t.load()}catch{return void this.applyTemplate(this.defaultTemplate)}const e=new D({type:"browse-template",layoutInfoTaskUrl:this._portalLayoutInfoTaskUrl,label:t.title,layoutItem:t});this._templateIdToCustomTemplate.set(e.id,e),this.browseTemplates.add(e)}removePortalTemplate(t){t.layoutItem&&this.templateOptions.id===t.layoutItem.id&&(this.defaultTemplate?this.applyTemplate(this.defaultTemplate):this.templateOptions.reset()),this.browseTemplates.remove(t),this._templateIdToCustomTemplate.delete(t.id)}async applyTemplate(t){if(t&&t===this.getLayoutTemplateById(this.templateOptions.id))return;if(this.templateOptions.reset(),!t)return;if("map-only"===t)return void(this.templateOptions.layout="map-only");!t.layout||!this.templatesInfo||this.templatesInfo.layout.choiceList.includes(t.layout)||(this.defaultTemplate?t=this.defaultTemplate:this.templateOptions.reset());const e=t.layout||t.layoutItem?.id,i=e?this.templateCustomTextElements?.[e]:void 0;if(await this.templateOptions.applyTemplate(t,{customTextElements:i,customLayoutOptions:this._customLayoutOptions}),e&&this._serviceTemplateCustomTextElements&&!this._serviceTemplateCustomTextElements[e]&&t.layoutTemplateInfo?.layoutOptions?.customTextElements){const i=r(this._serviceTemplateCustomTextElements);i[e]=t.layoutTemplateInfo.layoutOptions.customTextElements,this._serviceTemplateCustomTextElements=Object.freeze(i)}}createExportedFileLink(t){const e=this.toPrintTemplate(this.templateOptions).format.toLowerCase(),i=e.includes("png")?"png":e,s=t+i;return this._updateExportedFileNameMap(s),new W({name:t,extension:i,count:this._exportedFileNameMap[s]})}export(t){const e=this.createExportedFileLink(t);this.exportedLinks.add(e);const i=this.print(this.toPrintTemplate(this.templateOptions)).then(t=>e.set({url:t?.url,state:"ready"})).catch(t=>e.set({error:t,state:"error"}));return this.emit("submit",{link:e,saveExportEnabled:this.saveExportEnabled}),i.then(t=>this.emit("complete",{link:t,saveExportEnabled:this.saveExportEnabled})),{link:e,promise:i}}async _loadResources(t){this.destroyed||(await this._loadUrls(t),await this._loadTemplateInfos(t),await this._updateOverLayItem())}async _loadTemplateInfos(t){const e=[...this.defaultTemplates,...this.printServiceTemplates];for(const{id:o}of e)this._templateIdToCustomTemplate.delete(o);this.defaultTemplates.removeAll(),this.printServiceTemplates.removeAll();const[i,s]=await Promise.all([this._getLayoutToLayoutTemplateInfos(t),this._getPrintServiceTemplatesInfo(t)]);await this._loadAllTemplates(i,s,t),this._processPrintServiceTemplatesInfo(s),await this._processTemplateOptions()}_updateExportedFileNameMap(t){void 0!==this._exportedFileNameMap[t]?this._exportedFileNameMap[t]++:this._exportedFileNameMap[t]=0}async _processTemplateOptions(){const{layout:t,layoutItem:e}=this.templateOptions;if("map-only"!==t)if(this._customLayoutOptions={legend:this.templateOptions.legendEnabled,northArrow:this.templateOptions.northArrowEnabled,scaleBar:this.templateOptions.scaleBarEnabled},e?.id){try{e.loaded||await e.load()}catch{return void this.applyTemplate(this.defaultTemplate)}let t=this._templateIdToCustomTemplate.get(e.id);t||(t=new D({label:e.title,layoutItem:e,layoutInfoTaskUrl:this._portalLayoutInfoTaskUrl}),this._templateIdToCustomTemplate.set(t.id,t)),await this.applyTemplate(t)}else if(t){const t=this.defaultTemplates.find(t=>t.layout===this.templateOptions.layout)??this.printServiceTemplates.find(t=>t.layout===this.templateOptions.layout);await this.applyTemplate(t??this.defaultTemplate)}}async _loadPortal(t){try{await this.portal.load(t)}catch(e){throw new s("print:could-not-load-portal","Cannot load print resource information from portal",{error:e,url:this.effectivePrintServiceUrl})}}async _loadUrls(t){if(this.printServiceUrl)this._set("effectivePrintServiceUrl",this.printServiceUrl),this._layoutInfoTaskUrl=await this._getLayoutInfoTaskUrl(this.effectivePrintServiceUrl,t);else{await this._loadPortal(t);const{printTask:e,asyncPrintTask:i,layoutInfoTask:s}=this.portal?.helperServices??{};this._set("effectivePrintServiceUrl",e?.url),this._asyncPrintTaskUrl=i?.url,this._layoutInfoTaskUrl=await this._getLayoutInfoTaskUrl(this.effectivePrintServiceUrl,t),s?.url&&this.effectivePrintServiceUrl!==s.url?this._portalLayoutInfoTaskUrl=await this._getLayoutInfoTaskUrl(s.url,t):this._portalLayoutInfoTaskUrl=this._layoutInfoTaskUrl}const e=this.effectivePrintServiceUrl?.toLowerCase().split("/");if(!e?.includes("gpserver"))throw new s("print:invalid-print-service-url","Can't fetch print templates information from provided URL",{url:this.effectivePrintServiceUrl})}async _getLayoutInfoTaskUrl(t,e){if(!t)return null;const i=await P(t,"GetLayoutTemplatesInfo",e);return i?t.replace(G,`$1${encodeURI(i.displayName)}`):null}_getPortalDefaultTemplates(t,e){return this.portal?.helperServices?.printTask?.templates?.filter(t=>"map_only"!==t.layout.toLowerCase()&&(!e||e.includes(k(t.layout))))?.map(e=>{const i=D.fromJSON(e);if(i.type="default-template",i.layoutInfoTaskUrl=this._layoutInfoTaskUrl,i.layout){const e=t.get(i.layout);e&&i.setLayoutTemplateInfo(e)}return i})??[]}async _getPortalCustomTemplates(t){if(this.printServiceUrl||!this.portal)return[];const{layoutGroupQuery:e}=this.portal;if(!e)return[];const i=new E({query:e,disableExtraQuery:!0}),s=await this.portal.queryGroups(i,t);if(!s.total)return[];const o=s.results[0],a=new E({num:100,query:"type:Layout",sortField:o.sortField,sortOrder:o.sortOrder??void 0}),r=(await o.queryItems(a,t)).results;if(!r.length)return[];return r.map(t=>(this.portalTemplateIds.push(t.id),new D({type:"default-template",label:t.title,layoutItem:t,layoutInfoTaskUrl:this._portalLayoutInfoTaskUrl})))}async _loadAllTemplates(t,e,i){let s=!1;const o=e?.layout?.choiceList;if(this.includeDefaultTemplates&&this.portal&&!this.printServiceUrl){const e=this._getPortalDefaultTemplates(t,o);s=!!e.length,this.defaultTemplates.addMany(e);const a=await this._getPortalCustomTemplates(i);this.defaultTemplates.addMany(a);for(const t of this.defaultTemplates)this._templateIdToCustomTemplate.set(t.id,t)}s||t.forEach((t,e)=>{if(!o||o.includes(e)){const i=new D({type:"print-service-template",layout:e,layoutInfoTaskUrl:this._layoutInfoTaskUrl});i.setLayoutTemplateInfo(t),this.printServiceTemplates.add(i),this._templateIdToCustomTemplate.set(i.id,i)}})}_processPrintServiceTemplatesInfo(t){this._set("templatesInfo",t);const e=t?.layout?.defaultValue;if(e&&"map-only"!==e){const t=this.defaultTemplates.find(t=>t.layout===e)??this.printServiceTemplates.find(t=>t.layout===e)??this.defaultTemplates.at(0)??this.printServiceTemplates.at(0);this._set("defaultTemplate",t)}}async _getLayoutToLayoutTemplateInfos(t){const e=this._layoutInfoTaskUrl,i=e?this._layoutTemplateInfosCache.get(e):void 0,s=i??await R(e,void 0,t);i||this._layoutTemplateInfosCache.set(e,s);const o=new Map,a={};for(const r of s){const t=k(r.layoutTemplate);o.set(t,r),a[t]=r.layoutOptions.customTextElements}return this._serviceTemplateCustomTextElements=Object.freeze(a),o}async _getPrintServiceTemplatesInfo(t){const e=this.effectivePrintServiceUrl?this._tasksInfoCache.get(this.effectivePrintServiceUrl):void 0,i=e??await P(this.effectivePrintServiceUrl,"ExportWebMap",t);if(!i)throw new s("print:unavailable-service-info","Can't fetch templates info from service");e||this._tasksInfoCache.set(this.effectivePrintServiceUrl,i);const{parameters:o}=i,a=o.find(({name:t})=>"Format"===t),r=o.find(({name:t})=>"Layout_Template"===t);return{format:this._getFormat(a),layout:this._getLayout(r)}}_getFormat(t){const i="all"===this.allowedFormats?t.choiceList:t.choiceList.filter(t=>"string"!=typeof this.allowedFormats&&this.allowedFormats.some(e=>new RegExp(`\\b${e}\\b`,"i").test(t))),s=(i.length?i:t.choiceList).map(t=>S.fromJSON(t)).filter(e),o=S.fromJSON(t.defaultValue),a=s.some(t=>new RegExp(`\\b${o}\\b`,"i").test(t))?o:s[0];return{choiceList:s,defaultValue:a}}_getLayout(t){const i=t.choiceList.filter(t=>"map_only"!==t.toLowerCase()),s="all"===this.allowedLayouts?i:i.filter(t=>this.allowedLayouts.includes(k(t))),o=(s.length?s:i).map(k).filter(e),a=k(t.defaultValue),r=o.includes(a)?a:o.find(t=>/(?=.*letter)(?=.*landscape)/i.test(t))??o.find(t=>/(?=.*a4)(?=.*landscape)/i.test(t))??o[0];return{choiceList:o,defaultValue:r}}_getOverlayItem(){return this._overlayItem||(this._overlayItem=new A({strokeDash:[5],strokeWidth:2,strokeColor:[30,144,255,255]})),this._overlayItem}_enablePrintPreview(){if(!this.view?.overlay)return;const t=this.templateOptions,e=this._getOverlayItem();this.addHandles([m(()=>[t.width,t.height,t.scaleEnabled,t.scale,t.layout,t.layoutItem,t.id,t.state,t.dpi,this.view?.scale,this.view?.size,this.view?.state.paddedViewState.size,this.view?.state.padding,this.loaded],()=>{this._updateOverLayItem()},h),this.view?.on("drag",["Shift"],t=>this._handleDrag(t),H.WIDGET),this.view?.on("key-down",["Escape"],()=>this._resetDrag(),H.WIDGET)],"overlay-handler"),this.view.overlay.addItem(e)}async _updateOverLayItem(){if(!this.view)return;await this.view.when();const t=this.templateOptions,e=this._getOverlayItem(),i=t.layoutItem?.id??t.layout,s=this.view,o=s.spatialReference,[a,r]=s.state.paddedViewState.size,l=s.state.padding;let n=0,p=0;if("map-only"===i)null!=t.width&&null!=t.height&&(n=t.width,p=t.height);else if(i){const e=t.id?this._templateIdToCustomTemplate.get(t.id):null,{webMapFrameSize:i,pageUnits:s}=e?.layoutTemplateInfo??{};let l=!1;if(i&&s)if(this._isFreeHand){const t=i[0]/i[1];n=this._freeHandWidth,p=this._freehandHeight,n>p?p=n/t:n=p*t}else{const t=V.fromJSON(s.toLowerCase()),e=o.unit;c(t)===c(e)?(n=f(i[0],t,e),p=f(i[1],t,e)):(l=!0,n=i[0],p=i[1])}if(!this._isFreeHand)if(t.scaleEnabled&&t.scale){const t=l?Math.min(a/n,r/p):y(o)*v*$;n*=t,p*=t}else if(0===n||0===p)n=a,p=r;else{const t=(a-.1*a)/n,e=(r-.1*r)/p,i=Math.min(t,e);n*=i,p*=i}}const{scaleEnabled:m,scale:h}=t,d=m&&h?h/this.view.scale:1;if(e.boxWidth=n*d||a,e.boxHeight=p*d||r,l&&(e.padding=l),e.backgroundWidth=a??0,e.backgroundHeight=r??0,"loading"===this.loadStatus)e.strokeColor=B;else if("loaded"===this.loadStatus)switch(this.templateOptions.state){case"pending":e.strokeColor=B;break;case"ready":e.strokeColor=z;break;case"error":e.strokeColor=q}}_resetDrag(){this._isFreeHand=!1,this._updateOverLayItem()}_handleDrag(t){switch(t.action){case"start":this._start();break;case"update":this._update(t);break;case"end":this._end()}t.stopPropagation()}_start(){this._isFreeHand=!0}_update(t){const e=this._getOverlayItem(),{x:i,y:s}=t,{x:o,y:a}=t.origin;i>o?(e.x=o,e.boxWidth=i-o):(e.x=i,e.boxWidth=o-i),s>a?(e.y=a,e.boxHeight=s-a):(e.y=s,e.boxHeight=a-s)}_end(){const t=this._getOverlayItem();if(!this.view||null==t.x||null==t.y)return;const e=this.view,i=e.toMap(u(t.x+.5*t.boxWidth,t.y+.5*t.boxHeight));t.x=null,t.y=null,e.goTo({center:i}),this._freeHandWidth=t.boxWidth,this._freehandHeight=t.boxHeight,"map-only"===this.templateOptions.layout&&(this.templateOptions.width=this._freeHandWidth,this.templateOptions.height=this._freehandHeight),this.templateOptions.scale=this.view.scale,this._updateOverLayItem()}};t([T()],et.prototype,"_serviceTemplateCustomTextElements",void 0),t([T()],et.prototype,"_templateIdToCustomTemplate",void 0),t([T()],et.prototype,"allowedFormats",void 0),t([T()],et.prototype,"allowedLayouts",void 0),t([T({type:J})],et.prototype,"browseTemplates",void 0),t([T({type:J})],et.prototype,"defaultTemplates",void 0),t([T()],et.prototype,"error",void 0),t([T({type:Q})],et.prototype,"exportedLinks",void 0),t([T()],et.prototype,"extraParameters",void 0),t([T()],et.prototype,"includeDefaultTemplates",void 0),t([T({readOnly:!0})],et.prototype,"effectivePrintServiceUrl",null),t([T()],et.prototype,"effectiveTemplateCustomTextElements",null),t([T({type:I})],et.prototype,"outSpatialReference",void 0),t([T({type:O})],et.prototype,"portal",void 0),t([T()],et.prototype,"portalTemplateIds",void 0),t([T({type:J})],et.prototype,"printServiceTemplates",void 0),t([T({readOnly:!0})],et.prototype,"defaultTemplate",void 0),t([T()],et.prototype,"showPrintAreaEnabled",void 0),t([T()],et.prototype,"printServiceUrl",void 0),t([T()],et.prototype,"printTimeout",void 0),t([T()],et.prototype,"saveExportEnabled",void 0),t([T({readOnly:!0})],et.prototype,"state",null),t([T({readOnly:!0})],et.prototype,"templatesInfo",void 0),t([T()],et.prototype,"updateDelay",void 0),t([T()],et.prototype,"view",void 0),t([T()],et.prototype,"templateCustomTextElements",void 0),t([T({type:N})],et.prototype,"templateOptions",void 0),et=t([w("esri.widgets.Print.PrintViewModel")],et);const it=et;export{it as default};