@esri/solutions-components 0.8.60 → 0.8.61

Sign up to get free protection for your applications and to get access to all the features.
Files changed (158) hide show
  1. package/dist/cjs/basemap-gallery_7.cjs.entry.js +2 -2
  2. package/dist/cjs/buffer-tools_3.cjs.entry.js +2 -2
  3. package/dist/cjs/calcite-action-pad_2.cjs.entry.js +2 -2
  4. package/dist/cjs/calcite-alert_4.cjs.entry.js +4 -4
  5. package/dist/cjs/calcite-block_5.cjs.entry.js +4 -4
  6. package/dist/cjs/calcite-dropdown-group_2.cjs.entry.js +2 -2
  7. package/dist/cjs/calcite-flow_6.cjs.entry.js +2 -2
  8. package/dist/cjs/calcite-shell-panel_14.cjs.entry.js +2 -2
  9. package/dist/cjs/card-manager_3.cjs.entry.js +24 -9
  10. package/dist/cjs/consent-manager.cjs.entry.js +2 -2
  11. package/dist/cjs/crowdsource-manager.cjs.entry.js +4 -12
  12. package/dist/cjs/crowdsource-reporter.cjs.entry.js +2 -2
  13. package/dist/cjs/{downloadUtils-2e169425.js → downloadUtils-f4b01945.js} +2 -2
  14. package/dist/cjs/feature-list.cjs.entry.js +4 -4
  15. package/dist/cjs/{helpers-95c28cf3.js → helpers-0104985c.js} +1 -1
  16. package/dist/cjs/{index.es-301b8d18.js → index.es-08ff626f.js} +3 -3
  17. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +5 -5
  18. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +2 -2
  19. package/dist/cjs/instant-apps-create.cjs.entry.js +4 -4
  20. package/dist/cjs/instant-apps-export.cjs.entry.js +4 -4
  21. package/dist/cjs/instant-apps-header.cjs.entry.js +2 -2
  22. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +3 -3
  23. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +3 -3
  24. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +3 -3
  25. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +3 -3
  26. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +5 -5
  27. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +4 -4
  28. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +6 -6
  29. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +6 -6
  30. package/dist/cjs/instant-apps-measurement.cjs.entry.js +4 -4
  31. package/dist/cjs/instant-apps-popover.cjs.entry.js +4 -4
  32. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +4 -4
  33. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +4 -4
  34. package/dist/cjs/instant-apps-splash.cjs.entry.js +4 -4
  35. package/dist/cjs/{languageSwitcher-f0bb94fa.js → languageSwitcher-dc2dd354.js} +1 -1
  36. package/dist/cjs/{languageUtil-f22ce913.js → languageUtil-a3e1eafd.js} +1 -1
  37. package/dist/cjs/layout-manager.cjs.entry.js +2 -2
  38. package/dist/cjs/{loadModules-36d49819.js → loadModules-8567855e.js} +1 -1
  39. package/dist/cjs/loader.cjs.js +1 -1
  40. package/dist/cjs/{locale-708985a1.js → locale-1d07e942.js} +2 -2
  41. package/dist/cjs/{locale-f6fd03d2.js → locale-31289fc5.js} +1 -1
  42. package/dist/cjs/map-select-tools_3.cjs.entry.js +3 -3
  43. package/dist/cjs/{popupUtils-36e57a27.js → popupUtils-64405c62.js} +2 -2
  44. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  45. package/dist/cjs/solution-configuration.cjs.entry.js +2 -2
  46. package/dist/cjs/solution-contents_3.cjs.entry.js +2 -2
  47. package/dist/cjs/solutions-components.cjs.js +1 -1
  48. package/dist/cjs/spatial-ref.cjs.entry.js +2 -2
  49. package/dist/cjs/{utils-31a22d49.js → utils-0ab15745.js} +1 -1
  50. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -11
  51. package/dist/collection/components/layer-table/layer-table.js +21 -6
  52. package/dist/components/crowdsource-manager.js +3 -12
  53. package/dist/components/layer-table2.js +21 -6
  54. package/dist/esm/basemap-gallery_7.entry.js +2 -2
  55. package/dist/esm/buffer-tools_3.entry.js +2 -2
  56. package/dist/esm/calcite-action-pad_2.entry.js +2 -2
  57. package/dist/esm/calcite-alert_4.entry.js +4 -4
  58. package/dist/esm/calcite-block_5.entry.js +4 -4
  59. package/dist/esm/calcite-dropdown-group_2.entry.js +2 -2
  60. package/dist/esm/calcite-flow_6.entry.js +2 -2
  61. package/dist/esm/calcite-shell-panel_14.entry.js +2 -2
  62. package/dist/esm/card-manager_3.entry.js +24 -9
  63. package/dist/esm/consent-manager.entry.js +2 -2
  64. package/dist/esm/crowdsource-manager.entry.js +4 -12
  65. package/dist/esm/crowdsource-reporter.entry.js +2 -2
  66. package/dist/esm/{downloadUtils-5fbd8a40.js → downloadUtils-408e0384.js} +2 -2
  67. package/dist/esm/feature-list.entry.js +4 -4
  68. package/dist/esm/{helpers-3d53560f.js → helpers-3407a4b6.js} +1 -1
  69. package/dist/esm/{index.es-66571353.js → index.es-cac1405b.js} +3 -3
  70. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +5 -5
  71. package/dist/esm/instant-apps-control-panel.entry.js +2 -2
  72. package/dist/esm/instant-apps-create.entry.js +4 -4
  73. package/dist/esm/instant-apps-export.entry.js +4 -4
  74. package/dist/esm/instant-apps-header.entry.js +2 -2
  75. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +3 -3
  76. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +3 -3
  77. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +3 -3
  78. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +3 -3
  79. package/dist/esm/instant-apps-interactive-legend.entry.js +5 -5
  80. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +4 -4
  81. package/dist/esm/instant-apps-language-switcher.entry.js +6 -6
  82. package/dist/esm/instant-apps-language-translator.entry.js +6 -6
  83. package/dist/esm/instant-apps-measurement.entry.js +4 -4
  84. package/dist/esm/instant-apps-popover.entry.js +4 -4
  85. package/dist/esm/instant-apps-scoreboard.entry.js +4 -4
  86. package/dist/esm/instant-apps-sign-in.entry.js +4 -4
  87. package/dist/esm/instant-apps-splash.entry.js +4 -4
  88. package/dist/esm/{languageSwitcher-b665499d.js → languageSwitcher-9db90f1e.js} +1 -1
  89. package/dist/esm/{languageUtil-a3e6adf6.js → languageUtil-2b6e191a.js} +1 -1
  90. package/dist/esm/layout-manager.entry.js +2 -2
  91. package/dist/esm/{loadModules-9c062d08.js → loadModules-03ba7abe.js} +1 -1
  92. package/dist/esm/loader.js +1 -1
  93. package/dist/esm/{locale-28d48640.js → locale-4adfc8cf.js} +1 -1
  94. package/dist/esm/{locale-b4e7d56f.js → locale-d66155ee.js} +2 -2
  95. package/dist/esm/map-select-tools_3.entry.js +3 -3
  96. package/dist/esm/{popupUtils-4a91aa2a.js → popupUtils-142f616a.js} +2 -2
  97. package/dist/esm/public-notification.entry.js +3 -3
  98. package/dist/esm/solution-configuration.entry.js +2 -2
  99. package/dist/esm/solution-contents_3.entry.js +2 -2
  100. package/dist/esm/solutions-components.js +1 -1
  101. package/dist/esm/spatial-ref.entry.js +2 -2
  102. package/dist/esm/{utils-5484fcbf.js → utils-efd425d4.js} +1 -1
  103. package/dist/solutions-components/p-03b07165.entry.js +6 -0
  104. package/dist/solutions-components/{p-9e3b0220.entry.js → p-0534b446.entry.js} +1 -1
  105. package/dist/solutions-components/{p-3e8562b5.entry.js → p-057f9296.entry.js} +1 -1
  106. package/dist/solutions-components/{p-ce4b6931.entry.js → p-09de2308.entry.js} +1 -1
  107. package/dist/solutions-components/{p-7696af8e.entry.js → p-120a2091.entry.js} +1 -1
  108. package/dist/solutions-components/{p-5cc6eb18.js → p-12f9f81d.js} +1 -1
  109. package/dist/solutions-components/{p-427b4593.js → p-1c64264d.js} +1 -1
  110. package/dist/solutions-components/{p-ccd1e256.entry.js → p-2671a80b.entry.js} +1 -1
  111. package/dist/solutions-components/{p-d2de2b2a.entry.js → p-2e2e975a.entry.js} +1 -1
  112. package/dist/solutions-components/{p-c742acd9.js → p-2fc63144.js} +1 -1
  113. package/dist/solutions-components/{p-969828ab.entry.js → p-30f0687e.entry.js} +1 -1
  114. package/dist/solutions-components/p-318eac43.entry.js +6 -0
  115. package/dist/solutions-components/{p-6e6e6d23.entry.js → p-3ec70ff5.entry.js} +1 -1
  116. package/dist/solutions-components/{p-bbc7dd5e.entry.js → p-4250f852.entry.js} +1 -1
  117. package/dist/solutions-components/{p-36e199e0.entry.js → p-4bfec58a.entry.js} +1 -1
  118. package/dist/solutions-components/{p-ae50581b.entry.js → p-4c8fdf0b.entry.js} +1 -1
  119. package/dist/solutions-components/{p-65581d83.js → p-4cd4cb85.js} +1 -1
  120. package/dist/solutions-components/{p-b7123452.entry.js → p-54562381.entry.js} +1 -1
  121. package/dist/solutions-components/{p-2d6d44b5.entry.js → p-6067b27a.entry.js} +1 -1
  122. package/dist/solutions-components/{p-986ee365.entry.js → p-62e5aea4.entry.js} +1 -1
  123. package/dist/solutions-components/{p-00291b93.js → p-67c3ac62.js} +2 -2
  124. package/dist/solutions-components/{p-c6fd40f9.entry.js → p-6e65d93b.entry.js} +1 -1
  125. package/dist/solutions-components/{p-bd871071.entry.js → p-6f4a40fa.entry.js} +1 -1
  126. package/dist/solutions-components/{p-d73b90ab.entry.js → p-7058b4fa.entry.js} +1 -1
  127. package/dist/solutions-components/{p-44fea43a.js → p-742b5af7.js} +1 -1
  128. package/dist/solutions-components/{p-0cd87dca.entry.js → p-7b9207e4.entry.js} +1 -1
  129. package/dist/solutions-components/{p-6c7a990a.entry.js → p-80e42752.entry.js} +1 -1
  130. package/dist/solutions-components/{p-b92e9047.entry.js → p-83640661.entry.js} +1 -1
  131. package/dist/solutions-components/{p-2467b476.entry.js → p-83fdb1d4.entry.js} +1 -1
  132. package/dist/solutions-components/{p-1c3c83a5.js → p-841863b8.js} +1 -1
  133. package/dist/solutions-components/{p-a8d62b7d.entry.js → p-967411c5.entry.js} +1 -1
  134. package/dist/solutions-components/{p-af2c8aa9.js → p-ac122d9e.js} +1 -1
  135. package/dist/solutions-components/{p-cb4842dd.entry.js → p-b0985f9d.entry.js} +1 -1
  136. package/dist/solutions-components/{p-dae9d5b3.entry.js → p-bc8b4f68.entry.js} +1 -1
  137. package/dist/solutions-components/{p-ffd41e25.js → p-c0bf1d9f.js} +3 -3
  138. package/dist/solutions-components/{p-bb7463ed.entry.js → p-d3a2d182.entry.js} +1 -1
  139. package/dist/solutions-components/{p-e80751f4.entry.js → p-d61bbc4c.entry.js} +1 -1
  140. package/dist/solutions-components/{p-2961c63c.entry.js → p-d72b4031.entry.js} +1 -1
  141. package/dist/solutions-components/{p-881ead62.entry.js → p-d783ae9a.entry.js} +1 -1
  142. package/dist/solutions-components/{p-61f88049.entry.js → p-ddd9d50f.entry.js} +1 -1
  143. package/dist/solutions-components/{p-295f850a.entry.js → p-df2fc967.entry.js} +1 -1
  144. package/dist/solutions-components/{p-1e6c6ec4.entry.js → p-e900ec51.entry.js} +1 -1
  145. package/dist/solutions-components/{p-df56c019.entry.js → p-ed71dfdc.entry.js} +1 -1
  146. package/dist/solutions-components/{p-219f209e.entry.js → p-ee62f91c.entry.js} +1 -1
  147. package/dist/solutions-components/{p-e8ed3fa6.entry.js → p-f629ed65.entry.js} +1 -1
  148. package/dist/solutions-components/{p-932d6f29.entry.js → p-faed40ad.entry.js} +1 -1
  149. package/dist/solutions-components/{p-91142a26.js → p-fea7535c.js} +1 -1
  150. package/dist/solutions-components/solutions-components.esm.js +1 -1
  151. package/dist/types/components/crowdsource-manager/crowdsource-manager.d.ts +0 -4
  152. package/package.json +1 -1
  153. package/dist/solutions-components/p-13404ad7.entry.js +0 -6
  154. package/dist/solutions-components/p-d300430b.entry.js +0 -6
  155. package/dist/solutions-components_commit.txt +0 -8
  156. /package/dist/cjs/{esri-loader-a56cbcbe.js → esri-loader-08dc41bd.js} +0 -0
  157. /package/dist/esm/{esri-loader-781d738a.js → esri-loader-c6842c6b.js} +0 -0
  158. /package/dist/solutions-components/{p-6a68306c.js → p-0a24ad5f.js} +0 -0
