@esri/solutions-components 0.10.39 → 0.10.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (406) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +26 -6
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +23 -3
  3. package/dist/cjs/calcite-alert_5.cjs.entry.js +40 -5
  4. package/dist/cjs/calcite-block_5.cjs.entry.js +75 -65
  5. package/dist/cjs/calcite-combobox_3.cjs.entry.js +11 -1
  6. package/dist/cjs/calcite-flow_4.cjs.entry.js +33 -10
  7. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +119 -10
  8. package/dist/cjs/calcite-shell_3.cjs.entry.js +26 -4
  9. package/dist/cjs/card-manager_3.cjs.entry.js +41 -9
  10. package/dist/cjs/consent-manager.cjs.entry.js +12 -0
  11. package/dist/cjs/crowdsource-manager.cjs.entry.js +12 -13
  12. package/dist/cjs/crowdsource-reporter.cjs.entry.js +19 -9
  13. package/dist/cjs/deduct-calculator.cjs.entry.js +1 -1
  14. package/dist/cjs/feature-list.cjs.entry.js +13 -3
  15. package/dist/cjs/instant-apps-app-guide.cjs.entry.js +1 -1
  16. package/dist/cjs/instant-apps-export.cjs.entry.js +5 -1
  17. package/dist/cjs/instant-apps-landing-page.cjs.entry.js +1 -1
  18. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +2 -2
  19. package/dist/cjs/instant-apps-time-filter.cjs.entry.js +6 -6
  20. package/dist/cjs/loader.cjs.js +1 -1
  21. package/dist/cjs/map-select-tools_3.cjs.entry.js +38 -6
  22. package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
  23. package/dist/cjs/public-notification.cjs.entry.js +11 -2
  24. package/dist/cjs/share-item.cjs.entry.js +1 -1
  25. package/dist/cjs/solution-configuration.cjs.entry.js +20 -5
  26. package/dist/cjs/solution-contents_3.cjs.entry.js +37 -7
  27. package/dist/cjs/solution-item-accordion.cjs.entry.js +11 -1
  28. package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
  29. package/dist/cjs/solutions-components.cjs.js +1 -1
  30. package/dist/cjs/spatial-ref.cjs.entry.js +16 -1
  31. package/dist/collection/collection-manifest.json +0 -7
  32. package/dist/collection/components/buffer-tools/buffer-tools.js +30 -1
  33. package/dist/collection/components/card-manager/card-manager.js +34 -2
  34. package/dist/collection/components/consent-manager/consent-manager.js +32 -0
  35. package/dist/collection/components/create-feature/create-feature.js +31 -2
  36. package/dist/collection/components/create-related-feature/create-related-feature.js +30 -1
  37. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +20 -22
  38. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +38 -9
  39. package/dist/collection/components/deduct-calculator/deduct-calculator.js +1 -1
  40. package/dist/collection/components/delete-button/delete-button.js +31 -2
  41. package/dist/collection/components/delete-dialog/delete-dialog.js +33 -1
  42. package/dist/collection/components/edit-card/edit-card.js +30 -1
  43. package/dist/collection/components/feature-details/feature-details.js +24 -6
  44. package/dist/collection/components/feature-list/feature-list.js +32 -3
  45. package/dist/collection/components/floor-filter/floor-filter.js +1 -1
  46. package/dist/collection/components/info-card/info-card.js +36 -2
  47. package/dist/collection/components/json-editor/json-editor.js +38 -1
  48. package/dist/collection/components/layer-list/layer-list.js +35 -3
  49. package/dist/collection/components/layer-table/layer-table.js +34 -5
  50. package/dist/collection/components/map-card/map-card.js +31 -2
  51. package/dist/collection/components/map-draw-tools/map-draw-tools.js +30 -1
  52. package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
  53. package/dist/collection/components/map-layer-picker/map-layer-picker.js +30 -1
  54. package/dist/collection/components/map-legend/map-legend.js +1 -1
  55. package/dist/collection/components/map-picker/map-picker.js +30 -1
  56. package/dist/collection/components/map-search/map-search.js +1 -1
  57. package/dist/collection/components/map-select-tools/map-select-tools.js +15 -4
  58. package/dist/collection/components/map-tools/map-tools.js +30 -1
  59. package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
  60. package/dist/collection/components/pdf-download/pdf-download.js +33 -1
  61. package/dist/collection/components/public-notification/public-notification.js +13 -2
  62. package/dist/collection/components/refine-selection/refine-selection.js +15 -1
  63. package/dist/collection/components/share-item/share-item.js +1 -1
  64. package/dist/collection/components/solution-configuration/solution-configuration.js +38 -4
  65. package/dist/collection/components/solution-contents/solution-contents.js +1 -1
  66. package/dist/collection/components/solution-item/solution-item.js +37 -3
  67. package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +30 -1
  68. package/dist/collection/components/solution-item-details/solution-item-details.js +38 -1
  69. package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
  70. package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +35 -1
  71. package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +35 -1
  72. package/dist/collection/components/solution-resource-item/solution-resource-item.js +35 -1
  73. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +35 -1
  74. package/dist/collection/components/solution-template-data/solution-template-data.js +35 -1
  75. package/dist/collection/components/solution-variables/solution-variables.js +35 -1
  76. package/dist/collection/components/spatial-ref/spatial-ref.js +35 -1
  77. package/dist/collection/demos/crowdsource-manager.html +0 -1
  78. package/dist/collection/demos/crowdsource-reporter.html +2 -2
  79. package/dist/components/buffer-tools2.js +15 -3
  80. package/dist/components/card-manager2.js +18 -3
  81. package/dist/components/consent-manager.js +15 -0
  82. package/dist/components/create-feature2.js +14 -2
  83. package/dist/components/create-related-feature2.js +13 -1
  84. package/dist/components/crowdsource-manager.js +14 -15
  85. package/dist/components/crowdsource-reporter.js +21 -9
  86. package/dist/components/deduct-calculator2.js +1 -1
  87. package/dist/components/delete-button2.js +16 -4
  88. package/dist/components/delete-dialog2.js +16 -1
  89. package/dist/components/edit-card2.js +13 -1
  90. package/dist/components/feature-details2.js +8 -6
  91. package/dist/components/feature-list2.js +15 -3
  92. package/dist/components/floor-filter2.js +1 -1
  93. package/dist/components/info-card2.js +19 -2
  94. package/dist/components/instant-apps-app-guide.js +1 -1
  95. package/dist/components/instant-apps-export.js +5 -1
  96. package/dist/components/instant-apps-filter-list2.js +75 -66
  97. package/dist/components/instant-apps-landing-page.js +1 -1
  98. package/dist/components/instant-apps-sign-in2.js +2 -2
  99. package/dist/components/instant-apps-time-filter.js +6 -6
  100. package/dist/components/json-editor2.js +21 -1
  101. package/dist/components/layer-list2.js +18 -3
  102. package/dist/components/layer-table2.js +17 -5
  103. package/dist/components/map-card2.js +14 -2
  104. package/dist/components/map-draw-tools2.js +13 -1
  105. package/dist/components/map-fullscreen2.js +1 -1
  106. package/dist/components/map-layer-picker2.js +13 -1
  107. package/dist/components/map-legend2.js +1 -1
  108. package/dist/components/map-picker2.js +13 -1
  109. package/dist/components/map-search2.js +1 -1
  110. package/dist/components/map-select-tools2.js +14 -4
  111. package/dist/components/map-tools2.js +13 -1
  112. package/dist/components/pci-calculator.js +1 -1
  113. package/dist/components/pdf-download2.js +16 -1
  114. package/dist/components/public-notification.js +12 -2
  115. package/dist/components/refine-selection2.js +14 -1
  116. package/dist/components/share-item.js +1 -1
  117. package/dist/components/solution-configuration.js +23 -6
  118. package/dist/components/solution-contents2.js +1 -1
  119. package/dist/components/solution-item-accordion.js +13 -1
  120. package/dist/components/solution-item-details2.js +22 -2
  121. package/dist/components/solution-item-icon2.js +1 -1
  122. package/dist/components/solution-item-sharing2.js +20 -3
  123. package/dist/components/solution-item2.js +22 -5
  124. package/dist/components/solution-organization-variables2.js +18 -1
  125. package/dist/components/solution-resource-item2.js +20 -3
  126. package/dist/components/solution-spatial-ref2.js +20 -3
  127. package/dist/components/solution-template-data2.js +20 -3
  128. package/dist/components/solution-variables2.js +18 -1
  129. package/dist/components/spatial-ref.js +18 -1
  130. package/dist/esm/basemap-gallery_7.entry.js +26 -6
  131. package/dist/esm/buffer-tools_3.entry.js +23 -3
  132. package/dist/esm/calcite-alert_5.entry.js +40 -5
  133. package/dist/esm/calcite-block_5.entry.js +75 -65
  134. package/dist/esm/calcite-combobox_3.entry.js +11 -1
  135. package/dist/esm/calcite-flow_4.entry.js +33 -10
  136. package/dist/esm/calcite-shell-panel_14.entry.js +119 -10
  137. package/dist/esm/calcite-shell_3.entry.js +26 -4
  138. package/dist/esm/card-manager_3.entry.js +41 -9
  139. package/dist/esm/consent-manager.entry.js +12 -0
  140. package/dist/esm/crowdsource-manager.entry.js +12 -13
  141. package/dist/esm/crowdsource-reporter.entry.js +19 -9
  142. package/dist/esm/deduct-calculator.entry.js +1 -1
  143. package/dist/esm/feature-list.entry.js +13 -3
  144. package/dist/esm/instant-apps-app-guide.entry.js +1 -1
  145. package/dist/esm/instant-apps-export.entry.js +5 -1
  146. package/dist/esm/instant-apps-landing-page.entry.js +1 -1
  147. package/dist/esm/instant-apps-sign-in.entry.js +2 -2
  148. package/dist/esm/instant-apps-time-filter.entry.js +6 -6
  149. package/dist/esm/loader.js +1 -1
  150. package/dist/esm/map-select-tools_3.entry.js +38 -6
  151. package/dist/esm/pci-calculator.entry.js +1 -1
  152. package/dist/esm/public-notification.entry.js +11 -2
  153. package/dist/esm/share-item.entry.js +1 -1
  154. package/dist/esm/solution-configuration.entry.js +20 -5
  155. package/dist/esm/solution-contents_3.entry.js +37 -7
  156. package/dist/esm/solution-item-accordion.entry.js +11 -1
  157. package/dist/esm/solution-item-icon.entry.js +1 -1
  158. package/dist/esm/solutions-components.js +1 -1
  159. package/dist/esm/spatial-ref.entry.js +16 -1
  160. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-app-guide/instant-apps-app-guide.css +1 -1
  161. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-landing-page/instant-apps-landing-page.css +43 -26
  162. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-sign-in/instant-apps-sign-in.css +6 -0
  163. package/dist/solutions-components/demos/crowdsource-manager.html +0 -1
  164. package/dist/solutions-components/demos/crowdsource-reporter.html +2 -2
  165. package/dist/solutions-components/p-0a2e5861.entry.js +6 -0
  166. package/dist/solutions-components/{p-739ce6f3.entry.js → p-2f784608.entry.js} +1 -1
  167. package/dist/solutions-components/{p-1c2d0e90.entry.js → p-3e44cfab.entry.js} +1 -1
  168. package/dist/solutions-components/{p-841816a1.entry.js → p-41314f33.entry.js} +7 -7
  169. package/dist/solutions-components/{p-18089a0b.entry.js → p-471d5c7f.entry.js} +2 -2
  170. package/dist/solutions-components/p-5001cc41.entry.js +6 -0
  171. package/dist/solutions-components/p-523dcf4b.entry.js +6 -0
  172. package/dist/solutions-components/p-561c0e02.entry.js +6 -0
  173. package/dist/solutions-components/p-56beff4c.entry.js +6 -0
  174. package/dist/solutions-components/p-592f2000.entry.js +6 -0
  175. package/dist/solutions-components/p-5cbf3eed.entry.js +6 -0
  176. package/dist/solutions-components/p-62d8796c.entry.js +17 -0
  177. package/dist/solutions-components/p-6d1922cc.entry.js +6 -0
  178. package/dist/solutions-components/p-80e81af7.entry.js +6 -0
  179. package/dist/solutions-components/{p-82ddf716.entry.js → p-8e2f4995.entry.js} +1 -1
  180. package/dist/solutions-components/p-8f8c7045.entry.js +6 -0
  181. package/dist/solutions-components/p-953afbb3.entry.js +29 -0
  182. package/dist/solutions-components/{p-bb8b1ee2.entry.js → p-a2cf9fdc.entry.js} +1 -1
  183. package/dist/solutions-components/p-a7f56b28.entry.js +6 -0
  184. package/dist/solutions-components/{p-6502d0f8.entry.js → p-b7fbaeb7.entry.js} +1 -1
  185. package/dist/solutions-components/p-cced387c.entry.js +6 -0
  186. package/dist/solutions-components/{p-a5d79c86.entry.js → p-ce53e33d.entry.js} +2 -2
  187. package/dist/solutions-components/{p-59ccd27c.entry.js → p-d51c07d2.entry.js} +1 -1
  188. package/dist/solutions-components/p-d75cf651.entry.js +11 -0
  189. package/dist/solutions-components/p-d7afbe8d.entry.js +11 -0
  190. package/dist/solutions-components/p-e1e21798.entry.js +12 -0
  191. package/dist/solutions-components/p-e4107150.entry.js +6 -0
  192. package/dist/solutions-components/p-e9026f9a.entry.js +6 -0
  193. package/dist/solutions-components/solutions-components.esm.js +1 -1
  194. package/dist/types/components/buffer-tools/buffer-tools.d.ts +8 -0
  195. package/dist/types/components/card-manager/card-manager.d.ts +8 -0
  196. package/dist/types/components/consent-manager/consent-manager.d.ts +8 -0
  197. package/dist/types/components/create-feature/create-feature.d.ts +8 -0
  198. package/dist/types/components/create-related-feature/create-related-feature.d.ts +8 -0
  199. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +4 -4
  200. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +8 -0
  201. package/dist/types/components/deduct-calculator/deduct-calculator.d.ts +1 -1
  202. package/dist/types/components/delete-button/delete-button.d.ts +9 -1
  203. package/dist/types/components/delete-dialog/delete-dialog.d.ts +8 -0
  204. package/dist/types/components/edit-card/edit-card.d.ts +8 -0
  205. package/dist/types/components/feature-details/feature-details.d.ts +4 -0
  206. package/dist/types/components/feature-list/feature-list.d.ts +8 -0
  207. package/dist/types/components/info-card/info-card.d.ts +8 -0
  208. package/dist/types/components/json-editor/json-editor.d.ts +8 -0
  209. package/dist/types/components/layer-list/layer-list.d.ts +8 -0
  210. package/dist/types/components/layer-table/layer-table.d.ts +9 -1
  211. package/dist/types/components/map-card/map-card.d.ts +8 -0
  212. package/dist/types/components/map-draw-tools/map-draw-tools.d.ts +8 -0
  213. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +8 -0
  214. package/dist/types/components/map-picker/map-picker.d.ts +8 -0
  215. package/dist/types/components/map-select-tools/map-select-tools.d.ts +4 -0
  216. package/dist/types/components/map-tools/map-tools.d.ts +8 -0
  217. package/dist/types/components/pdf-download/pdf-download.d.ts +8 -0
  218. package/dist/types/components/public-notification/public-notification.d.ts +4 -0
  219. package/dist/types/components/refine-selection/refine-selection.d.ts +4 -0
  220. package/dist/types/components/solution-configuration/solution-configuration.d.ts +8 -0
  221. package/dist/types/components/solution-item/solution-item.d.ts +8 -0
  222. package/dist/types/components/solution-item-accordion/solution-item-accordion.d.ts +8 -0
  223. package/dist/types/components/solution-item-details/solution-item-details.d.ts +8 -0
  224. package/dist/types/components/solution-item-sharing/solution-item-sharing.d.ts +8 -0
  225. package/dist/types/components/solution-organization-variables/solution-organization-variables.d.ts +8 -0
  226. package/dist/types/components/solution-resource-item/solution-resource-item.d.ts +8 -0
  227. package/dist/types/components/solution-spatial-ref/solution-spatial-ref.d.ts +8 -0
  228. package/dist/types/components/solution-template-data/solution-template-data.d.ts +8 -0
  229. package/dist/types/components/solution-variables/solution-variables.d.ts +8 -0
  230. package/dist/types/components/spatial-ref/spatial-ref.d.ts +8 -0
  231. package/dist/types/components.d.ts +266 -120
  232. package/dist/types/preact.d.ts +0 -16
  233. package/package.json +8 -8
  234. package/dist/cjs/feature-comments.cjs.entry.js +0 -61
  235. package/dist/cjs/feature-form-flow-item.cjs.entry.js +0 -61
  236. package/dist/cjs/features-flow-item.cjs.entry.js +0 -61
  237. package/dist/cjs/layout-manager.cjs.entry.js +0 -114
  238. package/dist/cjs/list-flow-item.cjs.entry.js +0 -61
  239. package/dist/cjs/location-flow-item.cjs.entry.js +0 -61
  240. package/dist/cjs/refine-results-flow-item.cjs.entry.js +0 -61
  241. package/dist/collection/assets/t9n/feature-comments/resources.json +0 -3
  242. package/dist/collection/assets/t9n/feature-comments/resources_en.json +0 -3
  243. package/dist/collection/assets/t9n/feature-form-flow-item/resources.json +0 -3
  244. package/dist/collection/assets/t9n/feature-form-flow-item/resources_en.json +0 -3
  245. package/dist/collection/assets/t9n/layout-manager/resources.json +0 -7
  246. package/dist/collection/assets/t9n/layout-manager/resources_ar.json +0 -7
  247. package/dist/collection/assets/t9n/layout-manager/resources_bg.json +0 -7
  248. package/dist/collection/assets/t9n/layout-manager/resources_bs.json +0 -7
  249. package/dist/collection/assets/t9n/layout-manager/resources_ca.json +0 -7
  250. package/dist/collection/assets/t9n/layout-manager/resources_cs.json +0 -7
  251. package/dist/collection/assets/t9n/layout-manager/resources_da.json +0 -7
  252. package/dist/collection/assets/t9n/layout-manager/resources_de.json +0 -7
  253. package/dist/collection/assets/t9n/layout-manager/resources_el.json +0 -7
  254. package/dist/collection/assets/t9n/layout-manager/resources_en.json +0 -7
  255. package/dist/collection/assets/t9n/layout-manager/resources_es.json +0 -7
  256. package/dist/collection/assets/t9n/layout-manager/resources_et.json +0 -7
  257. package/dist/collection/assets/t9n/layout-manager/resources_fi.json +0 -7
  258. package/dist/collection/assets/t9n/layout-manager/resources_fr.json +0 -7
  259. package/dist/collection/assets/t9n/layout-manager/resources_he.json +0 -7
  260. package/dist/collection/assets/t9n/layout-manager/resources_hr.json +0 -7
  261. package/dist/collection/assets/t9n/layout-manager/resources_hu.json +0 -7
  262. package/dist/collection/assets/t9n/layout-manager/resources_id.json +0 -7
  263. package/dist/collection/assets/t9n/layout-manager/resources_it.json +0 -7
  264. package/dist/collection/assets/t9n/layout-manager/resources_ja.json +0 -7
  265. package/dist/collection/assets/t9n/layout-manager/resources_ko.json +0 -7
  266. package/dist/collection/assets/t9n/layout-manager/resources_lt.json +0 -7
  267. package/dist/collection/assets/t9n/layout-manager/resources_lv.json +0 -7
  268. package/dist/collection/assets/t9n/layout-manager/resources_nb.json +0 -7
  269. package/dist/collection/assets/t9n/layout-manager/resources_nl.json +0 -7
  270. package/dist/collection/assets/t9n/layout-manager/resources_pl.json +0 -7
  271. package/dist/collection/assets/t9n/layout-manager/resources_pt-BR.json +0 -7
  272. package/dist/collection/assets/t9n/layout-manager/resources_pt-PT.json +0 -7
  273. package/dist/collection/assets/t9n/layout-manager/resources_ro.json +0 -7
  274. package/dist/collection/assets/t9n/layout-manager/resources_ru.json +0 -7
  275. package/dist/collection/assets/t9n/layout-manager/resources_sk.json +0 -7
  276. package/dist/collection/assets/t9n/layout-manager/resources_sl.json +0 -7
  277. package/dist/collection/assets/t9n/layout-manager/resources_sr.json +0 -7
  278. package/dist/collection/assets/t9n/layout-manager/resources_sv.json +0 -7
  279. package/dist/collection/assets/t9n/layout-manager/resources_th.json +0 -7
  280. package/dist/collection/assets/t9n/layout-manager/resources_tr.json +0 -7
  281. package/dist/collection/assets/t9n/layout-manager/resources_uk.json +0 -7
  282. package/dist/collection/assets/t9n/layout-manager/resources_vi.json +0 -7
  283. package/dist/collection/assets/t9n/layout-manager/resources_zh-CN.json +0 -7
  284. package/dist/collection/assets/t9n/layout-manager/resources_zh-HK.json +0 -7
  285. package/dist/collection/assets/t9n/layout-manager/resources_zh-TW.json +0 -7
  286. package/dist/collection/assets/t9n/list-flow-item/resources.json +0 -3
  287. package/dist/collection/assets/t9n/list-flow-item/resources_en.json +0 -3
  288. package/dist/collection/assets/t9n/location-flow-item/resources.json +0 -3
  289. package/dist/collection/assets/t9n/location-flow-item/resources_en.json +0 -3
  290. package/dist/collection/components/feature-comments/feature-comments.css +0 -19
  291. package/dist/collection/components/feature-comments/feature-comments.js +0 -80
  292. package/dist/collection/components/feature-form-flow-item/feature-form-flow-item.css +0 -19
  293. package/dist/collection/components/feature-form-flow-item/feature-form-flow-item.js +0 -80
  294. package/dist/collection/components/features-flow-item/features-flow-item.css +0 -19
  295. package/dist/collection/components/features-flow-item/features-flow-item.js +0 -80
  296. package/dist/collection/components/layout-manager/layout-manager.css +0 -73
  297. package/dist/collection/components/layout-manager/layout-manager.js +0 -161
  298. package/dist/collection/components/list-flow-item/list-flow-item.css +0 -19
  299. package/dist/collection/components/list-flow-item/list-flow-item.js +0 -80
  300. package/dist/collection/components/location-flow-item/location-flow-item.css +0 -19
  301. package/dist/collection/components/location-flow-item/location-flow-item.js +0 -80
  302. package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.css +0 -19
  303. package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.js +0 -80
  304. package/dist/components/feature-comments.d.ts +0 -11
  305. package/dist/components/feature-comments.js +0 -76
  306. package/dist/components/feature-form-flow-item.d.ts +0 -11
  307. package/dist/components/feature-form-flow-item.js +0 -76
  308. package/dist/components/features-flow-item.d.ts +0 -11
  309. package/dist/components/features-flow-item.js +0 -76
  310. package/dist/components/layout-manager.d.ts +0 -11
  311. package/dist/components/layout-manager.js +0 -159
  312. package/dist/components/list-flow-item.d.ts +0 -11
  313. package/dist/components/list-flow-item.js +0 -76
  314. package/dist/components/location-flow-item.d.ts +0 -11
  315. package/dist/components/location-flow-item.js +0 -76
  316. package/dist/components/refine-results-flow-item.d.ts +0 -11
  317. package/dist/components/refine-results-flow-item.js +0 -76
  318. package/dist/esm/feature-comments.entry.js +0 -57
  319. package/dist/esm/feature-form-flow-item.entry.js +0 -57
  320. package/dist/esm/features-flow-item.entry.js +0 -57
  321. package/dist/esm/layout-manager.entry.js +0 -110
  322. package/dist/esm/list-flow-item.entry.js +0 -57
  323. package/dist/esm/location-flow-item.entry.js +0 -57
  324. package/dist/esm/refine-results-flow-item.entry.js +0 -57
  325. package/dist/solutions-components/assets/t9n/feature-comments/resources.json +0 -3
  326. package/dist/solutions-components/assets/t9n/feature-comments/resources_en.json +0 -3
  327. package/dist/solutions-components/assets/t9n/feature-form-flow-item/resources.json +0 -3
  328. package/dist/solutions-components/assets/t9n/feature-form-flow-item/resources_en.json +0 -3
  329. package/dist/solutions-components/assets/t9n/layout-manager/resources.json +0 -7
  330. package/dist/solutions-components/assets/t9n/layout-manager/resources_ar.json +0 -7
  331. package/dist/solutions-components/assets/t9n/layout-manager/resources_bg.json +0 -7
  332. package/dist/solutions-components/assets/t9n/layout-manager/resources_bs.json +0 -7
  333. package/dist/solutions-components/assets/t9n/layout-manager/resources_ca.json +0 -7
  334. package/dist/solutions-components/assets/t9n/layout-manager/resources_cs.json +0 -7
  335. package/dist/solutions-components/assets/t9n/layout-manager/resources_da.json +0 -7
  336. package/dist/solutions-components/assets/t9n/layout-manager/resources_de.json +0 -7
  337. package/dist/solutions-components/assets/t9n/layout-manager/resources_el.json +0 -7
  338. package/dist/solutions-components/assets/t9n/layout-manager/resources_en.json +0 -7
  339. package/dist/solutions-components/assets/t9n/layout-manager/resources_es.json +0 -7
  340. package/dist/solutions-components/assets/t9n/layout-manager/resources_et.json +0 -7
  341. package/dist/solutions-components/assets/t9n/layout-manager/resources_fi.json +0 -7
  342. package/dist/solutions-components/assets/t9n/layout-manager/resources_fr.json +0 -7
  343. package/dist/solutions-components/assets/t9n/layout-manager/resources_he.json +0 -7
  344. package/dist/solutions-components/assets/t9n/layout-manager/resources_hr.json +0 -7
  345. package/dist/solutions-components/assets/t9n/layout-manager/resources_hu.json +0 -7
  346. package/dist/solutions-components/assets/t9n/layout-manager/resources_id.json +0 -7
  347. package/dist/solutions-components/assets/t9n/layout-manager/resources_it.json +0 -7
  348. package/dist/solutions-components/assets/t9n/layout-manager/resources_ja.json +0 -7
  349. package/dist/solutions-components/assets/t9n/layout-manager/resources_ko.json +0 -7
  350. package/dist/solutions-components/assets/t9n/layout-manager/resources_lt.json +0 -7
  351. package/dist/solutions-components/assets/t9n/layout-manager/resources_lv.json +0 -7
  352. package/dist/solutions-components/assets/t9n/layout-manager/resources_nb.json +0 -7
  353. package/dist/solutions-components/assets/t9n/layout-manager/resources_nl.json +0 -7
  354. package/dist/solutions-components/assets/t9n/layout-manager/resources_pl.json +0 -7
  355. package/dist/solutions-components/assets/t9n/layout-manager/resources_pt-BR.json +0 -7
  356. package/dist/solutions-components/assets/t9n/layout-manager/resources_pt-PT.json +0 -7
  357. package/dist/solutions-components/assets/t9n/layout-manager/resources_ro.json +0 -7
  358. package/dist/solutions-components/assets/t9n/layout-manager/resources_ru.json +0 -7
  359. package/dist/solutions-components/assets/t9n/layout-manager/resources_sk.json +0 -7
  360. package/dist/solutions-components/assets/t9n/layout-manager/resources_sl.json +0 -7
  361. package/dist/solutions-components/assets/t9n/layout-manager/resources_sr.json +0 -7
  362. package/dist/solutions-components/assets/t9n/layout-manager/resources_sv.json +0 -7
  363. package/dist/solutions-components/assets/t9n/layout-manager/resources_th.json +0 -7
  364. package/dist/solutions-components/assets/t9n/layout-manager/resources_tr.json +0 -7
  365. package/dist/solutions-components/assets/t9n/layout-manager/resources_uk.json +0 -7
  366. package/dist/solutions-components/assets/t9n/layout-manager/resources_vi.json +0 -7
  367. package/dist/solutions-components/assets/t9n/layout-manager/resources_zh-CN.json +0 -7
  368. package/dist/solutions-components/assets/t9n/layout-manager/resources_zh-HK.json +0 -7
  369. package/dist/solutions-components/assets/t9n/layout-manager/resources_zh-TW.json +0 -7
  370. package/dist/solutions-components/assets/t9n/list-flow-item/resources.json +0 -3
  371. package/dist/solutions-components/assets/t9n/list-flow-item/resources_en.json +0 -3
  372. package/dist/solutions-components/assets/t9n/location-flow-item/resources.json +0 -3
  373. package/dist/solutions-components/assets/t9n/location-flow-item/resources_en.json +0 -3
  374. package/dist/solutions-components/p-04ab956c.entry.js +0 -6
  375. package/dist/solutions-components/p-06364211.entry.js +0 -6
  376. package/dist/solutions-components/p-1700f63a.entry.js +0 -6
  377. package/dist/solutions-components/p-1f07e21a.entry.js +0 -6
  378. package/dist/solutions-components/p-46416e11.entry.js +0 -6
  379. package/dist/solutions-components/p-5b3c0418.entry.js +0 -6
  380. package/dist/solutions-components/p-70c0050c.entry.js +0 -6
  381. package/dist/solutions-components/p-720de4db.entry.js +0 -6
  382. package/dist/solutions-components/p-74bcef23.entry.js +0 -11
  383. package/dist/solutions-components/p-750b3277.entry.js +0 -6
  384. package/dist/solutions-components/p-76154700.entry.js +0 -6
  385. package/dist/solutions-components/p-8779ee41.entry.js +0 -6
  386. package/dist/solutions-components/p-938bc915.entry.js +0 -6
  387. package/dist/solutions-components/p-9c4fef09.entry.js +0 -17
  388. package/dist/solutions-components/p-9d56f4b5.entry.js +0 -6
  389. package/dist/solutions-components/p-9da8a590.entry.js +0 -6
  390. package/dist/solutions-components/p-aac0c89c.entry.js +0 -6
  391. package/dist/solutions-components/p-be4c7ffd.entry.js +0 -6
  392. package/dist/solutions-components/p-ca3cbd29.entry.js +0 -6
  393. package/dist/solutions-components/p-d2612c30.entry.js +0 -6
  394. package/dist/solutions-components/p-df7de4b7.entry.js +0 -12
  395. package/dist/solutions-components/p-e1391389.entry.js +0 -29
  396. package/dist/solutions-components/p-e345f9c4.entry.js +0 -6
  397. package/dist/solutions-components/p-eadff42b.entry.js +0 -11
  398. package/dist/solutions-components/p-fa1c368c.entry.js +0 -6
  399. package/dist/solutions-components/p-ff3858c6.entry.js +0 -6
  400. package/dist/types/components/feature-comments/feature-comments.d.ts +0 -19
  401. package/dist/types/components/feature-form-flow-item/feature-form-flow-item.d.ts +0 -19
  402. package/dist/types/components/features-flow-item/features-flow-item.d.ts +0 -19
  403. package/dist/types/components/layout-manager/layout-manager.d.ts +0 -69
  404. package/dist/types/components/list-flow-item/list-flow-item.d.ts +0 -19
  405. package/dist/types/components/location-flow-item/location-flow-item.d.ts +0 -19
  406. package/dist/types/components/refine-results-flow-item/refine-results-flow-item.d.ts +0 -19
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,g as s,h as e,H as h}from"./p-4e6eb06e.js";import{g as a,l as o}from"./p-f4aadb3b.js";import{g as l,q as n,e as c,f as d,i as r,j as p,c as b}from"./p-d572627c.js";import{d as f}from"./p-ff9e28d1.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";import"./p-7530a02f.js";import"./p-d0d020a5.js";import"./p-9bb44f57.js";const u=class{constructor(s){t(this,s),this.createWorkFlowStarted=i(this,"createWorkFlowStarted",7),this.backFromCreateWorkFlow=i(this,"backFromCreateWorkFlow",7),this.featureOrRecordSubmitted=i(this,"featureOrRecordSubmitted",7),this.customInfoText=void 0,this.enableEditGeometry=!1,this.isMobile=void 0,this.layer=void 0,this.mapView=void 0,this.zoomAndScrollToSelected=void 0,this.selectedFeaturesIds=void 0,this.enableCreateFeatures=!0,this.selectingFeatureFromMap=void 0,this._cardLoading=!1,this._graphics=void 0,this._showCreateFeatureComponent=!1,this._showSubmitBtn=!1,this._translations=void 0}get el(){return s(this)}_isFeatureCreated=!1;_createFeature;createWorkFlowStarted;backFromCreateWorkFlow;featureOrRecordSubmitted;async featureSelectionChange(t){this._showCreateFeatureComponent&&!this._isFeatureCreated&&this._backFromCreateFeature();const i=t.detail;this._graphics=await this._getFeaturesByIds(i)}async layerSelectionChange(t){this._showCreateFeatureComponent&&this._backFromCreateFeature();const i=t.detail[0];this.layer=await l(this.mapView,i)}async componentWillLoad(){await this._getTranslations(),this.selectedFeaturesIds?.length>0&&(this._graphics=await this._getFeaturesByIds(this.selectedFeaturesIds))}render(){const t=this._graphics?.length>0?"":"display-none",i=0===this._graphics?.length&&this._showCreateFeatureComponent?"":"display-none",s=this._graphics?.length>0||this._showCreateFeatureComponent?"display-none":"",a=this.layer?.isTable,o=a?this._translations.createRecord:this._translations.createFeature,l=this.customInfoText?this.customInfoText:this.selectingFeatureFromMap?this._translations.selectFeaturesFromMapToStart:this._translations.selectFeaturesToStart,n=this.enableCreateFeatures&&this.layer?.capabilities?.operations?.supportsAdd;return e(h,{key:"7360aa9c48dd0c3e4a14fe0833b99c301388f93c"},e("div",{key:"9d610f0c4728c238eceb790e97a4e06b77f1a2d1",class:"overflow-auto height-full"},e("calcite-shell",{key:"4b6a02205a971c7ff61aab567b2f2a3c5d288f8d",class:"position-relative "+t},e("div",{key:"96ee8ce138265dd4b562ac0a33b79a0db4497842",class:"position-static z-index-500"},e("info-card",{key:"7db359bc1016281fd01b737dc5c424fe78995422",enableEditGeometry:this.enableEditGeometry,graphics:this._graphics,isLoading:this._cardLoading,isMobile:this.isMobile,mapView:this.mapView}))),e("calcite-shell",{key:"afc8d06e9aa3213a9ca10c929497ed4618a28e91",class:"position-relative "+s},e("calcite-flow-item",{key:"46db92a6e259eefea3293310e3e2f43d7639db97"},e("calcite-panel",{key:"d2bc23ae7bcf2b7b7b48a35efc0697e0d1f9e23e"},e("div",{key:"8f7fd13f9ec99beec1d7231dda03eba403a70a69",class:"padding-1"},e("calcite-notice",{key:"2fbe94292c1dd91ee1691b8e3d295225ff5b534b",icon:this.selectingFeatureFromMap?"map":"table",iconFlipRtl:!0,open:!0},e("div",{key:"9f91099e4bfa0675c5b098a73b2f132b80ee76b0",slot:"message"},l))),!this.isMobile&&n&&e("calcite-button",{key:"c1b04e776f3750712992d736e09726cc26eae5db",disabled:!this.layer,onClick:()=>this._createFeatureBtnClicked(),slot:"footer",width:"full"},a?this._translations.createRecord:this._translations.createFeature)))),e("calcite-shell",{key:"a71d4b0abd1ec1a4ed14a2cb3dcb10a075f54bf0",class:"position-relative "+i},e("calcite-flow-item",{key:"85047b527f5995a912b527325f287c3596caf630"},e("calcite-panel",{key:"d335be81502e0feb803ee9ad4e501d4c85f184f5",heading:o},e("calcite-action",{key:"b179c3185dbada3bd052d38b98b75cf29240655c",class:"back-button hydrated",icon:"chevron-left",onClick:this._backFromCreateFeature.bind(this),scale:"s",slot:"header-actions-start",text:""}),this.getEditorComponent(),this._showSubmitBtn&&e("calcite-button",{key:"f3b6655e3effdb6b09e64acd651a09d6028a6df9",appearance:"solid",class:"footer-top-button footer-button",onClick:()=>{this._createFeature.submit()},slot:"footer",width:"full"},this._translations.create))))))}getEditorComponent(){return e("div",null,this._showCreateFeatureComponent&&e("create-feature",{customizeSubmit:!0,mapView:this.mapView,onDrawComplete:()=>{this._showSubmitBtn=!0},onEditingAttachment:t=>{this._showSubmitBtn=!t.detail},onProgressStatus:()=>{setTimeout((()=>{this._isFeatureCreated=!1}),2e3)},onSuccess:this._featureCreated.bind(this),ref:t=>this._createFeature=t,selectedLayerId:this.layer?.id,showGuidingMsgWhileDrawing:!1}))}async _getFeaturesByIds(t){return(t.length>0?await n(t,this.layer,[],!0,this.mapView.spatialReference):[]).sort(((i,s)=>t.indexOf(i.getObjectId())-t.indexOf(s.getObjectId())))}_createFeatureBtnClicked(){this._showCreateFeatureComponent=!0,this.createWorkFlowStarted.emit()}async _backFromCreateFeature(){this._createFeature&&(this._showCreateFeatureComponent=!1,this.backFromCreateWorkFlow.emit()),this._showSubmitBtn=!1}_featureCreated(){this._showCreateFeatureComponent=!1,this._showSubmitBtn=!1,this._isFeatureCreated=!0,this.featureOrRecordSubmitted.emit(),setTimeout((()=>{this._showCreateFeatureComponent=!0}),50)}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}};u.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.height-full{height:100%}.position-static{position:static !important}.z-index-500{z-index:500 !important}card-manager{display:block}";const m=class{constructor(s){t(this,s),this.featureSelectionChange=i(this,"featureSelectionChange",7),this.toggleFilter=i(this,"toggleFilter",7),this.appLayout=void 0,this.defaultGlobalId=void 0,this.defaultLayerId=void 0,this.defaultOid=void 0,this.enableAutoRefresh=void 0,this.enableColumnReorder=!0,this.enableCSV=void 0,this.enableInlineEdit=void 0,this.enableShare=void 0,this.isMobile=void 0,this.mapHidden=void 0,this.mapInfo=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.selectedIds=[],this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.showNewestFirst=void 0,this.zoomAndScrollToSelected=void 0,this.zoomToScale=void 0,this.createFilterModal=!0,this._allIds=[],this._controlsThatFit=void 0,this._csvExporting=!1,this._fetchingData=!1,this._filterActive=!1,this._filterOpen=!1,this._layer=void 0,this._selectAllActive=!1,this._deleteDialogOpen=!1,this._showHideOpen=!1,this._showOnlySelected=!1,this._toolInfos=void 0,this._translations=void 0,this._fullTextSearchInfo=void 0,this._searchPlaceHolder="",this._size=0}get el(){return s(this)}FeatureTable;TableTemplate;_columnsInfo;_ctrlIsPressed=!1;_currentId;_editEnabled;_defaultFilterHonored=!1;_defaultGlobalIdHonored=!1;_defaultOidHonored=!1;_defaultVisibleToolSizeInfos;_definitionExpression;_deleteEnabled;_filterList;_floorExpression;_floorField;_floorFacility;_floorLevel;_floorSite;_layerExpressions;_loaded=!1;_mapClickHandle;_observerSet=!1;_previousCurrentId;reactiveUtils;_refreshHandle;_resizeObserver;_selectAllElement;_selectionFromMap=!1;_shareNode;_shiftIsPressed=!1;_showHideDropdown;_skipOnChange=!1;_moreDropdown;_table;_tableNode;_timeout;_toolbar;_toolbarSizeInfos;_searchExpression;appLayoutWatchHandler(){this._updateShareUrl()}async defaultOidWatchHandler(){await this._handleDefaults()}async defaultGlobalIdWatchHandler(){await this._handleDefaults()}enableCSVWatchHandler(){this._toolInfos?.length>0&&this._initToolInfos()}enableInlineEditWatchHandler(){this._table&&(this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit)}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}_controlsThatFitWatchHandler(){const t=this._controlsThatFit?this._controlsThatFit.reduce(((t,i)=>(t.push(i.id),t)),[]):[];this._toolInfos=this._toolInfos?.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}mapHiddenWatchHandler(){this._toolInfos?.length>0&&this._initToolInfos()}isMobileWatchHandler(){this._toolInfos||this.isMobile||this._initToolInfos()}async mapInfoWatchHandler(){this._resetColumnTemplates(),this.createFilterModal&&this._initLayerExpressions(),this._initToolInfos(),this._updateToolbar(),await this._sortTable()}async mapViewWatchHandler(){this._mapClickHandle&&this._mapClickHandle.remove(),this.mapView&&(this._floorExpression=void 0,this._searchExpression=void 0,this._updateShareUrl(),this._mapClickHandle=this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})))}async _layerWatchHandler(){this._fetchingData=!0,await(this._layer?.when((async()=>{this._definitionExpression=this._layer.definitionExpression,this._floorField=this._layer.floorInfo?.floorField,this._updateFloorDefinitionExpression(),await this._resetTable(),this.createFilterModal&&this._initLayerExpressions(),this._updateShareUrl(),this._fetchingData=!1})))}async selectedIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions(),this._selectAllActive&&this.selectedIds.length!==this._allIds.length&&(this._selectAllActive=!1),this.selectedIds.length>0&&(this._table.rowHighlightIds.removeAll(),this._table.rowHighlightIds.add(this.selectedIds[0]))}async filterReset(){await this._handleFilterListReset()}async filterUpdate(){await this._handleFilterUpdate()}async closeFilter(){await this._closeFilter()}async refresh(){this._table&&await this._refresh()}featureSelectionChange;toggleFilter;async selectionChanged(t){const i=t.detail.selectedFeature[0],s=i.getObjectId(),e=this._table;if(e.rowHighlightIds.length&&e.rowHighlightIds.removeAll(),e.rowHighlightIds.add(s),this.zoomAndScrollToSelected){const t=this._table.viewModel.getObjectIdIndex(s);this._table.scrollToIndex(t);const e=i.layer;let h;this.mapView.allLayerViews.toArray().some((t=>{if(t.layer.title===e.title&&"feature"===t.layer.type)return h=t,!0})),h&&await c([s],h,this.mapView,!0,void 0,this.zoomToScale)}}async layerSelectionChange(t){await this._layerSelectionChanged(t)}async editsComplete(t){const i=t.detail;"delete"!==i&&"add"!==i||(this._allIds=await d(this._layer)),await this._refresh()}async facilityChanged(t){this._floorFacility=t.detail,this._updateFloorDefinitionExpression()}async levelChanged(t){this._floorLevel=t.detail,this._updateFloorDefinitionExpression()}async siteChanged(t){this._floorSite=t.detail,this._updateFloorDefinitionExpression()}noLayersFound(){this._layer=void 0,this._allIds=[],this._clearSelection()}clearSelection(){this._clearSelection()}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._onResize())))}render(){const t=this._fetchingData?"display-none":"",i=this._fetchingData?"":"display-none",s=this._size.toString(),a=this.selectedIds.length.toString(),o=this.isMobile?"height-full":"height-full-adjusted",l=this._canShowFullTextSearch();return this._validateActiveActions(),e(h,{key:"04fccaaa9862ed315d99ad74f7e1135dd5656613"},e("calcite-shell",{key:"e332d781be1499857a5e17e37ad2e058bba453b1"},this._getTableControlRow("header"),e("div",{key:"6337e494f879c250494c5f5859daec627fdd0700",class:`width-full ${o}`},e("calcite-panel",{key:"d0d437997906fd15f97765cb89c3917f66b20c37",class:"height-full width-full"},l&&e("div",{key:"596a2d54fd707941d9e2ec167598313d9ee9b295",class:"search-container"},e("calcite-input",{key:"31cd1ffb09bc2c6c9c1f9daf39f3e9549cbceeb2",class:"search",clearable:!0,icon:"search",onCalciteInputChange:t=>{this._searchTextChanged(t)},placeholder:this._searchPlaceHolder,title:this._searchPlaceHolder,type:"search"})),e("calcite-loader",{key:"b4ba3d32fb346134672e08d55428bd38ac43f40d",class:i,label:this._translations.fetchingData,scale:"l"}),e("div",{key:"4fbac73935be7a1163643543e6d77a200534e5e3",class:t,ref:this.onTableNodeCreate}))),this.isMobile?void 0:e("div",{class:"bottom-left text-color height-19"},this._translations.recordsSelected.replace("{{total}}",s).replace("{{selected}}",a))),this.createFilterModal&&this._filterModal(),e("delete-dialog",{key:"3b0dba8bc391d777f4687ad6f4e905aeb1eb580b",id:"deleteDialogId",ids:this._getIds(),layer:this._layer,onDeleteDialogClose:()=>this._deleteDialogOpen=!1,open:this._deleteDialogOpen,ref:t=>this._deleteDialog=t}))}_deleteDialog;async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0)}componentDidRender(){document.onclick=t=>this._handleDocumentClick(t),document.onkeydown=t=>this._handleKeyDown(t),document.onkeyup=t=>this._handleKeyUp(t),this._updateToolbar()}async _initModules(){const[t,i,s]=await o(["esri/widgets/FeatureTable","esri/core/reactiveUtils","esri/widgets/FeatureTable/support/TableTemplate"]);this.FeatureTable=t,this.reactiveUtils=i,this.TableTemplate=s}async _searchTextChanged(t){this._fullTextSearchInfo.forEach((i=>{i.searchTerm=t.target.value})),this._searchFullText()}async _searchFullText(){if(this._searchExpression&&this._clearSearchDefinitionExpression(),this._fullTextSearchInfo.length&&this._fullTextSearchInfo[0].searchTerm){const t=this._layer.createQuery();t.fullText=this._fullTextSearchInfo;const i=await this._layer.queryObjectIds(t);await this._updateSearchDefinitionExpression(i?.length?i:[-1])}await new Promise((t=>setTimeout(t,800))),await this._updateAllIds()}_clearSearchDefinitionExpression(){const t=this._layer.definitionExpression;this._searchExpression&&t?.indexOf(this._searchExpression)>-1&&(this._layer.definitionExpression=t?.indexOf(" AND ("+this._searchExpression)>-1?t.replace(` AND (${this._searchExpression})`,""):t.replace(this._searchExpression,"")),this._searchExpression=void 0}async _updateSearchDefinitionExpression(t){const i=this._layer.definitionExpression;if(t?.length){const s=`objectId in(${t})`;this._layer.definitionExpression=i?.indexOf(this._searchExpression)>-1?i.replace(this._searchExpression,s):i?`${i} AND (${s})`:s,this._searchExpression=s}else this._clearSearchDefinitionExpression()}_canShowFullTextSearch(){return((this._layer?.capabilities)?.query)?.supportsFullTextSearch&&this._layer.indexes.items.filter((t=>"FullText"==t.indexType)).length>0}_getFullTextSearchInfo(){if(this._fullTextSearchInfo=[],((this._layer?.capabilities)?.query)?.supportsFullTextSearch){const t=this._layer.indexes?.filter((t=>"FullText"==t.indexType));if(t?.length){const i=[];t.forEach((t=>{i.push(...t.fields.split(","))}));const s=[];i.forEach((t=>{const i=this._layer.getField(t.trim());s.push(i.alias)})),this._searchPlaceHolder=this._translations.searchPlaceholder.replace("{{fields}}",s.join(", ")),this._fullTextSearchInfo.push({onFields:["*"],searchTerm:"",searchType:"prefix"})}}}_onResize(){this._updateToolbar()}_getTableControlRow(t){const i=this._canShowFullTextSearch()?"border-bottom":"";return e("div",{class:`display-flex height-51-px ${i}`,ref:t=>this._toolbar=t,slot:t},this._getActionBar(),this.isMobile?void 0:this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile?this._getShare("share"):void 0)}_getActionBar(){const t=this.isMobile?"width-full":"",i=this.isMobile?"border-top":"";return e("calcite-action-bar",{class:t,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},e("div",{class:`border-end ${t} ${i}`,id:"solutions-map-layer-picker-container"},e("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",scale:"l",selectedIds:this._layer?[this._layer?.id]:[],showSingleLayerAsLabel:!0,showTables:!0,type:"dropdown"})),this.isMobile?void 0:this._getActions())}_getActions(){const t=this._getActionItems();return t?.reduce(((t,i)=>(i&&!i.isOverflow&&t.push(i.isDanger?this._getDangerAction(i.icon,i.label,i.func,i.disabled):i.isSublist?e("calcite-dropdown",{closeOnSelectDisabled:!0,id:this._getId(i.icon),onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._showHideDropdown=t},this._getAction(i.active,this._showHideOpen?"chevron-down":i.icon,i.indicator,i.label,i.func,i.disabled,i.loading,"trigger"),this._showHideOpen?this._getFieldlist():void 0):this._getAction(i.active,i.icon,i.indicator,i.label,i.func,i.disabled,i.loading)),t)),[])}_getFieldlist(){return this._columnsInfo?e("calcite-dropdown-group",{"selection-mode":"multiple"},Object.keys(this._columnsInfo).map((t=>{const i=this._columnsInfo[t];return e("calcite-dropdown-item",{id:`layer-table-${t.toLowerCase().replaceAll(" ","")}`,label:t,onClick:t=>{const i=t.target;this._columnsInfo[i.label]=i.selected,i.selected?this._table.showColumn(i.label):this._table.hideColumn(i.label)},selected:i},t)}))):void 0}_validateEnabledActions(){const t=this._featuresSelected(),i=this.selectedIds.length>1&&this._layer?.capabilities?.operations?.supportsUpdate,s=["zoom-to-object","pencil","trash","erase","selected-items-filter"];this._toolInfos?.forEach((e=>{e&&s.indexOf(e.icon)>-1&&(e.disabled="pencil"===e.icon?!i:!t)}))}_validateActiveActions(){const t=["filter","list-check-all","selected-items-filter"];this._toolInfos?.forEach((i=>{i&&t.indexOf(i.icon)>-1&&("filter"===i.icon&&(i.indicator=this._filterActive),"list-check-all"===i.icon&&(i.active=this._selectAllActive),"selected-items-filter"===i.icon&&(i.active=this._showOnlySelected))}))}_initToolInfos(){const t=this._featuresSelected(),i=this.selectedIds.length>1&&this._layer?.capabilities?.operations?.supportsUpdate&&!1,s=this._featuresEmpty(),e=this._hasFilterExpressions();this._translations&&(this._toolInfos=[this.mapHidden?void 0:{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!t,isOverflow:!1},e?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this.createFilterModal?this._toggleFilter():this.toggleFilter.emit(),disabled:!1,isOverflow:!1}:void 0,i?{active:!1,icon:"pencil",indicator:!1,label:this._translations.editMultiple,func:()=>alert(this._translations.editMultiple),disabled:!i,isOverflow:!1}:void 0,this._deleteEnabled?{active:void 0,icon:"trash",indicator:void 0,label:this._translations.delete,func:()=>this._showDelete(),disabled:!t,isDanger:!0,isOverflow:!1}:void 0,{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this._clearSelection(),disabled:!t,isOverflow:!1},{active:!1,icon:"selected-items-filter",indicator:!1,label:this._showOnlySelected?this._translations.showAll:this._translations.showSelected,func:()=>this._toggleShowSelected(),disabled:!t,isOverflow:!1},{active:!1,icon:"list-check-all",indicator:!1,func:()=>this._selectAll(),label:this._translations.selectAll,disabled:s,isOverflow:!1},{active:!1,icon:"compare",indicator:!1,func:()=>this._switchSelected(),label:this._translations.switchSelected,disabled:s,isOverflow:!1},{active:!1,icon:"refresh",indicator:!1,func:()=>this._refresh(),label:this._translations.refresh,disabled:!1,isOverflow:!1},this.enableCSV?{active:!1,icon:"export",indicator:!1,func:()=>{this._exportToCSV()},label:this._translations.exportCSV,loading:this._csvExporting,disabled:s,isOverflow:!1}:void 0,{active:!1,icon:this._showHideOpen?"chevron-down":"chevron-right",indicator:!1,func:()=>this._toggleShowHide(),label:this._translations.showHideColumns,disabled:!1,isOverflow:!1,isSublist:!0}],this._defaultVisibleToolSizeInfos=void 0)}_updateFloorDefinitionExpression(){if(this._floorField&&this._floorLevel){const t=`${this._floorField} = '${this._floorLevel}'`,i=this._layer.definitionExpression;this._layer.definitionExpression=i?.indexOf(this._floorExpression)>-1?i.replace(this._floorExpression,t):i?`${i} AND (${t})`:t,this._floorExpression=t}}_featuresSelected(){return this.selectedIds.length>0}_featuresEmpty(){return 0===this._allIds.length}_hasFilterExpressions(){let t;return this.mapInfo?.filterConfig?.layerExpressions&&this._layer?.id&&(t=this.mapInfo.filterConfig.layerExpressions.filter((t=>t.id===this._layer.id))),t?.length>0}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const t=this._toolbar.offsetWidth;let i=this._toolbarSizeInfos.reduce(((t,i)=>t+i.width),0);const s=["solutions-more","solutions-map-layer-picker-container","solutions-action-share"];if(i>t){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(i>t?i-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((t,i)=>(t.push(i.id),t)),[]);let h=!1;const a=[...this._defaultVisibleToolSizeInfos].reduce(((a,o)=>(!h&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||i+o.width<=t)?(e.indexOf(o.id)<0&&(i+=o.width),a.push(o)):s.indexOf(o.id)<0&&i+o.width>t&&(h=!0),a)),[]);this._setControlsThatFit(a,s)}}),250))}_setControlsThatFit(t,i){let s=JSON.stringify(t)!==JSON.stringify(this._controlsThatFit);const e=document.getElementById("solutions-action-bar");e?.childNodes?.forEach((t=>{i.indexOf(t.id)<0&&!s&&(s=this._controlsThatFit.map((t=>t.id)).indexOf(t.id)<0)})),s&&(this._controlsThatFit=[...t])}_setToolbarSizeInfos(){let t=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((i,s)=>{0===s?i.childNodes.forEach((i=>{this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0)})):i.referenceElement||(this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0))})),t&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionItems(){return this._toolInfos?.filter((t=>t&&!t.isOverflow))}_getDropdown(t){const i=this._getDropdownItems();return i.length>0?e("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this._layer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._moreDropdown=t},e("calcite-action",{appearance:"solid",id:t,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},e("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),e("calcite-dropdown-group",{"selection-mode":"none"},i.map((t=>e("calcite-dropdown-group",{class:`${t.disabled?"disabled":""} ${"trash"===t.icon?"delete-red":""}`,selectionMode:"none"},e("calcite-dropdown-item",{disabled:t.loading,iconStart:t.isSublist&&this._showHideOpen?"chevron-down":t.loading?"":t.icon,id:`layer-table-${t.icon}`,onClick:t.func},t.loading?e("div",{class:"display-flex"},e("calcite-loader",{inline:!0,label:t.label,scale:"m"}),t.label):t.label))))),this._showHideOpen?this._getFieldlist():void 0):void 0}_getDropdownItems(){return this._toolInfos?.filter((t=>t&&t.isOverflow))}_getAction(t,i,s,h,a,o,l,n){const c=void 0===this._layer||o;return e("div",{class:"display-flex",id:this._getId(i),slot:n},e("calcite-action",{active:t,appearance:"solid",disabled:c,icon:i,id:`layer-table-${i}`,indicator:s,label:h,loading:l,onClick:a,text:h,textEnabled:!0}),this._getToolTip("bottom",i,h))}_showDelete(){this._deleteDialogOpen=!0}_getShare(t){return e("div",{class:"share-action",id:this._getId(t)},e("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:t=>this._shareNode=t,scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",t,this._translations.share))}_updateShareUrl(){const t=this._shareNode?.shareUrl;if(!t)return;const i=new URL(t);this.mapInfo?.id?i.searchParams.set("webmap",this.mapInfo.id):i.searchParams.delete("webmap"),this._layer?.id?i.searchParams.set("layer",this._layer.id):i.searchParams.delete("layer"),this.selectedIds?.length>0?i.searchParams.set("oid",this.selectedIds.join(",")):i.searchParams.delete("oid"),i.searchParams.set("applayout",this.appLayout),this._shareNode.shareUrl=i.href}_getToolTip(t,i,s){return document.getElementById(i)?e("calcite-tooltip",{placement:t,"reference-element":i},e("span",null,s)):void 0}_getId(t){return`solutions-action-${t}`}_getDangerAction(t,i,s,h){const a=void 0===this._layer||h;return e("div",{class:"display-flex",id:this._getId(t)},"trash"===t?e("delete-button",{buttonType:"action",class:"display-flex",disabled:a,icon:t,id:"solutions-delete",ids:this._getIds(),layer:this._layer}):e("calcite-action",{appearance:"solid",disabled:a,id:t,onClick:s,text:i},e("calcite-button",{appearance:"transparent",iconStart:t,kind:"danger"},i)),this._getToolTip("bottom",t,i))}_getIds(){return this._table?.highlightIds?.toArray()}onTableNodeCreate=t=>{this._tableNode=t};async _getTable(t,i){this._layer&&(await this._layer.when((()=>{this._table=new this.FeatureTable({autoRefreshEnabled:this.enableAutoRefresh,layer:this._layer,view:this.mapView,columnReorderingEnabled:this.enableColumnReorder,editingEnabled:this._editEnabled&&this.enableInlineEdit,highlightEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},tableTemplate:{columnTemplates:i},container:t})})),await this._table.when((()=>{this._table.highlightIds.on("change",(t=>{this._handleOnChange(t)}));const t=this.reactiveUtils.watch((()=>this._table.size),(t=>{this._size=t}));this._table.viewModel.addHandles(t)})))}async _handleOnChange(t){const i=[...this._table.highlightIds.toArray()];if(this._skipOnChange)this._skipOnChange=!1;else{if(!this._ctrlIsPressed&&!this._shiftIsPressed||this._selectionFromMap&&this._shiftIsPressed)if(this.selectedIds.length>0){this._skipOnChange=!0;const s=this.selectedIds.length>1&&1===t.removed.length?t.removed:i.filter((t=>this.selectedIds.indexOf(t)<0));this._clearSelection(),this.selectedIds=[...s],s.length>0?this._table.highlightIds.add(s[0]):this._skipOnChange=!1}else this.selectedIds=i.reverse();else if(this._ctrlIsPressed)this.selectedIds=i.reverse();else if(this._shiftIsPressed&&i?.length>0)if(this._skipOnChange=!0,this._previousCurrentId=this._currentId,this._currentId=[...i].reverse()[0],1===i.length)this._skipOnChange=!1;else if(this._previousCurrentId!==this._currentId){const t=this._table.activeSortOrders.reduce(((t,i)=>(t.push(`${i.fieldName} ${i.direction}`),t)),[]),s=await r(0,this._layer,[],t);let e=!1;const h=this._table.viewModel.getObjectIdIndex(this._previousCurrentId),a=this._table.viewModel.getObjectIdIndex(this._currentId);this._skipOnChange=(h<a?h:a)+1!==(a>h?a:h);const o=s.reduce(((t,i)=>{const s=i;return s===this._currentId||s===this._previousCurrentId?(e=!e,t.indexOf(s)<0&&t.push(s)):e&&t.indexOf(s)<0&&t.push(s),t}),[]),l=h<a?o.reverse():o;this.selectedIds=[...new Set([...l,...this.selectedIds])],this._table.highlightIds.addMany(this.selectedIds.filter((t=>i.indexOf(t)<0)))}this._finishOnChange()}this._currentId=[...this._table.highlightIds.toArray()].reverse()[0],this._selectionFromMap=!1}_finishOnChange(){this._showOnlySelected&&(this._featuresSelected()?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this.selectedIds)}_resetColumnTemplates(){const t=this._getColumnTemplates(this._layer?.id,this._layer?.fields),i=t?.some(((t,i)=>JSON.stringify(this._table?.tableTemplate.columnTemplates[i])!==JSON.stringify(t)));if(this._table&&t&&(i||!this._columnsInfo)){this._table.tableTemplate=new this.TableTemplate({columnTemplates:t});const i=t.map((t=>t.fieldName));this._initColumnsInfo(i)}}async _resetTable(){if(this._loaded=!1,this._clearSelection(),this._allIds=await d(this._layer),this._table)this._table.view=this.mapView,this._table.layer=this._layer;else{const t=this._getColumnTemplates(this._layer.id,this._layer?.fields);await this._getTable(this._tableNode,t)}await this._initLayerRefresh(),this._checkEditEnabled(),this._table.editingEnabled=this._editEnabled&&this.enableInlineEdit,await this._table.when(),setTimeout((()=>{this._loaded||(console.log(`table.state: ${this._table.state}`),this.finishLoading())}),1e3),await this.reactiveUtils.once((()=>"loaded"===this._table.state)).then((async()=>{await this.finishLoading()}))}async finishLoading(){try{this._loaded=!0,this._table.highlightIds.removeAll(),this._table.clearSelectionFilter(),this._resetColumnTemplates(),this._showOnlySelected=!1,await this._handleDefaults(),await this._sortTable(),this._initToolInfos(),this._updateToolbar()}catch(t){console.log(t)}}async _initLayerRefresh(){this._refreshHandle&&this._refreshHandle.remove(),this._refreshHandle=this._layer.on("refresh",(t=>{t.dataChanged&&(this._skipOnChange=!0,this._updateAllIds())}))}async _updateAllIds(){this._allIds=await d(this._layer),this.selectedIds=this.selectedIds.filter((t=>this._allIds.indexOf(t)>-1)),await this._refresh()}async _handleDefaults(){if(!this._defaultOidHonored&&this.defaultOid?.length>0&&this.defaultOid[0]>-1&&this._table&&(await this._selectDefaultFeature(this.defaultOid),this._defaultOidHonored=!0,this.defaultOid=void 0,this._showOnlySelected=!1,this._toggleShowSelected()),!this._defaultGlobalIdHonored&&this.defaultGlobalId?.length>0&&this._table){const t=await p(this.defaultGlobalId,this._layer),i=t?.length>0?t.map((t=>t.getObjectId())):void 0;i&&await this._selectDefaultFeature(i),this._defaultGlobalIdHonored=!0,this.defaultGlobalId=void 0,this._showOnlySelected=!1,this._toggleShowSelected()}}_initColumnsInfo(t){const i=this._table?.columns.reduce(((i,s)=>((!t||t?.indexOf(s.name)>-1)&&(i[s.name]=!s.hidden),i)),{}),s=this._table?.columns.map((t=>t.name));(t?t.filter((t=>s.indexOf(t)<0)):[]).forEach((t=>{i[t]=!0})),this._columnsInfo=t?t.reduce(((t,s)=>(t[s]=i[s],t)),{}):i}async _selectDefaultFeature(t){t.length>0&&this._table.highlightIds.addMany(t)}_checkEditEnabled(){this._editEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsUpdate,this._deleteEnabled=this._layer.editingEnabled&&this._layer.capabilities.operations.supportsDelete}async _sortTable(){let t,i=this._layer?.objectIdField,s="desc";this.mapInfo?.layerOptions?.layers?.length>0&&this._layer?.id&&(t=this.mapInfo.layerOptions.layers.filter((t=>t.id===this._layer.id)),t&&t.length>0&&(t=t[0],t.sortField&&t.fields?.includes(t.sortField)&&(i=t.sortField),s=t?.sortOrder?t.sortOrder:"desc")),this._table&&this._layer&&(await this._table.when(),await this._layer.when((()=>{this._table.sortColumn(i,s)})))}_forceShowHide(){this._showHideDropdown&&(this._showHideDropdown.open=this._showHideOpen),this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_closeShowHide(){this._showHideOpen=!1}_handleDocumentClick(t){const i=t.target?.id;i.startsWith("layer-table-")?this._moreDropdown.open=!0:this._showHideOpen&&Object.keys(this._columnsInfo).indexOf(i)<0&&"chevron-right"!==i&&(this._closeShowHide(),this._moreDropdown&&(this._moreDropdown.open=!1),this._showHideDropdown&&(this._showHideDropdown.open=!1))}_handleKeyDown(t){this._ctrlIsPressed=t.ctrlKey,this._shiftIsPressed=t.shiftKey}_handleKeyUp(t){this._ctrlIsPressed=t.ctrlKey,this._shiftIsPressed=t.shiftKey}_filterModal(){return e("calcite-modal",{"aria-labelledby":"modal-title",class:"modal",kind:"brand",onCalciteModalClose:()=>{this._closeFilter()},open:this._filterOpen,widthScale:"s"},e("div",{class:"display-flex align-center",id:"modal-title",slot:"header"},this._translations?.filter?.replace("{{title}}",this._layer?.title)),e("div",{slot:"content"},e("instant-apps-filter-list",{autoUpdateUrl:!1,closeBtn:!0,closeBtnOnClick:async()=>this._closeFilter(),comboboxOverlayPositioning:"fixed",layerExpressions:this._layerExpressions,onFilterListReset:()=>{this._handleFilterListReset()},onFilterUpdate:()=>{this._handleFilterUpdate()},ref:t=>this._filterList=t,view:this.mapView,zoomBtn:!1})))}async _handleFilterListReset(){this._filterActive=!1,this._updateShareUrl(),await this._searchFullText()}async _handleFilterUpdate(){const t=this._layer.definitionExpression;if(this._floorExpression){const i=new RegExp(`${this._floorField} = ['].+[']`,"gm");this._layer.definitionExpression=t&&this._floorField&&t.indexOf(`${this._floorField} = '`)>-1?t.replace(i,this._floorExpression):t?`${t} AND (${this._floorExpression})`:this._floorExpression}this._filterActive=this._definitionExpression!==this._layer.definitionExpression&&(!this._floorExpression||this._layer.definitionExpression!==this._floorExpression),this._updateShareUrl(),await this._searchFullText()}async _closeFilter(){this._filterOpen&&(this._allIds=await d(this._layer),this._filterOpen=!1)}async _mapClicked(t){const i={include:this._layer},s=await this.mapView.hitTest(t.screenPoint,i);s.results.length>0?(s.results.forEach((t=>{const i=t.graphic.getObjectId();this._table.highlightIds.indexOf(i)<0&&(this._selectionFromMap=!0,this._table.highlightIds.add(i))})),this._showOnlySelected&&this._table.filterBySelection()):this._clearSelection()}_selectAll(){const t=this._allIds;this._table.highlightIds.removeAll(),this._skipOnChange=!0,this._table.highlightIds.addMany(t),this.selectedIds=t,this._finishOnChange(),this._selectAllActive=!0}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){this.selectedIds=[],this._table?.highlightIds.removeAll(),this._table?.rowHighlightIds.removeAll(),this._finishOnChange()}_toggleFilter(){this._filterOpen=!this._filterOpen}_initLayerExpressions(){const t=this.mapInfo?.filterConfig?.layerExpressions;this._layerExpressions=t?t.filter((t=>t.id===this._layer?.id)):[],this._filterList.layerExpressions=this._layerExpressions,this._filterActive=this._layerExpressions.filter((t=>t.expressions.filter((t=>t.active)).length>0)).length>0}_switchSelected(){const t=[...this.selectedIds];this._table.highlightIds.removeAll();const i=this._allIds.reduce(((i,s)=>(t.indexOf(s)<0&&i.push(s),i)),[]).sort(((t,i)=>t-i));this._skipOnChange=!0,this._table.highlightIds.addMany(i),this.selectedIds=i,this._finishOnChange()}async _exportToCSV(){const t={},i=this._table.highlightIds.toArray();t[this._layer.id]={selectionSetNames:[this._layer.title],ids:i,layer:this._layer};const s=this._table.columns.toArray().reduce(((t,i)=>(i.hidden||t.push(i.name.toLocaleLowerCase()),t)),[]);this._updateToolInfoLoading("export",!0),this._csvExporting=!0,await f(null,t,!1,!1,!0,s,!0,!0),this._updateToolInfoLoading("export",!1),this._csvExporting=!1}_updateToolInfoLoading(t,i){this._toolInfos.some((s=>{if(s?.icon===t)return s.loading=i,!0}))}async _refresh(){await this._table.refresh(),this._allIds=await d(this._layer),this.featureSelectionChange.emit(this.selectedIds)}async _zoom(){if(this._layer){const t=await b(this.mapView,this._layer.id);await c(this.selectedIds,t,this.mapView,!0,void 0,this.zoomToScale)}}async _layerSelectionChanged(t){const i=t.detail[0];if(i!==this._layer?.id||this._featuresEmpty()){this._fetchingData=!0;const t=await l(this.mapView,i);t&&await t.when((()=>{this._layer=t,this._getFullTextSearchInfo()}))}this._fetchingData=!1}_getColumnTemplates(t,i){let s;this.mapInfo?.layerOptions?.layers.some((i=>{if(i.id===t)return s=i,!0}));const e=s?.fields&&s?.fieldOrder?s.fieldOrder.filter((t=>s.fields.indexOf(t)>-1)):void 0;let h;return i&&(h=s&&s?.fields?i.reduce(((t,i)=>{if(s.fields.indexOf(i.name)>-1){const s={type:"field",fieldName:i.name,label:i.alias,menuConfig:this._getMenuConfig(i.name)};t.push(s)}return t}),[]).sort(this._sortFields.bind(this,s?.fieldOrder)):i.map((t=>({type:"field",fieldName:t.name,label:t.alias,menuConfig:this._getMenuConfig(t.name)})))),e?h?.sort(this._sortFields.bind(this,e)):h}_sortFields(t,i,s){return t?.indexOf(i.fieldName)-t.indexOf(s.fieldName)}_getMenuConfig(t){return{items:[{label:this._translations.hideField,icon:"view-hide",autoCloseMenu:!0,clickFunction:()=>{this._handleHideClick(t)}}]}}_handleHideClick(t){this._columnsInfo[t]=!1,this._table.hideColumn(t),this._table.tableTemplate.columnTemplates.forEach((i=>{i.fieldName===t&&(i.visible=!1)}))}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}static get watchers(){return{appLayout:["appLayoutWatchHandler"],defaultOid:["defaultOidWatchHandler"],defaultGlobalId:["defaultGlobalIdWatchHandler"],enableCSV:["enableCSVWatchHandler"],enableInlineEdit:["enableInlineEditWatchHandler"],enableShare:["enableShareWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"],mapHidden:["mapHiddenWatchHandler"],isMobile:["isMobileWatchHandler"],mapInfo:["mapInfoWatchHandler"],mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"],selectedIds:["selectedIdsWatchHandler"]}}};function v(t){return function(t){return-1!==t?.indexOf("http://")}(t)?t.replace(/^http:\/\//,"https://"):t}m.style=':host{display:block}.height-full{height:100%}.height-full-adjusted{height:calc(100% - 20px)}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-color-border-2)}.border-end{border-inline-end:1px solid var(--calcite-color-border-2)}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-5{padding:5px}.padding-end-1{padding-inline-end:1rem}.height-51-px{height:51px}.height-50-px{height:50px}.bottom-left{position:absolute;left:0;bottom:0;padding-left:5px}html[dir="rtl"] .bottom-left{position:absolute;right:0;bottom:0;padding-right:5px}.height-19{height:19px}.background{background-color:var(--calcite-color-background)}.text-color{color:var(--calcite-color-text-1)}.align-center{align-items:center}.danger-color{color:var(--calcite-color-status-danger)}.esri-feature-table vaadin-grid{border:none !important}vaadin-grid-cell-content{font-size:14px !important;color:var(--calcite-color-text-3) !important}.share-action{position:absolute;right:0}html[dir="rtl"] .share-action{left:0}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.instant-app-share{height:50px !important;display:inline-flex}.border-top{border-top:1px solid var(--calcite-color-border-2)}.modal{--calcite-modal-content-padding:0}.esri-feature-table__table-container{height:100%}.search-container{background-color:var(--calcite-color-foreground-1) !important}.search{--calcite-color-border-input:var(--calcite-color-border-3);width:60%;padding:10px}.delete-red{--calcite-icon-color:var(--calcite-color-status-danger);--calcite-color-text-1:var(--calcite-color-status-danger);--calcite-color-text-3:var(--calcite-color-status-danger)}';const y=class{constructor(s){t(this,s),this.mapChanged=i(this,"mapChanged",7),this.beforeMapChanged=i(this,"beforeMapChanged",7),this.toggleFilter=i(this,"toggleFilter",7),this.clearSelection=i(this,"clearSelection",7),this.appLayout=void 0,this.appProxies=void 0,this.defaultWebmapId="",this.defaultLayerId=void 0,this.enableHome=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableShare=!1,this.enableSingleExpand=!0,this.enableSearch=void 0,this.enableBasemap=void 0,this.basemapConfig=void 0,this.hidden=void 0,this.homeZoomIndex=3,this.homeZoomPosition="top-left",this.homeZoomToolsSize="m",this.mapInfos=[],this.mapWidgetsIndex=0,this.mapWidgetsPosition="top-right",this.mapWidgetsSize="m",this.mapView=void 0,this.stackTools=!0,this.theme=void 0,this.toolOrder=void 0,this.isMapLayout=void 0,this.shareIncludeEmbed=void 0,this.shareIncludeSocial=void 0,this.selectedFeaturesIds=void 0,this.selectedLayer=void 0,this.zoomToScale=void 0,this.onlyShowUpdatableLayers=void 0,this.isMobile=void 0,this.mapInfo=void 0,this._translations=void 0,this._searchConfiguration=void 0,this._webMapInfo=void 0,this._showHideOpen=!1,this._toolInfos=void 0,this._controlsThatFit=void 0}get el(){return s(this)}esriConfig;Home;MapView;WebMap;_defaultWebmapHonored=!1;_homeWidget;_loadedId="";_mapDiv;_mapPicker;_mapTools;_moreDropdown;_mapListExpanded=!1;_filterActive=!1;_definitionExpression;_mapLayerPicker;_resizeObserver;_shareNode;_showHideDropdown;_toolbar;_timeout;_toolbarSizeInfos;_defaultVisibleToolSizeInfos;_observerSet=!1;appLayoutWatchHandler(){this._updateShareUrl()}enableHomeWatchHandler(){this._initHome()}enableShareWatchHandler(){this._toolbar&&this._updateToolbar()}async mapViewWatchHandler(){this.mapView&&this._updateShareUrl()}async selectedLayerWatchHandler(){await(this.selectedLayer?.when((async()=>{this._definitionExpression=this.selectedLayer.definitionExpression})))}async selectedFeaturesIdsWatchHandler(){this._updateShareUrl(),this._validateEnabledActions()}_controlsThatFitWatchHandler(){const t=this._controlsThatFit?this._controlsThatFit.reduce(((t,i)=>(t.push(i.id),t)),[]):[];this._toolInfos=this._toolInfos?.map((i=>{if(i&&this._controlsThatFit){const s=this._getId(i.icon);return i.isOverflow=t.indexOf(s)<0,i}}))}async resetFilter(){this._filterActive=!1,this._updateShareUrl()}async updateFilterState(){this._filterActive=this._definitionExpression!==this.selectedLayer.definitionExpression,this._updateShareUrl()}async updateLayer(){this._mapLayerPicker.updateLayer()}mapChanged;beforeMapChanged;toggleFilter;clearSelection;async mapInfoChange(t){await this._loadMap(t.detail)}noLayersFound(){this.selectedLayer=void 0,this.selectedFeaturesIds=[]}layerSelectionChange(){setTimeout((()=>{this._initToolInfos()}),50)}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initToolInfos(),this._resizeObserver||(this._resizeObserver=new ResizeObserver((()=>this._updateToolbar())))}render(){const t=this.isMapLayout?"display-flex height-49-px":"",i=this.hidden?"visibility-hidden-1":"",s="dark"===this.theme?"calcite-mode-dark":"calcite-mode-light",a=this.mapInfos?.length>1||this.isMapLayout?"map-height":"height-full",o=this.isMapLayout?"":"display-none";return this._validateActiveActions(),e(h,{key:"d4e5ff9c4aa08a4effe19a54a1a48463cb8b3774"},e("div",{key:"51ee35d267d5ef081a4c160de3e03b1790d328c8",class:`${t} width-full`,ref:t=>this._toolbar=t},this._getActionBar(),!this.isMobile&&this.isMapLayout&&this._getDropdown("more-table-options"),this.enableShare&&!this.isMobile&&this.isMapLayout?this._getShare("share"):void 0),e("calcite-progress",{key:"70a5c232aae8a9ff6740fd326e6ba6fe61936541",class:o,value:0}),e("div",{key:"c399acc019d7f0a16dbb644eee4cfdd1e6e83c7c",class:`${a} ${i}`,ref:t=>this._mapDiv=t}),e("map-tools",{key:"c6a88ccfa140fe9b0d059f74b9254af6ef0997ce",basemapConfig:this.basemapConfig,class:`box-shadow ${s}`,enableBasemap:this.enableBasemap,enableFloorFilter:this.enableFloorFilter,enableFullscreen:this.enableFullscreen,enableHome:this.enableHome,enableLegend:this.enableLegend,enableSearch:this.enableSearch,enableSingleExpand:this.enableSingleExpand,homeZoomToolsSize:this.homeZoomToolsSize,mapView:this.mapView,mapWidgetsSize:this.mapWidgetsSize,position:this.mapWidgetsPosition,ref:t=>this._mapTools=t,searchConfiguration:this._searchConfiguration,stackTools:this.stackTools,toolOrder:this.toolOrder}))}async componentDidRender(){this.isMapLayout&&this._updateToolbar(),document.onclick=t=>this._handleDocumentClick(t)}async componentDidLoad(){this.isMobile||this._observerSet||(this._resizeObserver.observe(this._toolbar),this._observerSet=!0),this._updateShareUrl()}async _initModules(){const[t,i,s,e]=await o(["esri/WebMap","esri/views/MapView","esri/widgets/Home","esri/config"]);this.WebMap=t,this.MapView=i,this.Home=s,this.esriConfig=e}async _loadMap(t){const i=!this._defaultWebmapHonored&&this.defaultWebmapId,s=this.mapInfos?.filter((t=>t.id===this.defaultWebmapId)),e=JSON.stringify(t)!==JSON.stringify(this._webMapInfo);this._webMapInfo=i&&s?s[0]:!t?.id&&this.mapInfos.length>0?this.mapInfos[0]:t;const h=this._webMapInfo.id,a=i&&t?.id===this.defaultWebmapId;if(this._loadedId!==h&&!i||a){const t=new this.WebMap({portalItem:{id:h}});this.appProxies&&(await t.load(),await(o=t,l=this.esriConfig,n=this.appProxies,n&&n.forEach((t=>{o.allLayers.forEach((i=>{i&&i.url===t.sourceUrl&&(i.url=v(t.proxyUrl),i.portalItem&&i.portalItem.when((()=>{i.portalItem.url=v(t.proxyUrl)})),l.request?.interceptors?.push({urls:t.sourceUrl,before:i=>{i.url&&i.url===t.sourceUrl&&(i.url=v(t.proxyUrl))}}))}))})),o)),this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"center"}),this._loadedId=h,this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),await this.mapView.when((()=>{this._initHome(),this.mapView.ui.add(this._mapTools,{position:this.mapWidgetsPosition,index:this.mapWidgetsIndex}),this._defaultWebmapHonored=!!a||this._defaultWebmapHonored,this.mapChanged.emit({id:h,mapView:this.mapView})}))}else i?(this._defaultWebmapHonored=!0,this._mapPicker.setMapByID(h)):e&&(this._searchConfiguration=this._webMapInfo.searchConfiguration,this.beforeMapChanged.emit(),this.mapChanged.emit({id:h,mapView:this.mapView}));var o,l,n;this._updateShareUrl()}_updateToolbar(){this._timeout&&clearTimeout(this._timeout),!this.isMobile&&this._toolbar&&this._toolInfos&&(this._timeout=setTimeout((()=>{clearTimeout(this._timeout),this._setToolbarSizeInfos();const t=this._toolbar.offsetWidth;let i=this._toolbarSizeInfos.reduce(((t,i)=>t+i.width),0);const s=["solutions-more","solutions-map-layer-picker-container","map-picker","solutions-action-share"];if(i>t){if(this._toolbarSizeInfos.length>0){const e=[...this._toolbarSizeInfos].reverse().reduce(((e,h)=>(s.indexOf(h.id)<0&&(i>t?i-=h.width:e.push(h)),e)),[]).reverse();this._setControlsThatFit(e,s)}}else if(this._defaultVisibleToolSizeInfos){const e=this._toolbarSizeInfos.reduce(((t,i)=>(t.push(i.id),t)),[]);let h=!1;const a=[...this._defaultVisibleToolSizeInfos].reduce(((a,o)=>(!h&&s.indexOf(o.id)<0&&(e.indexOf(o.id)>-1||i+o.width<=t)?(e.indexOf(o.id)<0&&(i+=o.width),a.push(o)):s.indexOf(o.id)<0&&i+o.width>t&&(h=!0),a)),[]);this._setControlsThatFit(a,s)}}),250))}_setControlsThatFit(t,i){let s=JSON.stringify(t)!==JSON.stringify(this._controlsThatFit);const e=document.getElementById("solutions-action-bar");e?.childNodes?.forEach((t=>{i.indexOf(t.id)<0&&!s&&(s=this._controlsThatFit.map((t=>t.id)).indexOf(t.id)<0)})),s&&(this._controlsThatFit=[...t])}_setToolbarSizeInfos(){let t=!1;this._toolbarSizeInfos=[],this._toolbar.childNodes.forEach(((i,s)=>{0===s?i.childNodes.forEach((i=>{this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0)})):i.referenceElement||(this._toolbarSizeInfos.push({id:i.id,width:i.offsetWidth}),t||(t=i.offsetWidth>0))})),t&&!this._defaultVisibleToolSizeInfos&&(this._defaultVisibleToolSizeInfos=[...this._toolbarSizeInfos])}_getActionBar(){const t=this.mapInfos?.length>1?"":"display-none",i=this.isMapLayout?"display-flex":"display-block",s=this.isMobile?"border-top":"",h=this.isMapLayout?"":"display-none";return e("calcite-action-bar",{class:i,expandDisabled:!0,expanded:!0,id:this._getId("bar"),layout:"horizontal"},e("map-picker",{class:t,isMapLayout:this.isMapLayout,mapInfos:this.mapInfos,ref:t=>this._mapPicker=t}),e("div",{class:`mapView-header display-flex ${h}`},e("div",{class:`border-end ${i} ${s}`,id:"solutions-map-layer-picker-container"},this.mapView&&e("map-layer-picker",{appearance:"transparent",defaultLayerId:this.defaultLayerId,display:"inline-flex",height:50,isMobile:this.isMobile,mapView:this.mapView,onlyShowUpdatableLayers:this.onlyShowUpdatableLayers,placeholderIcon:"layers",ref:t=>this._mapLayerPicker=t,scale:"l",selectedIds:this.selectedLayer?[this.selectedLayer.id]:[],showSingleLayerAsLabel:!0,showTables:!0,showTablesDisabled:!0,type:"dropdown"}))),!this.isMobile&&this.isMapLayout?this._getActions():void 0)}_getDropdown(t){const i=this._getDropdownItems();return i.length>0?e("calcite-dropdown",{closeOnSelectDisabled:!0,disabled:void 0===this.selectedLayer,id:"solutions-more",onCalciteDropdownBeforeClose:()=>this._forceShowHide(),ref:t=>this._moreDropdown=t},e("calcite-action",{appearance:"solid",id:t,label:"",onClick:()=>this._closeShowHide(),slot:"trigger",text:""},e("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),e("calcite-dropdown-group",{"selection-mode":"none"},i.map((t=>e("calcite-dropdown-group",{class:t.disabled?"disabled":"",selectionMode:"none"},e("calcite-dropdown-item",{disabled:t.loading,iconStart:t.icon,id:"solutions-subset-list",onClick:t.func},t.loading?e("div",{class:"display-flex"},e("calcite-loader",{inline:!0,label:t.label,scale:"m"}),t.label):t.label)))))):void 0}_getShare(t){return e("div",{class:"share-action",id:this._getId(t)},e("instant-apps-social-share",{autoUpdateShareUrl:!1,class:"instant-app-share",embed:this.shareIncludeEmbed,popoverButtonIconScale:"s",ref:t=>{this._shareNode=t,this._updateShareUrl()},scale:"m",shareButtonColor:"neutral",shareButtonType:"action",socialMedia:this.shareIncludeSocial,view:this.mapView}),this._getToolTip("bottom",t,this._translations.share))}_updateShareUrl(){const t=this._shareNode?.shareUrl;if(!t)return;const i=new URL(t);this._loadedId?i.searchParams.set("webmap",this._loadedId):i.searchParams.delete("webmap"),this.selectedLayer?.id?i.searchParams.set("layer",this.selectedLayer.id):i.searchParams.delete("layer"),this.selectedFeaturesIds?.length>0?i.searchParams.set("oid",this.selectedFeaturesIds.join(",")):i.searchParams.delete("oid"),i.searchParams.set("applayout",this.appLayout),this._shareNode.shareUrl=i.href}_closeShowHide(){this._showHideOpen=!1}_getDropdownItems(){return this._toolInfos?.filter((t=>t&&t.isOverflow))}_initToolInfos(){const t=this.selectedFeaturesIds?.length>0,i=this._hasFilterExpressions(),s=this.selectedFeaturesIds?.length>1&&!1;this._translations&&(this._toolInfos=[{active:!1,icon:"zoom-to-object",indicator:!1,label:this._translations.zoom,func:()=>this._zoom(),disabled:!t,isOverflow:!1},i?{active:!1,icon:"filter",indicator:!1,label:this._translations.filters,func:()=>this._toggleFilter(),disabled:!1,isOverflow:!1}:void 0,s?{active:!1,icon:"pencil",indicator:!1,label:this._translations.editMultiple,func:()=>alert(this._translations.editMultiple),disabled:!s,isOverflow:!1}:void 0,{active:!1,icon:"refresh",indicator:!1,label:this._translations.refresh,func:()=>this.selectedLayer.refresh(),disabled:!1,isOverflow:!1},{active:!1,icon:"erase",indicator:!1,label:this._translations.clearSelection,func:()=>this.clearSelection.emit(),disabled:!t,isOverflow:!1}],this._defaultVisibleToolSizeInfos=void 0)}_validateActiveActions(){const t=["filter"];this._toolInfos?.forEach((i=>{i&&t.indexOf(i.icon)>-1&&"filter"===i.icon&&(i.indicator=this._filterActive)}))}_validateEnabledActions(){const t=this.selectedFeaturesIds?.length>0,i=this.selectedFeaturesIds?.length>1&&this.selectedLayer?.capabilities?.operations?.supportsUpdate,s=["zoom-to-object","pencil","erase"];this._toolInfos?.forEach((e=>{e&&s.indexOf(e.icon)>-1&&(e.disabled="pencil"===e.icon?!i:!t)}))}_initHome(){if(this.enableHome){this._homeWidget=new this.Home({view:this.mapView}),this.mapView.ui.add(this._homeWidget,{position:this.homeZoomPosition,index:this.homeZoomIndex});const t="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";this._homeWidget.domNode.style.height=t,this._homeWidget.domNode.style.width=t}else this._homeWidget&&this.mapView.ui.remove(this._homeWidget)}_toggleShowHide(){this._showHideOpen=!this._showHideOpen}_forceShowHide(){this._moreDropdown&&(this._moreDropdown.open=this._showHideOpen)}_handleDocumentClick(t){const i=t.target?.id;"solutions-subset-list"===i?this._moreDropdown.open=!0:this._showHideOpen&&"solutions-subset-list"!==i&&"solutions-more"!==i&&"chevron-down"!==i&&this._moreDropdown&&(this._showHideOpen=!1,this._moreDropdown.open=!1),"MAP-PICKER"===t.target.tagName&&(this._mapListExpanded=!this._mapListExpanded,this._mapPicker.toggle(this._mapListExpanded)),"MAP-PICKER"!==t.target.tagName&&(this._mapListExpanded=!1,this._mapPicker.close())}async _zoom(){if(this.selectedLayer){const t=await b(this.mapView,this.selectedLayer.id);await c(this.selectedFeaturesIds,t,this.mapView,!0,void 0,this.zoomToScale)}}async _toggleFilter(){this.toggleFilter.emit()}_hasFilterExpressions(){let t;return this.mapInfo?.filterConfig?.layerExpressions&&this.selectedLayer?.id&&(t=this.mapInfo.filterConfig.layerExpressions.filter((t=>t.id===this.selectedLayer.id))),t?.length>0}_getActions(){const t=this._getActionItems();return t?.reduce(((t,i)=>(i&&!i.isOverflow&&t.push(this._getAction(i.active,i.icon,i.indicator,i.label,i.func,i.disabled,i.loading)),t)),[])}_getToolTip(t,i,s){return document.getElementById(i)?e("calcite-tooltip",{placement:t,"reference-element":"map-"+i},e("span",null,s)):void 0}_getActionItems(){return this._toolInfos?.filter((t=>t&&!t.isOverflow))}_getAction(t,i,s,h,a,o,l,n){const c=void 0===this.selectedLayer||o;return e("div",{class:"display-flex",id:this._getId(i),slot:n},e("calcite-action",{active:t,appearance:"solid",disabled:c,icon:i,id:"map-"+i,indicator:s,label:h,loading:l,onClick:a,text:h,textEnabled:!0}),this._getToolTip("bottom",i,h))}_getId(t){return`solutions-action-${t}`}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}static get watchers(){return{appLayout:["appLayoutWatchHandler"],enableHome:["enableHomeWatchHandler"],enableShare:["enableShareWatchHandler"],mapView:["mapViewWatchHandler"],selectedLayer:["selectedLayerWatchHandler"],selectedFeaturesIds:["selectedFeaturesIdsWatchHandler"],_controlsThatFit:["_controlsThatFitWatchHandler"]}}};y.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.map-height{height:calc(100% - 53px)}.height-full{height:100%}.height-49-px{height:49px}.box-shadow{box-shadow:none !important}.visibility-hidden-1{visibility:hidden;height:1px;}.display-none{display:none}.display-block{display:block}";export{u as card_manager,m as layer_table,y as map_card}
@@ -1,12 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,g as e,h as s,H as a}from"./p-4e6eb06e.js";import{l as n,g as h}from"./p-f4aadb3b.js";import{z as o}from"./p-621ad249.js";import{f as c}from"./p-80cb7c73.js";import{s as l}from"./p-51c6e6fe.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-7d542581.js";import"./p-91371f97.js";import"./p-dc9d4be3.js";const r=class{constructor(e){t(this,e),this.bufferComplete=i(this,"bufferComplete",7),this.distanceChanged=i(this,"distanceChanged",7),this.unitChanged=i(this,"unitChanged",7),this.appearance="text",this.distance=0,this.geometries=[],this.max=void 0,this.min=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this.disabled=!1,this._translations=void 0}get el(){return e(this)}_geometryEngine;_bufferTimeout;_unitElement;_units;geometriesWatchHandler(){this._buffer()}disabledWatchHandler(){this._buffer()}async getTranslatedUnit(t){return this._units||await this._defineTranslations(),this._units[t]}bufferComplete;distanceChanged;unitChanged;async componentWillLoad(){await this._defineTranslations(),await this._initModules()}render(){return s(a,{key:"fe60961aabf178fd32c4c85e8d52b9bc61a349d0"},"text"===this.appearance?this._getTextBoxDisplay():this._getSliderDisplay())}async _defineTranslations(){await this._getTranslations(),this._initTranslatedUnits()}async _initModules(){const[t]=await n(["esri/geometry/geometryEngine"]);this._geometryEngine=t}_initTranslatedUnits(){this._units={feet:this._translations.feet,meters:this._translations.meters,miles:this._translations.miles,kilometers:this._translations.kilometers}}_getUnits(){return Object.keys(this._units).map((t=>s("calcite-option",{label:this._units[t],selected:this.unit===t,value:t})))}_setDistance(t){const i=parseInt(t.target.value,10);this.distance!==i&&i>=this.min&&(this.distanceChanged.emit({oldValue:this.distance,newValue:i}),this.distance=i,this.distance>0?this._buffer():this.bufferComplete.emit(void 0))}_setUnit(t){this.unitChanged.emit({oldValue:this.unit,newValue:t}),this.unit=t,this._buffer()}_buffer(){this.disabled?this.bufferComplete.emit(void 0):(this._bufferTimeout&&clearTimeout(this._bufferTimeout),this._bufferTimeout=setTimeout((()=>{if(this.geometries?.length>0&&this.unit&&this.distance>0){const t=this.geometries[0].spatialReference,i=t.isWGS84||t.isWebMercator?this._geometryEngine.geodesicBuffer(this.geometries,this.distance,this.unit,this.unionResults):this._geometryEngine.buffer(this.geometries,this.distance,this.unit,this.unionResults);this.bufferComplete.emit(i)}}),400))}_getTextBoxDisplay(){return s("div",{class:"c-container"},s("calcite-input",{class:"padding-end-1 w-50",max:this.max&&this.max>0?this.max:void 0,min:this.min,"number-button-type":"vertical",onCalciteInputInput:t=>this._setDistance(t),placeholder:"0",type:"number",value:this.distance?this.distance.toString():void 0}),s("calcite-select",{class:"flex-1 w-50",label:"label",onCalciteSelectChange:()=>this._setUnit(this._unitElement.value),ref:t=>{this._unitElement=t}},this._getUnits()))}_getSliderDisplay(){return s("div",null,s("calcite-slider",{labelHandles:!0,max:this.max&&this.max>0?this.max:void 0,min:this.min,ticks:this.sliderTicks}))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}_testAccess(t,i){switch(t){case"_setUnit":return this._setUnit(i);case"_setDistance":return this._setDistance(i)}return null}static get watchers(){return{geometries:["geometriesWatchHandler"],disabled:["disabledWatchHandler"]}}};r.style=':host{display:block}.c-container{display:inline-flex}.flex-1{flex:"1"}.padding-end-1{padding-inline-end:1rem}.w-50{width:50%}';
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
10
- * v2.13.0
11
- */
12
- const d={valid:"check-circle",invalid:"exclamation-mark-triangle",idle:"information"},p=class{constructor(i){t(this,i),this.icon=void 0,this.iconFlipRtl=!1,this.scale="m",this.status="idle"}handleIconEl(){this.requestedIcon=o(d,this.icon,this.status)}connectedCallback(){this.requestedIcon=o(d,this.icon,this.status)}render(){return s(a,{key:"c7d1b37721cec28dee1020b81ff66dee7fc8bc44","calcite-hydrated-hidden":this.el.hidden},this.renderIcon(this.requestedIcon),s("slot",{key:"7147d81e906765c154b4a61e31706a72c1ef3ae0"}))}renderIcon(t){if(t)return s("calcite-icon",{class:"calcite-input-message-icon",flipRtl:this.iconFlipRtl,icon:t,scale:"s"})}get el(){return e(this)}static get watchers(){return{status:["handleIconEl"],icon:["handleIconEl"]}}};p.style=":host{box-sizing:border-box;display:flex;block-size:auto;inline-size:100%;align-items:center;font-weight:var(--calcite-font-weight-medium);color:var(--calcite-color-text-1);opacity:1;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;--calcite-input-message-spacing-value:0.25rem;margin-block-start:var(--calcite-input-message-spacing-value)}.calcite-input-message-icon{pointer-events:none;display:inline-flex;flex-shrink:0;transition:background-color, block-size, border-color, box-shadow, color, inset-block-end, inset-block-start, inset-inline-end, inset-inline-start inset-size, opacity, outline-color, transform var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;margin-inline-end:0.5rem}:host([status=invalid]) .calcite-input-message-icon{color:var(--calcite-color-status-danger)}:host([status=warning]) .calcite-input-message-icon{color:var(--calcite-color-status-warning)}:host([status=valid]) .calcite-input-message-icon{color:var(--calcite-color-status-success)}:host([status=idle]) .calcite-input-message-icon{color:var(--calcite-color-brand)}:host([scale=s]){font-size:var(--calcite-font-size--3);line-height:0.75rem}:host([scale=m]){font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=l]){font-size:var(--calcite-font-size--1);line-height:1rem}:host([hidden]){display:none}[hidden]{display:none}";const g=class{constructor(e){t(this,e),this.selectionLoadingChange=i(this,"selectionLoadingChange",7),this.sketchGraphicsChange=i(this,"sketchGraphicsChange",7),this.drawUndo=i(this,"drawUndo",7),this.drawRedo=i(this,"drawRedo",7),this.active=!1,this.drawMode=c.SKETCH,this.editGraphicsEnabled=!0,this.graphics=void 0,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.redoEnabled=!1,this.undoEnabled=!1,this._translations=void 0,this._selectionMode=void 0}get el(){return e(this)}GraphicsLayer;SketchViewModel;Sketch;_sketchGraphicsLayer;_sketchViewModel;_sketchWidget;_sketchElement;graphicsWatchHandler(t,i){t&&t.length>0&&JSON.stringify(t)!==JSON.stringify(i)&&this._sketchGraphicsLayer&&(this._updateGraphicsSymbols(t),this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(t))}mapViewWatchHandler(t,i){t&&t!==i&&this._init()}async clear(){this._clearSketch()}async updateGraphics(){this._updateGraphics()}selectionLoadingChange;sketchGraphicsChange;drawUndo;drawRedo;async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this._sketchWidget.cancel(),this._clearSketch()}render(){const t=this.drawMode===c.SKETCH?"display-none":"esri-widget esri-sketch__panel border-left esri-sketch__section";return s(a,{key:"c6717ea80242f622168f49efeaf2cebf497ca09e"},s("div",{key:"2dd805c704381cb411d69b757072371d91fb243d",class:this.drawMode===c.SKETCH?"border":"border esri-widget esri-sketch__panel"},s("div",{key:"28b81cb37f3e11f66656195fc10b4c170f8d8fe9",ref:t=>{this._sketchElement=t}}),s("div",{key:"a6de7ee6dbf4f02eb355c032c7bd9bf4ec4426e9",class:t},s("calcite-action",{key:"2efeab5db057e1657c3639a39ae4d4150d331776",disabled:!this.undoEnabled,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),s("calcite-action",{key:"770693e30a6cfb58f593bb471342ea34556fc8d4",disabled:!this.redoEnabled,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo}))))}async _initModules(){const[t,i,e]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=t,this.Sketch=i,this.SketchViewModel=e}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initSketch())}_initGraphicsLayer(){const t=this._translations.sketchLayer,i=this.mapView.map.layers.findIndex((i=>i.title===t));i>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(i):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:t,listMode:"hide"}),l.managedLayers[t]="sketch",this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initSketch(){const t={layer:this._sketchGraphicsLayer,view:this.mapView,defaultCreateOptions:{mode:"hybrid"},defaultUpdateOptions:{preserveAspectRatio:!1,enableScaling:!1,enableRotation:!1,tool:"reshape",toggleToolOnClick:!1}};this._sketchWidget=new this.Sketch({...t,container:this._sketchElement,creationMode:"single",visibleElements:{duplicateButton:!1,selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1,settingsMenu:this.drawMode===c.SKETCH}}),this._sketchViewModel=new this.SketchViewModel({...t}),this._sketchWidget.viewModel.polylineSymbol=this.polylineSymbol,this._sketchWidget.viewModel.pointSymbol=this.pointSymbol,this._sketchWidget.viewModel.polygonSymbol=this.polygonSymbol;let i=!1;this._sketchWidget.on("create",(t=>{"complete"===t.state&&(this.graphics=[t.graphic],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}),this.drawMode===c.REFINE&&(i=!0,this._sketchWidget.viewModel.create(t.tool))),"cancel"===t.state&&this.drawMode===c.REFINE&&i&&(i=!i,this._sketchWidget.viewModel.create(t.tool))})),this._sketchWidget.on("update",(t=>{if(this.editGraphicsEnabled){const i=t?.toolEventInfo?.type;"reshape-stop"!==i&&"move-stop"!==i||(this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1}))}else this._sketchWidget.viewModel.cancel(),this._sketchViewModel.cancel()})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("undo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})})),this._sketchWidget.on("redo",(t=>{this.graphics=t.graphics,this.sketchGraphicsChange.emit({graphics:this.graphics,useOIDs:!1})}))}_clearSketch(){this._sketchWidget?.viewModel.cancel(),this.graphics=[],this._sketchGraphicsLayer?.removeAll()}_undo(){this.drawUndo.emit()}_redo(){this.drawRedo.emit()}_updateGraphics(){setTimeout((()=>{1===this.graphics.length&&this._sketchWidget.update(this.graphics,{tool:"reshape",enableRotation:!1,enableScaling:!1,preserveAspectRatio:!1,toggleToolOnClick:!1})}),100)}_updateGraphicsSymbols(t){const i=t[0].geometry.type,e="point"===i?this.pointSymbol:"polyline"===i?this.polylineSymbol:"polygon"===i?this.polygonSymbol:void 0;e&&t.forEach((t=>t.symbol=e))}async _getTranslations(){const t=await h(this.el);this._translations=t[0]}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};g.style=':host{display:block}.border{outline:1px solid var(--calcite-color-border-input)}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.margin-top-1{margin-top:1rem}.border-left{border-left:1px solid rgba(110, 110, 110, .3)}.border-left[dir="rtl"]{border-right:1px solid rgba(110, 110, 110, .3)}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next", "Helvetica Neue", Helvetica, Arial, sans-serif;line-height:1.3em;background-color:#fff;--esri-widget-padding-v:12px;--esri-widget-padding-h:15px;--esri-widget-padding:var(--esri-widget-padding-v) var(--esri-widget-padding-h)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row wrap;padding:0;justify-content:flex-start !important}.esri-sketch__section{align-items:center;display:flex;flex-flow:row wrap;padding:0 7px;margin:6px 0}';export{r as buffer_tools,p as calcite_input_message,g as map_draw_tools}
@@ -1,29 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,h as e,H as s,g as a,a as n}from"./p-4e6eb06e.js";import{c as o,d as l}from"./p-5e25a0b8.js";import{s as r,f as c,o as h,t as d}from"./p-621ad249.js";import{u as p,I as u}from"./p-d6902512.js";import{c as v,d as m,g as f,n as g,a as b,f as x,b as y}from"./p-895e7b9c.js";import{u as w,c as _,d as k,s as $}from"./p-efaa77a0.js";import{H as C}from"./p-b13aca6a.js";import{c as D,s as z,a as E}from"./p-ad9d1221.js";import{o as I}from"./p-c7f8b7f0.js";import{d as L,f as P,c as F,a as S,r as R,b as A,F as j}from"./p-f746ec20.js";import{d as O,g as M,a as T,b as B,s as N,c as H,e as W,f as U,i as V}from"./p-5d2cd0a4.js";import{i as q}from"./p-4f82eb55.js";import{s as K,c as Z,d as G,H as Q}from"./p-6adaac20.js";import{n as Y}from"./p-233f219c.js";import{c as J,d as X}from"./p-d25fc2c2.js";import{c as tt,d as it,a as et}from"./p-4253e9f1.js";import{g as st}from"./p-7d542581.js";import{g as at}from"./p-4a291f79.js";import{V as nt}from"./p-745efeab.js";import{s as ot}from"./p-f0c96a6a.js";import{l as lt}from"./p-4cd4cb85.js";import{g as rt}from"./p-5ff711ee.js";import{g as ct}from"./p-a9a72626.js";import"./p-ff336351.js";import"./p-91371f97.js";import"./p-c8d3207e.js";import"./p-a02e2069.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
10
- * v2.13.0
11
- */const ht="content",dt="toggle",pt="header",ut="container",vt="header",mt="header--has-text",ft="icon",gt="icon-end-container",bt="invalid",xt="status-icon",yt="valid",wt="control",_t="header-menu-actions",kt="icon",$t={opened:"chevron-up",closed:"chevron-down",valid:"check-circle",invalid:"exclamation-mark-triangle"},Ct=class{constructor(e){t(this,e),this.calciteBlockBeforeClose=i(this,"calciteBlockBeforeClose",6),this.calciteBlockBeforeOpen=i(this,"calciteBlockBeforeOpen",6),this.calciteBlockClose=i(this,"calciteBlockClose",6),this.calciteBlockOpen=i(this,"calciteBlockOpen",6),this.calciteBlockToggle=i(this,"calciteBlockToggle",6),this.openTransitionProp="margin-top",this.onHeaderClick=()=>{this.open=!this.open,this.calciteBlockToggle.emit()},this.actionsEndSlotChangeHandler=t=>{this.hasEndActions=r(t)},this.handleContentStartSlotChange=t=>{this.hasContentStart=r(t)},this.collapsible=!1,this.disabled=!1,this.dragHandle=!1,this.heading=void 0,this.headingLevel=void 0,this.iconEnd=void 0,this.iconFlipRtl=void 0,this.iconStart=void 0,this.loading=!1,this.menuFlipPlacements=void 0,this.menuPlacement=L,this.open=!1,this.status=void 0,this.description=void 0,this.messages=void 0,this.messageOverrides=void 0,this.overlayPositioning="absolute",this.defaultMessages=void 0,this.effectiveLocale=void 0,this.hasContentStart=!1,this.hasEndActions=!1}openHandler(){I(this)}onMessagesChange(){}async setFocus(){await D(this),c(this.el)}onBeforeOpen(){this.calciteBlockBeforeOpen.emit()}onOpen(){this.calciteBlockOpen.emit()}onBeforeClose(){this.calciteBlockBeforeClose.emit()}onClose(){this.calciteBlockClose.emit()}effectiveLocaleChange(){w(this,this.effectiveLocale)}connectedCallback(){o(this),v(this),_(this),this.transitionEl=this.el}disconnectedCallback(){m(this),k(this),l(this)}async componentWillLoad(){await $(this),z(this),this.open&&I(this)}componentDidLoad(){E(this)}componentDidRender(){p(this)}renderScrim(){const{loading:t}=this,i=e("slot",null);return[t?e("calcite-scrim",{loading:t}):null,i]}renderLoaderStatusIcon(){const{loading:t,messages:i,status:s}=this,a=!!h(this.el,kt);return t?e("div",{class:ft,key:"loader"},e("calcite-loader",{inline:!0,label:i.loading})):s?e("div",{class:ft,key:"status-icon"},e("calcite-icon",{class:{[xt]:!0,[yt]:"valid"==s,[bt]:"invalid"==s},icon:$t[s],scale:"s"})):a?e("div",{class:ft,key:"icon-slot"},e("slot",{key:"icon-slot",name:kt})):null}renderActionsEnd(){return e("div",{class:"actions-end"},e("slot",{name:"actions-end",onSlotchange:this.actionsEndSlotChangeHandler}))}renderContentStart(){const{hasContentStart:t}=this;return e("div",{class:"content-start",hidden:!t},e("slot",{name:"content-start",onSlotchange:this.handleContentStartSlotChange}))}renderTitle(){const{heading:t,headingLevel:i,description:s}=this;return t||s?e("div",{class:"title"},e(C,{class:"heading",level:i},t),s?e("div",{class:"description"},s):null):null}renderIcon(t){const{iconFlipRtl:i}=this,s="start"===t?this.iconStart:this.iconEnd;if(s)return e("calcite-icon",{class:"start"===t?"icon--start":"icon--end",flipRtl:"both"===i||"start"===t?"start"===i:"end"===i,icon:s,key:s,scale:"s"})}render(){const{collapsible:t,el:i,loading:a,open:n,heading:o,messages:l,description:r,menuFlipPlacements:c,menuPlacement:p}=this,v=n?l.collapse:l.expand,m=e("header",{key:"439d2866f9c5f13cfd8020812203a6cdf86c964f",class:{[vt]:!0,[mt]:!(!o&&!r)},id:pt},this.renderIcon("start"),this.renderContentStart(),this.renderLoaderStatusIcon(),this.renderTitle()),f=!!h(i,wt),g=!!h(i,_t),b=n?$t.opened:$t.closed,x=e("div",{key:"a9721a9e145db53a215262190d2f7e46472edec6",class:"header-container"},this.dragHandle?e("calcite-handle",{label:o}):null,t?e("button",{"aria-controls":ht,"aria-describedby":pt,"aria-expanded":t?d(n):null,class:"toggle",id:dt,onClick:this.onHeaderClick,title:v},m,e("div",{class:gt},this.renderIcon("end"),e("calcite-icon",{class:"toggle-icon",icon:b,scale:"s"}))):this.iconEnd?e("div",null,m,e("div",{class:gt},this.renderIcon("end"))):m,f?e("div",{"aria-labelledby":pt,class:"control-container"},e("slot",{name:wt})):null,g?e("calcite-action-menu",{flipPlacements:c??["top","bottom"],label:l.options,overlayPositioning:this.overlayPositioning,placement:p},e("slot",{name:_t})):null,this.renderActionsEnd());return e(s,{key:"cdf7c69cc630466cfd4fb0078735f1e685fde512"},e(u,{key:"ae5b2a044fb337bb2c5c12bee2c9ed4b10e5c373",disabled:this.disabled},e("article",{key:"01c5c5499d62361cfe26d8b6a878034f0805787b","aria-busy":d(a),class:{[ut]:!0}},x,e("section",{key:"e72271e369055329e4447d15c2deec25599332ec","aria-labelledby":dt,class:"content",hidden:!n,id:ht},this.renderScrim()))))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange"]}}};Ct.style=':host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:flex;flex-shrink:0;flex-grow:0;flex-direction:column;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);padding:0px;transition-property:margin;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;transition-timing-function:cubic-bezier(0.215, 0.440, 0.420, 0.880);flex-basis:auto;transition-duration:var(--calcite-animation-timing)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.header{margin:0px;display:flex;align-content:space-between;align-items:center;fill:var(--calcite-color-text-2);color:var(--calcite-color-text-2)}.heading{margin:0px;padding:0px;font-weight:var(--calcite-font-weight-medium)}.header .heading{flex:1 1 auto;padding:0.5rem}.header{justify-content:flex-start}.header--has-text{padding:var(--calcite-spacing-md)}.header,.toggle{grid-area:header}.header-container{display:grid;align-items:stretch;grid-template:auto/auto 1fr auto auto;grid-template-areas:"handle header control menu actions-end";grid-column:header-start/actions-end;grid-row:1/2}.content-start,.icon,.icon--start,.icon--end{margin-inline-end:var(--calcite-spacing-md)}.icon calcite-loader{margin-inline-end:var(--calcite-spacing-xxxs)}.icon--start,.icon--end{color:var(--calcite-color-text-3)}.actions-end{grid-area:actions-end}.toggle{margin:0px;display:flex;cursor:pointer;flex-wrap:nowrap;align-items:center;justify-content:space-between;border-style:none;padding:0px;font-family:var(--calcite-font-family);outline-color:transparent;text-align:initial;background-color:transparent}.toggle:hover{background-color:var(--calcite-color-foreground-2)}.toggle:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-color-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-offset-invert-focus),\n 1\n )\n )\n )}calcite-loader[inline]{grid-area:control;align-self:center}calcite-handle{grid-area:handle}.title{margin:0px}.header .title .heading{padding:0px;font-size:var(--calcite-font-size--1);font-weight:var(--calcite-font-weight-medium);line-height:1.25;color:var(--calcite-color-text-2);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);word-wrap:break-word;word-break:break-word}.description{margin-block-start:0.125rem;padding:0px;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text-3);word-wrap:break-word;word-break:break-word}.icon{display:flex}.status-icon.valid{color:var(--calcite-color-status-success)}.status-icon.invalid{color:var(--calcite-color-status-danger)}@keyframes spin{0%{transform:rotate(0deg)}50%{transform:rotate(180deg)}100%{transform:rotate(360deg)}}.icon-end-container{display:flex;align-items:center;margin-inline-start:auto}.toggle-icon{align-self:center;justify-self:end;color:var(--calcite-color-text-3);transition-property:color;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);margin-inline-end:var(--calcite-spacing-md)}.toggle:hover .toggle-icon{color:var(--calcite-color-text-1)}.container{position:relative;display:flex;block-size:100%;flex-direction:column}.content{position:relative;min-block-size:0px;flex:1 1 0%}@keyframes in{0%{opacity:0}100%{opacity:1}}.content{animation:in var(--calcite-internal-animation-timing-slow) ease-in-out;padding-block:var(--calcite-block-padding, var(--calcite-spacing-sm));padding-inline:var(--calcite-block-padding, var(--calcite-spacing-md))}.content-start{display:flex;align-items:center;color:var(--calcite-color-text-3)}.control-container{margin:0px;display:flex;grid-area:control}calcite-action-menu{grid-area:menu}.actions-end{display:flex;align-items:stretch}:host([open]){margin-block:0.5rem}:host([open]) .header .title .heading{color:var(--calcite-color-text-1)}:host([hidden]){display:none}[hidden]{display:none}';
12
- /*!
13
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
- * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
15
- * v2.13.0
16
- */
17
- const Dt={dateStyle:"full"},zt={},Et={};async function It(t){const i=f(t);if(zt[i])return zt[i];Et[i]||(Et[i]=fetch(n(`./assets/date-picker/nls/${i}.json`)).then((t=>t.json())).catch((()=>(console.error(`Translations for "${i}" not found or invalid, falling back to english`),It("en")))));const e=await Et[i];return zt[i]=e,e}function Lt(t){return t.map(((t,i)=>O(t,1===i)))}const Pt=class{constructor(e){t(this,e),this.calciteDatePickerChange=i(this,"calciteDatePickerChange",6),this.calciteDatePickerRangeChange=i(this,"calciteDatePickerRangeChange",6),this.keyDownHandler=t=>{"Escape"===t.key&&this.resetActiveDates()},this.monthHeaderSelectChange=t=>{const i=new Date(t.detail);this.range?("end"===this.activeRange?this.activeEndDate=i:this.activeStartDate=i,this.mostRecentRangeValue=i):this.activeDate=i},this.monthActiveDateChange=t=>{const i=new Date(t.detail);this.range?("end"===this.activeRange?this.activeEndDate=i:this.activeStartDate=i,this.mostRecentRangeValue=i):this.activeDate=i},this.monthHoverChange=t=>{if(!this.range)return void(this.hoverRange=void 0);const{valueAsDate:i}=this,e=Array.isArray(i)&&i[0],s=Array.isArray(i)&&i[1],a=new Date(t.detail);if(this.hoverRange={focused:this.activeRange||"start",start:e,end:s},this.proximitySelectionDisabled)s&&e||!s&&a>=e?(this.hoverRange.focused="end",this.hoverRange.end=a):this.hoverRange=!s&&a<e?{focused:"start",start:a,end:e}:void 0;else if(e&&s){const t=M(a,e),i=M(a,s);i>0?(this.hoverRange.end=a,this.hoverRange.focused="end"):t<0||t>i?(this.hoverRange.start=a,this.hoverRange.focused="start"):(this.hoverRange.end=a,this.hoverRange.focused="end")}else e&&(a<e?this.hoverRange={focused:"start",start:a,end:e}:(this.hoverRange.end=a,this.hoverRange.focused="end"));t.stopPropagation()},this.monthMouseOutChange=()=>{this.hoverRange&&(this.hoverRange=void 0)},this.resetActiveDates=()=>{const{valueAsDate:t}=this;!Array.isArray(t)&&t&&t!==this.activeDate&&(this.activeDate=new Date(t)),Array.isArray(t)&&(t[0]&&t[0]!==this.activeStartDate&&(this.activeStartDate=new Date(t[0])),t[1]&&t[1]!==this.activeEndDate&&(this.activeEndDate=new Date(t[1])))},this.monthDateChange=t=>{const i=new Date(t.detail),e=T(i);if(!this.range&&e===T(this.valueAsDate))return;if(!this.range)return this.value=e||"",this.valueAsDate=i||null,this.activeDate=i||null,void this.calciteDatePickerChange.emit();const s=this.getStartDate(),a=this.getEndDate();if(!s||!a&&i<s)s&&this.setEndDate(new Date(s)),"end"==this.activeRange?this.setEndDate(i):this.setStartDate(i);else if(a)if(this.proximitySelectionDisabled)this.setStartDate(i),this.setEndDate(null);else if(this.activeRange)"end"==this.activeRange?this.setEndDate(i):this.setStartDate(i);else{const t=M(i,s),e=M(i,a);0===e||t<0?this.setStartDate(i):0===t||e<0?this.setEndDate(i):t<e?this.setStartDate(i):this.setEndDate(i)}else this.setEndDate(i);this.calciteDatePickerChange.emit()},this.activeDate=void 0,this.activeRange=void 0,this.value=void 0,this.headingLevel=void 0,this.valueAsDate=void 0,this.minAsDate=void 0,this.maxAsDate=void 0,this.min=void 0,this.max=void 0,this.numberingSystem=void 0,this.scale="m",this.range=!1,this.proximitySelectionDisabled=!1,this.messageOverrides=void 0,this.messages=void 0,this.activeEndDate=void 0,this.activeStartDate=void 0,this.dateTimeFormat=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.endAsDate=void 0,this.hoverRange=void 0,this.localeData=void 0,this.mostRecentRangeValue=void 0,this.startAsDate=void 0}activeDateWatcher(t){"end"===this.activeRange&&(this.activeEndDate=t)}valueAsDateWatcher(t){if(this.range&&Array.isArray(t)){const{activeStartDate:i,activeEndDate:e}=this,s=t[0],a=t[1];this.activeStartDate=i!==s&&s,this.activeEndDate=e!==a&&a}else t&&t!==this.activeDate&&(this.activeDate=t)}onMinChanged(t){this.minAsDate=O(t)}onMaxChanged(t){this.maxAsDate=O(t)}onMessagesChange(){}async setFocus(){await D(this),this.el.focus()}async reset(){this.resetActiveDates(),this.mostRecentRangeValue=void 0}connectedCallback(){v(this),_(this),Array.isArray(this.value)?this.valueAsDate=Lt(this.value):this.value&&(this.valueAsDate=O(this.value)),this.min&&(this.minAsDate=O(this.min)),this.max&&(this.maxAsDate=O(this.max))}disconnectedCallback(){m(this),k(this)}async componentWillLoad(){z(this),await this.loadLocaleData(),this.onMinChanged(this.min),this.onMaxChanged(this.max),await $(this)}componentDidLoad(){E(this)}render(){const t=B(this.range&&Array.isArray(this.valueAsDate)?this.valueAsDate[0]:this.valueAsDate,this.minAsDate,this.maxAsDate);let i=this.getActiveDate(t,this.minAsDate,this.maxAsDate);const a=this.range&&Array.isArray(this.valueAsDate)?B(this.valueAsDate[1],this.minAsDate,this.maxAsDate):null,n=this.getActiveEndDate(a,this.minAsDate,this.maxAsDate);return"end"!==this.activeRange&&("end"!==this.hoverRange?.focused||this.proximitySelectionDisabled&&!a)||!n||(i=n),this.range&&this.mostRecentRangeValue&&(i=this.mostRecentRangeValue),e(s,{key:"32213cf1e0848af340d9a7cdaf0838f88d04e0cb",onBlur:this.resetActiveDates,onKeyDown:this.keyDownHandler},this.renderCalendar(i,this.range&&this.activeRange&&"start"===this.activeRange&&a||this.maxAsDate,this.range&&this.activeRange?"start"===this.activeRange?this.minAsDate:t||this.minAsDate:this.minAsDate,t,a))}effectiveLocaleChange(){w(this,this.effectiveLocale)}valueHandler(t){Array.isArray(t)?this.valueAsDate=Lt(t):t&&(this.valueAsDate=O(t))}async loadLocaleData(){q()&&(g.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.localeData=await It(this.effectiveLocale),this.dateTimeFormat=b(this.effectiveLocale,Dt))}renderCalendar(t,i,s,a,n){return this.localeData&&[e("calcite-date-picker-month-header",{activeDate:t,headingLevel:this.headingLevel||2,localeData:this.localeData,max:i,messages:this.messages,min:s,onCalciteInternalDatePickerSelect:this.monthHeaderSelectChange,scale:this.scale,selectedDate:"end"===this.activeRange?n:a||new Date}),e("calcite-date-picker-month",{activeDate:t,dateTimeFormat:this.dateTimeFormat,endDate:this.range?n:void 0,hoverRange:this.hoverRange,localeData:this.localeData,max:i,min:s,onCalciteInternalDatePickerActiveDateChange:this.monthActiveDateChange,onCalciteInternalDatePickerHover:this.monthHoverChange,onCalciteInternalDatePickerMouseOut:this.monthMouseOutChange,onCalciteInternalDatePickerSelect:this.monthDateChange,scale:this.scale,selectedDate:"end"===this.activeRange?n:a,startDate:this.range?a:void 0})]}getEndDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0}setEndDate(t){const i=this.getStartDate(),e=t?N(t):t;this.value=[T(i),T(t)],this.valueAsDate=[i,t],this.mostRecentRangeValue=e,this.calciteDatePickerRangeChange.emit(),this.activeEndDate=t||null}getStartDate(){return Array.isArray(this.valueAsDate)&&this.valueAsDate[0]}setStartDate(t){const i=this.getEndDate();this.value=[T(t),T(i)],this.valueAsDate=[t,i],this.mostRecentRangeValue=t,this.calciteDatePickerRangeChange.emit(),this.activeStartDate=t||null}getActiveDate(t,i,e){return B(this.activeDate,i,e)||t||B(new Date,i,e)}getActiveEndDate(t,i,e){return B(this.activeEndDate,i,e)||t||B(new Date,i,e)}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{activeDate:["activeDateWatcher"],valueAsDate:["valueAsDateWatcher"],min:["onMinChanged"],max:["onMaxChanged"],messageOverrides:["onMessagesChange"],effectiveLocale:["effectiveLocaleChange","loadLocaleData"],value:["valueHandler"]}}};Pt.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{display:inline-block;inline-size:auto;overflow:visible;border-radius:0px;border-width:1px;border-style:solid;border-color:var(--calcite-color-border-1);vertical-align:top}:host([scale=s]){inline-size:234px;min-inline-size:216px;max-inline-size:380px}:host([scale=m]){inline-size:304px;min-inline-size:272px;max-inline-size:480px}:host([scale=l]){inline-size:370px;min-inline-size:320px;max-inline-size:600px}:host([hidden]){display:none}[hidden]{display:none}";
18
- /*!
19
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
20
- * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
21
- * v2.13.0
22
- */
23
- const Ft="calendar-wrapper",St="calendar-wrapper--end",Rt="border-top-color-one",At="no-bottom-border",jt="input-wrapper",Ot="input",Mt="menu-container",Tt="menu-container--active",Bt="toggle-icon",Nt="inputDatePickerValidationMessage",Ht=class{constructor(e){t(this,e),this.calciteInputDatePickerChange=i(this,"calciteInputDatePickerChange",6),this.calciteInputDatePickerBeforeClose=i(this,"calciteInputDatePickerBeforeClose",6),this.calciteInputDatePickerClose=i(this,"calciteInputDatePickerClose",6),this.calciteInputDatePickerBeforeOpen=i(this,"calciteInputDatePickerBeforeOpen",6),this.calciteInputDatePickerOpen=i(this,"calciteInputDatePickerOpen",6),this.calciteInternalInputInputHandler=t=>{const i=t.target,e=i.value,s=this.parseNumerals(e),a=this.formatNumerals(s);i.value=a;const{year:n}=W(e,this.localeData);if(n&&n.length<4)return;const o=U(e,this.localeData);V(o,this.min,this.max)&&(this.datePickerActiveDate=o)},this.calciteInternalInputBlurHandler=()=>{this.commitValue()},this.dialogId=`date-picker-dialog--${st()}`,this.focusOnOpen=!1,this.userChangedValue=!1,this.openTransitionProp="opacity",this.valueAsDateChangedExternally=!1,this.placeholderTextId=`calcite-input-date-picker-placeholder-${st()}`,this.onInputWrapperPointerDown=()=>{this.currentOpenInput=this.focusedInput},this.onInputWrapperClick=t=>{const{range:i,endInput:e,startInput:s,currentOpenInput:a}=this,n=t.currentTarget.getAttribute("data-position");t.composedPath().find((t=>t.classList?.contains(Bt)))&&("start"===n?s:e).setFocus(),i&&this.open&&a!==n||(this.open=!this.open)},this.setFilteredPlacements=()=>{const{el:t,flipPlacements:i}=this;this.filteredFlipPlacements=i?P(i,t):null},this.setTransitionEl=t=>{this.transitionEl=t},this.setStartInput=t=>{this.startInput=t},this.setEndInput=t=>{this.endInput=t},this.blurHandler=()=>{this.open=!1},this.keyDownHandler=t=>{const{defaultPrevented:i,key:e}=t;i||("Enter"===e?(t.preventDefault(),this.commitValue(),this.shouldFocusRangeEnd()?this.endInput?.setFocus():this.shouldFocusRangeStart()&&this.startInput?.setFocus(),K(this)&&this.restoreInputFocus()):"ArrowDown"===e?(this.open=!0,this.focusOnOpen=!0,t.preventDefault()):"Escape"===e&&(this.open=!1,t.preventDefault(),this.restoreInputFocus()))},this.startInputFocus=()=>{this.focusedInput="start"},this.endInputFocus=()=>{this.focusedInput="end"},this.setFloatingEl=t=>{this.floatingEl=t,F(this,this.referenceEl,this.floatingEl)},this.setStartWrapper=t=>{this.startWrapper=t,this.setReferenceEl()},this.setEndWrapper=t=>{this.endWrapper=t,this.setReferenceEl()},this.setDatePickerRef=t=>{this.datePickerEl=t,tt(this,{focusTrapEl:t,focusTrapOptions:{initialFocus:!1,setReturnFocus:!1}})},this.handleDateChange=t=>{this.range||(t.stopPropagation(),this.setValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.handleDateRangeChange=t=>{this.range&&(t.stopPropagation(),this.setRangeValue(t.target.valueAsDate),this.localizeInputValues(),this.restoreInputFocus())},this.setInputValue=(t,i="start")=>{const e=this[`${i}Input`];e&&(e.value=t)},this.setRangeValue=t=>{if(!this.range)return;const{value:i}=this,e=Array.isArray(i),s=Array.isArray(t);let a=s?T(s?t[0]:null):"";a&&(a=this.getNormalizedDate(a));let n=s?T(s?t[1]:null):"";n&&(n=this.getNormalizedDate(n));const o=a||n?[a,n]:"";if(o===i)return;this.userChangedValue=!0,this.value=o,this.valueAsDate=o?Lt(o):void 0;const l=this.calciteInputDatePickerChange.emit();l&&l.defaultPrevented&&(this.value=i,e?(this.setInputValue(i[0],"start"),this.setInputValue(i[1],"end")):(this.value=i,this.setInputValue(i)))},this.setValue=t=>{if(this.range)return;const i=this.value;let e=T(t);e=this.getNormalizedDate(e),e!==i&&(this.userChangedValue=!0,this.valueAsDate=e?O(e):void 0,this.value=e||"",this.calciteInputDatePickerChange.emit().defaultPrevented&&(this.value=i,this.setInputValue(i)))},this.commonDateSeparators=[".","-","/"],this.formatNumerals=t=>t?t.split("").map((t=>this.commonDateSeparators?.includes(t)?this.localeData?.separator:Y?.includes(t)?g?.numberFormatter?.format(Number(t)):t)).join(""):"",this.parseNumerals=t=>t?t.split("").map((t=>Y.includes(t)?g.delocalize(t):t)).join(""):"",this.disabled=!1,this.focusTrapDisabled=!1,this.form=void 0,this.readOnly=!1,this.value="",this.flipPlacements=void 0,this.headingLevel=void 0,this.valueAsDate=void 0,this.messageOverrides=void 0,this.messages=void 0,this.minAsDate=void 0,this.maxAsDate=void 0,this.min=void 0,this.max=void 0,this.open=!1,this.validationMessage=void 0,this.validationIcon=void 0,this.validity={valid:!1,badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1},this.name=void 0,this.numberingSystem=void 0,this.scale="m",this.status="idle",this.placement=S,this.range=!1,this.required=!1,this.overlayPositioning="absolute",this.proximitySelectionDisabled=!1,this.layout="horizontal",this.datePickerActiveDate=void 0,this.defaultMessages=void 0,this.effectiveLocale="",this.focusedInput="start",this.localeData=void 0}handleFocusTrapDisabled(t){this.open&&(t?it(this):et(this))}handleDisabledAndReadOnlyChange(t){t||(this.open=!1)}valueWatcher(t){if(!this.userChangedValue){let i;i=Array.isArray(t)?Lt(t):t?O(t):void 0,this.valueAsDateChangedExternally||i===this.valueAsDate||(this.valueAsDate=i),this.localizeInputValues()}this.userChangedValue=!1}valueAsDateWatcher(t){this.datePickerActiveDate=t;const i=this.range&&Array.isArray(t)?[T(t[0]),T(t[1])]:T(t);this.value!==i&&(this.valueAsDateChangedExternally=!0,this.value=i,this.valueAsDateChangedExternally=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}onMessagesChange(){}onMinChanged(t){this.minAsDate=O(t)}onMaxChanged(t){this.maxAsDate=O(t)}openHandler(){I(this),this.disabled||this.readOnly?this.open=!1:this.reposition(!0)}overlayPositioningHandler(){this.reposition(!0)}calciteDaySelectHandler(){this.shouldFocusRangeStart()||this.shouldFocusRangeEnd()||(this.open=!1)}async setFocus(){await D(this),c(this.el)}async reposition(t=!1){const{floatingEl:i,referenceEl:e,placement:s,overlayPositioning:a,filteredFlipPlacements:n}=this;return R(this,{floatingEl:i,referenceEl:e,overlayPositioning:a,placement:s,flipPlacements:n,type:"menu"},t)}connectedCallback(){v(this),this.handleDateTimeFormatChange();const{open:t}=this;if(t&&this.openHandler(),this.min&&(this.minAsDate=O(this.min)),this.max&&(this.maxAsDate=O(this.max)),Array.isArray(this.value))this.valueAsDate=Lt(this.value);else if(this.value)try{const t=O(this.value),i=B(t,this.minAsDate,this.maxAsDate);this.valueAsDate=i}catch(t){this.warnAboutInvalidValue(this.value),this.value=""}else this.valueAsDate&&(this.range&&Array.isArray(this.valueAsDate)?this.value=[T(this.valueAsDate[0]),T(this.valueAsDate[1])]:this.range||Array.isArray(this.valueAsDate)||(this.value=T(this.valueAsDate)));J(this),Z(this),_(this),this.setFilteredPlacements(),g.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.open&&I(this),F(this,this.referenceEl,this.floatingEl)}async componentWillLoad(){z(this),await Promise.all([this.loadLocaleData(),$(this)]),this.onMinChanged(this.min),this.onMaxChanged(this.max)}componentDidLoad(){E(this),this.localizeInputValues(),F(this,this.referenceEl,this.floatingEl)}disconnectedCallback(){it(this),X(this),G(this),A(this,this.referenceEl,this.floatingEl),m(this),k(this)}componentDidRender(){p(this)}render(){const{disabled:t,effectiveLocale:i,messages:a,numberingSystem:n,readOnly:o}=this;return g.numberFormatOptions={numberingSystem:n,locale:i,useGrouping:!1},e(s,{key:"b31ae837415083aa63451c5f32b78253b1d6af1e",onBlur:this.blurHandler,onKeyDown:this.keyDownHandler},e(u,{key:"7315a0e5773a1ef96c00b48b138c8afd50aca28a",disabled:this.disabled},this.localeData&&e("div",{key:"022f86001938e2994ab523b30a2e3cb379a550b4",class:"input-container"},e("div",{key:"4a3add7824ea7ec41b75ddd5e9b847afa1ca0708",class:jt,"data-position":"start",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setStartWrapper},e("calcite-input-text",{key:"d415c8d890333f76793fc5f804111c0a72f4d3c8","aria-autocomplete":"none","aria-controls":this.dialogId,"aria-describedby":this.placeholderTextId,"aria-errormessage":Nt,"aria-expanded":d(this.open),"aria-haspopup":"dialog","aria-invalid":d("invalid"===this.status),class:{[Ot]:!0,[At]:"vertical"===this.layout&&this.range},disabled:t,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.startInputFocus,placeholder:this.localeData?.placeholder,readOnly:o,ref:this.setStartInput,role:"combobox",scale:this.scale,status:this.status}),!this.readOnly&&this.renderToggleIcon(this.open&&"start"===this.focusedInput),e("span",{key:"7d5b86f35bde88b757f9a46485ce37bf8317ac88","aria-hidden":"true",class:"assistive-text",id:this.placeholderTextId},"Date Format: ",this.localeData?.placeholder)),e("div",{key:"8d38fc155dcc3851865e699645f64e3278519f02","aria-hidden":d(!this.open),"aria-label":a.chooseDate,"aria-live":"polite","aria-modal":"true",class:{[Mt]:!0,[Tt]:this.open},id:this.dialogId,ref:this.setFloatingEl,role:"dialog"},e("div",{key:"92b37e521a0d2e0e8fb30ca129a53e75d26e9dd6",class:{[Ft]:!0,[St]:"end"===this.focusedInput,[j.animation]:!0,[j.animationActive]:this.open},ref:this.setTransitionEl},e("calcite-date-picker",{key:"35aa39e5552eff762bb58368b4cbe1069692ee38",activeDate:this.datePickerActiveDate,activeRange:this.focusedInput,headingLevel:this.headingLevel,max:this.max,maxAsDate:this.maxAsDate,messageOverrides:this.messageOverrides,min:this.min,minAsDate:this.minAsDate,numberingSystem:n,onCalciteDatePickerChange:this.handleDateChange,onCalciteDatePickerRangeChange:this.handleDateRangeChange,proximitySelectionDisabled:this.proximitySelectionDisabled,range:this.range,ref:this.setDatePickerRef,scale:this.scale,tabIndex:this.open?void 0:-1,valueAsDate:this.valueAsDate}))),this.range&&"horizontal"===this.layout&&e("div",{key:"386b0a687fc16a4f96ef9cc199aca653ab90071b",class:"horizontal-arrow-container"},e("calcite-icon",{key:"65b1d5b9e7b77f524ef40cd1f0efda3776db33e1",flipRtl:!0,icon:"arrow-right",scale:at(this.scale)})),this.range&&"vertical"===this.layout&&"s"!==this.scale&&e("div",{key:"50b0b98f4d51c5866557ab5691692a42704d08f2",class:"vertical-arrow-container"},e("calcite-icon",{key:"48758a61b800c61109b492d77ca468519ad65227",icon:"arrow-down",scale:at(this.scale)})),this.range&&e("div",{key:"af12058d6a8d299fd988ae4ac7fc0422d05342c6",class:jt,"data-position":"end",onClick:this.onInputWrapperClick,onPointerDown:this.onInputWrapperPointerDown,ref:this.setEndWrapper},e("calcite-input-text",{key:"38c68e0df3d516ea5b840a1a937d1af6d1c971b0","aria-autocomplete":"none","aria-controls":this.dialogId,"aria-errormessage":Nt,"aria-expanded":d(this.open),"aria-haspopup":"dialog","aria-invalid":d("invalid"===this.status),class:{[Ot]:!0,[Rt]:"vertical"===this.layout&&this.range},disabled:t,icon:"calendar",onCalciteInputTextInput:this.calciteInternalInputInputHandler,onCalciteInternalInputTextBlur:this.calciteInternalInputBlurHandler,onCalciteInternalInputTextFocus:this.endInputFocus,placeholder:this.localeData?.placeholder,readOnly:o,ref:this.setEndInput,role:"combobox",scale:this.scale,status:this.status}),!this.readOnly&&this.renderToggleIcon(this.open&&"end"===this.focusedInput))),e(Q,{key:"65e98114397e07a95ccf82217412360be3a36d96",component:this}),this.validationMessage&&"invalid"===this.status?e(nt,{icon:this.validationIcon,id:Nt,message:this.validationMessage,scale:this.scale,status:this.status}):null))}renderToggleIcon(t){return e("span",{class:Bt,tabIndex:-1},e("calcite-icon",{class:"chevron-icon",icon:t?"chevron-up":"chevron-down",scale:at(this.scale)}))}effectiveLocaleChange(){w(this,this.effectiveLocale),this.loadLocaleData()}handleDateTimeFormatChange(){const t={numberingSystem:y(this.numberingSystem)};this.dateTimeFormat=new Intl.DateTimeFormat(x(this.effectiveLocale),t)}setReferenceEl(){const{focusedInput:t,layout:i,endWrapper:e,startWrapper:s}=this;this.referenceEl="end"===t||"vertical"===i?e||s:s||e,requestAnimationFrame((()=>F(this,this.referenceEl,this.floatingEl)))}onLabelClick(){this.setFocus()}onBeforeOpen(){this.calciteInputDatePickerBeforeOpen.emit()}onOpen(){et(this,{onActivate:()=>{this.focusOnOpen&&(this.datePickerEl.setFocus(),this.focusOnOpen=!1)}}),this.calciteInputDatePickerOpen.emit()}onBeforeClose(){this.calciteInputDatePickerBeforeClose.emit()}onClose(){this.calciteInputDatePickerClose.emit(),it(this),this.restoreInputFocus(),this.focusOnOpen=!1,this.datePickerEl.reset()}syncHiddenFormInput(t){ot("date",this,t)}commitValue(){const{focusedInput:t,value:i}=this,e=U(this[`${t}Input`].value,this.localeData),s=T(e),a=Array.isArray(i);if(this.range)if(a){if(s===i["start"===t?0:1])return;e?(this.setRangeValue(["start"===t?e:O(i[0]),"end"===t?e:O(i[1])]),this.localizeInputValues()):this.setRangeValue(["end"===t&&O(i[0]),"start"===t&&O(i[1])])}else e&&(this.setRangeValue(["start"===t?e:O(i[0]),"end"===t?e:O(i[1])]),this.localizeInputValues());else{if(s===i)return;this.setValue(e),this.localizeInputValues()}}async loadLocaleData(){q()&&(g.numberFormatOptions={numberingSystem:this.numberingSystem,locale:this.effectiveLocale,useGrouping:!1},this.localeData=await It(this.effectiveLocale),this.localizeInputValues())}shouldFocusRangeStart(){return!(!this.value[1]||this.value[0]||"end"!==this.focusedInput||!this.startInput)}shouldFocusRangeEnd(){return!(!this.value[0]||this.value[1]||"start"!==this.focusedInput||!this.endInput)}restoreInputFocus(){this.range?("start"===this.focusedInput?this.startInput:this.endInput).setFocus():this.startInput.setFocus()}localizeInputValues(){const t=B(this.range?Array.isArray(this.valueAsDate)&&this.valueAsDate[0]||void 0:this.valueAsDate,this.minAsDate,this.maxAsDate),i=this.range?B(Array.isArray(this.valueAsDate)&&this.valueAsDate[1]||void 0,this.minAsDate,this.maxAsDate):null;this.setInputValue((t&&this.dateTimeFormat.format(t))??"","start"),this.setInputValue((this.range&&i&&this.dateTimeFormat.format(i))??"","end")}warnAboutInvalidValue(t){console.warn(`The specified value "${t}" does not conform to the required format, "YYYY-MM-DD".`)}getNormalizedDate(t){if(!t)return"";if(!
24
- /*!
25
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
26
- * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
27
- * v2.13.0
28
- */
29
- function(t){if(!t)return!1;const{year:i}=H(t);return Number(i)<100}(t))return t;const{day:i,month:e,year:s}=H(t);return`${function(t){const i=(new Date).getFullYear();return 100*Math.floor(i/100)+t}(Number(s))}-${e}-${i}`}static get delegatesFocus(){return!0}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{focusTrapDisabled:["handleFocusTrapDisabled"],disabled:["handleDisabledAndReadOnlyChange"],readOnly:["handleDisabledAndReadOnlyChange"],value:["valueWatcher"],valueAsDate:["valueAsDateWatcher"],flipPlacements:["flipPlacementsHandler"],messageOverrides:["onMessagesChange"],min:["onMinChanged"],max:["onMaxChanged"],open:["openHandler"],overlayPositioning:["overlayPositioningHandler"],effectiveLocale:["effectiveLocaleChange","handleDateTimeFormatChange"],numberingSystem:["handleDateTimeFormatChange"],layout:["setReferenceEl"],focusedInput:["setReferenceEl"]}}};Ht.style=":host{--calcite-icon-size:1rem;--calcite-spacing-eighth:0.125rem;--calcite-spacing-quarter:0.25rem;--calcite-spacing-half:0.5rem;--calcite-spacing-three-quarters:0.75rem;--calcite-spacing:1rem;--calcite-spacing-plus-quarter:1.25rem;--calcite-spacing-plus-half:1.5rem;--calcite-spacing-double:2rem;--calcite-menu-min-width:10rem;--calcite-header-min-height:3rem;--calcite-footer-min-height:3rem}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:inline-block;inline-size:100%;overflow:visible;vertical-align:top;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host .menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}:host .menu-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}:host .menu-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}:host .menu-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}:host .menu-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}:host .menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([scale=s]){--calcite-toggle-spacing:0.5rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1rem)}:host([scale=m]){--calcite-toggle-spacing:0.75rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 1.5rem)}:host([scale=l]){--calcite-toggle-spacing:1rem;--calcite-internal-input-text-input-padding-inline-end:calc(var(--calcite-toggle-spacing) + 2rem)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.interaction-container{display:contents}.calendar-wrapper{--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);transform:translate3d(0, 0, 0)}.input-wrapper{position:relative}.input-wrapper .chevron-icon{color:var(--calcite-color-text-3)}.input-wrapper:focus-within .chevron-icon,.input-wrapper:active .chevron-icon,.input-wrapper:hover .chevron-icon{color:var(--calcite-color-text-1)}.toggle-icon{position:absolute;display:flex;cursor:pointer;align-items:center;inset-inline-end:0;inset-block:0;padding-inline:var(--calcite-toggle-spacing)}:host([range]) .input-container{display:flex}:host([range]) .input-wrapper{flex:1 1 auto}:host([range]) .horizontal-arrow-container{display:flex;align-items:center;border-width:1px;border-inline-start-width:0px;border-inline-end-width:0px;border-style:solid;border-color:var(--calcite-color-border-input);background-color:var(--calcite-color-background);padding-block:0px;padding-inline:0.25rem}:host([range][layout=vertical]) .input-wrapper{inline-size:100%}:host([range][layout=vertical]) .input-container{flex-direction:column;align-items:flex-start}:host([range][layout=vertical]) .calendar-wrapper--end{transform:translate3d(0, 0, 0)}:host([range][layout=vertical]) .vertical-arrow-container{inset-block-start:1.5rem;position:absolute;z-index:var(--calcite-z-index);margin-inline:1px;background-color:var(--calcite-color-foreground-1);padding-inline:0.625rem;inset-inline-start:0}.menu-container{--calcite-floating-ui-z-index:var(--calcite-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.menu-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:inset, left, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-z-index);border-radius:0.25rem}.menu-container[data-placement^=bottom] .calcite-floating-ui-anim{inset-block-start:-5px}.menu-container[data-placement^=top] .calcite-floating-ui-anim{inset-block-start:5px}.menu-container[data-placement^=left] .calcite-floating-ui-anim{left:5px}.menu-container[data-placement^=right] .calcite-floating-ui-anim{left:-5px}.menu-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;inset-block:0;left:0}:host([open]) .menu-container{visibility:visible}.menu-container--active{visibility:visible}.input .calcite-input__wrapper{margin-block-start:0px}:host([range][layout=vertical][scale=m]) .vertical-arrow-container{inset-block-start:1.5rem;padding-inline-start:0.75rem}:host([range][layout=vertical][scale=m]) .vertical-arrow-container calcite-icon{block-size:0.75rem;inline-size:0.75rem;min-inline-size:0px}:host([range][layout=vertical][scale=l]) .vertical-arrow-container{inset-block-start:2.25rem;padding-inline:0.875rem}:host([range][layout=vertical][open]) .vertical-arrow-container{display:none}.validation-container{display:flex;flex-direction:column;align-items:flex-start;align-self:stretch}:host([scale=m]) .validation-container,:host([scale=l]) .validation-container{padding-block-start:0.5rem}:host([scale=s]) .validation-container{padding-block-start:0.25rem}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}.assistive-text{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}:host([hidden]){display:none}[hidden]{display:none}";const Wt="instant-apps-filter-list calcite-mode-light",Ut=["feature","geojson","wfs","csv","scene","subtype-group","point-cloud","map-image","sublayer"];function Vt(t){return t.replaceAll("'","''")}function qt(t,i=!1){if(t){const e=new Date(t),s=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;return i?`${s} ${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}`:s}}function Kt(t){var i;if(null!=t){t.value=["",""];const e=null===(i=t.shadowRoot)||void 0===i?void 0:i.querySelectorAll("calcite-input");if(null!=e)for(const t of e)t.value=""}}const Zt="instant-apps-filter-list__item-container--user-input",Gt=class{constructor(e){t(this,e),this.filterListReset=i(this,"filterListReset",7),this.filterUpdate=i(this,"filterUpdate",7),this.layerExpressions=void 0,this.autoUpdateUrl=!1,this.closeBtn=!1,this.closeBtnOnClick=void 0,this.comboboxOverlayPositioning="absolute",this.closeBtnText=void 0,this.openFilters=!1,this.extentSelector=!1,this.extentSelectorConfig=void 0,this.urlParams=void 0,this.filterCount=0,this.view=void 0,this.zoomBtn=!0,this.resetBtn=!0,this.resetFiltersOnDisconnect=!0,this.loading=void 0,this.filterLayerExpressions=void 0,this.messages=void 0,this.baseClass=Wt,this.disabled=!0,this.hasLayerExpression=!1,this.initDefExpressions=void 0,this.initMapImageExpressions=void 0,this.initPointCloudFilters=void 0}watchViewHandler(){this.handleWhenView()}watchLayerExpressions(){this.hasLayerExpression||(this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}getFilterInitState(){return Promise.resolve({initDefExpressions:this.initDefExpressions,initMapImageExpressions:this.initMapImageExpressions,initPointCloudFilters:this.initPointCloudFilters})}forceReset(){return this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleResetFilter(),this.initExpressions()}restoreFilters(t,i){this.filterLayerExpressions=structuredClone(this.layerExpressions),this.initDefExpressions=i.initDefExpressions,this.initMapImageExpressions=i.initMapImageExpressions,this.initPointCloudFilters=i.initPointCloudFilters;const e=null==t?void 0:t.split(";").map((t=>JSON.parse(t)));return e&&(this.filterCount=this.applyFilters(e)),this.initExpressions()}async componentWillLoad(){var t;this.baseClass="dark"===ct(this.el)?"instant-apps-filter-list calcite-mode-dark":Wt,await this.initializeModules(),rt(this),this.hasLayerExpression=null!=this.layerExpressions,this.filterLayerExpressions=null!=this.layerExpressions?structuredClone(this.layerExpressions):[],this.disabled=!(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)||void 0,this.reactiveUtils.whenOnce((()=>this.view)).then((()=>this.handleLayerExpressionsUpdate()))}componentShouldUpdate(t,i,e){"view"===e&&null!=t?this.handleWhenView():"layerExpressions"===e&&(this.hasLayerExpression&&this.resetAllFilters(),this.filterLayerExpressions=structuredClone(this.layerExpressions),this.handleLayerExpressionsUpdate(),this.hasLayerExpression=!0)}componentWillRender(){var t;this.disabled=!((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0)||void 0}disconnectedCallback(){this.resetFiltersOnDisconnect&&(this.filterLayerExpressions=structuredClone(this.layerExpressions),this.resetAllFilters())}async initializeModules(){const[t,i,e]=await lt(["esri/intl","esri/geometry/support/jsonUtils","esri/core/reactiveUtils"]);this.geometryJsonUtils=i,this.reactiveUtils=e,this.locale=t.getLocale(),this.intl=t}render(){const t=this.loading?this.renderLoading():this.initFilterConfig(),i=this.renderFooter(this.closeBtn,this.resetBtn);return e(s,{key:"80c4918bd3bdf65d541ed6cf4cf4843ab0f0df01"},e("calcite-panel",{key:"f1da101b071420df42da5eb8f5478d0719b40cec",class:this.baseClass,ref:t=>this.panelEl=t},e("slot",{key:"8ebdbf20767027459470fa85fe4238e69bc47ab8",slot:"header-content",name:"filter-header-content"}),e("slot",{key:"177f8db80aa842eeb200344cd7b398cd51ca23f3",slot:"header-actions-end",name:"filter-header-actions-end"}),e("div",{key:"filter-container",class:"instant-apps-filter-list__container"},t,i)))}renderLoading(){return e("calcite-loader",{label:"Loading filters..."})}renderFilter(t){const{id:i}=t;return t.expressions.map(((s,a)=>"checkbox"==s.type||null==s.type?e("div",{key:`${i}-${a}`,class:"instant-apps-filter-list__item-container"},e("div",{class:"instant-apps-filter-list__title"},e("p",null,s.name)),e("div",{class:"instant-apps-filter-list__checkbox-container"},e("calcite-checkbox",{id:s.id.toString(),scale:"l",checked:null==s?void 0:s.active,onCalciteCheckboxChange:this.handleCheckboxChange.bind(this,t,s)}))):this.initInput(t,s)))}renderLayerBlock(){return this.filterLayerExpressions.map((t=>this.renderFilterBlocks(t)))}renderFilterBlocks(t){var i;const s=this.renderFilter(t),{operator:a}=t,n="OR"===(null==a?void 0:a.trim())?"orOperator":"andOperator",o=this.renderZoomTo(t);return e("calcite-block",{key:t.id,heading:t.title,description:null===(i=this.messages)||void 0===i?void 0:i[n],open:!!this.openFilters||void 0,collapsible:!0},o,s)}renderCombobox(t,i){var s;return e("label",{key:"combo-select",class:Zt},e("span",null,i.name),e("calcite-combobox",{id:i.id.toString(),onCalciteComboboxChange:this.handleComboSelect.bind(this,i,t),label:i.name,placeholder:i.placeholder,selectionMode:"multiple","max-items":"6",scale:"s",overlayPositioning:this.comboboxOverlayPositioning},null===(s=i.fields)||void 0===s?void 0:s.map(((t,e)=>this.renderComboboxItem(i,t,e)))))}renderComboboxItem(t,i,s){var a;const n=this.createLabel(t,i),o=null==t?void 0:t.selectedFields,l=null!==(a=null==o?void 0:o.includes(i))&&void 0!==a&&a;return e("calcite-combobox-item",{key:`${n}-${s}`,value:i,textLabel:`${n}`,selected:l})}initFilterConfig(){var t,i;if((null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.length)>0){if(1===this.filterLayerExpressions.length){const{operator:t}=this.filterLayerExpressions[0],s="OR"===(null==t?void 0:t.trim())?"orOperator":"andOperator",a=this.renderZoomTo(this.filterLayerExpressions[0]);return e("calcite-block",{class:"instant-apps-filter-list__operator-description",heading:null===(i=this.messages)||void 0===i?void 0:i[s],open:!0},a,this.renderFilter(this.filterLayerExpressions[0]))}if(this.filterLayerExpressions.length>1)return this.renderLayerBlock()}}renderNumberSlider(t,i){var s,a,n,o,l,r,c,h;const d=null==i?void 0:i.min,p=null==i?void 0:i.max,u=(null==i?void 0:i.step)?i.step:1,v=null!==(s=null==i?void 0:i.field)&&void 0!==s?s:"",m=[null!=(null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.min)?i.range.min:d,null!=(null===(n=null==i?void 0:i.range)||void 0===n?void 0:n.max)?i.range.max:p];return null!=d&&null!=p?e("label",{key:null==i?void 0:i.id.toString(),class:Zt},e("span",null,null==i?void 0:i.name),e("div",{class:"instant-apps-filter-list__number-input-container"},e("calcite-slider",{id:null==i?void 0:i.id.toString(),onCalciteSliderChange:this.handleSliderChange.bind(this,i,t),min:d,max:p,minValue:d,maxValue:p,"min-label":null===(l=null===(o=this.messages)||void 0===o?void 0:o.minSlider)||void 0===l?void 0:l.replace("{field}",v),"max-label":null===(c=null===(r=this.messages)||void 0===r?void 0:r.maxSlider)||void 0===c?void 0:c.replace("{field}",v),step:u,labelHandles:!0,snap:!0,value:m,"group-separator":null===(h=null==i?void 0:i.format)||void 0===h?void 0:h.digitSeparator}))):void 0}renderDatePicker(t,i){var s,a,n,o;const{min:l,max:r}=i,c=[null===(s=null==i?void 0:i.range)||void 0===s?void 0:s.min,null===(a=null==i?void 0:i.range)||void 0===a?void 0:a.max];return null!=l&&null!=r?e("label",{class:Zt},e("span",null,null==i?void 0:i.name),e("div",{class:"instant-apps-filter-list__date-picker-input-container"},e("calcite-input-date-picker",{id:null==i?void 0:i.id.toString(),onCalciteInputDatePickerChange:this.handleDatePickerRangeChange.bind(this,i,t),min:l,max:r,"overlay-positioning":"fixed",lang:null!==(n=this.locale)&&void 0!==n?n:"en",layout:"vertical",value:c,range:!0}),e("calcite-action",{onClick:this.handleResetDatePicker.bind(this,i,t),icon:"reset",text:null===(o=this.messages)||void 0===o?void 0:o.resetDatePicker,scale:"s"}))):null}renderFooter(t,i){var s,a,n;const o=null!=this.closeBtnText?this.closeBtnText:null===(s=this.messages)||void 0===s?void 0:s.close;return e("div",{class:"instant-apps-filter-list__footer",slot:"footer"},i?e("calcite-button",{appearance:"outline",width:"half",disabled:this.disabled,onClick:this.handleResetFilter.bind(this)},null===(a=this.messages)||void 0===a?void 0:a.resetFilter):void 0,t?e("calcite-button",{appearance:"solid",width:"half",kind:"brand",onClick:null===(n=this.closeBtnOnClick)||void 0===n?void 0:n.bind(this)},o):void 0)}renderZoomTo(t){var i;return this.zoomBtn?e("div",{class:"instant-apps-filter-list__zoom-to"},e("calcite-button",{id:(null==t?void 0:t.sublayerId)?`zoom-to-${t.id}-${t.sublayerId}`:`zoom-to-${t.id}`,appearance:"transparent",kind:"neutral",scale:"s",iconStart:"magnifying-glass-plus",onClick:this.handleZoomTo.bind(this,t)},null===(i=this.messages)||void 0===i?void 0:i.zoomTo)):void 0}handleResetDatePicker(t,i){Kt(this.panelEl.querySelector(`[id='${t.id}']`)),t.active=!1,t.definitionExpression=void 0,t.range=void 0,this.generateOutput(i)}initInput(t,i){const{type:e,numDisplayOption:s,displayOption:a}=i;return"string"!==e&&"coded-value"!==e&&("number"!==e&&"range"!==e&&"date"!==e||"drop-down"!==s&&"drop-down"!==a)?"number"===e||"range"===e?this.renderNumberSlider(t,i):"date"===e?this.renderDatePicker(t,i):void 0:this.renderCombobox(t,i)}async initExpressions(){if(this.loading=!0,null==this.filterLayerExpressions)return;const t=await this.processExpressions();this.loading=!1,this.filterLayerExpressions=[...t]}async processExpressions(){var t;if(!this.filterLayerExpressions)return[];for(const i of this.filterLayerExpressions)for(const e of i.expressions||[])e.active=null!==(t=e.active)&&void 0!==t?t:null!=e.definitionExpression,await this.setInitExpression(i,e);return this.filterLayerExpressions}handleResetFilter(){var t;null===(t=this.filterLayerExpressions)||void 0===t||t.forEach((t=>{var i;null===(i=t.expressions)||void 0===i||i.forEach((t=>{const{type:i,numDisplayOption:e,displayOption:s}=t;let a="";"string"!==i&&"coded-value"!==i&&("date"!==i||"drop-down"!==e&&"drop-down"!==s)&&("number"!==i&&"range"!==i||"drop-down"!==e&&"drop-down"!==s)?"date"===i?a="datePicker":"number"!==i&&"range"!==i||(a="numberRange"):a="combobox",a?this.resetExpressionUI(a,t):this.resetCheckbox(t),t.active=!1}))})),this.resetAllFilters(),this.generateURLParams(),this.filterListReset.emit()}resetExpressionUI(t,i){const{id:e}=i;switch(t){case"combobox":i.selectedFields=void 0;const t=this.panelEl.querySelector(`[id='${e}']`);t&&Array.from(t.children).forEach((t=>{t.selected=!1}));break;case"datePicker":i.range=void 0,Kt(this.panelEl.querySelector(`[id='${e}']`));break;case"numberRange":i.range=void 0;const s=this.panelEl.querySelector(`[id='${e}']`);s&&(s.minValue=i.min,s.maxValue=i.max)}}resetCheckbox(t){const{id:i}=t,e=this.panelEl.querySelector(`[id='${i}']`);null!=e&&(e.checked=!1)}resetAllFilters(){var t,i,e,s,a;const n=null===(e=null===(i=null===(t=this.view)||void 0===t?void 0:t.map)||void 0===i?void 0:i.allLayers)||void 0===e?void 0:e.concat(null===(a=null===(s=this.view)||void 0===s?void 0:s.map)||void 0===a?void 0:a.allTables);null==n||n.forEach((t=>{var i,e;if(!Ut.includes(t.type))return;const s=t;"point-cloud"===s.type?s.filters=null===(i=this.initPointCloudFilters)||void 0===i?void 0:i[s.id]:"map-image"===s.type?s.allSublayers.forEach((t=>{var i,e;t.definitionExpression=null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[s.id])||void 0===e?void 0:e[t.id]})):s.definitionExpression=null===(e=this.initDefExpressions)||void 0===e?void 0:e[s.id]}))}async updateStringExpression(t,i){const e=this.findFilterLayer(t);return await this.getFeatureAttributes(e,i),this.handleDateField(e,i),!!(null==i?void 0:i.selectedFields)&&(i.definitionExpression=this.createDefinitionExpression(i),!0)}handleDateField(t,i){if("date"===i.type){const e=t.fields.find((({name:t})=>t===i.field));"date-only"===(null==e?void 0:e.type)&&(i.dateOnly=!0)}}createDefinitionExpression(t){var i;if(!(null===(i=t.selectedFields)||void 0===i?void 0:i.length))return"";const e=t.selectedFields.map((t=>"number"==typeof t?t:`'${Vt(t)}'`));return`${t.field} IN (${e.join(",")})`}async updateNumberExpression(t,i){var e,s;if(!(null==i?void 0:i.min)&&0!==(null==i?void 0:i.min)||!(null==i?void 0:i.max)&&0!==(null==i?void 0:i.max)){const a=this.findFilterLayer(t),{field:n}=i;if(null!=n)if(this.setExpressionFormat(a,i,n),"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption))await this.getFeatureAttributes(a,i);else{const t=await this.calculateMinMaxStatistics(a,n),o=null===(e=null==t?void 0:t[0])||void 0===e?void 0:e.attributes;if(null!=(null===(s=i.format)||void 0===s?void 0:s.places)?(i.min=this.roundMinNumberDown(o[`min${n}`],i.format.places),i.max=this.roundMaxNumberUp(o[`max${n}`],i.format.places)):(i.min=o[`min${n}`],i.max=o[`max${n}`]),(null==i?void 0:i.range)&&Object.keys(i.range).length){const{min:t,max:e}=i.range;return i.definitionExpression=`${i.field} BETWEEN ${t} AND ${e}`,!0}}}return!1}async updateDateExpression(t,i){var e;const{field:s,range:a}=i,n=this.findFilterLayer(t),o=await this.calculateMinMaxStatistics(n,s),l=null===(e=null==o?void 0:o[0])||void 0===e?void 0:e.attributes;if(i.min=qt(l[`min${s}`]),i.max=qt(l[`max${s}`]),null!=a&&(null!=(null==a?void 0:a.max)||null!=(null==a?void 0:a.min))){let{min:t,max:e}=a;if(t=null==t?void 0:t.replace("+"," "),e=null==e?void 0:e.replace("+"," "),t||e){const a=e&&!t?"<":!e&&t?">":null;return i.definitionExpression=a?`${s} ${a} '${null!=t?t:e}'`:`${s} BETWEEN '${t}' AND '${e}'`,!0}}return!1}updateCodedValueExpression(t,i){var e,s;if(!(null==i?void 0:i.domain)||"coded-value"!==(null===(e=null==i?void 0:i.domain)||void 0===e?void 0:e.type))return!1;const a=i.domain.codedValues.reduce(((t,{code:i,name:e})=>(t[i]=e,t)),{});if(t.codedValues=a,t.fields=Object.keys(a),null===(s=t.selectedFields)||void 0===s?void 0:s.length){const i=t.selectedFields.map((t=>"number"==typeof t?t:`'${Vt(t)}'`)).join(",");return t.definitionExpression=`${t.field} IN (${i})`,!0}return!1}updateRangeExpression(t,i){var e;if(!(null==i?void 0:i.domain)||"range"!==(null===(e=null==i?void 0:i.domain)||void 0===e?void 0:e.type))return!1;const{field:s,range:a}=t;return t.min=i.domain.minValue,t.max=i.domain.maxValue,!(!a||!Object.keys(a).length||(t.definitionExpression=`${s} BETWEEN ${a.min} AND ${a.max}`,0))}async getFeatureAttributes(t,i){if(!this.isLayerSupported(t))return void(i.fields=[]);const e=await this.getQueryLayer(t),{maxRecordCount:s,supportsMaxRecordCountFactor:a}=this.extractQueryCapabilities(t),n=await e.queryFeatureCount(),o=this.createQuery(e,i);await this.queryDistinctFeatures(e,o,i),this.shouldPaginate(s,n,a)&&this.handlePagination(e,o,s,a,n,i)}isLayerSupported(t){return t&&Ut.includes(t.type)}extractQueryCapabilities(t){var i,e,s,a,n,o;return{maxRecordCount:null!==(s=null===(e=null===(i=t.capabilities)||void 0===i?void 0:i.query)||void 0===e?void 0:e.maxRecordCount)&&void 0!==s?s:null===(a=t.sourceJSON)||void 0===a?void 0:a.maxRecordCount,supportsMaxRecordCountFactor:null===(o=null===(n=t.capabilities)||void 0===n?void 0:n.query)||void 0===o?void 0:o.supportsMaxRecordCountFactor}}createQuery(t,i){const e=t.createQuery();this.applyCacheHint(t,e);const s=null==i?void 0:i.field;if(s){const i=this.getInitDefExprFromLayer(t);e.where=i||"1=1",e.outFields=[s],e.orderByFields=[`${s} ASC`],e.returnDistinctValues=!0,e.returnGeometry=!1,e.maxRecordCountFactor=5,this.applyQueryGeometryFromExtentSelector(e)}return e}async queryDistinctFeatures(t,i,e){if(!i.outFields)return;const s=await this.queryForFeatures(t,i,i.outFields[0]);(null==s?void 0:s.length)&&(e.fields=[...new Set(s)],"string"===e.type?e.fields=e.fields.sort():"number"===e.type&&(e.fields=e.fields.sort(((t,i)=>t-i))))}getQueryCount(t,i){return i?5*t:t}shouldPaginate(t,i,e){const s=this.getQueryCount(t,e);return null!=t&&i>s}async handlePagination(t,i,e,s,a,n){const o=this.getQueryCount(e,s),l=[];for(let s=o;s<a;s+=o){const a=i.clone();a.num=e,a.start=s,l.push(this.queryForFeatures(t,a,i.outFields[0]))}Promise.all(l).then((t=>{t.forEach((t=>{(null==t?void 0:t.length)&&n.fields&&n.fields.push(...t)})),n.fields=[...new Set(n.fields)].sort(),this.filterLayerExpressions=[...this.filterLayerExpressions]}))}async queryForFeatures(t,i,e){const s=await t.queryFeatures(i),a=null==s?void 0:s.features.filter((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[e]}));return null==a?void 0:a.map((t=>{var i;return null===(i=t.attributes)||void 0===i?void 0:i[e]}))}async calculateMinMaxStatistics(t,i){if(!t||!Ut.includes(t.type)||!i)return[];const e=this.createStatisticsQuery(t,i),s=await t.queryFeatures(e);return(null==s?void 0:s.features)||[]}createStatisticsQuery(t,i){const e=t.createQuery();return e.where=this.getInitDefExprFromLayer(t)||"1=1",this.applyCacheHint(t,e),e.outStatistics=[{onStatisticField:i,outStatisticFieldName:`max${i}`,statisticType:"max"},{onStatisticField:i,outStatisticFieldName:`min${i}`,statisticType:"min"}],this.applyQueryGeometryFromExtentSelector(e),e}getExtent(t,i){if(t&&i){const{constraints:t}=i;let e=Object.assign({},t);const s=null==e?void 0:e.geometry;if(s){const t="extent"in s?s:this.geometryJsonUtils.fromJSON(s);if("extent"===(null==t?void 0:t.type)||"polygon"===(null==t?void 0:t.type))return t}}}async setInitExpression(t,i){if(!i.field||!i.type)return void await this.updateExpression(t,i,void 0);const e=this.findFilterLayer(t);e&&("not-loaded"!==e.loadStatus&&"failed"!==e.loadStatus||await e.load(),await e.when((async()=>{var s,a;const n=null===(s=e.fields)||void 0===s?void 0:s.find((({name:t})=>t===i.field)),o=null===(a=null==n?void 0:n.domain)||void 0===a?void 0:a.type;i.type="coded-value"===o||"range"===o?o:i.type,await this.updateExpression(t,i,n)})))}async updateExpression(t,i,e){await this.handleExpressionType(t,i,e)&&this.generateOutput(t)}async handleExpressionType(t,i,e){var s;switch(i.type){case"string":return await this.updateStringExpression(t,i);case"number":return await this.updateNumberExpression(t,i);case"date":return this.updateDateExpressionBasedOnDisplayOption(t,i);case"coded-value":return this.updateCodedValueExpression(i,e);case"range":return this.updateRangeExpressionBasedOnDisplayOption(t,i,e);case"checkbox":case null:return null!==(s=i.active)&&void 0!==s&&s;default:return!1}}async updateDateExpressionBasedOnDisplayOption(t,i){return"drop-down"===i.displayOption?await this.updateStringExpression(t,i):await this.updateDateExpression(t,i)}async updateRangeExpressionBasedOnDisplayOption(t,i,e){return"drop-down"===i.displayOption?await this.updateStringExpression(t,i):this.updateRangeExpression(i,e)}updateRangeExpressions(t,i,e,s){const a=this.getInitDefExprFromLayerExpression(i);!s&&0!==s||!e&&0!==e||(s===(null==t?void 0:t.min)&&e===(null==t?void 0:t.max)?(t.definitionExpression=void 0,t.active=!1):(t.definitionExpression=a?`(${a}) AND ${null==t?void 0:t.field} BETWEEN ${s} AND ${e}`:`${null==t?void 0:t.field} BETWEEN ${s} AND ${e}`,t.active=!0)),t.range={min:s,max:e}}handleCheckboxChange(t,i,e){i.active=e.target.checked,this.generateOutput(t)}handleSliderChange(t,i,e){const{maxValue:s,minValue:a}=e.target;this.updateRangeExpressions(t,i,s,a),this.generateOutput(i)}handleComboSelect(t,i,e){const s=e.target.selectedItems,{field:a,type:n}=t;if(t.selectedFields=s.map((({value:t})=>t)),s.length){const i=s.map((({value:t})=>"number"==typeof t?t:`'${Vt(t)}'`));t.definitionExpression="date"===n?i.map((t=>this.buildDateExpression(t,a))).join(" OR "):`${a} IN (${i.join(",")})`,t.active=!0}else t.definitionExpression=void 0,t.active=!1;this.generateOutput(i)}handleDatePickerRangeChange(t,i,e){const s=e.target,[a,n]=s.valueAsDate,o=a?qt(Math.floor(a.getTime()),!0):void 0,l=n?qt(Math.floor(n.getTime()),!0):void 0;(o||l)&&(t.definitionExpression=this.constructDefinitionExpression(t.field,o,l),t.range={min:o,max:l},t.active=!0,this.generateOutput(i))}constructDefinitionExpression(t,i,e){return i?e?`${t} BETWEEN '${i}' AND '${e}'`:`${t} > '${i}'`:`${t} < '${e}'`}handleURLParams(){if(!("URLSearchParams"in window))return;const t=new URLSearchParams(document.location.search).get("filter");if(!t)return void(this.filterCount=0);const i=t.split(";").map((t=>JSON.parse(t)));this.filterCount=this.applyFilters(i)}applyFilters(t){let i=0;return t.forEach((t=>{var e,s;const a=null===(e=this.filterLayerExpressions)||void 0===e?void 0:e.find((i=>i.id===t.layerId));a&&(null===(s=a.expressions)||void 0===s||s.forEach((e=>{var s,a;(null===(s=e.id)||void 0===s?void 0:s.toString())===(null===(a=t.expressionId)||void 0===a?void 0:a.toString())&&(this.activateExpression(e,t),i++)})))})),i}activateExpression(t,i){t.active=!0,"range"===i.type?t.range=i.range:"select"===i.type&&(t.selectedFields=i.selectedFields)}createURLParamExpression(t,i){const{id:e,range:s,selectedFields:a,type:n}=i;return"string"===n||"coded-value"===n||"drop-down"===(null==i?void 0:i.numDisplayOption)||"drop-down"===(null==i?void 0:i.displayOption)?{type:"select",layerId:t.id,expressionId:e.toString(),selectedFields:a}:"number"===n||"range"===n||"date"===n?{type:"range",layerId:t.id,expressionId:e.toString(),range:s}:{layerId:t.id,expressionId:e.toString()}}autoUpdateURLCheck(t){if(this.autoUpdateUrl){const i=t.toString()?`${window.location.pathname}?${t}`.trim():window.location.pathname;window.history.replaceState({},"",i)}}generateURLParams(){var t;if(!("URLSearchParams"in window))return;const i=new URLSearchParams(window.location.search),e=(null===(t=this.filterLayerExpressions)||void 0===t?void 0:t.flatMap((t=>{var i;return(null===(i=null==t?void 0:t.expressions)||void 0===i?void 0:i.filter((t=>t.active)).map((i=>JSON.stringify(this.createURLParamExpression(t,i)))))||[]})))||[];this.filterCount=e.length,e.length>0?i.set("filter",e.join(";")):i.delete("filter"),this.autoUpdateURLCheck(i),this.urlParams=i}updateFilter(t,i,e){const{id:s}=t,a=this.view.map.findLayerById(s)||this.view.map.findTableById(s);if(null!=a)if("point-cloud"===a.type)this.updateFilterLayerPCLFilter(a,e);else if("map-image"===a.type){const e=a.findSublayerById(null==t?void 0:t.sublayerId);null!=e&&this.updateFilterLayerDefExpression(e,i,t)}else this.updateFilterLayerDefExpression(a,i,t)}updateFilterLayerDefExpression(t,i,e){const{operator:s}=e;let a=this.getInitDefExprFromLayer(t);const n=(null==i?void 0:i.length)>0&&null!=a?`(${i.join(s)}) AND (${a})`:i.length>0?i.join(s):a;t.definitionExpression=n}updateFilterLayerPCLFilter(t,i){t.filters=i}async handleWhenView(){if(null==this.view)return;const t=this.view.map;await t.loadAll(),this.handleLayerExpressionsUpdate()}async handleLayerExpressionsUpdate(){if(null==this.view)return;const t=this.view.map;this.initDefExpressions={},this.initPointCloudFilters={},this.initMapImageExpressions={},t.allLayers.concat(t.allTables).forEach((t=>{if(!Ut.includes(t.type))return;const i=t;"point-cloud"===i.type?this.initPointCloudFilters[i.id]=i.filters:"map-image"===i.type?this.initMapImageExpressions[i.id]=i.allSublayers.reduce(((t,i)=>(t[i.id]=i.definitionExpression,t)),{}):this.initDefExpressions[i.id]=i.definitionExpression})),this.initExpressions(),this.handleURLParams()}async handleZoomTo(t){const i=this.panelEl.querySelector((null==t?void 0:t.sublayerId)?`#zoom-to-${t.id}-${t.sublayerId}`:`#zoom-to-${t.id}`),e=(t,e)=>{i&&(i.loading=t,i.disabled=e)};e(!0,!0),await this.getZoomToExtent(t);const s="point"===this.zoomToExtent.type&&1===this.zoomToExtent.count?{target:this.zoomToExtent.extent,zoom:10}:this.zoomToExtent.extent;await this.view.goTo(s),e(!1,!1)}async getZoomToExtent(t){var i;const e=this.view.allLayerViews.find((({layer:i})=>i.id===t.id)),s=e.layer,a="map-image"===s.type?s.findSublayerById(t.sublayerId):s;if("point-cloud"!==a.type&&Ut.includes(null==a?void 0:a.type)){const t=await this.getQueryLayer(a),e=t.createQuery();e.where=null!==(i=t.definitionExpression)&&void 0!==i?i:"1=1";const s=await t.queryExtent(e);this.zoomToExtent=Object.assign(Object.assign({},s),{type:t.geometryType})}}applyFilterToQuery(t,i){var e,s;const a=this.view.allLayerViews.find((({layer:t})=>t.id===i.id)),n=null!==(s=null===(e=null==a?void 0:a.featureEffect)||void 0===e?void 0:e.filter)&&void 0!==s?s:a.filter;n&&["objectIds","distance","geometry","spatialRelationship","units","where","timeExtent"].forEach((i=>{null!=n[i]&&(t[i]=n[i])}))}generateOutput(t){if(null==this.view)return;const i=[];let e=[];if(t){for(const s of t.expressions){const{active:t,definitionExpression:a,pointCloudFilters:n}=s;t&&a&&i.push(`(${a})`),t&&null!=n&&n.length>0&&(e=e.concat(n))}this.updateFilter(t,i,e),this.generateURLParams(),this.filterUpdate.emit()}}numberWithCommas(t){return t.toLocaleString("en-US",{maximumFractionDigits:20})}scientificRounding(t,i,e){if(null==t)return;let s;if(String(t).includes("e")){const[a,n]=String(t).split("e").map((t=>Number(t)));s=Math[e](+`${a}e${n+i}`)*Math.pow(10,-i)}else s=Math[e](t*Math.pow(10,i))/Math.pow(10,i);return+s.toFixed(i)}roundMinNumberDown(t,i){return this.scientificRounding(t,i,"floor")}roundMaxNumberUp(t,i){return this.scientificRounding(t,i,"ceil")}roundNumber(t,i){var e;return null!==(e=this.scientificRounding(t,i,"round"))&&void 0!==e?e:t}setExpressionFormat(t,i,e){if(null!=(null==t?void 0:t.popupTemplate)){const s=t.popupTemplate.fieldInfos.find((({fieldName:t})=>t===e));i.format=null==s?void 0:s.format}}getInitDefExprFromLayer(t){var i,e,s;return"sublayer"===t.type?null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.layer.id])||void 0===e?void 0:e[t.id]:null===(s=this.initDefExpressions)||void 0===s?void 0:s[t.id]}getInitDefExprFromLayerExpression(t){var i,e,s;return null!=(null==t?void 0:t.sublayerId)?null===(e=null===(i=this.initMapImageExpressions)||void 0===i?void 0:i[t.id])||void 0===e?void 0:e[t.sublayerId]:null===(s=this.initDefExpressions)||void 0===s?void 0:s[t.id]}findFilterLayer(t){const i=this.view.map.allLayers.concat(this.view.map.allTables).find((({id:i})=>i===t.id));return"map-image"===i.type?null==i?void 0:i.findSublayerById(t.sublayerId):i}createLabel(t,i){var e,s,a;if("coded-value"===t.type)return null===(e=t.codedValues)||void 0===e?void 0:e[i];if("number"===t.type&&"number"==typeof i){let e=i;return null!=(null===(s=t.format)||void 0===s?void 0:s.places)&&(e=this.roundNumber(i,t.format.places)),(null===(a=t.format)||void 0===a?void 0:a.digitSeparator)?this.numberWithCommas(e):e}if("date"===t.type&&!t.dateOnly){const t=this.intl.convertDateFormatToIntlOptions("short-date-long-time");return this.intl.formatDate(i,t)}return i}buildDateExpression(t,i){if(t){const e=new Date(t),s=new Date(t),a=new Date(s.setDate(e.getDate()+1)),n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`,o=`${e.getHours()}:${e.getMinutes()}:${e.getSeconds()}`,l=`${a.getHours()}:${a.getMinutes()}:${a.getSeconds()}`;return`${i} BETWEEN '${n} ${o}' AND '${a.getFullYear()}-${a.getMonth()+1}-${a.getDate()} ${l}'`}}async getQueryLayer(t){return"sublayer"===t.type?await t.createFeatureLayer():t}applyCacheHint(t,i){var e,s;(null===(s=null===(e=null==t?void 0:t.capabilities)||void 0===e?void 0:e.query)||void 0===s?void 0:s.supportsCacheHint)&&(i.cacheHint=!0)}applyQueryGeometryFromExtentSelector(t){if(!this.extentSelector||!this.extentSelectorConfig)return;const i=this.getExtent(this.extentSelector,this.extentSelectorConfig);i&&(t.geometry=i,t.spatialRelationship="intersects")}get el(){return a(this)}static get watchers(){return{view:["watchViewHandler"],layerExpressions:["watchLayerExpressions"]}}};Gt.style=":host{display:block}.instant-apps-filter-list *{box-sizing:border-box}.instant-apps-filter-list__container{height:100%}.instant-apps-filter-list__container calcite-block:last-of-type{margin-bottom:0}.instant-apps-filter-list__footer{padding:12px;display:flex}.instant-apps-filter-list__footer calcite-button:nth-child(2){margin-left:6px}.instant-apps-filter-list__item-container,.instant-apps-filter-list__item-container--user-input{display:flex;justify-content:space-between;align-items:center}.instant-apps-filter-list__item-container:not(:last-child),.instant-apps-filter-list__item-container--user-input:not(:last-child){padding-bottom:20px}.instant-apps-filter-list__item-container--user-input{margin:0;display:flex;flex-direction:column;align-items:flex-start}.instant-apps-filter-list__item-container--user-input>span{margin:0 0 6px;font-size:14px;font-weight:normal}.instant-apps-filter-list__item-container--user-input calcite-combobox{width:100%;font-size:16px;--calcite-combobox-input-height:24px}.instant-apps-filter-list__number-input-container{width:100%;display:flex;justify-content:center}.instant-apps-filter-list__number-input-container calcite-slider{width:90%}.instant-apps-filter-list__date-picker-input-container{display:flex;align-items:center;justify-content:unset;width:100%}.instant-apps-filter-list__date-picker-input-container calcite-action{height:64px;border-top:1px solid var(--calcite-color-border-input);border-right:1px solid var(--calcite-color-border-input);border-bottom:1px solid var(--calcite-color-border-input)}.instant-apps-filter-list__title{margin-right:20px}.instant-apps-filter-list__title>p{font-size:14px;font-weight:normal;margin:0}.instant-apps-filter-list__checkbox-container{display:flex}.instant-apps-filter-list__checkbox-container calcite-checkbox{height:18px}.instant-apps-filter-list__operator-description{margin:0;--calcite-font-size--1:12px}.instant-apps-filter-list__zoom-to{display:flex;justify-content:flex-end;margin:8px 0 20px}.instant-apps-filter-list__zoom-to calcite-action{width:-moz-min-content;width:min-content}.instant-apps-filter-list calcite-input-date-picker{--calcite-font-size--1:16px}@media (prefers-reduced-motion){.instant-apps-filter-list calcite-loader{--calcite-internal-duration-factor:2;--calcite-internal-animation-timing-slow:calc(300ms * 2)}}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__header-container{background:#2b2b2b;color:#fff}.instant-apps-filter-list.calcite-mode-dark .instant-apps-filter-list__operator-description{background:#353535}";const Qt="instant-apps-social-share",Yt=".calcite-mode-dark",Jt={base:Qt,dialog:`${Qt}__dialog`,dialogEmbed:`${Qt}__dialog-embed`,dialogContent:`${Qt}__dialog-content`,options:`${Qt}__options`,tipContainer:`${Qt}__tip`,tipHeader:`${Qt}__tip-header`,tipContent:`${Qt}__tip-content`,icon:`${Qt}__icon`,iconContainer:`${Qt}__icon-container`,optionText:`${Qt}__option-text`,popoverButton:`${Qt}__popover-button`,layout:{vertical:`${Qt}__layout--vertical`,horizontal:`${Qt}__layout--horizontal`},xLogo:{light:`${Qt}__x-logo--light`,dark:`${Qt}__x-logo--dark`},success:{container:`${Qt}__success`,header:`${Qt}__success-header`,message:`${Qt}__success-message`,icon:`${Qt}__success-icon`},embed:{container:`${Qt}__embed`,header:`${Qt}__embed-header`,embedCode:{container:`${Qt}__embed-code`,textArea:`${Qt}__embed-code-text-area`,copyButton:`${Qt}__embed-code-copy-button`},textAreaText:`${Qt}__embed-text-area-text`,dimensions:{container:`${Qt}__embed-dimensions`,input:`${Qt}__embed-dimensions-input`}},rtl:{optionText:`${Qt}__option-text--rtl`,textArea:`${Qt}__text-area--rtl`}},Xt={facebook:"https://www.facebook.com/sharer/sharer.php?u={url}",x:"https://x.com/intent/post?url={url}",linkedIn:"https://www.linkedin.com/sharing/share-offsite/?url={url}"},ti=class{constructor(i){t(this,i),this.mode="popover",this.shareUrl=window.location.href,this.autoUpdateShareUrl=!0,this.shareText="",this.embed=!1,this.shareButtonColor="neutral",this.shareButtonType="button",this.shareButtonScale=void 0,this.iframeInnerText="",this.popoverButtonIconScale="m",this.view=void 0,this.displayTipText=!0,this.shortenShareUrl=!0,this.socialMedia=!0,this.shareIconsLayout="vertical",this.scale="m",this.successMessage="",this.defaultUrlParams=null,this.inlineSuccessPopoverPlacement="trailing",this.popoverPositioning="absolute",this.removePopoverOffset=!1,this.messages=void 0,this.opened=!1,this.copied=!1,this.inlineCopyLinkOpened=!1,this.inlineCopyEmbedOpened=!1,this.embedWidth=400,this.embedHeight=600}componentDidLoad(){var t,i;rt(this),this.setupAutoCloseListeners(),"popover"===this.mode&&(this.opened&&(this.popoverRef.open=!0),this.popoverRef.addEventListener("calcitePopoverOpen",(()=>{this.shareListRef&&this.shareListRef.children[0].focus()})),this.popoverRef.addEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))),this.embed&&(null===(t=this.embedWidthRef)||void 0===t||t.addEventListener("change",this.updateDimensions.bind(this,"width")),null===(i=this.embedHeightRef)||void 0===i||i.addEventListener("change",this.updateDimensions.bind(this,"height")))}disconnectedCallback(){var t,i,e;document.documentElement.removeEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?null!=this.popoverRef&&(this.popoverRef.removeEventListener("click",this.stopPropagationCallback.bind(this)),this.popoverRef.removeEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this)),this.popoverRef.removeEventListener("keydown",this.handlePopoverRefKeyDown.bind(this))):(null===(t=this.embedWidthRef)||void 0===t||t.removeEventListener("change",this.updateDimensions.bind(this)),null===(i=this.embedHeightRef)||void 0===i||i.removeEventListener("change",this.updateDimensions.bind(this)),null===(e=this.dialogContentRef)||void 0===e||e.removeEventListener("click",this.stopPropagationCallback.bind(this)))}setupAutoCloseListeners(){var t,i,e;document.documentElement.addEventListener("click",this.autoCloseCallback.bind(this)),"popover"===this.mode?(null===(t=this.popoverRef)||void 0===t||t.addEventListener("click",this.stopPropagationCallback.bind(this)),null===(i=this.popoverRef)||void 0===i||i.addEventListener("calcitePopoverClose",this.resetPopoverCopyState.bind(this))):null===(e=this.dialogContentRef)||void 0===e||e.addEventListener("click",this.stopPropagationCallback.bind(this))}handlePopoverRefKeyDown(t){var i,e;if("Tab"===t.code){if(!this.shareListRef)return;const e=t.target,s=this.shareListRef.children[0],a=this.shareListRef.children[(null===(i=this.shareListRef)||void 0===i?void 0:i.children.length)-1];t.shiftKey&&e===s?(t.preventDefault(),a.focus()):t.shiftKey||e!==a||(t.preventDefault(),s.focus())}else"Escape"===t.code&&(this.closePopover(),null===(e=this.popoverButtonRef)||void 0===e||e.setFocus())}autoCloseCallback(){"popover"===this.mode?(this.opened=!1,this.popoverRef.open=this.opened):(this.copyLinkPopoverRef&&(this.copyLinkPopoverRef.open=!1),this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef&&(this.copyEmbedPopoverRef.open=!1),this.inlineCopyEmbedOpened=!1)}stopPropagationCallback(t){t.stopPropagation()}resetPopoverCopyState(){var t;null===(t=this.popoverButtonRef)||void 0===t||t.setFocus(),setTimeout((()=>{this.copied=!1}),200)}updateDimensions(t){var i,e;if("width"===t){const t=null===(i=this.embedWidthRef)||void 0===i?void 0:i.value;this.embedWidth=parseInt(t)}else{const t=null===(e=this.embedHeightRef)||void 0===e?void 0:e.value;this.embedHeight=parseInt(t)}}render(){var t,i,a,n,o,l;const r=this.copied&&"popover"===this.mode?this.renderSuccess():e("div",{class:Jt.dialogContent},this.renderOptions(),this.displayTipText?this.renderTip():null,this.embed?this.renderEmbed():null),c="vertical"===this.shareIconsLayout?` ${Jt.layout.vertical}`:` ${Jt.layout.horizontal}`,h=" calcite-mode-"+(this.el.closest(Yt)?"dark":"light"),d=e("div",{key:"f205f0e614bc6c4a645f7047951979f88b8c61e3",ref:t=>this.dialogContentRef=t,class:`${Jt.dialog}${c}${h}`},r);return e(s,{key:"efe99545244d7b5f9ae4065bba069c25d45beb0a"},"popover"===this.mode?[e("calcite-popover",{ref:t=>this.popoverRef=t,label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,referenceElement:"shareButton",placement:"bottom-start",scale:this.scale,"overlay-positioning":this.popoverPositioning,"offset-distance":this.removePopoverOffset?0:6,"pointer-disabled":this.removePopoverOffset},d),this.renderButton()]:[d,e("calcite-popover",{ref:t=>this.copyLinkPopoverRef=t,label:null===(n=null===(a=this.messages)||void 0===a?void 0:a.share)||void 0===n?void 0:n.label,referenceElement:"copyToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderSuccess()),e("calcite-popover",{ref:t=>this.copyEmbedPopoverRef=t,label:null===(l=null===(o=this.messages)||void 0===o?void 0:o.share)||void 0===l?void 0:l.label,referenceElement:"copyEmbedToClipboard",placement:this.inlineSuccessPopoverPlacement,scale:this.scale},this.renderEmbedSuccess())])}renderButton(){var t,i,s,a,n,o,l,r;const c=null!=this.shareButtonScale?this.shareButtonScale:this.scale;return"button"===this.shareButtonType?e("calcite-button",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:Jt.popoverButton,kind:this.shareButtonColor,appearance:"transparent",label:null===(i=null===(t=this.messages)||void 0===t?void 0:t.share)||void 0===i?void 0:i.label,title:null===(a=null===(s=this.messages)||void 0===s?void 0:s.share)||void 0===a?void 0:a.label,scale:c},e("div",{class:Jt.iconContainer},e("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale}))):e("calcite-action",{ref:t=>this.popoverButtonRef=t,onClick:this.togglePopover.bind(this),id:"shareButton",class:Jt.popoverButton,appearance:"transparent",label:null===(o=null===(n=this.messages)||void 0===n?void 0:n.share)||void 0===o?void 0:o.label,title:null===(r=null===(l=this.messages)||void 0===l?void 0:l.share)||void 0===r?void 0:r.label,scale:c,text:"",alignment:"center"},e("div",{class:Jt.iconContainer},e("calcite-icon",{icon:"share",scale:this.popoverButtonIconScale})))}renderSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return e("div",{class:Jt.success.container},e("span",{class:Jt.success.header},e("span",{class:Jt.success.icon},e("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),e("span",{class:Jt.success.message},this.successMessage||(null==i?void 0:i.url)))}renderEmbedSuccess(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.success;return e("div",{class:Jt.success.container},e("span",{class:Jt.success.header},e("span",{class:Jt.success.icon},e("calcite-icon",{icon:"check-circle-f",scale:this.scale})),null==i?void 0:i.label),e("span",{class:Jt.success.message},null==i?void 0:i.embed))}renderOptions(){var t,i,s,a;const n=null===(t=this.messages)||void 0===t?void 0:t.options,o="rtl"===document.dir?` ${Jt.rtl.optionText}`:"";return e("ul",{ref:t=>this.shareListRef=t,class:Jt.options,role:"menu"},e("li",{id:"copyToClipboard",onClick:this.handleShareItem.bind(this,"link"),onKeyDown:this.handleOptionKeyDown("link"),role:"menuitem",tabindex:"0"},e("span",{class:Jt.icon},e("calcite-icon",{icon:"link",scale:this.scale})),e("span",{class:`${Jt.optionText}${o}`},null===(i=null==n?void 0:n.link)||void 0===i?void 0:i.label)),this.socialMedia?[e("li",{onClick:this.handleShareItem.bind(this,"facebook"),onKeyDown:this.handleOptionKeyDown("facebook"),role:"menuitem",tabindex:"0"},e("span",{class:Jt.icon},this.renderFacebookIcon()),e("span",{class:`${Jt.optionText}${o}`},null===(s=null==n?void 0:n.facebook)||void 0===s?void 0:s.label)),e("li",{onClick:this.handleShareItem.bind(this,"x"),onKeyDown:this.handleOptionKeyDown("x"),role:"menuitem",tabindex:"0"},e("span",{class:Jt.icon},this.renderXIcon()),e("span",{class:`${Jt.optionText}${o}`},"X")),e("li",{onClick:this.handleShareItem.bind(this,"linkedIn"),onKeyDown:this.handleOptionKeyDown("linkedIn"),role:"menuitem",tabindex:"0"},e("span",{class:Jt.icon},this.renderLinkedInIcon()),e("span",{class:`${Jt.optionText}${o}`},null===(a=null==n?void 0:n.linkedIn)||void 0===a?void 0:a.label))]:null)}handleOptionKeyDown(t){return i=>{const e=i.code;("Space"===e||"Enter"===e)&&this.handleShareItem(t)}}renderFacebookIcon(){return e("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},e("g",null,e("path",{d:"M512,256c0,-141.385 -114.615,-256 -256,-256c-141.385,0 -256,114.615 -256,256c0,127.777 93.616,233.685 216,252.89l0,-178.89l-65,0l0,-74l65,0l0,-56.4c0,-64.16 38.219,-99.6 96.695,-99.6c28.009,0 57.305,5 57.305,5l0,63l-32.281,0c-31.801,0 -41.719,19.733 -41.719,39.978l0,48.022l71,0l-11.35,74l-59.65,0l0,178.89c122.385,-19.205 216,-125.113 216,-252.89Z",style:{fill:"#1877f2",fillRule:"nonzero"}}),e("path",{d:"M355.65,330l11.35,-74l-71,0l0,-48.022c0,-20.245 9.917,-39.978 41.719,-39.978l32.281,0l0,-63c0,0 -29.297,-5 -57.305,-5c-58.476,0 -96.695,35.44 -96.695,99.6l0,56.4l-65,0l0,74l65,0l0,178.89c13.033,2.045 26.392,3.11 40,3.11c13.608,0 26.966,-1.065 40,-3.11l0,-178.89l59.65,0Z",style:{fill:"#fff",fillRule:"nonzero"}})))}renderXIcon(){const t=!!this.el.closest(Yt);return e("svg",{class:t?Jt.xLogo.dark:Jt.xLogo.light,viewBox:"0 0 1200 1227",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("rect",{height:"400",style:{fill:"none"},width:"400",x:"56",y:"56"}),e("path",{d:"M714.163 519.284L1160.89 0H1055.03L667.137 450.887L357.328 0H0L468.492 681.821L0 1226.37H105.866L515.491 750.218L842.672 1226.37H1200L714.137 519.284H714.163ZM569.165 687.828L521.697 619.934L144.011 79.6944H306.615L611.412 515.685L658.88 583.579L1055.08 1150.3H892.476L569.165 687.854V687.828Z",fill:t?"white":"black"}))}renderLinkedInIcon(){return e("svg",{height:"100%",style:{fillRule:"evenodd",clipRule:"evenodd",strokeLinejoin:"round",strokeMiterlimit:"2"},version:"1.1",viewBox:"0 0 512 512",width:"100%",xmlns:"http://www.w3.org/2000/svg"},e("g",{id:"g5891"},e("path",{d:"M512,64c0,-35.323 -28.677,-64 -64,-64l-384,0c-35.323,0 -64,28.677 -64,64l0,384c0,35.323 28.677,64 64,64l384,0c35.323,0 64,-28.677 64,-64l0,-384Z",id:"background",style:{fill:"#2867b2"}}),e("g",{id:"shapes"},e("rect",{height:"257.962",id:"rect11",style:{fill:"#fff"},width:"85.76",x:"61.053",y:"178.667"}),e("path",{d:"M104.512,54.28c-29.341,0 -48.512,19.29 -48.512,44.573c0,24.752 18.588,44.574 47.377,44.574l0.554,0c29.903,0 48.516,-19.822 48.516,-44.574c-0.555,-25.283 -18.611,-44.573 -47.935,-44.573Z",id:"path13-0",style:{fill:"#fff",fillRule:"nonzero"}}),e("path",{d:"M357.278,172.601c-45.49,0 -65.866,25.017 -77.276,42.589l0,-36.523l-85.738,0c1.137,24.197 0,257.961 0,257.961l85.737,0l0,-144.064c0,-7.711 0.554,-15.42 2.827,-20.931c6.188,-15.4 20.305,-31.352 43.993,-31.352c31.012,0 43.436,23.664 43.436,58.327l0,138.02l85.741,0l0,-147.93c0,-79.237 -42.305,-116.097 -98.72,-116.097Z",id:"path15",style:{fill:"#fff",fillRule:"nonzero"}}))))}renderTip(){var t;const i=null===(t=this.messages)||void 0===t?void 0:t.info;return e("div",{class:Jt.tipContainer},e("span",{class:Jt.tipHeader},e("calcite-icon",{icon:"lightbulb",scale:this.scale}),e("span",null,null==i?void 0:i.label)),e("p",{class:Jt.tipContent},null==i?void 0:i.tooltip))}renderEmbed(){var t,i,s;const a=null===(t=this.messages)||void 0===t?void 0:t.embed,n="rtl"===document.dir?` ${Jt.rtl.textArea}`:"";return e("div",{class:Jt.embed.container},e("span",{class:Jt.embed.header},e("calcite-icon",{icon:"code",scale:this.scale}),e("span",null,null===(s=null===(i=this.messages)||void 0===i?void 0:i.embed)||void 0===s?void 0:s.label)),e("div",{class:Jt.embed.embedCode.container},e("div",{class:Jt.embed.embedCode.textArea},e("textarea",{ref:t=>this.embedCodeRef=t,cols:30,rows:5,readonly:!0,class:n,value:this.getEmbedCode()}),e("button",{id:"copyEmbedToClipboard",onClick:this.copyEmbedCode.bind(this),class:Jt.embed.embedCode.copyButton},e("calcite-icon",{icon:"copy",scale:this.scale}),e("span",null,null==a?void 0:a.copy))),e("span",{class:Jt.embed.textAreaText},e("slot",{name:"text-area-text"})),e("div",{class:Jt.embed.dimensions.container},e("label",{class:Jt.embed.dimensions.input},e("span",null,null==a?void 0:a.width),e("input",{ref:t=>this.embedWidthRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("width"),value:this.embedWidth,min:"1"})),e("label",{class:Jt.embed.dimensions.input},e("span",null,null==a?void 0:a.height),e("input",{ref:t=>this.embedHeightRef=t,type:"number",onKeyDown:t=>["e","E","+","-"].includes(t.key)&&t.preventDefault(),onChange:this.handleNumberInputOnChange("height"),value:this.embedHeight,min:"1"})))))}handleNumberInputOnChange(t){const i="width"===t?this.embedWidthRef:this.embedHeightRef,e="width"===t?"embedWidth":"embedHeight";return()=>{i&&parseFloat(i.value)<=0&&(this[e]=parseInt("1"),i.value="1")}}togglePopover(t){t.stopPropagation(),this.opened=!this.opened,this.popoverRef.open=this.opened}closePopover(){this.opened=!1,this.popoverRef.open=this.opened}async handleShareItem(t){var i,e,s,a;this.shareUrl=await this.generateShareUrl();let n=null;const o=null!==(e=null===(i=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===i?void 0:i.includes("Chrome"))&&void 0!==e&&e,l=null!==(a=null===(s=null===navigator||void 0===navigator?void 0:navigator.userAgent)||void 0===s?void 0:s.includes("Safari"))&&void 0!==a&&a&&!o;!l&&this.shortenShareUrl&&(n=await this.shortenUrl(this.shareUrl));let r=n||this.shareUrl;switch(t){case"link":return navigator.clipboard.writeText(r),this.embed&&(this.copyEmbedPopoverRef.open=!1,this.inlineCopyEmbedOpened=!1),"inline"===this.mode&&(this.copyLinkPopoverRef.open=!0,setTimeout((()=>this.copyLinkPopoverRef.open=!1),3e3)),this.inlineCopyLinkOpened=!0,this.copied=!0,void("popover"===this.mode&&setTimeout((()=>this.closePopover()),2e3));case"facebook":case"x":case"linkedIn":let i;l&&(i=window.open("","_blank"),this.shortenShareUrl&&(r=await this.shortenUrl(this.shareUrl)||r));const e={url:encodeURI(r)},s="x"===t?Object.assign(Object.assign({},e),{text:this.shareText}):e,[a]=await lt(["esri/intl"]),n=a.substitute(Xt[t],s);return"popover"===this.mode&&this.closePopover(),void(l&&i?(i.location=n,i.focus()):window.open(encodeURI(n),"_blank"))}}async shortenUrl(t){var i,e;const[s]=await lt(["esri/request"]),a=await s("https://arcg.is/prod/shorten",{query:{longUrl:t,f:"json"}}),n=null===(e=null===(i=null==a?void 0:a.data)||void 0===i?void 0:i.data)||void 0===e?void 0:e.url;if(n)return n.replace("http://","https://")}getEmbedCode(){return`<iframe src="${this.shareUrl}" width="${this.embedWidth}" height="${this.embedHeight}" frameborder="0" style="border:0" allowfullscreen>${this.iframeInnerText}</iframe>`}copyEmbedCode(){navigator.clipboard.writeText(this.getEmbedCode()),this.copyLinkPopoverRef.open=!1,this.inlineCopyLinkOpened=!1,this.copyEmbedPopoverRef.open=!0,setTimeout((()=>this.copyEmbedPopoverRef.open=!1),3e3),this.inlineCopyEmbedOpened=!0}async generateShareUrl(){var t;if(this.autoUpdateShareUrl&&(this.shareUrl=window.location.href),!this.view||!(null===(t=this.view)||void 0===t?void 0:t.ready))return this.shareUrl;const{x:i,y:e}=this.view.center,{spatialReference:s}=this.view,[a,n]=await lt(["esri/geometry/Point","esri/geometry/SpatialReference"]),o=new a({x:i,y:e,spatialReference:new n(Object.assign({},s.toJSON()))}),l=await this.processPoint(o),{isWGS84:r,isWebMercator:c}=l.spatialReference;return this.generateShareUrlParams(l,r||c)}async processPoint(t){const{isWGS84:i,isWebMercator:e}=t.spatialReference;if(i||e)return t;const[s,a]=await lt(["esri/geometry/SpatialReference","esri/geometry/projection"]),n=new s({wkid:4326});try{await a.load();const i=a.project(t,n);return Promise.resolve(i)}catch(t){return console.error("Failed to project point",t),Promise.reject(null)}}generateShareUrlParams(t,i){var e,s,a,n,o;const{longitude:l,latitude:r,x:c,y:h}=t;if(void 0===l||void 0===r)return this.shareUrl;const d=this.roundValue(i?l:c),p=this.roundValue(i?r:h),{zoom:u}=this.view,v=this.roundValue(u),m=null===(s=null===(e=this.view)||void 0===e?void 0:e.popup)||void 0===s?void 0:s.selectedFeature,f=null===(n=null===(a=this.view)||void 0===a?void 0:a.popup)||void 0===n?void 0:n.visible;let g,b,x;if(m&&f&&"feature"===(null===(o=null==m?void 0:m.layer)||void 0===o?void 0:o.type)){const t=null==m?void 0:m.layer;g=null==t?void 0:t.id,b=m.attributes[t.objectIdField]}x=this.view.map.allLayers.filter((t=>!t.visible)).toArray().map((t=>t.id)).toString().replaceAll(",",";");const{type:y}=this.view,{defaultUrlParams:w}=this,_=new URL(this.shareUrl),{searchParams:k}=_;if(k.get("center")&&k.delete("center"),k.get("level")&&k.delete("level"),k.get("selectedFeature")&&k.delete("selectedFeature"),k.get("hiddenLayers")&&k.delete("hiddenLayers"),k.get("viewpoint")&&k.delete("viewpoint"),"3d"===y){const{camera:t}=this.view,{heading:i,position:e,tilt:s}=t,{longitude:a,latitude:n,z:o}=e,l={longitude:this.roundValue(a,8),latitude:this.roundValue(n,8),z:this.roundValue(o,3),heading:this.roundValue(i,3),tilt:this.roundValue(s,3)};return!1!==(null==w?void 0:w.viewpoint)&&_.searchParams.set("viewpoint",`cam:${l.longitude},${l.latitude},${l.z};${l.heading},${l.tilt}`),g&&b&&!1!==(null==w?void 0:w.selectedFeature)&&_.searchParams.set("selectedFeature",`${g};${b}`),x&&!1!==(null==w?void 0:w.hiddenLayers)&&_.searchParams.set("hiddenLayers",x),_.search=decodeURIComponent(_.search),_.href}return!1!==(null==w?void 0:w.center)&&_.searchParams.set("center",`${d};${p}`),!1!==(null==w?void 0:w.level)&&_.searchParams.set("level",`${v}`),g&&b&&!1!==(null==w?void 0:w.selectedFeature)&&_.searchParams.set("selectedFeature",`${g};${b}`),x&&!1!==(null==w?void 0:w.hiddenLayers)&&_.searchParams.set("hiddenLayers",x),_.search=decodeURIComponent(_.search),_.href}roundValue(t,i=4){return parseFloat(t.toFixed(i))}get el(){return a(this)}};ti.style=":host{display:block;--instant-apps-social-share-action-width:initial;--instant-apps-social-share-width--s:200px;--instant-apps-social-share-width--m:280px;--instant-apps-social-share-width--l:320px;--instant-apps-social-share-width-horizontal--s:300px;--instant-apps-social-share-width-horizontal--m:380px;--instant-apps-social-share-width-horizontal--l:420px;--instant-apps-social-share-background-color:var(--calcite-color-foreground-1);--instant-apps-social-share-popover-button-background-color:transparent;--instant-apps-social-share-popover-button-icon-color:var(--calcite-ui-icon-color);--instant-apps-social-share-embed-border:1px solid $border;--instant-apps-social-share-embed-text-area-text:#468540}:host .instant-apps-social-share__popover-button{background-color:var(--instant-apps-social-share-popover-button-background-color)}:host .instant-apps-social-share__popover-button calcite-icon{color:var(--instant-apps-social-share-popover-button-icon-color)}:host .instant-apps-social-share__dialog,:host .instant-apps-social-share__dialog-embed{background-color:var(--instant-apps-social-share-background-color);border:var(--instant-apps-social-share-embed-border)}:host .instant-apps-social-share__dialog{box-sizing:border-box;height:auto;padding:10px 0;border-radius:5px;color:var(--calcite-color-text-1)}:host .instant-apps-social-share__options{margin:0;padding:1% 0 0 0;list-style-type:none}:host .instant-apps-social-share__options li{box-sizing:border-box;display:flex;align-items:center;width:100%;padding:5%;transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__options li .instant-apps-social-share__icon,:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{display:inline-block}:host .instant-apps-social-share__options li .instant-apps-social-share__icon{display:flex;align-items:center}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text{width:85%;margin-left:10px;word-break:break-word}:host .instant-apps-social-share__options li .instant-apps-social-share__option-text--rtl{margin-left:0;margin-right:10px}:host .instant-apps-social-share__options li:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2)}:host .instant-apps-social-share__options__x-logo--light path{fill:#000000}:host .instant-apps-social-share__options__x-logo--dark path{fill:#ffffff}:host .instant-apps-social-share__tip{box-sizing:border-box;padding:0 5% 1% 5%}:host .instant-apps-social-share__tip-header{display:flex;align-items:center;color:#007ac2;margin:8px 0 5px 0}:host .instant-apps-social-share__tip-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__tip-content{line-height:17px;margin:0;padding-top:2%}:host .instant-apps-social-share__success{display:flex;flex-direction:column;padding:15px}:host .instant-apps-social-share__success-header{display:flex;align-items:center;font-weight:bold;margin-bottom:10px}:host .instant-apps-social-share__success-icon{display:flex;align-items:center;margin-right:5px}:host .instant-apps-social-share__success-icon calcite-icon{color:var(--calcite-color-status-success)}:host .instant-apps-social-share__success-message{line-height:16px}:host .instant-apps-social-share__embed{box-sizing:border-box;width:100%;padding:5%;margin-bottom:10px;border-top:1px solid #d3d3d3}:host .instant-apps-social-share__embed-header{display:flex;align-items:center;margin-bottom:5px}:host .instant-apps-social-share__embed-header calcite-icon{margin-right:5px}:host .instant-apps-social-share__embed-code-text-area{border:1px solid #d3d3d3}:host .instant-apps-social-share__embed-code-text-area textarea{box-sizing:border-box;padding:4%;border:none;resize:none;background:transparent;width:100%;font-family:var(--calcite-sans-family);color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button{display:flex;align-items:center;text-align:start;width:100%;border:none;border-top:1px solid #d3d3d3;background-color:transparent;line-height:16px;font-weight:400;padding:3%;color:var(--calcite-color-text-1)}:host .instant-apps-social-share__embed-code-text-area button calcite-icon{color:#007ac2;margin-right:3px}:host .instant-apps-social-share__embed-code-text-area button:hover{cursor:pointer;background-color:var(--calcite-color-foreground-2);transition:background-color 0.15s ease-out 0s}:host .instant-apps-social-share__embed-text-area-text{font-weight:600;color:var(--instant-apps-social-share-embed-text-area-text)}:host .instant-apps-social-share__embed .instant-apps-social-share__text-area--rtl{text-align:left;direction:ltr}:host .instant-apps-social-share__embed-dimensions{display:flex;justify-content:space-between;margin-top:10px}:host .instant-apps-social-share__embed-dimensions-input{width:47%;box-sizing:border-box}:host .instant-apps-social-share__embed-dimensions-input input{border:1px solid #d3d3d3;width:100%;height:25px;font-family:var(--calcite-sans-family)}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options{display:flex;justify-content:space-around;margin-bottom:8%}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li{flex-direction:column;padding:0}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li .instant-apps-social-share__option-text{word-break:break-word;margin-left:0;margin-top:10px;text-align:center}:host .instant-apps-social-share__layout--horizontal .instant-apps-social-share__options li:hover{background-color:unset}:host .instant-apps-social-share__icon-container{display:flex;align-items:center}:host calcite-action{width:var(--instant-apps-social-share-action-width)}:host([scale=s]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--s)}:host([scale=s]) .instant-apps-social-share__icon{width:16px;height:16px}:host([scale=s]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size--1)}:host([scale=s]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--s)}:host([scale=s]) .instant-apps-social-share__tip-header,:host([scale=s]) .instant-apps-social-share__tip-content,:host([scale=s]) .instant-apps-social-share__embed-header,:host([scale=s]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--2)}:host([scale=m]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--m)}:host([scale=m]) .instant-apps-social-share__icon{width:24px;height:24px}:host([scale=m]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-0)}:host([scale=m]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--m)}:host([scale=m]) .instant-apps-social-share__tip-header,:host([scale=m]) .instant-apps-social-share__tip-content,:host([scale=m]) .instant-apps-social-share__embed-header,:host([scale=m]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size--1)}:host([scale=l]) .instant-apps-social-share__dialog{width:var(--instant-apps-social-share-width--l)}:host([scale=l]) .instant-apps-social-share__icon{width:32px;height:32px}:host([scale=l]) .instant-apps-social-share__option-text{font-size:var(--calcite-font-size-1)}:host([scale=l]) .instant-apps-social-share__dialog.instant-apps-social-share__layout--horizontal{width:var(--instant-apps-social-share-width-horizontal--l)}:host([scale=l]) .instant-apps-social-share__tip-header,:host([scale=l]) .instant-apps-social-share__tip-content,:host([scale=l]) .instant-apps-social-share__embed-header,:host([scale=l]) .instant-apps-social-share__embed-dimensions-input{font-size:var(--calcite-font-size-0)}";export{Ct as calcite_block,Pt as calcite_date_picker,Ht as calcite_input_date_picker,Gt as instant_apps_filter_list,ti as instant_apps_social_share}
@@ -1,6 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,c as i,g as s,a as e,h as a,H as l}from"./p-4e6eb06e.js";import{b as o,c as n,a as h}from"./p-80cb7c73.js";import{l as c,g as r}from"./p-f4aadb3b.js";import{e as d,h as p}from"./p-d572627c.js";import{s as g}from"./p-51c6e6fe.js";import{c as b,r as m}from"./p-ff9e28d1.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dc9d4be3.js";import"./p-7530a02f.js";import"./p-d0d020a5.js";import"./p-9bb44f57.js";const u=class{constructor(s){t(this,s),this.searchConfigurationChange=i(this,"searchConfigurationChange",7),this.addresseeLayerIds=[],this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.defaultExportTitle="",this.defaultNumLabelsPerPage=6,this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.featureEffect=void 0,this.featureHighlightEnabled=void 0,this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionLayerIds=[],this.showRefineSelection=!1,this.showSearchSettings=!0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._exportGraphics=!1,this._addMap=!1,this._addResults=!0,this._addTitle=!1,this._downloadActive=!0,this._exportType=o.PDF,this._fetchingData=!1,this._isMobile=void 0,this._numDuplicates=0,this._pageType=n.LIST,this._saveEnabled=!1,this._selectionSets=[],this._translations=void 0}get el(){return s(this)}_activeSelection;_downloadTools;_geometryEngine;Graphic;_jsonUtils;_onboardingImageUrl="";_popupsEnabled;_removeDuplicates;_searchConfiguration;_selectTools;_mediaQuery;_titleElement;_titleValue=void 0;_numSelected=0;async mapViewWatchHandler(t){t?.popup&&(this._popupsEnabled=t?.popup.autoOpenEnabled),this._initSearchConfiguration(this.searchConfiguration)}async watchSearchConfigurationHandler(t,i){const s=JSON.stringify(t);this.mapView&&(s!==JSON.stringify(i)||s&&!this._searchConfiguration)&&(this._searchConfiguration=JSON.parse(s),this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}async sketchLineSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setLineSymbol(t)}async sketchPointSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPointSymbol(t)}async sketchPolygonSymbolWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._setPolygonSymbol(t)}async pageTypeWatchHandler(t,i){if(this._checkPopups(),this.mapView?.popup&&(this.mapView.popupEnabled=t===n.LIST&&this._popupsEnabled),t===n.EXPORT&&(this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._updateExportGraphics(),this._fetchingData=!1),this._clearHighlight(),i!==n.SELECT&&i!==n.REFINE||await this._clearSelection(),i===n.EXPORT&&this._removeExportGraphics(),t!==n.SELECT)return this._highlightFeatures()}searchConfigurationChange;selectionSetsChanged(t){this._selectionSets=[...t.detail]}connectedCallback(){this._mediaQuery=window.matchMedia("(max-width: 600px)"),this._mediaQuery.addEventListener("change",(t=>this._setIsMobile(t)))}async componentWillLoad(){await this._getTranslations(),await this._initModules(),this._initSymbols(),this._onboardingImageUrl=e("assets/data/images/onboarding.png")}render(){return a(l,{key:"8b22f6b45144705e9ff5b230ca8075f68985165b"},a("calcite-shell",{key:"774731e643edb5b52bf565349fdfe58dae1e845e"},a("calcite-action-bar",{key:"5e3bcc6ba2f53d25ee2bd972ce67108c0ab808f4",class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:this._isMobile?"footer":"header"},this._getActionGroup("list-check",n.LIST,this._translations.myLists),this.showRefineSelection?this._getActionGroup("test-data",n.REFINE,this._translations.refineSelection):null,this._getActionGroup("export",n.EXPORT,this._translations.export)),this._getPage(this._pageType)))}async componentDidLoad(){this._initSearchConfiguration(this.searchConfiguration)}disconnectedCallback(){this._mediaQuery.removeEventListener("change",(t=>this._setIsMobile(t)))}async _initModules(){const[t,i,s]=await c(["esri/geometry/geometryEngine","esri/symbols/support/jsonUtils","esri/Graphic"]);this._geometryEngine=t,this._jsonUtils=i,this.Graphic=s}_initSearchConfiguration(t){this.searchConfiguration&&!this._searchConfiguration&&this.mapView&&(this._searchConfiguration=t,this.searchConfigurationChange.emit(this._searchConfiguration),this._home())}_initSymbols(){this._setLineSymbol(this.sketchLineSymbol),this._setPointSymbol(this.sketchPointSymbol),this._setPolygonSymbol(this.sketchPolygonSymbol)}_setLineSymbol(t){this.sketchLineSymbol="simple-line"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSLS",color:[130,130,130,255],width:2,style:"esriSLSSolid"})}_setPointSymbol(t){this.sketchPointSymbol="simple-marker"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSMS",color:[255,255,255,255],angle:0,xoffset:0,yoffset:0,size:6,style:"esriSMSCircle",outline:{type:"esriSLS",color:[50,50,50,255],width:1,style:"esriSLSSolid"}})}_setPolygonSymbol(t){this.sketchPolygonSymbol="simple-fill"===t?.type?t:this._jsonUtils.fromJSON(t||{type:"esriSFS",color:[150,150,150,51],outline:{type:"esriSLS",color:[50,50,50,255],width:2,style:"esriSLSSolid"},style:"esriSFSSolid"})}_setIsMobile(t){this._isMobile=t.matches}_getActionGroup(t,i,s){return a("calcite-action-group",{class:this.showRefineSelection?"w-1-3":"w-1-2",layout:"horizontal"},a("div",{class:"background-override"},a("calcite-action",{active:this._pageType===i,alignment:"center",class:"width-full height-full",compact:!1,icon:t,id:t,onClick:()=>{this._setPageType(i)},text:""})),a("calcite-tooltip",{label:"",placement:"bottom","reference-element":t},a("span",null,s)))}_setPageType(t){this._pageType=t}_getPage(t){let i;switch(t){case n.LIST:i=this._getListPage();break;case n.SELECT:i=this._getSelectPage();break;case n.EXPORT:i=this._getExportPage();break;case n.REFINE:i=this._getRefinePage()}return i}_getListPage(){const t=this._hasSelections();return a("calcite-panel",null,this._getLabel(this._translations.myLists),this._getNotice(t?this._translations.listHasSetsTip:this._translations.selectLayerAndAdd,"padding-sides-1 padding-bottom-1","word-wrap-anywhere"),t?this._getSelectionSetList():this._getOnboardingImage(),a("div",{class:"display-flex padding-1"},a("calcite-button",{onClick:()=>{this._setPageType(n.SELECT)},width:"full"},a("span",{class:"font-weight-500"},this._translations.add))))}_getOnboardingImage(){return a("div",{class:"display-flex padding-sides-1"},a("img",{class:"img-container",role:"presentation",src:this._onboardingImageUrl}))}_getSelectionSetList(){return a("div",{class:"padding-top-1-2 padding-bottom-1-2"},a("calcite-list",{class:"list-border margin-sides-1"},this._selectionSets.reduce(((t,i,s)=>{const e=this._getSelectionSetIds(i);let l=!0;return i.workflowType===h.REFINE&&(l=Object.keys(i.refineInfos).reduce(((t,s)=>{const e=i.refineInfos[s];return t+(e.addIds.length+e.removeIds.length)}),0)>0),l&&t.push(a("calcite-list-item",{label:i.label,onClick:()=>this._gotoSelection(i,this.mapView)},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",e.length.toString()))),this._getAction(!0,"pencil","",(t=>this._openSelection(i,t)),!1,"actions-end"),this._getAction(!0,"x","",(t=>this._deleteSelection(s,t)),!1,"actions-end"))),t}),[])))}_getSelectionSetIds(t){return t.workflowType!==h.REFINE?t.selectedIds:Object.keys(t.refineInfos).reduce(((i,s)=>[...i,...t.refineInfos[s].addIds]),[])}_hasSelections(t=!1){let i=[];const s=this._selectionSets.some((t=>{if(t.workflowType===h.REFINE)return i=this._getSelectionSetIds(t),!0}));return t&&s?i.length>0||this._selectionSets.length>1:this._selectionSets.length>0}async _getNumDuplicates(){const t=this._getExportInfos(),i=await b(this.mapView.map,t),s=m(i);return i.length-s.length}_getExportInfos(){return this._selectionSets.reduce(((t,i)=>(i.download&&(i.workflowType!==h.REFINE?this._updateIds(i.layerView.layer.id,i.layerView,i.selectedIds,t):Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds.length>0&&this._updateIds(s,e.layerView,e.addIds,t)}))),t)),{})}_updateIds(t,i,s,e){return e[t]?e[t].ids=e[t].ids.concat(s):e[t]={layerView:i,ids:s},e}_getSelectPage(){const t=this._translations.selectSearchTip;return a("calcite-panel",null,this._getLabel(this._translations.stepTwoFull,!0),this._getNotice(t,"padding-1","word-wrap-anywhere"),a("div",null,a("map-select-tools",{bufferColor:this.bufferColor,bufferOutlineColor:this.bufferOutlineColor,class:"font-bold",customLabelEnabled:this.customLabelEnabled,defaultBufferDistance:this.defaultBufferDistance,defaultBufferUnit:this.defaultBufferUnit,enableLayerFeatures:this.enableLayerFeatures,enableLayerFeaturesOnLoad:this.enableLayerFeaturesOnLoad,enableSearchDistance:this.enableSearchDistance,enableSearchDistanceOnLoad:this.enableSearchDistanceOnLoad,enableSketchTools:this.enableSketchTools,enabledLayerIds:this.addresseeLayerIds,isUpdate:!!this._activeSelection,locale:this.locale,mapView:this.mapView,noResultText:this.noResultText,onSelectionSetChange:t=>this._updateForSelection(t),ref:t=>{this._selectTools=t},searchConfiguration:this._searchConfiguration,selectionLayerIds:this.selectionLayerIds,selectionSet:this._activeSelection,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})),this._getPageNavButtons(this._translations.done,0===this._numSelected,(()=>{this._saveSelection()}),this._translations.cancel,!1,(()=>{this._home()})))}_getExportPage(){const t=this._hasSelections(this.showRefineSelection),i=this._numDuplicates>0?"display-block":"display-none";return a("calcite-panel",null,a("div",null,this._getLabel(this._translations.export,!1),t?a("div",null,this._getNotice(this._translations.exportTip,"padding-sides-1"),this._getLabel(this._translations.exportListsLabel),this._getExportSelectionLists(),a("div",{class:"padding-sides-1 "+i},a("div",{class:"display-flex"},a("calcite-label",{layout:"inline"},a("calcite-checkbox",{ref:t=>{this._removeDuplicates=t}}),a("div",{class:"display-flex"},this._translations.removeDuplicate,a("div",{class:"info-message padding-start-1-2"},a("calcite-input-message",{class:"info-blue margin-top-0",scale:"m"},` ${this._translations.numDuplicates.replace("{{n}}",this._numDuplicates.toString())}`)))),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"remove-duplicates-icon",scale:"s"})),a("calcite-popover",{closable:!0,label:"",referenceElement:"remove-duplicates-icon"},a("span",{class:"tooltip-message"},this._translations.duplicatesTip))),a("div",{class:"border-bottom"}),a("div",{class:"padding-top-sides-1"},a("calcite-segmented-control",{class:"w-100",onCalciteSegmentedControlChange:t=>this._exportTypeChange(t),width:"full"},a("calcite-segmented-control-item",{checked:this._exportType===o.PDF,class:"w-50 end-border",value:o.PDF},a("span",{class:"font-weight-500"},this._translations.pdf)),a("calcite-segmented-control-item",{checked:this._exportType===o.CSV,class:"w-50",value:o.CSV},a("span",{class:"font-weight-500"},this._translations.csv)))),a("div",{class:"padding-bottom-1"},this._getExportOptions()),a("div",{class:"padding-1 display-flex"},a("calcite-button",{disabled:!this._downloadActive||this._fetchingData||!this._addMap&&!this._addResults,loading:this._fetchingData,onClick:()=>{this._export()},width:"full"},a("span",{class:"font-weight-500"},this._translations.export)))):this._getNotice(this._translations.downloadNoLists,"padding-sides-1 padding-bottom-1")))}_exportTypeChange(t){this._exportType=t.target.value}_getExportOptions(){const t=this._addTitle?"display-block":"display-none",i=this._addMap?"display-flex":"display-none",s=this._titleValue?this._titleValue:this.defaultExportTitle?this.defaultExportTitle:"",e=this._addResults?"":"display-none";return a("div",{class:this._exportType===o.PDF?"display-block":"display-none"},this._getLabel(this._translations.pdfOptions,!0),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addResults,onCalciteCheckboxChange:()=>this._addResults=!this._addResults}),this._translations.addResults)),a("div",{class:`padding-top-sides-1 ${e}`},a("calcite-label",{class:"label-margin-0"},this._translations.selectPDFLabelOption)),a("div",{class:`padding-sides-1 ${e}`},a("pdf-download",{defaultNumLabelsPerPage:parseInt(this.defaultNumLabelsPerPage.toString(),10),disabled:!this._downloadActive,ref:t=>{this._downloadTools=t}})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addTitle,onCalciteCheckboxChange:()=>this._addTitle=!this._addTitle}),this._translations.title)),a("div",{class:t},this._getLabel(this._translations.title,!0,""),a("calcite-input-text",{class:"padding-sides-1",onCalciteInputTextInput:()=>this._changeTitle(),placeholder:this._translations.titlePlaceholder,ref:t=>{this._titleElement=t},value:s})),a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._addMap,onCalciteCheckboxChange:()=>this._handleAddMapChange()}),this._translations.includeMap)),a("div",{class:`padding-top-sides-1 ${i}`},a("calcite-label",{class:"label-margin-0",layout:"inline"},a("calcite-checkbox",{checked:this._exportGraphics,onCalciteCheckboxChange:()=>this._handleExportGraphicsChange()}),this._translations.listGraphics),a("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"list-graphics-icon",scale:"s"}),a("calcite-popover",{closable:!0,label:"",referenceElement:"list-graphics-icon"},a("span",{class:"tooltip-message"},this._translations.listGraphicsTip))))}_handleAddMapChange(){this._addMap=!this._addMap,this._updateExportGraphics()}_handleExportGraphicsChange(){this._exportGraphics=!this._exportGraphics,this._updateExportGraphics()}_getManagedLayer(t){let i;return Object.keys(g.managedLayers).some((s=>{const e=this.mapView.map.layers.findIndex((t=>t.title===s));if(g.managedLayers[s]===t)return i=this.mapView.map.layers.getItemAt(e),!0})),i}_updateExportGraphics(t=!1){!t&&this._exportGraphics&&this._addMap||this._removeExportGraphics(),this._exportGraphics&&this._addMap&&this._addExportGraphics()}_removeExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");t&&t.graphics.removeAll(),i&&i.graphics.removeAll()}_addExportGraphics(){const t=this._getManagedLayer("sketch"),i=this._getManagedLayer("buffer");this._selectionSets.forEach((s=>{if(s.download&&(t&&t.graphics.add(s.sketchGraphic),i)){const t=new this.Graphic({geometry:s.buffer,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});i.graphics.add(t)}}))}_getRefinePage(){const t=this._hasSelections();return a("calcite-panel",null,this._getLabel(this._translations.refineSelection),t?a("div",null,this._getNotice(this._translations.refineTip,"padding-sides-1"),a("refine-selection",{enabledLayerIds:this.selectionLayerIds,locale:this.locale,mapView:this.mapView,selectionSets:this._selectionSets,sketchLineSymbol:this.sketchLineSymbol,sketchPointSymbol:this.sketchPointSymbol,sketchPolygonSymbol:this.sketchPolygonSymbol})):this._getNotice(this._translations.refineTipNoSelections,"padding-sides-1"))}_getPageNavButtons(t,i,s,e,l,o){return a("div",{class:"padding-bottom-1"},a("div",{class:"display-flex padding-top-sides-1"},a("calcite-button",{disabled:i,onClick:s,width:"full"},a("span",{class:"font-weight-500"},t))),a("div",{class:"display-flex padding-top-1-2 padding-sides-1"},a("calcite-button",{appearance:"outline",disabled:l,onClick:o,width:"full"},a("span",{class:"font-weight-500"},e))))}_changeTitle(){this._titleValue=this._titleElement.value}_getNotice(t,i="padding-1",s=""){return a("calcite-notice",{class:i,icon:"lightbulb",kind:"success",open:!0},a("div",{class:s,slot:"message"},t))}_getLabel(t,i=!1,s="font-bold"){return a("div",{class:"padding-top-sides-1"},a("calcite-label",{class:s+=i?" label-margin-0":""},t))}_getExportSelectionLists(){return this._selectionSets.reduce(((t,i)=>{const s=this._getSelectionSetIds(i),e=i.workflowType!==h.REFINE||s.length>0;return!this._downloadActive&&i.download&&e&&(this._downloadActive=!0),e&&t.push(a("div",{class:"display-flex padding-sides-1 padding-bottom-1"},a("calcite-checkbox",{checked:i.download,class:"align-center",onClick:()=>{this._toggleDownload(i.id)}}),a("calcite-list",{class:"list-border margin-start-1-2 width-full",id:"download-list"},a("calcite-list-item",{disabled:!i.download,label:i.label,onClick:()=>{this._toggleDownload(i.id)}},a("div",{slot:"content"},a("div",{class:"list-label"},i.label),a("div",{class:"list-description"},i?.layerView?.layer.title),a("div",{class:"list-description"},this._translations.selectedFeatures.replace("{{n}}",s.length.toString()))))))),t}),[])||a("div",null)}async _toggleDownload(t){let i=!1;this._selectionSets=this._selectionSets.map((s=>(s.download=s.id===t?!s.download:s.download,i=!!s.download||i,s))),this._updateExportGraphics(!0),this._downloadActive=i,this._fetchingData=!0,this._numDuplicates=await this._getNumDuplicates(),this._fetchingData=!1,await this._highlightFeatures()}async _export(){const t=this._addResults?this._getSelectionIdsAndViews(this._selectionSets,!0):{};if(this._exportType===o.PDF){let i="";if(this._addMap&&this.mapView){const t=await this.mapView.takeScreenshot({width:1500,height:2e3});i=t?.dataUrl}this._fetchingData=!0,await this._downloadTools.downloadPDF(this.mapView.map,t,this._removeDuplicates.checked,this._addTitle?this._titleElement.value:"",i),this._fetchingData=!1}this._exportType===o.CSV&&(this._fetchingData=!0,await this._downloadTools.downloadCSV(this.mapView.map,t,this._removeDuplicates.checked),this._fetchingData=!1)}_getSelectionIdsAndViews(t,i=!1){return(i?t.filter((t=>t.download)):t).reduce(((t,i)=>{if(i.workflowType===h.REFINE)Object.keys(i.refineInfos).forEach((s=>{const e=i.refineInfos[s];e.addIds&&(t=this._updateExportInfos(t,e.layerView.layer.id,i.label,e.addIds,e.layerView))}));else{const s=i?.layerView?.layer.id;t=this._updateExportInfos(t,s,i.label,i.selectedIds,i.layerView)}return t}),{})}_updateExportInfos(t,i,s,e,a){return i&&Object.keys(t).indexOf(i)>-1?(t[i].ids=[...new Set([...t[i].ids,...e])],t[i].selectionSetNames.push(s)):i&&(t[i]={ids:e,layerView:a,selectionSetNames:[s]}),t}_getAction(t,i,s,e,l=!1,o=""){return a("calcite-action",{disabled:!t,icon:i,iconFlipRtl:!0,indicator:l,onClick:e,slot:o,text:s})}_updateForSelection(t){this._numSelected=t.detail,this._saveEnabled=this._numSelected>0}async _home(){await this._clearSelection(),this._setPageType(n.LIST)}async _saveSelection(){const t=await(this._selectTools?.getSelection()),i=this._selectTools?.isUpdate;return this._selectionSets=i?this._selectionSets.map((i=>i.id===t.id?t:i)):[...this._selectionSets,t],this._home()}async _clearSelection(){await(this._selectTools?.clearSelection()),this._numSelected=0,this._activeSelection=void 0}_deleteSelection(t,i){return i.stopPropagation(),this._selectionSets=this._selectionSets.filter(((i,s)=>{if(s!==t)return i})),this._highlightFeatures()}_gotoSelection(t,i){d(t.selectedIds,t.layerView,i,this.featureHighlightEnabled,this.featureEffect)}_openSelection(t,i){i.stopPropagation(),this._activeSelection=t,this._pageType=t.workflowType===h.REFINE?n.REFINE:n.SELECT}async _highlightFeatures(){this._clearHighlight();const t=this._getSelectionIdsAndViews(this._selectionSets,this._pageType===n.EXPORT),i=Object.keys(t);if(i.length>0)for(let s=0;s<i.length;s++){const e=t[i[s]];g.highlightHandles.push(await p(e.ids,e.layerView,this.mapView))}}_checkPopups(){"boolean"!=typeof this._popupsEnabled&&(this._popupsEnabled=this.mapView?.popupEnabled)}_clearHighlight(){g&&g.highlightHandles&&g.removeHandles()}async _getTranslations(){const t=await r(this.el);this._translations=t[0]}static get watchers(){return{mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"],sketchLineSymbol:["sketchLineSymbolWatchHandler"],sketchPointSymbol:["sketchPointSymbolWatchHandler"],sketchPolygonSymbol:["sketchPolygonSymbolWatchHandler"],_pageType:["pageTypeWatchHandler"]}}};u.style=':host{display:block;--calcite-input-message-spacing-value:0}.align-center{align-items:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.action-bar-size{height:3.5rem;width:100%}.w-1-2{width:50%}.w-1-3{width:33.33%}.width-full{width:100%}.height-full{height:100%}.padding-1{padding:1rem}.padding-top-sides-1{padding-block-start:1rem;padding-inline-start:1rem;padding-inline-end:1rem}.padding-sides-1{padding-inline-start:1rem;padding-inline-end:1rem}.padding-end-1-2{padding-inline-end:.5rem}.padding-top-1-2{padding-block-start:.5rem}.padding-top-1{padding-top:1rem}.padding-bottom-1{padding-bottom:1rem}.padding-bottom-1-2{padding-bottom:.5rem}.info-blue{color:#00A0FF}.info-message{justify-content:center;display:grid}.font-bold{font-weight:bold}.display-flex{display:flex}.display-block{display:block}.display-none{display:none}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.padding-start-1-2{padding-inline-start:0.5rem}.list-border{border:1px solid var(--calcite-color-border-2)}.margin-sides-1{margin-inline-start:1rem;margin-inline-end:1rem}.margin-start-1-2{margin-inline-start:0.5rem}.float-right{float:right}.float-right[dir="rtl"]{float:left}.float-left{float:left}.float-left[dir="rtl"]{float:right}.margin-top-0{margin-block-start:0 !important}.height-1-1-2{height:1.5rem}.main-background{background-color:var(--calcite-color-foreground-2)}.position-right{position:absolute;right:1rem}.position-right[dir="rtl"]{position:absolute;left:1rem}.label-margin-0{--calcite-label-margin-bottom:0}.list-label{color:var(--calcite-color-text-1)}.list-label,.list-description{font-family:var(--calcite-sans-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal);overflow-wrap:break-word;word-break:break-word}.list-description{margin-block-start:0.125rem;color:var(--calcite-color-text-3)}.img-container{width:100%;height:100%}.font-weight-500{font-weight:500}.background-override{height:100%;width:100%;--calcite-color-foreground-3:var(--calcite-color-brand);--calcite-color-foreground-2:var(--calcite-color-brand-hover);--calcite-color-text-1:var(--calcite-color-text-inverse)}.word-wrap-anywhere{word-wrap:anywhere}';export{u as public_notification}
@@ -1,11 +0,0 @@
1
- /*!
2
- * Copyright 2022 Esri
3
- * Licensed under the Apache License, Version 2.0
4
- * http://www.apache.org/licenses/LICENSE-2.0
5
- */
6
- import{r as t,h as i,g as s,c as e,F as a}from"./p-4e6eb06e.js";import{c as h}from"./p-ff336351.js";import{c as n,s as c,a as o}from"./p-ad9d1221.js";import{l as r,g as l,f as d}from"./p-f4aadb3b.js";import{b as f,d as p,a as m,c as b}from"./p-d572627c.js";import"./p-4f82eb55.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-80cb7c73.js";
7
- /*!
8
- * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
- * See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
10
- * v2.13.0
11
- */const y="frame",u="frame--advancing",g="frame--retreating",w=class{constructor(i){t(this,i),this.itemMutationObserver=h("mutation",(()=>this.updateFlowProps())),this.getFlowDirection=(t,i)=>t&&i>1||t>1?i<t?"retreating":"advancing":null,this.updateFlowProps=()=>{const{customItemSelectors:t,el:i,items:s}=this,e=Array.from(i.querySelectorAll("calcite-flow-item"+(t?`,${t}`:""))).filter((t=>t.closest("calcite-flow")===i)),a=s.length,h=e.length,n=e[h-1],c=e[h-2];if(h&&n&&e.forEach((t=>{t.showBackButton=t===n&&h>1,t.hidden=t!==n})),c&&(c.menuOpen=!1),this.items=e,a!==h){const t=this.getFlowDirection(a,h);this.itemCount=h,this.flowDirection=t}},this.customItemSelectors=void 0,this.flowDirection=null,this.itemCount=0,this.items=[]}async back(){const{items:t}=this,i=t[t.length-1];if(!i)return;const s=i.beforeBack?i.beforeBack:()=>Promise.resolve();try{await s.call(i)}catch(t){return}return i.remove(),i}async setFocus(){await n(this);const{items:t}=this,i=t[t.length-1];return i?.setFocus()}connectedCallback(){this.itemMutationObserver?.observe(this.el,{childList:!0,subtree:!0}),this.updateFlowProps()}async componentWillLoad(){c(this)}componentDidLoad(){o(this)}disconnectedCallback(){this.itemMutationObserver?.disconnect()}async handleItemBackClick(t){if(!t.defaultPrevented)return await this.back(),this.setFocus()}render(){const{flowDirection:t}=this;return i("div",{key:"01fbee965d48cb54fa5bd1b53a3435538df84332",class:{[y]:!0,[u]:"advancing"===t,[g]:"retreating"===t}},i("slot",{key:"495880eceeb04387dd1352aa00337f037ab0636c"}))}get el(){return s(this)}};w.style=":host{box-sizing:border-box;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);font-size:var(--calcite-font-size--1)}:host *{box-sizing:border-box}:host{position:relative;display:flex;inline-size:100%;flex:1 1 auto;align-items:stretch;overflow:hidden;background-color:transparent}:host .frame{position:relative;margin:0px;display:flex;inline-size:100%;flex:1 1 auto;flex-direction:column;align-items:stretch;padding:0px}:host ::slotted(calcite-flow-item),:host ::slotted(calcite-panel){block-size:100%}:host ::slotted(.calcite-match-height:last-child){display:flex;flex:1 1 auto;overflow:hidden}:host .frame--advancing{animation:calcite-frame-advance var(--calcite-animation-timing)}:host .frame--retreating{animation:calcite-frame-retreat var(--calcite-animation-timing)}@keyframes calcite-frame-advance{0%{--tw-bg-opacity:0.5;transform:translate3d(50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}@keyframes calcite-frame-retreat{0%{--tw-bg-opacity:0.5;transform:translate3d(-50px, 0, 0)}100%{--tw-bg-opacity:1;transform:translate3d(0, 0, 0)}}:host([hidden]){display:none}[hidden]{display:none}";const k=class{constructor(i){t(this,i),this.success=e(this,"success",7),this.fail=e(this,"fail",7),this.isActionPending=e(this,"isActionPending",7),this.formReady=e(this,"formReady",7),this.mapView=void 0,this.table=void 0,this.selectedFeature=void 0,this.customizeSubmit=!1,this.showGuidingMsg=!0,this._editorLoading=!1,this._translations=void 0}get el(){return s(this)}Editor;_editor;reactiveUtils;_container;_addingAttachment;_isSubmitBtnClicked=!1;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this.init()}))}async _editorLoadingWatchHandler(t){t&&(this._container?.classList.add("display-none"),await this.startCreate(),this._container?.classList.remove("display-none"),this._editorLoading=!1)}async submit(){this._editor&&(this._isSubmitBtnClicked=!0,this._editor.viewModel.featureFormViewModel.submit())}success;fail;isActionPending;formReady;async componentWillLoad(){await this._getTranslations(),await this.initModules()}async init(){this.mapView&&await this.createEditorWidget()}async initModules(){const[t,i]=await r(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}render(){const t=this._editorLoading?"":"display-none";return i(a,{key:"641b4f6f51bce04b6263a1d7dc72a31839df970d"},this.showGuidingMsg&&i("calcite-notice",{key:"1a6e577bcc0632a7bc69dd411a692062a7ad176e",class:"notice-msg",icon:"lightbulb",kind:"success",open:!0},i("div",{key:"55c5836314fcca69a259be3a36e34c527edcabf3",slot:"message"},this._translations.provideDetailsMsg)),i("calcite-loader",{key:"18c5603a4a75c67a160a71caa15e94790f66d60b",class:t,label:"",scale:"s"}))}async componentDidLoad(){await this.init()}disconnectedCallback(){this._editor&&this._editor.destroy()}async createEditorWidget(){this._editor&&this._editor.destroy(),this._container=document.createElement("div"),this._container?.classList.add("display-none"),this._editor=new this.Editor({view:this.mapView,visibleElements:{snappingControls:!1},container:this._container}),this.el.appendChild(this._container);const t=this.reactiveUtils.watch((()=>this._editor.viewModel.featureTemplatesViewModel.state),(t=>{"ready"===t&&(this._editorLoading=!0)}));this._editor.viewModel.addHandles(t);const i=this.reactiveUtils.watch((()=>this._editor.viewModel.state),(t=>{"adding-attachment"===t||"editing-attachment"===t?(this._addingAttachment=!0,this.isActionPending.emit(!0)):this._addingAttachment&&(this.isActionPending.emit(!1),this._addingAttachment=!1)}));this._editor.viewModel.addHandles(i);const s=this.reactiveUtils.watch((()=>this._editor.viewModel.featureFormViewModel?.state),(t=>{"ready"===t&&this.formReady.emit()}));this._editor.viewModel.addHandles(s)}async startCreate(){const t=this.selectedFeature.layer,i=this.table,s=t.relationships[0],e=i.relationships.find((i=>t.layerId===i.relatedTableId)),a=await t.queryFeatures({objectIds:[this.selectedFeature.getObjectId()],outFields:[t.objectIdField,s.keyField]}),h=i.templates[0],n={attributeOverrides:this.makeAttributesForRelatedFeature(a.features[0],s,e),layer:i,template:h};await this._editor.startCreateFeaturesWorkflowAtFeatureCreation(n),await this.hideEditorsElements(),this._editor.viewModel.featureFormViewModel.on("submit",this.submitted.bind(this))}async hideEditorsElements(){this.customizeSubmit&&(await this.timeout(700),this.el.querySelector(".esri-editor")?.querySelectorAll("calcite-flow-item")?.forEach((t=>{const i=t.shadowRoot?.querySelector("calcite-panel")?.shadowRoot?.querySelector("article");i?.querySelector("header")?.setAttribute("style","display: none"),i?.querySelector("footer")?.setAttribute("style","display: none")})))}makeAttributesForRelatedFeature(t,i,s){const e=i.keyField;let a;t.attributes.hasOwnProperty(e)?a=t.getAttribute(e):t.attributes.hasOwnProperty(e.toLowerCase())?a=t.getAttribute(e.toLowerCase()):t.attributes.hasOwnProperty(e.toUpperCase())&&(a=t.getAttribute(e.toUpperCase()));let h=s.keyField;const n=this.table.fields.find((t=>t.name.toLocaleLowerCase()===h.toLocaleLowerCase()));return h=n.name,{[h]:a}}async submitted(t){if(t.invalid.length)this._isSubmitBtnClicked=!1;else if(t.valid.length&&this._isSubmitBtnClicked){this._isSubmitBtnClicked=!1;try{await this._editor.activeWorkflow.commit(),this._editor.viewModel.failures?.length&&this._editor.viewModel.failures.some((t=>{if(t.error)throw t.error}))}catch(t){return void this.fail.emit(t)}this.success.emit()}}timeout(t){return new Promise((i=>setTimeout(i,t)))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}static get watchers(){return{mapView:["mapViewWatchHandler"],_editorLoading:["_editorLoadingWatchHandler"]}}};k.style=":host{display:block}.esri-editor__panel-toolbar{display:none !important}.display-none{display:none !important}.esri-editor__panel-content{padding-block:10px !important}.notice-msg{padding:10px;width:calc(100% - 20px)}";const v=class{constructor(i){t(this,i),this.loadingStatus=e(this,"loadingStatus",7),this.commentSelect=e(this,"commentSelect",7),this.addComment=e(this,"addComment",7),this.likeOrDislikeClicked=e(this,"likeOrDislikeClicked",7),this.featureSelectionChange=e(this,"featureSelectionChange",7),this.mapView=void 0,this.graphics=void 0,this.reportingOptions=void 0,this.layerItemsHash=void 0,this.showUserImageInCommentsList=!1,this._likeFieldAvailable=!1,this._likeCount=0,this._disLikeCount=0,this._dislikeFieldAvailable=!1,this._commentsAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._relatedFeaturesOIDs=void 0,this._updating=!1}get el(){return s(this)}_infoCard;_commentsList;_selectedGraphic;_likeField;_dislikeField;Graphic;RelationshipQuery;_validFieldTypes=["small-integer","integer","big-integer","single","long"];relatedTableId;async graphicsWatchHandler(){await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}async refresh(t){await this.getCompleteGraphic(t),await this.processComments(),this.isLikeDislikeConfigured(t.layer)?t&&this.graphics.length>1&&this.checkLikeDislikeFields():(this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1)}async back(){this._infoCard.back()}async next(){this._infoCard.next()}async toggleListView(){this._infoCard.toggleListView()}loadingStatus;commentSelect;addComment;likeOrDislikeClicked;featureSelectionChange;async componentWillLoad(){await this._initModules(),await this.getCompleteGraphic(this.graphics[0]),this.checkLikeDislikeFields(),await this.processComments()}render(){const t=this._relatedFeaturesOIDs?.length>0?`objectId in(${this._relatedFeaturesOIDs})`:"1=0";return i("calcite-panel",{key:"e09b693348a5d446f6ea3c774af3c2fd14e66daf","full-height":!0},i("info-card",{key:"4483a15e4e0bdd62c2c21bc4622d3bbddf3cd113",allowEditing:!1,graphics:this.graphics,highlightEnabled:!1,isLoading:!1,isMobile:!1,mapView:this.mapView,onSelectionChanged:t=>{this.featureSelectionChange.emit(t.detail)},paginationEnabled:!1,position:"relative",ref:t=>this._infoCard=t}),(this._likeFieldAvailable||this._dislikeFieldAvailable||this._commentsAvailable)&&i("div",{key:"ac24bb5fd56a7561e78d90c3a1b10027cfab6b2b",class:"buttons-container"},this._commentsAvailable&&i("calcite-button",{key:"676c5da52465f295212668f8db9b353e219070f2",appearance:"transparent",iconEnd:"speech-bubble",kind:"neutral",onClick:()=>{this.addComment.emit()},scale:"m"},this._relatedFeaturesOIDs.length),this._likeFieldAvailable&&i("calcite-button",{key:"b3fe54ea2fcf5361e6ec0a91bd52775d24408d77",appearance:"transparent",iconEnd:"thumbs-up",kind:this._isLikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onLikeButtonClick.bind(this),scale:"m"},this._likeCount??this._selectedGraphic.attributes[this._likeField]??0),this._dislikeFieldAvailable&&i("calcite-button",{key:"d83c9b9fdd287e07670ca9a5aeafd1a4cc38c0f8",appearance:"transparent",iconEnd:"thumbs-down",kind:this._isDislikeBtnClicked?"brand":"neutral",loading:this._updating,onClick:this.onDislikeButtonClick.bind(this),scale:"m"},this._disLikeCount??this._selectedGraphic.attributes[this._dislikeField]??0)),this.relatedTableId&&this._commentsAvailable&&i("feature-list",{key:"9d72181a778e08b632d802689a66fa21924cd5b3",class:"height-full",mapView:this.mapView,onFeatureSelect:t=>{this.commentSelect.emit(t.detail)},pageSize:5,ref:t=>this._commentsList=t,selectedLayerId:this.relatedTableId,showErrorWhenNoFeatures:!1,showInitialLoading:!1,showUserImageInList:this.showUserImageInCommentsList,textSize:"small",whereClause:t}))}async _initModules(){const[t,i]=await r(["esri/rest/support/RelationshipQuery","esri/Graphic"]);this.RelationshipQuery=t,this.Graphic=i}async getCompleteGraphic(t){if(t){const i=t.layer,s=i.createQuery();s.objectIds=[t.getObjectId()];const e=await i.queryFeatures(s);this._selectedGraphic=e.features[0]}}async processComments(){const t=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[t.id]&&this.reportingOptions[t.id].comment&&t.relationships?.length>0){const i=await f(this.mapView);let s=null,e=null;if(t.relationships.some((a=>{const h=i.filter((i=>t.url===i.url&&i.layerId===a.relatedTableId));if(h&&h.length>0)return s=h[0],e=a.id,!0})),this.relatedTableId=s?.id??"",this.relatedTableId){const i=this._selectedGraphic.attributes[t.objectIdField],a=new this.RelationshipQuery({objectIds:[i],outFields:["*"],relationshipId:e}),h=await t.queryRelatedFeatures(a).catch((t=>{console.error(t)})),n=[];h[i]&&h[i].features.forEach((t=>{n.push(t.attributes[s.objectIdField])})),this._relatedFeaturesOIDs=n,this._commentsAvailable=!0}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1}else this._relatedFeaturesOIDs=[],this._commentsAvailable=!1,this.relatedTableId=""}isLikeDislikeConfigured(t){let i=!1,s=!1;if(this.reportingOptions&&this.reportingOptions[t.id]){if(!this.reportingOptions[t.id].like&&!this.reportingOptions[t.id].dislike)return!1;const e=this.reportingOptions[t.id].likeField,a=this.reportingOptions[t.id].dislikeField;if(!e&&!a)return!1;t.fields.forEach((h=>{this._validFieldTypes.indexOf(h.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(h.name===e&&this.reportingOptions[t.id].like?i=!0:h.name===a&&this.reportingOptions[t.id].dislike&&(s=!0))}))}return i||s}checkLikeDislikeFields(){this._likeFieldAvailable=!1,this._dislikeFieldAvailable=!1,this._isLikeBtnClicked=!1,this._isDislikeBtnClicked=!1,this._likeCount=0,this._disLikeCount=0;const t=this._selectedGraphic.layer;if(this.reportingOptions&&this.reportingOptions[t.id]){if(this._likeField=this.reportingOptions[t.id].likeField,this._dislikeField=this.reportingOptions[t.id].dislikeField,!this._likeField&&!this._dislikeField)return;t.fields.forEach((i=>{this._validFieldTypes.indexOf(i.type)>-1&&this.layerItemsHash[t.id].supportsUpdate&&(i.name===this._likeField&&this.reportingOptions[t.id].like?(this._likeFieldAvailable=!0,this._likeCount=this._selectedGraphic.attributes[i.name]):i.name===this._dislikeField&&this.reportingOptions[t.id].dislike&&(this._dislikeFieldAvailable=!0,this._disLikeCount=this._selectedGraphic.attributes[i.name]))})),this.getFromLocalStorage()}}onLikeButtonClick(){this._isDislikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].dislike&&this.onDislikeButtonClick(),this._isLikeBtnClicked=!this._isLikeBtnClicked,this._isLikeBtnClicked?this._likeCount++:this._likeCount--,this.updateFeaturesLikeDislikeField(this._likeField,this._isLikeBtnClicked)}onDislikeButtonClick(){this._isLikeBtnClicked&&this.reportingOptions[this._selectedGraphic.layer.id].like&&this.onLikeButtonClick(),this._isDislikeBtnClicked=!this._isDislikeBtnClicked,this._isDislikeBtnClicked?this._disLikeCount++:this._disLikeCount--,this.updateFeaturesLikeDislikeField(this._dislikeField,this._isDislikeBtnClicked)}async updateFeaturesLikeDislikeField(t,i){const s={},e=this._selectedGraphic.layer;this._updating=!0;const a=this._selectedGraphic;a.attributes[t]=Number(a.attributes[t])+(i?1:-1),s[e.objectIdField]=a.attributes[e.objectIdField],s[t]=a.attributes[t];const h=new this.Graphic;h.attributes=s;const n={updateFeatures:[h]};await e.applyEdits(n).then((()=>{this._selectedGraphic=a,this.setInLocalStorage(),this._updating=!1,this.likeOrDislikeClicked.emit()}),(t=>{this._updating=!1,console.log(t)}))}getFromLocalStorage(){const t=localStorage[this._selectedGraphic.layer.id];if(t){const i=JSON.parse(t).filter((t=>t.id===this._selectedGraphic.getObjectId()));i.length>0&&(this._isLikeBtnClicked=i[0].like,this._isDislikeBtnClicked=i[0].dislike)}}setInLocalStorage(){const t=this._selectedGraphic.layer.id,i=localStorage[t];let s=[];if(i){s=JSON.parse(i);const t=s.findIndex((t=>t.id===this._selectedGraphic.getObjectId()));t>=0&&s.splice(t,1)}s.push({id:this._selectedGraphic.getObjectId(),like:this._isLikeBtnClicked&&0!==this._likeCount,dislike:this._isDislikeBtnClicked&&0!==this._disLikeCount}),localStorage.setItem(t,JSON.stringify(s))}static get watchers(){return{graphics:["graphicsWatchHandler"]}}};v.style=":host{display:block}.buttons-container{align-items:center;display:flex;padding:4px;color:var(--calcite-color-text-1) !important;background-color:var(--calcite-color-foreground-1) !important;border-block-start:1px solid var(--calcite-color-border-3);border-block-end:1px solid var(--calcite-color-border-3)}";const L=class{constructor(i){t(this,i),this.layerSelect=e(this,"layerSelect",7),this.layersListLoaded=e(this,"layersListLoaded",7),this.mapView=void 0,this.layers=void 0,this.showFeatureCount=!0,this.showNextIcon=!1,this.applyLayerViewFilter=!1,this._noLayersToDisplay=!1,this._mapLayerIds=[],this._isLoading=!1,this._translations=void 0}get el(){return s(this)}_layerItemsHash;async refresh(){await this.setLayers()}layerSelect;layersListLoaded;async componentWillLoad(){await this._getTranslations()}async componentDidLoad(){await this.setLayers()}render(){return i(a,{key:"f8e0c21d4ff87d663a1e0f00f1d9ef1123091db9"},this._isLoading&&i("calcite-loader",{key:"42058be6b41126e58d33895bc237b174e55a16ed",label:"",scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{key:"89d9073a156f07379699cc5b67bf9ba54654cc68",class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{key:"730b8dcca79bd45a7a6eecb5030626d1dcd01238",slot:"title"},this._translations.error),i("div",{key:"656e8276ffab75734909348f49f11492de1d5a8b",slot:"message"},this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",{key:"1d2206d3163b6c5ed8511e32ab296f0025889824","selection-appearance":"border","selection-mode":"none"},this.renderLayerList()))}async setLayers(){this.mapView&&(this._isLoading=!0,await this.initLayerHash(),this._isLoading=!1)}async initLayerHash(){const t=[];this._layerItemsHash=await p(this.mapView,!0);const i=await m(this.mapView);for(const s of i)if("feature"===s?.type&&this.showFeatureCount){const i=s.createQuery();if(s?.definitionExpression&&(i.where=i.where+" AND "+s.definitionExpression),this.applyLayerViewFilter){const t=await b(this.mapView,s.id);t?.filter?.where&&(i.where=i.where?i.where+" AND "+t.filter.where:t.filter.where)}const e=s.queryFeatureCount(i);t.push(e),e.then((async t=>{const i=isNaN(t)?"":await d(t,{places:0,api:4,type:"decimal"});this._layerItemsHash[s.id].formattedFeatureCount=i}))}await Promise.all(t).then((()=>{const t=this.getLayersToBeShownInList(this._layerItemsHash);this._mapLayerIds=t.reverse(),this.handleNoLayersToDisplay()}),(()=>{this._mapLayerIds=[],this.handleNoLayersToDisplay()}))}handleNoLayersToDisplay(){this._noLayersToDisplay=!(this._mapLayerIds.length>0),this.layersListLoaded.emit(this._mapLayerIds)}getLayersToBeShownInList(t){const i=this.layers?.length>0?this.layers:[];return Object.keys(t).reduce(((t,s)=>(i.indexOf(s)>-1&&t.push(s),t)),[])}renderLayerList(){return this._mapLayerIds.length>0&&this._mapLayerIds.reduce(((t,i)=>(this._layerItemsHash[i]&&t.push(this.getLayerListItem(i)),t)),[])}getLayerListItem(t){const s=this._layerItemsHash[t].formattedFeatureCount;return i("calcite-list-item",{onCalciteListItemSelect:()=>{this.onLayerItemSelected(t)}},i("div",{class:"layer-name",slot:"content-start"},this._layerItemsHash[t].name),this.showFeatureCount&&void 0!==s&&""!==s&&i("div",{class:this.showNextIcon?"":"feature-count",slot:"content-end"},"("+s+")"),this.showNextIcon&&i("calcite-icon",{flipRtl:!0,icon:"chevron-right",scale:"s",slot:"content-end"}))}onLayerItemSelected(t){this.layerSelect.emit({layerId:t,layerName:this._layerItemsHash[t].name})}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}};L.style=":host{display:block}.error-msg{padding:10px}.layer-name{font-weight:500;padding:10px 12px}.feature-count{padding-right:12px}";export{w as calcite_flow,k as create_related_feature,v as feature_details,L as layer_list}