@esri/solutions-components 0.10.34 → 0.10.35
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/basemap-gallery_7.cjs.entry.js +6 -6
- package/dist/cjs/buffer-tools_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-alert_5.cjs.entry.js +7 -5
- package/dist/cjs/calcite-combobox_3.cjs.entry.js +1 -1
- package/dist/cjs/calcite-flow_4.cjs.entry.js +18 -16
- package/dist/cjs/{calcite-modal_3.cjs.entry.js → calcite-modal.cjs.entry.js} +27 -368
- package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +7 -7
- package/dist/cjs/calcite-shell_3.cjs.entry.js +440 -0
- package/dist/cjs/card-manager_3.cjs.entry.js +20 -9
- package/dist/cjs/crowdsource-manager.cjs.entry.js +3 -2
- package/dist/cjs/crowdsource-reporter.cjs.entry.js +24 -21
- package/dist/cjs/feature-comments.cjs.entry.js +1 -1
- package/dist/cjs/feature-form-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/feature-list.cjs.entry.js +4 -4
- package/dist/cjs/features-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/layout-manager.cjs.entry.js +1 -1
- package/dist/cjs/list-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/location-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
- package/dist/cjs/pci-calculator.cjs.entry.js +1 -1
- package/dist/cjs/public-notification.cjs.entry.js +1 -1
- package/dist/cjs/refine-results-flow-item.cjs.entry.js +1 -1
- package/dist/cjs/share-item.cjs.entry.js +1 -1
- package/dist/cjs/solution-configuration.cjs.entry.js +3 -3
- package/dist/cjs/solution-contents_3.cjs.entry.js +3 -3
- package/dist/cjs/solution-item-accordion.cjs.entry.js +1 -1
- package/dist/cjs/solution-item-icon.cjs.entry.js +1 -1
- package/dist/cjs/solutions-components.cjs.js +1 -1
- package/dist/cjs/spatial-ref.cjs.entry.js +1 -1
- package/dist/collection/assets/t9n/delete-dialog/resources.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_ar.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_bg.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_bs.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_ca.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_cs.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_da.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_de.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_el.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_en.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_es.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_et.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_fi.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_fr.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_he.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_hr.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_hu.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_id.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_it.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_ja.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_ko.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_lt.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_lv.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_nb.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_nl.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_pl.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_pt-BR.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_pt-PT.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_ro.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_ru.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_sk.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_sl.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_sr.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_sv.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_th.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_tr.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_uk.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_vi.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_zh-CN.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_zh-HK.json +8 -0
- package/dist/collection/assets/t9n/delete-dialog/resources_zh-TW.json +8 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/create-feature/create-feature.css +2 -1
- package/dist/collection/components/create-feature/create-feature.js +3 -1
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +4 -0
- package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +2 -1
- package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +24 -21
- package/dist/collection/components/delete-button/delete-button.js +20 -27
- package/dist/collection/components/delete-dialog/delete-dialog.css +23 -0
- package/dist/collection/components/delete-dialog/delete-dialog.js +239 -0
- package/dist/collection/components/edit-card/edit-card.js +1 -1
- package/dist/collection/components/feature-comments/feature-comments.js +1 -1
- package/dist/collection/components/feature-details/feature-details.js +13 -11
- package/dist/collection/components/feature-form-flow-item/feature-form-flow-item.js +1 -1
- package/dist/collection/components/feature-list/feature-list.js +4 -4
- package/dist/collection/components/features-flow-item/features-flow-item.js +1 -1
- package/dist/collection/components/floor-filter/floor-filter.js +1 -1
- package/dist/collection/components/info-card/info-card.js +2 -2
- package/dist/collection/components/json-editor/json-editor.js +1 -1
- package/dist/collection/components/layer-list/layer-list.js +5 -5
- package/dist/collection/components/layer-table/layer-table.css +6 -0
- package/dist/collection/components/layer-table/layer-table.js +19 -7
- package/dist/collection/components/layout-manager/layout-manager.js +1 -1
- package/dist/collection/components/list-flow-item/list-flow-item.js +1 -1
- package/dist/collection/components/location-flow-item/location-flow-item.js +1 -1
- package/dist/collection/components/map-card/map-card.js +1 -1
- package/dist/collection/components/map-draw-tools/map-draw-tools.js +1 -1
- package/dist/collection/components/map-fullscreen/map-fullscreen.js +1 -1
- package/dist/collection/components/map-layer-picker/map-layer-picker.js +1 -1
- package/dist/collection/components/map-legend/map-legend.js +1 -1
- package/dist/collection/components/map-picker/map-picker.js +1 -1
- package/dist/collection/components/map-search/map-search.js +1 -1
- package/dist/collection/components/map-select-tools/map-select-tools.js +1 -1
- package/dist/collection/components/map-tools/map-tools.js +1 -1
- package/dist/collection/components/pci-calculator/pci-calculator.js +1 -1
- package/dist/collection/components/pdf-download/pdf-download.js +1 -1
- package/dist/collection/components/public-notification/public-notification.js +1 -1
- package/dist/collection/components/refine-results-flow-item/refine-results-flow-item.js +1 -1
- package/dist/collection/components/refine-selection/refine-selection.js +1 -1
- package/dist/collection/components/share-item/share-item.js +1 -1
- package/dist/collection/components/solution-configuration/solution-configuration.js +3 -3
- package/dist/collection/components/solution-contents/solution-contents.js +1 -1
- package/dist/collection/components/solution-item/solution-item.js +1 -1
- package/dist/collection/components/solution-item-accordion/solution-item-accordion.js +1 -1
- package/dist/collection/components/solution-item-details/solution-item-details.js +1 -1
- package/dist/collection/components/solution-item-icon/solution-item-icon.js +1 -1
- package/dist/collection/components/solution-item-sharing/solution-item-sharing.js +1 -1
- package/dist/collection/components/solution-organization-variables/solution-organization-variables.js +1 -1
- package/dist/collection/components/solution-resource-item/solution-resource-item.js +1 -1
- package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +1 -1
- package/dist/collection/components/solution-template-data/solution-template-data.js +1 -1
- package/dist/collection/components/solution-variables/solution-variables.js +1 -1
- package/dist/collection/components/spatial-ref/spatial-ref.js +1 -1
- package/dist/components/card-manager2.js +40 -34
- package/dist/components/create-feature2.js +4 -2
- package/dist/components/crowdsource-manager.js +101 -94
- package/dist/components/crowdsource-reporter.js +110 -101
- package/dist/components/delete-button2.js +24 -41
- package/dist/components/delete-dialog.d.ts +11 -0
- package/dist/components/delete-dialog.js +11 -0
- package/dist/components/delete-dialog2.js +165 -0
- package/dist/components/edit-card2.js +1 -1
- package/dist/components/feature-comments.js +1 -1
- package/dist/components/feature-details2.js +67 -59
- package/dist/components/feature-form-flow-item.js +1 -1
- package/dist/components/feature-list2.js +4 -4
- package/dist/components/features-flow-item.js +1 -1
- package/dist/components/floor-filter2.js +1 -1
- package/dist/components/info-card2.js +38 -32
- package/dist/components/json-editor2.js +1 -1
- package/dist/components/layer-list2.js +5 -5
- package/dist/components/layer-table2.js +100 -82
- package/dist/components/layout-manager.js +1 -1
- package/dist/components/list-flow-item.js +1 -1
- package/dist/components/location-flow-item.js +1 -1
- package/dist/components/map-card2.js +1 -1
- package/dist/components/map-draw-tools2.js +1 -1
- package/dist/components/map-fullscreen2.js +1 -1
- package/dist/components/map-layer-picker2.js +1 -1
- package/dist/components/map-legend2.js +1 -1
- package/dist/components/map-picker2.js +1 -1
- package/dist/components/map-search2.js +1 -1
- package/dist/components/map-select-tools2.js +1 -1
- package/dist/components/map-tools2.js +1 -1
- package/dist/components/pci-calculator.js +1 -1
- package/dist/components/pdf-download2.js +1 -1
- package/dist/components/public-notification.js +1 -1
- package/dist/components/refine-results-flow-item.js +1 -1
- package/dist/components/refine-selection2.js +1 -1
- package/dist/components/share-item.js +1 -1
- package/dist/components/solution-configuration.js +3 -3
- package/dist/components/solution-contents2.js +1 -1
- package/dist/components/solution-item-accordion.js +1 -1
- package/dist/components/solution-item-details2.js +1 -1
- package/dist/components/solution-item-icon2.js +1 -1
- package/dist/components/solution-item-sharing2.js +1 -1
- package/dist/components/solution-item2.js +1 -1
- package/dist/components/solution-organization-variables2.js +1 -1
- package/dist/components/solution-resource-item2.js +1 -1
- package/dist/components/solution-spatial-ref2.js +1 -1
- package/dist/components/solution-template-data2.js +1 -1
- package/dist/components/solution-variables2.js +1 -1
- package/dist/components/spatial-ref.js +1 -1
- package/dist/esm/basemap-gallery_7.entry.js +6 -6
- package/dist/esm/buffer-tools_3.entry.js +1 -1
- package/dist/esm/calcite-alert_5.entry.js +7 -5
- package/dist/esm/calcite-combobox_3.entry.js +1 -1
- package/dist/esm/calcite-flow_4.entry.js +18 -16
- package/dist/esm/{calcite-modal_3.entry.js → calcite-modal.entry.js} +30 -369
- package/dist/esm/calcite-shell-panel_14.entry.js +7 -7
- package/dist/esm/calcite-shell_3.entry.js +434 -0
- package/dist/esm/card-manager_3.entry.js +20 -9
- package/dist/esm/crowdsource-manager.entry.js +3 -2
- package/dist/esm/crowdsource-reporter.entry.js +24 -21
- package/dist/esm/feature-comments.entry.js +1 -1
- package/dist/esm/feature-form-flow-item.entry.js +1 -1
- package/dist/esm/feature-list.entry.js +4 -4
- package/dist/esm/features-flow-item.entry.js +1 -1
- package/dist/esm/layout-manager.entry.js +1 -1
- package/dist/esm/list-flow-item.entry.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/location-flow-item.entry.js +1 -1
- package/dist/esm/map-select-tools_3.entry.js +3 -3
- package/dist/esm/pci-calculator.entry.js +1 -1
- package/dist/esm/public-notification.entry.js +1 -1
- package/dist/esm/refine-results-flow-item.entry.js +1 -1
- package/dist/esm/share-item.entry.js +1 -1
- package/dist/esm/solution-configuration.entry.js +3 -3
- package/dist/esm/solution-contents_3.entry.js +3 -3
- package/dist/esm/solution-item-accordion.entry.js +1 -1
- package/dist/esm/solution-item-icon.entry.js +1 -1
- package/dist/esm/solutions-components.js +1 -1
- package/dist/esm/spatial-ref.entry.js +1 -1
- package/dist/solutions-components/assets/t9n/delete-dialog/resources.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_ar.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_bg.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_bs.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_ca.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_cs.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_da.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_de.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_el.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_en.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_es.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_et.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_fi.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_fr.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_he.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_hr.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_hu.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_id.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_it.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_ja.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_ko.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_lt.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_lv.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_nb.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_nl.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_pl.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_pt-BR.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_pt-PT.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_ro.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_ru.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_sk.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_sl.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_sr.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_sv.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_th.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_tr.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_uk.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_vi.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_zh-CN.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_zh-HK.json +8 -0
- package/dist/solutions-components/assets/t9n/delete-dialog/resources_zh-TW.json +8 -0
- package/dist/solutions-components/{p-6c3261d7.entry.js → p-06364211.entry.js} +1 -1
- package/dist/solutions-components/{p-d119872d.entry.js → p-18089a0b.entry.js} +1 -1
- package/dist/solutions-components/p-1f07e21a.entry.js +6 -0
- package/dist/solutions-components/p-2a6ecaa9.entry.js +11 -0
- package/dist/solutions-components/p-46416e11.entry.js +6 -0
- package/dist/solutions-components/{p-a8525233.entry.js → p-588adf13.entry.js} +1 -1
- package/dist/solutions-components/{p-5fc0e134.entry.js → p-59ccd27c.entry.js} +1 -1
- package/dist/solutions-components/p-5eb9a413.entry.js +6 -0
- package/dist/solutions-components/{p-42f75c8f.entry.js → p-6502d0f8.entry.js} +1 -1
- package/dist/solutions-components/p-70c0050c.entry.js +6 -0
- package/dist/solutions-components/p-74bcef23.entry.js +11 -0
- package/dist/solutions-components/{p-4cb12506.entry.js → p-76154700.entry.js} +1 -1
- package/dist/solutions-components/p-82ddf716.entry.js +6 -0
- package/dist/solutions-components/{p-d08ece15.entry.js → p-841816a1.entry.js} +1 -1
- package/dist/solutions-components/{p-4f5913f3.entry.js → p-89046451.entry.js} +1 -1
- package/dist/solutions-components/p-938bc915.entry.js +6 -0
- package/dist/solutions-components/{p-fa7672c7.entry.js → p-9d56f4b5.entry.js} +1 -1
- package/dist/solutions-components/p-9da8a590.entry.js +6 -0
- package/dist/solutions-components/{p-5fdb8f83.entry.js → p-a5d79c86.entry.js} +1 -1
- package/dist/solutions-components/{p-dd0bd439.entry.js → p-b4c49411.entry.js} +2 -2
- package/dist/solutions-components/p-b86b2664.entry.js +6 -0
- package/dist/solutions-components/{p-ddc1218d.entry.js → p-be4c7ffd.entry.js} +1 -1
- package/dist/solutions-components/{p-ffa9a117.entry.js → p-cb3199f9.entry.js} +1 -1
- package/dist/solutions-components/{p-a07322cc.entry.js → p-df7de4b7.entry.js} +1 -1
- package/dist/solutions-components/{p-1f072e2c.entry.js → p-eadff42b.entry.js} +1 -1
- package/dist/solutions-components/{p-8a411917.entry.js → p-ecf642c2.entry.js} +1 -1
- package/dist/solutions-components/{p-06db1bfd.entry.js → p-efb4cb43.entry.js} +1 -1
- package/dist/solutions-components/{p-e4a42efa.entry.js → p-fa1c368c.entry.js} +1 -1
- package/dist/solutions-components/solutions-components.esm.js +1 -1
- package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +6 -1
- package/dist/types/components/delete-button/delete-button.d.ts +4 -12
- package/dist/types/components/delete-dialog/delete-dialog.d.ts +75 -0
- package/dist/types/components/layer-table/layer-table.d.ts +12 -0
- package/dist/types/components.d.ts +69 -0
- package/dist/types/preact.d.ts +5 -0
- package/package.json +1 -1
- package/dist/solutions-components/p-51e2500f.entry.js +0 -6
- package/dist/solutions-components/p-52280e10.entry.js +0 -17
- package/dist/solutions-components/p-67ca4a64.entry.js +0 -6
- package/dist/solutions-components/p-7e6a8c06.entry.js +0 -6
- package/dist/solutions-components/p-8d2d66d0.entry.js +0 -6
- package/dist/solutions-components/p-8e6081e0.entry.js +0 -6
- package/dist/solutions-components/p-b9b77b87.entry.js +0 -6
- package/dist/solutions-components/p-cf878a34.entry.js +0 -6
- package/dist/solutions-components/p-edd88d2d.entry.js +0 -6
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as i,c as t,g as e,h as s,H as a}from"./p-4e6eb06e.js";import{a as h,l,g as n}from"./p-f4aadb3b.js";import{e as o,h as r,k as c,l as d,c as p,m as b,n as g,o as f}from"./p-d572627c.js";import{a as y,e as m,f as u}from"./p-80cb7c73.js";import{s as w}from"./p-51c6e6fe.js";import{d as v,a as _}from"./p-46c8015c.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dc9d4be3.js";import"./p-d0d020a5.js";import"./p-7530a02f.js";import"./p-9bb44f57.js";const S=class{constructor(e){i(this,e),this.selectionSetChange=t(this,"selectionSetChange",7),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectionLayerIds=[],this.selectLayerView=void 0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._numSelected=0,this._searchDistanceEnabled=!1,this._searchTerm=void 0,this._selectionLoading=!1,this._translations=void 0,this._useLayerFeaturesEnabled=!1}get el(){return e(this)}_esriRequest;FeatureLayer;Graphic;GraphicsLayer;Search;_geometryEngine;_bufferGeometry;_bufferGraphicsLayer;_bufferTools;_distance;_drawTools;_labelName;_selectLayers;_searchElement;_searchResult;_searchWidget;_selectedIds=[];_selectionLabel="";_skipGeomOIDs;_sketchGraphic;_graphics=[];_unit;_workflowType;_featuresCollection={};async watchGeometriesHandler(i,t){if(i!==t){const t=0===i.length;if(await this._clearResults(t,t),i.length>0)return this._highlightWithOIDsOrGeoms()}}async mapViewWatchHandler(i,t){i&&i!==t&&await this._init()}async watchSearchConfigurationHandler(i,t){JSON.stringify(i)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools?.distance,download:!0,unit:this._bufferTools?.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this._searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this._useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}selectionSetChange;searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}async distanceChanged(i){await this._distanceChanged(i.detail)}async unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,await this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){await this._init()}render(){const i=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return s(a,{key:"6753158d00a33dd5dfbb1f22cc27388baf4c0b5e"},this._getMapLayerPicker(),s("div",{key:"082c6be48d3dfbe2e39be2c462959c7772a91d40",class:"border-bottom"}),s("div",{key:"0e8133a809b05bef34c2f19adeff43c1e57cc002",class:"padding-top-sides-1"},s("div",{key:"4434b5b4d073f3ba9a7e44b82078b9b81733025b",class:"search-widget",ref:i=>{this._searchElement=i}}),s("div",{key:"6f01e27e06ea365de6ff98df3f9edd973d87117c",class:t},s("map-draw-tools",{key:"24ffe562d080955f2aacfd080c0baa1997f8eaab",active:!0,class:i,editGraphicsEnabled:!this._useLayerFeaturesEnabled,graphics:this._graphics,mapView:this.mapView,onSketchGraphicsChange:i=>{this._sketchGraphicsChanged(i)},pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),this.enableSearchDistance?this._getBufferOptions():void 0,this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0,this._getNumSelected()),s("div",{key:"4c7cf401b5bcc7e4adef34e140d22676fce8ebbc",class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){this.enableSearchDistanceOnLoad&&(this._searchDistanceEnabled=!0,this.enableSearchDistanceOnLoad=!1);const i=this._searchDistanceEnabled?"search-distance":"div-not-visible",t="number"==typeof this.selectionSet?.distance?this.selectionSet.distance:this.defaultBufferDistance;return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.searchDistance,s("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"search-distance-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},s("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),s("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),s("div",{class:i},s("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:t,geometries:this.geometries,onBufferComplete:i=>{this._bufferComplete(i)},ref:i=>this._bufferTools=i,unit:this.selectionSet?.unit||this.defaultBufferUnit})))}_getUseLayerFeaturesOptions(){this.enableLayerFeaturesOnLoad&&(this._useLayerFeaturesEnabled=!0,this.enableLayerFeaturesOnLoad=!1);const i=this._useLayerFeaturesEnabled?"div-visible":"div-not-visible";return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.useLayerFeatures,s("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"use-layer-features-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},s("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),s("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),s("div",{class:i+" padding-top-1"},s("map-layer-picker",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedIds:this.layerViews.map((i=>i.layer.id)),showTables:!1})))}_getNumSelected(){const i=h(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return s("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?s("div",null,s("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):s("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),s("calcite-input-message",{class:"info-blue",scale:"m"},this._selectionLoading?t:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())))}_getNameInput(){return s("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},s("calcite-label",{class:"font-bold"},this._translations.listName,s("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return s("div",{class:"display-flex padding-sides-1 padding-bottom-1"},s("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,s("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._inputLayerSelectionChange(i)},selectedIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[],showTables:!1})))}async _initModules(){const[i,t,e,s,a,h]=await l(["esri/request","esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this._esriRequest=i,this.GraphicsLayer=t,this.Graphic=e,this.Search=s,this._geometryEngine=a,this.FeatureLayer=h}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.name,this._searchResult=this.selectionSet.searchResult,this._selectLayers=this.selectionSet.selectLayers,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs,this._searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this._useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...this.selectionSet?.geometries||[]],this._graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:this.sketchPolygonSymbol}))),this._selectionLabel=this.selectionSet?.label,this._useLayerFeaturesEnabled||await(this._drawTools?.updateGraphics()),await o(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t={view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm,...i};this._searchWidget=new this.Search(t),this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{this._selectResult(i.result)})),await this._searchWidget.when((()=>{this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}}async _selectResult(i){if(i){this._searchResult=i;const t=i.feature,e=t?.layer,s=this.selectLayerView.layer,a=t?.getObjectId();let h,l;e.sourceJSON?.isView&&(h=await this._getViewSourceUrl(e.url)),s.sourceJSON?.isView&&(l=await this._getViewSourceUrl(s.url));const n=e?.url?.toLowerCase(),o=h?.toLowerCase(),r=s?.url?.toLowerCase(),c=l?.toLowerCase(),d=n&&r&&(n===r||n===c||o===r||o===c)&&!isNaN(a),p=d?[a]:void 0;this._workflowType=y.SEARCH,this._updateLabel();const b=[i.feature];this._updateSelection(b,d,p),this._drawTools.graphics=b,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}}async _getViewSourceUrl(i){let t="";const e=`${i}/sources?f=json`;try{const i=await this._esriRequest(e,{query:{f:"json"}});1===i?.data?.services?.length&&(t=i.data.services[0].url)}catch(i){console.log(i)}return t}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const e=i?.sources;return e?.length>0?(i={...i,includeDefaultSources:!1},e.forEach((i=>{if(i.hasOwnProperty("layer")){const e=i,s=e.layer?.id,a=s?t.map.findLayerById(s):null,h=e?.layer?.url;a?e.layer=a:h&&(e.layer=new this.FeatureLayer(h))}})),e?.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===t?.name&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i={...i,includeDefaultSources:!0},i}_initGraphicsLayer(){const i=this._translations.bufferLayer;if(this.mapView){const t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),w.managedLayers[i]="buffer";const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(i,t=!1){const e=i.detail.graphics;if(e.length>0&&e[0])if(t||(this._sketchGraphic=e[0]),this._workflowType=this._useLayerFeaturesEnabled?y.SELECT:y.SKETCH,this._workflowType===y.SKETCH&&await this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(e)?e.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=e.reduce(((i,t)=>(t?.layer?.objectIdField?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i)),[]),s=i.detail.useOIDs&&t.length>0;this._updateSelection(e,s,t),s&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs?.length>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(i){w.removeHandles(),i.length>0&&w.highlightHandles.push(await r(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await c(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,e=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),e=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:e})}_geomQuery(i){const t=d(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName&&(this._labelName.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),w.removeHandles(),this._drawTools?.clear&&(this._graphics=[],await this._drawTools.clear()),this._numSelected=this._selectedIds.length,this.selectionSetChange.emit(this._numSelected)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,e){this._selectedIds=t&&e?e:this._selectedIds,this._skipGeomOIDs=t?e:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){if(this.enableSearchDistance){const i=this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._selectionLabel.indexOf(this._translations.select)>-1,e=this._selectionLabel.indexOf(this._searchResult?.name)>-1,s=this._workflowType===y.SEARCH?this._searchResult?.name:this._workflowType===y.SELECT?this._translations.select:this._translations.sketch,a=this._unit?this._unit:this._bufferTools.unit,h=await this._bufferTools.getTranslatedUnit(a),l=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=i||t||e||!this._selectionLabel?`${s} ${l} ${h}`:this._selectionLabel,this._labelName.value=this._selectionLabel}}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){const t=i.detail.map((i=>p(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i,this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}))}}async _inputLayerSelectionChange(i){const t=i?.detail?.length>0?i.detail[0]:"";this.selectLayerView&&t===this.selectLayerView.layer.id||(this.selectLayerView=await p(this.mapView,t),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,await this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],b(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))}));let e=!1;t.forEach((i=>{const t=i.geometry;i.symbol="point"===t.type?this.sketchPointSymbol:"polyline"===t.type?this.sketchLineSymbol:"polygon"===t.type?this.sketchPolygonSymbol:void 0,e=i?.layer?.hasOwnProperty("objectIdField")||i.hasOwnProperty("getObjectId")}));const s=this.layerViews[0].layer,a=this.selectLayerView.layer,h=e&&s.url===a.url&&a.layerId===s.layerId;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:h}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}static get watchers(){return{geometries:["watchGeometriesHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};S.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{border-inline-end:1px solid var(--calcite-color-border-2)}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:0.5rem}.icon{--calcite-color-icon-color:var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}';const L=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),k=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}get el(){return e(this)}_labelInfoElement;_intl;async downloadCSV(i,t,e,s=!0){return v(i,t,!0,e,s)}async downloadPDF(i,t,e=!1,s="",a=""){return _(i,t,this._labelInfoElement.selectedOption?.value,e,s,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(a,{key:"ff0ad2a97a113ccfaa10d5219d93f5b07319fb33"},s("calcite-select",{key:"4675536d2732329715198c54b5c03c8748d7732a",disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await l(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="‎"+i.descriptionPDF.labelWidthDisplay+" x "+i.descriptionPDF.labelHeightDisplay+"‏";return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}_renderOptions(){(L.default||L).sort(((i,t)=>{const e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),s=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<s?-1:e>s?1:0})).forEach(((i,t)=>{const e=document.createElement("calcite-option");e.value=i,e.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(e),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(e.selected=!0,this._labelInfoElement.selectedOption=e)}))}};k.style=":host{display:block}";const P=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this.addresseeLayer=void 0,this.enabledLayerIds=[],this.locale=void 0,this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=m.ADD,this._refineLayer=void 0}get el(){return e(this)}_addEnabled=!0;_drawTools;_refineSets=[];_enabledLayerIds=[];_layerPicker;_featuresCollection={};_refineSelectionSet;selectionLoadingChange;selectionSetsChanged;async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){return s(a,{key:"b3693694a5d007dd6add79848d1254a1ee52b8e3"},s("div",{key:"c464770d28fb981e9fba4d5cb3709684e41cbdc3",class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},s("div",{key:"2972637e3194c86d097a491678eb8b508bbf2fd2",class:"display-flex"},s("calcite-label",{key:"242295f4d8f2f17554b99748795a5bc1e1f05dcb",class:"font-bold width-full label-margin-0"},s("div",{key:"f2643bf44301aaa0a1d67595dac537c6bad21928",class:"display-flex"},this._translations.inputLayer,s("calcite-icon",{key:"1d068bd809b36b4aba7e3836d2fc8b33d6de5d3e",class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"refine-input-layer",scale:"s"})),s("map-layer-picker",{key:"e97947859dfa0a718595bfb54c843b6358ece94e",enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedIds:[this._refineLayer.layer.id],showTables:!1})),s("calcite-popover",{key:"e78a114a50aec427b6f6f0e4f8096447e464ba7e",closable:!0,label:"",referenceElement:"refine-input-layer"},s("span",{key:"b7abd37b2907c0ef98059fd280dd30cfa4eea2d2",class:"tooltip-message"},this._translations.inputLayerTip)))),s("div",{key:"3d5869d473e7c8068969e07619fc891268422f2b",class:"padding-1"},s("div",{key:"b89ed77287dc4ae5a6f7a7589faccbbc4da3b524",class:"padding-bottom-1"},s("calcite-segmented-control",{key:"1f0d85ab4ed9af445ff8b9bc5c7d4be80733f573",class:"w-100",width:"full"},s("calcite-segmented-control-item",{key:"229473e79f8ddc6c95ad0a09fdd3fef08c176b1e",checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.ADD),value:m.ADD},s("span",{key:"27f7e1f70da8ae44cab4d2643d58b0bfe8e3ad6c",class:"font-weight-500"},this._translations.add)),s("calcite-segmented-control-item",{key:"b6c4199b48d7cedec36510572de7f63ee105b605",checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.REMOVE),value:m.REMOVE},s("span",{key:"c3047bd7b4564b171ed8cb7c7842b64e7a4677f8",class:"font-weight-500"},this._translations.remove)))),s("div",{key:"14408ec1abdbb64e4c4ccc473b3615d7036399f7"},s("map-draw-tools",{key:"fe946dc9ae433dabe45f5da695cde3daaa9e057d",active:!0,drawMode:u.REFINE,mapView:this.mapView,onDrawRedo:()=>this._redo(),onDrawUndo:()=>this._undo(),onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,redoEnabled:this._refineSelectionSet?.redoStack.length>0,ref:i=>{this._drawTools=i},undoEnabled:this._refineSelectionSet?.undoStack.length>0})),s("br",{key:"a532f7b86708d6839449397841a68f2258645410"}),s("calcite-list",{key:"ef51c27c396c52c8fcb1c512957b3b2e276306e4",class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){const t=i.detail?.graphics[0].geometry;this._selectFeatures(t)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{const e=t?.layerView?.layer.id;return e&&i.indexOf(e)<0?i.push(e):t.workflowType===y.REFINE&&Object.keys(t.refineInfos).forEach((t=>{i.indexOf(t)<0&&i.push(t)})),i}),[])}async _setRefineSet(i){this.selectionSets.some((t=>{if(t.workflowType===y.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const e={};e[i]={addIds:[],removeIds:[],layerView:await p(this.mapView,i)},t?t.refineInfos={...t.refineInfos,...e}:(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:y.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:e,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===y.REFINE)return t=i,!0}));let e=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{e+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[s("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",e.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=g(i);return Object.keys(t).reduce(((i,e)=>i+t[e].ids.length),0)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}async _selectFeatures(i){this.selectionLoadingChange.emit(!0),this._featuresCollection[this._refineLayer?.layer.id]=[];const t=await b(0,this._refineLayer?.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let e=[];Object.keys(t).forEach((i=>{i===this._refineLayer?.layer.id&&(e=e.concat(t[i]))}));const s=Array.isArray(e)?e.map((i=>i.attributes[i?.layer?.objectIdField])):[];await this._updateIds(s,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),w.highlightHandles=await f(this.selectionSets)}_clearHighlight(){w.removeHandles()}async _updateIds(i,t,e,s){let a=!1;const h=this._refineSelectionSet.refineInfos,l=s.layer.id,n={};n[l]={addIds:[],removeIds:[],layerView:s};const o=Object.keys(h).indexOf(l)>-1?h[l]:n[l];if(t===m.ADD)o.addIds=[...new Set([...i,...o.addIds])],o.addIds.length>0&&e.push({ids:i,mode:t,layerView:s}),o.removeIds.length>0&&(o.removeIds=o.removeIds.filter((t=>i.indexOf(t)<0)));else{const h=this.selectionSets.reduce(((t,e)=>(i.forEach((i=>{e.workflowType!==y.REFINE?e.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(e.refineInfos).some((a=>{const h=e.refineInfos[a];if(h.layerView.layer.id===s.layer.id&&h.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);o.removeIds=[...new Set([...h,...o.removeIds])],o.addIds=o.addIds.filter((i=>h.indexOf(i)<0)),o.removeIds.length>0&&e.push({ids:h,mode:t,layerView:s}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==y.REFINE&&t.layerView.layer.id===s.layer.id?(t.selectedIds=t.selectedIds.filter((i=>o.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[l]=o,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}};P.style=':host{display:block}.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}.border{outline:1px solid var(--calcite-color-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.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:var(--calcite-color-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110, 110, 110, .3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110, 110, 110, .3)}.display-flex{display:flex}.font-bold{font-weight:bold}.width-full{width:100%}.label-margin-0{--calcite-label-margin-bottom:0}.padding-start-1-2{padding-inline-start:0.5rem}.font-weight-500{font-weight:500}.word-wrap-anywhere{word-wrap:anywhere}';export{S as map_select_tools,k as pdf_download,P as refine_selection}
|
6
|
+
import{r as i,c as t,g as e,h as s,H as a}from"./p-4e6eb06e.js";import{a as h,l,g as n}from"./p-f4aadb3b.js";import{e as c,h as o,k as r,l as d,c as p,m as b,n as g,o as y}from"./p-d572627c.js";import{a as f,e as m,f as u}from"./p-80cb7c73.js";import{s as w}from"./p-51c6e6fe.js";import{d as v,a as _}from"./p-46c8015c.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-dc9d4be3.js";import"./p-d0d020a5.js";import"./p-7530a02f.js";import"./p-9bb44f57.js";const S=class{constructor(e){i(this,e),this.selectionSetChange=t(this,"selectionSetChange",7),this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.enableLayerFeatures=!0,this.enableLayerFeaturesOnLoad=!1,this.enableSearchDistance=!0,this.enableSearchDistanceOnLoad=!1,this.enableSketchTools=!0,this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.locale=void 0,this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectionLayerIds=[],this.selectLayerView=void 0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._numSelected=0,this._searchDistanceEnabled=!1,this._searchTerm=void 0,this._selectionLoading=!1,this._translations=void 0,this._useLayerFeaturesEnabled=!1}get el(){return e(this)}_esriRequest;FeatureLayer;Graphic;GraphicsLayer;Search;_geometryEngine;_bufferGeometry;_bufferGraphicsLayer;_bufferTools;_distance;_drawTools;_labelName;_selectLayers;_searchElement;_searchResult;_searchWidget;_selectedIds=[];_selectionLabel="";_skipGeomOIDs;_sketchGraphic;_graphics=[];_unit;_workflowType;_featuresCollection={};async watchGeometriesHandler(i,t){if(i!==t){const t=0===i.length;if(await this._clearResults(t,t),i.length>0)return this._highlightWithOIDsOrGeoms()}}async mapViewWatchHandler(i,t){i&&i!==t&&await this._init()}async watchSearchConfigurationHandler(i,t){JSON.stringify(i)!==JSON.stringify(t)&&await this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||await this._updateLabel(),{id:this.isUpdate?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools?.distance,download:!0,unit:this._bufferTools?.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this._searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this._useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}selectionSetChange;searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}async distanceChanged(i){await this._distanceChanged(i.detail)}async unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,await this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){await this._init()}render(){const i=this.enableSketchTools?"":"display-none",t=this.enableSketchTools?"padding-top-1":"";return s(a,{key:"62c70f52dbf364c71048b6de11477735fa3eddc4"},this._getMapLayerPicker(),s("div",{key:"f749a152c0821969177ca6bc83b3e75bac232f98",class:"border-bottom"}),s("div",{key:"e5f564bd4c01dd3648891f74581f3826ce59a06c",class:"padding-top-sides-1"},s("div",{key:"0f2a402284088431d0cc956cf17cd9420080a540",class:"search-widget",ref:i=>{this._searchElement=i}}),s("div",{key:"d3f9352d3a6ff51ecbda166ea2dd9ae49bdec443",class:t},s("map-draw-tools",{key:"00fdebdc3d430965aaa9d5f28b5a2f1d50afdeb8",active:!0,class:i,editGraphicsEnabled:!this._useLayerFeaturesEnabled,graphics:this._graphics,mapView:this.mapView,onSketchGraphicsChange:i=>{this._sketchGraphicsChanged(i)},pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),this.enableSearchDistance?this._getBufferOptions():void 0,this.enableLayerFeatures?this._getUseLayerFeaturesOptions():void 0,this._getNumSelected()),s("div",{key:"67ecd2ef8f3cd8819fc57785e2b84994c8e71547",class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){this.enableSearchDistanceOnLoad&&(this._searchDistanceEnabled=!0,this.enableSearchDistanceOnLoad=!1);const i=this._searchDistanceEnabled?"search-distance":"div-not-visible",t="number"==typeof this.selectionSet?.distance?this.selectionSet.distance:this.defaultBufferDistance;return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.searchDistance,s("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"search-distance-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},s("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),s("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),s("div",{class:i},s("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:t,geometries:this.geometries,onBufferComplete:i=>{this._bufferComplete(i)},ref:i=>this._bufferTools=i,unit:this.selectionSet?.unit||this.defaultBufferUnit})))}_getUseLayerFeaturesOptions(){this.enableLayerFeaturesOnLoad&&(this._useLayerFeaturesEnabled=!0,this.enableLayerFeaturesOnLoad=!1);const i=this._useLayerFeaturesEnabled?"div-visible":"div-not-visible";return s("div",null,s("div",{class:"padding-top-1 display-flex"},s("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},s("div",{class:"tooltip-container"},this._translations.useLayerFeatures,s("calcite-icon",{class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"use-layer-features-icon",scale:"s"}))),s("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},s("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),s("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),s("div",{class:i+" padding-top-1"},s("map-layer-picker",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedIds:this.layerViews.map((i=>i.layer.id)),showTables:!1})))}_getNumSelected(){const i=h(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return s("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?s("div",null,s("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):s("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),s("calcite-input-message",{class:"info-blue",scale:"m"},this._selectionLoading?t:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())))}_getNameInput(){return s("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},s("calcite-label",{class:"font-bold"},this._translations.listName,s("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return s("div",{class:"display-flex padding-sides-1 padding-bottom-1"},s("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,s("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._inputLayerSelectionChange(i)},selectedIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[],showTables:!1})))}async _initModules(){const[i,t,e,s,a,h]=await l(["esri/request","esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this._esriRequest=i,this.GraphicsLayer=t,this.Graphic=e,this.Search=s,this._geometryEngine=a,this.FeatureLayer=h}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),await this._initSearchWidget()}async _initSelectionSet(){this.selectionSet&&(this._searchTerm=this.selectionSet.searchResult?.name,this._searchResult=this.selectionSet.searchResult,this._selectLayers=this.selectionSet.selectLayers,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs,this._searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this._useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...this.selectionSet?.geometries||[]],this._graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:this.sketchPolygonSymbol}))),this._selectionLabel=this.selectionSet?.label,this._useLayerFeaturesEnabled||await(this._drawTools?.updateGraphics()),await c(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}async _initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t={view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm,...i};this._searchWidget=new this.Search(t),this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{this._selectResult(i.result)})),await this._searchWidget.when((()=>{this._searchWidget.allPlaceholder=this.searchConfiguration?.allPlaceholder&&"find address or place"!==this.searchConfiguration.allPlaceholder.toLowerCase()?this.searchConfiguration.allPlaceholder:this._translations.placeholder}))}}async _selectResult(i){if(i){this._searchResult=i;const t=i.feature,e=t?.layer,s=this.selectLayerView.layer,a=t?.getObjectId();let h,l;e.sourceJSON?.isView&&(h=await this._getViewSourceUrl(e.url)),s.sourceJSON?.isView&&(l=await this._getViewSourceUrl(s.url));const n=e?.url?.toLowerCase(),c=h?.toLowerCase(),o=s?.url?.toLowerCase(),r=l?.toLowerCase(),d=n&&o&&(n===o||n===r||c===o||c===r)&&!isNaN(a),p=d?[a]:void 0;this._workflowType=f.SEARCH,this._updateLabel();const b=[i.feature];this._updateSelection(b,d,p),this._drawTools.graphics=b,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}}async _getViewSourceUrl(i){let t="";const e=`${i}/sources?f=json`;try{const i=await this._esriRequest(e,{query:{f:"json"}});1===i?.data?.services?.length&&(t=i.data.services[0].url)}catch(i){console.log(i)}return t}_searchClearLabel(){return this._searchResult?.name&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const e=i?.sources;return e?.length>0?(i={...i,includeDefaultSources:!1},e.forEach((i=>{if(i.hasOwnProperty("layer")){const e=i,s=e.layer?.id,a=s?t.map.findLayerById(s):null,h=e?.layer?.url;a?e.layer=a:h&&(e.layer=new this.FeatureLayer(h))}})),e?.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===t?.name&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i={...i,includeDefaultSources:!0},i}_initGraphicsLayer(){const i=this._translations.bufferLayer;if(this.mapView){const t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),w.managedLayers[i]="buffer";const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}}async _sketchGraphicsChanged(i,t=!1){const e=i.detail.graphics;if(e.length>0&&e[0])if(t||(this._sketchGraphic=e[0]),this._workflowType=this._useLayerFeaturesEnabled?f.SELECT:f.SKETCH,this._workflowType===f.SKETCH&&await this._drawTools.updateGraphics(),await this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(e)?e.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=e.reduce(((i,t)=>(t?.layer?.objectIdField?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i)),[]),s=i.detail.useOIDs&&t.length>0;this._updateSelection(e,s,t),s&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){return this._skipGeomOIDs?.length>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(i){w.removeHandles(),i.length>0&&w.highlightHandles.push(await o(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await r(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,e=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),e=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();await this._distanceChanged({oldValue:t,newValue:e})}_geomQuery(i){const t=d(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName&&(this._labelName.value="")),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),w.removeHandles(),this._drawTools?.clear&&(this._graphics=[],await this._drawTools.clear()),this._numSelected=this._selectedIds.length,this.selectionSetChange.emit(this._numSelected)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,e){this._selectedIds=t&&e?e:this._selectedIds,this._skipGeomOIDs=t?e:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}async _updateLabel(){if(this.enableSearchDistance){const i=this._selectionLabel.indexOf(this._translations.sketch)>-1,t=this._selectionLabel.indexOf(this._translations.select)>-1,e=this._selectionLabel.indexOf(this._searchResult?.name)>-1,s=this._workflowType===f.SEARCH?this._searchResult?.name:this._workflowType===f.SELECT?this._translations.select:this._translations.sketch,a=this._unit?this._unit:this._bufferTools.unit,h=await this._bufferTools.getTranslatedUnit(a),l=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=i||t||e||!this._selectionLabel?`${s} ${l} ${h}`:this._selectionLabel,this._labelName.value=this._selectionLabel}}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){const t=i.detail.map((i=>p(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i,this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}))}}async _inputLayerSelectionChange(i){const t=i?.detail?.length>0?i.detail[0]:"";this.selectLayerView&&t===this.selectLayerView.layer.id||(this.selectLayerView=await p(this.mapView,t),await this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}async _distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,await this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],b(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))}));let e=!1;t.forEach((i=>{const t=i.geometry;i.symbol="point"===t.type?this.sketchPointSymbol:"polyline"===t.type?this.sketchLineSymbol:"polygon"===t.type?this.sketchPolygonSymbol:void 0,e=i?.layer?.hasOwnProperty("objectIdField")||i.hasOwnProperty("getObjectId")}));const s=this.layerViews[0].layer,a=this.selectLayerView.layer,h=e&&s.url===a.url&&a.layerId===s.layerId;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:h}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}static get watchers(){return{geometries:["watchGeometriesHandler"],mapView:["mapViewWatchHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};S.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{border-inline-end:1px solid var(--calcite-color-border-2)}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-color-border-2)}.tooltip-container{display:flex}.padding-start-1-2{padding-inline-start:0.5rem}.icon{--calcite-color-icon-color:var(--calcite-color-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-color-text-2)}';const L=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),k=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}get el(){return e(this)}_labelInfoElement;_intl;async downloadCSV(i,t,e,s=!0){return v(i,t,!0,e,s)}async downloadPDF(i,t,e=!1,s="",a=""){return _(i,t,this._labelInfoElement.selectedOption?.value,e,s,a)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return s(a,{key:"3d3fa11ecc4cf7a49c4b3831a6c4c19abd6c9ed9"},s("calcite-select",{key:"74e76d8854fd582d2ed214c1b8f52c5744be8167",disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidLoad(){this._renderOptions()}async _initModules(){const[i]=await l(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="‎"+i.descriptionPDF.labelWidthDisplay+" x "+i.descriptionPDF.labelHeightDisplay+"‏";return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}_renderOptions(){(L.default||L).sort(((i,t)=>{const e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),s=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<s?-1:e>s?1:0})).forEach(((i,t)=>{const e=document.createElement("calcite-option");e.value=i,e.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(e),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(e.selected=!0,this._labelInfoElement.selectedOption=e)}))}};k.style=":host{display:block}";const P=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this.addresseeLayer=void 0,this.enabledLayerIds=[],this.locale=void 0,this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=m.ADD,this._refineLayer=void 0}get el(){return e(this)}_addEnabled=!0;_drawTools;_refineSets=[];_enabledLayerIds=[];_layerPicker;_featuresCollection={};_refineSelectionSet;selectionLoadingChange;selectionSetsChanged;async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){return s(a,{key:"b7322ad26466e7c710b08b1cd10edf3e82d18603"},s("div",{key:"05289c139685611149306ade3b9217c374bf54e7",class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},s("div",{key:"a24e1b1ffb921bb493fb4c0e06b455e564077ad2",class:"display-flex"},s("calcite-label",{key:"a6e25d7f0ad1a3aab589bd4731a1fbea87b08b5b",class:"font-bold width-full label-margin-0"},s("div",{key:"d1850cec01ff43a81dfe5d71dc0b88f4fb4de147",class:"display-flex"},this._translations.inputLayer,s("calcite-icon",{key:"ed94bff762eb431bef9207c1db6b9dd5f56d7132",class:"padding-start-1-2 icon",flipRtl:!("he"===this.locale?.toLowerCase()),icon:"question",id:"refine-input-layer",scale:"s"})),s("map-layer-picker",{key:"5da6c655606a2b1ad4f723c13d0b2c5a50464029",enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedIds:[this._refineLayer.layer.id],showTables:!1})),s("calcite-popover",{key:"3bfe937cd5d2c8cc9a2e1b5628a86bc44b529963",closable:!0,label:"",referenceElement:"refine-input-layer"},s("span",{key:"cc46053c7494631c07521857e90ae83dc3f440cc",class:"tooltip-message"},this._translations.inputLayerTip)))),s("div",{key:"4ceced950b73cc06d28cac4f76d52126249bdbbd",class:"padding-1"},s("div",{key:"5084d664578acd35c550c57d8c7a27cf97f06332",class:"padding-bottom-1"},s("calcite-segmented-control",{key:"965f42a4b3b3c19401681be1f86ab41dcc58a24a",class:"w-100",width:"full"},s("calcite-segmented-control-item",{key:"dad9b9c04c8fcdda7d5cad7c044fb592b6f740bf",checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.ADD),value:m.ADD},s("span",{key:"0cf895d959f14966736b22d4652f406c75af5c0e",class:"font-weight-500"},this._translations.add)),s("calcite-segmented-control-item",{key:"6f0c8158159215d5a0929deb62c97db5058545a3",checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(m.REMOVE),value:m.REMOVE},s("span",{key:"77c66ccd25105c2be67178303d0652a90fa97e35",class:"font-weight-500"},this._translations.remove)))),s("div",{key:"0e409d21bda555363c9a0e870cba3e2f9556bcbb"},s("map-draw-tools",{key:"d84888210ce4c31442a523dc5976fee6bd246b9c",active:!0,drawMode:u.REFINE,mapView:this.mapView,onDrawRedo:()=>this._redo(),onDrawUndo:()=>this._undo(),onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,redoEnabled:this._refineSelectionSet?.redoStack.length>0,ref:i=>{this._drawTools=i},undoEnabled:this._refineSelectionSet?.undoStack.length>0})),s("br",{key:"b66849ca294e717352e34ac647f69bef36ba9755"}),s("calcite-list",{key:"8e13006094c5b9d5d63d467d5938e95d00e42ded",class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){const t=i.detail?.graphics[0].geometry;this._selectFeatures(t)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{const e=t?.layerView?.layer.id;return e&&i.indexOf(e)<0?i.push(e):t.workflowType===f.REFINE&&Object.keys(t.refineInfos).forEach((t=>{i.indexOf(t)<0&&i.push(t)})),i}),[])}async _setRefineSet(i){this.selectionSets.some((t=>{if(t.workflowType===f.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const e={};e[i]={addIds:[],removeIds:[],layerView:await p(this.mapView,i)},t?t.refineInfos={...t.refineInfos,...e}:(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:f.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:e,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===m.ADD?m.REMOVE:m.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===f.REFINE)return t=i,!0}));let e=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{e+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[s("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",e.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),s("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=g(i);return Object.keys(t).reduce(((i,e)=>i+t[e].ids.length),0)}async _getTranslations(){const i=await n(this.el);this._translations=i[0]}async _selectFeatures(i){this.selectionLoadingChange.emit(!0),this._featuresCollection[this._refineLayer?.layer.id]=[];const t=await b(0,this._refineLayer?.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let e=[];Object.keys(t).forEach((i=>{i===this._refineLayer?.layer.id&&(e=e.concat(t[i]))}));const s=Array.isArray(e)?e.map((i=>i.attributes[i?.layer?.objectIdField])):[];await this._updateIds(s,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),w.highlightHandles=await y(this.selectionSets)}_clearHighlight(){w.removeHandles()}async _updateIds(i,t,e,s){let a=!1;const h=this._refineSelectionSet.refineInfos,l=s.layer.id,n={};n[l]={addIds:[],removeIds:[],layerView:s};const c=Object.keys(h).indexOf(l)>-1?h[l]:n[l];if(t===m.ADD)c.addIds=[...new Set([...i,...c.addIds])],c.addIds.length>0&&e.push({ids:i,mode:t,layerView:s}),c.removeIds.length>0&&(c.removeIds=c.removeIds.filter((t=>i.indexOf(t)<0)));else{const h=this.selectionSets.reduce(((t,e)=>(i.forEach((i=>{e.workflowType!==f.REFINE?e.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(e.refineInfos).some((a=>{const h=e.refineInfos[a];if(h.layerView.layer.id===s.layer.id&&h.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);c.removeIds=[...new Set([...h,...c.removeIds])],c.addIds=c.addIds.filter((i=>h.indexOf(i)<0)),c.removeIds.length>0&&e.push({ids:h,mode:t,layerView:s}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==f.REFINE&&t.layerView.layer.id===s.layer.id?(t.selectedIds=t.selectedIds.filter((i=>c.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[l]=c,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}};P.style=':host{display:block}.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}.border{outline:1px solid var(--calcite-color-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.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:var(--calcite-color-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110, 110, 110, .3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110, 110, 110, .3)}.display-flex{display:flex}.font-bold{font-weight:bold}.width-full{width:100%}.label-margin-0{--calcite-label-margin-bottom:0}.padding-start-1-2{padding-inline-start:0.5rem}.font-weight-500{font-weight:500}.word-wrap-anywhere{word-wrap:anywhere}';export{S as map_select_tools,k as pdf_download,P as refine_selection}
|
@@ -9,4 +9,4 @@ 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
|
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
10
10
|
* v2.13.0
|
11
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:"
|
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}
|
@@ -8,4 +8,4 @@ import{r as t,h as i,g as s,c as e,F as a}from"./p-4e6eb06e.js";import{c as h}fr
|
|
8
8
|
* All material copyright ESRI, All Rights Reserved, unless otherwise specified.
|
9
9
|
* See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details.
|
10
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:"05a12e56500ab833e856b8f5ac0f8371de522170","full-height":!0},i("info-card",{key:"53c2102681c8005322c1711b038087b1a70d9a53",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:"1cf9a8eb026a2ed6c15ccafc3910fed388e63e5d",class:"buttons-container"},this._commentsAvailable&&i("calcite-button",{key:"c95920ae526cfeaa9a8824b985f593c95807c3ae",appearance:"transparent",iconEnd:"speech-bubble",kind:"neutral",onClick:()=>{this.addComment.emit()},scale:"m"},this._relatedFeaturesOIDs.length),this._likeFieldAvailable&&i("calcite-button",{key:"cf6cab791332884e63615058d6d0a1861534177b",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:"1fe322958b367df620c73834353251d05566d8c7",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:"8eefe98bc8af36db6793879c38dbed85f45b4a36",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){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(),this._isLoading=!0}async componentDidLoad(){await this.setLayers(),this._isLoading=!1}render(){return i(a,{key:"96f61a2b92d352cdc341961c54b9fdfb06bab6fc"},this._isLoading&&i("calcite-loader",{key:"948c5a101fe19294dbc99a5d015c4f08c3db7f24",label:"",scale:"m"}),!this._isLoading&&this.mapView&&this._noLayersToDisplay&&i("calcite-notice",{key:"23a73833e78b0c0009453ecfbf9bc000f2f7ff33",class:"error-msg",icon:"layers-reference",kind:"danger",open:!0},i("div",{key:"da338486c22d7d70499713e22d45bd343c752e38",slot:"title"},this._translations.error),i("div",{key:"751c99a20af04f7253a518181d02a353e7f1b6b8",slot:"message"},this._translations.noLayerToDisplayErrorMsg)),!this._isLoading&&this.mapView&&i("calcite-list",{key:"09c24ccb0ce715bc0606302af41571b5594e64b5","selection-appearance":"border","selection-mode":"none"},this.renderLayerList()))}async setLayers(){this.mapView&&await this.initLayerHash()}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}
|
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}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,g as i,h as s,H as e,c as a}from"./p-4e6eb06e.js";import{l as h,g as n}from"./p-f4aadb3b.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}get el(){return i(this)}BasemapGallery;PortalBasemapsSource;_basemapElement;async basemapConfigWatchHandler(){if(this.basemapWidget?.source){const t=this.basemapWidget?.source;t.query=this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,await t.refresh()}}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"1f8be0f65a784ffaac49b8a5a15ebd6fb72d6643"},s("div",{key:"2c1bde6c0624b476f6c34302ea843da195f535cb",ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const i=new this.PortalBasemapsSource({query:this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await i.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:i})}}static get watchers(){return{basemapConfig:["basemapConfigWatchHandler"],mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.facilityChanged=a(this,"facilityChanged",7),this.levelChanged=a(this,"levelChanged",7),this.siteChanged=a(this,"siteChanged",7),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}get el(){return i(this)}FloorFilter;_floorFilterElement;reactiveUtils;_facilityHandle;_levelHandle;_siteHandle;async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}facilityChanged;levelChanged;siteChanged;async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"51da7a656e7f56ecc8cc4093d3dab856f77b5c7a"},s("div",{key:"d2fda7047f09a673216484f5c202f039fca20108",ref:t=>{this._floorFilterElement=t}}))}async componentDidLoad(){this.mapView&&!this.floorFilterWidget&&await this._initFloorFilter(this.mapView)}async _initModules(){const[t,i]=await h(["esri/widgets/FloorFilter","esri/core/reactiveUtils"]);this.FloorFilter=t,this.reactiveUtils=i}_destroyWidget(){this.floorFilterWidget&&(this.floorFilterWidget.destroy(),this.floorFilterWidget=void 0),this._floorFilterElement&&this._floorFilterElement.remove()}_initContainer(){this._destroyWidget(),this._floorFilterElement=document.createElement("div")}async _initFloorFilter(t){const i=t?.map;await i.when((()=>{t&&this.enabled&&this.FloorFilter&&i?.floorInfo&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),this._facilityHandle?.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),this._levelHandle?.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),this._siteHandle?.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}static get watchers(){return{mapView:["mapViewWatchHandler"],enabled:["enabledWatchHandler"]}}};c.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}Fullscreen;_fullscreenElement;_fullscreenStateChangeHandle;reactiveUtils;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}fullscreenStateChange;async componentWillLoad(){await this._initModules()}render(){return s(e,{key:"9fc5dfeffc8601763b27e001311ec317934ebcae"},s("div",{key:"65f2ab96d7283a9a10a113be0cdef6a95de1ee1b",class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};r.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}get el(){return i(this)}Legend;_legendElement;async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"f520dd3737b8b883d8e27eb9a63da25f6d5b9375"},s("div",{key:"6775e1c58ecd4fe63d50358fe2cd4f050cb1d709",ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,view:t}))}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this.mapInfos=[],this.isMapLayout=void 0,this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}get el(){return i(this)}_list;_loadedId="";_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=t?.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t){const i=this.mapInfos?.filter((i=>i.id===t));t&&i?.length>0&&this._webMapSelected(i[0])}async close(){this._mapListExpanded&&(this._mapListExpanded=!1)}async toggle(t){this._mapListExpanded=t}mapInfoChange;async componentWillLoad(){await this._getTranslations()}render(){return s(e,{key:"178a4e3fcd08972b0465885c4891a732ea970428"},this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){const t="map-picker-expand-toggle";return s("div",{class:"width-full"},s("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",iconStart:"map",id:t,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},this._webMapInfo?.name),s("calcite-tooltip",{placement:"bottom","reference-element":t},s("span",null,this._translations.switchMap)))}_getToolbar(){return s("div",{class:"display-flex border-right"},s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return s("div",{class:t?"map-list border-bottom-1 adjusted-height "+(this.isMapLayout?"width-26":"width-full"):"display-none"},s("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>s("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.width-26{width:26% !important}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.border-right{border-right:1px solid var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}.adjusted-height{max-height:calc(100% - 52px);overflow-y:auto}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}FeatureLayer;Search;_searchElement;_searchResult;async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return s(e,{key:"7c990343af0d1077a7315fd131379bc891310e30"},s("div",{key:"97cd41cf7f749f31701de3526cf2ef633eda48dd",class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this.mapView)}),this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return s?.length>0?(t.includeDefaultSources=!1,s.forEach((t=>{if(t.hasOwnProperty("layer")){const s=t,e=s.layer?.id,a=e?i.map.findLayerById(e):null,h=s?.layer?.url;a?s.layer=a:h&&(s.layer=new this.FeatureLayer(h))}})),s?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}";const m=class{constructor(i){t(this,i),this.basemapConfig=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.enableHome=void 0,this.enableSingleExpand=void 0,this.homeZoomToolsSize="m",this.layout="vertical",this.mapView=void 0,this.mapWidgetsSize="m",this.position="top-right",this.searchConfiguration=void 0,this.stackTools=!0,this.toolOrder=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}get el(){return i(this)}Expand;_basemapElement;_floorFilterElement;_fullscreenElement;_legendElement;_searchElement;_widgets=[];async mapViewWatchHandler(){await this.mapView.when((()=>{this._hasFloorInfo=this.mapView?.map?.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:this.position,index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){this._setZoomToolsSize();const t=this._showTools?"":"display-none",i=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFloorFilter?"":"display-none",o=this._showFullscreen?"":"display-none",c=this.enableSingleExpand?"margin-top-1-2":"",r=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],l=this.stackTools?"box-shadow":"";return s(e,{key:"087d0879847a1a48e3e586d4e851a55f0640dfea"},s("div",{key:"cd76a75845afb17c42722125f30fb5c59d305671",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?s("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))):void 0,s("div",{key:"f2522aa2d41243bcaf9ae75372c50454d354de1b",class:`${c} ${l} ${t}`},this._getMapWidgets(r))),s("basemap-gallery",{key:"38762b76d6e5300800a1214a579cc7c76d4f00d7",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),s("map-search",{key:"929003ecf89addceb07b6337a90f7d0558c67c18",class:i,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),s("map-legend",{key:"46177bd0963cefc5b5b36e4b4c08e323193d14c9",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),s("map-fullscreen",{key:"dfb346c088e665f137143655a47539148a3d2580",class:o,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),s("floor-filter",{key:"0c1bd8979355d6f5d2c7299bbca23f6762d94cc5",class:n,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){const t=document.getElementsByClassName("esri-zoom")[0]?.children[0],i=document.getElementsByClassName("esri-zoom")[0]?.children[1];if(t&&i){const s="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";t.style.width=s,t.style.height=s,i.style.width=s,i.style.height=s}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,this._legendElement?.legendWidget,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):this.enableSearch?this._getWidget(t,this._searchElement?.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,this._fullscreenElement?.fullscreenWidget,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):this.enableBasemap?this._getWidget(t,this._basemapElement?.basemapWidget,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(t,this._floorFilterElement?.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,i,e,a){return s("div",null,s("calcite-action",{alignment:"center",class:`${"s"===this.mapWidgetsSize?"square-32":"m"===this.mapWidgetsSize?"square-40":"square-48"} ${this.stackTools?"":"margin-bottom-1-2"} border-bottom ${this.stackTools?"":"box-shadow"}`,compact:!1,disabled:i,icon:t,id:t,onClick:a,scale:"s",text:""},s("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),s("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},s("span",null,e)))}_getWidget(t,i,s){if(this._widgets.indexOf(t)<0&&this.mapView&&i){const e=this.toolOrder.indexOf(t),a=new this.Expand({view:this.mapView,content:i});this.mapView.ui.add(s?a:i,{position:this.position,index:e>-1?e+(this.enableHome?2:1):1}),this._widgets.push(t)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};m.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.margin-bottom-1-2{margin-bottom:0.5rem}";export{o as basemap_gallery,c as floor_filter,r as map_fullscreen,l as map_legend,d as map_picker,p as map_search,m as map_tools}
|
6
|
+
import{r as t,g as i,h as s,H as e,c as a}from"./p-4e6eb06e.js";import{l as h,g as n}from"./p-f4aadb3b.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const o=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}get el(){return i(this)}BasemapGallery;PortalBasemapsSource;_basemapElement;async basemapConfigWatchHandler(){if(this.basemapWidget?.source){const t=this.basemapWidget?.source;t.query=this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,await t.refresh()}}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"1f8be0f65a784ffaac49b8a5a15ebd6fb72d6643"},s("div",{key:"2c1bde6c0624b476f6c34302ea843da195f535cb",ref:t=>{this._basemapElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t,i]=await h(["esri/widgets/BasemapGallery","esri/widgets/BasemapGallery/support/PortalBasemapsSource"]);this.BasemapGallery=t,this.PortalBasemapsSource=i}async _initBaseMapGallery(t){if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const i=new this.PortalBasemapsSource({query:this.basemapConfig?.basemapGroupId?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await i.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:i})}}static get watchers(){return{basemapConfig:["basemapConfigWatchHandler"],mapView:["mapViewWatchHandler"]}}};o.style=":host{display:block}";const r=class{constructor(i){t(this,i),this.facilityChanged=a(this,"facilityChanged",7),this.levelChanged=a(this,"levelChanged",7),this.siteChanged=a(this,"siteChanged",7),this.enabled=void 0,this.floorFilterWidget=void 0,this.mapView=void 0}get el(){return i(this)}FloorFilter;_floorFilterElement;reactiveUtils;_facilityHandle;_levelHandle;_siteHandle;async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}facilityChanged;levelChanged;siteChanged;async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"7890927db517fe8e1133fce3e0fe977a441f2abf"},s("div",{key:"34ad695eb04dd20a0b9893817a33df5020de7da1",ref:t=>{this._floorFilterElement=t}}))}async componentDidLoad(){this.mapView&&!this.floorFilterWidget&&await this._initFloorFilter(this.mapView)}async _initModules(){const[t,i]=await h(["esri/widgets/FloorFilter","esri/core/reactiveUtils"]);this.FloorFilter=t,this.reactiveUtils=i}_destroyWidget(){this.floorFilterWidget&&(this.floorFilterWidget.destroy(),this.floorFilterWidget=void 0),this._floorFilterElement&&this._floorFilterElement.remove()}_initContainer(){this._destroyWidget(),this._floorFilterElement=document.createElement("div")}async _initFloorFilter(t){const i=t?.map;await i.when((()=>{t&&this.enabled&&this.FloorFilter&&i?.floorInfo&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),this._facilityHandle?.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),this._levelHandle?.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),this._siteHandle?.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}static get watchers(){return{mapView:["mapViewWatchHandler"],enabled:["enabledWatchHandler"]}}};r.style=":host{display:block}";const c=class{constructor(i){t(this,i),this.fullscreenStateChange=a(this,"fullscreenStateChange",7),this.mapView=void 0,this.fullscreenWidget=void 0}Fullscreen;_fullscreenElement;_fullscreenStateChangeHandle;reactiveUtils;async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}fullscreenStateChange;async componentWillLoad(){await this._initModules()}render(){return s(e,{key:"350ebb01c52631c9441b6554f5b8e26f8ca1418e"},s("div",{key:"b09344b721da2cc18b74fb21f8017446ba5baa03",class:"fullscreen-widget",ref:t=>{this._fullscreenElement=t}}))}async componentDidUpdate(){await this._initFullscreenWidget()}async componentDidLoad(){await this._initFullscreenWidget()}async _initModules(){const[t,i]=await h(["esri/widgets/Fullscreen","esri/core/reactiveUtils"]);this.Fullscreen=t,this.reactiveUtils=i}async _initFullscreenWidget(){this.mapView&&this._fullscreenElement&&!this.fullscreenWidget?(this.fullscreenWidget=new this.Fullscreen({view:this.mapView}),await this.fullscreenWidget.when((()=>{this._fullscreenStateChangeHandle&&this._fullscreenStateChangeHandle.remove(),this._fullscreenStateChangeHandle=this.reactiveUtils.watch((()=>this.fullscreenWidget.viewModel.state),(t=>this.fullscreenStateChange.emit(t)))}))):this.fullscreenWidget&&(this.fullscreenWidget.view=this.mapView)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};c.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}get el(){return i(this)}Legend;_legendElement;async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return s(e,{key:"2c5cfbfd4048347ace5ff3cf17d411e85454be7a"},s("div",{key:"3927ef8af3a4a93fbd558480a96f982ca5b477a2",ref:t=>{this._legendElement=t}}))}async componentDidLoad(){this.mapView&&await this.mapViewWatchHandler()}async _initModules(){const[t]=await h(["esri/widgets/Legend"]);this.Legend=t}_initLegend(t){t&&this.Legend&&(this.legendWidget?this.legendWidget.view=t:this.legendWidget=new this.Legend({container:this._legendElement,view:t}))}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}";const d=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this.mapInfos=[],this.isMapLayout=void 0,this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}get el(){return i(this)}_list;_loadedId="";_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=t?.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t){const i=this.mapInfos?.filter((i=>i.id===t));t&&i?.length>0&&this._webMapSelected(i[0])}async close(){this._mapListExpanded&&(this._mapListExpanded=!1)}async toggle(t){this._mapListExpanded=t}mapInfoChange;async componentWillLoad(){await this._getTranslations()}render(){return s(e,{key:"84cc43e195045e28fe01e35fe2f6f06cbe28fefd"},this._getToolbar(),this._getMapNameList(this._mapListExpanded))}async componentDidLoad(){const t=this.mapInfos&&this.mapInfos.length>0?this.mapInfos[0]:void 0;t&&this._webMapSelected(t)}_getMapPicker(){const t="map-picker-expand-toggle";return s("div",{class:"width-full"},s("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",iconStart:"map",id:t,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},this._webMapInfo?.name),s("calcite-tooltip",{placement:"bottom","reference-element":t},s("span",null,this._translations.switchMap)))}_getToolbar(){return s("div",{class:"display-flex border-right"},s("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return s("div",{class:t?"map-list border-bottom-1 adjusted-height "+(this.isMapLayout?"width-26":"width-full"):"display-none"},s("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>s("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};d.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.width-26{width:26% !important}.height-full{height:100%}.display-flex{display:flex}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-color-border-3)}.border-right{border-right:1px solid var(--calcite-color-border-3)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-color-background);z-index:1000;width:100%;height:-moz-fit-content;height:fit-content}.display-none{display:none}.align-center{align-items:center}.adjusted-height{max-height:calc(100% - 52px);overflow-y:auto}";const p=class{constructor(i){t(this,i),this.mapView=void 0,this.popupEnabled=!1,this.resultGraphicEnabled=!1,this.searchConfiguration=void 0,this.searchTerm=void 0,this.searchWidget=void 0}FeatureLayer;Search;_searchElement;_searchResult;async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return s(e,{key:"482d8d891f8c6905eefee8b26f0837a4c7c2e525"},s("div",{key:"9a3993ab8a7506299cf2bdbfab23b47ac7fe3037",class:"search-widget",ref:t=>{this._searchElement=t}}))}async _initModules(){const[t,i]=await h(["esri/widgets/Search","esri/layers/FeatureLayer"]);this.Search=t,this.FeatureLayer=i}_initSearchWidget(){if(this.mapView&&this._searchElement&&!this.searchWidget){let t={view:this.mapView,container:this._searchElement,searchTerm:this.searchTerm};this.searchConfiguration&&(t={...this._getSearchConfig(this.searchConfiguration,this.mapView)}),this.searchWidget=new this.Search(t),this.searchWidget.popupEnabled=this.popupEnabled,this.searchWidget.resultGraphicEnabled=this.resultGraphicEnabled}else this.searchWidget&&(this.searchWidget.view=this.mapView)}_getSearchConfig(t,i){const s=t.sources;return s?.length>0?(t.includeDefaultSources=!1,s.forEach((t=>{if(t.hasOwnProperty("layer")){const s=t,e=s.layer?.id,a=e?i.map.findLayerById(e):null,h=s?.layer?.url;a?s.layer=a:h&&(s.layer=new this.FeatureLayer(h))}})),s?.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===i?.name&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t={...t,includeDefaultSources:!0},t}static get watchers(){return{searchConfiguration:["watchSearchConfigurationHandler"],mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.search-widget{width:100% !important;border:1px solid var(--calcite-color-border-input)}";const m=class{constructor(i){t(this,i),this.basemapConfig=void 0,this.enableLegend=void 0,this.enableFloorFilter=void 0,this.enableFullscreen=void 0,this.enableSearch=void 0,this.enableBasemap=void 0,this.enableHome=void 0,this.enableSingleExpand=void 0,this.homeZoomToolsSize="m",this.layout="vertical",this.mapView=void 0,this.mapWidgetsSize="m",this.position="top-right",this.searchConfiguration=void 0,this.stackTools=!0,this.toolOrder=void 0,this._hasFloorInfo=!1,this._translations=void 0,this._showTools=!0,this._showBasemapWidget=!1,this._showFloorFilter=!1,this._showFullscreen=!1,this._showLegendWidget=!1,this._showSearchWidget=!1}get el(){return i(this)}Expand;_basemapElement;_floorFilterElement;_fullscreenElement;_legendElement;_searchElement;_widgets=[];async mapViewWatchHandler(){await this.mapView.when((()=>{this._hasFloorInfo=this.mapView?.map?.floorInfo}))}async _showBasemapWidgetWatchHandler(t){t?this.mapView.ui.add(this._basemapElement.basemapWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._basemapElement.basemapWidget)}async _showFloorFilterWatchHandler(t){const i=this._floorFilterElement.floorFilterWidget;t?this.mapView.ui.add(i,{position:this.position,index:1}):this.mapView.ui.remove(i)}async _showFullscreenWatchHandler(t){const i=this._fullscreenElement.fullscreenWidget;t?"ready"===i.viewModel.state&&i.viewModel.enter():"active"===i.viewModel.state&&i.viewModel.exit()}async _showLegendWidgetWatchHandler(t){t?this.mapView.ui.add(this._legendElement.legendWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._legendElement.legendWidget)}async _showSearchWidgetWatchHandler(t){t?this.mapView.ui.add(this._searchElement.searchWidget,{position:this.position,index:1}):this.mapView.ui.remove(this._searchElement.searchWidget)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){this._setZoomToolsSize();const t=this._showTools?"":"display-none",i=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",n=this._showFloorFilter?"":"display-none",o=this._showFullscreen?"":"display-none",r=this.enableSingleExpand?"margin-top-1-2":"",c=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],l=this.stackTools?"box-shadow":"";return s(e,{key:"224b99c53e7f8ac9c072efbd2c2093c6c9684a9a"},s("div",{key:"ead56063c6aa28146d4c50044b6e7c98fd2ed1ab",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?s("div",{class:"box-shadow"},this._getActionGroup(this._showTools?"chevrons-up":"chevrons-down",!1,this._showTools?this._translations.collapse:this._translations.expand,(()=>this._toggleTools()))):void 0,s("div",{key:"3fd7a2bd6225c10b89e282d4521486ad7eb5802a",class:`${r} ${l} ${t}`},this._getMapWidgets(c))),s("basemap-gallery",{key:"43063099ee4b3a72d96b2ae6e4ca750dff109ae2",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),s("map-search",{key:"5c149ea67f2a2450864e968a50acce565d95e0b6",class:i,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),s("map-legend",{key:"d3add3a5f820c5d654fec793d3e6e46b6a8919a3",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),s("map-fullscreen",{key:"e18a3a5d021d76e7c8fa9ecf3903105d5a43bed2",class:o,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),s("floor-filter",{key:"cb5d92e503248818e9627ba4ee8d70c81495599d",class:n,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){const t=document.getElementsByClassName("esri-zoom")[0]?.children[0],i=document.getElementsByClassName("esri-zoom")[0]?.children[1];if(t&&i){const s="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";t.style.width=s,t.style.height=s,i.style.width=s,i.style.height=s}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,this._legendElement?.legendWidget,!0):void 0;case"search":return this.enableSearch&&this.enableSingleExpand?this._getActionGroup("magnifying-glass",!1,this._translations.search,(()=>this._search())):this.enableSearch?this._getWidget(t,this._searchElement?.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,this._fullscreenElement?.fullscreenWidget,!1):void 0;case"basemap":return this.enableBasemap&&this.enableSingleExpand?this._getActionGroup("basemap",!1,this._translations.basemap,(()=>this._toggleBasemapPicker())):this.enableBasemap?this._getWidget(t,this._basemapElement?.basemapWidget,!0):void 0;case"floorfilter":return this.enableFloorFilter&&this._hasFloorInfo&&this.enableSingleExpand?this._getActionGroup("urban-model",!1,this._translations.floorFilter,(()=>this._toggleFloorFilter())):this.enableFloorFilter&&this._hasFloorInfo?this._getWidget(t,this._floorFilterElement?.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,i,e,a){return s("div",null,s("calcite-action",{alignment:"center",class:`${"s"===this.mapWidgetsSize?"square-32":"m"===this.mapWidgetsSize?"square-40":"square-48"} ${this.stackTools?"":"margin-bottom-1-2"} border-bottom ${this.stackTools?"":"box-shadow"}`,compact:!1,disabled:i,icon:t,id:t,onClick:a,scale:"s",text:""},s("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),s("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},s("span",null,e)))}_getWidget(t,i,s){if(this._widgets.indexOf(t)<0&&this.mapView&&i){const e=this.toolOrder.indexOf(t),a=new this.Expand({view:this.mapView,content:i});this.mapView.ui.add(s?a:i,{position:this.position,index:e>-1?e+(this.enableHome?2:1):1}),this._widgets.push(t)}}_showLegend(){this._showLegendWidget=!this._showLegendWidget,this._showTools=!1}_search(){this._showSearchWidget=!this._showSearchWidget,this._showTools=!1}_toggleBasemapPicker(){this._showBasemapWidget=!this._showBasemapWidget,this._showTools=!1}_toggleFloorFilter(){this._showFloorFilter=!this._showFloorFilter,this._showTools=!1}_expand(){this._showFullscreen=!this._showFullscreen}_toggleTools(){this._showTools||(this._showBasemapWidget=!1,this._showSearchWidget=!1,this._showLegendWidget=!1,this._showFloorFilter=!1),this._showTools=!this._showTools}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}static get watchers(){return{mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};m.style=":host{display:block}.display-none{display:none}.margin-top-1-2{margin-top:0.5rem}.square-32{width:32px;height:32px}.square-40{width:40px;height:40px}.square-48{width:48px;height:48px}.width-40{width:40px}.square-40-41{width:40px;height:41px}.border-bottom{border-bottom:1px solid var(--calcite-color-border-3)}.box-shadow{box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.margin-bottom-1-2{margin-bottom:0.5rem}";export{o as basemap_gallery,r as floor_filter,c as map_fullscreen,l as map_legend,d as map_picker,p as map_search,m as map_tools}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as t,g as e,h as i,H as s}from"./p-4e6eb06e.js";import{g as a}from"./p-f4aadb3b.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const r=class{constructor(e){t(this,e),this.templateInfos=[],this._sortedTemplateInfos=[],this._translations=void 0}get el(){return e(this)}_sortOrder=["Hub Site Application","Hub Page","Web Experience","Instant App","Web Mapping Application","Dashboard","StoryMap","Form","QuickCapture Project","Workflow","Big Data Analytic","Real Time Analytic","Feed","Tool","Notebook","Data Pipeline","Project Package","Desktop Application Template","TypeNotFound","Web Map","Web Scene","Feature Layer (hosted, view)","Feature Layer (hosted)","Tile Layer","CSV","Microsoft Excel","Microsoft Word","Report Template","Rule Package","Group"];_types=[];async templateInfosWatchHandler(){this._types=[],this._sortedTemplateInfos=this._sortTemplates()}async componentWillLoad(){await this._getTranslations()}async componentWillRender(){0===this._sortedTemplateInfos.length&&this.templateInfos?.length>0&&(this._sortedTemplateInfos=this._sortTemplates())}render(){return i(s,{key:"
|
6
|
+
import{r as t,g as e,h as i,H as s}from"./p-4e6eb06e.js";import{g as a}from"./p-f4aadb3b.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const r=class{constructor(e){t(this,e),this.templateInfos=[],this._sortedTemplateInfos=[],this._translations=void 0}get el(){return e(this)}_sortOrder=["Hub Site Application","Hub Page","Web Experience","Instant App","Web Mapping Application","Dashboard","StoryMap","Form","QuickCapture Project","Workflow","Big Data Analytic","Real Time Analytic","Feed","Tool","Notebook","Data Pipeline","Project Package","Desktop Application Template","TypeNotFound","Web Map","Web Scene","Feature Layer (hosted, view)","Feature Layer (hosted)","Tile Layer","CSV","Microsoft Excel","Microsoft Word","Report Template","Rule Package","Group"];_types=[];async templateInfosWatchHandler(){this._types=[],this._sortedTemplateInfos=this._sortTemplates()}async componentWillLoad(){await this._getTranslations()}async componentWillRender(){0===this._sortedTemplateInfos.length&&this.templateInfos?.length>0&&(this._sortedTemplateInfos=this._sortTemplates())}render(){return i(s,{key:"9a940187b8b91f94346f51cd67cb3c9fd2d8f470"},this._getAccordion())}_getAccordion(){return i("calcite-accordion",{selectionMode:"single"},this._sortedTemplateInfos.reduce(((t,e)=>{const i=this._getTypeForDisplay(e.type,e.typeKeywords);return this._types.indexOf(i)<0&&(this._types.push(i),t.push(this._getAccordionItem(e))),t}),[]))}_getAccordionItem(t){const e=this._getTypeForDisplay(t.type,t.typeKeywords),s=this._sortedTemplateInfos.filter((t=>this._getTypeForDisplay(t.type,t.typeKeywords)===e));return i("calcite-accordion-item",{description:`${e} (${s.length})`},i("solution-item-icon",{class:"padding-start-1",slot:"actions-start",type:t.type,typeKeywords:t.typeKeywords}),this._getList(s))}_getList(t){const e=this._sortTemplatesByTitle(t);return i("calcite-list",null,e.map((t=>this._getListItem(t))))}_getListItem(t){return i("calcite-list-item",{class:"font-size-override",description:t.snippet,label:t.title,value:t.id})}_sortTemplatesByTitle(t){return t.sort(((t,e)=>t.title<e.title?-1:t.title>e.title?1:0))}_sortTemplates(){return this.templateInfos.sort(((t,e)=>{const i=this._getTypeForSort(t),s=this._getTypeForSort(e);return this._sortOrder.indexOf(i)-this._sortOrder.indexOf(s)}))}_getTypeForSort(t){let e=this._getTypeForDisplay(t.type,t.typeKeywords);return this._sortOrder.indexOf(e)<0&&(e="TypeNotFound"),e}_getTypeForDisplay(t,e){let i=t;return"Feature Service"===t&&(i=e.indexOf("View Service")>-1?"Feature Layer (hosted, view)":"Feature Layer (hosted)"),"Web Mapping Application"===t&&(i=e.indexOf("configurableApp")>-1?"Instant App":i),i}async _getTranslations(){const t=await a(this.el);this._translations=t[0]}static get watchers(){return{templateInfos:["templateInfosWatchHandler"]}}};r.style=":host{display:block}.padding-start-1{padding-inline-start:1rem}.font-size-override{--calcite-font-size--2:var(--calcite-font-size--1)}";export{r as solution_item_accordion}
|
@@ -3,4 +3,4 @@
|
|
3
3
|
* Licensed under the Apache License, Version 2.0
|
4
4
|
* http://www.apache.org/licenses/LICENSE-2.0
|
5
5
|
*/
|
6
|
-
import{r as e,g as s,h as t,H as o}from"./p-4e6eb06e.js";const r=class{constructor(s){e(this,s)}get el(){return s(this)}render(){return t(o,{key:"
|
6
|
+
import{r as e,g as s,h as t,H as o}from"./p-4e6eb06e.js";const r=class{constructor(s){e(this,s)}get el(){return s(this)}render(){return t(o,{key:"65473b5e82ede7018cc249c583e09be2981172ed"},t("slot",{key:"0d637e47de593df9cd1e716538742996d9de682e"}))}};r.style=":host{display:block}";export{r as location_flow_item}
|