@@ -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,f as t,h as e,g as s}from"./p-fa1ceaf9.js";import{l as n}from"./p-65581d83.js";import{g as a}from"./p-427b4593.js";import{g as r}from"./p-1c3c83a5.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";import"./p-8c6d9b5a.js";const o={base:"esri-legend",widget:"esri-widget",widgetPanel:"esri-widget--panel",component:"esri-component",iconLayerList:"esri-icon-layer-list"},c=class{constructor(t){i(this,t),this.handles=void 0,this.reactiveUtils=void 0,this.legendvm=void 0,this.widget=void 0,this.view=void 0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"},this.messages=void 0}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0}),await this.initializeModules()}async componentDidLoad(){a(this)}async initializeModules(){const[i,t,e,s]=await n(["esri/core/Handles","esri/core/reactiveUtils","esri/widgets/Widget","esri/widgets/Legend"]);this.handles=new i,this.reactiveUtils=t,this.widget=new e;const a=new s;return await t.whenOnce((()=>null==a?void 0:a.messages)),this.messages=Object.assign(Object.assign({},this.messages),a.messages),Promise.resolve()}async init(){if(this.reactiveUtils&&this.view&&this.handles)try{const{on:i}=this.reactiveUtils,[t]=await n(["esri/widgets/Legend/LegendViewModel"]),e=new t({view:this.view});this.legendvm=e,this.handles.add([i((()=>{var i;return null===(i=this.legendvm)||void 0===i?void 0:i.activeLayerInfos}),"change",(()=>{var i;return this._refreshActiveLayerInfos(null===(i=null==this?void 0:this.legendvm)||void 0===i?void 0:i.activeLayerInfos,this.reactiveUtils)}))])}catch(i){console.error('Failed at "init": ',i)}}render(){var i;const{base:t,component:s,widget:n,widgetPanel:a}=o;return e("div",{key:"interactive-legend",class:null===(i=this.widget)||void 0===i?void 0:i.classes(t,s,n,a)},e("instant-apps-interactive-legend-classic",{key:"interactive-legend-classic",ref:i=>this.ref=i,class:r(this.el),legendvm:this.legendvm,"zoom-to":this.zoomTo,filterMode:this.filterMode,"feature-count":this.featureCount,messages:this.messages}))}_refreshActiveLayerInfos(i,t){i&&(this.handles.removeAll(),i.forEach((i=>this._renderOnActiveLayerInfoChange(i,t))))}_renderOnActiveLayerInfoChange(i,t){var e;const{on:s}=this.reactiveUtils,n=s((()=>i.children),"change",(()=>i.children.forEach((i=>this._renderOnActiveLayerInfoChange(i,t)))));this.handles.add(n,`children_${null===(e=null==i?void 0:i.layer)||void 0===e?void 0:e.uid}`),i.children.forEach((i=>{var e,s;this._renderOnActiveLayerInfoChange(i,t),(null===(e=null==i?void 0:i.children)||void 0===e?void 0:e.length)>0&&(null===(s=null==i?void 0:i.children)||void 0===s||s.forEach((i=>this._renderOnActiveLayerInfoChange(i,t))))}))}get el(){return s(this)}static get watchers(){return{handles:["init"],reactiveUtils:["init"],view:["init"]}}};c.style=".sc-instant-apps-interactive-legend-h{display:block;height:100%}.sc-instant-apps-interactive-legend-h .esri-legend.sc-instant-apps-interactive-legend{height:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1)}.sc-instant-apps-interactive-legend-h .esri-legend.esri-component.esri-widget.esri-widget--panel.sc-instant-apps-interactive-legend{margin:0}";export{c as instant_apps_interactive_legend}
6
+ import{r as i,f as t,h as e,g as s}from"./p-fa1ceaf9.js";import{l as n}from"./p-4cd4cb85.js";import{g as a}from"./p-1c64264d.js";import{g as r}from"./p-841863b8.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";import"./p-8c6d9b5a.js";const o={base:"esri-legend",widget:"esri-widget",widgetPanel:"esri-widget--panel",component:"esri-component",iconLayerList:"esri-icon-layer-list"},c=class{constructor(t){i(this,t),this.handles=void 0,this.reactiveUtils=void 0,this.legendvm=void 0,this.widget=void 0,this.view=void 0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"},this.messages=void 0}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0}),await this.initializeModules()}async componentDidLoad(){a(this)}async initializeModules(){const[i,t,e,s]=await n(["esri/core/Handles","esri/core/reactiveUtils","esri/widgets/Widget","esri/widgets/Legend"]);this.handles=new i,this.reactiveUtils=t,this.widget=new e;const a=new s;return await t.whenOnce((()=>null==a?void 0:a.messages)),this.messages=Object.assign(Object.assign({},this.messages),a.messages),Promise.resolve()}async init(){if(this.reactiveUtils&&this.view&&this.handles)try{const{on:i}=this.reactiveUtils,[t]=await n(["esri/widgets/Legend/LegendViewModel"]),e=new t({view:this.view});this.legendvm=e,this.handles.add([i((()=>{var i;return null===(i=this.legendvm)||void 0===i?void 0:i.activeLayerInfos}),"change",(()=>{var i;return this._refreshActiveLayerInfos(null===(i=null==this?void 0:this.legendvm)||void 0===i?void 0:i.activeLayerInfos,this.reactiveUtils)}))])}catch(i){console.error('Failed at "init": ',i)}}render(){var i;const{base:t,component:s,widget:n,widgetPanel:a}=o;return e("div",{key:"interactive-legend",class:null===(i=this.widget)||void 0===i?void 0:i.classes(t,s,n,a)},e("instant-apps-interactive-legend-classic",{key:"interactive-legend-classic",ref:i=>this.ref=i,class:r(this.el),legendvm:this.legendvm,"zoom-to":this.zoomTo,filterMode:this.filterMode,"feature-count":this.featureCount,messages:this.messages}))}_refreshActiveLayerInfos(i,t){i&&(this.handles.removeAll(),i.forEach((i=>this._renderOnActiveLayerInfoChange(i,t))))}_renderOnActiveLayerInfoChange(i,t){var e;const{on:s}=this.reactiveUtils,n=s((()=>i.children),"change",(()=>i.children.forEach((i=>this._renderOnActiveLayerInfoChange(i,t)))));this.handles.add(n,`children_${null===(e=null==i?void 0:i.layer)||void 0===e?void 0:e.uid}`),i.children.forEach((i=>{var e,s;this._renderOnActiveLayerInfoChange(i,t),(null===(e=null==i?void 0:i.children)||void 0===e?void 0:e.length)>0&&(null===(s=null==i?void 0:i.children)||void 0===s||s.forEach((i=>this._renderOnActiveLayerInfoChange(i,t))))}))}get el(){return s(this)}static get watchers(){return{handles:["init"],reactiveUtils:["init"],view:["init"]}}};c.style=".sc-instant-apps-interactive-legend-h{display:block;height:100%}.sc-instant-apps-interactive-legend-h .esri-legend.sc-instant-apps-interactive-legend{height:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-1)}.sc-instant-apps-interactive-legend-h .esri-legend.esri-component.esri-widget.esri-widget--panel.sc-instant-apps-interactive-legend{margin:0}";export{c as instant_apps_interactive_legend}
@@ -3,7 +3,7 @@
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,h as e,H as i,g as n}from"./p-fa1ceaf9.js";import{g as s,a as r,b as o}from"./p-fdd93685.js";import{s as a}from"./p-2afdcdfc.js";import"./p-3d7cff5e.js";import{r as h,N as c,c as u,e as l,A as f,a as d}from"./p-a0300d31.js";import"./p-a230b270.js";import{g as p}from"./p-ffd41e25.js";import"./p-8c6d9b5a.js";import"./p-c1cf3ebc.js";import"./p-d4056c1c.js";import"./p-6a68306c.js";
6
+ import{r as t,h as e,H as i,g as n}from"./p-fa1ceaf9.js";import{g as s,a as r,b as o}from"./p-fdd93685.js";import{s as a}from"./p-2afdcdfc.js";import"./p-3d7cff5e.js";import{r as h,N as c,c as u,e as l,A as f,a as d}from"./p-a0300d31.js";import"./p-a230b270.js";import{g as p}from"./p-c0bf1d9f.js";import"./p-8c6d9b5a.js";import"./p-c1cf3ebc.js";import"./p-d4056c1c.js";import"./p-0a24ad5f.js";
7
7
  /*! *****************************************************************************
8
8
  Copyright (c) Microsoft Corporation.
9
9
 
@@ -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,c as n,h as i,H as s,g as e}from"./p-fa1ceaf9.js";import{l as o}from"./p-65581d83.js";import{g as a}from"./p-427b4593.js";import{g as r}from"./p-a9a72626.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";const p="instant-apps-export calcite-mode-light",l="instant-apps-export-print",h="instant-apps-export-print__content-container",c="instant-apps-export-print__extra-container",d="instant-apps-export-print__legend-container",u="instant-apps-export-print__compass-container",v="instant-apps-export-print__scale-bar-container",x="instant-apps-export-print__popup-container",b="instant-apps-export-print__popup-content",_="instant-apps-export-print__popup-title",g="instant-apps-export-print__view",f="instant-apps-export-print__view-container",m="instant-apps-export-print__view-wrapper",w="instant-app-export-drag",k=class{constructor(i){t(this,i),this.exportOutputUpdated=n(this,"exportOutputUpdated",7),this.output=void 0,this.beforeExport=()=>Promise.resolve(),this.popoverIcon="export",this.extraContent=void 0,this.extraContentLabel=void 0,this.headerTitle="",this.includeExtraContent=!0,this.includeLegend=!0,this.includeMap=!0,this.includePopup=!1,this.mode="popover",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.scale="m",this.showHeaderTitle=!0,this.showIncludeLegend=!0,this.showIncludeMap=!1,this.showIncludePopup=!0,this.showScaleBar=!1,this.view=void 0,this.maskBackground="rgba(255, 51, 0, 0.1)",this.maskBorder="2px dashed rgb(255, 51, 0)",this.baseClass=p,this.exportIsLoading=void 0,this.messages=void 0}watchIncludeMap(t){t&&this.updateLegend()}watchView(){this.handleIncludePopup()}async componentWillLoad(){this.baseClass="dark"===r(this.el)?"instant-apps-export calcite-mode-dark":p,a(this),await this.initializeModules()}componentDidLoad(){this.printContainerEl.prepend(this.printEl),this.handleIncludePopup()}async initializeModules(){const[t,n]=await o(["esri/core/Handles","esri/core/reactiveUtils"]);return this.handles=new t,this.reactiveUtils=n,Promise.resolve()}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel(),n=this.renderCompass();return i(s,{key:"d561a14661edad3e4ad5f0041537acdc1fb724a1"},i("div",{key:"917848051ac8114c4ba527332c8688791a9c75d0",class:this.baseClass,onMouseEnter:this.handleWidgetCreation.bind(this),onFocusin:this.handleWidgetCreation.bind(this)},t,i("div",{key:"3421d8bde7ce6f91062b538f087c155946358e01",class:"instant-apps-export__visually-hidden"},n)))}renderPopover(){var t,n,s;const e=this.renderPanel();return[i("calcite-popover",{referenceElement:"export-popover-btn",label:null===(t=this.messages)||void 0===t?void 0:t.exportPopover,overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t},e),i("calcite-action",{id:"export-popover-btn",alignment:"center",icon:this.popoverIcon,scale:this.scale,title:null===(n=this.messages)||void 0===n?void 0:n.exportBtn,text:null===(s=this.messages)||void 0===s?void 0:s.exportBtn})]}renderPanel(){var t,n;const s=this.showHeaderTitle?this.renderTitle():null,e=null!=this.extraContent?this.renderSwitch("includeExtraContent",this.extraContentLabel):null,o=this.showIncludeMap?this.renderSwitch("includeMap"):null,a=this.includeMap?this.renderMapOptions():null,r=this.renderPrint();return i("div",{class:"inline"===this.mode?"instant-apps-export__inline-container":"instant-apps-export__popover-container"},s,e,o,a,this.includeMap?i("calcite-button",{appearance:"transparent",width:"full",onClick:this.setMapAreaOnClick.bind(this),disabled:this.exportIsLoading},null===(t=this.messages)||void 0===t?void 0:t.setMapArea):null,i("calcite-button",{width:"full",onClick:this.exportOnClick.bind(this),disabled:this.exportIsLoading},null===(n=this.messages)||void 0===n?void 0:n.export),r)}renderTitle(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.title,i("calcite-input",{value:this.headerTitle,onCalciteInputInput:this.updateHeaderTitle.bind(this)}))}renderSwitch(t,n){var s;const e=null!=n?n:null===(s=this.messages)||void 0===s?void 0:s[t];return i("calcite-label",{layout:"inline-space-between"},e,i("calcite-switch",{checked:this[t],value:t,onCalciteSwitchChange:this.optionOnChange.bind(this)}))}renderMapOptions(){const t=this.showIncludeLegend?this.renderSwitch("includeLegend"):null,n=this.showIncludePopup?this.renderSwitch("includePopup"):null;return i("div",null,t,n)}renderPrint(){const t=this.includeMap?this.renderPrintMap():null,n=this.renderExtraContent(),s=this.includeMap&&this.showIncludeLegend?this.renderLegend():null,e=this.includeMap&&this.showIncludePopup?this.renderPopup():null;return i("div",{ref:t=>this.printContainerEl=t},i("div",{class:l,ref:t=>this.printEl=t},t,s,i("div",{class:h},e,n)))}renderPrintMap(){return i("div",{class:f,ref:t=>this.viewContainerEl=t},i("div",{class:m,ref:t=>this.viewWrapperEl=t},this.headerTitle?i("instant-apps-header",{titleText:this.headerTitle,backgroundColor:"#fff",textColor:"#323232"}):null,i("img",{class:g,ref:t=>this.viewEl=t}),i("div",{class:v,ref:t=>this.scaleBarContainerEl=t})))}renderLegend(){return i("div",{class:d,ref:t=>this.legendContainerEl=t})}renderCompass(){return i("div",{class:u,ref:t=>this.compassContainerEl=t})}renderPopup(){return i("div",{class:x,ref:t=>this.popupContainerEl=t},i("div",{ref:t=>this.popupTitleEl=t,class:_}),i("div",{ref:t=>this.popupContentEl=t,class:b}))}renderExtraContent(){return i("div",{class:c,id:"export-content",ref:t=>this.extraContainerEl=t})}optionOnChange(t){const{checked:n,value:i}=t.target;this[i]=n,this.updateExportOutput()}updateHeaderTitle(t){this.headerTitle=t.target.value,this.updateExportOutput()}async exportOnClick(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}async handleViewExportOnClick(){null!=this.view?(this.addPrintStyling(),document.body.prepend(this.printEl),this.handleExtraContent(),this.includeMap?(this.updateScaleBar(),this.updatePopupToPrint(),this.viewScreenshot(),this.handleImgLoaded()):this.handleImgLoaded()):null!=this.popoverEl&&(this.popoverEl.open=!1)}addPrintStyling(){null==this.printStyleEl&&(this.printStyleEl=document.createElement("style"),this.printStyleEl.innerHTML='\n @media print {\n @page {\n size: Portrait;\n margin: .25in;\n }\n\n html, body {\n padding: 0;\n margin: 0;\n height: 100%;\n width: 100%;\n }\n\n body > *:not(.instant-apps-export-print) { display: none; }\n }\n\n * {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n }\n\n\n .instant-apps-export-print {\n height: 100%;\n width: 100%;\n position: absolute;\n z-index: -999;\n color: #323232 !important;\n display: grid;\n gap: 24px;\n grid-auto-flow: row;\n --esri-calcite-mode-name: "light";\n }\n\n .instant-apps-export-print, .instant-apps-export-print * {\n box-sizing: border-box;\n }\n\n .instant-apps-export-print__view-section {\n height: 100%;\n }\n\n .instant-apps-export-print__view-container {\n height: 100%;\n width: 100%;\n display: flex;\n justify-content: center;\n }\n\n .instant-apps-export-print__view-wrapper {\n height: fit-content;\n width: fit-content;\n position: relative;\n display: flex;\n flex-direction: column;\n border: 2pt solid #323232;\n overflow: hidden;\n }\n\n .instant-apps-export-print__view {\n object-fit: contain;\n }\n\n .instant-apps-export-print__popup-container {\n height: min-content;\n max-width: 350px;\n display: none;\n color: #323232;\n background: #fff;\n border: 1pt solid #323232;\n break-inside: avoid;\n }\n\n .instant-apps-export-print__popup-title {\n border-bottom: 1pt solid #323232;\n }\n\n .instant-apps-export-print__popup-content {\n background: #fff;\n padding-top: 8pt;\n }\n\n .instant-apps-export-print__popup-content .esri-feature-media__chart {\n background: #fff;\n }\n\n .instant-apps-export-print__legend-container {\n height: min-content;\n background: #fff;\n overflow: unset;\n }\n\n .esri-legend--card, .esri-legend--card__service-content {\n flex-flow: row wrap;\n }\n\n .instant-apps-export-print .esri-widget > *:not(.esri-scale-bar.esri-widget > *) {\n background: #fff;\n color: #323232;\n }\n\n .instant-apps-export-print__popup-content * {\n color: #323232;\n }\n\n .instant-apps-export-print .esri-widget__heading {\n margin: 2pt 7pt;\n padding: 0;\n color: #323232;\n }\n\n .instant-apps-export-print .esri-legend__ramp-label:before {\n border-color: rgba(0,0,0,0) rgba(50,50,50,.8) rgba(0,0,0,0) rgba(0,0,0,0);\n }\n\n .instant-apps-export-print .esri-legend--card__section {\n padding: 4pt 0 4pt;\n min-width: unset;\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__section:first-child {\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service {\n border: none;\n flex: 0 1 auto;\n break-inside: avoid;\n }\n\n .instant-apps-export-print .esri-legend--card {\n border: none;\n gap: 6pt 12pt;\n }\n\n .instant-apps-export-print .esri-legend--card:not(:first-child),\n .instant-apps-export-print .esri-compass.esri-widget:not(:first-child) {\n display: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-container {\n height: unset;\n padding: 0;\n border-bottom: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-text {\n padding-bottom: 4px;\n }\n\n .instant-apps-export-print__compass-container {\n position: absolute;\n top: 65px;\n left: 15px;\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n --calcite-ui-icon-color: #000;\n border-radius: 50%;\n height: fit-content;\n }\n\n .instant-apps-export-print__compass-container .esri-compass {\n background: #fff;\n }\n\n .instant-apps-export-print__compass-container .esri-compass__icon.esri-icon-compass {\n color: #000;\n }\n\n .instant-apps-export-print__compass-container.esri-compass.esri-widget--button {\n background: #fff;\n }\n\n .instant-apps-export-print__scale-bar-container {\n width: 100%;\n position: absolute;\n bottom: 15px;\n margin: 0 15px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n color: #323232;\n font-size: 10px;\n padding: 0 4px;\n }\n \n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label {\n height: 10px;\n padding: 0 2px;\n line-height: 11px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {\n display: none;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__bar-container.esri-scale-bar__bar-container--line {\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line {\n background-color: rgba(255, 255, 255, 0.66);\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top {\n width: var(--instant-apps-scale-bar-top) !important;\n border-bottom: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom {\n width: var(--instant-apps-scale-bar-bottom) !important;\n border-top: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label-container--line {\n position: unset;\n margin: 0 2px;\n background-color: rgba(255, 255, 255, 0.66);\n height: 10px;\n display: flex;\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:after,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:after {\n background-color: #323232;\n border-right: 2px solid #323232;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__item-navigation {\n display: none;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__chart.esri-feature-media__chart--rendered * {\n width: 100%!important;\n }\n\n .instant-apps-export-print__popup-content .esri-popup__content {\n margin: 0;\n }\n\n .instant-apps-export-print__content-container {\n display: flex;\n gap: 24px;\n break-inside: avoid;\n break-before: auto;\n }',document.body.prepend(this.printStyleEl))}handleImgLoaded(){this.exportIsLoading=!0,setTimeout((()=>{this.exportIsLoading=void 0,this.setupViewPrintElements()}),1500)}handleExtraContent(){const t=this.printEl.querySelector("#export-content");null!=t&&(t.innerHTML="",null!=this.extraContent&&this.includeExtraContent?(t.style.display="block",t.append(this.extraContent.cloneNode(!0))):t.style.display="none")}resetPrintContent(){var t,n;if(null!=this.view){this.screenshot=null,null===(t=this.printContainerEl)||void 0===t||t.prepend(this.printEl),null===(n=this.printStyleEl)||void 0===n||n.remove(),this.printStyleEl=void 0;const i=this.printEl.querySelector("#export-content");i&&(i.innerHTML="")}}async updatePopupToPrint(){var t,n;if(null!=this.view&&(null!=this.popupContainerEl&&(this.popupContainerEl.style.display=this.includePopup&&this.view.popup.visible?"block":"none",this.checkPopupOpen()),this.view.popup.visible&&null!=this.view.popup.selectedFeature)){const i=document.createElement(`h${null!==(t=this.view.popup.headingLevel)&&void 0!==t?t:2}`);i.innerHTML=null!==(n=this.view.popup.title)&&void 0!==n?n:"",i.className="esri-widget__heading esri-popup__header-title",null!=this.popupTitleEl&&(this.popupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupTitleEl.innerHTML="",this.popupTitleEl.prepend(i))}}updateExportOutput(){this.output={},this.showHeaderTitle&&(this.output.headerTitle=this.headerTitle),this.showIncludeLegend&&(this.output.includeLegend=this.includeLegend),this.showIncludeMap&&(this.output.includeMap=this.includeMap),this.showIncludePopup&&(this.output.includePopup=this.includePopup),this.exportOutputUpdated.emit()}setupViewPrintElements(){if(null!=this.view){this.handleLegendSetup();const t=document.title;this.showHeaderTitle&&this.headerTitle&&(document.title=this.headerTitle),window.print(),document.title=t,setTimeout((()=>{this.resetPrintContent()}),1e3)}}handleLegendSetup(){var t;if(this.showIncludeLegend&&null!=this.view&&this.includeMap&&null!=this.legendContainerEl){const n=null!=this.legend&&(null===(t=this.legend.activeLayerInfos)||void 0===t?void 0:t.length)>0;this.legendContainerEl.style.display=this.includeLegend&&n?"block":"none"}}handleWidgetCreation(){this.includeMap&&(this.handleLegendCreation(),this.handleCompassCreation())}handleIncludePopup(){var t,n;if(this.showIncludePopup){const i="includePopup";null===(t=this.handles)||void 0===t||t.remove(i),null===(n=this.reactiveUtils)||void 0===n||n.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready})).then((()=>{var t;null===(t=this.handles)||void 0===t||t.add(this.reactiveUtils.watch((()=>{var t,n;return null===(n=null===(t=this.view)||void 0===t?void 0:t.popup)||void 0===n?void 0:n.visible}),(t=>{this.includePopup=t})),i)}))}}handleLegendCreation(){var t,n,i,s,e;if(null!=this.view&&this.showIncludeLegend&&null!=this.legendContainerEl){const o=this.view.map,a=null===(n=null===(t=this.legend)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;null!=(null===(i=null==o?void 0:o.portalItem)||void 0===i?void 0:i.id)&&(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)===(null===(e=null==a?void 0:a.portalItem)||void 0===e?void 0:e.id)||this.updateLegend()}}updateLegend(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{if(null!=this.legend&&(this.legend.destroy(),this.legend=null),null!=this.legendContainerEl){this.legendContainerEl.innerHTML="";const n=document.createElement("div");this.legendContainerEl.append(n);const[i]=await o(["esri/widgets/Legend"]);this.legend=new i({container:n,view:t,style:{type:"card",layout:"side-by-side"}})}}))}handleCompassCreation(){var t,n,i,s;if(null!=this.view&&null!=this.compassContainerEl){const e=this.view.map,o=null===(n=null===(t=this.compass)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null===(i=null==e?void 0:e.portalItem)||void 0===i?void 0:i.id)===(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)||this.updateCompass()}}updateCompass(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.compass)||void 0===n||n.destroy(),this.compass=null;const i=document.createElement("div");this.compassContainerEl.append(i);const[s]=await o(["esri/widgets/Compass"]);this.compass=new s({container:i,view:t})}))}updateScaleBar(){if(this.scaleBarContainerEl&&null!=this.view&&(this.scaleBarContainerEl.innerHTML="",this.showScaleBar)){const t=this.view.ui.getComponents(),n=null==t?void 0:t.find((({container:t})=>{var n;return null===(n=null==t?void 0:t.className)||void 0===n?void 0:n.includes("esri-scale-bar")}));null!=(null==n?void 0:n.container)&&"string"!=typeof n.container&&this.scaleBarContainerEl.append(n.container.cloneNode(!0))}}async viewScreenshot(){var t;if(null!=this.view&&this.includeMap&&(null==this.screenshot&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3),this.screenshot=await this.view.takeScreenshot({width:2*this.view.width,height:2*this.view.height})),this.handleScaleBarSize(),null!=this.viewEl&&null!=this.viewWrapperEl)){const{height:t,width:n}=this.screenshot.data;t>n?this.setMaxRowHeightOnViewContainer():this.setMaxWidthOnViewContainer(),this.viewEl.src=this.screenshot.dataUrl}}setMaxRowHeightOnViewContainer(){this.printEl.style.gridTemplateRows="minmax(auto, 70%)",this.viewEl.style.height="100%",this.viewEl.style.width="",this.viewWrapperEl.style.height="100%",this.viewWrapperEl.style.width="fit-content"}setMaxWidthOnViewContainer(){this.printEl.style.gridTemplateRows="",this.viewEl.style.width="100%",this.viewEl.style.height="",this.viewWrapperEl.style.height="fit-content",this.viewWrapperEl.style.width="100%"}checkPopupOpen(){if(null!=this.view){const t=this.view.popup.container,n=null==t?void 0:t.querySelector(".esri-popup .esri-feature__main-container");if(null!=n){const t=n.querySelectorAll("canvas");this.popupContentEl.innerHTML="",this.popupContentEl.append(n.cloneNode(!0));const i=this.popupContentEl.querySelectorAll("canvas");t.forEach(((t,n)=>{var s;const e=t.toDataURL(),o=document.createElement("img");o.src=e;const a=t.getAttribute("style");a&&o.setAttribute("style",a);const r=i[n];null!=r&&(r.replaceWith(o),document.querySelector("link[href*='esri/themes/dark/main.css']")&&null!=(null===(s=o.parentElement)||void 0===s?void 0:s.parentElement)&&(o.parentElement.style.background="#242424",o.parentElement.parentElement.style.background="#242424"))}))}}}createScreenshot(){var t,n;if(null!=this.view){this.screenshotPreview=document.createElement("div"),this.screenshotPreview.className="screenshot-preview hide",this.screenshotImgContainer=document.createElement("div"),this.screenshotImgContainer.className="screenshot-img-container",this.screenshotImg=document.createElement("img");const i=document.createElement("div"),s=document.createElement("calcite-button"),e=document.createElement("calcite-button");s.innerHTML=null===(t=this.messages)||void 0===t?void 0:t.export,e.innerHTML=null===(n=this.messages)||void 0===n?void 0:n.returnToMap,e.appearance="outline-fill",s.onclick=this.exportOnClick.bind(this),e.onclick=this.screenshotReturn.bind(this),i.append(e,s),this.screenshotImgContainer.append(this.screenshotImg,i),this.screenshotPreview.append(this.screenshotImgContainer),this.view.container.append(this.screenshotPreview)}}createMaskDiv(){null!=this.view&&(this.maskDivEl=document.createElement("div"),this.maskDivEl.id="screenshot-mask",this.maskDivEl.className="hide screenshot-cursor",this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-background",this.maskBackground),this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-border",this.maskBorder),this.screenshotStyle=document.createElement("style"),this.screenshotStyle.innerHTML="\n.screenshot-preview.hide, .hide {\n display: none;\n}\n\n.screenshot-cursor {\n cursor: crosshair;\n}\n\n.relative {\n position: relative;\n}\n\n#screenshot-mask {\n position: absolute;\n background: var(--instant-apps-screenshot-mask-background);\n border: var(--instant-apps-screenshot-mask-border);\n}\n\n.screenshot-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n text-align: center;\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.screenshot-preview * {\n box-sizing: border-box;\n}\n\n.screenshot-img-container img {\n max-height: 75%;\n max-width: 75%;\n object-fit: contain;\n border: 10px solid white;\n box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.5);\n margin-bottom: 0.5em;\n}\n\n.screenshot-img-container {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n margin-bottom: 8px;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n}\n\n.screenshot-img-container calcite-button {\n margin: 5px;\n}",this.view.container.append(this.screenshotStyle),this.view.container.append(this.maskDivEl))}screenshotReturn(){this.removeScreenshotElements(),this.exportIsLoading=!1,this.screenshot=null}setMapAreaOnClick(){null!=this.view&&(this.exportIsLoading=!0,this.createMaskDiv(),this.createScreenshot(),this.view.container.classList.add("screenshot-cursor","relative"),this.view.addHandles(this.view.on("drag",(async t=>{null!=this.view&&(t.stopPropagation(),"end"!==t.action?this.updateMaskSize(t):this.maskScreenshot())})),w))}updateMaskSize(t){if(null!=this.view){const n=this.clamp(Math.min(t.origin.x,t.x),0,this.view.width),i=this.clamp(Math.max(t.origin.x,t.x),0,this.view.width),s=this.clamp(Math.min(t.origin.y,t.y),0,this.view.height),e=this.clamp(Math.max(t.origin.y,t.y),0,this.view.height);this.area={x:n,y:s,width:i-n,height:e-s},this.setMaskPosition(this.area)}}maskScreenshot(){var t;if(null!=this.view&&null!=this.area){this.view.removeHandles(w);const n=this.area.height,i=this.area.width;this.showScaleBar&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3&&.75*this.view.width<i)),this.view.takeScreenshot({area:this.area,width:2*i,height:2*n,format:"jpg"}).then((t=>{var n;this.screenshot=t,this.showPreview(),null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null)}))}}setMaskPosition(t){null!=t?(this.maskDivEl.classList.remove("hide"),this.maskDivEl.style.left=`${t.x}px`,this.maskDivEl.style.top=`${t.y}px`,this.maskDivEl.style.width=`${t.width}px`,this.maskDivEl.style.height=`${t.height}px`):this.maskDivEl.remove()}clamp(t,n,i){return t<n?n:t>i?i:t}showPreview(){this.screenshotPreview.classList.remove("hide"),null!=this.screenshotImg&&null!=this.screenshot&&(this.screenshotImg.src=this.screenshot.dataUrl)}handleScaleBarSize(){var t;if(this.showScaleBar&&"2d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&null!=this.scaleBarContainerEl){const t=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--top"),n=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--bottom");this.setScalebarWidth(t,"top"),this.setScalebarWidth(n,"bottom")}}setScalebarWidth(t,n){var i;if(null!=t&&null!=this.screenshot){const s=this.screenshot.data.width/2,e=Number(t.style.width.replace("px",""));null===(i=this.scaleBarContainerEl)||void 0===i||i.style.setProperty(`--instant-apps-scale-bar-${n}`,e/s*100+"%")}}removeScreenshotElements(){var t,n;null===(t=this.screenshotPreview)||void 0===t||t.remove(),null===(n=this.screenshotStyle)||void 0===n||n.remove()}get el(){return e(this)}static get watchers(){return{includeMap:["watchIncludeMap"],view:["watchView"]}}};k.style=":host{display:block;--instant-apps-export-action-background:var(--calcite-color-foreground-1);--instant-apps-export-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-export-action-background-press:var(--calcite-color-foreground-3);--instant-apps-export-action-height:100%;--instant-apps-export-action-width:fit-content;--instant-apps-export-action-icon-color:var(--calcite-color-text-3);--instant-apps-export-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-export-background:var(--calcite-color-foreground-1);--instant-apps-export-text-color:var(--calcite-color-text-1);--instant-apps-export-popover-width:250px}.instant-apps-export{height:100%}.instant-apps-export *{box-sizing:border-box}.instant-apps-export__popover-container,.instant-apps-export__inline-container{padding:12px;background:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export__popover-container{width:var(--instant-apps-export-popover-width)}.instant-apps-export calcite-action{height:var(--instant-apps-export-action-height);width:var(--instant-apps-export-action-width);--calcite-color-foreground-1:var(--instant-apps-export-action-background);--calcite-color-foreground-2:var(--instant-apps-export-action-background-hover);--calcite-color-foreground-3:var(--instant-apps-export-action-background-press);--calcite-color-text-3:var(--instant-apps-export-action-icon-color);--calcite-color-text-1:var(--instant-apps-export-action-icon-hover-color)}.instant-apps-export .instant-apps-export-print{display:none}.instant-apps-export__visually-hidden{position:absolute;top:0;z-index:-1;visibility:hidden}.instant-apps-export calcite-input{--calcite-color-foreground-1:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export calcite-popover{--calcite-color-foreground-1:var(--instant-apps-export-background)}.instant-apps-export calcite-switch{--calcite-color-foreground-1:#fff;--calcite-color-foreground-2:#f3f3f3}.instant-apps-export calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-export .calcite-mode-dark calcite-switch{--calcite-color-foreground-1:#2b2b2b;--calcite-color-foreground-2:#202020}.instant-apps-export__compass-container.esri-widget{background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.instant-apps-export__compass-container.esri-widget .esri-compass__icon.esri-icon-compass{color:#6e6e6e}.hide{display:none}.screenshotCursor{cursor:crosshair}";export{k as instant_apps_export}
6
+ import{r as t,c as n,h as i,H as s,g as e}from"./p-fa1ceaf9.js";import{l as o}from"./p-4cd4cb85.js";import{g as a}from"./p-1c64264d.js";import{g as r}from"./p-a9a72626.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";const p="instant-apps-export calcite-mode-light",l="instant-apps-export-print",c="instant-apps-export-print__content-container",h="instant-apps-export-print__extra-container",d="instant-apps-export-print__legend-container",u="instant-apps-export-print__compass-container",v="instant-apps-export-print__scale-bar-container",x="instant-apps-export-print__popup-container",b="instant-apps-export-print__popup-content",_="instant-apps-export-print__popup-title",g="instant-apps-export-print__view",f="instant-apps-export-print__view-container",m="instant-apps-export-print__view-wrapper",w="instant-app-export-drag",k=class{constructor(i){t(this,i),this.exportOutputUpdated=n(this,"exportOutputUpdated",7),this.output=void 0,this.beforeExport=()=>Promise.resolve(),this.popoverIcon="export",this.extraContent=void 0,this.extraContentLabel=void 0,this.headerTitle="",this.includeExtraContent=!0,this.includeLegend=!0,this.includeMap=!0,this.includePopup=!1,this.mode="popover",this.popoverPositioning="absolute",this.popoverPlacement="auto",this.scale="m",this.showHeaderTitle=!0,this.showIncludeLegend=!0,this.showIncludeMap=!1,this.showIncludePopup=!0,this.showScaleBar=!1,this.view=void 0,this.maskBackground="rgba(255, 51, 0, 0.1)",this.maskBorder="2px dashed rgb(255, 51, 0)",this.baseClass=p,this.exportIsLoading=void 0,this.messages=void 0}watchIncludeMap(t){t&&this.updateLegend()}watchView(){this.handleIncludePopup()}async componentWillLoad(){this.baseClass="dark"===r(this.el)?"instant-apps-export calcite-mode-dark":p,a(this),await this.initializeModules()}componentDidLoad(){this.printContainerEl.prepend(this.printEl),this.handleIncludePopup()}async initializeModules(){const[t,n]=await o(["esri/core/Handles","esri/core/reactiveUtils"]);return this.handles=new t,this.reactiveUtils=n,Promise.resolve()}render(){const t="popover"===this.mode?this.renderPopover():this.renderPanel(),n=this.renderCompass();return i(s,{key:"d561a14661edad3e4ad5f0041537acdc1fb724a1"},i("div",{key:"917848051ac8114c4ba527332c8688791a9c75d0",class:this.baseClass,onMouseEnter:this.handleWidgetCreation.bind(this),onFocusin:this.handleWidgetCreation.bind(this)},t,i("div",{key:"3421d8bde7ce6f91062b538f087c155946358e01",class:"instant-apps-export__visually-hidden"},n)))}renderPopover(){var t,n,s;const e=this.renderPanel();return[i("calcite-popover",{referenceElement:"export-popover-btn",label:null===(t=this.messages)||void 0===t?void 0:t.exportPopover,overlayPositioning:this.popoverPositioning,placement:this.popoverPlacement,autoClose:!0,ref:t=>this.popoverEl=t},e),i("calcite-action",{id:"export-popover-btn",alignment:"center",icon:this.popoverIcon,scale:this.scale,title:null===(n=this.messages)||void 0===n?void 0:n.exportBtn,text:null===(s=this.messages)||void 0===s?void 0:s.exportBtn})]}renderPanel(){var t,n;const s=this.showHeaderTitle?this.renderTitle():null,e=null!=this.extraContent?this.renderSwitch("includeExtraContent",this.extraContentLabel):null,o=this.showIncludeMap?this.renderSwitch("includeMap"):null,a=this.includeMap?this.renderMapOptions():null,r=this.renderPrint();return i("div",{class:"inline"===this.mode?"instant-apps-export__inline-container":"instant-apps-export__popover-container"},s,e,o,a,this.includeMap?i("calcite-button",{appearance:"transparent",width:"full",onClick:this.setMapAreaOnClick.bind(this),disabled:this.exportIsLoading},null===(t=this.messages)||void 0===t?void 0:t.setMapArea):null,i("calcite-button",{width:"full",onClick:this.exportOnClick.bind(this),disabled:this.exportIsLoading},null===(n=this.messages)||void 0===n?void 0:n.export),r)}renderTitle(){var t;return i("calcite-label",null,null===(t=this.messages)||void 0===t?void 0:t.title,i("calcite-input",{value:this.headerTitle,onCalciteInputInput:this.updateHeaderTitle.bind(this)}))}renderSwitch(t,n){var s;const e=null!=n?n:null===(s=this.messages)||void 0===s?void 0:s[t];return i("calcite-label",{layout:"inline-space-between"},e,i("calcite-switch",{checked:this[t],value:t,onCalciteSwitchChange:this.optionOnChange.bind(this)}))}renderMapOptions(){const t=this.showIncludeLegend?this.renderSwitch("includeLegend"):null,n=this.showIncludePopup?this.renderSwitch("includePopup"):null;return i("div",null,t,n)}renderPrint(){const t=this.includeMap?this.renderPrintMap():null,n=this.renderExtraContent(),s=this.includeMap&&this.showIncludeLegend?this.renderLegend():null,e=this.includeMap&&this.showIncludePopup?this.renderPopup():null;return i("div",{ref:t=>this.printContainerEl=t},i("div",{class:l,ref:t=>this.printEl=t},t,s,i("div",{class:c},e,n)))}renderPrintMap(){return i("div",{class:f,ref:t=>this.viewContainerEl=t},i("div",{class:m,ref:t=>this.viewWrapperEl=t},this.headerTitle?i("instant-apps-header",{titleText:this.headerTitle,backgroundColor:"#fff",textColor:"#323232"}):null,i("img",{class:g,ref:t=>this.viewEl=t}),i("div",{class:v,ref:t=>this.scaleBarContainerEl=t})))}renderLegend(){return i("div",{class:d,ref:t=>this.legendContainerEl=t})}renderCompass(){return i("div",{class:u,ref:t=>this.compassContainerEl=t})}renderPopup(){return i("div",{class:x,ref:t=>this.popupContainerEl=t},i("div",{ref:t=>this.popupTitleEl=t,class:_}),i("div",{ref:t=>this.popupContentEl=t,class:b}))}renderExtraContent(){return i("div",{class:h,id:"export-content",ref:t=>this.extraContainerEl=t})}optionOnChange(t){const{checked:n,value:i}=t.target;this[i]=n,this.updateExportOutput()}updateHeaderTitle(t){this.headerTitle=t.target.value,this.updateExportOutput()}async exportOnClick(){this.removeScreenshotElements(),await this.beforeExport(),null==this.viewWrapperEl||this.viewWrapperEl.contains(this.compassContainerEl)||this.viewWrapperEl.append(this.compassContainerEl),this.handleViewExportOnClick(),null!=this.popoverEl&&(this.popoverEl.open=!1)}async handleViewExportOnClick(){null!=this.view?(this.addPrintStyling(),document.body.prepend(this.printEl),this.handleExtraContent(),this.includeMap?(this.updateScaleBar(),this.updatePopupToPrint(),this.viewScreenshot(),this.handleImgLoaded()):this.handleImgLoaded()):null!=this.popoverEl&&(this.popoverEl.open=!1)}addPrintStyling(){null==this.printStyleEl&&(this.printStyleEl=document.createElement("style"),this.printStyleEl.innerHTML='\n @media print {\n @page {\n size: Portrait;\n margin: .25in;\n }\n\n html, body {\n padding: 0;\n margin: 0;\n height: 100%;\n width: 100%;\n }\n\n body > *:not(.instant-apps-export-print) { display: none; }\n }\n\n * {\n -webkit-print-color-adjust: exact;\n color-adjust: exact;\n }\n\n\n .instant-apps-export-print {\n height: 100%;\n width: 100%;\n position: absolute;\n z-index: -999;\n color: #323232 !important;\n display: grid;\n gap: 24px;\n grid-auto-flow: row;\n --esri-calcite-mode-name: "light";\n }\n\n .instant-apps-export-print, .instant-apps-export-print * {\n box-sizing: border-box;\n }\n\n .instant-apps-export-print__view-section {\n height: 100%;\n }\n\n .instant-apps-export-print__view-container {\n height: 100%;\n width: 100%;\n display: flex;\n justify-content: center;\n }\n\n .instant-apps-export-print__view-wrapper {\n height: fit-content;\n width: fit-content;\n position: relative;\n display: flex;\n flex-direction: column;\n border: 2pt solid #323232;\n overflow: hidden;\n }\n\n .instant-apps-export-print__view {\n object-fit: contain;\n }\n\n .instant-apps-export-print__popup-container {\n height: min-content;\n max-width: 350px;\n display: none;\n color: #323232;\n background: #fff;\n border: 1pt solid #323232;\n break-inside: avoid;\n }\n\n .instant-apps-export-print__popup-title {\n border-bottom: 1pt solid #323232;\n }\n\n .instant-apps-export-print__popup-content {\n background: #fff;\n padding-top: 8pt;\n }\n\n .instant-apps-export-print__popup-content .esri-feature-media__chart {\n background: #fff;\n }\n\n .instant-apps-export-print__legend-container {\n height: min-content;\n background: #fff;\n overflow: unset;\n }\n\n .esri-legend--card, .esri-legend--card__service-content {\n flex-flow: row wrap;\n }\n\n .instant-apps-export-print .esri-widget > *:not(.esri-scale-bar.esri-widget > *) {\n background: #fff;\n color: #323232;\n }\n\n .instant-apps-export-print__popup-content * {\n color: #323232;\n }\n\n .instant-apps-export-print .esri-widget__heading {\n margin: 2pt 7pt;\n padding: 0;\n color: #323232;\n }\n\n .instant-apps-export-print .esri-legend__ramp-label:before {\n border-color: rgba(0,0,0,0) rgba(50,50,50,.8) rgba(0,0,0,0) rgba(0,0,0,0);\n }\n\n .instant-apps-export-print .esri-legend--card__section {\n padding: 4pt 0 4pt;\n min-width: unset;\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__section:first-child {\n border-left: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service {\n border: none;\n flex: 0 1 auto;\n break-inside: avoid;\n }\n\n .instant-apps-export-print .esri-legend--card {\n border: none;\n gap: 6pt 12pt;\n }\n\n .instant-apps-export-print .esri-legend--card:not(:first-child),\n .instant-apps-export-print .esri-compass.esri-widget:not(:first-child) {\n display: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-container {\n height: unset;\n padding: 0;\n border-bottom: none;\n }\n\n .instant-apps-export-print .esri-legend--card__service-caption-text {\n padding-bottom: 4px;\n }\n\n .instant-apps-export-print__compass-container {\n position: absolute;\n top: 65px;\n left: 15px;\n background: #fff;\n box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);\n --calcite-ui-icon-color: #000;\n border-radius: 50%;\n height: fit-content;\n }\n\n .instant-apps-export-print__compass-container .esri-compass {\n background: #fff;\n }\n\n .instant-apps-export-print__compass-container .esri-compass__icon.esri-icon-compass {\n color: #000;\n }\n\n .instant-apps-export-print__compass-container.esri-compass.esri-widget--button {\n background: #fff;\n }\n\n .instant-apps-export-print__scale-bar-container {\n width: 100%;\n position: absolute;\n bottom: 15px;\n margin: 0 15px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__label {\n color: #323232;\n font-size: 10px;\n padding: 0 4px;\n }\n \n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label {\n height: 10px;\n padding: 0 2px;\n line-height: 11px;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__bar-container:nth-child(1n+3) {\n display: none;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__bar-container.esri-scale-bar__bar-container--line {\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line {\n background-color: rgba(255, 255, 255, 0.66);\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top {\n width: var(--instant-apps-scale-bar-top) !important;\n border-bottom: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom {\n width: var(--instant-apps-scale-bar-bottom) !important;\n border-top: 2px solid #323232;\n }\n\n .instant-apps-export-print__scale-bar-container--position .esri-scale-bar__label-container--line {\n position: unset;\n margin: 0 2px;\n background-color: rgba(255, 255, 255, 0.66);\n height: 10px;\n display: flex;\n align-items: center;\n }\n\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--top:after,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:before,\n .instant-apps-export-print__scale-bar-container .esri-scale-bar__line--bottom:after {\n background-color: #323232;\n border-right: 2px solid #323232;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__item-navigation {\n display: none;\n }\n\n .instant-apps-export-print__popup-container .esri-feature-media__chart.esri-feature-media__chart--rendered * {\n width: 100%!important;\n }\n\n .instant-apps-export-print__popup-content .esri-popup__content {\n margin: 0;\n }\n\n .instant-apps-export-print__content-container {\n display: flex;\n gap: 24px;\n break-inside: avoid;\n break-before: auto;\n }',document.body.prepend(this.printStyleEl))}handleImgLoaded(){this.exportIsLoading=!0,setTimeout((()=>{this.exportIsLoading=void 0,this.setupViewPrintElements()}),1500)}handleExtraContent(){const t=this.printEl.querySelector("#export-content");null!=t&&(t.innerHTML="",null!=this.extraContent&&this.includeExtraContent?(t.style.display="block",t.append(this.extraContent.cloneNode(!0))):t.style.display="none")}resetPrintContent(){var t,n;if(null!=this.view){this.screenshot=null,null===(t=this.printContainerEl)||void 0===t||t.prepend(this.printEl),null===(n=this.printStyleEl)||void 0===n||n.remove(),this.printStyleEl=void 0;const i=this.printEl.querySelector("#export-content");i&&(i.innerHTML="")}}async updatePopupToPrint(){var t,n;if(null!=this.view&&(null!=this.popupContainerEl&&(this.popupContainerEl.style.display=this.includePopup&&this.view.popup.visible?"block":"none",this.checkPopupOpen()),this.view.popup.visible&&null!=this.view.popup.selectedFeature)){const i=document.createElement(`h${null!==(t=this.view.popup.headingLevel)&&void 0!==t?t:2}`);i.innerHTML=null!==(n=this.view.popup.title)&&void 0!==n?n:"",i.className="esri-widget__heading esri-popup__header-title",null!=this.popupTitleEl&&(this.popupTitleEl.style.display=this.view.popup.title?"block":"none",this.popupTitleEl.innerHTML="",this.popupTitleEl.prepend(i))}}updateExportOutput(){this.output={},this.showHeaderTitle&&(this.output.headerTitle=this.headerTitle),this.showIncludeLegend&&(this.output.includeLegend=this.includeLegend),this.showIncludeMap&&(this.output.includeMap=this.includeMap),this.showIncludePopup&&(this.output.includePopup=this.includePopup),this.exportOutputUpdated.emit()}setupViewPrintElements(){if(null!=this.view){this.handleLegendSetup();const t=document.title;this.showHeaderTitle&&this.headerTitle&&(document.title=this.headerTitle),window.print(),document.title=t,setTimeout((()=>{this.resetPrintContent()}),1e3)}}handleLegendSetup(){var t;if(this.showIncludeLegend&&null!=this.view&&this.includeMap&&null!=this.legendContainerEl){const n=null!=this.legend&&(null===(t=this.legend.activeLayerInfos)||void 0===t?void 0:t.length)>0;this.legendContainerEl.style.display=this.includeLegend&&n?"block":"none"}}handleWidgetCreation(){this.includeMap&&(this.handleLegendCreation(),this.handleCompassCreation())}handleIncludePopup(){var t,n;if(this.showIncludePopup){const i="includePopup";null===(t=this.handles)||void 0===t||t.remove(i),null===(n=this.reactiveUtils)||void 0===n||n.whenOnce((()=>{var t;return null===(t=this.view)||void 0===t?void 0:t.ready})).then((()=>{var t;null===(t=this.handles)||void 0===t||t.add(this.reactiveUtils.watch((()=>{var t,n;return null===(n=null===(t=this.view)||void 0===t?void 0:t.popup)||void 0===n?void 0:n.visible}),(t=>{this.includePopup=t})),i)}))}}handleLegendCreation(){var t,n,i,s,e;if(null!=this.view&&this.showIncludeLegend&&null!=this.legendContainerEl){const o=this.view.map,a=null===(n=null===(t=this.legend)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;null!=(null===(i=null==o?void 0:o.portalItem)||void 0===i?void 0:i.id)&&(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)===(null===(e=null==a?void 0:a.portalItem)||void 0===e?void 0:e.id)||this.updateLegend()}}updateLegend(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{if(null!=this.legend&&(this.legend.destroy(),this.legend=null),null!=this.legendContainerEl){this.legendContainerEl.innerHTML="";const n=document.createElement("div");this.legendContainerEl.append(n);const[i]=await o(["esri/widgets/Legend"]);this.legend=new i({container:n,view:t,style:{type:"card",layout:"side-by-side"}})}}))}handleCompassCreation(){var t,n,i,s;if(null!=this.view&&null!=this.compassContainerEl){const e=this.view.map,o=null===(n=null===(t=this.compass)||void 0===t?void 0:t.view)||void 0===n?void 0:n.map;(null===(i=null==e?void 0:e.portalItem)||void 0===i?void 0:i.id)===(null===(s=null==o?void 0:o.portalItem)||void 0===s?void 0:s.id)||this.updateCompass()}}updateCompass(){var t;null===(t=this.view)||void 0===t||t.when((async t=>{var n;null===(n=this.compass)||void 0===n||n.destroy(),this.compass=null;const i=document.createElement("div");this.compassContainerEl.append(i);const[s]=await o(["esri/widgets/Compass"]);this.compass=new s({container:i,view:t})}))}updateScaleBar(){if(this.scaleBarContainerEl&&null!=this.view&&(this.scaleBarContainerEl.innerHTML="",this.showScaleBar)){const t=this.view.ui.getComponents(),n=null==t?void 0:t.find((({container:t})=>{var n;return null===(n=null==t?void 0:t.className)||void 0===n?void 0:n.includes("esri-scale-bar")}));null!=(null==n?void 0:n.container)&&"string"!=typeof n.container&&this.scaleBarContainerEl.append(n.container.cloneNode(!0))}}async viewScreenshot(){var t;if(null!=this.view&&this.includeMap&&(null==this.screenshot&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3),this.screenshot=await this.view.takeScreenshot({width:2*this.view.width,height:2*this.view.height})),this.handleScaleBarSize(),null!=this.viewEl&&null!=this.viewWrapperEl)){const{height:t,width:n}=this.screenshot.data;t>n?this.setMaxRowHeightOnViewContainer():this.setMaxWidthOnViewContainer(),this.viewEl.src=this.screenshot.dataUrl}}setMaxRowHeightOnViewContainer(){this.printEl.style.gridTemplateRows="minmax(auto, 70%)",this.viewEl.style.height="100%",this.viewEl.style.width="",this.viewWrapperEl.style.height="100%",this.viewWrapperEl.style.width="fit-content"}setMaxWidthOnViewContainer(){this.printEl.style.gridTemplateRows="",this.viewEl.style.width="100%",this.viewEl.style.height="",this.viewWrapperEl.style.height="fit-content",this.viewWrapperEl.style.width="100%"}checkPopupOpen(){if(null!=this.view){const t=this.view.popup.container,n=null==t?void 0:t.querySelector(".esri-popup .esri-feature__main-container");if(null!=n){const t=n.querySelectorAll("canvas");this.popupContentEl.innerHTML="",this.popupContentEl.append(n.cloneNode(!0));const i=this.popupContentEl.querySelectorAll("canvas");t.forEach(((t,n)=>{var s;const e=t.toDataURL(),o=document.createElement("img");o.src=e;const a=t.getAttribute("style");a&&o.setAttribute("style",a);const r=i[n];null!=r&&(r.replaceWith(o),document.querySelector("link[href*='esri/themes/dark/main.css']")&&null!=(null===(s=o.parentElement)||void 0===s?void 0:s.parentElement)&&(o.parentElement.style.background="#242424",o.parentElement.parentElement.style.background="#242424"))}))}}}createScreenshot(){var t,n;if(null!=this.view){this.screenshotPreview=document.createElement("div"),this.screenshotPreview.className="screenshot-preview hide",this.screenshotImgContainer=document.createElement("div"),this.screenshotImgContainer.className="screenshot-img-container",this.screenshotImg=document.createElement("img");const i=document.createElement("div"),s=document.createElement("calcite-button"),e=document.createElement("calcite-button");s.innerHTML=null===(t=this.messages)||void 0===t?void 0:t.export,e.innerHTML=null===(n=this.messages)||void 0===n?void 0:n.returnToMap,e.appearance="outline-fill",s.onclick=this.exportOnClick.bind(this),e.onclick=this.screenshotReturn.bind(this),i.append(e,s),this.screenshotImgContainer.append(this.screenshotImg,i),this.screenshotPreview.append(this.screenshotImgContainer),this.view.container.append(this.screenshotPreview)}}createMaskDiv(){null!=this.view&&(this.maskDivEl=document.createElement("div"),this.maskDivEl.id="screenshot-mask",this.maskDivEl.className="hide screenshot-cursor",this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-background",this.maskBackground),this.maskDivEl.style.setProperty("--instant-apps-screenshot-mask-border",this.maskBorder),this.screenshotStyle=document.createElement("style"),this.screenshotStyle.innerHTML="\n.screenshot-preview.hide, .hide {\n display: none;\n}\n\n.screenshot-cursor {\n cursor: crosshair;\n}\n\n.relative {\n position: relative;\n}\n\n#screenshot-mask {\n position: absolute;\n background: var(--instant-apps-screenshot-mask-background);\n border: var(--instant-apps-screenshot-mask-border);\n}\n\n.screenshot-preview {\n display: flex;\n align-items: center;\n justify-content: center;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n text-align: center;\n background-color: rgba(0, 0, 0, 0.75);\n}\n\n.screenshot-preview * {\n box-sizing: border-box;\n}\n\n.screenshot-img-container img {\n max-height: 75%;\n max-width: 75%;\n object-fit: contain;\n border: 10px solid white;\n box-shadow: 2px 2px 5px 0 rgba(0, 0, 0, 0.5);\n margin-bottom: 0.5em;\n}\n\n.screenshot-img-container {\n height: 100%;\n width: 100%;\n overflow-y: auto;\n margin-bottom: 8px;\n display: flex;\n flex-flow: column;\n align-items: center;\n justify-content: center;\n}\n\n.screenshot-img-container calcite-button {\n margin: 5px;\n}",this.view.container.append(this.screenshotStyle),this.view.container.append(this.maskDivEl))}screenshotReturn(){this.removeScreenshotElements(),this.exportIsLoading=!1,this.screenshot=null}setMapAreaOnClick(){null!=this.view&&(this.exportIsLoading=!0,this.createMaskDiv(),this.createScreenshot(),this.view.container.classList.add("screenshot-cursor","relative"),this.view.addHandles(this.view.on("drag",(async t=>{null!=this.view&&(t.stopPropagation(),"end"!==t.action?this.updateMaskSize(t):this.maskScreenshot())})),w))}updateMaskSize(t){if(null!=this.view){const n=this.clamp(Math.min(t.origin.x,t.x),0,this.view.width),i=this.clamp(Math.max(t.origin.x,t.x),0,this.view.width),s=this.clamp(Math.min(t.origin.y,t.y),0,this.view.height),e=this.clamp(Math.max(t.origin.y,t.y),0,this.view.height);this.area={x:n,y:s,width:i-n,height:e-s},this.setMaskPosition(this.area)}}maskScreenshot(){var t;if(null!=this.view&&null!=this.area){this.view.removeHandles(w);const n=this.area.height,i=this.area.width;this.showScaleBar&&(null===(t=this.scaleBarContainerEl)||void 0===t||t.classList.toggle("instant-apps-export-print__scale-bar-container--position",this.view.width>1e3&&.75*this.view.width<i)),this.view.takeScreenshot({area:this.area,width:2*i,height:2*n,format:"jpg"}).then((t=>{var n;this.screenshot=t,this.showPreview(),null===(n=this.view)||void 0===n||n.container.classList.remove("screenshot-cursor"),this.setMaskPosition(null)}))}}setMaskPosition(t){null!=t?(this.maskDivEl.classList.remove("hide"),this.maskDivEl.style.left=`${t.x}px`,this.maskDivEl.style.top=`${t.y}px`,this.maskDivEl.style.width=`${t.width}px`,this.maskDivEl.style.height=`${t.height}px`):this.maskDivEl.remove()}clamp(t,n,i){return t<n?n:t>i?i:t}showPreview(){this.screenshotPreview.classList.remove("hide"),null!=this.screenshotImg&&null!=this.screenshot&&(this.screenshotImg.src=this.screenshot.dataUrl)}handleScaleBarSize(){var t;if(this.showScaleBar&&"2d"===(null===(t=this.view)||void 0===t?void 0:t.type)&&null!=this.scaleBarContainerEl){const t=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--top"),n=this.scaleBarContainerEl.querySelector(".esri-scale-bar__line--bottom");this.setScalebarWidth(t,"top"),this.setScalebarWidth(n,"bottom")}}setScalebarWidth(t,n){var i;if(null!=t&&null!=this.screenshot){const s=this.screenshot.data.width/2,e=Number(t.style.width.replace("px",""));null===(i=this.scaleBarContainerEl)||void 0===i||i.style.setProperty(`--instant-apps-scale-bar-${n}`,e/s*100+"%")}}removeScreenshotElements(){var t,n;null===(t=this.screenshotPreview)||void 0===t||t.remove(),null===(n=this.screenshotStyle)||void 0===n||n.remove()}get el(){return e(this)}static get watchers(){return{includeMap:["watchIncludeMap"],view:["watchView"]}}};k.style=":host{display:block;--instant-apps-export-action-background:var(--calcite-color-foreground-1);--instant-apps-export-action-background-hover:var(--calcite-color-foreground-2);--instant-apps-export-action-background-press:var(--calcite-color-foreground-3);--instant-apps-export-action-height:100%;--instant-apps-export-action-width:fit-content;--instant-apps-export-action-icon-color:var(--calcite-color-text-3);--instant-apps-export-action-icon-hover-color:var(--calcite-color-text-1);--instant-apps-export-background:var(--calcite-color-foreground-1);--instant-apps-export-text-color:var(--calcite-color-text-1);--instant-apps-export-popover-width:250px}.instant-apps-export{height:100%}.instant-apps-export *{box-sizing:border-box}.instant-apps-export__popover-container,.instant-apps-export__inline-container{padding:12px;background:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export__popover-container{width:var(--instant-apps-export-popover-width)}.instant-apps-export calcite-action{height:var(--instant-apps-export-action-height);width:var(--instant-apps-export-action-width);--calcite-color-foreground-1:var(--instant-apps-export-action-background);--calcite-color-foreground-2:var(--instant-apps-export-action-background-hover);--calcite-color-foreground-3:var(--instant-apps-export-action-background-press);--calcite-color-text-3:var(--instant-apps-export-action-icon-color);--calcite-color-text-1:var(--instant-apps-export-action-icon-hover-color)}.instant-apps-export .instant-apps-export-print{display:none}.instant-apps-export__visually-hidden{position:absolute;top:0;z-index:-1;visibility:hidden}.instant-apps-export calcite-input{--calcite-color-foreground-1:var(--instant-apps-export-background);--calcite-color-text-1:var(--instant-apps-export-text-color)}.instant-apps-export calcite-popover{--calcite-color-foreground-1:var(--instant-apps-export-background)}.instant-apps-export calcite-switch{--calcite-color-foreground-1:#fff;--calcite-color-foreground-2:#f3f3f3}.instant-apps-export calcite-button:last-of-type{margin-top:0.5rem}.instant-apps-export .calcite-mode-dark calcite-switch{--calcite-color-foreground-1:#2b2b2b;--calcite-color-foreground-2:#202020}.instant-apps-export__compass-container.esri-widget{background:#fff;box-shadow:0 1px 2px rgba(0, 0, 0, 0.3)}.instant-apps-export__compass-container.esri-widget .esri-compass__icon.esri-icon-compass{color:#6e6e6e}.hide{display:none}.screenshotCursor{cursor:crosshair}";export{k as instant_apps_export}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{_ as t}from"./p-00291b93.js";import{l as i}from"./p-ffd41e25.js";
6
+ import{_ as t}from"./p-67c3ac62.js";import{l as i}from"./p-c0bf1d9f.js";
7
7
  /** @license
8
8
  * Copyright 2022 Esri
9
9
  *
@@ -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,c as e,h as i,H as a,g as s}from"./p-fa1ceaf9.js";import{s as l}from"./p-2afdcdfc.js";import{g as c}from"./p-ffd41e25.js";import{n}from"./p-eed41e1a.js";import"./p-8c6d9b5a.js";import"./p-c1cf3ebc.js";import"./p-3d7cff5e.js";import"./p-d4056c1c.js";import"./p-a230b270.js";import"./p-a0300d31.js";import"./p-6a68306c.js";const r=class{constructor(i){t(this,i),this.solutionItemSelected=e(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,e){t&&t!==e&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return i(a,{key:"7546d1fe9d944520db9f8f81600fb7cf0655f1ab"},i("calcite-tree",{key:"94bea7616cd3bdbb9fbcaddd49bb394e11bcf88b"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const e=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,e){var i;const a=null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.closest("calcite-tree-item");a&&(a.expanded=!(null==a?void 0:a.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return s(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=l.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"16de446a44799754d7066eb5cc587585fc9e37c8"},i("div",{key:"ddb7c1e6c86657502dc4b293d495f3b4dee594cf",class:"configuration-container"},i("div",{key:"016954a98a5eb229a1f9eb2a4b9260daff3593bf",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.groupDetailsTab),i("calcite-tab-title",null,this._translations.sharingTab)),i("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"share-tab"},i("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.itemDetailsTab),i("calcite-tab-title",null,this._translations.dataTab),i("calcite-tab-title",null,this._translations.propertiesTab),i("calcite-tab-title",null,this._translations.resourcesTab)),i("calcite-tab",{class:"config-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"data-tab"},i("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"props-tab"},i("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"resources-tab"},i("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const d=class{constructor(i){t(this,i),this.featureServiceSpatialReferenceChange=e(this,"featureServiceSpatialReferenceChange",7),this.lockedSpatialReferenceChange=e(this,"lockedSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._translations=void 0}lockedChanged(t){t||this._setFeatureServiceDefaults(this.services),this.lockedSpatialReferenceChange.emit({locked:t})}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"8c5f34b7d44429ed0395ae48956161caf7e62111"},i("label",{key:"69f1178da58409888f0b5b15ae4ffd224bb999d4",class:"switch-label"},i("calcite-switch",{key:"279795c5e21b914c595ea95219e3f589f7270ac4",checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),i("div",{key:"516e621ad3e2f6f881b0fbc0a80d98f1f3b7eecd",class:"spatial-ref-component",id:"spatialRefDefn"},i("calcite-label",{key:"19b05ffa3e80d5e33521d0b6ee8438d882f9481d"},this._translations.spatialReferenceInfo,i("label",{key:"0766edb36aa3e8853bfd4754b9ea7aa955d7d987",class:"spatial-ref-default"},i("spatial-ref",{key:"9f1b37a12e18b5ba3c2d2b4b372f01a4f69ded28",defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services)))}solutionStoreHasChanges(){this.services=l.getStoreInfo("featureServices").map((t=>t.name))}spatialReferenceChange(t){this.value=t.detail.newValue,l.setStoreInfo("defaultWkid",t.detail.newValue);const e=l.getStoreInfo("spatialReferenceInfo");e.spatialReference=t.detail.newValue,l.setStoreInfo("spatialReferenceInfo",e)}_getFeatureServices(t){const e=l.getStoreInfo("spatialReferenceInfo"),a=t.filter((t=>Object.keys(e.services).some((e=>e===t))));return a.length>0?i("div",null,i("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),i("ul",{class:"spatial-ref-services-list"},a.map((t=>i("li",{class:"spatial-ref-services-list-item"},i("label",{class:"switch-label"},i("calcite-switch",{checked:e.services[t],class:"spatial-ref-item-switch",disabled:this.locked,onCalciteSwitchChange:e=>this._updateEnabledServices(e,t),scale:"m"}),t)))))):null}_setFeatureServiceDefaults(t){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((t=>t.checked=!0)),t.forEach((t=>this._updateEnabledServices({detail:{switched:!0}},t)))}_updateEnabledServices(t,e){var i,a;const s=l.getStoreInfo("spatialReferenceInfo"),c=void 0!==(null===(i=t.detail)||void 0===i?void 0:i.switched)?t.detail.switched:void 0===(null===(a=t.target)||void 0===a?void 0:a.checked)||t.target.checked;s.services[e]=c,l.setStoreInfo("spatialReferenceInfo",s),this.featureServiceSpatialReferenceChange.emit({name:e,enabled:c})}_updateLocked(t){this.locked=!t.target.checked,this._updateStore(),this.loaded||(t.target.checked&&this._setFeatureServiceDefaults(this.services),this.loaded=!0)}_updateStore(){const t=l.getStoreInfo("spatialReferenceInfo");t.enabled=!this.locked,t.spatialReference=this.value,l.setStoreInfo("spatialReferenceInfo",t)}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{locked:["lockedChanged"]}}};d.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-default{margin:0px}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.disabled-div{pointer-events:none;opacity:0.4}.spatial-ref-desc{padding-bottom:0.5rem;padding-inline-start:0.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:0}.spatial-ref-services-list-item{margin-top:0.25rem}";export{r as solution_contents,o as solution_item,d as solution_spatial_ref}
6
+ import{r as t,c as e,h as i,H as a,g as s}from"./p-fa1ceaf9.js";import{s as l}from"./p-2afdcdfc.js";import{g as c}from"./p-c0bf1d9f.js";import{n}from"./p-eed41e1a.js";import"./p-8c6d9b5a.js";import"./p-c1cf3ebc.js";import"./p-3d7cff5e.js";import"./p-d4056c1c.js";import"./p-a230b270.js";import"./p-a0300d31.js";import"./p-0a24ad5f.js";const r=class{constructor(i){t(this,i),this.solutionItemSelected=e(this,"solutionItemSelected",7),this.selectedItemId=void 0,this.templateHierarchy=[]}valueWatchHandler(t,e){t&&t!==e&&Array.isArray(t)&&t.length>0&&this._treeItemSelected(t[0].id)}componentWillLoad(){this.valueWatchHandler(this.templateHierarchy,[])}render(){return i(a,{key:"7546d1fe9d944520db9f8f81600fb7cf0655f1ab"},i("calcite-tree",{key:"94bea7616cd3bdbb9fbcaddd49bb394e11bcf88b"},this.renderHierarchy(this.templateHierarchy)))}renderHierarchy(t){return t.map((t=>{const e=this.selectedItemId&&this.selectedItemId===t.id;return t.dependencies&&t.dependencies.length>0?i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title),i("calcite-tree",{slot:"children"},this.renderHierarchy(t.dependencies))):i("calcite-tree-item",{onClick:e=>this._treeItemSelected(t.id,e),selected:e},i("solution-item-icon",{type:t.type,typeKeywords:t.typeKeywords}),i("span",{class:"icon-text",title:t.title},t.title))}))}_treeItemSelected(t,e){var i;const a=null===(i=null==e?void 0:e.target)||void 0===i?void 0:i.closest("calcite-tree-item");a&&(a.expanded=!(null==a?void 0:a.expanded)),this.selectedItemId=t,this.solutionItemSelected.emit(t)}static get assetsDirs(){return["item-type-icons"]}get el(){return s(this)}static get watchers(){return{templateHierarchy:["valueWatchHandler"]}}};r.style=".icon-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}";const o=class{constructor(e){t(this,e),this.authentication=void 0,this.itemId="",this.solutionVariables="",this.organizationVariables="",this.itemType=void 0,this._translations=void 0}itemIdWatchHandler(){const t=l.getItemInfo(this.itemId);this.itemType=t.type}async componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"16de446a44799754d7066eb5cc587585fc9e37c8"},i("div",{key:"ddb7c1e6c86657502dc4b293d495f3b4dee594cf",class:"configuration-container"},i("div",{key:"016954a98a5eb229a1f9eb2a4b9260daff3593bf",class:"configuration"},this._showGroupTabs("Group"===this.itemType),this._showItemTabs("Group"!==this.itemType))))}_showGroupTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.groupDetailsTab),i("calcite-tab-title",null,this._translations.sharingTab)),i("calcite-tab",{class:"config-tab",id:"group-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"share-tab"},i("solution-item-sharing",{"group-id":this.itemId})))}_showItemTabs(t){return i("calcite-tabs",{class:"config-tabs",style:{display:t?"inherit":"none"}},i("calcite-tab-nav",{slot:"tab-nav"},i("calcite-tab-title",null,this._translations.itemDetailsTab),i("calcite-tab-title",null,this._translations.dataTab),i("calcite-tab-title",null,this._translations.propertiesTab),i("calcite-tab-title",null,this._translations.resourcesTab)),i("calcite-tab",{class:"config-tab",selected:!0},i("solution-item-details",{"item-id":this.itemId})),i("calcite-tab",{class:"config-tab",id:"data-tab"},i("solution-template-data",{instanceid:"data","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"props-tab"},i("solution-template-data",{instanceid:"properties","item-id":this.itemId,"organization-variables":this.organizationVariables,"solution-variables":this.solutionVariables})),i("calcite-tab",{class:"config-tab",id:"resources-tab"},i("solution-resource-item",{authentication:this.authentication,class:"solutions-resource-container","item-id":this.itemId})))}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{itemId:["itemIdWatchHandler"]}}};o.style=".configuration-container{position:relative;height:100%;width:100%}.configuration{position:absolute;top:0px;right:0px;bottom:0px;left:0px;display:flex;padding:0.5rem;border:1px #808080 solid}.config-tabs{width:100%}.config-tab{width:100%;overflow-y:auto;height:inherit}";const d=class{constructor(i){t(this,i),this.featureServiceSpatialReferenceChange=e(this,"featureServiceSpatialReferenceChange",7),this.lockedSpatialReferenceChange=e(this,"lockedSpatialReferenceChange",7),this.defaultWkid=102100,this.loaded=!1,this.locked=!0,this.services=[],this.value=this.defaultWkid.toString(),this._translations=void 0}lockedChanged(t){t||this._setFeatureServiceDefaults(this.services),this.lockedSpatialReferenceChange.emit({locked:t})}componentWillLoad(){return this._getTranslations()}render(){return i(a,{key:"8c5f34b7d44429ed0395ae48956161caf7e62111"},i("label",{key:"69f1178da58409888f0b5b15ae4ffd224bb999d4",class:"switch-label"},i("calcite-switch",{key:"279795c5e21b914c595ea95219e3f589f7270ac4",checked:!this.locked,class:"spatial-ref-switch",onCalciteSwitchChange:t=>this._updateLocked(t),scale:"m"}),this._translations.specifyParam),i("div",{key:"516e621ad3e2f6f881b0fbc0a80d98f1f3b7eecd",class:"spatial-ref-component",id:"spatialRefDefn"},i("calcite-label",{key:"19b05ffa3e80d5e33521d0b6ee8438d882f9481d"},this._translations.spatialReferenceInfo,i("label",{key:"0766edb36aa3e8853bfd4754b9ea7aa955d7d987",class:"spatial-ref-default"},i("spatial-ref",{key:"9f1b37a12e18b5ba3c2d2b4b372f01a4f69ded28",defaultWkid:this.defaultWkid,disabled:this.locked,value:this.value}))),this._getFeatureServices(this.services)))}solutionStoreHasChanges(){this.services=l.getStoreInfo("featureServices").map((t=>t.name))}spatialReferenceChange(t){this.value=t.detail.newValue,l.setStoreInfo("defaultWkid",t.detail.newValue);const e=l.getStoreInfo("spatialReferenceInfo");e.spatialReference=t.detail.newValue,l.setStoreInfo("spatialReferenceInfo",e)}_getFeatureServices(t){const e=l.getStoreInfo("spatialReferenceInfo"),a=t.filter((t=>Object.keys(e.services).some((e=>e===t))));return a.length>0?i("div",null,i("label",{class:"spatial-ref-item-title"},this._translations.featureServicesHeading),i("ul",{class:"spatial-ref-services-list"},a.map((t=>i("li",{class:"spatial-ref-services-list-item"},i("label",{class:"switch-label"},i("calcite-switch",{checked:e.services[t],class:"spatial-ref-item-switch",disabled:this.locked,onCalciteSwitchChange:e=>this._updateEnabledServices(e,t),scale:"m"}),t)))))):null}_setFeatureServiceDefaults(t){n(this.el.getElementsByClassName("spatial-ref-item-switch")).forEach((t=>t.checked=!0)),t.forEach((t=>this._updateEnabledServices({detail:{switched:!0}},t)))}_updateEnabledServices(t,e){var i,a;const s=l.getStoreInfo("spatialReferenceInfo"),c=void 0!==(null===(i=t.detail)||void 0===i?void 0:i.switched)?t.detail.switched:void 0===(null===(a=t.target)||void 0===a?void 0:a.checked)||t.target.checked;s.services[e]=c,l.setStoreInfo("spatialReferenceInfo",s),this.featureServiceSpatialReferenceChange.emit({name:e,enabled:c})}_updateLocked(t){this.locked=!t.target.checked,this._updateStore(),this.loaded||(t.target.checked&&this._setFeatureServiceDefaults(this.services),this.loaded=!0)}_updateStore(){const t=l.getStoreInfo("spatialReferenceInfo");t.enabled=!this.locked,t.spatialReference=this.value,l.setStoreInfo("spatialReferenceInfo",t)}async _getTranslations(){const t=await c(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{locked:["lockedChanged"]}}};d.style=".spatial-ref-switch{margin-inline-end:0.5rem}.spatial-ref-component{margin-top:0.625rem;margin-inline-start:2.5rem}#spatialRefDefn .sc-calcite-label-h label.sc-calcite-label{margin:0px;background-color:#CBC3E3}.spatial-ref-default{margin:0px}.spatial-ref-item-title{margin-bottom:0.5rem;font-size:0.875rem;line-height:1.25rem}.spatial-ref-item-switch{margin-inline-end:0.5rem}.switch-label{font-size:0.875rem;line-height:1.25rem}.disabled-div{pointer-events:none;opacity:0.4}.spatial-ref-desc{padding-bottom:0.5rem;padding-inline-start:0.25rem}.spatial-ref-services-list{margin-block-start:0.5em;margin-block-end:0.5em;list-style-type:none;padding-inline-start:0}.spatial-ref-services-list-item{margin-top:0.25rem}";export{r as solution_contents,o as solution_item,d as solution_spatial_ref}
@@ -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,h as i,H as s,g as e,c as a}from"./p-fa1ceaf9.js";import{l as h,g as o}from"./p-ffd41e25.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";const n=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"7fe5ef48d77de087f17498e2e1f3370a069e8629"},i("div",{key:"aca555c687352046a138343cab6f656234069644",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){var i;if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const s=new this.PortalBasemapsSource({query:(null===(i=this.basemapConfig)||void 0===i?void 0:i.basemapGroupId)?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await s.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:s})}}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};n.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}async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"c80a8d46fb48f3789d9fa09c2400faad49e2e236"},i("div",{key:"82919a3ba061a17c8aeaa0d2f6f4f13bc428b519",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=null==t?void 0:t.map;await i.when((()=>{var s,e,a;t&&this.enabled&&this.FloorFilter&&(null==i?void 0:i.floorInfo)&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),null===(s=this._facilityHandle)||void 0===s||s.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),null===(e=this._levelHandle)||void 0===e||e.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),null===(a=this._siteHandle)||void 0===a||a.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}get el(){return e(this)}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}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}async componentWillLoad(){await this._initModules()}render(){return i(s,{key:"943217d26f3cf5861c165c3300ba24736ce8f7dc"},i("div",{key:"6c76ebf6e63dab19f24d776cd27cd86b74ea93d0",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 d=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"bdd3b848bec1aec6f8c7676f8bab5e9463b16064"},i("div",{key:"d7bb217db6971758ef8774d19d6ac5cfa94a0ddc",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}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};d.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this._loadedId="",this.mapInfos=[],this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=null==t?void 0:t.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t){var i;const s=null===(i=this.mapInfos)||void 0===i?void 0:i.filter((i=>i.id===t));t&&(null==s?void 0:s.length)>0&&this._webMapSelected(s[0])}async componentWillLoad(){await this._getTranslations()}render(){return i(s,{key:"86994e2c4d87809c1508b073c3af1c0975c2d81d"},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(){var t;const s="map-picker-expand-toggle";return i("div",{class:"width-full"},i("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",id:s,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":s},i("span",null,this._translations.switchMap)))}_getToolbar(){return i("div",{class:"display-flex"},i("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return i("div",{class:t?"map-list border-bottom-1":"display-none"},i("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>i("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 o(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};l.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.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)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;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}";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}async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return i(s,{key:"5036a89c6a686b2486ff88dffd06f0bed1ea510e"},i("div",{key:"4c5ede4d9877ff0ca0f16706c99aba354df21fd1",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};if(this.searchConfiguration){const i=this._getSearchConfig(this.searchConfiguration,this.mapView);t=Object.assign({},i)}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(null==s?void 0:s.length)>0?(t.includeDefaultSources=!1,s.forEach((t=>{var s,e;if(t.hasOwnProperty("layer")){const a=t,h=null===(s=a.layer)||void 0===s?void 0:s.id,o=h?i.map.findLayerById(h):null,n=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;o?a.layer=o:n&&(a.layer=new this.FeatureLayer(n))}})),null==s||s.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===(null==i?void 0:i.name)&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t=Object.assign(Object.assign({},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 u=class{constructor(i){t(this,i),this._widgets=[],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}async mapViewWatchHandler(){await this.mapView.when((()=>{var t,i;this._hasFloorInfo=null===(i=null===(t=this.mapView)||void 0===t?void 0:t.map)||void 0===i?void 0:i.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",e=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",o=this._showFloorFilter?"":"display-none",n=this._showFullscreen?"":"display-none",c=this.enableSingleExpand?"margin-top-1-2":"",r=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],d=this.stackTools?"box-shadow":"";return i(s,{key:"a1557491ffd833bed11843dbe1bd040a9d2d6b15"},i("div",{key:"8866b3bc6e05fa75605b078e1a3deecaf6392024",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?i("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,i("div",{key:"6a4e62ad1afcca39365aa965ffabedf8933051d4",class:`${c} ${d} ${t}`},this._getMapWidgets(r))),i("basemap-gallery",{key:"4edade9536c0912a89f6a9335ae05ae46669e14d",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),i("map-search",{key:"046d02c1927def025294645c6e855906fabd30aa",class:e,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),i("map-legend",{key:"54575e31073bdc68b611939eb0e619e4479b26f3",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),i("map-fullscreen",{key:"9a54a22e12c372dd85717f83cf31b4ace80489eb",class:n,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),i("floor-filter",{key:"ffadf501a03186ed6f2fec8754cd758faea5b4dd",class:o,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){var t,i;const s=null===(t=document.getElementsByClassName("esri-zoom")[0])||void 0===t?void 0:t.children[0],e=null===(i=document.getElementsByClassName("esri-zoom")[0])||void 0===i?void 0:i.children[1];if(s&&e){const t="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";s.style.width=t,s.style.height=t,e.style.width=t,e.style.height=t}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{var e,a,h,o,n;switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,null===(e=this._legendElement)||void 0===e?void 0:e.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,null===(a=this._searchElement)||void 0===a?void 0:a.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,null===(h=this._fullscreenElement)||void 0===h?void 0:h.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,null===(o=this._basemapElement)||void 0===o?void 0:o.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,null===(n=this._floorFilterElement)||void 0===n?void 0:n.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,s,e,a){return i("div",null,i("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:s,icon:t,id:t,onClick:a,scale:"s",text:""},i("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),i("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},i("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 o(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};u.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{n as basemap_gallery,c as floor_filter,r as map_fullscreen,d as map_legend,l as map_picker,p as map_search,u as map_tools}
6
+ import{r as t,h as i,H as s,g as e,c as a}from"./p-fa1ceaf9.js";import{l as h,g as o}from"./p-c0bf1d9f.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const n=class{constructor(i){t(this,i),this.mapView=void 0,this.basemapConfig=void 0,this.basemapWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initBaseMapGallery(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"7fe5ef48d77de087f17498e2e1f3370a069e8629"},i("div",{key:"aca555c687352046a138343cab6f656234069644",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){var i;if(this.BasemapGallery){this.basemapWidget&&this.basemapWidget.destroy();const s=new this.PortalBasemapsSource({query:(null===(i=this.basemapConfig)||void 0===i?void 0:i.basemapGroupId)?`id:${this.basemapConfig.basemapGroupId}`:null,filterFunction:this.basemapConfig?t=>!this.basemapConfig.basemapIdsToFilter.includes(t.portalItem.id):()=>!0});await s.refresh(),this.basemapWidget=new this.BasemapGallery({container:this._basemapElement,view:t,source:s})}}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};n.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}async mapViewWatchHandler(){await this._initFloorFilter(this.mapView)}async enabledWatchHandler(){this.enabled?await this._initFloorFilter(this.mapView):this.enabled||this._destroyWidget()}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"c80a8d46fb48f3789d9fa09c2400faad49e2e236"},i("div",{key:"82919a3ba061a17c8aeaa0d2f6f4f13bc428b519",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=null==t?void 0:t.map;await i.when((()=>{var s,e,a;t&&this.enabled&&this.FloorFilter&&(null==i?void 0:i.floorInfo)&&(this._initContainer(),this.floorFilterWidget=new this.FloorFilter({container:this._floorFilterElement,view:t}),null===(s=this._facilityHandle)||void 0===s||s.remove(),this._facilityHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.facility),(t=>{this.facilityChanged.emit(t)})),null===(e=this._levelHandle)||void 0===e||e.remove(),this._levelHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.level),(t=>{this.levelChanged.emit(t)})),null===(a=this._siteHandle)||void 0===a||a.remove(),this._siteHandle=this.reactiveUtils.watch((()=>this.floorFilterWidget.site),(t=>{this.siteChanged.emit(t)})))}))}get el(){return e(this)}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}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFullscreenWidget()}))}async componentWillLoad(){await this._initModules()}render(){return i(s,{key:"943217d26f3cf5861c165c3300ba24736ce8f7dc"},i("div",{key:"6c76ebf6e63dab19f24d776cd27cd86b74ea93d0",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 d=class{constructor(i){t(this,i),this.mapView=void 0,this.legendWidget=void 0}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initLegend(this.mapView)}))}async componentWillLoad(){return this._initModules()}render(){return i(s,{key:"bdd3b848bec1aec6f8c7676f8bab5e9463b16064"},i("div",{key:"d7bb217db6971758ef8774d19d6ac5cfa94a0ddc",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}))}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};d.style=":host{display:block}";const l=class{constructor(i){t(this,i),this.mapInfoChange=a(this,"mapInfoChange",7),this._loadedId="",this.mapInfos=[],this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&(this._loadedId=null==t?void 0:t.id,this.mapInfoChange.emit(t))}async mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._webMapSelected(t[0])}async setMapByID(t){var i;const s=null===(i=this.mapInfos)||void 0===i?void 0:i.filter((i=>i.id===t));t&&(null==s?void 0:s.length)>0&&this._webMapSelected(s[0])}async componentWillLoad(){await this._getTranslations()}render(){return i(s,{key:"86994e2c4d87809c1508b073c3af1c0975c2d81d"},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(){var t;const s="map-picker-expand-toggle";return i("div",{class:"width-full"},i("calcite-button",{alignment:"icon-end-space-between",appearance:"transparent",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",id:s,kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":s},i("span",null,this._translations.switchMap)))}_getToolbar(){return i("div",{class:"display-flex"},i("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_getMapNameList(t){return i("div",{class:t?"map-list border-bottom-1":"display-none"},i("calcite-list",{id:"mapList",ref:t=>this._list=t,selectionAppearance:"border",selectionMode:"single"},this.mapInfos.map((t=>i("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 o(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};l.style=":host{display:block;--solutions-theme-foreground-color:var(--calcite-color-foreground-1)}.width-full{width:100%}.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)}.action-bar-size{height:51px;width:100%}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;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}";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}async watchSearchConfigurationHandler(){this._initSearchWidget()}async mapViewWatchHandler(){await this.mapView.when((()=>{this._initSearchWidget()}))}async componentWillLoad(){await this._initModules()}async componentDidLoad(){return this._initSearchWidget()}render(){return i(s,{key:"5036a89c6a686b2486ff88dffd06f0bed1ea510e"},i("div",{key:"4c5ede4d9877ff0ca0f16706c99aba354df21fd1",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};if(this.searchConfiguration){const i=this._getSearchConfig(this.searchConfiguration,this.mapView);t=Object.assign({},i)}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(null==s?void 0:s.length)>0?(t.includeDefaultSources=!1,s.forEach((t=>{var s,e;if(t.hasOwnProperty("layer")){const a=t,h=null===(s=a.layer)||void 0===s?void 0:s.id,o=h?i.map.findLayerById(h):null,n=null===(e=null==a?void 0:a.layer)||void 0===e?void 0:e.url;o?a.layer=o:n&&(a.layer=new this.FeatureLayer(n))}})),null==s||s.forEach((t=>{if(t.hasOwnProperty("locator")){const i=t;"ArcGIS World Geocoding Service"===(null==i?void 0:i.name)&&(i.outFields=i.outFields||["Addr_type","Match_addr","StAddr","City"],i.singleLineFieldName="SingleLine"),i.url=i.url,delete i.url}}))):t=Object.assign(Object.assign({},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 u=class{constructor(i){t(this,i),this._widgets=[],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}async mapViewWatchHandler(){await this.mapView.when((()=>{var t,i;this._hasFloorInfo=null===(i=null===(t=this.mapView)||void 0===t?void 0:t.map)||void 0===i?void 0:i.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",e=this._showSearchWidget?"":"display-none",a=this._showBasemapWidget?"":"display-none",h=this._showLegendWidget?"":"display-none",o=this._showFloorFilter?"":"display-none",n=this._showFullscreen?"":"display-none",c=this.enableSingleExpand?"margin-top-1-2":"",r=this.toolOrder?this.toolOrder:["legend","search","fullscreen","floorfilter"],d=this.stackTools?"box-shadow":"";return i(s,{key:"a1557491ffd833bed11843dbe1bd040a9d2d6b15"},i("div",{key:"8866b3bc6e05fa75605b078e1a3deecaf6392024",class:this.enableBasemap||this.enableFullscreen||this.enableLegend||this.enableSearch?"":"display-none"},this.enableSingleExpand?i("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,i("div",{key:"6a4e62ad1afcca39365aa965ffabedf8933051d4",class:`${c} ${d} ${t}`},this._getMapWidgets(r))),i("basemap-gallery",{key:"4edade9536c0912a89f6a9335ae05ae46669e14d",basemapConfig:this.basemapConfig,class:a,mapView:this.mapView,ref:t=>{this._basemapElement=t}}),i("map-search",{key:"046d02c1927def025294645c6e855906fabd30aa",class:e,mapView:this.mapView,ref:t=>{this._searchElement=t},resultGraphicEnabled:!0,searchConfiguration:this.searchConfiguration}),i("map-legend",{key:"54575e31073bdc68b611939eb0e619e4479b26f3",class:h,mapView:this.mapView,ref:t=>{this._legendElement=t}}),i("map-fullscreen",{key:"9a54a22e12c372dd85717f83cf31b4ace80489eb",class:n,mapView:this.mapView,onFullscreenStateChange:t=>this._fullscreenStateChange(t.detail),ref:t=>{this._fullscreenElement=t}}),i("floor-filter",{key:"ffadf501a03186ed6f2fec8754cd758faea5b4dd",class:o,enabled:this.enableFloorFilter,mapView:this.mapView,ref:t=>{this._floorFilterElement=t}}))}async _initModules(){const[t]=await h(["esri/widgets/Expand"]);this.Expand=t}_setZoomToolsSize(){var t,i;const s=null===(t=document.getElementsByClassName("esri-zoom")[0])||void 0===t?void 0:t.children[0],e=null===(i=document.getElementsByClassName("esri-zoom")[0])||void 0===i?void 0:i.children[1];if(s&&e){const t="s"===this.homeZoomToolsSize?"32px":"m"===this.homeZoomToolsSize?"40px":"48px";s.style.width=t,s.style.height=t,e.style.width=t,e.style.height=t}}_getMapWidgets(t){const i=this._showFullscreen?"full-screen-exit":"full-screen",s=this._showFullscreen?this._translations.exitFullscreen:this._translations.enterFullscreen;return t.map((t=>{var e,a,h,o,n;switch(t){case"legend":return this.enableLegend&&this.enableSingleExpand?this._getActionGroup("legend",!1,this._translations.legend,(()=>this._showLegend())):this.enableLegend?this._getWidget(t,null===(e=this._legendElement)||void 0===e?void 0:e.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,null===(a=this._searchElement)||void 0===a?void 0:a.searchWidget,!0):void 0;case"fullscreen":return this.enableFullscreen&&this.enableSingleExpand?this._getActionGroup(i,!1,s,(()=>this._expand())):this.enableFullscreen?this._getWidget(t,null===(h=this._fullscreenElement)||void 0===h?void 0:h.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,null===(o=this._basemapElement)||void 0===o?void 0:o.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,null===(n=this._floorFilterElement)||void 0===n?void 0:n.floorFilterWidget,!0):void 0}}))}_fullscreenStateChange(t){"ready"===t&&this._showFullscreen?this._showFullscreen=!1:"active"!==t||this._showFullscreen||(this._showFullscreen=!0)}_getActionGroup(t,s,e,a){return i("div",null,i("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:s,icon:t,id:t,onClick:a,scale:"s",text:""},i("calcite-icon",{icon:"cheveron-up",scale:"s",slot:"icon"})),i("calcite-tooltip",{label:"",placement:"trailing","reference-element":t},i("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 o(this.el);this._translations=t[0]}get el(){return e(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_showBasemapWidget:["_showBasemapWidgetWatchHandler"],_showFloorFilter:["_showFloorFilterWatchHandler"],_showFullscreen:["_showFullscreenWatchHandler"],_showLegendWidget:["_showLegendWidgetWatchHandler"],_showSearchWidget:["_showSearchWidgetWatchHandler"]}}};u.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{n as basemap_gallery,c as floor_filter,r as map_fullscreen,d as map_legend,l as map_picker,p as map_search,u 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,c as i,h as e,H as s,g as a}from"./p-fa1ceaf9.js";import{c as o}from"./p-e6c9e6af.js";import{C as r}from"./p-c41997d5.js";import{g as n}from"./p-ffd41e25.js";import{d as h,p as l}from"./p-996c1ac5.js";import{s as c}from"./p-c4ddb206.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-c1cf3ebc.js";import"./p-8c6d9b5a.js";const d=class{constructor(e){t(this,e),this.calciteInternalDropdownItemChange=i(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((t=>t.selectionMode=this.selectionMode))},this.mutationObserver=o("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var t;this.updateItems(),null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}render(){const t=this.groupTitle?e("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?e("div",{class:"dropdown-separator",role:"separator"}):null;return e(s,{key:"c1b662afcbb612d775cea66edb949d71f5f63167","aria-label":this.groupTitle,role:"group"},e("div",{key:"cdfdb0919b1b6006f69f7fbcda0c16c2beefec5e",class:{[r.container]:!0,[`${r.container}--${this.scale}`]:!0}},i,t,e("slot",{key:"166c8236f3315d2f038f61b0619270d2bd9b344a"})))}updateActiveItemOnChange(t){this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};d.style=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";const p=class{constructor(e){t(this,e),this.idsFound=i(this,"idsFound",7),this.noLayersFound=i(this,"noLayersFound",7),this.layerSelectionChange=i(this,"layerSelectionChange",7),this.defaultLayerHonored=!1,this.appearance="transparent",this.defaultLayerId="",this.display="inline-block",this.enabledLayerIds=[],this.enabledTableIds=[],this.height=void 0,this.isMobile=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=void 0,this.showSingleLayerAsLabel=!1,this.type="select",this._hasMultipleLayers=!0,this._hasValidLayers=!0,this._isDropdownOpen=void 0,this.ids=[],this.selectedName="",this._translations=void 0}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async componentWillLoad(){await this._getTranslations(),await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){const t="map-layer-picker";let i=this.height>0?{height:`${this.height.toString()}px`}:{};return i=Object.assign(Object.assign({},i),{display:this.display}),e(s,{key:"a96e93924530d926c5e10dd2f7212f3f8c1cbe3c"},e("div",{key:"4b96a73e43e86c31291e4ac60eb15976b01de6a2",class:"map-layer-picker-container",style:i},e("div",{key:"e75c61d8ce0853814dd3903b9e1952cc613b6fbb",class:"map-layer-picker",style:i},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(t):"select"===this.type?this._getSelect(t):this._getDropdown(t):this._getInvalidPlaceholder())))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return e("div",null,e("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},e("div",{slot:"message"},this._translations.noLayersFound)),e("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},e("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){return e("div",{class:"layer-picker-label-container cursor-default"},e("calcite-icon",{icon:"layers",scale:"s"}),e("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(t){return e("calcite-select",{id:t,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(t){return e("calcite-combobox",{clearDisabled:!0,id:t,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(t){return e("calcite-dropdown",{class:"layer-picker-dropdown",onCalciteDropdownBeforeClose:()=>this._isDropdownOpen=!1,onCalciteDropdownBeforeOpen:()=>this._isDropdownOpen=!0},this.isMobile?this._getDropdownButton():this._getActionDropdownButton(t),e("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getActionDropdownButton(t){return e("calcite-action",{id:t,slot:"trigger",text:""},this._getDropdownButton())}_getDropdownButton(){return e("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:this.isMobile?"":"max-width-350",iconEnd:this._isDropdownOpen?"chevron-up":"chevron-down",iconStart:"layers",kind:"neutral",slot:this.isMobile?"trigger":"",width:"full"},e("div",null,this.selectedName))}_getMapLayerOptions(){return this.ids.reduce(((t,i)=>(this._validLayer(i)?t.push(this._getItem(i,"layer")):this._validTable(i)&&t.push(this._getItem(i,"table")),t)),[])}_getItem(t,i){const s="layer"===i?this._layerNameHash[t]:this._tableNameHash[t],a=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,r=this.selectedIds.indexOf(t)>-1;return"combobox"===this.type?e("calcite-combobox-item",{disabled:a,selected:r,textLabel:o,value:t}):"select"===this.type?e("calcite-option",{disabled:a,label:o,selected:r,value:t}):e("calcite-dropdown-group",{class:a?"disabled":"",selectionMode:a?"none":"single"},e("calcite-dropdown-item",{onClick:a?void 0:()=>{this._setSelectedLayer(t)},selected:r},o))}_setSelectedLayer(t){let i;this.defaultLayerId&&!this.defaultLayerHonored&&(i=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==i,t=this.defaultLayerHonored?this.defaultLayerId:t),i=i||this._getLayerFromHash(t),this.selectedName=null==i?void 0:i.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds)}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),i=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>{var i;return!((null===(i=this.enabledLayerIds)||void 0===i?void 0:i.length)>0)||this.enabledLayerIds.reverse().indexOf(t)>-1})),...i.reverse().filter((t=>{var i;return!((null===(i=this.enabledTableIds)||void 0===i?void 0:i.length)>0)||this.enabledTableIds.reverse().indexOf(t)>-1}))],this.idsFound.emit({layerIds:t,tableIds:i})}}_getEditableIds(t){return Object.keys(t).reduce(((i,e)=>(t[e].supportsUpdate&&i.push(e),i)),[])}async _initLayerTableHash(){this._layerNameHash=await h(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await l(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){var i;const e=null===(i=this._layerNameHash[t])||void 0===i?void 0:i.name;return e&&Object.keys(c.managedLayers).indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){var i;const e=null===(i=this._tableNameHash[t])||void 0===i?void 0:i.name,s=e&&this.showTables;return s?c.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):s}_layerSelectionChange(){const t=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(t)!==JSON.stringify([""])&&(this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";export{d as calcite_dropdown_group,p as map_layer_picker}
6
+ import{r as t,c as i,h as e,H as s,g as a}from"./p-fa1ceaf9.js";import{c as o}from"./p-e6c9e6af.js";import{C as r}from"./p-c41997d5.js";import{g as n}from"./p-c0bf1d9f.js";import{d as h,p as l}from"./p-996c1ac5.js";import{s as c}from"./p-c4ddb206.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-c1cf3ebc.js";import"./p-8c6d9b5a.js";const d=class{constructor(e){t(this,e),this.calciteInternalDropdownItemChange=i(this,"calciteInternalDropdownItemChange",6),this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach((t=>t.selectionMode=this.selectionMode))},this.mutationObserver=o("mutation",(()=>this.updateItems())),this.groupTitle=void 0,this.scale="m",this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){var t;this.updateItems(),null===(t=this.mutationObserver)||void 0===t||t.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){var t;null===(t=this.mutationObserver)||void 0===t||t.disconnect()}render(){const t=this.groupTitle?e("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,i=this.groupPosition>0?e("div",{class:"dropdown-separator",role:"separator"}):null;return e(s,{key:"c1b662afcbb612d775cea66edb949d71f5f63167","aria-label":this.groupTitle,role:"group"},e("div",{key:"cdfdb0919b1b6006f69f7fbcda0c16c2beefec5e",class:{[r.container]:!0,[`${r.container}--${this.scale}`]:!0}},i,t,e("slot",{key:"166c8236f3315d2f038f61b0619270d2bd9b344a"})))}updateActiveItemOnChange(t){this.requestedDropdownGroup=t.detail.requestedDropdownGroup,this.requestedDropdownItem=t.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{selectionMode:["handlePropsChange"]}}};d.style=":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}";const p=class{constructor(e){t(this,e),this.idsFound=i(this,"idsFound",7),this.noLayersFound=i(this,"noLayersFound",7),this.layerSelectionChange=i(this,"layerSelectionChange",7),this.defaultLayerHonored=!1,this.appearance="transparent",this.defaultLayerId="",this.display="inline-block",this.enabledLayerIds=[],this.enabledTableIds=[],this.height=void 0,this.isMobile=void 0,this.mapView=void 0,this.onlyShowUpdatableLayers=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=void 0,this.showSingleLayerAsLabel=!1,this.type="select",this._hasMultipleLayers=!0,this._hasValidLayers=!0,this._isDropdownOpen=void 0,this.ids=[],this.selectedName="",this._translations=void 0}async mapViewWatchHandler(){await this._setLayers(),this.ids.length>0?(this._hasValidLayers=!0,this._hasMultipleLayers=this.ids.length>1,this._setSelectedLayer(this.ids[0])):(this._hasValidLayers=!1,this.noLayersFound.emit())}async componentWillLoad(){await this._getTranslations(),await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){const t="map-layer-picker";let i=this.height>0?{height:`${this.height.toString()}px`}:{};return i=Object.assign(Object.assign({},i),{display:this.display}),e(s,{key:"a96e93924530d926c5e10dd2f7212f3f8c1cbe3c"},e("div",{key:"4b96a73e43e86c31291e4ac60eb15976b01de6a2",class:"map-layer-picker-container",style:i},e("div",{key:"e75c61d8ce0853814dd3903b9e1952cc613b6fbb",class:"map-layer-picker",style:i},this._hasValidLayers?!this._hasMultipleLayers&&this.showSingleLayerAsLabel?this._getSingleLayerPlaceholder():"combobox"===this.type?this._getCombobox(t):"select"===this.type?this._getSelect(t):this._getDropdown(t):this._getInvalidPlaceholder())))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const t=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=t:"dropdown"===this.type&&(this.selectedName=Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t].name:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t].name:"")}}_getInvalidPlaceholder(){return e("div",null,e("calcite-notice",{class:"height-100",icon:"exclamation-mark-triangle",id:"no-valid-layers",kind:"danger",open:!0},e("div",{slot:"message"},this._translations.noLayersFound)),e("calcite-tooltip",{label:this._translations.enableEditUpdate,placement:"bottom","reference-element":"no-valid-layers"},e("span",null,this._translations.enableEditUpdate)))}_getSingleLayerPlaceholder(){return e("div",{class:"layer-picker-label-container cursor-default"},e("calcite-icon",{icon:"layers",scale:"s"}),e("calcite-label",{class:"no-bottom-margin padding-start-1"},this.selectedName))}_getSelect(t){return e("calcite-select",{id:t,label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:t=>{this._layerElement=t},scale:this.scale},this._getMapLayerOptions())}_getCombobox(t){return e("calcite-combobox",{clearDisabled:!0,id:t,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:t=>{this._layerElement=t},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(t){return e("calcite-dropdown",{class:"layer-picker-dropdown",onCalciteDropdownBeforeClose:()=>this._isDropdownOpen=!1,onCalciteDropdownBeforeOpen:()=>this._isDropdownOpen=!0},this.isMobile?this._getDropdownButton():this._getActionDropdownButton(t),e("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getActionDropdownButton(t){return e("calcite-action",{id:t,slot:"trigger",text:""},this._getDropdownButton())}_getDropdownButton(){return e("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:this.isMobile?"":"max-width-350",iconEnd:this._isDropdownOpen?"chevron-up":"chevron-down",iconStart:"layers",kind:"neutral",slot:this.isMobile?"trigger":"",width:"full"},e("div",null,this.selectedName))}_getMapLayerOptions(){return this.ids.reduce(((t,i)=>(this._validLayer(i)?t.push(this._getItem(i,"layer")):this._validTable(i)&&t.push(this._getItem(i,"table")),t)),[])}_getItem(t,i){const s="layer"===i?this._layerNameHash[t]:this._tableNameHash[t],a=!!this.onlyShowUpdatableLayers&&!s.supportsUpdate,o=s.name,r=this.selectedIds.indexOf(t)>-1;return"combobox"===this.type?e("calcite-combobox-item",{disabled:a,selected:r,textLabel:o,value:t}):"select"===this.type?e("calcite-option",{disabled:a,label:o,selected:r,value:t}):e("calcite-dropdown-group",{class:a?"disabled":"",selectionMode:a?"none":"single"},e("calcite-dropdown-item",{onClick:a?void 0:()=>{this._setSelectedLayer(t)},selected:r},o))}_setSelectedLayer(t){let i;this.defaultLayerId&&!this.defaultLayerHonored&&(i=this._getLayerFromHash(this.defaultLayerId),this.defaultLayerHonored=void 0!==i,t=this.defaultLayerHonored?this.defaultLayerId:t),i=i||this._getLayerFromHash(t),this.selectedName=null==i?void 0:i.name,this.selectedIds=[t],this.layerSelectionChange.emit(this.selectedIds)}_getLayerFromHash(t){return Object.keys(this._layerNameHash).indexOf(t)>-1?this._layerNameHash[t]:Object.keys(this._tableNameHash).indexOf(t)>-1?this._tableNameHash[t]:void 0}async _setLayers(){if(this.mapView){await this._initLayerTableHash();const t=this.onlyShowUpdatableLayers?this._getEditableIds(this._layerNameHash):Object.keys(this._layerNameHash),i=this.showTables?this.onlyShowUpdatableLayers?this._getEditableIds(this._tableNameHash):Object.keys(this._tableNameHash):[];this.ids=[...t.reverse().filter((t=>{var i;return!((null===(i=this.enabledLayerIds)||void 0===i?void 0:i.length)>0)||this.enabledLayerIds.reverse().indexOf(t)>-1})),...i.reverse().filter((t=>{var i;return!((null===(i=this.enabledTableIds)||void 0===i?void 0:i.length)>0)||this.enabledTableIds.reverse().indexOf(t)>-1}))],this.idsFound.emit({layerIds:t,tableIds:i})}}_getEditableIds(t){return Object.keys(t).reduce(((i,e)=>(t[e].supportsUpdate&&i.push(e),i)),[])}async _initLayerTableHash(){this._layerNameHash=await h(this.mapView,this.onlyShowUpdatableLayers),this._tableNameHash=this.showTables?await l(this.mapView,this.onlyShowUpdatableLayers):{}}_validLayer(t){var i;const e=null===(i=this._layerNameHash[t])||void 0===i?void 0:i.name;return e&&Object.keys(c.managedLayers).indexOf(e)<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)}_validTable(t){var i;const e=null===(i=this._tableNameHash[t])||void 0===i?void 0:i.name,s=e&&this.showTables;return s?c.managedTables.indexOf(e)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(t)>-1):s}_layerSelectionChange(){const t=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(t)!==JSON.stringify([""])&&(this.selectedIds=t,this.layerSelectionChange.emit(this.selectedIds))}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};p.style=":host{display:block}.map-layer-picker-container{width:100%;align-items:center}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}.height-100{height:100%}.disabled{cursor:default !important;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-opacity-disabled);pointer-events:none}.no-bottom-margin{--calcite-label-margin-bottom:0px}.layer-picker-label-container{align-items:center;display:inline-flex;height:100%;padding-inline-start:1rem;padding-inline-end:1rem}.padding-start-1{padding-inline-start:1rem}.cursor-default{cursor:default}";export{d as calcite_dropdown_group,p as map_layer_picker}
@@ -3,7 +3,7 @@
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,c as i,h as e,H as s,g as a,a as n}from"./p-fa1ceaf9.js";import{c as o,d as l}from"./p-27c68097.js";import{f as r,g as c,t as h}from"./p-67b26725.js";import{c as d,d as p,u,I as v}from"./p-9c6c056a.js";import{c as m,d as f,g,n as b,a as x,b as y}from"./p-813d004f.js";import{u as w,c as _,d as k,s as $}from"./p-44bfa87d.js";import{H as C}from"./p-cc388a08.js";import{c as D,s as z,a as E}from"./p-8ed6ce4d.js";import{o as I}from"./p-ba569f8b.js";import{d as L,g as P,a as S,b as A,s as F,c as R,e as j,f as O,i as M}from"./p-df0a1d4b.js";import{f as N,c as T,d as B,r as W,a as H,F as U}from"./p-5eb6219c.js";import{s as V,c as q,d as J,H as K}from"./p-716a0878.js";import{n as Z}from"./p-f50a294b.js";import{c as Y,d as G}from"./p-6127f49e.js";import{c as X,d as Q,a as tt}from"./p-97f0e1b6.js";import{g as it}from"./p-b85be429.js";import{g as et}from"./p-e6e50975.js";import{V as st}from"./p-5f1fdaf9.js";import{l as at}from"./p-65581d83.js";import{g as nt}from"./p-427b4593.js";import{g as ot}from"./p-a9a72626.js";import"./p-e6c9e6af.js";import"./p-db50226e.js";import"./p-b64cc55e.js";import"./p-c8d3207e.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";
6
+ import{r as t,c as i,h as e,H as s,g as a,a as n}from"./p-fa1ceaf9.js";import{c as o,d as l}from"./p-27c68097.js";import{f as r,g as c,t as h}from"./p-67b26725.js";import{c as d,d as p,u,I as v}from"./p-9c6c056a.js";import{c as m,d as f,g,n as b,a as x,b as y}from"./p-813d004f.js";import{u as w,c as _,d as k,s as $}from"./p-44bfa87d.js";import{H as C}from"./p-cc388a08.js";import{c as D,s as z,a as E}from"./p-8ed6ce4d.js";import{o as I}from"./p-ba569f8b.js";import{d as L,g as P,a as S,b as A,s as F,c as R,e as j,f as O,i as M}from"./p-df0a1d4b.js";import{f as N,c as T,d as B,r as W,a as H,F as U}from"./p-5eb6219c.js";import{s as V,c as q,d as J,H as K}from"./p-716a0878.js";import{n as Z}from"./p-f50a294b.js";import{c as Y,d as G}from"./p-6127f49e.js";import{c as X,d as Q,a as tt}from"./p-97f0e1b6.js";import{g as it}from"./p-b85be429.js";import{g as et}from"./p-e6e50975.js";import{V as st}from"./p-5f1fdaf9.js";import{l as at}from"./p-4cd4cb85.js";import{g as nt}from"./p-1c64264d.js";import{g as ot}from"./p-a9a72626.js";import"./p-e6c9e6af.js";import"./p-db50226e.js";import"./p-b64cc55e.js";import"./p-c8d3207e.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-design-system/blob/main/LICENSE.md for details.
@@ -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{l}from"./p-65581d83.js";import{c as n}from"./p-8c6d9b5a.js";async function o(n,o,i){const[u]=await l(["esri/layers/effects/jsonUtils"]),{toJSON:v,fromJSON:d}=u,t=null==o?void 0:o.layer;if(!n)return(null==t?void 0:t.effect)?t.effect:(null==t?void 0:t.featureEffect)?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:null;const e=v(n);let r;r=t.featureEffect?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:t.effect;const a=r?v(r):null;if(!a)return d(e);let s=[...a];return e&&e.forEach((l=>{s.forEach((n=>{const{value:o}=n;if(o)o.forEach(((i,u)=>{i.type===l.type?o[u]=l:!n.value.find((l=>l.type===e[0].type))&&(n.value=[...n.value,...e])}));else{const o=!s.find((l=>l.type===n.type));!s.find((n=>n.type===l.type))&&(s=[...s,l]),o&&(s=[...s,n])}}))})),d(s)}const i=n({data:{},relationshipRampExpandStates:{}}),u=i.state,v=i;async function d(l,n,o){var i,u,v,d,t,e,r,a,s;try{const c="group"===(null===(i=null==n?void 0:n.layer)||void 0===i?void 0:i.type),f=null===(v=null===(u=null==n?void 0:n.layer)||void 0===u?void 0:u.layers)||void 0===v?void 0:v.some((l=>l.visible)),$=null===(t=null===(d=null==n?void 0:n.layer)||void 0===d?void 0:d.layers)||void 0===t?void 0:t.every((l=>!(null==l?void 0:l.legendEnabled)));await o.whenOnce((()=>"ready"===(null==l?void 0:l.state))),!c||c&&f?c&&$?await o.whenOnce((()=>{var l;return null===(l=null==n?void 0:n.layer)||void 0===l?void 0:l.loaded})):await o.whenOnce((()=>null==n?void 0:n.ready)):await o.whenOnce((()=>null==n?void 0:n.legendElements));const y=null===(e=null==n?void 0:n.legendElements)||void 0===e?void 0:e[0],m=new Map,p=n.layer,N=await l.view.whenLayerView(p);await o.whenOnce((()=>!1===(null==N?void 0:N.updating)));const O=null===(r=p.renderer)||void 0===r?void 0:r.field;return void 0!==y&&(null===(a=null==y?void 0:y.infos)||void 0===a||a.forEach((l=>{var n;if("symbol-table"===l.type){const n=[];l.infos.forEach((l=>{n.push({count:null,selected:!1,legendElementInfo:l})})),m.set(l.title,{count:null,selected:!1,legendElementInfo:l,nestedInfos:n})}else m.set(null!==(n=l.label)&&void 0!==n?n:p.id,{count:null,selected:!1,legendElementInfo:l})}))),Promise.resolve({activeLayerInfo:n,title:null===(s=null==N?void 0:N.layer)||void 0===s?void 0:s.title,categories:m,field:O,queryExpressions:[],totalCount:null,fLayerView:N,legendElement:y})}catch(l){return Promise.resolve(null)}}async function t(l,n){const o={},i=[];l.activeLayerInfos.forEach(function(l,n,o){return i=>{var u;const v=null===(u=null==i?void 0:i.layer)||void 0===u?void 0:u.type;if("feature"===v||"group"===v){const u=d(n,i,o).then((l=>l));u&&l.push(u);const v=i=>{const u=d(n,i,o).then((l=>l));u&&l.push(u)};i.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{v(l)}))}))}))}}}(i,l,n));try{return(await Promise.all(i)).forEach((l=>{var n,i;return o[null===(i=null===(n=null==l?void 0:l.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===i?void 0:i.id]=l})),Promise.resolve(o)}catch(l){return Promise.reject(null)}}function e(l){return Array.from(l).map((l=>l[1]))}function r(l,n,o,i,u){var v,d,t;return i?null===(v=null==i?void 0:i.nestedInfos)||void 0===v?void 0:v[u]:null===(d=null==l?void 0:l.categories)||void 0===d?void 0:d.get(null!==(t=null==o?void 0:o.label)&&void 0!==t?t:null==n?void 0:n.id)}function a(l){var n;return null===(n=null==u?void 0:u.data)||void 0===n?void 0:n[null==l?void 0:l.id]}async function s(n,i,u,v,d){var t,e;const[r,a]=await l(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]),{queryExpressions:s,fLayerView:$}=n;!function(l,n,o,i){var u,v,d,t;const{field:e,legendElement:r,categories:a,fLayerView:s}=l,$=null==l?void 0:l.queryExpressions;i&&Array.from(l.categories).map((l=>l[1])).forEach((l=>{var n,o;(null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected)))&&(null===(o=l.nestedInfos)||void 0===o||o.forEach((l=>{const n=e?`${e} = '${l.legendElementInfo.value}'`:null,o=n?$.indexOf(n):-1;n&&-1!==o&&$.splice(o,1)})))}));const m=null==r?void 0:r.infos,p=y(s);let N=p?c(n,s):f(n,e,o,r,m,"");const O=a?i?null===(v=null===(u=a.get(i.title))||void 0===u?void 0:u.nestedInfos)||void 0===v?void 0:v[o]:a.get(null!==(d=n.label)&&void 0!==d?d:null===(t=null==s?void 0:s.layer)||void 0===t?void 0:t.id):null;O&&(O.selected=!(null==O?void 0:O.selected));const A=m&&1===m.length,w=$.indexOf(N);if(p){const l=$.indexOf(N);0===$.length||-1===l?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]?$[0]="1=0":$&&1===$.length||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]?$[0]=null:$.splice(l,1),$.join(" OR ")}else 0===$.length||-1===w?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]&&!A?$[0]="1=0":$&&1===$.length&&!A||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]&&!A?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]&&!A?$[0]=null:$.splice(w,1);if(i){const n=[];Array.from(l.categories).map((l=>l[1])).forEach((l=>{var o,i;(null===(o=l.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=l.nestedInfos)||void 0===i||i.forEach((l=>{e&&`${e} = '${l.legendElementInfo.value}'`&&n.push(`${e} = '${l.legendElementInfo.value}'`)})))})),n.forEach((l=>{-1===$.indexOf(l)&&$.push(l)}))}}(n,i,u,d);const m=s.every((l=>l&&l.includes("<>")))?" AND ":" OR ",p=s.join(m),N=null!==(e=null===(t=null==$?void 0:$.filter)||void 0===t?void 0:t.timeExtent)&&void 0!==e?e:null,{type:O}=v;if("filter"===O)$.filter=new r({where:p,timeExtent:N});else if(v.effect){const{includedEffect:l,excludedEffect:n}=v.effect,i=await o(n,$,"excludedEffect"),u=await o(l,$,"includedEffect");$.featureEffect=new a({filter:new r({where:p,timeExtent:N}),includedEffect:u,excludedEffect:i})}return Promise.resolve()}function c(l,n){const o=n?n.layer.renderer.authoringInfo:null,i=o?o.fields:null,u=[];if(!i)return"";if(l.hasOwnProperty("value"))return i.forEach((n=>{l.value!==n&&u.push(`(${l.value} > ${n} OR (${n} IS NULL AND ${l.value} <> 0 AND ${l.value} IS NOT NULL))`)})),u.join(" AND ");{const l=[];i.forEach((n=>{l.push(`${n} = 0`)}));const n=[];if(i.length>2){i.forEach((l=>{i.forEach((o=>{if(l===o)return;const u=[];i.forEach((n=>{l!==n&&o!==n&&u.push(`${l} = ${o} AND (${l} > ${n} OR ${l} >= ${n})`)})),n.push(`(${u.join(" AND ")})`)}))}));const o=[];return i.forEach((l=>{o.push(`${l} IS NULL`)})),`(${l.join(" AND ")}) OR (${n.join(" OR ")}) OR (${o.join(" AND ")})`}{const n=[];i.forEach((o=>{i.forEach((i=>{o!==i&&(n.push(`${o} = ${i}`),n.push(`(${l.join(" AND ")})`))}))}));const o=[];return i.forEach((l=>{i.forEach((n=>{l!==n&&o.push(`(${l} = 0 AND ${n} IS NULL) OR (${l} IS NULL AND ${n} IS NULL)`)}))})),`(${n.join(" OR ")}) OR (${o.join(" OR ")})`}}}function f(l,n,o,i,u,v){const{value:d}=l;if("symbol-table"===(null==i?void 0:i.type)){if(!l.hasOwnProperty("value")||Array.isArray(l.value)&&1===(null==u?void 0:u.length)){if((null==u?void 0:u[0].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[0].value)&&(null==u?void 0:u[(null==u?void 0:u.length)-2])&&(null==u?void 0:u[(null==u?void 0:u.length)-2].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[(null==u?void 0:u.length)-2].value))return v?`((${n}/${v}) > ${null==u?void 0:u[0].value[1]}) OR ((${n}/${v}) < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]}) OR ${v} = 0 OR ${v} IS NULL`:`${n} > ${null==u?void 0:u[0].value[1]} OR ${n} < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]} OR ${n} IS NULL`;if(1===(null==u?void 0:u.length))return"1=0";{const l=[];null==u||u.forEach((o=>{if(null==o?void 0:o.value){const{value:i}=o,u=-1!==i.indexOf("'")?i.split("'").join("''"):null,v=u?`${n} <> '${u}'`:isNaN(i)||"string"==typeof i&&!i.trim()?`${n} <> '${i}'`:`${n} <> ${i} AND ${n} <> '${i}'`;l.push(v)}}));const o=l.join(" AND ");return n&&o?`${o} OR ${n} IS NULL`:""}}{const i=-1!==d.indexOf("'")?d.split("'").join("''"):null,t=Array.isArray(l.value),e=(null==u?void 0:u.length)-1===o,r=!(null==u?void 0:u[(null==u?void 0:u.length)-1].hasOwnProperty("value")),a=o===(null==u?void 0:u.length)-2;return t?v?e||r&&a?`(${n}/${v}) >= ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:`(${n}/${v}) > ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:e||r&&a?`${n} >= ${d[0]} AND ${n} <= ${d[1]}`:`${n} > ${d[0]} AND ${n} <= ${d[1]}`:1===(null==u?void 0:u.length)&&n?isNaN(d)||!d.trim().length?`${n} <> '${d}'`:`${n} <> ${d} OR ${n} <> '${d}'`:i?`${n} = '${i}'`:isNaN(d)||!d.trim().length?`${n} = '${d}'`:`${n} = ${d} OR ${n} = '${d}'`}}return""}function $(l){return Array.isArray(l)?l.every((l=>!l.selected)):l&&Array.from(l.categories.entries()).every((l=>!l[1].selected))&&"1=0"!==l.queryExpressions[0]}function y(l){var n,o,i;return"predominance"===(null===(i=null===(o=null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.renderer)||void 0===o?void 0:o.authoringInfo)||void 0===i?void 0:i.type)}function m(l){var n;return"relationship-ramp"===(null===(n=null==l?void 0:l.legendElements[1])||void 0===n?void 0:n.type)}function p(l,n,o){var i,u,v,d,t,e,r,a,s,c,f,$,m,p,N,O,A,w,E;const b=l.layer,R=null===(i=null==b?void 0:b.renderer)||void 0===i?void 0:i.field,L=null==n?void 0:n.type,D=null==l?void 0:l.layerView,I=null===(v=null===(u=null==D?void 0:D.layer)||void 0===u?void 0:u.renderer)||void 0===v?void 0:v.classBreakInfos,x=(null===(t=null===(d=null==D?void 0:D.layer)||void 0===d?void 0:d.renderer)||void 0===t?void 0:t.uniqueValueInfos)&&R,g="size-ramp"===L,h="color-ramp"===L,P="opacity-ramp"===L,S="heatmap-ramp"===L,U=D&&I&&I.length>1,z=null===(a=null===(r=null===(e=null==D?void 0:D.layer)||void 0===e?void 0:e.renderer)||void 0===r?void 0:r.authoringInfo)||void 0===a?void 0:a.type,F="class-breaks-color"===z,k="class-breaks-size"===z,q=1===(null===(s=null==n?void 0:n.infos)||void 0===s?void 0:s.length)&&!R,V="relationship"===z&&"size-ramp"!==(null==n?void 0:n.type)&&"symbol-table"!==(null==n?void 0:n.type),C="feature"===(null===(c=null==l?void 0:l.layer)||void 0===c?void 0:c.type),J=C&&R&&!h&&!g&&U,T=!(!C||!R||h||g||U),M=!!(T||y(D)&&!g||F&&R||k&&R||q&&!R&&null!==R||V||x),B=(null===(f=null==l?void 0:l.layer)||void 0===f?void 0:f.featureReduction)&&"size-ramp"===(null===(m=null===($=null==l?void 0:l.legendElements)||void 0===$?void 0:$[o])||void 0===m?void 0:m.type),G="symbol-table"===(null==n?void 0:n.type)&&1===(null===(p=null==n?void 0:n.infos)||void 0===p?void 0:p.length),H=!(null==l?void 0:l.legendElements.every((l=>"color-ramp"!==l.type))),K=!(null==l?void 0:l.legendElements.every((l=>"size-ramp"!==l.type))),Q=G&&H,W=G&&K,X=null===(N=null==n?void 0:n.infos)||void 0===N?void 0:N.every((l=>"number"==typeof l.value)),Y="symbol-table"===(null===(A=null===(O=null==l?void 0:l.legendElements)||void 0===O?void 0:O[0])||void 0===A?void 0:A.type)&&"color-ramp"===(null===(E=null===(w=null==l?void 0:l.legendElements)||void 0===w?void 0:w[1])||void 0===E?void 0:E.type),Z="dot-density"===z,_=j(null==l?void 0:l.layer,R);return!(!C||B||P||S||Q||W||X||Y||Z||!_)&&(I?J||M:T||M)}function N(l){var n,o,i,u,v;return l.queryExpressions=[],(null===(o=null===(n=null==l?void 0:l.fLayerView)||void 0===n?void 0:n.filter)||void 0===o?void 0:o.where)&&(l.fLayerView.filter.where=""),(null===(v=null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.featureEffect)||void 0===u?void 0:u.filter)||void 0===v?void 0:v.where)&&(l.fLayerView.featureEffect=null),l.categories.forEach((l=>{l.selected=!1})),l}function O(l,n){var o,i,u,v,d,t,e,r,a,s,c;const f=l.categories.get(n);null===(o=null==f?void 0:f.nestedInfos)||void 0===o||o.forEach((n=>{const o=l.queryExpressions.indexOf(`${l.field} = '${n.legendElementInfo.value}'`);-1!==o&&l.queryExpressions.splice(o,1),n.selected=!1}));const $=[],y=Array.from(l.categories).map((l=>l[1]));y.forEach((n=>{var o,i;(null===(o=n.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=n.nestedInfos)||void 0===i||i.forEach((n=>{$.push(`${l.field} = '${n.legendElementInfo.value}'`)})))})),$.forEach((n=>{-1===l.queryExpressions.indexOf(n)&&l.queryExpressions.push(n)}));let m=l.queryExpressions.join(" OR ");const p=y.every((l=>{var n;return null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected))}));return p?((null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.filter)||void 0===u?void 0:u.where)&&(l.fLayerView.filter.where=""),(null===(t=null===(d=null===(v=null==l?void 0:l.fLayerView)||void 0===v?void 0:v.featureEffect)||void 0===d?void 0:d.filter)||void 0===t?void 0:t.where)&&(l.fLayerView.featureEffect=null),l.queryExpressions=[]):((null===(r=null===(e=null==l?void 0:l.fLayerView)||void 0===e?void 0:e.filter)||void 0===r?void 0:r.where)&&(l.fLayerView.filter.where=m),(null===(c=null===(s=null===(a=null==l?void 0:l.fLayerView)||void 0===a?void 0:a.featureEffect)||void 0===s?void 0:s.filter)||void 0===c?void 0:c.where)&&(l.fLayerView.featureEffect.filter.where=m)),l}async function A(l,n,o){var i,u;const v=l.fLayerView.createQuery();if(o)if(o.nestedInfos.every((l=>!l.selected))){const n=o.nestedInfos.map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=o.nestedInfos.filter((l=>l.selected)).map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=l.queryExpressions.join(" OR ");v.where=n}try{const{extent:o}=await(null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.layer)||void 0===u?void 0:u.queryExtent(v));await n.goTo(o)}catch(l){}}function w(l){return l.map((l=>null==l?void 0:l.count)).reduce(((l,n)=>l+n))}function E(l){return l.map((l=>{var n;return null===(n=null==l?void 0:l.nestedInfos)||void 0===n?void 0:n.map((l=>l.count)).reduce(((l,n)=>l+n))})).reduce(((l,n)=>l+n))}async function b(l,n,o,i,u,v,d,t){var e,r,a;if(!n)return;if(!j(null==n?void 0:n.layer,o))return;const s="feature"===(null===(e=null==n?void 0:n.layer)||void 0===e?void 0:e.type)?n.createQuery():null,$=y(n)?c(i,n):i.type?f(d,o,t,i,i.infos):f(i,o,u,v,v.infos);s&&$&&(s.where="1=0"===$?"1=1":$,s.geometry=l);try{const l=s?await n.queryFeatureCount(s):null;return Promise.resolve({[null!==(r=i.label)&&void 0!==r?r:null===(a=null==n?void 0:n.layer)||void 0===a?void 0:a.id]:l})}catch(l){console.error("FAILURE AT 'getInfoCount': ",l)}return Promise.resolve(null)}async function R(l,n){let o=Object.assign({},n);const{activeLayerInfos:i}=l;let u={};const v={};i.forEach((async o=>{var i,u,d,t;const e=o.legendElements[0],r=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,a=null===(d=o.layer.renderer)||void 0===d?void 0:d.field,s=[];v[o.layer.id]=[],null===(t=null==e?void 0:e.infos)||void 0===t||t.forEach(((n,i)=>{var u;const d=null===(u=e.infos)||void 0===u?void 0:u.every((l=>"symbol-table"===l.type));if(d){const u=[];n.infos.forEach(((o,v)=>{const d=b(l.view.extent,r,a,n,i,e,o,v);u.push(d)})),v[o.layer.id].push(u)}else s.push(b(l.view.extent,r,a,n,i,e)),v[o.layer.id]=s}));const c=o=>{var i,u,d,t;const e=[],r=o.legendElements[0],a=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,s=null===(d=o.layer.renderer)||void 0===d?void 0:d.field;null===(t=null==r?void 0:r.infos)||void 0===t||t.forEach(((n,o)=>e.push(b(l.view.extent,a,s,n,o,r)))),v[o.layer.id]=e};o.children.forEach((async l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{c(l)}))}))}))}));for(const l in v){let n=u[l];n||(n=u[l]={});const o=await Promise.all(v[l]);if(o.every((l=>Array.isArray(l)))){const i=await Promise.all(o.map((async l=>(await Promise.all(l)).map((l=>l&&Object.values(l)[0])))));n[l]=i,u[l]=Object.assign({},n[l])}else{const i={};o.forEach((l=>{if(!l)return;const n=Object.keys(l)[0];i[n]=l[n]})),l&&(n[l]=i),u[l]=Object.assign({},n[l])}}return i.forEach((l=>{var o;const i=n[l.layer.id],v=l.layer.id;null===(o=null==i?void 0:i.categories)||void 0===o||o.forEach(((n,o)=>{var d;const t=Array.from(null==i?void 0:i.categories).findIndex((l=>l[0]===o));if(null==n?void 0:n.nestedInfos)null==n||n.nestedInfos.forEach(((n,o)=>{var i,v,d;const e=null===(d=null===(v=null==u?void 0:u[null===(i=null==l?void 0:l.layer)||void 0===i?void 0:i.id])||void 0===v?void 0:v[t])||void 0===d?void 0:d[o];n.count=isNaN(e)?null:e}));else{const l=null===(d=null==u?void 0:u[v])||void 0===d?void 0:d[o];n.count=isNaN(l)?null:l}}));const d=l=>{var o;const i=l.layer.id,v=n[i];null===(o=null==v?void 0:v.categories)||void 0===o||o.forEach(((l,n)=>{var o;const v=null===(o=null==u?void 0:u[i])||void 0===o?void 0:o[n];l.count=v}))};l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{d(l)}))}))}))})),Promise.resolve(o)}function L(l,n){var o;return null===(o=null==l?void 0:l.nestedInfos)||void 0===o?void 0:o[n]}function D(l){return Array.from(l).map((l=>l[1])).every((l=>!!(null==l?void 0:l.nestedInfos)))}function I(l){var n,o,i,u;return!!(null===(u=null===(i=null===(o=null===(n=null==l?void 0:l.legendElements)||void 0===n?void 0:n[0])||void 0===o?void 0:o.infos)||void 0===i?void 0:i.every)||void 0===u?void 0:u.call(i,(l=>"symbol-table"===(null==l?void 0:l.type))))}function x(l,n){var o;return null===(o=null==l?void 0:l.categories)||void 0===o?void 0:o.get(null==n?void 0:n.title)}function g(l){const n="calcite-mode-",o=`${n}light`,i=`${n}dark`;return l.classList.contains(i)?i:o}function h(l){if(l.layerId&&l.intLegendLayerData){const n=l.layerId,o=l.intLegendLayerData,i=Object.assign(Object.assign({},u.data),{[n]:o});v.set("data",i)}}function P(n,i){const{type:u}=n;"filter"===u?function(l){var n,o;null===(o=null===(n=null==l?void 0:l.allLayerViews)||void 0===n?void 0:n.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})))||void 0===o||o.forEach((l=>{const n=S(l);l.filter=n,l.set("featureEffect",null)}))}(i):"effect"===u&&function(n,i){var u;null===(u=null==i?void 0:i.allLayerViews)||void 0===u||u.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})).forEach((async i=>{if((null==n?void 0:n.effect)&&i){const[u]=await l(["esri/layers/support/FeatureEffect"]),{includedEffect:v,excludedEffect:d}=n.effect,t=await o(d,i,"excludedEffect"),e=await o(v,i,"includedEffect"),r=S(i);i.featureEffect=new u({filter:r,includedEffect:e,excludedEffect:t}),i.set("filter",null)}}))}(n,i)}function S(l){var n;return(null==l?void 0:l.filter)||(null===(n=null==l?void 0:l.featureEffect)||void 0===n?void 0:n.filter)}function j(l,n){const o=null==l?void 0:l.fields,i=o&&o.map((l=>l.name));return!n||i&&i.includes(n)}function U(l){const n=[];return l.forEach((l=>z(l,n))),n}function z(l,n){n.push(l),l.children&&l.children.length>0&&l.children.forEach((l=>{z(l,n)}))}export{x as a,r as b,$ as c,R as d,t as e,U as f,g,P as h,u as i,d as j,s as k,a as l,I as m,m as n,O as o,N as p,o as q,e as r,v as s,D as t,h as u,p as v,E as w,w as x,L as y,A as z}
6
+ import{l}from"./p-4cd4cb85.js";import{c as n}from"./p-8c6d9b5a.js";async function o(n,o,i){const[u]=await l(["esri/layers/effects/jsonUtils"]),{toJSON:v,fromJSON:d}=u,t=null==o?void 0:o.layer;if(!n)return(null==t?void 0:t.effect)?t.effect:(null==t?void 0:t.featureEffect)?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:null;const e=v(n);let r;r=t.featureEffect?"includedEffect"===i?t.featureEffect.includedEffect:t.featureEffect.excludedEffect:t.effect;const a=r?v(r):null;if(!a)return d(e);let s=[...a];return e&&e.forEach((l=>{s.forEach((n=>{const{value:o}=n;if(o)o.forEach(((i,u)=>{i.type===l.type?o[u]=l:!n.value.find((l=>l.type===e[0].type))&&(n.value=[...n.value,...e])}));else{const o=!s.find((l=>l.type===n.type));!s.find((n=>n.type===l.type))&&(s=[...s,l]),o&&(s=[...s,n])}}))})),d(s)}const i=n({data:{},relationshipRampExpandStates:{}}),u=i.state,v=i;async function d(l,n,o){var i,u,v,d,t,e,r,a,s;try{const c="group"===(null===(i=null==n?void 0:n.layer)||void 0===i?void 0:i.type),f=null===(v=null===(u=null==n?void 0:n.layer)||void 0===u?void 0:u.layers)||void 0===v?void 0:v.some((l=>l.visible)),$=null===(t=null===(d=null==n?void 0:n.layer)||void 0===d?void 0:d.layers)||void 0===t?void 0:t.every((l=>!(null==l?void 0:l.legendEnabled)));await o.whenOnce((()=>"ready"===(null==l?void 0:l.state))),!c||c&&f?c&&$?await o.whenOnce((()=>{var l;return null===(l=null==n?void 0:n.layer)||void 0===l?void 0:l.loaded})):await o.whenOnce((()=>null==n?void 0:n.ready)):await o.whenOnce((()=>null==n?void 0:n.legendElements));const y=null===(e=null==n?void 0:n.legendElements)||void 0===e?void 0:e[0],m=new Map,p=n.layer,N=await l.view.whenLayerView(p);await o.whenOnce((()=>!1===(null==N?void 0:N.updating)));const O=null===(r=p.renderer)||void 0===r?void 0:r.field;return void 0!==y&&(null===(a=null==y?void 0:y.infos)||void 0===a||a.forEach((l=>{var n;if("symbol-table"===l.type){const n=[];l.infos.forEach((l=>{n.push({count:null,selected:!1,legendElementInfo:l})})),m.set(l.title,{count:null,selected:!1,legendElementInfo:l,nestedInfos:n})}else m.set(null!==(n=l.label)&&void 0!==n?n:p.id,{count:null,selected:!1,legendElementInfo:l})}))),Promise.resolve({activeLayerInfo:n,title:null===(s=null==N?void 0:N.layer)||void 0===s?void 0:s.title,categories:m,field:O,queryExpressions:[],totalCount:null,fLayerView:N,legendElement:y})}catch(l){return Promise.resolve(null)}}async function t(l,n){const o={},i=[];l.activeLayerInfos.forEach(function(l,n,o){return i=>{var u;const v=null===(u=null==i?void 0:i.layer)||void 0===u?void 0:u.type;if("feature"===v||"group"===v){const u=d(n,i,o).then((l=>l));u&&l.push(u);const v=i=>{const u=d(n,i,o).then((l=>l));u&&l.push(u)};i.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;v(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{v(l)}))}))}))}}}(i,l,n));try{return(await Promise.all(i)).forEach((l=>{var n,i;return o[null===(i=null===(n=null==l?void 0:l.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===i?void 0:i.id]=l})),Promise.resolve(o)}catch(l){return Promise.reject(null)}}function e(l){return Array.from(l).map((l=>l[1]))}function r(l,n,o,i,u){var v,d,t;return i?null===(v=null==i?void 0:i.nestedInfos)||void 0===v?void 0:v[u]:null===(d=null==l?void 0:l.categories)||void 0===d?void 0:d.get(null!==(t=null==o?void 0:o.label)&&void 0!==t?t:null==n?void 0:n.id)}function a(l){var n;return null===(n=null==u?void 0:u.data)||void 0===n?void 0:n[null==l?void 0:l.id]}async function s(n,i,u,v,d){var t,e;const[r,a]=await l(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]),{queryExpressions:s,fLayerView:$}=n;!function(l,n,o,i){var u,v,d,t;const{field:e,legendElement:r,categories:a,fLayerView:s}=l,$=null==l?void 0:l.queryExpressions;i&&Array.from(l.categories).map((l=>l[1])).forEach((l=>{var n,o;(null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected)))&&(null===(o=l.nestedInfos)||void 0===o||o.forEach((l=>{const n=e?`${e} = '${l.legendElementInfo.value}'`:null,o=n?$.indexOf(n):-1;n&&-1!==o&&$.splice(o,1)})))}));const m=null==r?void 0:r.infos,p=y(s);let N=p?c(n,s):f(n,e,o,r,m,"");const O=a?i?null===(v=null===(u=a.get(i.title))||void 0===u?void 0:u.nestedInfos)||void 0===v?void 0:v[o]:a.get(null!==(d=n.label)&&void 0!==d?d:null===(t=null==s?void 0:s.layer)||void 0===t?void 0:t.id):null;O&&(O.selected=!(null==O?void 0:O.selected));const A=m&&1===m.length,w=$.indexOf(N);if(p){const l=$.indexOf(N);0===$.length||-1===l?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]?$[0]="1=0":$&&1===$.length||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]?$[0]=null:$.splice(l,1),$.join(" OR ")}else 0===$.length||-1===w?($&&"1=0"===$[0]&&$.splice(0,1),$.push(N)):$&&1===$.length&&N===$[0]&&!A?$[0]="1=0":$&&1===$.length&&!A||$&&1===$.length&&N!==$[0]&&"1=0"===$[0]&&!A?$[0]=N:$&&1===$.length&&N===$[0]&&"1=0"===$[0]&&!A?$[0]=null:$.splice(w,1);if(i){const n=[];Array.from(l.categories).map((l=>l[1])).forEach((l=>{var o,i;(null===(o=l.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=l.nestedInfos)||void 0===i||i.forEach((l=>{e&&`${e} = '${l.legendElementInfo.value}'`&&n.push(`${e} = '${l.legendElementInfo.value}'`)})))})),n.forEach((l=>{-1===$.indexOf(l)&&$.push(l)}))}}(n,i,u,d);const m=s.every((l=>l&&l.includes("<>")))?" AND ":" OR ",p=s.join(m),N=null!==(e=null===(t=null==$?void 0:$.filter)||void 0===t?void 0:t.timeExtent)&&void 0!==e?e:null,{type:O}=v;if("filter"===O)$.filter=new r({where:p,timeExtent:N});else if(v.effect){const{includedEffect:l,excludedEffect:n}=v.effect,i=await o(n,$,"excludedEffect"),u=await o(l,$,"includedEffect");$.featureEffect=new a({filter:new r({where:p,timeExtent:N}),includedEffect:u,excludedEffect:i})}return Promise.resolve()}function c(l,n){const o=n?n.layer.renderer.authoringInfo:null,i=o?o.fields:null,u=[];if(!i)return"";if(l.hasOwnProperty("value"))return i.forEach((n=>{l.value!==n&&u.push(`(${l.value} > ${n} OR (${n} IS NULL AND ${l.value} <> 0 AND ${l.value} IS NOT NULL))`)})),u.join(" AND ");{const l=[];i.forEach((n=>{l.push(`${n} = 0`)}));const n=[];if(i.length>2){i.forEach((l=>{i.forEach((o=>{if(l===o)return;const u=[];i.forEach((n=>{l!==n&&o!==n&&u.push(`${l} = ${o} AND (${l} > ${n} OR ${l} >= ${n})`)})),n.push(`(${u.join(" AND ")})`)}))}));const o=[];return i.forEach((l=>{o.push(`${l} IS NULL`)})),`(${l.join(" AND ")}) OR (${n.join(" OR ")}) OR (${o.join(" AND ")})`}{const n=[];i.forEach((o=>{i.forEach((i=>{o!==i&&(n.push(`${o} = ${i}`),n.push(`(${l.join(" AND ")})`))}))}));const o=[];return i.forEach((l=>{i.forEach((n=>{l!==n&&o.push(`(${l} = 0 AND ${n} IS NULL) OR (${l} IS NULL AND ${n} IS NULL)`)}))})),`(${n.join(" OR ")}) OR (${o.join(" OR ")})`}}}function f(l,n,o,i,u,v){const{value:d}=l;if("symbol-table"===(null==i?void 0:i.type)){if(!l.hasOwnProperty("value")||Array.isArray(l.value)&&1===(null==u?void 0:u.length)){if((null==u?void 0:u[0].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[0].value)&&(null==u?void 0:u[(null==u?void 0:u.length)-2])&&(null==u?void 0:u[(null==u?void 0:u.length)-2].hasOwnProperty("value"))&&Array.isArray(null==u?void 0:u[(null==u?void 0:u.length)-2].value))return v?`((${n}/${v}) > ${null==u?void 0:u[0].value[1]}) OR ((${n}/${v}) < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]}) OR ${v} = 0 OR ${v} IS NULL`:`${n} > ${null==u?void 0:u[0].value[1]} OR ${n} < ${null==u?void 0:u[(null==u?void 0:u.length)-2].value[0]} OR ${n} IS NULL`;if(1===(null==u?void 0:u.length))return"1=0";{const l=[];null==u||u.forEach((o=>{if(null==o?void 0:o.value){const{value:i}=o,u=-1!==i.indexOf("'")?i.split("'").join("''"):null,v=u?`${n} <> '${u}'`:isNaN(i)||"string"==typeof i&&!i.trim()?`${n} <> '${i}'`:`${n} <> ${i} AND ${n} <> '${i}'`;l.push(v)}}));const o=l.join(" AND ");return n&&o?`${o} OR ${n} IS NULL`:""}}{const i=-1!==d.indexOf("'")?d.split("'").join("''"):null,t=Array.isArray(l.value),e=(null==u?void 0:u.length)-1===o,r=!(null==u?void 0:u[(null==u?void 0:u.length)-1].hasOwnProperty("value")),a=o===(null==u?void 0:u.length)-2;return t?v?e||r&&a?`(${n}/${v}) >= ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:`(${n}/${v}) > ${d[0]} AND (${n}/${v}) <= ${l.value[1]}`:e||r&&a?`${n} >= ${d[0]} AND ${n} <= ${d[1]}`:`${n} > ${d[0]} AND ${n} <= ${d[1]}`:1===(null==u?void 0:u.length)&&n?isNaN(d)||!d.trim().length?`${n} <> '${d}'`:`${n} <> ${d} OR ${n} <> '${d}'`:i?`${n} = '${i}'`:isNaN(d)||!d.trim().length?`${n} = '${d}'`:`${n} = ${d} OR ${n} = '${d}'`}}return""}function $(l){return Array.isArray(l)?l.every((l=>!l.selected)):l&&Array.from(l.categories.entries()).every((l=>!l[1].selected))&&"1=0"!==l.queryExpressions[0]}function y(l){var n,o,i;return"predominance"===(null===(i=null===(o=null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.renderer)||void 0===o?void 0:o.authoringInfo)||void 0===i?void 0:i.type)}function m(l){var n;return"relationship-ramp"===(null===(n=null==l?void 0:l.legendElements[1])||void 0===n?void 0:n.type)}function p(l,n,o){var i,u,v,d,t,e,r,a,s,c,f,$,m,p,N,O,A,w,E;const b=l.layer,R=null===(i=null==b?void 0:b.renderer)||void 0===i?void 0:i.field,L=null==n?void 0:n.type,D=null==l?void 0:l.layerView,I=null===(v=null===(u=null==D?void 0:D.layer)||void 0===u?void 0:u.renderer)||void 0===v?void 0:v.classBreakInfos,x=(null===(t=null===(d=null==D?void 0:D.layer)||void 0===d?void 0:d.renderer)||void 0===t?void 0:t.uniqueValueInfos)&&R,g="size-ramp"===L,h="color-ramp"===L,P="opacity-ramp"===L,S="heatmap-ramp"===L,U=D&&I&&I.length>1,z=null===(a=null===(r=null===(e=null==D?void 0:D.layer)||void 0===e?void 0:e.renderer)||void 0===r?void 0:r.authoringInfo)||void 0===a?void 0:a.type,F="class-breaks-color"===z,k="class-breaks-size"===z,q=1===(null===(s=null==n?void 0:n.infos)||void 0===s?void 0:s.length)&&!R,V="relationship"===z&&"size-ramp"!==(null==n?void 0:n.type)&&"symbol-table"!==(null==n?void 0:n.type),C="feature"===(null===(c=null==l?void 0:l.layer)||void 0===c?void 0:c.type),J=C&&R&&!h&&!g&&U,T=!(!C||!R||h||g||U),M=!!(T||y(D)&&!g||F&&R||k&&R||q&&!R&&null!==R||V||x),B=(null===(f=null==l?void 0:l.layer)||void 0===f?void 0:f.featureReduction)&&"size-ramp"===(null===(m=null===($=null==l?void 0:l.legendElements)||void 0===$?void 0:$[o])||void 0===m?void 0:m.type),G="symbol-table"===(null==n?void 0:n.type)&&1===(null===(p=null==n?void 0:n.infos)||void 0===p?void 0:p.length),H=!(null==l?void 0:l.legendElements.every((l=>"color-ramp"!==l.type))),K=!(null==l?void 0:l.legendElements.every((l=>"size-ramp"!==l.type))),Q=G&&H,W=G&&K,X=null===(N=null==n?void 0:n.infos)||void 0===N?void 0:N.every((l=>"number"==typeof l.value)),Y="symbol-table"===(null===(A=null===(O=null==l?void 0:l.legendElements)||void 0===O?void 0:O[0])||void 0===A?void 0:A.type)&&"color-ramp"===(null===(E=null===(w=null==l?void 0:l.legendElements)||void 0===w?void 0:w[1])||void 0===E?void 0:E.type),Z="dot-density"===z,_=j(null==l?void 0:l.layer,R);return!(!C||B||P||S||Q||W||X||Y||Z||!_)&&(I?J||M:T||M)}function N(l){var n,o,i,u,v;return l.queryExpressions=[],(null===(o=null===(n=null==l?void 0:l.fLayerView)||void 0===n?void 0:n.filter)||void 0===o?void 0:o.where)&&(l.fLayerView.filter.where=""),(null===(v=null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.featureEffect)||void 0===u?void 0:u.filter)||void 0===v?void 0:v.where)&&(l.fLayerView.featureEffect=null),l.categories.forEach((l=>{l.selected=!1})),l}function O(l,n){var o,i,u,v,d,t,e,r,a,s,c;const f=l.categories.get(n);null===(o=null==f?void 0:f.nestedInfos)||void 0===o||o.forEach((n=>{const o=l.queryExpressions.indexOf(`${l.field} = '${n.legendElementInfo.value}'`);-1!==o&&l.queryExpressions.splice(o,1),n.selected=!1}));const $=[],y=Array.from(l.categories).map((l=>l[1]));y.forEach((n=>{var o,i;(null===(o=n.nestedInfos)||void 0===o?void 0:o.every((l=>!l.selected)))&&(null===(i=n.nestedInfos)||void 0===i||i.forEach((n=>{$.push(`${l.field} = '${n.legendElementInfo.value}'`)})))})),$.forEach((n=>{-1===l.queryExpressions.indexOf(n)&&l.queryExpressions.push(n)}));let m=l.queryExpressions.join(" OR ");const p=y.every((l=>{var n;return null===(n=l.nestedInfos)||void 0===n?void 0:n.every((l=>!l.selected))}));return p?((null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.filter)||void 0===u?void 0:u.where)&&(l.fLayerView.filter.where=""),(null===(t=null===(d=null===(v=null==l?void 0:l.fLayerView)||void 0===v?void 0:v.featureEffect)||void 0===d?void 0:d.filter)||void 0===t?void 0:t.where)&&(l.fLayerView.featureEffect=null),l.queryExpressions=[]):((null===(r=null===(e=null==l?void 0:l.fLayerView)||void 0===e?void 0:e.filter)||void 0===r?void 0:r.where)&&(l.fLayerView.filter.where=m),(null===(c=null===(s=null===(a=null==l?void 0:l.fLayerView)||void 0===a?void 0:a.featureEffect)||void 0===s?void 0:s.filter)||void 0===c?void 0:c.where)&&(l.fLayerView.featureEffect.filter.where=m)),l}async function A(l,n,o){var i,u;const v=l.fLayerView.createQuery();if(o)if(o.nestedInfos.every((l=>!l.selected))){const n=o.nestedInfos.map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=o.nestedInfos.filter((l=>l.selected)).map((n=>`${l.field} = '${n.legendElementInfo.value}'`)).join(" OR ");v.where=n}else{const n=l.queryExpressions.join(" OR ");v.where=n}try{const{extent:o}=await(null===(u=null===(i=null==l?void 0:l.fLayerView)||void 0===i?void 0:i.layer)||void 0===u?void 0:u.queryExtent(v));await n.goTo(o)}catch(l){}}function w(l){return l.map((l=>null==l?void 0:l.count)).reduce(((l,n)=>l+n))}function E(l){return l.map((l=>{var n;return null===(n=null==l?void 0:l.nestedInfos)||void 0===n?void 0:n.map((l=>l.count)).reduce(((l,n)=>l+n))})).reduce(((l,n)=>l+n))}async function b(l,n,o,i,u,v,d,t){var e,r,a;if(!n)return;if(!j(null==n?void 0:n.layer,o))return;const s="feature"===(null===(e=null==n?void 0:n.layer)||void 0===e?void 0:e.type)?n.createQuery():null,$=y(n)?c(i,n):i.type?f(d,o,t,i,i.infos):f(i,o,u,v,v.infos);s&&$&&(s.where="1=0"===$?"1=1":$,s.geometry=l);try{const l=s?await n.queryFeatureCount(s):null;return Promise.resolve({[null!==(r=i.label)&&void 0!==r?r:null===(a=null==n?void 0:n.layer)||void 0===a?void 0:a.id]:l})}catch(l){console.error("FAILURE AT 'getInfoCount': ",l)}return Promise.resolve(null)}async function R(l,n){let o=Object.assign({},n);const{activeLayerInfos:i}=l;let u={};const v={};i.forEach((async o=>{var i,u,d,t;const e=o.legendElements[0],r=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,a=null===(d=o.layer.renderer)||void 0===d?void 0:d.field,s=[];v[o.layer.id]=[],null===(t=null==e?void 0:e.infos)||void 0===t||t.forEach(((n,i)=>{var u;const d=null===(u=e.infos)||void 0===u?void 0:u.every((l=>"symbol-table"===l.type));if(d){const u=[];n.infos.forEach(((o,v)=>{const d=b(l.view.extent,r,a,n,i,e,o,v);u.push(d)})),v[o.layer.id].push(u)}else s.push(b(l.view.extent,r,a,n,i,e)),v[o.layer.id]=s}));const c=o=>{var i,u,d,t;const e=[],r=o.legendElements[0],a=null===(u=n[null===(i=null==o?void 0:o.layer)||void 0===i?void 0:i.id])||void 0===u?void 0:u.fLayerView,s=null===(d=o.layer.renderer)||void 0===d?void 0:d.field;null===(t=null==r?void 0:r.infos)||void 0===t||t.forEach(((n,o)=>e.push(b(l.view.extent,a,s,n,o,r)))),v[o.layer.id]=e};o.children.forEach((async l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;c(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{c(l)}))}))}))}));for(const l in v){let n=u[l];n||(n=u[l]={});const o=await Promise.all(v[l]);if(o.every((l=>Array.isArray(l)))){const i=await Promise.all(o.map((async l=>(await Promise.all(l)).map((l=>l&&Object.values(l)[0])))));n[l]=i,u[l]=Object.assign({},n[l])}else{const i={};o.forEach((l=>{if(!l)return;const n=Object.keys(l)[0];i[n]=l[n]})),l&&(n[l]=i),u[l]=Object.assign({},n[l])}}return i.forEach((l=>{var o;const i=n[l.layer.id],v=l.layer.id;null===(o=null==i?void 0:i.categories)||void 0===o||o.forEach(((n,o)=>{var d;const t=Array.from(null==i?void 0:i.categories).findIndex((l=>l[0]===o));if(null==n?void 0:n.nestedInfos)null==n||n.nestedInfos.forEach(((n,o)=>{var i,v,d;const e=null===(d=null===(v=null==u?void 0:u[null===(i=null==l?void 0:l.layer)||void 0===i?void 0:i.id])||void 0===v?void 0:v[t])||void 0===d?void 0:d[o];n.count=isNaN(e)?null:e}));else{const l=null===(d=null==u?void 0:u[v])||void 0===d?void 0:d[o];n.count=isNaN(l)?null:l}}));const d=l=>{var o;const i=l.layer.id,v=n[i];null===(o=null==v?void 0:v.categories)||void 0===o||o.forEach(((l,n)=>{var o;const v=null===(o=null==u?void 0:u[i])||void 0===o?void 0:o[n];l.count=v}))};l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{var n;d(l),(null===(n=null==l?void 0:l.children)||void 0===n?void 0:n.length)>0&&l.children.forEach((l=>{d(l)}))}))}))})),Promise.resolve(o)}function L(l,n){var o;return null===(o=null==l?void 0:l.nestedInfos)||void 0===o?void 0:o[n]}function D(l){return Array.from(l).map((l=>l[1])).every((l=>!!(null==l?void 0:l.nestedInfos)))}function I(l){var n,o,i,u;return!!(null===(u=null===(i=null===(o=null===(n=null==l?void 0:l.legendElements)||void 0===n?void 0:n[0])||void 0===o?void 0:o.infos)||void 0===i?void 0:i.every)||void 0===u?void 0:u.call(i,(l=>"symbol-table"===(null==l?void 0:l.type))))}function x(l,n){var o;return null===(o=null==l?void 0:l.categories)||void 0===o?void 0:o.get(null==n?void 0:n.title)}function g(l){const n="calcite-mode-",o=`${n}light`,i=`${n}dark`;return l.classList.contains(i)?i:o}function h(l){if(l.layerId&&l.intLegendLayerData){const n=l.layerId,o=l.intLegendLayerData,i=Object.assign(Object.assign({},u.data),{[n]:o});v.set("data",i)}}function P(n,i){const{type:u}=n;"filter"===u?function(l){var n,o;null===(o=null===(n=null==l?void 0:l.allLayerViews)||void 0===n?void 0:n.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})))||void 0===o||o.forEach((l=>{const n=S(l);l.filter=n,l.set("featureEffect",null)}))}(i):"effect"===u&&function(n,i){var u;null===(u=null==i?void 0:i.allLayerViews)||void 0===u||u.filter((l=>{var n;return"feature"===(null===(n=null==l?void 0:l.layer)||void 0===n?void 0:n.type)})).forEach((async i=>{if((null==n?void 0:n.effect)&&i){const[u]=await l(["esri/layers/support/FeatureEffect"]),{includedEffect:v,excludedEffect:d}=n.effect,t=await o(d,i,"excludedEffect"),e=await o(v,i,"includedEffect"),r=S(i);i.featureEffect=new u({filter:r,includedEffect:e,excludedEffect:t}),i.set("filter",null)}}))}(n,i)}function S(l){var n;return(null==l?void 0:l.filter)||(null===(n=null==l?void 0:l.featureEffect)||void 0===n?void 0:n.filter)}function j(l,n){const o=null==l?void 0:l.fields,i=o&&o.map((l=>l.name));return!n||i&&i.includes(n)}function U(l){const n=[];return l.forEach((l=>z(l,n))),n}function z(l,n){n.push(l),l.children&&l.children.length>0&&l.children.forEach((l=>{z(l,n)}))}export{x as a,r as b,$ as c,R as d,t as e,U as f,g,P as h,u as i,d as j,s as k,a as l,I as m,m as n,O as o,N as p,o as q,e as r,v as s,D as t,h as u,p as v,E as w,w as x,L as y,A as z}
@@ -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,c as s,h as i,g as e}from"./p-fa1ceaf9.js";import{S as o}from"./p-a230b270.js";import{g as n}from"./p-427b4593.js";import"./p-65581d83.js";import"./p-6a68306c.js";import"./p-d4056c1c.js";import"./p-af2c8aa9.js";function l(t){var s;return!!(null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s?void 0:s.getItem(t))}const a=class{constructor(i){var e;t(this,i),this.splashClose=s(this,"splashClose",7),this._sanitizer=null==(e=o)||"function"!=typeof e?null:new e({whiteList:{h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],img:["style","src","width","height"],pre:["style"],p:["id","class","style"],div:["id","class","style","role"],span:["id","class","style","role"],figure:["class","style"]}},!0),this.localStorageKey=void 0,this.titleText="",this.content="",this.primaryButtonText="",this.open=!0,this.closeButtonDisabled=!1,this.outsideCloseDisabled=!1,this.secondaryButton=!1,this.secondaryButtonText=void 0,this.secondaryButtonIcon=void 0,this.secondaryButtonCallback=void 0,this.messages=void 0}sanitizeContent(){this.content=this._sanitizer.sanitize(this.content)}componentWillLoad(){let t;const{localStorageKey:s}=this;t=s?this.open&&!l(this.localStorageKey):this.open,this.el.open=t,this.content&&this._sanitizer&&this.sanitizeContent()}componentDidLoad(){n(this)}render(){return i("calcite-modal",{key:"6d6a46267460646843c9b06ffbb8d319d2368b3b",onCalciteModalClose:this.close.bind(this),open:this.open,closeButtonDisabled:this.closeButtonDisabled,outsideCloseDisabled:this.outsideCloseDisabled},this.renderHeader(),this.renderContent(),this.localStorageKey?this.renderDontShowThisAgainCheckbox():null,this.renderPrimaryButton(),this.secondaryButton?this.renderSecondaryButton():null)}renderHeader(){const{titleText:t}=this;return i("header",{slot:"header"},t)}renderContent(){const{content:t}=this;return i("div",{slot:"content",innerHTML:t},i("slot",{name:"custom-action"}))}renderDontShowThisAgainCheckbox(){const{localStorageKey:t,messages:s}=this,e=!!l(t)||null;return i("div",{class:"instant-apps-splash__back-content",slot:"back"},i("calcite-label",{layout:"inline"},i("calcite-checkbox",{onCalciteCheckboxChange:this.handleDontShowThisAgain.bind(this),checked:null!=e?e:void 0}),null==s?void 0:s.dontShowThisAgain))}renderPrimaryButton(){const{primaryButtonText:t}=this;return i("calcite-button",{onClick:this.close.bind(this),slot:"primary"},t||"Enter")}renderSecondaryButton(){var t;return i("calcite-button",{onClick:null===(t=this.secondaryButtonCallback)||void 0===t?void 0:t.bind(this),slot:"secondary","icon-start":this.secondaryButtonIcon,appearance:"outline"},this.secondaryButtonText)}close(){this.open=!1,this.splashClose.emit()}handleDontShowThisAgain(t){const{localStorageKey:s}=this;if(!s)return;const i=t.target,{checked:e}=i;e?null===window||void 0===window||window.localStorage.setItem(s,"false"):function(t){var s;null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s||s.removeItem(t)}(s)}get el(){return e(this)}static get watchers(){return{content:["sanitizeContent"]}}};a.style=":host{display:block}:host .image.image_resized img{width:100%}:host .instant-apps-splash__back-content{display:flex;align-items:center}:host .instant-apps-splash__back-content calcite-label{--calcite-label-margin-bottom:0}";export{a as instant_apps_splash}
6
+ import{r as t,c as s,h as i,g as e}from"./p-fa1ceaf9.js";import{S as o}from"./p-a230b270.js";import{g as n}from"./p-1c64264d.js";import"./p-4cd4cb85.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";function l(t){var s;return!!(null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s?void 0:s.getItem(t))}const a=class{constructor(i){var e;t(this,i),this.splashClose=s(this,"splashClose",7),this._sanitizer=null==(e=o)||"function"!=typeof e?null:new e({whiteList:{h1:["style"],h2:["style"],h3:["style"],h4:["style"],h5:["style"],h6:["style"],img:["style","src","width","height"],pre:["style"],p:["id","class","style"],div:["id","class","style","role"],span:["id","class","style","role"],figure:["class","style"]}},!0),this.localStorageKey=void 0,this.titleText="",this.content="",this.primaryButtonText="",this.open=!0,this.closeButtonDisabled=!1,this.outsideCloseDisabled=!1,this.secondaryButton=!1,this.secondaryButtonText=void 0,this.secondaryButtonIcon=void 0,this.secondaryButtonCallback=void 0,this.messages=void 0}sanitizeContent(){this.content=this._sanitizer.sanitize(this.content)}componentWillLoad(){let t;const{localStorageKey:s}=this;t=s?this.open&&!l(this.localStorageKey):this.open,this.el.open=t,this.content&&this._sanitizer&&this.sanitizeContent()}componentDidLoad(){n(this)}render(){return i("calcite-modal",{key:"6d6a46267460646843c9b06ffbb8d319d2368b3b",onCalciteModalClose:this.close.bind(this),open:this.open,closeButtonDisabled:this.closeButtonDisabled,outsideCloseDisabled:this.outsideCloseDisabled},this.renderHeader(),this.renderContent(),this.localStorageKey?this.renderDontShowThisAgainCheckbox():null,this.renderPrimaryButton(),this.secondaryButton?this.renderSecondaryButton():null)}renderHeader(){const{titleText:t}=this;return i("header",{slot:"header"},t)}renderContent(){const{content:t}=this;return i("div",{slot:"content",innerHTML:t},i("slot",{name:"custom-action"}))}renderDontShowThisAgainCheckbox(){const{localStorageKey:t,messages:s}=this,e=!!l(t)||null;return i("div",{class:"instant-apps-splash__back-content",slot:"back"},i("calcite-label",{layout:"inline"},i("calcite-checkbox",{onCalciteCheckboxChange:this.handleDontShowThisAgain.bind(this),checked:null!=e?e:void 0}),null==s?void 0:s.dontShowThisAgain))}renderPrimaryButton(){const{primaryButtonText:t}=this;return i("calcite-button",{onClick:this.close.bind(this),slot:"primary"},t||"Enter")}renderSecondaryButton(){var t;return i("calcite-button",{onClick:null===(t=this.secondaryButtonCallback)||void 0===t?void 0:t.bind(this),slot:"secondary","icon-start":this.secondaryButtonIcon,appearance:"outline"},this.secondaryButtonText)}close(){this.open=!1,this.splashClose.emit()}handleDontShowThisAgain(t){const{localStorageKey:s}=this;if(!s)return;const i=t.target,{checked:e}=i;e?null===window||void 0===window||window.localStorage.setItem(s,"false"):function(t){var s;null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s||s.removeItem(t)}(s)}get el(){return e(this)}static get watchers(){return{content:["sanitizeContent"]}}};a.style=":host{display:block}:host .image.image_resized img{width:100%}:host .instant-apps-splash__back-content{display:flex;align-items:center}:host .instant-apps-splash__back-content calcite-label{--calcite-label-margin-bottom:0}";export{a as instant_apps_splash}
@@ -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"./p-6a68306c.js";const t=new Map([["ar","ar"],["bg","bg"],["bs","bs"],["ca","ca"],["cs","cs"],["da","da"],["de","de"],["el","el"],["en","en"],["es","es"],["et","et"],["fi","fi"],["fr","fr"],["he","he"],["hr","hr"],["hu","hu"],["id","id"],["it","it"],["ja","ja"],["ko","ko"],["lt","lt"],["lv","lv"],["nb","nb"],["nl","nl"],["pl","pl"],["pt-br","pt-BR"],["pt-pt","pt-PT"],["ro","ro"],["ru","ru"],["sk","sk"],["sl","sl"],["sr","sr"],["sv","sv"],["th","th"],["tr","tr"],["uk","uk"],["vi","vi"],["zh-cn","zh-CN"],["zh-hk","zh-HK"],["zh-tw","zh-TW"]]);function r(t){return function(t){const r=t.closest("[dir]");return r?r.getAttribute("dir"):"ltr"}(t)}export{r as g,t as l}
6
+ import"./p-0a24ad5f.js";const t=new Map([["ar","ar"],["bg","bg"],["bs","bs"],["ca","ca"],["cs","cs"],["da","da"],["de","de"],["el","el"],["en","en"],["es","es"],["et","et"],["fi","fi"],["fr","fr"],["he","he"],["hr","hr"],["hu","hu"],["id","id"],["it","it"],["ja","ja"],["ko","ko"],["lt","lt"],["lv","lv"],["nb","nb"],["nl","nl"],["pl","pl"],["pt-br","pt-BR"],["pt-pt","pt-PT"],["ro","ro"],["ru","ru"],["sk","sk"],["sl","sl"],["sr","sr"],["sv","sv"],["th","th"],["tr","tr"],["uk","uk"],["vi","vi"],["zh-cn","zh-CN"],["zh-hk","zh-HK"],["zh-tw","zh-TW"]]);function r(t){return function(t){const r=t.closest("[dir]");return r?r.getAttribute("dir"):"ltr"}(t)}export{r as g,t as l}