@esri/solutions-components 0.10.42 → 0.10.43

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. package/dist/cjs/calcite-action-pad_2.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-block_5.cjs.entry.js +25 -26
  3. package/dist/cjs/{constants-51cf394f.js → constants-bed33322.js} +3 -11
  4. package/dist/cjs/crowdsource-reporter.cjs.entry.js +112 -49
  5. package/dist/cjs/{helpers-afcac967.js → helpers-0493759d.js} +1 -1
  6. package/dist/cjs/instant-apps-app-guide.cjs.entry.js +2 -2
  7. package/dist/cjs/instant-apps-ckeditor-wrapper_3.cjs.entry.js +3 -3
  8. package/dist/cjs/instant-apps-control-panel.cjs.entry.js +1 -1
  9. package/dist/cjs/instant-apps-create.cjs.entry.js +2 -2
  10. package/dist/cjs/instant-apps-export-views.cjs.entry.js +2 -2
  11. package/dist/cjs/instant-apps-export.cjs.entry.js +2 -2
  12. package/dist/cjs/instant-apps-interactive-legend-classic.cjs.entry.js +2 -2
  13. package/dist/cjs/instant-apps-interactive-legend-count_2.cjs.entry.js +2 -2
  14. package/dist/cjs/instant-apps-interactive-legend-group-legend-element-caption.cjs.entry.js +2 -2
  15. package/dist/cjs/instant-apps-interactive-legend-group-legend-element_5.cjs.entry.js +21 -7
  16. package/dist/cjs/instant-apps-interactive-legend.cjs.entry.js +3 -3
  17. package/dist/cjs/instant-apps-keyboard-shortcuts.cjs.entry.js +2 -2
  18. package/dist/cjs/instant-apps-language-switcher.cjs.entry.js +7 -7
  19. package/dist/cjs/instant-apps-language-translator.cjs.entry.js +6 -6
  20. package/dist/cjs/instant-apps-measurement.cjs.entry.js +2 -2
  21. package/dist/cjs/instant-apps-popover.cjs.entry.js +2 -2
  22. package/dist/cjs/instant-apps-scoreboard.cjs.entry.js +2 -2
  23. package/dist/cjs/instant-apps-sign-in.cjs.entry.js +2 -2
  24. package/dist/cjs/instant-apps-splash.cjs.entry.js +6 -5
  25. package/dist/cjs/instant-apps-time-filter.cjs.entry.js +2 -2
  26. package/dist/cjs/{loadModules-8567855e.js → loadModules-df8b13ca.js} +1 -1
  27. package/dist/cjs/loader.cjs.js +1 -1
  28. package/dist/cjs/{locale-4a18a858.js → locale-4b820602.js} +1 -1
  29. package/dist/cjs/solution-contents_3.cjs.entry.js +1 -1
  30. package/dist/cjs/solutions-components.cjs.js +1 -1
  31. package/dist/cjs/{utils-fa7ad44b.js → utils-3f10ea6b.js} +2 -2
  32. package/dist/collection/components/crowdsource-reporter/crowdsource-reporter.js +112 -49
  33. package/dist/collection/components/solution-spatial-ref/solution-spatial-ref.js +2 -2
  34. package/dist/components/crowdsource-reporter.js +112 -49
  35. package/dist/components/instant-apps-filter-list2.js +25 -26
  36. package/dist/components/instant-apps-interactive-legend-relationship2.js +19 -5
  37. package/dist/components/instant-apps-language-switcher.js +3 -3
  38. package/dist/components/instant-apps-language-translator2.js +4 -12
  39. package/dist/components/instant-apps-splash.js +4 -3
  40. package/dist/components/loadModules2.js +1 -1
  41. package/dist/components/solution-spatial-ref2.js +2 -2
  42. package/dist/components/utils4.js +1 -1
  43. package/dist/esm/calcite-action-pad_2.entry.js +1 -1
  44. package/dist/esm/calcite-block_5.entry.js +25 -26
  45. package/dist/esm/{constants-886c7c2c.js → constants-637a40f5.js} +3 -11
  46. package/dist/esm/crowdsource-reporter.entry.js +112 -49
  47. package/dist/esm/{helpers-91087955.js → helpers-91ca0f44.js} +1 -1
  48. package/dist/esm/instant-apps-app-guide.entry.js +2 -2
  49. package/dist/esm/instant-apps-ckeditor-wrapper_3.entry.js +3 -3
  50. package/dist/esm/instant-apps-control-panel.entry.js +1 -1
  51. package/dist/esm/instant-apps-create.entry.js +2 -2
  52. package/dist/esm/instant-apps-export-views.entry.js +2 -2
  53. package/dist/esm/instant-apps-export.entry.js +2 -2
  54. package/dist/esm/instant-apps-interactive-legend-classic.entry.js +2 -2
  55. package/dist/esm/instant-apps-interactive-legend-count_2.entry.js +2 -2
  56. package/dist/esm/instant-apps-interactive-legend-group-legend-element-caption.entry.js +2 -2
  57. package/dist/esm/instant-apps-interactive-legend-group-legend-element_5.entry.js +21 -7
  58. package/dist/esm/instant-apps-interactive-legend.entry.js +3 -3
  59. package/dist/esm/instant-apps-keyboard-shortcuts.entry.js +2 -2
  60. package/dist/esm/instant-apps-language-switcher.entry.js +7 -7
  61. package/dist/esm/instant-apps-language-translator.entry.js +6 -6
  62. package/dist/esm/instant-apps-measurement.entry.js +2 -2
  63. package/dist/esm/instant-apps-popover.entry.js +2 -2
  64. package/dist/esm/instant-apps-scoreboard.entry.js +2 -2
  65. package/dist/esm/instant-apps-sign-in.entry.js +2 -2
  66. package/dist/esm/instant-apps-splash.entry.js +6 -5
  67. package/dist/esm/instant-apps-time-filter.entry.js +2 -2
  68. package/dist/esm/{loadModules-03ba7abe.js → loadModules-d5a25252.js} +1 -1
  69. package/dist/esm/loader.js +1 -1
  70. package/dist/esm/{locale-ce177eb8.js → locale-77038bee.js} +1 -1
  71. package/dist/esm/solution-contents_3.entry.js +1 -1
  72. package/dist/esm/solutions-components.js +1 -1
  73. package/dist/esm/{utils-3fc29543.js → utils-0a78d3c9.js} +2 -2
  74. package/dist/node_modules/@esri/instant-apps-components/dist/collection/components/instant-apps-splash/instant-apps-splash.css +7 -0
  75. package/dist/solutions-components/{p-b739f26d.entry.js → p-053effee.entry.js} +1 -1
  76. package/dist/solutions-components/{p-af573e0d.js → p-09543b4e.js} +1 -1
  77. package/dist/solutions-components/p-1b1ff60a.entry.js +6 -0
  78. package/dist/solutions-components/{p-e4107150.entry.js → p-2291bf3f.entry.js} +1 -1
  79. package/dist/solutions-components/p-2cf41651.entry.js +6 -0
  80. package/dist/solutions-components/{p-fe3aea1a.entry.js → p-351c7cbf.entry.js} +1 -1
  81. package/dist/solutions-components/{p-90fc786f.entry.js → p-3d999f0f.entry.js} +1 -1
  82. package/dist/solutions-components/p-3fe6c230.entry.js +6 -0
  83. package/dist/solutions-components/p-4695cfab.js +6 -0
  84. package/dist/solutions-components/{p-43699470.entry.js → p-499489c5.entry.js} +1 -1
  85. package/dist/solutions-components/{p-5ff711ee.js → p-5104cc98.js} +1 -1
  86. package/dist/solutions-components/p-5e694bcc.entry.js +29 -0
  87. package/dist/solutions-components/{p-cbb86cf2.entry.js → p-6a3f2249.entry.js} +1 -1
  88. package/dist/solutions-components/{p-a7f56b28.entry.js → p-6e5ea1cb.entry.js} +1 -1
  89. package/dist/solutions-components/{p-9c170b30.entry.js → p-76a1236d.entry.js} +1 -1
  90. package/dist/solutions-components/{p-1e14b3d0.entry.js → p-78b6d3fe.entry.js} +1 -1
  91. package/dist/solutions-components/{p-c48be45f.entry.js → p-8a1a0f9b.entry.js} +1 -1
  92. package/dist/solutions-components/{p-5cbf3eed.entry.js → p-8d4a4498.entry.js} +1 -1
  93. package/dist/solutions-components/{p-4a02fd45.entry.js → p-9d9e0e74.entry.js} +1 -1
  94. package/dist/solutions-components/{p-50fb7f47.js → p-b49e1a78.js} +1 -1
  95. package/dist/solutions-components/{p-c551ffc5.entry.js → p-c399f2b8.entry.js} +1 -1
  96. package/dist/solutions-components/p-cb27611e.entry.js +6 -0
  97. package/dist/solutions-components/{p-4cd4cb85.js → p-d001e961.js} +1 -1
  98. package/dist/solutions-components/{p-523dcf4b.entry.js → p-d37a68f7.entry.js} +1 -1
  99. package/dist/solutions-components/{p-a2cf9fdc.entry.js → p-db7d5db8.entry.js} +1 -1
  100. package/dist/solutions-components/{p-6438d1ea.entry.js → p-e29e57db.entry.js} +1 -1
  101. package/dist/solutions-components/{p-a5b751e2.entry.js → p-e625aa69.entry.js} +1 -1
  102. package/dist/solutions-components/{p-2542d5c9.entry.js → p-e9fcc194.entry.js} +1 -1
  103. package/dist/solutions-components/{p-374ddead.entry.js → p-f4880179.entry.js} +1 -1
  104. package/dist/solutions-components/solutions-components.esm.js +1 -1
  105. package/dist/types/components/crowdsource-reporter/crowdsource-reporter.d.ts +43 -17
  106. package/package.json +7 -7
  107. package/dist/solutions-components/p-3fc18283.entry.js +0 -6
  108. package/dist/solutions-components/p-442dd59c.entry.js +0 -6
  109. package/dist/solutions-components/p-5585dcd3.entry.js +0 -6
  110. package/dist/solutions-components/p-953afbb3.entry.js +0 -29
  111. package/dist/solutions-components/p-ceb1030b.js +0 -6
  112. package/dist/solutions-components/p-f728af86.entry.js +0 -6
@@ -3,4 +3,4 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as e,f as t,h as i,g as n,c as a}from"./p-4e6eb06e.js";import{g as s,m as l,s as c,i as o,a as d,z as r,n as p,l as h,o as v,u as g,p as u,q as m}from"./p-af573e0d.js";import{l as f}from"./p-4cd4cb85.js";import"./p-dc9d4be3.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const y=class{constructor(t){e(this,t),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}layerCaptionElementExpandUpdatedEmitted(){var e;this.expanded=!!(null===(e=this.layerCaption)||void 0===e?void 0:e.expanded)}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0})}render(){return i("div",{key:"ab9a4911afa5f1021f3270c4fec409a708e2ec51",style:{borderLeft:"1px solid var(--calcite-color-border-3)"},class:"esri-legend__service esri-legend__group-layer"},i("instant-apps-interactive-legend-layer-element-caption",{key:"bc80abe473c1b47920a78b072033d5b214f7822c",ref:e=>this.layerCaption=e,class:s(this.el),legendvm:this.legendvm,"feature-count":this.featureCount,activeLayerInfo:this.activeLayerInfo,messages:this.messages,isChild:this.isChild}),i("div",{key:"cf6dc1620eb0a95430129b9d414a9f6b893b61c2",class:"esri-legend__group-content "+(!1===this.expanded?"hide":"show")},i("slot",{key:"f346b52020e3cf4e3a072fdfa17a3762676aba53",name:"content"})))}get el(){return n(this)}};y.style=".sc-instant-apps-interactive-legend-group-legend-element-h{display:block}.sc-instant-apps-interactive-legend-group-legend-element-h .esri-legend__service.sc-instant-apps-interactive-legend-group-legend-element{margin:0;padding:0}.sc-instant-apps-interactive-legend-group-legend-element-h .hide.sc-instant-apps-interactive-legend-group-legend-element{display:none}";const _=class{constructor(t){e(this,t),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=void 0,this.expanded=!0}layerCaptionElementExpandUpdatedEmitted(){this.expanded=this.layerCaption.expanded}componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0})}render(){var e,t;return i("div",{key:"45305a415db8ba0a08ab69de820ff6b8711e1cee",style:{borderLeft:"1px solid var(--calcite-color-border-3)"},class:"esri-legend__service"+(this.activeLayerInfo.parent?" esri-legend__group-layer-child":""),tabIndex:0},i("instant-apps-interactive-legend-layer-element-caption",{key:"7babce8571540883bca9e0ff07c0a152cbb30fbb",ref:e=>this.layerCaption=e,legendvm:this.legendvm,"feature-count":this.featureCount,activeLayerInfo:this.activeLayerInfo,messages:this.messages,isChild:!!this.isChild,class:s(this.el)}),i("div",{key:"c021d9c441c407d5fac6f246eb9f4b6ce76bcaa5",id:`${null===(t=null===(e=this.activeLayerInfo)||void 0===e?void 0:e.layer)||void 0===t?void 0:t.id}-legend-layer`,class:"esri-legend__layer"+(!1===this.expanded?" hide":" show")},i("slot",{key:"761834066d924654c87a39601c1670625c88d863",name:"content"})))}get el(){return n(this)}};_.style=".sc-instant-apps-interactive-legend-layer-element-h{display:block}.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__service.sc-instant-apps-interactive-legend-layer-element{padding:0}.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-body.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__group-layer-child.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-child-table.sc-instant-apps-interactive-legend-layer-element{margin:0;overflow:hidden}.sc-instant-apps-interactive-legend-layer-element-h .hide.sc-instant-apps-interactive-legend-layer-element{display:none}";const b=class{constructor(t){e(this,t),this.activeLayerInfo=void 0,this.isSizeRamp=void 0,this.isChild=void 0,this.isColorRamp=void 0,this.isRelationshipRamp=void 0,this.isInteractive=void 0,this.zoomTo=void 0,this.legendElement=void 0,this.titleText=void 0,this.legendvm=void 0,this.legendElementIndex=void 0,this.messages=void 0,this.expanded=!0}legendLayerExpandUpdatedEmitted(){this.expanded=this.legendLayerCaption.expanded}render(){var e,t,n,a,s,o,d,r,p;const h=this.isChild?"esri-legend__layer-child-table":"esri-legend__layer-table",v=1===(null===(t=null===(e=this.legendElement)||void 0===e?void 0:e.infos)||void 0===t?void 0:t.length)&&!(null===(s=null===(a=null===(n=this.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===a?void 0:a.renderer)||void 0===s?void 0:s.field),g=!this.isSizeRamp&&this.isChild||this.isColorRamp?"":" esri-legend__layer-table--size-ramp",u=this.isInteractive?"":" instant-apps-interactive-legend__non-interactive",m=l(this.activeLayerInfo)?" instant-apps-interactive-legend__nested-unique-symbol":"";let f=!(!v||this.expanded||this.zoomTo)||this.expanded;return this.isRelationshipRamp&&(f=c.get("relationshipRampExpandStates")[this.activeLayerInfo.layer.id]),i("div",{key:"cd76a15dfd77c630708e61535a4d22d66385a4bf",class:`${h}${g}${u}${m}`},i("div",{key:"24eb28f5fa505d1d4471a750b5273b34af2f3428",id:`${null===(d=null===(o=this.activeLayerInfo)||void 0===o?void 0:o.layer)||void 0===d?void 0:d.id}-legend-element-caption`,class:this.isRelationshipRamp||!this.titleText&&!this.zoomTo&&v?"hide":"show"},i("instant-apps-interactive-legend-legend-element-caption",{key:"5ffd04439d1c99251e358afcf077628a780c8e40",ref:e=>this.legendLayerCaption=e,legendvm:this.legendvm,activeLayerInfo:this.activeLayerInfo,layer:this.activeLayerInfo.layer,titleText:this.titleText,legendElement:this.legendElement,legendElementIndex:this.legendElementIndex,zoomTo:this.zoomTo,isInteractive:this.isInteractive,messages:this.messages})),i("div",{key:"content",id:`${null===(p=null===(r=this.activeLayerInfo)||void 0===r?void 0:r.layer)||void 0===p?void 0:p.id}-legend-element-content-${this.legendElementIndex}`,class:!1===f?"hide":"show"},i("slot",{key:"c95e14737a003f85f7c494e6d30d9f946bef464a",name:"content"})))}};var L;b.style=".sc-instant-apps-interactive-legend-legend-element-h{display:block}.sc-instant-apps-interactive-legend-legend-element-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-legend-element,.sc-instant-apps-interactive-legend-legend-element-h .instant-apps-interactive-legend__nested-unique-symbol.sc-instant-apps-interactive-legend-legend-element{margin:0}.sc-instant-apps-interactive-legend-legend-element-h .hide.sc-instant-apps-interactive-legend-legend-element{display:none}",function(e){e.ZoomTo="magnifying-glass-plus",e.ShowAll="list-check-all"}(L||(L={}));const w=class{constructor(t){e(this,t),this.showAllSelectedEvent=a(this,"showAllSelected",7),this.legendLayerExpandUpdatedEvent=a(this,"legendLayerExpandUpdated",7),this.legendvm=void 0,this.activeLayerInfo=void 0,this.layer=void 0,this.titleText=void 0,this.legendElementIndex=void 0,this.zoomTo=void 0,this.isInteractive=void 0,this.legendElement=void 0,this.expanded=!0,this.messages=void 0}render(){var e,t,n,a;const s=l(this.activeLayerInfo),o=p(this.activeLayerInfo),{expanded:d}=this,r=c.get("compact"),h=r?" instant-apps-interactive-legend__layer-caption--compact":"";if(s&&!this.titleText)return null;const v=this.titleText&&i("span",{class:"instant-apps-interactive-legend__legend-layer-caption-text",title:this.titleText},this.titleText),g=(this.isInteractive||o)&&this.renderLegendElementCaptionControls();return i("div",{class:`esri-legend__layer-caption${h}`},i("calcite-action",{onClick:this.toggleExpanded(),icon:!1===d?"chevron-up":"chevron-down",appearance:"transparent",text:!1===d?null===(e=this.messages)||void 0===e?void 0:e.expand:null===(t=this.messages)||void 0===t?void 0:t.collapse,label:!1===d?null===(n=this.messages)||void 0===n?void 0:n.expand:null===(a=this.messages)||void 0===a?void 0:a.collapse,scale:"s"}),r?[v,g]:[g,v])}renderLegendElementCaptionControls(){return i("div",{key:"layer-caption-btn-container",class:"instant-apps-interactive-legend__layer-caption-btn-container"+(this.titleText?"":" instant-apps-interactive-legend__layer-caption-btn-container--no-text")},this.renderShowAllZoomToButtons())}renderShowAllZoomToButtons(){return c.get("compact")?this.renderCompactButtonUI():this.renderButtonUI()}renderCompactButtonUI(){var e,t,n,a,s;const{data:l}=o,{id:c}=this.layer||{},d=(null===(t=null===(e=null==l?void 0:l[c])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size)>1,r="zoomToCompact";return[this.zoomTo&&[i("calcite-action",{id:r,class:"instant-apps-interactive-legend__zoom-to-btn",onClick:this.handleZoomTo(),icon:L.ZoomTo,appearance:"transparent",scale:"s",compact:!0}),i("calcite-tooltip",{"reference-element":r,placement:"top",label:null===(n=this.messages)||void 0===n?void 0:n.zoomTo},null===(a=this.messages)||void 0===a?void 0:a.zoomTo)],d&&i("button",{onClick:this.handleShowAll(),class:"instant-apps-interactive-legend__show-all-btn"},null===(s=this.messages)||void 0===s?void 0:s.showAll)]}renderButtonUI(){var e,t,n,a,s,l,c,d;const{data:r}=o,{id:p}=this.layer||{},h="showAll",v="zoomTo";return[(null===(t=null===(e=null==r?void 0:r[p])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size)>1&&[i("calcite-button",{key:"show-all-button",id:h,label:null===(n=this.messages)||void 0===n?void 0:n.showAll,onClick:this.handleShowAll(),iconStart:L.ShowAll,appearance:"outline",round:!0}),i("calcite-tooltip",{referenceElement:h,placement:"top",label:null===(a=this.messages)||void 0===a?void 0:a.showAll},null===(s=this.messages)||void 0===s?void 0:s.showAll)],this.zoomTo&&[i("calcite-button",{key:"zoom-to-button",id:v,label:null===(l=this.messages)||void 0===l?void 0:l.zoomTo,onClick:this.handleZoomTo(),iconStart:L.ZoomTo,appearance:"outline",round:!0}),i("calcite-tooltip",{"reference-element":v,placement:"top",label:null===(c=this.messages)||void 0===c?void 0:c.zoomTo},null===(d=this.messages)||void 0===d?void 0:d.zoomTo)]]}toggleExpanded(){return()=>{var e,t;this.expanded=!this.expanded,this.legendLayerExpandUpdatedEvent.emit(),(null===(t=null===(e=this.activeLayerInfo)||void 0===e?void 0:e.legendElements)||void 0===t?void 0:t.filter((e=>"relationship-ramp"===e.type))).length>0&&c.set("relationshipRampExpandStates",Object.assign(Object.assign({},o.relationshipRampExpandStates),{[this.activeLayerInfo.layer.id]:this.expanded}))}}handleZoomTo(){return()=>{const e=h(this.layer),t=d(e,this.legendElement);r(e,this.legendvm.view,t)}}handleShowAll(){return()=>{var e,t;const i=null===(e=o.data)||void 0===e?void 0:e[null===(t=this.layer)||void 0===t?void 0:t.id];d(i,this.legendElement)?(()=>{const e=v(i,this.legendElement.title);g({intLegendLayerData:e,layerId:this.layer.id})})():((()=>{const e=u(i);g({intLegendLayerData:e,layerId:this.layer.id})})(),this.showAllSelectedEvent.emit())}}get el(){return n(this)}};w.style=".sc-instant-apps-interactive-legend-legend-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-caption-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-field-name-font-size:1rem;--instant-apps-interactive-legend-total-feature-count-font-size:0.875rem;--instant-apps-interactive-legend-info-font-size:0.875rem;--instant-apps-interactive-legend-info-item-background--selected:#c7ebff;--instant-apps-interactive-legend-info-item-color--selected:var(--calcite-color-text-2);--instant-apps-interactive-legend-secondary-background-color:var(--calcite-color-background);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption calcite-action.sc-instant-apps-interactive-legend-legend-element-caption{margin-left:20px}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption{--instant-apps-interactive-legend-ui-padding:5px}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption{display:flex;justify-content:flex-end;width:100%}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__show-all-btn.sc-instant-apps-interactive-legend-legend-element-caption{border:none;background-color:transparent;cursor:pointer;color:var(--calcite-ui-brand);font-weight:var(--calcite-font-weight-medium);font-size:0.75rem;padding-inline-start:20px}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__zoom-to-btn.sc-instant-apps-interactive-legend-legend-element-caption{--calcite-icon-color:var(--calcite-ui-brand);--calcite-color-transparent-hover:transparent}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__legend-layer-caption-text.sc-instant-apps-interactive-legend-legend-element-caption{display:inline-block;font-size:0.75rem;white-space:nowrap;width:100%;overflow:hidden;text-overflow:ellipsis}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__legend-layer-caption-text.sc-instant-apps-interactive-legend-legend-element-caption{display:inline-block;margin-left:5px;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption{white-space:nowrap}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption calcite-button.sc-instant-apps-interactive-legend-legend-element-caption{margin:2px}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption{font-weight:var(--instant-apps-interactive-legend-caption-font-weight);padding:var(--instant-apps-interactive-legend-ui-padding)}html[dir=rtl] .sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption calcite-action.sc-instant-apps-interactive-legend-legend-element-caption{margin-left:unset;margin-right:20px}";const x=".esri-relationship-ramp--diamond__middle-column--ramp svg g",k=class{constructor(t){e(this,t),this.cellNodeCounter=0,this.filterMode=void 0,this.activeLayerInfo=void 0,this.legendElement=void 0,this.messages=void 0}applyInteractivity(){this.applyRelationshipRampInteractivity()}showAllSelectedEmitted(){const e=0===o.data[this.activeLayerInfo.layer.id].queryExpressions.length,t=this.relationshipRamp.querySelector(x).children,i=t?Array.from(t):null;e&&(null==i||i.forEach((e=>{e.removeAttribute("stroke"),e.removeAttribute("stroke-width"),e.removeAttribute("stroke-opacity"),e.classList.remove("esri-interactive-legend--selected-cell")})))}async componentWillLoad(){const[e]=await f(["esri/symbols/support/symbolUtils"]);this.symbolUtils=e}render(){var e,t;return i("div",{key:"8b7054296e51e501b5378804dc6055acd113fbfa",ref:e=>{if(!(null==e?void 0:e.querySelector("relationshipStyles"))){const t=document.createElement("style");t.id="relationshipStyles",t.innerHTML="\n rect:hover {\n cursor: pointer;\n opacity: 0.8;\n }\n ",null==e||e.appendChild(t)}}},i("span",{key:"7cd336ef09492b5fc016657a61991f2f255a0b4a",class:"instant-apps-interactive-legend-relationship__instructional-text"},null===(t=null===(e=this.messages)||void 0===e?void 0:e.relationship)||void 0===t?void 0:t.instructionalText),this.renderRelationshipRamp())}renderRelationshipRamp(){var e;const t=(null===(e=this.activeLayerInfo)||void 0===e?void 0:e.layer).renderer,n=this.symbolUtils.renderRelationshipRampPreviewHTML(t);return i("div",{ref:e=>{this.relationshipRamp=e,this.applyRelationshipRampInteractivity()},key:"relationship-ramp-diamond",innerHTML:`${null==n?void 0:n.outerHTML}`})}applyRelationshipRampInteractivity(){if(!(this.relationshipRamp&&this.activeLayerInfo&&this.legendElement&&o.data))return;let e=setInterval((()=>{const t=this.relationshipRamp.querySelector(x);t&&(clearInterval(e),this.setupRelationshipDrawingStyle(t.children))}),10)}setupRelationshipDrawingStyle(e){const t=e?Array.from(e):null;if(!t)return;t.map(((e,t)=>{var i,n;const a=(null===(n=null===(i=this.activeLayerInfo)||void 0===i?void 0:i.layer)||void 0===n?void 0:n.renderer).uniqueValueInfos;if(a[t]){const i=a[t].symbol.color;a.forEach(((t,n)=>{const a=t.symbol.color;i.r===a.r&&i.g===a.g&&i.b===a.b&&i.a===a.a&&this.setCellAttributes(e,n)})),e.classList.add("esri-interactive-legend__svg-rect-element")}}));const i=this.reorderCellNodes(t);this.attachFeatureIndexes(i),this.applyEventHandlers()}setCellAttributes(e,t){const i=this.activeLayerInfo.layer.renderer.uniqueValueInfos,n=this.generateIndexPattern(t);i[n]&&(e.setAttribute("data-color",`${i[n].symbol.color}`),e.setAttribute("data-cell-index",`${n}`),e.setAttribute("tabindex","0"))}generateIndexPattern(e){const{focus:t,numClasses:i}=this.legendElement;return"HL"===t?e:2===i?this.twoClasses(e,t):3===i?this.threeClasses(e,t):4===i?this.fourClasses(e,t):null}twoClasses(e,t){return"HH"===t||null===t?0===e||2===e?e+1:1===e||3===e?e-1:null:"LH"===t?0===e?e+3:1===e?e+1:2===e?e-1:3===e?e-3:4===e?e+0:null:"LL"===t?0===e||1===e?e+2:2===e||3===e?e-2:null:void 0}threeClasses(e,t){return"HH"===t||null===t?0===e||3===e||6===e?e+2:2===e||5===e||8===e?e-2:e:"LH"===t?0===e?e+8:1===e?e+6:2===e?e+4:3===e?e+2:5===e?e-2:6===e?e-4:7===e?e-6:8===e?e-8:e:"LL"===t?0===e||1===e||2===e?e+6:6===e||7===e||8===e?e-6:e:void 0}fourClasses(e,t){return"HH"===t||null===t?0===e||4===e||8===e||12===e?e+3:1===e||5===e||9===e||13===e?e+1:2===e||6===e||10===e||14===e?e-1:3===e||7===e||11===e||15===e?e-3:null:"LH"===t?0===e?e+15:1===e?e+13:2===e?e+11:3===e?e+9:4===e?e+7:5===e?e+5:6===e?e+3:7===e?e+1:8===e?e-1:9===e?e-3:10===e?e-5:11===e?e-7:12===e?e-9:13===e?e-11:14===e?e-13:15===e?e-15:null:"LL"===t?0===e||1===e||2===e||3===e?e+12:4===e||5===e||6===e||7===e?e+4:8===e||9===e||10===e||11===e?e-4:12===e||13===e||14===e||15===e?e-12:null:void 0}reorderCellNodes(e){const t=[];for(;this.cellNodeCounter<=e.length-1;)e.map((e=>{parseInt(e.getAttribute("data-cell-index"))===this.cellNodeCounter&&t.push(e)})),this.cellNodeCounter++;return this.cellNodeCounter=0,t}attachFeatureIndexes(e){const{focus:t,numClasses:i}=this.legendElement;"HH"===t||null===t?this.relationshipFocusIsHighHigh(e,i):"LL"===t?this.relationshipFocusIsLowLow(e,i):"LH"===t?this.relationshipFocusIsLowHigh(e,i):"HL"===t&&this.relationshipFocusIsHighLow(e,i),this.cellNodeCounter=0}relationshipFocusIsHighHigh(e,t){for(let i=t-1;i>=0;i--)for(let n=t-1;n>=0;n--)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsLowLow(e,t){for(let i=0;i<t;i++)for(let n=0;n<t;n++)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsLowHigh(e,t){for(let i=0;i<t;i++)for(let n=t-1;n>=0;n--)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsHighLow(e,t){for(let i=t-1;i>=0;i--)for(let n=0;n<t;n++)this.setDataAttributes(e,n,i,t),this.cellNodeCounter++}setDataAttributes(e,t,i,n){const a=e[this.cellNodeCounter];2===n?this.twoClassAttributes(a,t,i):3===n?this.threeClassAttributes(a,t,i):this.fourClassAttributes(a,t,i)}twoClassAttributes(e,t,i){const{legendElement:n}=this;"HL"===n.focus?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i)}threeClassAttributes(e,t,i){const{legendElement:n}=this;1===this.cellNodeCounter||3===this.cellNodeCounter||5===this.cellNodeCounter||7===this.cellNodeCounter?"HL"===n.focus?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i):"HL"!==n.focus?this.setDataFeatureIndexes(e,t,i):this.swapDataFeatureIndexes(e,t,i)}fourClassAttributes(e,t,i){const{legendElement:n}=this,{focus:a}=n;1===this.cellNodeCounter||2===this.cellNodeCounter||4===this.cellNodeCounter||5===this.cellNodeCounter||7===this.cellNodeCounter||8===this.cellNodeCounter||10===this.cellNodeCounter||11===this.cellNodeCounter||13===this.cellNodeCounter||14===this.cellNodeCounter?"HL"===a?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i):"HL"!==a?this.setDataFeatureIndexes(e,t,i):this.swapDataFeatureIndexes(e,t,i)}setDataFeatureIndexes(e,t,i){e.setAttribute("data-feature-i",`${t}`),e.setAttribute("data-feature-j",`${i}`),this.setDataCellFocus(e,t,i)}swapDataFeatureIndexes(e,t,i){e.setAttribute("data-feature-i",`${i}`),e.setAttribute("data-feature-j",`${t}`),this.setDataCellFocus(e,i,t)}setDataCellFocus(e,t,i){const{numClasses:n}=this.legendElement;2===n?this.setDataCellFocusForTwoClasses(e,t,i):3===n?this.setDataCellFocusForThreeClasses(e,t,i):4===n&&this.setDataCellFocusForFourClasses(e,t,i)}setDataCellFocusForTwoClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","HL"):1===t&&1===i&&e.setAttribute("data-cell-focus","HH")}setDataCellFocusForThreeClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LM"):0===t&&2===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","ML"):1===t&&1===i?e.setAttribute("data-cell-focus","MM"):1===t&&2===i?e.setAttribute("data-cell-focus","MH"):2===t&&0===i?e.setAttribute("data-cell-focus","HL"):2===t&&1===i?e.setAttribute("data-cell-focus","HM"):2===t&&2===i&&e.setAttribute("data-cell-focus","HH")}setDataCellFocusForFourClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LM1"):0===t&&2===i?e.setAttribute("data-cell-focus","LM2"):0===t&&3===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","M1L"):1===t&&1===i?e.setAttribute("data-cell-focus","M1M1"):1===t&&2===i?e.setAttribute("data-cell-focus","M1M2"):1===t&&3===i?e.setAttribute("data-cell-focus","M1H"):2===t&&0===i?e.setAttribute("data-cell-focus","M2L"):2===t&&1===i?e.setAttribute("data-cell-focus","M2M1"):2===t&&2===i?e.setAttribute("data-cell-focus","M2M2"):2===t&&3===i?e.setAttribute("data-cell-focus","M2H"):3===t&&0===i?e.setAttribute("data-cell-focus","HL"):3===t&&1===i?e.setAttribute("data-cell-focus","HM1"):3===t&&2===i?e.setAttribute("data-cell-focus","HM2"):3===t&&3===i&&e.setAttribute("data-cell-focus","HH")}applyEventHandlers(){const e=document.querySelectorAll(".esri-interactive-legend__svg-rect-element");Array.from(e).map((e=>{const t=e.getAttribute("data-feature-i"),i=e.getAttribute("data-feature-j"),n=e.getAttribute("data-cell-focus");e.onclick=()=>{this.handleFilter(t,i,n),this.handleSelectedElement(e)},e.onkeydown=a=>{const{key:s}=a;("Enter"===s||"Space"===s)&&(this.handleFilter(t,i,n),this.handleSelectedElement(e))}}))}async handleFilter(e,t,i){var n,a,s,l,c;const d=this.activeLayerInfo.layer,{authoringInfo:r}=d.renderer,{field1:p,field2:h}=r,{queryExpressions:v,fLayerView:g}=o.data[this.activeLayerInfo.layer.id];if("relationship-ramp"===this.legendElement.type&&r&&p&&h){const o=this.generateExpressionParams(p,h,r,e,t,i),d=this.generateExpressionForRelationship(o);0===v.length?v[0]=d:-1===v.indexOf(d)?v.push(d):v.splice(v.indexOf(d),1);const u=v.join(" OR "),y=null!==(a=null===(n=null==g?void 0:g.filter)||void 0===n?void 0:n.timeExtent)&&void 0!==a?a:null,[_,b]=await f(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]);if("filter"===(null===(s=this.filterMode)||void 0===s?void 0:s.type))g.filter=new _({where:u,timeExtent:(null===(l=null==g?void 0:g.filter)||void 0===l?void 0:l.timeExtent)?g.filter.timeExtent:null});else if(null===(c=this.filterMode)||void 0===c?void 0:c.effect){const{includedEffect:e,excludedEffect:t}=this.filterMode.effect,i=await m(t,g,"excludedEffect"),n=await m(e,g,"includedEffect");g.featureEffect=new b({filter:new _({where:u,timeExtent:y}),includedEffect:n,excludedEffect:i})}}}generateExpressionParams(e,t,i,n,a,s){const l=[],c=e.field,o=t.field,d=e.classBreakInfos,r=t.classBreakInfos,p=i.field1.hasOwnProperty("normalizationField")?i.field1.normalizationField:null,h=i.field2.hasOwnProperty("normalizationField")?i.field2.normalizationField:null;return d.forEach(((e,t)=>{const i=[];r.forEach(((e,n)=>{i.push([d[t],r[n]])})),l.push(i)})),{data:l,i:n,j:a,field1:p?`(${c}/${p})`:`${c}`,field2:h?`(${o}/${h})`:`${o}`,focus:s}}generateExpressionForRelationship(e){const{focus:t,field1:i,field2:n,data:a,i:s,j:l}=e;return"LL"===t?`${i} >= ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} >= ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`:"LM"===t||"LM1"===t||"LM2"===t||"LH"===t?`${i} >= ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} > ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`:"ML"===t||"M1L"===t||"M2L"===t||"HL"===t?`${i} > ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} >= ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`:`${i} > ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} > ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`}handleSelectedElement(e){const t=e.classList;t.contains("esri-interactive-legend--selected-cell")?(e.removeAttribute("stroke"),e.removeAttribute("stroke-width"),e.removeAttribute("stroke-opacity"),t.remove("esri-interactive-legend--selected-cell")):(t.add("esri-interactive-legend--selected-cell"),e.setAttribute("stroke","black"),e.setAttribute("stroke-width","3px"),e.setAttribute("stroke-opacity","1"))}};k.style=".sc-instant-apps-interactive-legend-relationship-h{display:block}.sc-instant-apps-interactive-legend-relationship-h .instant-apps-interactive-legend-relationship__instructional-text.sc-instant-apps-interactive-legend-relationship{display:inline-block;width:100%;text-align:center;margin-bottom:10px;background-color:#d2e9f9}.calcite-mode-dark .sc-instant-apps-interactive-legend-relationship-h .instant-apps-interactive-legend-relationship__instructional-text.sc-instant-apps-interactive-legend-relationship{background-color:var(--calcite-color-brand);color:#151515}";export{y as instant_apps_interactive_legend_group_legend_element,_ as instant_apps_interactive_legend_layer_element,b as instant_apps_interactive_legend_legend_element,w as instant_apps_interactive_legend_legend_element_caption,k as instant_apps_interactive_legend_relationship}
6
+ import{r as e,f as t,h as i,g as n,c as a}from"./p-4e6eb06e.js";import{g as s,m as l,s as o,i as c,a as d,z as r,n as p,l as h,o as v,u as g,p as u,q as m}from"./p-09543b4e.js";import{l as f}from"./p-d001e961.js";import"./p-dc9d4be3.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";const y=class{constructor(t){e(this,t),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=!1,this.expanded=!0}layerCaptionElementExpandUpdatedEmitted(){var e;this.expanded=!!(null===(e=this.layerCaption)||void 0===e?void 0:e.expanded)}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0})}render(){return i("div",{key:"ab9a4911afa5f1021f3270c4fec409a708e2ec51",style:{borderLeft:"1px solid var(--calcite-color-border-3)"},class:"esri-legend__service esri-legend__group-layer"},i("instant-apps-interactive-legend-layer-element-caption",{key:"bc80abe473c1b47920a78b072033d5b214f7822c",ref:e=>this.layerCaption=e,class:s(this.el),legendvm:this.legendvm,"feature-count":this.featureCount,activeLayerInfo:this.activeLayerInfo,messages:this.messages,isChild:this.isChild}),i("div",{key:"cf6dc1620eb0a95430129b9d414a9f6b893b61c2",class:"esri-legend__group-content "+(!1===this.expanded?"hide":"show")},i("slot",{key:"f346b52020e3cf4e3a072fdfa17a3762676aba53",name:"content"})))}get el(){return n(this)}};y.style=".sc-instant-apps-interactive-legend-group-legend-element-h{display:block}.sc-instant-apps-interactive-legend-group-legend-element-h .esri-legend__service.sc-instant-apps-interactive-legend-group-legend-element{margin:0;padding:0}.sc-instant-apps-interactive-legend-group-legend-element-h .hide.sc-instant-apps-interactive-legend-group-legend-element{display:none}";const _=class{constructor(t){e(this,t),this.legendvm=void 0,this.featureCount=void 0,this.activeLayerInfo=void 0,this.messages=void 0,this.isChild=void 0,this.expanded=!0}layerCaptionElementExpandUpdatedEmitted(){this.expanded=this.layerCaption.expanded}componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0})}render(){var e,t;return i("div",{key:"45305a415db8ba0a08ab69de820ff6b8711e1cee",style:{borderLeft:"1px solid var(--calcite-color-border-3)"},class:"esri-legend__service"+(this.activeLayerInfo.parent?" esri-legend__group-layer-child":""),tabIndex:0},i("instant-apps-interactive-legend-layer-element-caption",{key:"7babce8571540883bca9e0ff07c0a152cbb30fbb",ref:e=>this.layerCaption=e,legendvm:this.legendvm,"feature-count":this.featureCount,activeLayerInfo:this.activeLayerInfo,messages:this.messages,isChild:!!this.isChild,class:s(this.el)}),i("div",{key:"c021d9c441c407d5fac6f246eb9f4b6ce76bcaa5",id:`${null===(t=null===(e=this.activeLayerInfo)||void 0===e?void 0:e.layer)||void 0===t?void 0:t.id}-legend-layer`,class:"esri-legend__layer"+(!1===this.expanded?" hide":" show")},i("slot",{key:"761834066d924654c87a39601c1670625c88d863",name:"content"})))}get el(){return n(this)}};_.style=".sc-instant-apps-interactive-legend-layer-element-h{display:block}.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__service.sc-instant-apps-interactive-legend-layer-element{padding:0}.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-body.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__group-layer-child.sc-instant-apps-interactive-legend-layer-element,.sc-instant-apps-interactive-legend-layer-element-h .esri-legend__layer-child-table.sc-instant-apps-interactive-legend-layer-element{margin:0;overflow:hidden}.sc-instant-apps-interactive-legend-layer-element-h .hide.sc-instant-apps-interactive-legend-layer-element{display:none}";const b=class{constructor(t){e(this,t),this.activeLayerInfo=void 0,this.isSizeRamp=void 0,this.isChild=void 0,this.isColorRamp=void 0,this.isRelationshipRamp=void 0,this.isInteractive=void 0,this.zoomTo=void 0,this.legendElement=void 0,this.titleText=void 0,this.legendvm=void 0,this.legendElementIndex=void 0,this.messages=void 0,this.expanded=!0}legendLayerExpandUpdatedEmitted(){this.expanded=this.legendLayerCaption.expanded}render(){var e,t,n,a,s,c,d,r,p;const h=this.isChild?"esri-legend__layer-child-table":"esri-legend__layer-table",v=1===(null===(t=null===(e=this.legendElement)||void 0===e?void 0:e.infos)||void 0===t?void 0:t.length)&&!(null===(s=null===(a=null===(n=this.activeLayerInfo)||void 0===n?void 0:n.layer)||void 0===a?void 0:a.renderer)||void 0===s?void 0:s.field),g=!this.isSizeRamp&&this.isChild||this.isColorRamp?"":" esri-legend__layer-table--size-ramp",u=this.isInteractive?"":" instant-apps-interactive-legend__non-interactive",m=l(this.activeLayerInfo)?" instant-apps-interactive-legend__nested-unique-symbol":"";let f=!(!v||this.expanded||this.zoomTo)||this.expanded;return this.isRelationshipRamp&&(f=o.get("relationshipRampExpandStates")[this.activeLayerInfo.layer.id]),i("div",{key:"cd76a15dfd77c630708e61535a4d22d66385a4bf",class:`${h}${g}${u}${m}`},i("div",{key:"24eb28f5fa505d1d4471a750b5273b34af2f3428",id:`${null===(d=null===(c=this.activeLayerInfo)||void 0===c?void 0:c.layer)||void 0===d?void 0:d.id}-legend-element-caption`,class:this.isRelationshipRamp||!this.titleText&&!this.zoomTo&&v?"hide":"show"},i("instant-apps-interactive-legend-legend-element-caption",{key:"5ffd04439d1c99251e358afcf077628a780c8e40",ref:e=>this.legendLayerCaption=e,legendvm:this.legendvm,activeLayerInfo:this.activeLayerInfo,layer:this.activeLayerInfo.layer,titleText:this.titleText,legendElement:this.legendElement,legendElementIndex:this.legendElementIndex,zoomTo:this.zoomTo,isInteractive:this.isInteractive,messages:this.messages})),i("div",{key:"content",id:`${null===(p=null===(r=this.activeLayerInfo)||void 0===r?void 0:r.layer)||void 0===p?void 0:p.id}-legend-element-content-${this.legendElementIndex}`,class:!1===f?"hide":"show"},i("slot",{key:"c95e14737a003f85f7c494e6d30d9f946bef464a",name:"content"})))}};var L;b.style=".sc-instant-apps-interactive-legend-legend-element-h{display:block}.sc-instant-apps-interactive-legend-legend-element-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-legend-element,.sc-instant-apps-interactive-legend-legend-element-h .instant-apps-interactive-legend__nested-unique-symbol.sc-instant-apps-interactive-legend-legend-element{margin:0}.sc-instant-apps-interactive-legend-legend-element-h .hide.sc-instant-apps-interactive-legend-legend-element{display:none}",function(e){e.ZoomTo="magnifying-glass-plus",e.ShowAll="list-check-all"}(L||(L={}));const w=class{constructor(t){e(this,t),this.showAllSelectedEvent=a(this,"showAllSelected",7),this.legendLayerExpandUpdatedEvent=a(this,"legendLayerExpandUpdated",7),this.legendvm=void 0,this.activeLayerInfo=void 0,this.layer=void 0,this.titleText=void 0,this.legendElementIndex=void 0,this.zoomTo=void 0,this.isInteractive=void 0,this.legendElement=void 0,this.expanded=!0,this.messages=void 0}render(){var e,t,n,a;const s=l(this.activeLayerInfo),c=p(this.activeLayerInfo),{expanded:d}=this,r=o.get("compact"),h=r?" instant-apps-interactive-legend__layer-caption--compact":"";if(s&&!this.titleText)return null;const v=this.titleText&&i("span",{class:"instant-apps-interactive-legend__legend-layer-caption-text",title:this.titleText},this.titleText),g=(this.isInteractive||c)&&this.renderLegendElementCaptionControls();return i("div",{class:`esri-legend__layer-caption${h}`},i("calcite-action",{onClick:this.toggleExpanded(),icon:!1===d?"chevron-up":"chevron-down",appearance:"transparent",text:!1===d?null===(e=this.messages)||void 0===e?void 0:e.expand:null===(t=this.messages)||void 0===t?void 0:t.collapse,label:!1===d?null===(n=this.messages)||void 0===n?void 0:n.expand:null===(a=this.messages)||void 0===a?void 0:a.collapse,scale:"s"}),r?[v,g]:[g,v])}renderLegendElementCaptionControls(){return i("div",{key:"layer-caption-btn-container",class:"instant-apps-interactive-legend__layer-caption-btn-container"+(this.titleText?"":" instant-apps-interactive-legend__layer-caption-btn-container--no-text")},this.renderShowAllZoomToButtons())}renderShowAllZoomToButtons(){return o.get("compact")?this.renderCompactButtonUI():this.renderButtonUI()}renderCompactButtonUI(){var e,t,n,a,s;const{data:l}=c,{id:o}=this.layer||{},d=(null===(t=null===(e=null==l?void 0:l[o])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size)>1,r="zoomToCompact";return[this.zoomTo&&[i("calcite-action",{id:r,class:"instant-apps-interactive-legend__zoom-to-btn",onClick:this.handleZoomTo(),icon:L.ZoomTo,appearance:"transparent",scale:"s",compact:!0}),i("calcite-tooltip",{"reference-element":r,placement:"top",label:null===(n=this.messages)||void 0===n?void 0:n.zoomTo},null===(a=this.messages)||void 0===a?void 0:a.zoomTo)],d&&i("button",{onClick:this.handleShowAll(),class:"instant-apps-interactive-legend__show-all-btn"},null===(s=this.messages)||void 0===s?void 0:s.showAll)]}renderButtonUI(){var e,t,n,a,s,l,o,d;const{data:r}=c,{id:p}=this.layer||{},h="showAll",v="zoomTo";return[(null===(t=null===(e=null==r?void 0:r[p])||void 0===e?void 0:e.categories)||void 0===t?void 0:t.size)>1&&[i("calcite-button",{key:"show-all-button",id:h,label:null===(n=this.messages)||void 0===n?void 0:n.showAll,onClick:this.handleShowAll(),iconStart:L.ShowAll,appearance:"outline",round:!0}),i("calcite-tooltip",{referenceElement:h,placement:"top",label:null===(a=this.messages)||void 0===a?void 0:a.showAll},null===(s=this.messages)||void 0===s?void 0:s.showAll)],this.zoomTo&&[i("calcite-button",{key:"zoom-to-button",id:v,label:null===(l=this.messages)||void 0===l?void 0:l.zoomTo,onClick:this.handleZoomTo(),iconStart:L.ZoomTo,appearance:"outline",round:!0}),i("calcite-tooltip",{"reference-element":v,placement:"top",label:null===(o=this.messages)||void 0===o?void 0:o.zoomTo},null===(d=this.messages)||void 0===d?void 0:d.zoomTo)]]}toggleExpanded(){return()=>{var e,t;this.expanded=!this.expanded,this.legendLayerExpandUpdatedEvent.emit(),(null===(t=null===(e=this.activeLayerInfo)||void 0===e?void 0:e.legendElements)||void 0===t?void 0:t.filter((e=>"relationship-ramp"===e.type))).length>0&&o.set("relationshipRampExpandStates",Object.assign(Object.assign({},c.relationshipRampExpandStates),{[this.activeLayerInfo.layer.id]:this.expanded}))}}handleZoomTo(){return()=>{const e=h(this.layer),t=d(e,this.legendElement);r(e,this.legendvm.view,t)}}handleShowAll(){return()=>{var e,t;const i=null===(e=c.data)||void 0===e?void 0:e[null===(t=this.layer)||void 0===t?void 0:t.id];d(i,this.legendElement)?(()=>{const e=v(i,this.legendElement.title);g({intLegendLayerData:e,layerId:this.layer.id})})():((()=>{const e=u(i);g({intLegendLayerData:e,layerId:this.layer.id})})(),this.showAllSelectedEvent.emit())}}get el(){return n(this)}};w.style=".sc-instant-apps-interactive-legend-legend-element-caption-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-caption-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-field-name-font-size:1rem;--instant-apps-interactive-legend-total-feature-count-font-size:0.875rem;--instant-apps-interactive-legend-info-font-size:0.875rem;--instant-apps-interactive-legend-info-item-background--selected:#c7ebff;--instant-apps-interactive-legend-info-item-color--selected:var(--calcite-color-text-2);--instant-apps-interactive-legend-secondary-background-color:var(--calcite-color-background);--instant-apps-interactive-legend-ui-padding:15px 10px}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption calcite-action.sc-instant-apps-interactive-legend-legend-element-caption{margin-left:20px}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption{--instant-apps-interactive-legend-ui-padding:5px}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption{display:flex;justify-content:flex-end;width:100%}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__show-all-btn.sc-instant-apps-interactive-legend-legend-element-caption{border:none;background-color:transparent;cursor:pointer;color:var(--calcite-ui-brand);font-weight:var(--calcite-font-weight-medium);font-size:0.75rem;padding-inline-start:20px}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__zoom-to-btn.sc-instant-apps-interactive-legend-legend-element-caption{--calcite-icon-color:var(--calcite-ui-brand);--calcite-color-transparent-hover:transparent}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption--compact.sc-instant-apps-interactive-legend-legend-element-caption .instant-apps-interactive-legend__legend-layer-caption-text.sc-instant-apps-interactive-legend-legend-element-caption{display:inline-block;font-size:0.75rem;white-space:nowrap;width:100%;overflow:hidden;text-overflow:ellipsis}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__legend-layer-caption-text.sc-instant-apps-interactive-legend-legend-element-caption{display:inline-block;margin-left:5px;margin-bottom:0;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;line-height:normal}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption{white-space:nowrap}.sc-instant-apps-interactive-legend-legend-element-caption-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-legend-element-caption calcite-button.sc-instant-apps-interactive-legend-legend-element-caption{margin:2px}.sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption{font-weight:var(--instant-apps-interactive-legend-caption-font-weight);padding:var(--instant-apps-interactive-legend-ui-padding)}html[dir=rtl] .sc-instant-apps-interactive-legend-legend-element-caption-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-legend-element-caption calcite-action.sc-instant-apps-interactive-legend-legend-element-caption{margin-left:unset;margin-right:20px}";const x=".esri-relationship-ramp--diamond__middle-column--ramp svg g",k=class{constructor(t){e(this,t),this.cellNodeCounter=0,this.filterMode=void 0,this.activeLayerInfo=void 0,this.legendElement=void 0,this.messages=void 0}applyInteractivity(){this.applyRelationshipRampInteractivity()}showAllSelectedEmitted(){const e=0===c.data[this.activeLayerInfo.layer.id].queryExpressions.length,t=this.relationshipRamp.querySelector(x).children,i=t?Array.from(t):null;e&&(null==i||i.forEach((e=>{e.removeAttribute("stroke"),e.removeAttribute("stroke-width"),e.removeAttribute("stroke-opacity"),e.classList.remove("esri-interactive-legend--selected-cell")})))}async componentWillLoad(){const[e]=await f(["esri/symbols/support/symbolUtils"]);this.symbolUtils=e}render(){var e,t;return i("div",{key:"8b7054296e51e501b5378804dc6055acd113fbfa",ref:e=>{if(!(null==e?void 0:e.querySelector("relationshipStyles"))){const t=document.createElement("style");t.id="relationshipStyles",t.innerHTML="\n rect:hover {\n cursor: pointer;\n opacity: 0.8;\n }\n ",null==e||e.appendChild(t)}}},i("span",{key:"7cd336ef09492b5fc016657a61991f2f255a0b4a",class:"instant-apps-interactive-legend-relationship__instructional-text"},null===(t=null===(e=this.messages)||void 0===e?void 0:e.relationship)||void 0===t?void 0:t.instructionalText),this.renderRelationshipRamp())}renderRelationshipRamp(){var e;const t=(null===(e=this.activeLayerInfo)||void 0===e?void 0:e.layer).renderer,n=this.symbolUtils.renderRelationshipRampPreviewHTML(t);return i("div",{ref:e=>{this.relationshipRamp=e,this.applyRelationshipRampInteractivity()},key:"relationship-ramp-diamond",innerHTML:`${null==n?void 0:n.outerHTML}`})}applyRelationshipRampInteractivity(){if(!(this.relationshipRamp&&this.activeLayerInfo&&this.legendElement&&c.data))return;let e=setInterval((()=>{const t=this.relationshipRamp.querySelector(x);t&&(clearInterval(e),this.setupRelationshipDrawingStyle(t.children))}),10)}setupRelationshipDrawingStyle(e){const t=e?Array.from(e):null;if(!t)return;t.map(((e,t)=>{var i,n,a,s,l,o,c,d,r;const p=(null===(n=null===(i=this.activeLayerInfo)||void 0===i?void 0:i.layer)||void 0===n?void 0:n.renderer).uniqueValueInfos;if(p[t]){const i=null===(c=null===(o=null===(l=null===(s=null===(a=null==p?void 0:p[t])||void 0===a?void 0:a.symbol)||void 0===s?void 0:s.data)||void 0===l?void 0:l.symbol)||void 0===o?void 0:o.symbolLayers)||void 0===c?void 0:c[1].color,n=null===(r=null===(d=null==p?void 0:p[t])||void 0===d?void 0:d.symbol)||void 0===r?void 0:r.color;p.forEach(((t,a)=>{var s,l,o,c,d;const r=null===(s=null==t?void 0:t.symbol)||void 0===s?void 0:s.color,p=null===(d=null===(c=null===(o=null===(l=null==t?void 0:t.symbol)||void 0===l?void 0:l.data)||void 0===o?void 0:o.symbol)||void 0===c?void 0:c.symbolLayers)||void 0===d?void 0:d[1].color;let h=!1;h=p?p.every(((e,t)=>e===i[t])):r.r===n.r&&r.g===n.g&&r.b===n.b&&r.a===n.a,h&&this.setCellAttributes(e,a)})),e.classList.add("esri-interactive-legend__svg-rect-element")}}));const i=this.reorderCellNodes(t);this.attachFeatureIndexes(i),this.applyEventHandlers()}setCellAttributes(e,t){const i=this.activeLayerInfo.layer.renderer.uniqueValueInfos,n=this.generateIndexPattern(t);i[n]&&(e.setAttribute("data-color",`${i[n].symbol.color}`),e.setAttribute("data-cell-index",`${n}`),e.setAttribute("tabindex","0"))}generateIndexPattern(e){const{focus:t,numClasses:i}=this.legendElement;return"HL"===t?e:2===i?this.twoClasses(e,t):3===i?this.threeClasses(e,t):4===i?this.fourClasses(e,t):null}twoClasses(e,t){return"HH"===t||null===t?0===e||2===e?e+1:1===e||3===e?e-1:null:"LH"===t?0===e?e+3:1===e?e+1:2===e?e-1:3===e?e-3:4===e?e+0:null:"LL"===t?0===e||1===e?e+2:2===e||3===e?e-2:null:void 0}threeClasses(e,t){return"HH"===t||null===t?0===e||3===e||6===e?e+2:2===e||5===e||8===e?e-2:e:"LH"===t?0===e?e+8:1===e?e+6:2===e?e+4:3===e?e+2:5===e?e-2:6===e?e-4:7===e?e-6:8===e?e-8:e:"LL"===t?0===e||1===e||2===e?e+6:6===e||7===e||8===e?e-6:e:void 0}fourClasses(e,t){return"HH"===t||null===t?0===e||4===e||8===e||12===e?e+3:1===e||5===e||9===e||13===e?e+1:2===e||6===e||10===e||14===e?e-1:3===e||7===e||11===e||15===e?e-3:null:"LH"===t?0===e?e+15:1===e?e+13:2===e?e+11:3===e?e+9:4===e?e+7:5===e?e+5:6===e?e+3:7===e?e+1:8===e?e-1:9===e?e-3:10===e?e-5:11===e?e-7:12===e?e-9:13===e?e-11:14===e?e-13:15===e?e-15:null:"LL"===t?0===e||1===e||2===e||3===e?e+12:4===e||5===e||6===e||7===e?e+4:8===e||9===e||10===e||11===e?e-4:12===e||13===e||14===e||15===e?e-12:null:void 0}reorderCellNodes(e){const t=[];for(;this.cellNodeCounter<=e.length-1;)e.map((e=>{parseInt(e.getAttribute("data-cell-index"))===this.cellNodeCounter&&t.push(e)})),this.cellNodeCounter++;return this.cellNodeCounter=0,t}attachFeatureIndexes(e){const{focus:t,numClasses:i}=this.legendElement;"HH"===t||null===t?this.relationshipFocusIsHighHigh(e,i):"LL"===t?this.relationshipFocusIsLowLow(e,i):"LH"===t?this.relationshipFocusIsLowHigh(e,i):"HL"===t&&this.relationshipFocusIsHighLow(e,i),this.cellNodeCounter=0}relationshipFocusIsHighHigh(e,t){for(let i=t-1;i>=0;i--)for(let n=t-1;n>=0;n--)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsLowLow(e,t){for(let i=0;i<t;i++)for(let n=0;n<t;n++)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsLowHigh(e,t){for(let i=0;i<t;i++)for(let n=t-1;n>=0;n--)this.setDataAttributes(e,i,n,t),this.cellNodeCounter++}relationshipFocusIsHighLow(e,t){for(let i=t-1;i>=0;i--)for(let n=0;n<t;n++)this.setDataAttributes(e,n,i,t),this.cellNodeCounter++}setDataAttributes(e,t,i,n){const a=e[this.cellNodeCounter];2===n?this.twoClassAttributes(a,t,i):3===n?this.threeClassAttributes(a,t,i):this.fourClassAttributes(a,t,i)}twoClassAttributes(e,t,i){const{legendElement:n}=this;"HL"===n.focus?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i)}threeClassAttributes(e,t,i){const{legendElement:n}=this;1===this.cellNodeCounter||3===this.cellNodeCounter||5===this.cellNodeCounter||7===this.cellNodeCounter?"HL"===n.focus?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i):"HL"!==n.focus?this.setDataFeatureIndexes(e,t,i):this.swapDataFeatureIndexes(e,t,i)}fourClassAttributes(e,t,i){const{legendElement:n}=this,{focus:a}=n;1===this.cellNodeCounter||2===this.cellNodeCounter||4===this.cellNodeCounter||5===this.cellNodeCounter||7===this.cellNodeCounter||8===this.cellNodeCounter||10===this.cellNodeCounter||11===this.cellNodeCounter||13===this.cellNodeCounter||14===this.cellNodeCounter?"HL"===a?this.swapDataFeatureIndexes(e,t,i):this.setDataFeatureIndexes(e,t,i):"HL"!==a?this.setDataFeatureIndexes(e,t,i):this.swapDataFeatureIndexes(e,t,i)}setDataFeatureIndexes(e,t,i){e.setAttribute("data-feature-i",`${t}`),e.setAttribute("data-feature-j",`${i}`),this.setDataCellFocus(e,t,i)}swapDataFeatureIndexes(e,t,i){e.setAttribute("data-feature-i",`${i}`),e.setAttribute("data-feature-j",`${t}`),this.setDataCellFocus(e,i,t)}setDataCellFocus(e,t,i){const{numClasses:n}=this.legendElement;2===n?this.setDataCellFocusForTwoClasses(e,t,i):3===n?this.setDataCellFocusForThreeClasses(e,t,i):4===n&&this.setDataCellFocusForFourClasses(e,t,i)}setDataCellFocusForTwoClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","HL"):1===t&&1===i&&e.setAttribute("data-cell-focus","HH")}setDataCellFocusForThreeClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LM"):0===t&&2===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","ML"):1===t&&1===i?e.setAttribute("data-cell-focus","MM"):1===t&&2===i?e.setAttribute("data-cell-focus","MH"):2===t&&0===i?e.setAttribute("data-cell-focus","HL"):2===t&&1===i?e.setAttribute("data-cell-focus","HM"):2===t&&2===i&&e.setAttribute("data-cell-focus","HH")}setDataCellFocusForFourClasses(e,t,i){0===t&&0===i?e.setAttribute("data-cell-focus","LL"):0===t&&1===i?e.setAttribute("data-cell-focus","LM1"):0===t&&2===i?e.setAttribute("data-cell-focus","LM2"):0===t&&3===i?e.setAttribute("data-cell-focus","LH"):1===t&&0===i?e.setAttribute("data-cell-focus","M1L"):1===t&&1===i?e.setAttribute("data-cell-focus","M1M1"):1===t&&2===i?e.setAttribute("data-cell-focus","M1M2"):1===t&&3===i?e.setAttribute("data-cell-focus","M1H"):2===t&&0===i?e.setAttribute("data-cell-focus","M2L"):2===t&&1===i?e.setAttribute("data-cell-focus","M2M1"):2===t&&2===i?e.setAttribute("data-cell-focus","M2M2"):2===t&&3===i?e.setAttribute("data-cell-focus","M2H"):3===t&&0===i?e.setAttribute("data-cell-focus","HL"):3===t&&1===i?e.setAttribute("data-cell-focus","HM1"):3===t&&2===i?e.setAttribute("data-cell-focus","HM2"):3===t&&3===i&&e.setAttribute("data-cell-focus","HH")}applyEventHandlers(){const e=document.querySelectorAll(".esri-interactive-legend__svg-rect-element");Array.from(e).map((e=>{const t=e.getAttribute("data-feature-i"),i=e.getAttribute("data-feature-j"),n=e.getAttribute("data-cell-focus");e.onclick=()=>{this.handleFilter(t,i,n),this.handleSelectedElement(e)},e.onkeydown=a=>{const{key:s}=a;("Enter"===s||"Space"===s)&&(this.handleFilter(t,i,n),this.handleSelectedElement(e))}}))}async handleFilter(e,t,i){var n,a,s,l,o;const d=this.activeLayerInfo.layer,{authoringInfo:r}=d.renderer,{field1:p,field2:h}=r,{queryExpressions:v,fLayerView:g}=c.data[this.activeLayerInfo.layer.id];if("relationship-ramp"===this.legendElement.type&&r&&p&&h){const c=this.generateExpressionParams(p,h,r,e,t,i),d=this.generateExpressionForRelationship(c);0===v.length?v[0]=d:-1===v.indexOf(d)?v.push(d):v.splice(v.indexOf(d),1);const u=v.join(" OR "),y=null!==(a=null===(n=null==g?void 0:g.filter)||void 0===n?void 0:n.timeExtent)&&void 0!==a?a:null,[_,b]=await f(["esri/layers/support/FeatureFilter","esri/layers/support/FeatureEffect"]);if("filter"===(null===(s=this.filterMode)||void 0===s?void 0:s.type))g.filter=new _({where:u,timeExtent:(null===(l=null==g?void 0:g.filter)||void 0===l?void 0:l.timeExtent)?g.filter.timeExtent:null});else if(null===(o=this.filterMode)||void 0===o?void 0:o.effect){const{includedEffect:e,excludedEffect:t}=this.filterMode.effect,i=await m(t,g,"excludedEffect"),n=await m(e,g,"includedEffect");g.featureEffect=new b({filter:new _({where:u,timeExtent:y}),includedEffect:n,excludedEffect:i})}}}generateExpressionParams(e,t,i,n,a,s){const l=[],o=e.field,c=t.field,d=e.classBreakInfos,r=t.classBreakInfos,p=i.field1.hasOwnProperty("normalizationField")?i.field1.normalizationField:null,h=i.field2.hasOwnProperty("normalizationField")?i.field2.normalizationField:null;return d.forEach(((e,t)=>{const i=[];r.forEach(((e,n)=>{i.push([d[t],r[n]])})),l.push(i)})),{data:l,i:n,j:a,field1:p?`(${o}/${p})`:`${o}`,field2:h?`(${c}/${h})`:`${c}`,focus:s}}generateExpressionForRelationship(e){const{focus:t,field1:i,field2:n,data:a,i:s,j:l}=e;return"LL"===t?`${i} >= ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} >= ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`:"LM"===t||"LM1"===t||"LM2"===t||"LH"===t?`${i} >= ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} > ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`:"ML"===t||"M1L"===t||"M2L"===t||"HL"===t?`${i} > ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} >= ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`:`${i} > ${a[s][l][0].minValue} AND ${i} <= ${a[s][l][0].maxValue} AND ${n} > ${a[s][l][1].minValue} AND ${n} <= ${a[s][l][1].maxValue}`}handleSelectedElement(e){const t=e.classList;t.contains("esri-interactive-legend--selected-cell")?(e.removeAttribute("stroke"),e.removeAttribute("stroke-width"),e.removeAttribute("stroke-opacity"),t.remove("esri-interactive-legend--selected-cell")):(t.add("esri-interactive-legend--selected-cell"),e.setAttribute("stroke","black"),e.setAttribute("stroke-width","3px"),e.setAttribute("stroke-opacity","1"))}};k.style=".sc-instant-apps-interactive-legend-relationship-h{display:block}.sc-instant-apps-interactive-legend-relationship-h .instant-apps-interactive-legend-relationship__instructional-text.sc-instant-apps-interactive-legend-relationship{display:inline-block;width:100%;text-align:center;margin-bottom:10px;background-color:#d2e9f9}.calcite-mode-dark .sc-instant-apps-interactive-legend-relationship-h .instant-apps-interactive-legend-relationship__instructional-text.sc-instant-apps-interactive-legend-relationship{background-color:var(--calcite-color-brand);color:#151515}";export{y as instant_apps_interactive_legend_group_legend_element,_ as instant_apps_interactive_legend_layer_element,b as instant_apps_interactive_legend_legend_element,w as instant_apps_interactive_legend_legend_element_caption,k as instant_apps_interactive_legend_relationship}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{r as t,c as s,h as i,g as e}from"./p-4e6eb06e.js";import{S as n}from"./p-7530a02f.js";import{g as o}from"./p-5104cc98.js";import"./p-d001e961.js";import"./p-0a24ad5f.js";import"./p-d4056c1c.js";import"./p-ac122d9e.js";function a(t){var s;return!!(null===(s=null===window||void 0===window?void 0:window.localStorage)||void 0===s?void 0:s.getItem(t))}const l=class{constructor(i){var e;t(this,i),this.splashClose=s(this,"splashClose",7),this._sanitizer=null==(e=n)||"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&&!a(this.localStorageKey):this.open,this.el.open=t,this.content&&this._sanitizer&&this.sanitizeContent()}componentDidLoad(){o(this)}render(){return i("calcite-modal",{key:"9496c3fd2cee50e19313f82ca1acd5532e8ba4d1",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",class:"instant-apps-splash__content",innerHTML:t},i("slot",{name:"custom-action"}))}renderDontShowThisAgainCheckbox(){const{localStorageKey:t,messages:s}=this,e=!!a(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"]}}};l.style=":host{--instant-apps-splash-content-max-height:100%;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}:host .instant-apps-splash__content{max-height:var(--instant-apps-splash-content-max-height)}";export{l as instant_apps_splash}
@@ -0,0 +1,6 @@
1
+ /*!
2
+ * Copyright 2022 Esri
3
+ * Licensed under the Apache License, Version 2.0
4
+ * http://www.apache.org/licenses/LICENSE-2.0
5
+ */
6
+ import{l as a}from"./p-d001e961.js";async function t(a){try{const t=await a.fetch("json",{cacheBust:!0});return Promise.resolve(t)}catch(a){console.error("Unable to get resource t9n data.")}}async function n(t){if(!t)return null;const[n]=await a(["esri/portal/PortalItemResource"]),e=await t.fetchResources({num:100}),l=`t9n/${null==t?void 0:t.id}.json`,s=new n({path:l,portalItem:t}),r=e.resources.filter((a=>a.resource.path===l));if(0!==r.length)return Promise.resolve(r[0].resource);{const a="application/json",n=new Blob([JSON.stringify({})],{type:a});try{await t.addResource(s,n);const a=await t.fetchResources(),e=`t9n/${null==t?void 0:t.id}.json`,l=a.resources.filter((a=>a.resource.path===e));return Promise.resolve(l[0].resource)}catch(a){return console.error("ERROR: ",a),Promise.reject(null)}}}const e={full:{ar:{language:"Arabic",translated:"عربي"},bg:{language:"Bulgarian",translated:"Български"},bs:{language:"Bosnian",translated:"Bosanski"},ca:{language:"Catalan",translated:"Català"},cs:{language:"Czech",translated:"čeština"},da:{language:"Danish",translated:"Dansk"},de:{language:"German",translated:"Deutsch"},el:{language:"Greek",translated:"Ελλάδα"},en:{language:"English",translated:"English"},es:{language:"Spanish",translated:"Español"},et:{language:"Estonian",translated:"Eesti"},fi:{language:"Finnish",translated:"Suomi"},fr:{language:"French",translated:"Français"},he:{language:"Hebrew",translated:"עברית"},hr:{language:"Croatian",translated:"Hrvatski"},hu:{language:"Hungarian",translated:"Magyar"},id:{language:"Indonesian",translated:"Bahasa Indonesia",supportsAutoTranslate:!0},it:{language:"Italian",translated:"Italiano"},ja:{language:"Japanese",translated:"日本語"},ko:{language:"Korean",translated:"한국어"},lt:{language:"Lithuanian",translated:"Lietuvių"},lv:{language:"Latvian",translated:"Latviešu"},nb:{language:"Norwegian",translated:"Norsk"},nl:{language:"Dutch",translated:"Nederlands"},pl:{language:"Polish",translated:"Polski"},"pt-BR":{language:"Portuguese (Brazil)",translated:"Português (Brasil)"},"pt-PT":{language:"Portuguese (Portugal)",translated:"Português (Portugal)"},ro:{language:"Romanian",translated:"Română"},ru:{language:"Russian",translated:"Русский"},sk:{language:"Slovak",translated:"Slovenčina"},sl:{language:"Slovenian",translated:"Slovenščina"},sr:{language:"Serbian",translated:"Srpski"},sv:{language:"Swedish",translated:"Svenska"},th:{language:"Thai",translated:"ไทย"},tr:{language:"Turkish",translated:"Türkiye"},uk:{language:"Ukrainian",translated:"Україна"},vi:{language:"Vietnamese",translated:"Tiếng Việt"},"zh-CN":{language:"Simplified Chinese",translated:"简体中文"},"zh-HK":{language:"Traditional Chinese (Hong Kong)",translated:"繁體中文(香港)"},"zh-TW":{language:"Traditional Chinese (Taiwan)",translated:"繁體中文(台灣)"}},partial:{ab:{language:"Abkhaz",translated:"Аҧсуа"},aa:{language:"Afar",translated:"Afar"},af:{language:"Afrikaans",translated:"Afrikaans",supportsAutoTranslate:!0},ak:{language:"Akan",translated:"Akan"},sq:{language:"Albanian",translated:"Shqip",supportsAutoTranslate:!0},am:{language:"Amharic",translated:"አማርኛ",supportsAutoTranslate:!0},an:{language:"Aragonese",translated:"Aragonés"},hy:{language:"Armenian",translated:"Հայերեն",supportsAutoTranslate:!0},as:{language:"Assamese",translated:"অসমীয়া",supportsAutoTranslate:!0},av:{language:"Avaric",translated:"авар мацӀ"},ae:{language:"Avestan",translated:"Avesta"},ay:{language:"Aymara",translated:"aymar aru"},az:{language:"Azerbaijani",translated:"azərbaycan dili"},bm:{language:"Bambara",translated:"bamanankan"},ba:{language:"Bashkir",translated:"Башҡорт теле",supportsAutoTranslate:!0},eu:{language:"Basque",translated:"euskara",supportsAutoTranslate:!0},be:{language:"Belarusian",translated:"Беларуская"},bn:{language:"Bengali",translated:"বাংলা"},bh:{language:"Bihari",translated:"भोजपुरी"},bi:{language:"Bislama",translated:"Bislama"},br:{language:"Breton",translated:"Brezhoneg"},my:{language:"Burmese",translated:"ဗမာစာ"},ch:{language:"Chamorro",translated:"Chamoru"},ce:{language:"Chechen",translated:"нохчийн мотт"},ny:{language:"Chichewa",translated:"chiCheŵa"},cu:{language:"Church Slavic",translated:"ѩзыкъ словѣньскъ"},cv:{language:"Chuvash",translated:"чӑваш чӗлхи"},kw:{language:"Cornish",translated:"Kernewek"},co:{language:"Corsican",translated:"corsu"},cr:{language:"Cree",translated:"ᓀᐦᐃᔭᐍᐏᐣ"},dv:{language:"Divehi",translated:"ދިވެހި",supportsAutoTranslate:!0},eo:{language:"Esperanto",translated:"Esperanto"},ee:{language:"Ewe",translated:"Ɛʋɛgbɛ"},fo:{language:"Faroese",translated:"føroyskt",supportsAutoTranslate:!0},fj:{language:"Fijian",translated:"Vosa Vakaviti"},ff:{language:"Fulah",translated:"Fulfulde"},gl:{language:"Galician",translated:"galego",supportsAutoTranslate:!0},ka:{language:"Georgian",translated:"ქართული",supportsAutoTranslate:!0},gn:{language:"Guarani",translated:"Avañe'ẽ"},gu:{language:"Gujarati",translated:"ગુજરાતી",supportsAutoTranslate:!0},ht:{language:"Haitian Creole",translated:"Kreyòl Ayisyen",supportsAutoTranslate:!0},ha:{language:"Hausa",translated:"هَوُسَ",supportsAutoTranslate:!0},hz:{language:"Herero",translated:"Otjiherero"},hi:{language:"Hindi",translated:"हिन्दी"},ho:{language:"Hiri Motu",translated:"Hiri Motu"},is:{language:"Icelandic",translated:"Íslenska",supportsAutoTranslate:!0},io:{language:"Ido",translated:"Ido"},ig:{language:"Igbo",translated:"Asụsụ Igbo",supportsAutoTranslate:!0},ia:{language:"Interlingua",translated:"Interlingua"},ie:{language:"Interlingue",translated:"Interlingue"},iu:{language:"Inuktitut",translated:"ᐃᓄᒃᑎᑐᑦ",supportsAutoTranslate:!0},ip:{language:"Inupiaq",translated:"Iñupiaq"},ga:{language:"Irish",translated:"Gaeilge",supportsAutoTranslate:!0},jv:{language:"Javanese",translated:"ꦧꦱꦗꦮ"},kl:{language:"Kalaallisut",translated:"kalaallisut"},kn:{language:"Kannada",translated:"ಕನ್ನಡ",supportsAutoTranslate:!0},kr:{language:"Kanuri",translated:"Kanuri"},ks:{language:"Kashmiri",translated:"कश्मीरी",supportsAutoTranslate:!0},kk:{language:"Kazakh",translated:"қазақ тілі",supportsAutoTranslate:!0},km:{language:"Khmer",translated:"ខ្មែរ",supportsAutoTranslate:!0},ki:{language:"Kikuyu",translated:"Gĩkũyũ"},rw:{language:"Kinyarwanda",translated:"Kinyarwanda",supportsAutoTranslate:!0},rn:{language:"Kirundi",translated:"Ikirundi"},kv:{language:"Komi",translated:"коми кыв"},kg:{language:"Kongo",translated:"Kikongo"},ku:{language:"Kurdish",translated:"Kurdî",supportsAutoTranslate:!0},kj:{language:"Kwanyama",translated:"Kuanyama"},ky:{language:"Kyrgyz",translated:"Кыргызча"},lo:{language:"Lao",translated:"ພາສາລາວ",supportsAutoTranslate:!0},la:{language:"Latin",translated:"latine"},li:{language:"Limburgish",translated:"Limburgs"},ln:{language:"Lingala",translated:"Lingála"},lu:{language:"Luba-Katanga",translated:"Kiluba"},lg:{language:"Luganda",translated:"Luganda"},lb:{language:"Luxembourgish",translated:"Lëtzebuergesch"},mk:{language:"Macedonian",translated:"македонски јазик",supportsAutoTranslate:!0},mg:{language:"Malagasy",translated:"fiteny malagasy",supportsAutoTranslate:!0},ms:{language:"Malay",translated:"Bahasa Melayu",supportsAutoTranslate:!0},ml:{language:"Malayalam",translated:"മലയാളം",supportsAutoTranslate:!0},mt:{language:"Maltese",translated:"Malti",supportsAutoTranslate:!0},gv:{language:"Manx",translated:"Gailck"},mi:{language:"Maori",translated:"te reo Māori",supportsAutoTranslate:!0},mr:{language:"Marathi",translated:"मराठी",supportsAutoTranslate:!0},mh:{language:"Marshallese",translated:"Kajin M̧ajeļ"},mn:{language:"Mongolian",translated:"Монгол хэл"},na:{language:"Nauru",translated:"Ekakairũ Naoero"},nv:{language:"Navajo",translated:"Diné bizaad"},ng:{language:"Ndonga",translated:"Owambo"},ne:{language:"Nepali",translated:"नेपाली",supportsAutoTranslate:!0},nd:{language:"North Ndebele",translated:"isiNdebele"},se:{language:"Northern Sami",translated:"Davvisámegiella"},no:{language:"Norwegian",translated:"Norsk"},nn:{language:"Norwegian Nynorsk",translated:"Norsk nynorsk"},ii:{language:"Nuosu",translated:"ꆈꌠ꒿ Nuosuhxop"},oc:{language:"Occitan",translated:"occitan"},oj:{language:"Ojibwe",translated:"ᐊᓂᔑᓈᐯᒧᐎᓐ"},or:{language:"Oriya",translated:"ଓଡ଼ିଆ",supportsAutoTranslate:!0},om:{language:"Oromo",translated:"Afaan Oromoo"},os:{language:"Ossetian",translated:"ирон æвзаг"},pi:{language:"Pali",translated:"पाऴि"},pa:{language:"Panjabi",translated:"ਪੰਜਾਬੀ"},ps:{language:"Pashto",translated:"پښتو",supportsAutoTranslate:!0},fa:{language:"Persian",translated:"فارسی",supportsAutoTranslate:!0},qu:{language:"Quechua",translated:"Runa Simi"},rm:{language:"Romansh",translated:"rumantsch grischun"},sm:{language:"Samoan",translated:"gagana fa'a Samoa",supportsAutoTranslate:!0},sg:{language:"Sango",translated:"yângâ tî sängö"},sa:{language:"Sanskrit",translated:"संस्कृतम्"},sc:{language:"Sardinian",translated:"sardu"},gd:{language:"Scottish Gaelic",translated:"Gàidhlig"},sn:{language:"Shona",translated:"chiShona"},sd:{language:"Sindhi",translated:"सिन्धी",supportsAutoTranslate:!0},si:{language:"Sinhala",translated:"සිංහල",supportsAutoTranslate:!0},so:{language:"Somali",translated:"Soomaaliga",supportsAutoTranslate:!0},nr:{language:"South Ndebele",translated:"isiNdebele"},st:{language:"Southern Sotho",translated:"Sesotho"},su:{language:"Sundanese",translated:"Basa Sunda"},sw:{language:"Swahili",translated:"Kiswahili",supportsAutoTranslate:!0},ss:{language:"Swati",translated:"SiSwati"},tl:{language:"Tagalog",translated:"Wikang Tagalog"},ty:{language:"Tahitian",translated:"Reo Tahiti",supportsAutoTranslate:!0},tg:{language:"Tajik",translated:"тоҷикӣ"},ta:{language:"Tamil",translated:"தமிழ்",supportsAutoTranslate:!0},tt:{language:"Tatar",translated:"татар теле",supportsAutoTranslate:!0},te:{language:"Telugu",translated:"తెలుగు",supportsAutoTranslate:!0},bo:{language:"Tibetan",translated:"བོད་ཡིག",supportsAutoTranslate:!0},ti:{language:"Tigrinya",translated:"ትግርኛ",supportsAutoTranslate:!0},to:{language:"Tonga",translated:"faka Tonga",supportsAutoTranslate:!0},ts:{language:"Tsonga",translated:"Xitsonga"},tn:{language:"Tswana",translated:"Setswana"},tk:{language:"Turkmen",translated:"Türkmen",supportsAutoTranslate:!0},tw:{language:"Twi",translated:"Twi"},ug:{language:"Uighur",translated:"Uyƣurqə"},ur:{language:"Urdu",translated:"اردو",supportsAutoTranslate:!0},uz:{language:"Uzbek",translated:"O'zbek",supportsAutoTranslate:!0},ve:{language:"Venda",translated:"Tshivenḓa"},vo:{language:"Volapük",translated:"Volapük"},wa:{language:"Walloon",translated:"walon"},cy:{language:"Welsh",translated:"Cymraeg",supportsAutoTranslate:!0},fy:{language:"Western Frisian",translated:"Frysk"},wo:{language:"Wolof",translated:"Wollof"},xh:{language:"Xhosa",translated:"isiXhosa",supportsAutoTranslate:!0},yi:{language:"Yiddish",translated:"ייִדיש"},yo:{language:"Yoruba",translated:"Yorùbá",supportsAutoTranslate:!0},za:{language:"Zhuang",translated:"Saɯ cueŋƅ"},zu:{language:"Zulu",translated:"isiZulu",supportsAutoTranslate:!0}}};export{e as L,t as f,n as g}
@@ -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{h as e,r as i,f as t,g as n}from"./p-4e6eb06e.js";import{h as a,s,g as l,v as r,a as c,i as o,b as d,c as v,d as p,e as u,f as g,j as h,u as f,k as m,l as y}from"./p-af573e0d.js";import{c as _}from"./p-d4056c1c.js";import{l as b}from"./p-4cd4cb85.js";import"./p-dc9d4be3.js";import"./p-0a24ad5f.js";const w=96;function k(e){return e?e/72*w:0}var x={exports:{}};!function(e){var i,t="http://www.w3.org/",n="".concat(t,"2000/svg"),a="".concat(t,"1999/xlink"),s=[],l=function(e,i){var t={};return Object.keys(e).forEach((function(i){t[i]=e[i]})),i&&Object.keys(i).forEach((function(e){t[e]=i[e]})),t},r=function(e,i){return e.vnodeSelector===i.vnodeSelector&&(e.properties&&i.properties?e.properties.key===i.properties.key&&e.properties.bind===i.properties.bind:!e.properties&&!i.properties)},c=function(e){if("string"!=typeof e)throw new Error("Style values must be strings")},o=function(e,i,t){if(""!==i.vnodeSelector)for(var n=t;n<e.length;n++)if(r(e[n],i))return n;return-1},d=function(e,i,t,n){var a=e[i];if(""!==a.vnodeSelector){var s=a.properties;if(!(s?void 0===s.key?s.bind:s.key:void 0))for(var l=0;l<e.length;l++)if(l!==i&&r(e[l],a))throw{error:new Error("".concat(t.vnodeSelector," had a ").concat(a.vnodeSelector," child ").concat("added"===n?n:"removed",", but there is now more than one. You must add unique key properties to make them distinguishable.")),parentNode:t,childNode:a}}},v=function(e){if(e.properties){var i=e.properties.enterAnimation;i&&i(e.domNode,e.properties)}},p=[],u=!1,g=function(e){(e.children||[]).forEach(g),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},h=function(){u=!1,p.forEach(g),p.length=0},f=function(e){p.push(e),u||(u=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(h,{timeout:16}):setTimeout(h,16))},m=function(e){var i=e.domNode;if(e.properties){var t=e.properties.exitAnimation;if(t){i.style.pointerEvents="none";return void t(i,(function(){i.parentNode&&(i.parentNode.removeChild(i),f(e))}),e.properties)}}i.parentNode&&(i.parentNode.removeChild(i),f(e))},y=function(e,i,t){(function(e,i,t){if(i)for(var n=0,a=i;n<a.length;n++)_(a[n],e,void 0,t)})(e,i.children,t),i.text&&(e.textContent=i.text),function(e,i,t){if(i)for(var s=t.eventHandlerInterceptor,l=Object.keys(i),r=l.length,o=function(r){var o,d=l[r],v=i[d];if("className"===d)throw new Error('Property "className" is not supported, use "class".');if("class"===d)b(e,v,!0);else if("classes"===d)for(var p=Object.keys(v),u=p.length,g=0;g<u;g++){var h=p[g];v[h]&&e.classList.add(h)}else if("styles"===d){var f=Object.keys(v),m=f.length;for(g=0;g<m;g++){var y=f[g],_=v[y];_&&(c(_),t.styleApplyer(e,y,_))}}else if("key"!==d&&null!=v){var w=typeof v;"function"===w?(0===d.lastIndexOf("on",0)&&(s&&(v=s(d,v,e,i)),"oninput"===d&&(o=v,v=function(e){o.apply(this,[e]),e.target["oninput-value"]=e.target.value})),e[d]=v):t.namespace===n?"href"===d?e.setAttributeNS(a,d,v):e.setAttribute(d,v):"string"===w&&"value"!==d&&"innerHTML"!==d?e.setAttribute(d,v):e[d]=v}},d=0;d<r;d++)o(d)}(e,i.properties,t),i.properties&&i.properties.afterCreate&&i.properties.afterCreate.apply(i.properties.bind||i.properties,[e,t,i.vnodeSelector,i.properties,i.children])},_=function(e,i,t,a){var s,r,c=0,o=e.vnodeSelector,d=i.ownerDocument;if(""===o)e.domNode?e.domNode.nodeValue=e.text:(r=e.domNode=d.createTextNode(e.text),void 0!==t?i.insertBefore(r,t):i.appendChild(r));else{for(var v=0;v<=o.length;++v){var p=o.charAt(v);if(v===o.length||"."===p||"#"===p){var u=o.charAt(c-1),g=o.slice(c,v);"."===u?r.classList.add(g):"#"===u?r.id=g:("svg"===g&&(a=l(a,{namespace:n})),void 0!==a.namespace?r=e.domNode=d.createElementNS(a.namespace,g):(r=e.domNode=e.domNode||((null===(s=e.properties)||void 0===s?void 0:s.is)?d.createElement(g,{is:e.properties.is}):d.createElement(g)),"input"===g&&e.properties&&void 0!==e.properties.type&&r.setAttribute("type",e.properties.type)),void 0!==t?i.insertBefore(r,t):r.parentNode!==i&&i.appendChild(r)),c=v+1}}y(r,e,a)}},b=function(e,i,t){i&&i.split(" ").forEach((function(i){i&&e.classList.toggle(i,t)}))};i=function(e,t,p){var u=e.domNode,g=!1;if(e===t)return!1;var h=!1;if(""===t.vnodeSelector){if(t.text!==e.text){var f=u.ownerDocument.createTextNode(t.text);return u.parentNode.replaceChild(f,u),t.domNode=f,!0}t.domNode=u}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(p=l(p,{namespace:n})),e.text!==t.text&&(h=!0,void 0===t.text?u.removeChild(u.firstChild):u.textContent=t.text),t.domNode=u,h=function(e,t,n,a,l){if(n===a)return!1;for(var c,p=(n=n||s).length,u=(a=a||s).length,g=0,h=0,f=!1;h<u;){var y=g<p?n[g]:void 0,b=a[h];if(void 0!==y&&r(y,b))f=i(y,b,l)||f,g++;else{var w=o(n,b,g+1);if(w>=0){for(c=g;c<w;c++)m(n[c]),d(n,c,e,"removed");f=i(n[w],b,l)||f,g=w+1}else _(b,t,g<p?n[g].domNode:void 0,l),v(b),d(a,h,e,"added")}h++}if(p>g)for(c=g;c<p;c++)m(n[c]),d(n,c,e,"removed");return f}(t,u,e.children,t.children,p)||h,h=function(e,i,t,s){if(t){for(var l=!1,r=Object.keys(t),o=r.length,d=0;d<o;d++){var v=r[d],p=t[v],u=i[v];if("class"===v)u!==p&&(b(e,u,!1),b(e,p,!0));else if("classes"===v)for(var g=e.classList,h=Object.keys(p),f=h.length,m=0;m<f;m++){var y=h[m],_=!!p[y];_!==!!u[y]&&(l=!0,_?g.add(y):g.remove(y))}else if("styles"===v){var w=Object.keys(p),k=w.length;for(m=0;m<k;m++){var x=w[m],$=p[x];$!==u[x]&&(l=!0,$?(c($),s.styleApplyer(e,x,$)):s.styleApplyer(e,x,""))}}else if(p||"string"!=typeof u||(p=""),"value"===v){var L=e[v];L!==p&&(e["oninput-value"]?L===e["oninput-value"]:p!==u)&&(e[v]=p,e["oninput-value"]=void 0),p!==u&&(l=!0)}else if(p!==u){var j=typeof p;"function"===j&&s.eventHandlerInterceptor||(s.namespace===n?"href"===v?e.setAttributeNS(a,v,p):e.setAttribute(v,p):"string"===j&&"innerHTML"!==v?"role"===v&&""===p?e.removeAttribute(v):e.setAttribute(v,p):e[v]!==p&&(e[v]=p),l=!0)}}return l}}(u,e.properties,t.properties,p)||h,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[u,p,t.vnodeSelector,t.properties,t.children]);return h&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(u,t.properties,e.properties),g};var w=function(e,t){return{getLastRender:function(){return e},update:function(n){if(e.vnodeSelector!==n.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");var a=e;e=n,i(a,n,t)},domNode:e.domNode}},k={namespace:void 0,performanceLogger:function(){},eventHandlerInterceptor:void 0,styleApplyer:function(e,i,t){"-"===i.charAt(0)?e.style.setProperty(i,t):e.style[i]=t}},x=function(e){return l(k,e)},$={create:function(e,i){return i=x(i),_(e,document.createElement("div"),void 0,i),w(e,i)},append:function(e,i,t){return t=x(t),_(i,e,void 0,t),w(i,t)},insertBefore:function(e,i,t){return t=x(t),_(i,e.parentNode,e,t),w(i,t)},merge:function(e,i,t){return t=x(t),i.domNode=e,y(e,i,t),w(i,t)},replace:function(e,i,t){return t=x(t),_(i,e.parentNode,e,t),e.parentNode.removeChild(e),w(i,t)}},L=function(e,i,t){for(var n=0,a=i.length;n<a;n++){var s=i[n];Array.isArray(s)?L(e,s,t):null!=s&&!1!==s&&("string"==typeof s&&(s={vnodeSelector:"",properties:void 0,children:void 0,text:s.toString(),domNode:null}),t.push(s))}};var j;j=Array.prototype.find?function(e,i){return e.find(i)}:function(e,i){return e.filter(i)[0]};var O=function(e,i,t){return function(){return n};function n(n){t("domEvent",n);var a=i(),s=function(e,i){for(var t=[];e&&e!==i;)t.push(e),e=e.parentNode;return t}(n.currentTarget,a.domNode);s.reverse();var l,r=function(e,i){var t=e;return i.forEach((function(e){t=t&&t.children?j(t.children,(function(i){return i.domNode===e})):void 0})),t}(a.getLastRender(),s);return e.scheduleRender(),r&&(l=r.properties["on".concat(n.type)].apply(r.properties.bind||this,arguments)),t("domEventProcessed",n),l}};e.createCache=function(){var e,i;return{invalidate:function(){i=void 0,e=void 0},result:function(t,n){if(e)for(var a=0;a<t.length;a++)e[a]!==t[a]&&(i=void 0);return i||(i=n(),e=t),i}}},e.createMapping=function(e,i,t){var n=[],a=[];return{results:a,map:function(s){for(var l=s.map(e),r=a.slice(),c=0,o=0;o<s.length;o++){var d=s[o],v=l[o];if(v===n[c])a[o]=r[c],t(d,r[c],o),c++;else{for(var p=!1,u=1;u<n.length+1;u++){var g=(c+u)%n.length;if(n[g]===v){a[o]=r[g],t(s[o],r[g],o),c=g+1,p=!0;break}}p||(a[o]=i(d,o))}}a.length=s.length,n=l}}},e.createProjector=function(e){var i,t,n=x(e),a=n.performanceLogger,s=!0,l=!1,r=[],c=[],o=function(e,t,s){var l;n.eventHandlerInterceptor=O(i,(function(){return l}),a),l=e(t,s(),n),r.push(l),c.push(s)},d=function(){if(t=void 0,s){s=!1,a("renderStart",void 0);for(var e=0;e<r.length;e++){var i=c[e]();a("rendered",void 0),r[e].update(i),a("patched",void 0)}a("renderDone",void 0),s=!0}};return i={renderNow:d,scheduleRender:function(){t||l||(t=requestAnimationFrame(d))},stop:function(){t&&(cancelAnimationFrame(t),t=void 0),l=!0},resume:function(){l=!1,s=!0,i.scheduleRender()},append:function(e,i){o($.append,e,i)},insertBefore:function(e,i){o($.insertBefore,e,i)},merge:function(e,i){o($.merge,e,i)},replace:function(e,i){o($.replace,e,i)},detach:function(e){for(var i=0;i<c.length;i++)if(c[i]===e)return c.splice(i,1),r.splice(i,1)[0];throw new Error("renderFunction was not found")}}},e.dom=$,e.h=function(e,i,t){if(Array.isArray(i))t=i,i=void 0;else if(i&&("string"==typeof i||i.vnodeSelector)||t&&("string"==typeof t||t.vnodeSelector))throw new Error("h called with invalid arguments");var n,a;return t&&1===t.length&&"string"==typeof t[0]?n=t[0]:t&&(L(e,t,a=[]),0===a.length&&(a=void 0)),{vnodeSelector:e,properties:i,children:a,text:""===n?void 0:n,domNode:null}}}(x.exports);const $=x.exports.createProjector(),L=20,j={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function O(i="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===i?e("svg",{height:"4",width:"10"},e("line",{x1:"0",y1:"2",x2:"10",y2:"2",style:t})):e("svg",{height:"10",width:"10"},e("line",{x1:"5",y1:"0",x2:"5",y2:"10",style:t}))}function z(e,i="vertical"){const t=document.createElement("div");return t.style.height=`${L}px`,t.className=j.univariateAboveAndBelowSymbol,null!=e&&(t.style.opacity=e.toString()),$.append(t,O.bind(null,i)),t}function R(e,i,t="vertical",n){e.infos.forEach(((e,a)=>{if(n&&2===a)e.preview=z(i,t);else{const{size:i}=e,n=k(i)+("horizontal"===t?20:10),a="div"===e.preview.tagName.toLowerCase(),s=a?e.preview:document.createElement("div");s&&(s.className=j.univariateAboveAndBelowSymbol),"horizontal"===t?s&&(s.style.width=`${n}px`):s&&(s.style.height=`${n}px`),a||s&&s.appendChild(e.preview),e.preview=s}}))}function E(e,i="classic"){const t=e.infos,n=t[0].size,a=t[t.length-1].size;return"classic"===i?(k(n)+10)/2:(k(n)-k(a))/2}async function A(e,i){if(!e)return Promise.resolve(null);const t=e.infos.map((e=>e.color)),[n]=await b(["esri/symbols/support/symbolUtils"]),a=n.renderColorRampPreviewHTML("full"===i.type?t:"above"===i.type?t.slice(0,3):t.slice(2,5),{width:i.width,height:i.height,align:i.rampAlignment,effectList:i.effectList});return a.className=j.colorRamp,null!=i.opacity&&(a.style.opacity=i.opacity.toString()),Promise.resolve(a)}function F(e,i,t,n="vertical"){const a=function(e,i,t,n="vertical"){let a=0;const s=e.infos,l=Math.floor(s.length/2),r="full"===i||"below"===i?s.length-1:l;for(let e="full"===i||"above"===i?0:l;e<=r;e++)a+=t&&e===l?"horizontal"===n?10:L:k(s[e].size)+("horizontal"===n?20:10);return Math.round(a)}(e,i,t,n),s=e.infos,l=Math.floor(s.length/2),r="full"===i||"above"===i?0:l,c="full"===i||"below"===i?s.length-1:l,o=t?"vertical"===n?L:10:0,d="vertical"===n?10*("full"===i?2:1):20*("full"===i?2:1);return Math.round(a-(k("full"===i?s[r].size+s[c].size:"above"===i?s[r].size:s[c].size)/2+o/2+d/2))}const M="esri-legend__layer-body",C="esri-legend__layer-row",I="esri-legend__layer-cell esri-legend__layer-cell--info",T="esri-legend__layer-cell esri-legend__layer-cell--symbols",N="esri-legend__symbol",S="esri-legend__ramps",P="esri-legend__size-ramp",H="esri-legend__ramp-labels",D="esri-legend__ramp-label",q="esri-univariate-above-and-below-ramp__label",B={display:"flex",alignItems:"flex-start"},U={marginLeft:"3px"},V={display:"table-cell",verticalAlign:"middle"},W=class{constructor(e){i(this,e),this.calculatingFeatureCount=!1,this.legendvm=void 0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"},this.messages=void 0,this.isLoading=!0,this.intLegendId=void 0}handleFilterModeChange(){a(this.filterMode,this.legendvm.view)}async connectedCallback(){if(this.handles)return;const[e]=await b(["esri/core/Handles"]);this.handles=new e}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0});const[e,i]=await b(["esri/intl","esri/core/reactiveUtils"]);this.reactiveUtils=i,this.intl=e}async componentDidLoad(){this.initLegend()}async initLegend(){try{await this.reactiveUtils.whenOnce((()=>{var e;return null===(e=this.legendvm)||void 0===e?void 0:e.view}));const e=async()=>{var e,i,t,n;try{const a=await(null===(t=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===t?void 0:t.load());await(null===(n=null==a?void 0:a.basemap)||void 0===n?void 0:n.load());const l=null==a?void 0:a.allLayers,r=null==l?void 0:l.map((e=>e.load())),c=(await Promise.allSettled(r)).map((e=>"fulfilled"===(null==e?void 0:e.status)&&(null==e?void 0:e.value)?e.value:null)).filter((e=>!!e)),d=[];c.forEach((e=>{var i;(null===(i=this.legendvm)||void 0===i?void 0:i.view)&&d.push(this.legendvm.view.whenLayerView(e))})),await Promise.allSettled(d);const v=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),v)),this.isLoading=!1,this.setupWatchersAndListeners()}catch(e){console.error(e),this.isLoading=!1}};this.legendvm.view.when(e),this.legendvm.view.map.layers.on("after-changes",e)}catch(e){this.isLoading=!1}}disconnectedCallback(){var e,i;null===(e=this.handles)||void 0===e||e.removeAll(),null===(i=this.handles)||void 0===i||i.destroy(),this.handles=null}render(){var i,t,n;const a=this.renderFilteredLayers(),r=s.get("compact")?" instant-apps-interactive-legend__compact":"";return this.isLoading?e("calcite-loader",{key:"interactive-legend-loader",scale:"m",label:null===(i=this.messages)||void 0===i?void 0:i.loading,text:null===(t=this.messages)||void 0===t?void 0:t.loading}):e("div",{key:"interactive-legend-classic-container",class:`${l(this.el)}${r}`},(null==a?void 0:a.length)>0?a:e("div",{class:"esri-legend__message"},null===(n=this.messages)||void 0===n?void 0:n.noLegend))}renderFilteredLayers(){var e,i;return(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.activeLayerInfos)||void 0===i?void 0:i.toArray()).map((e=>this.renderLegendForLayer(e))).filter((e=>!!e))}renderLegendForLayer(i,t){var n,a;if(!i.ready)return null;if(i.children.length){const a=i.children.map((e=>this.renderLegendForLayer(e,!0))).toArray();return e("instant-apps-interactive-legend-group-legend-element",{class:l(this.el),legendvm:this.legendvm,featureCount:this.featureCount,activeLayerInfo:i,isChild:t},e("div",{style:{paddingLeft:"20px"},id:`${null===(n=null==i?void 0:i.layer)||void 0===n?void 0:n.id}-legend-layer`,slot:"content"},a))}const s=i.legendElements;if(s&&!s.length)return null;const r=s.map(((e,t)=>this.renderLegendForElement(e,i.layer,i.effectList,i,t))).filter((e=>!!e));return r.length?e("instant-apps-interactive-legend-layer-element",{class:l(this.el),legendvm:this.legendvm,featureCount:this.featureCount,activeLayerInfo:i,messages:this.messages,isChild:t},e("div",{slot:"content",id:`${null===(a=null==i?void 0:i.layer)||void 0===a?void 0:a.id}-legend-layer`,class:"esri-legend__layer"},r)):null}renderLegendForElement(i,t,n,a,s,c,o){const d="color-ramp"===i.type,v="opacity-ramp"===i.type,p="size-ramp"===i.type;let u=null;const g=r(a,i,s),h="relationship-ramp"===(null==i?void 0:i.type);if("symbol-table"===i.type||p){const l=i.infos.map(((e,l)=>this.renderLegendForElementInfo(e,t,n,p,i,a,s,l,g,o||null))).filter((e=>!!e));l.length&&(u=e("div",{class:M},l))}else"color-ramp"===i.type||"opacity-ramp"===i.type||"heatmap-ramp"===i.type||"stretch-ramp"===i.type?u=this.renderLegendForRamp(i,t.opacity):"relationship-ramp"===i.type?u=e("instant-apps-interactive-legend-relationship",{class:l(this.el),key:"relationship-ramp",filterMode:this.filterMode,activeLayerInfo:a,legendElement:i,messages:this.messages}):"pie-chart-ramp"===i.type?u=this.renderPieChartRamp(i):"univariate-above-and-below-ramp"===i.type?u=this.renderUnivariateAboveAndBelowRamp(i,t.opacity,n):"univariate-color-size-ramp"===i.type&&(u=this.renderUnivariateColorSizeRamp(i,t.opacity,n));if(!u)return null;const f=i.title;let m=null;if("string"==typeof f)m=f;else if(f){const e=this.getTitle(this.messages,f,d||v);m=this.isRendererTitle(f,d||v)&&f.title?`${f.title} (${e})`:e}return e("instant-apps-interactive-legend-legend-element",{class:l(this.el),activeLayerInfo:a,isSizeRamp:p,isChild:c,isColorRamp:d,isRelationshipRamp:h,isInteractive:g,zoomTo:this.zoomTo,legendElement:i,titleText:m,legendvm:this.legendvm,legendElementIndex:s,messages:this.messages},e("div",{slot:"content"},u))}renderPieChartRamp(i){var t;return e("div",{innerHTML:`${null===(t=i.preview)||void 0===t?void 0:t.outerHTML}`})}async renderUnivariateAboveAndBelowRamp(i,t,n){const{sizeRampElement:a,colorRampElement:s}=function(e,i,t="vertical"){const n=e.infos;let a=n.find((({type:e})=>"size-ramp"===e)),s=n.find((({type:e})=>"color-ramp"===e));return a&&(a=Object.assign({},a),a.infos=[...a.infos],R(a,i,t,!0)),s&&(s=Object.assign({},s),s.infos=[...s.infos]),"horizontal"===t&&(null==a||a.infos.reverse(),null==s||s.infos.reverse()),{sizeRampElement:a,colorRampElement:s}}(i,t);if(!a)return null;const l=F(a,"above",!0),r=F(a,"below",!0),c=await A(s,{width:12,height:l,rampAlignment:"vertical",opacity:t,type:"above",effectList:n}),o=await A(s,{width:12,height:r,rampAlignment:"vertical",opacity:t,type:"below",effectList:n}),d=E(a),v=a.infos.map((e=>e.label)),p=v.map(((i,t)=>{const n=2===t;return 0===t?e("div",{class:i?c?q:D:""},i):n?e("div",null):null})),u=v.length-1,g=Math.floor(v.length/2),h=v.map(((i,t)=>t===g||t===u?e("div",{class:i?c?q:D:""},i):null)),f={display:"table-cell",verticalAlign:"middle"},m={marginTop:`${d}px`},y={height:`${l}px`},_={height:`${r}px`};return e("div",{key:"univariate-above-and-below-ramp-preview",style:B},e("div",{class:M},a.infos.map(((i,t)=>e("div",{class:`${C} ${P}`},e("div",{class:N,style:f,innerHTML:`${i.preview.outerHTML}`}),c||t%2!=0?null:e("div",{class:I},v[t]))))),c?e("div",{style:m,key:"color-ramp-preview"},e("div",{style:U},e("div",{style:V},e("div",{class:S},c)),e("div",{style:V},e("div",{class:H,style:y},p))),e("div",{style:U},e("div",{style:V},e("div",{class:S},o)),e("div",{style:V},e("div",{class:H,style:_},h)))):null)}renderUnivariateColorSizeRamp(i,t,n){const{sizeRampElement:a,colorRampElement:s}=function(e,i="vertical"){const t=e.infos;let n=t.find((({type:e})=>"size-ramp"===e)),a=t.find((({type:e})=>"color-ramp"===e));return n&&(n=Object.assign({},n),n.infos=[...n.infos],R(n,null,i,!1)),a&&(a=Object.assign({},a),a.infos=[...a.infos]),"horizontal"===i&&(null==n||n.infos.reverse(),null==a||a.infos.reverse()),{sizeRampElement:n,colorRampElement:a}}(i);if(!a)return null;const l=E(a),r=F(a,"full",!1),c=A(s,{width:12,height:r,rampAlignment:"vertical",opacity:t,type:"full",effectList:n}),o=a.infos.length-1,d=a.infos.map(((i,t)=>0===t||t===o?e("div",{class:i.label?s?q:D:""},i.label):null)),v={display:"table-cell",verticalAlign:"middle"},p={marginTop:`${l}px`},u={height:`${r}px`};return e("div",{key:"univariate-above-and-below-ramp-preview",style:B},e("div",{class:M},a.infos.map((i=>e("div",{class:`${C} ${P}`},e("div",{class:N,style:v,innerHTML:`${i.preview.outerHTML}`}))))),e("div",{style:p,key:"color-ramp-preview"},e("div",{style:U},e("div",{style:V},e("div",{class:S},c)),e("div",{style:V},e("div",{class:H,style:u},d)))))}renderLegendForRamp(i,t){var n;const a=i.infos,s="heatmap-ramp"===i.type,l="stretch-ramp"===i.type,r=i.preview,c="opacity-ramp"===i.type?"esri-legend__opacity-ramp":"";r&&(r.classList.add("esri-legend__color-ramp"),c&&r.classList.add(c)),null!=t&&r&&(r.style.opacity=t.toString());const o=a.map((i=>e("div",{class:i.label?D:""},s?this.messages[i.label]||i.label:l?this.getStretchStopLabel(i):i.label))),d={height:null===(n=null==r?void 0:r.style)||void 0===n?void 0:n.height};return e("div",{class:C},e("div",{class:T,style:Object.assign({},{width:"24px"})},e("div",{ref:e=>{var i;(null==e?void 0:e.firstChild)&&(null===(i=null==e?void 0:e.firstChild)||void 0===i||i.remove()),null==e||e.appendChild(r)},class:S})),e("div",{class:I},e("div",{class:H,style:Object.assign({},d)},o)))}getStretchStopLabel(e){return e.label?this.messages[e.label]+": "+("string"==typeof e.value?e.value:this.intl.formatNumber(e.value,{style:"decimal",notation:e.value.toString().includes("e")?"scientific":"standard"})):""}renderLegendForElementInfo(i,t,n,a,r,p,u,g,h,f){var m,_;if(i.type)return this.renderLegendForElement(i,t,n,p,u,!0,i);let b;if(i.preview?b=e("div",{class:N,innerHTML:`${i.preview.outerHTML}`}):i.src&&(b=this.renderImage(i,t,!1)),!b)return null;const w=a?` ${P}`:"";let k;const x=y(t),$=c(x,f);if(o.data){const e=d(x,t,i,$,g),n=v($?null==$?void 0:$.nestedInfos:x);k=1===(null===(m=null==x?void 0:x.categories)||void 0===m?void 0:m.size)?!(null==e?void 0:e.selected):n||(null==e?void 0:e.selected)}const L=!($&&!(null==i?void 0:i.value))&&h,j=s.get("compact"),O=this.getTitle(this.messages,i.label,!1)||"";return L?e("button",{onClick:this.applyFilter(i,t,g,f),class:`${C} instant-apps-interactive-legend__layer-row--interactive${k?" instant-apps-interactive-legend-element-info--selected":""}`,title:j?`${O}`:void 0},e("div",{class:`${T}${w}`},b),e("div",{class:`${I}`},this.getTitle(this.messages,i.label,!1)||""),this.featureCount&&!j?e("instant-apps-interactive-legend-count",{class:l(this.el),categoryId:$?r.title:null!==(_=i.label)&&void 0!==_?_:null==t?void 0:t.id,activeLayerInfo:p,legendvm:this.legendvm,messages:this.messages,selected:k,legendElement:r,infoIndex:g}):null):e("div",{class:C},e("div",{class:`${T}${w}`},b),e("div",{class:`${I}`},O))}renderImage(i,t,n){const{label:a,src:s,opacity:l}=i,r=n?" esri-legend__imagery-layer-image--stretched":"",c=n?"":` ${N}`,o={opacity:`${null!=l?l:t.opacity}`};return e("img",{alt:this.getTitle(this.messages,a,!1),src:s,width:i.width,height:i.height,class:`$${r}${c}`,style:o})}getTitle(e,i,t){var n,a;if(!i)return;if("string"==typeof i||"number"==typeof i)return i;if("value"in i||"unit"in i)return this.intl.substitute(null!==(n=null==e?void 0:e.dotValue)&&void 0!==n?n:"",i);if("colorName"in i||"bandName"in i)return e[i.colorName]+": "+(e[i.bandName]||i.bandName);if("showCount"in i)return i.showCount?e.clusterCountTitle:null;let s=null;return this.isRampTitle(i,t)?s=i.ratioPercentTotal?"showRatioPercentTotal":i.ratioPercent?"showRatioPercent":i.ratio?"showRatio":i.normField?"showNormField":i.field?"showField":null:this.isRendererTitle(i,t)&&(s=i.normField?"showNormField":i.normByPct?"showNormPct":i.field?"showField":null),s?null===(a=this.intl)||void 0===a?void 0:a.substitute("showField"===s?"{field}":e[s],{field:i.field,normField:i.normField}):""}isRampTitle(e,i){return i}isRendererTitle(e,i){return!i}setupWatchersAndListeners(){var e,i,n,a,l,r,c;const d=null===(a=null===(n=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===n?void 0:n.allLayers)||void 0===a?void 0:a.filter((e=>"feature"===(null==e?void 0:e.type)));d.forEach((async e=>{var i,t,n,a;try{const s=await(null===(t=null===(i=this.legendvm)||void 0===i?void 0:i.view)||void 0===t?void 0:t.whenLayerView(e)),l=`fLayerViewScale-${null==e?void 0:e.id}`;(null===(n=this.handles)||void 0===n?void 0:n.has(l))||null===(a=this.handles)||void 0===a||a.add(s.watch("visibleAtCurrentScale",(async()=>this.createDataForLayer(e))),l)}catch(e){}})),null==d||d.forEach((e=>{var i,t,n;const a=`fLayer-${null==e?void 0:e.id}`;(null===(i=this.handles)||void 0===i?void 0:i.has(a))||null===(t=this.handles)||void 0===t||t.add(null===(n=this.reactiveUtils)||void 0===n?void 0:n.watch((()=>null==e?void 0:e.visible),(async()=>this.createDataForLayer(e))),a)})),null===(l=this.handles)||void 0===l||l.add(this.reactiveUtils.when((()=>this.legendvm),(()=>{this.reactiveUtils.watch((()=>{var e,i;return null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating}),(()=>{var e,i;this.calculatingFeatureCount||(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating)&&(this.calculatingFeatureCount=!0,this.reactiveUtils.when((()=>{var e,i;return!(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating)}),(async()=>{const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e)),this.calculatingFeatureCount=!1}),{once:!0,initial:!0}))}),{initial:!0})}),{initial:!0,once:!0})),null===(r=this.handles)||void 0===r||r.add(this.reactiveUtils.on((()=>{var e;return null===(e=this.legendvm)||void 0===e?void 0:e.activeLayerInfos}),"change",(async e=>{var i;const n=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),n)),t(this.el),null===(i=this.handles)||void 0===i||i.add(this.reactiveUtils.on((()=>e.children),"change",(async()=>{const e=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),e)),t(this.el)})))}))),null===(c=this.handles)||void 0===c||c.add(this.reactiveUtils.on((()=>{var e,i,t;return null===(t=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===t?void 0:t.layers}),"after-changes",(async()=>{const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e)),this.calculatingFeatureCount=!1})))}async createDataForLayer(e){var i;const t=s.get("data"),n=null==t?void 0:t[null==e?void 0:e.id],a=g(null===(i=this.legendvm)||void 0===i?void 0:i.activeLayerInfos),l=null==a?void 0:a.find((i=>{var t;return(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.id)===(null==e?void 0:e.id)}));if(!n&&l){const i=await h(this.legendvm,l,this.reactiveUtils);if(f({intLegendLayerData:i,layerId:null==e?void 0:e.id}),this.featureCount){const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e))}}}applyFilter(e,i,t,n){return async()=>{var a;const s=Object.assign({},null===(a=o.data)||void 0===a?void 0:a[null==i?void 0:i.id]);n?await m(s,e,t,this.filterMode,n):await m(s,e,t,this.filterMode),f({intLegendLayerData:s,layerId:null==i?void 0:i.id})}}get el(){return n(this)}static get watchers(){return{filterMode:["handleFilterModeChange"]}}};W.style=".sc-instant-apps-interactive-legend-classic-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-caption-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-field-name-font-size:1rem;--instant-apps-interactive-legend-total-feature-count-font-size:0.875rem;--instant-apps-interactive-legend-info-font-size:0.875rem;--instant-apps-interactive-legend-info-item-background--selected:#c7ebff;--instant-apps-interactive-legend-info-item-background--selected--dark:#009af2;--instant-apps-interactive-legend-info-item-background--hover:#e9e9e9;--instant-apps-interactive-legend-info-item-background--hover--dark:#4a4a4a;--instant-apps-interactive-legend-info-item-color--selected:var(--calcite-color-text-2);--instant-apps-interactive-legend-secondary-background-color:var(--calcite-color-background);--instant-apps-interactive-legend-ui-margin:20px 15px;--instant-apps-interactive-legend-ui-padding:20px 15px}.sc-instant-apps-interactive-legend-classic-h .esri-legend__service.sc-instant-apps-interactive-legend-classic{padding:0}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-body.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__group-layer-child.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-child-table.sc-instant-apps-interactive-legend-classic{margin:0;overflow:hidden}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic calcite-action.sc-instant-apps-interactive-legend-classic{margin-right:5px}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-classic{white-space:nowrap}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-classic calcite-button.sc-instant-apps-interactive-legend-classic{margin:2px}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{font-weight:var(--instant-apps-interactive-legend-caption-font-weight)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell.esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{font-size:var(--instant-apps-interactive-legend-info-font-size);text-align:left}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{display:flex;align-items:center}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-body.sc-instant-apps-interactive-legend-classic{display:block;margin:var(--instant-apps-interactive-legend-ui-margin)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.instant-apps-interactive-legend__nested-unique-symbol.sc-instant-apps-interactive-legend-classic>.esri-legend__layer-body.sc-instant-apps-interactive-legend-classic{margin:0}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{display:table-row}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell.sc-instant-apps-interactive-legend-classic{display:table-cell}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--symbols.sc-instant-apps-interactive-legend-classic{justify-content:center;width:20%}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{width:65%}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{margin:1px;background:transparent;border:none;width:100%}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{position:relative}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic{background-color:var(--instant-apps-interactive-legend-info-item-background--selected)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic{cursor:pointer;background-color:var(--instant-apps-interactive-legend-info-item-background--selected--dark)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{color:var(--calcite-color-text-inverse)}.sc-instant-apps-interactive-legend-classic-h .hide.sc-instant-apps-interactive-legend-classic{display:none}.instant-apps-interactive-legend__compact.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{--instant-apps-interactive-legend-ui-padding:10px 5px}.instant-apps-interactive-legend__compact.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;line-clamp:2;line-height:1.3125rem;max-height:2.625rem}@media (min-width: 992px){.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{cursor:pointer}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover.instant-apps-interactive-legend-element-info--selected{background-color:#e2f2fe}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover--dark)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover.instant-apps-interactive-legend-element-info--selected{background-color:#26a9f4}}";export{W as instant_apps_interactive_legend_classic}
6
+ import{h as e,r as i,f as t,g as n}from"./p-4e6eb06e.js";import{h as a,s,g as l,v as r,a as c,i as o,b as d,c as v,d as p,e as u,f as g,j as h,u as f,k as m,l as y}from"./p-09543b4e.js";import{c as _}from"./p-d4056c1c.js";import{l as b}from"./p-d001e961.js";import"./p-dc9d4be3.js";import"./p-0a24ad5f.js";const w=96;function k(e){return e?e/72*w:0}var x={exports:{}};!function(e){var i,t="http://www.w3.org/",n="".concat(t,"2000/svg"),a="".concat(t,"1999/xlink"),s=[],l=function(e,i){var t={};return Object.keys(e).forEach((function(i){t[i]=e[i]})),i&&Object.keys(i).forEach((function(e){t[e]=i[e]})),t},r=function(e,i){return e.vnodeSelector===i.vnodeSelector&&(e.properties&&i.properties?e.properties.key===i.properties.key&&e.properties.bind===i.properties.bind:!e.properties&&!i.properties)},c=function(e){if("string"!=typeof e)throw new Error("Style values must be strings")},o=function(e,i,t){if(""!==i.vnodeSelector)for(var n=t;n<e.length;n++)if(r(e[n],i))return n;return-1},d=function(e,i,t,n){var a=e[i];if(""!==a.vnodeSelector){var s=a.properties;if(!(s?void 0===s.key?s.bind:s.key:void 0))for(var l=0;l<e.length;l++)if(l!==i&&r(e[l],a))throw{error:new Error("".concat(t.vnodeSelector," had a ").concat(a.vnodeSelector," child ").concat("added"===n?n:"removed",", but there is now more than one. You must add unique key properties to make them distinguishable.")),parentNode:t,childNode:a}}},v=function(e){if(e.properties){var i=e.properties.enterAnimation;i&&i(e.domNode,e.properties)}},p=[],u=!1,g=function(e){(e.children||[]).forEach(g),e.properties&&e.properties.afterRemoved&&e.properties.afterRemoved.apply(e.properties.bind||e.properties,[e.domNode])},h=function(){u=!1,p.forEach(g),p.length=0},f=function(e){p.push(e),u||(u=!0,"undefined"!=typeof window&&"requestIdleCallback"in window?window.requestIdleCallback(h,{timeout:16}):setTimeout(h,16))},m=function(e){var i=e.domNode;if(e.properties){var t=e.properties.exitAnimation;if(t){i.style.pointerEvents="none";return void t(i,(function(){i.parentNode&&(i.parentNode.removeChild(i),f(e))}),e.properties)}}i.parentNode&&(i.parentNode.removeChild(i),f(e))},y=function(e,i,t){(function(e,i,t){if(i)for(var n=0,a=i;n<a.length;n++)_(a[n],e,void 0,t)})(e,i.children,t),i.text&&(e.textContent=i.text),function(e,i,t){if(i)for(var s=t.eventHandlerInterceptor,l=Object.keys(i),r=l.length,o=function(r){var o,d=l[r],v=i[d];if("className"===d)throw new Error('Property "className" is not supported, use "class".');if("class"===d)b(e,v,!0);else if("classes"===d)for(var p=Object.keys(v),u=p.length,g=0;g<u;g++){var h=p[g];v[h]&&e.classList.add(h)}else if("styles"===d){var f=Object.keys(v),m=f.length;for(g=0;g<m;g++){var y=f[g],_=v[y];_&&(c(_),t.styleApplyer(e,y,_))}}else if("key"!==d&&null!=v){var w=typeof v;"function"===w?(0===d.lastIndexOf("on",0)&&(s&&(v=s(d,v,e,i)),"oninput"===d&&(o=v,v=function(e){o.apply(this,[e]),e.target["oninput-value"]=e.target.value})),e[d]=v):t.namespace===n?"href"===d?e.setAttributeNS(a,d,v):e.setAttribute(d,v):"string"===w&&"value"!==d&&"innerHTML"!==d?e.setAttribute(d,v):e[d]=v}},d=0;d<r;d++)o(d)}(e,i.properties,t),i.properties&&i.properties.afterCreate&&i.properties.afterCreate.apply(i.properties.bind||i.properties,[e,t,i.vnodeSelector,i.properties,i.children])},_=function(e,i,t,a){var s,r,c=0,o=e.vnodeSelector,d=i.ownerDocument;if(""===o)e.domNode?e.domNode.nodeValue=e.text:(r=e.domNode=d.createTextNode(e.text),void 0!==t?i.insertBefore(r,t):i.appendChild(r));else{for(var v=0;v<=o.length;++v){var p=o.charAt(v);if(v===o.length||"."===p||"#"===p){var u=o.charAt(c-1),g=o.slice(c,v);"."===u?r.classList.add(g):"#"===u?r.id=g:("svg"===g&&(a=l(a,{namespace:n})),void 0!==a.namespace?r=e.domNode=d.createElementNS(a.namespace,g):(r=e.domNode=e.domNode||((null===(s=e.properties)||void 0===s?void 0:s.is)?d.createElement(g,{is:e.properties.is}):d.createElement(g)),"input"===g&&e.properties&&void 0!==e.properties.type&&r.setAttribute("type",e.properties.type)),void 0!==t?i.insertBefore(r,t):r.parentNode!==i&&i.appendChild(r)),c=v+1}}y(r,e,a)}},b=function(e,i,t){i&&i.split(" ").forEach((function(i){i&&e.classList.toggle(i,t)}))};i=function(e,t,p){var u=e.domNode,g=!1;if(e===t)return!1;var h=!1;if(""===t.vnodeSelector){if(t.text!==e.text){var f=u.ownerDocument.createTextNode(t.text);return u.parentNode.replaceChild(f,u),t.domNode=f,!0}t.domNode=u}else 0===t.vnodeSelector.lastIndexOf("svg",0)&&(p=l(p,{namespace:n})),e.text!==t.text&&(h=!0,void 0===t.text?u.removeChild(u.firstChild):u.textContent=t.text),t.domNode=u,h=function(e,t,n,a,l){if(n===a)return!1;for(var c,p=(n=n||s).length,u=(a=a||s).length,g=0,h=0,f=!1;h<u;){var y=g<p?n[g]:void 0,b=a[h];if(void 0!==y&&r(y,b))f=i(y,b,l)||f,g++;else{var w=o(n,b,g+1);if(w>=0){for(c=g;c<w;c++)m(n[c]),d(n,c,e,"removed");f=i(n[w],b,l)||f,g=w+1}else _(b,t,g<p?n[g].domNode:void 0,l),v(b),d(a,h,e,"added")}h++}if(p>g)for(c=g;c<p;c++)m(n[c]),d(n,c,e,"removed");return f}(t,u,e.children,t.children,p)||h,h=function(e,i,t,s){if(t){for(var l=!1,r=Object.keys(t),o=r.length,d=0;d<o;d++){var v=r[d],p=t[v],u=i[v];if("class"===v)u!==p&&(b(e,u,!1),b(e,p,!0));else if("classes"===v)for(var g=e.classList,h=Object.keys(p),f=h.length,m=0;m<f;m++){var y=h[m],_=!!p[y];_!==!!u[y]&&(l=!0,_?g.add(y):g.remove(y))}else if("styles"===v){var w=Object.keys(p),k=w.length;for(m=0;m<k;m++){var x=w[m],$=p[x];$!==u[x]&&(l=!0,$?(c($),s.styleApplyer(e,x,$)):s.styleApplyer(e,x,""))}}else if(p||"string"!=typeof u||(p=""),"value"===v){var L=e[v];L!==p&&(e["oninput-value"]?L===e["oninput-value"]:p!==u)&&(e[v]=p,e["oninput-value"]=void 0),p!==u&&(l=!0)}else if(p!==u){var j=typeof p;"function"===j&&s.eventHandlerInterceptor||(s.namespace===n?"href"===v?e.setAttributeNS(a,v,p):e.setAttribute(v,p):"string"===j&&"innerHTML"!==v?"role"===v&&""===p?e.removeAttribute(v):e.setAttribute(v,p):e[v]!==p&&(e[v]=p),l=!0)}}return l}}(u,e.properties,t.properties,p)||h,t.properties&&t.properties.afterUpdate&&t.properties.afterUpdate.apply(t.properties.bind||t.properties,[u,p,t.vnodeSelector,t.properties,t.children]);return h&&t.properties&&t.properties.updateAnimation&&t.properties.updateAnimation(u,t.properties,e.properties),g};var w=function(e,t){return{getLastRender:function(){return e},update:function(n){if(e.vnodeSelector!==n.vnodeSelector)throw new Error("The selector for the root VNode may not be changed. (consider using dom.merge and add one extra level to the virtual DOM)");var a=e;e=n,i(a,n,t)},domNode:e.domNode}},k={namespace:void 0,performanceLogger:function(){},eventHandlerInterceptor:void 0,styleApplyer:function(e,i,t){"-"===i.charAt(0)?e.style.setProperty(i,t):e.style[i]=t}},x=function(e){return l(k,e)},$={create:function(e,i){return i=x(i),_(e,document.createElement("div"),void 0,i),w(e,i)},append:function(e,i,t){return t=x(t),_(i,e,void 0,t),w(i,t)},insertBefore:function(e,i,t){return t=x(t),_(i,e.parentNode,e,t),w(i,t)},merge:function(e,i,t){return t=x(t),i.domNode=e,y(e,i,t),w(i,t)},replace:function(e,i,t){return t=x(t),_(i,e.parentNode,e,t),e.parentNode.removeChild(e),w(i,t)}},L=function(e,i,t){for(var n=0,a=i.length;n<a;n++){var s=i[n];Array.isArray(s)?L(e,s,t):null!=s&&!1!==s&&("string"==typeof s&&(s={vnodeSelector:"",properties:void 0,children:void 0,text:s.toString(),domNode:null}),t.push(s))}};var j;j=Array.prototype.find?function(e,i){return e.find(i)}:function(e,i){return e.filter(i)[0]};var O=function(e,i,t){return function(){return n};function n(n){t("domEvent",n);var a=i(),s=function(e,i){for(var t=[];e&&e!==i;)t.push(e),e=e.parentNode;return t}(n.currentTarget,a.domNode);s.reverse();var l,r=function(e,i){var t=e;return i.forEach((function(e){t=t&&t.children?j(t.children,(function(i){return i.domNode===e})):void 0})),t}(a.getLastRender(),s);return e.scheduleRender(),r&&(l=r.properties["on".concat(n.type)].apply(r.properties.bind||this,arguments)),t("domEventProcessed",n),l}};e.createCache=function(){var e,i;return{invalidate:function(){i=void 0,e=void 0},result:function(t,n){if(e)for(var a=0;a<t.length;a++)e[a]!==t[a]&&(i=void 0);return i||(i=n(),e=t),i}}},e.createMapping=function(e,i,t){var n=[],a=[];return{results:a,map:function(s){for(var l=s.map(e),r=a.slice(),c=0,o=0;o<s.length;o++){var d=s[o],v=l[o];if(v===n[c])a[o]=r[c],t(d,r[c],o),c++;else{for(var p=!1,u=1;u<n.length+1;u++){var g=(c+u)%n.length;if(n[g]===v){a[o]=r[g],t(s[o],r[g],o),c=g+1,p=!0;break}}p||(a[o]=i(d,o))}}a.length=s.length,n=l}}},e.createProjector=function(e){var i,t,n=x(e),a=n.performanceLogger,s=!0,l=!1,r=[],c=[],o=function(e,t,s){var l;n.eventHandlerInterceptor=O(i,(function(){return l}),a),l=e(t,s(),n),r.push(l),c.push(s)},d=function(){if(t=void 0,s){s=!1,a("renderStart",void 0);for(var e=0;e<r.length;e++){var i=c[e]();a("rendered",void 0),r[e].update(i),a("patched",void 0)}a("renderDone",void 0),s=!0}};return i={renderNow:d,scheduleRender:function(){t||l||(t=requestAnimationFrame(d))},stop:function(){t&&(cancelAnimationFrame(t),t=void 0),l=!0},resume:function(){l=!1,s=!0,i.scheduleRender()},append:function(e,i){o($.append,e,i)},insertBefore:function(e,i){o($.insertBefore,e,i)},merge:function(e,i){o($.merge,e,i)},replace:function(e,i){o($.replace,e,i)},detach:function(e){for(var i=0;i<c.length;i++)if(c[i]===e)return c.splice(i,1),r.splice(i,1)[0];throw new Error("renderFunction was not found")}}},e.dom=$,e.h=function(e,i,t){if(Array.isArray(i))t=i,i=void 0;else if(i&&("string"==typeof i||i.vnodeSelector)||t&&("string"==typeof t||t.vnodeSelector))throw new Error("h called with invalid arguments");var n,a;return t&&1===t.length&&"string"==typeof t[0]?n=t[0]:t&&(L(e,t,a=[]),0===a.length&&(a=void 0)),{vnodeSelector:e,properties:i,children:a,text:""===n?void 0:n,domNode:null}}}(x.exports);const $=x.exports.createProjector(),L=20,j={univariateAboveAndBelowSymbol:"esri-univariate-above-and-below-ramp__symbol",colorRamp:"esri-legend__color-ramp"};function O(i="vertical"){const t="stroke:rgb(200, 200, 200);stroke-width:1";return"vertical"===i?e("svg",{height:"4",width:"10"},e("line",{x1:"0",y1:"2",x2:"10",y2:"2",style:t})):e("svg",{height:"10",width:"10"},e("line",{x1:"5",y1:"0",x2:"5",y2:"10",style:t}))}function z(e,i="vertical"){const t=document.createElement("div");return t.style.height=`${L}px`,t.className=j.univariateAboveAndBelowSymbol,null!=e&&(t.style.opacity=e.toString()),$.append(t,O.bind(null,i)),t}function R(e,i,t="vertical",n){e.infos.forEach(((e,a)=>{if(n&&2===a)e.preview=z(i,t);else{const{size:i}=e,n=k(i)+("horizontal"===t?20:10),a="div"===e.preview.tagName.toLowerCase(),s=a?e.preview:document.createElement("div");s&&(s.className=j.univariateAboveAndBelowSymbol),"horizontal"===t?s&&(s.style.width=`${n}px`):s&&(s.style.height=`${n}px`),a||s&&s.appendChild(e.preview),e.preview=s}}))}function E(e,i="classic"){const t=e.infos,n=t[0].size,a=t[t.length-1].size;return"classic"===i?(k(n)+10)/2:(k(n)-k(a))/2}async function A(e,i){if(!e)return Promise.resolve(null);const t=e.infos.map((e=>e.color)),[n]=await b(["esri/symbols/support/symbolUtils"]),a=n.renderColorRampPreviewHTML("full"===i.type?t:"above"===i.type?t.slice(0,3):t.slice(2,5),{width:i.width,height:i.height,align:i.rampAlignment,effectList:i.effectList});return a.className=j.colorRamp,null!=i.opacity&&(a.style.opacity=i.opacity.toString()),Promise.resolve(a)}function F(e,i,t,n="vertical"){const a=function(e,i,t,n="vertical"){let a=0;const s=e.infos,l=Math.floor(s.length/2),r="full"===i||"below"===i?s.length-1:l;for(let e="full"===i||"above"===i?0:l;e<=r;e++)a+=t&&e===l?"horizontal"===n?10:L:k(s[e].size)+("horizontal"===n?20:10);return Math.round(a)}(e,i,t,n),s=e.infos,l=Math.floor(s.length/2),r="full"===i||"above"===i?0:l,c="full"===i||"below"===i?s.length-1:l,o=t?"vertical"===n?L:10:0,d="vertical"===n?10*("full"===i?2:1):20*("full"===i?2:1);return Math.round(a-(k("full"===i?s[r].size+s[c].size:"above"===i?s[r].size:s[c].size)/2+o/2+d/2))}const M="esri-legend__layer-body",C="esri-legend__layer-row",I="esri-legend__layer-cell esri-legend__layer-cell--info",T="esri-legend__layer-cell esri-legend__layer-cell--symbols",N="esri-legend__symbol",S="esri-legend__ramps",P="esri-legend__size-ramp",H="esri-legend__ramp-labels",D="esri-legend__ramp-label",q="esri-univariate-above-and-below-ramp__label",B={display:"flex",alignItems:"flex-start"},U={marginLeft:"3px"},V={display:"table-cell",verticalAlign:"middle"},W=class{constructor(e){i(this,e),this.calculatingFeatureCount=!1,this.legendvm=void 0,this.zoomTo=!1,this.featureCount=!1,this.filterMode={type:"filter"},this.messages=void 0,this.isLoading=!0,this.intLegendId=void 0}handleFilterModeChange(){a(this.filterMode,this.legendvm.view)}async connectedCallback(){if(this.handles)return;const[e]=await b(["esri/core/Handles"]);this.handles=new e}async componentWillLoad(){new MutationObserver((()=>{t(this.el)})).observe(this.el,{attributes:!0});const[e,i]=await b(["esri/intl","esri/core/reactiveUtils"]);this.reactiveUtils=i,this.intl=e}async componentDidLoad(){this.initLegend()}async initLegend(){try{await this.reactiveUtils.whenOnce((()=>{var e;return null===(e=this.legendvm)||void 0===e?void 0:e.view}));const e=async()=>{var e,i,t,n;try{const a=await(null===(t=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===t?void 0:t.load());await(null===(n=null==a?void 0:a.basemap)||void 0===n?void 0:n.load());const l=null==a?void 0:a.allLayers,r=null==l?void 0:l.map((e=>e.load())),c=(await Promise.allSettled(r)).map((e=>"fulfilled"===(null==e?void 0:e.status)&&(null==e?void 0:e.value)?e.value:null)).filter((e=>!!e)),d=[];c.forEach((e=>{var i;(null===(i=this.legendvm)||void 0===i?void 0:i.view)&&d.push(this.legendvm.view.whenLayerView(e))})),await Promise.allSettled(d);const v=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),v)),this.isLoading=!1,this.setupWatchersAndListeners()}catch(e){console.error(e),this.isLoading=!1}};this.legendvm.view.when(e),this.legendvm.view.map.layers.on("after-changes",e)}catch(e){this.isLoading=!1}}disconnectedCallback(){var e,i;null===(e=this.handles)||void 0===e||e.removeAll(),null===(i=this.handles)||void 0===i||i.destroy(),this.handles=null}render(){var i,t,n;const a=this.renderFilteredLayers(),r=s.get("compact")?" instant-apps-interactive-legend__compact":"";return this.isLoading?e("calcite-loader",{key:"interactive-legend-loader",scale:"m",label:null===(i=this.messages)||void 0===i?void 0:i.loading,text:null===(t=this.messages)||void 0===t?void 0:t.loading}):e("div",{key:"interactive-legend-classic-container",class:`${l(this.el)}${r}`},(null==a?void 0:a.length)>0?a:e("div",{class:"esri-legend__message"},null===(n=this.messages)||void 0===n?void 0:n.noLegend))}renderFilteredLayers(){var e,i;return(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.activeLayerInfos)||void 0===i?void 0:i.toArray()).map((e=>this.renderLegendForLayer(e))).filter((e=>!!e))}renderLegendForLayer(i,t){var n,a;if(!i.ready)return null;if(i.children.length){const a=i.children.map((e=>this.renderLegendForLayer(e,!0))).toArray();return e("instant-apps-interactive-legend-group-legend-element",{class:l(this.el),legendvm:this.legendvm,featureCount:this.featureCount,activeLayerInfo:i,isChild:t},e("div",{style:{paddingLeft:"20px"},id:`${null===(n=null==i?void 0:i.layer)||void 0===n?void 0:n.id}-legend-layer`,slot:"content"},a))}const s=i.legendElements;if(s&&!s.length)return null;const r=s.map(((e,t)=>this.renderLegendForElement(e,i.layer,i.effectList,i,t))).filter((e=>!!e));return r.length?e("instant-apps-interactive-legend-layer-element",{class:l(this.el),legendvm:this.legendvm,featureCount:this.featureCount,activeLayerInfo:i,messages:this.messages,isChild:t},e("div",{slot:"content",id:`${null===(a=null==i?void 0:i.layer)||void 0===a?void 0:a.id}-legend-layer`,class:"esri-legend__layer"},r)):null}renderLegendForElement(i,t,n,a,s,c,o){const d="color-ramp"===i.type,v="opacity-ramp"===i.type,p="size-ramp"===i.type;let u=null;const g=r(a,i,s),h="relationship-ramp"===(null==i?void 0:i.type);if("symbol-table"===i.type||p){const l=i.infos.map(((e,l)=>this.renderLegendForElementInfo(e,t,n,p,i,a,s,l,g,o||null))).filter((e=>!!e));l.length&&(u=e("div",{class:M},l))}else"color-ramp"===i.type||"opacity-ramp"===i.type||"heatmap-ramp"===i.type||"stretch-ramp"===i.type?u=this.renderLegendForRamp(i,t.opacity):"relationship-ramp"===i.type?u=e("instant-apps-interactive-legend-relationship",{class:l(this.el),key:"relationship-ramp",filterMode:this.filterMode,activeLayerInfo:a,legendElement:i,messages:this.messages}):"pie-chart-ramp"===i.type?u=this.renderPieChartRamp(i):"univariate-above-and-below-ramp"===i.type?u=this.renderUnivariateAboveAndBelowRamp(i,t.opacity,n):"univariate-color-size-ramp"===i.type&&(u=this.renderUnivariateColorSizeRamp(i,t.opacity,n));if(!u)return null;const f=i.title;let m=null;if("string"==typeof f)m=f;else if(f){const e=this.getTitle(this.messages,f,d||v);m=this.isRendererTitle(f,d||v)&&f.title?`${f.title} (${e})`:e}return e("instant-apps-interactive-legend-legend-element",{class:l(this.el),activeLayerInfo:a,isSizeRamp:p,isChild:c,isColorRamp:d,isRelationshipRamp:h,isInteractive:g,zoomTo:this.zoomTo,legendElement:i,titleText:m,legendvm:this.legendvm,legendElementIndex:s,messages:this.messages},e("div",{slot:"content"},u))}renderPieChartRamp(i){var t;return e("div",{innerHTML:`${null===(t=i.preview)||void 0===t?void 0:t.outerHTML}`})}async renderUnivariateAboveAndBelowRamp(i,t,n){const{sizeRampElement:a,colorRampElement:s}=function(e,i,t="vertical"){const n=e.infos;let a=n.find((({type:e})=>"size-ramp"===e)),s=n.find((({type:e})=>"color-ramp"===e));return a&&(a=Object.assign({},a),a.infos=[...a.infos],R(a,i,t,!0)),s&&(s=Object.assign({},s),s.infos=[...s.infos]),"horizontal"===t&&(null==a||a.infos.reverse(),null==s||s.infos.reverse()),{sizeRampElement:a,colorRampElement:s}}(i,t);if(!a)return null;const l=F(a,"above",!0),r=F(a,"below",!0),c=await A(s,{width:12,height:l,rampAlignment:"vertical",opacity:t,type:"above",effectList:n}),o=await A(s,{width:12,height:r,rampAlignment:"vertical",opacity:t,type:"below",effectList:n}),d=E(a),v=a.infos.map((e=>e.label)),p=v.map(((i,t)=>{const n=2===t;return 0===t?e("div",{class:i?c?q:D:""},i):n?e("div",null):null})),u=v.length-1,g=Math.floor(v.length/2),h=v.map(((i,t)=>t===g||t===u?e("div",{class:i?c?q:D:""},i):null)),f={display:"table-cell",verticalAlign:"middle"},m={marginTop:`${d}px`},y={height:`${l}px`},_={height:`${r}px`};return e("div",{key:"univariate-above-and-below-ramp-preview",style:B},e("div",{class:M},a.infos.map(((i,t)=>e("div",{class:`${C} ${P}`},e("div",{class:N,style:f,innerHTML:`${i.preview.outerHTML}`}),c||t%2!=0?null:e("div",{class:I},v[t]))))),c?e("div",{style:m,key:"color-ramp-preview"},e("div",{style:U},e("div",{style:V},e("div",{class:S},c)),e("div",{style:V},e("div",{class:H,style:y},p))),e("div",{style:U},e("div",{style:V},e("div",{class:S},o)),e("div",{style:V},e("div",{class:H,style:_},h)))):null)}renderUnivariateColorSizeRamp(i,t,n){const{sizeRampElement:a,colorRampElement:s}=function(e,i="vertical"){const t=e.infos;let n=t.find((({type:e})=>"size-ramp"===e)),a=t.find((({type:e})=>"color-ramp"===e));return n&&(n=Object.assign({},n),n.infos=[...n.infos],R(n,null,i,!1)),a&&(a=Object.assign({},a),a.infos=[...a.infos]),"horizontal"===i&&(null==n||n.infos.reverse(),null==a||a.infos.reverse()),{sizeRampElement:n,colorRampElement:a}}(i);if(!a)return null;const l=E(a),r=F(a,"full",!1),c=A(s,{width:12,height:r,rampAlignment:"vertical",opacity:t,type:"full",effectList:n}),o=a.infos.length-1,d=a.infos.map(((i,t)=>0===t||t===o?e("div",{class:i.label?s?q:D:""},i.label):null)),v={display:"table-cell",verticalAlign:"middle"},p={marginTop:`${l}px`},u={height:`${r}px`};return e("div",{key:"univariate-above-and-below-ramp-preview",style:B},e("div",{class:M},a.infos.map((i=>e("div",{class:`${C} ${P}`},e("div",{class:N,style:v,innerHTML:`${i.preview.outerHTML}`}))))),e("div",{style:p,key:"color-ramp-preview"},e("div",{style:U},e("div",{style:V},e("div",{class:S},c)),e("div",{style:V},e("div",{class:H,style:u},d)))))}renderLegendForRamp(i,t){var n;const a=i.infos,s="heatmap-ramp"===i.type,l="stretch-ramp"===i.type,r=i.preview,c="opacity-ramp"===i.type?"esri-legend__opacity-ramp":"";r&&(r.classList.add("esri-legend__color-ramp"),c&&r.classList.add(c)),null!=t&&r&&(r.style.opacity=t.toString());const o=a.map((i=>e("div",{class:i.label?D:""},s?this.messages[i.label]||i.label:l?this.getStretchStopLabel(i):i.label))),d={height:null===(n=null==r?void 0:r.style)||void 0===n?void 0:n.height};return e("div",{class:C},e("div",{class:T,style:Object.assign({},{width:"24px"})},e("div",{ref:e=>{var i;(null==e?void 0:e.firstChild)&&(null===(i=null==e?void 0:e.firstChild)||void 0===i||i.remove()),null==e||e.appendChild(r)},class:S})),e("div",{class:I},e("div",{class:H,style:Object.assign({},d)},o)))}getStretchStopLabel(e){return e.label?this.messages[e.label]+": "+("string"==typeof e.value?e.value:this.intl.formatNumber(e.value,{style:"decimal",notation:e.value.toString().includes("e")?"scientific":"standard"})):""}renderLegendForElementInfo(i,t,n,a,r,p,u,g,h,f){var m,_;if(i.type)return this.renderLegendForElement(i,t,n,p,u,!0,i);let b;if(i.preview?b=e("div",{class:N,innerHTML:`${i.preview.outerHTML}`}):i.src&&(b=this.renderImage(i,t,!1)),!b)return null;const w=a?` ${P}`:"";let k;const x=y(t),$=c(x,f);if(o.data){const e=d(x,t,i,$,g),n=v($?null==$?void 0:$.nestedInfos:x);k=1===(null===(m=null==x?void 0:x.categories)||void 0===m?void 0:m.size)?!(null==e?void 0:e.selected):n||(null==e?void 0:e.selected)}const L=!($&&!(null==i?void 0:i.value))&&h,j=s.get("compact"),O=this.getTitle(this.messages,i.label,!1)||"";return L?e("button",{onClick:this.applyFilter(i,t,g,f),class:`${C} instant-apps-interactive-legend__layer-row--interactive${k?" instant-apps-interactive-legend-element-info--selected":""}`,title:j?`${O}`:void 0},e("div",{class:`${T}${w}`},b),e("div",{class:`${I}`},this.getTitle(this.messages,i.label,!1)||""),this.featureCount&&!j?e("instant-apps-interactive-legend-count",{class:l(this.el),categoryId:$?r.title:null!==(_=i.label)&&void 0!==_?_:null==t?void 0:t.id,activeLayerInfo:p,legendvm:this.legendvm,messages:this.messages,selected:k,legendElement:r,infoIndex:g}):null):e("div",{class:C},e("div",{class:`${T}${w}`},b),e("div",{class:`${I}`},O))}renderImage(i,t,n){const{label:a,src:s,opacity:l}=i,r=n?" esri-legend__imagery-layer-image--stretched":"",c=n?"":` ${N}`,o={opacity:`${null!=l?l:t.opacity}`};return e("img",{alt:this.getTitle(this.messages,a,!1),src:s,width:i.width,height:i.height,class:`$${r}${c}`,style:o})}getTitle(e,i,t){var n,a;if(!i)return;if("string"==typeof i||"number"==typeof i)return i;if("value"in i||"unit"in i)return this.intl.substitute(null!==(n=null==e?void 0:e.dotValue)&&void 0!==n?n:"",i);if("colorName"in i||"bandName"in i)return e[i.colorName]+": "+(e[i.bandName]||i.bandName);if("showCount"in i)return i.showCount?e.clusterCountTitle:null;let s=null;return this.isRampTitle(i,t)?s=i.ratioPercentTotal?"showRatioPercentTotal":i.ratioPercent?"showRatioPercent":i.ratio?"showRatio":i.normField?"showNormField":i.field?"showField":null:this.isRendererTitle(i,t)&&(s=i.normField?"showNormField":i.normByPct?"showNormPct":i.field?"showField":null),s?null===(a=this.intl)||void 0===a?void 0:a.substitute("showField"===s?"{field}":e[s],{field:i.field,normField:i.normField}):""}isRampTitle(e,i){return i}isRendererTitle(e,i){return!i}setupWatchersAndListeners(){var e,i,n,a,l,r,c;const d=null===(a=null===(n=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===n?void 0:n.allLayers)||void 0===a?void 0:a.filter((e=>"feature"===(null==e?void 0:e.type)));d.forEach((async e=>{var i,t,n,a;try{const s=await(null===(t=null===(i=this.legendvm)||void 0===i?void 0:i.view)||void 0===t?void 0:t.whenLayerView(e)),l=`fLayerViewScale-${null==e?void 0:e.id}`;(null===(n=this.handles)||void 0===n?void 0:n.has(l))||null===(a=this.handles)||void 0===a||a.add(s.watch("visibleAtCurrentScale",(async()=>this.createDataForLayer(e))),l)}catch(e){}})),null==d||d.forEach((e=>{var i,t,n;const a=`fLayer-${null==e?void 0:e.id}`;(null===(i=this.handles)||void 0===i?void 0:i.has(a))||null===(t=this.handles)||void 0===t||t.add(null===(n=this.reactiveUtils)||void 0===n?void 0:n.watch((()=>null==e?void 0:e.visible),(async()=>this.createDataForLayer(e))),a)})),null===(l=this.handles)||void 0===l||l.add(this.reactiveUtils.when((()=>this.legendvm),(()=>{this.reactiveUtils.watch((()=>{var e,i;return null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating}),(()=>{var e,i;this.calculatingFeatureCount||(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating)&&(this.calculatingFeatureCount=!0,this.reactiveUtils.when((()=>{var e,i;return!(null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.updating)}),(async()=>{const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e)),this.calculatingFeatureCount=!1}),{once:!0,initial:!0}))}),{initial:!0})}),{initial:!0,once:!0})),null===(r=this.handles)||void 0===r||r.add(this.reactiveUtils.on((()=>{var e;return null===(e=this.legendvm)||void 0===e?void 0:e.activeLayerInfos}),"change",(async e=>{var i;const n=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),n)),t(this.el),null===(i=this.handles)||void 0===i||i.add(this.reactiveUtils.on((()=>e.children),"change",(async()=>{const e=await u(this.legendvm,this.reactiveUtils);s.set("data",Object.assign(Object.assign({},o.data),e)),t(this.el)})))}))),null===(c=this.handles)||void 0===c||c.add(this.reactiveUtils.on((()=>{var e,i,t;return null===(t=null===(i=null===(e=this.legendvm)||void 0===e?void 0:e.view)||void 0===i?void 0:i.map)||void 0===t?void 0:t.layers}),"after-changes",(async()=>{const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e)),this.calculatingFeatureCount=!1})))}async createDataForLayer(e){var i;const t=s.get("data"),n=null==t?void 0:t[null==e?void 0:e.id],a=g(null===(i=this.legendvm)||void 0===i?void 0:i.activeLayerInfos),l=null==a?void 0:a.find((i=>{var t;return(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.id)===(null==e?void 0:e.id)}));if(!n&&l){const i=await h(this.legendvm,l,this.reactiveUtils);if(f({intLegendLayerData:i,layerId:null==e?void 0:e.id}),this.featureCount){const e=await p(this.legendvm,o.data);s.set("data",Object.assign(Object.assign({},o.data),e))}}}applyFilter(e,i,t,n){return async()=>{var a;const s=Object.assign({},null===(a=o.data)||void 0===a?void 0:a[null==i?void 0:i.id]);n?await m(s,e,t,this.filterMode,n):await m(s,e,t,this.filterMode),f({intLegendLayerData:s,layerId:null==i?void 0:i.id})}}get el(){return n(this)}static get watchers(){return{filterMode:["handleFilterModeChange"]}}};W.style=".sc-instant-apps-interactive-legend-classic-h{display:block;--instant-apps-interactive-legend-heading-font-size:1rem;--instant-apps-interactive-legend-heading-font-weight:normal;--instant-apps-interactive-legend-caption-font-weight:normal;--instant-apps-interactive-legend-secondary-color:var(--calcite-color-text-1);--instant-apps-interactive-legend-field-name-font-size:1rem;--instant-apps-interactive-legend-total-feature-count-font-size:0.875rem;--instant-apps-interactive-legend-info-font-size:0.875rem;--instant-apps-interactive-legend-info-item-background--selected:#c7ebff;--instant-apps-interactive-legend-info-item-background--selected--dark:#009af2;--instant-apps-interactive-legend-info-item-background--hover:#e9e9e9;--instant-apps-interactive-legend-info-item-background--hover--dark:#4a4a4a;--instant-apps-interactive-legend-info-item-color--selected:var(--calcite-color-text-2);--instant-apps-interactive-legend-secondary-background-color:var(--calcite-color-background);--instant-apps-interactive-legend-ui-margin:20px 15px;--instant-apps-interactive-legend-ui-padding:20px 15px}.sc-instant-apps-interactive-legend-classic-h .esri-legend__service.sc-instant-apps-interactive-legend-classic{padding:0}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-body.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-table.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__group-layer-child.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-child-table.sc-instant-apps-interactive-legend-classic{margin:0;overflow:hidden}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{display:flex;align-items:center;font-size:var(--instant-apps-interactive-legend-field-name-font-size);background-color:var(--instant-apps-interactive-legend-secondary-background-color);color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic calcite-action.sc-instant-apps-interactive-legend-classic{margin-right:5px}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-classic{white-space:nowrap}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-caption-btn-container.sc-instant-apps-interactive-legend-classic calcite-button.sc-instant-apps-interactive-legend-classic{margin:2px}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{font-weight:var(--instant-apps-interactive-legend-caption-font-weight)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell.esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{font-size:var(--instant-apps-interactive-legend-info-font-size);text-align:left}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{display:flex;align-items:center}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-body.sc-instant-apps-interactive-legend-classic{display:block;margin:var(--instant-apps-interactive-legend-ui-margin)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.instant-apps-interactive-legend__nested-unique-symbol.sc-instant-apps-interactive-legend-classic>.esri-legend__layer-body.sc-instant-apps-interactive-legend-classic{margin:0}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{display:table-row}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__non-interactive.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell.sc-instant-apps-interactive-legend-classic{display:table-cell}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--symbols.sc-instant-apps-interactive-legend-classic{justify-content:center;width:20%}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{width:65%}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{margin:1px;background:transparent;border:none;width:100%}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{color:var(--instant-apps-interactive-legend-secondary-color)}.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic,.sc-instant-apps-interactive-legend-classic-h .esri-legend__layer-caption.sc-instant-apps-interactive-legend-classic{padding:var(--instant-apps-interactive-legend-ui-padding)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{position:relative}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic{background-color:var(--instant-apps-interactive-legend-info-item-background--selected)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic{cursor:pointer;background-color:var(--instant-apps-interactive-legend-info-item-background--selected--dark)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend-element-info--selected.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{color:var(--calcite-color-text-inverse)}.sc-instant-apps-interactive-legend-classic-h .hide.sc-instant-apps-interactive-legend-classic{display:none}.instant-apps-interactive-legend__compact.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic{--instant-apps-interactive-legend-ui-padding:10px 5px}.instant-apps-interactive-legend__compact.sc-instant-apps-interactive-legend-classic .esri-legend__layer-row.sc-instant-apps-interactive-legend-classic .esri-legend__layer-cell--info.sc-instant-apps-interactive-legend-classic{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;text-overflow:ellipsis;line-clamp:2;line-height:1.3125rem;max-height:2.625rem}@media (min-width: 992px){.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic{cursor:pointer}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover)}.sc-instant-apps-interactive-legend-classic-h .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover.instant-apps-interactive-legend-element-info--selected{background-color:#e2f2fe}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover{background-color:var(--instant-apps-interactive-legend-info-item-background--hover--dark)}.sc-instant-apps-interactive-legend-classic-h .calcite-mode-dark.sc-instant-apps-interactive-legend-classic .instant-apps-interactive-legend__layer-row--interactive.sc-instant-apps-interactive-legend-classic:hover.instant-apps-interactive-legend-element-info--selected{background-color:#26a9f4}}";export{W as instant_apps_interactive_legend_classic}
@@ -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{a as t}from"./p-4e6eb06e.js";import{l as n}from"./p-4cd4cb85.js";import{l as o}from"./p-ac122d9e.js";const a=new URL(window.location.href).origin.includes("localhost:4444");function c(){const t=(document.documentElement.lang||(null===navigator||void 0===navigator?void 0:navigator.language)||"en").toLowerCase();return o.has(t)?o.get(t):o.has(t.slice(0,2))?o.get(t.slice(0,2)):"en"}async function e(n,o){const c=`assets/t9n/${n}/resources_${o}.json`,e=`${new URL(window.location.href).origin}/dist/${c}`;async function r(t){const n=await fetch(t);if(!n.ok)throw new Error(`Fetch failed with status ${n.status}: ${n.statusText}`);const o=n.headers.get("content-type");if(!o||!o.includes("application/json")){const t=await n.text();throw console.error(`Expected JSON, but received (${o}): ${t}`),new Error("Fetched content is not JSON")}return await n.json()}try{return await r(a?e:t(c))}catch(t){console.error(`Primary fetch error: ${t}`);try{return await r(e)}catch(t){throw console.error(`Fallback fetch error: ${t}`),new Error("Both primary and fallback fetches failed")}}}function r(t,n){var o,a;const c=null===(o=null==n?void 0:n.user)||void 0===o?void 0:o.culture,e=null===(a=null===window||void 0===window?void 0:window.navigator)||void 0===a?void 0:a.language,r=t.getLocale();return t.normalizeMessageBundleLocale(c||e||r||"en")}async function i(t,n){const o=t.tagName.toLowerCase(),a=null!=n?n:c();let r;try{r=await e(o,a)}catch(t){console.warn(`no locale for ${o} (${a}) loading default locale en.`),r=await e(o,"en")}return[r,a]}async function s(t,o){try{l(t,await i(t.el),o)}catch(t){}finally{try{const[a]=await n(["esri/intl"]);a.onLocaleChange(function(t,n){return async o=>{const a=await i(t.el,o);l(t,a,n)}}(t,o))}catch(t){}}}function l(t,n,o){t.messages=n[0],o&&(t.messages=Object.assign(Object.assign({},t.messages),o))}export{r as a,i as b,c,s as g}
6
+ import{a as t}from"./p-4e6eb06e.js";import{l as n}from"./p-d001e961.js";import{l as o}from"./p-ac122d9e.js";const a=new URL(window.location.href).origin.includes("localhost:4444");function c(){const t=(document.documentElement.lang||(null===navigator||void 0===navigator?void 0:navigator.language)||"en").toLowerCase();return o.has(t)?o.get(t):o.has(t.slice(0,2))?o.get(t.slice(0,2)):"en"}async function e(n,o){const c=`assets/t9n/${n}/resources_${o}.json`,e=`${new URL(window.location.href).origin}/dist/${c}`;async function r(t){const n=await fetch(t);if(!n.ok)throw new Error(`Fetch failed with status ${n.status}: ${n.statusText}`);const o=n.headers.get("content-type");if(!o||!o.includes("application/json")){const t=await n.text();throw console.error(`Expected JSON, but received (${o}): ${t}`),new Error("Fetched content is not JSON")}return await n.json()}try{return await r(a?e:t(c))}catch(t){console.error(`Primary fetch error: ${t}`);try{return await r(e)}catch(t){throw console.error(`Fallback fetch error: ${t}`),new Error("Both primary and fallback fetches failed")}}}function r(t,n){var o,a;const c=null===(o=null==n?void 0:n.user)||void 0===o?void 0:o.culture,e=null===(a=null===window||void 0===window?void 0:window.navigator)||void 0===a?void 0:a.language,r=t.getLocale();return t.normalizeMessageBundleLocale(c||e||r||"en")}async function i(t,n){const o=t.tagName.toLowerCase(),a=null!=n?n:c();let r;try{r=await e(o,a)}catch(t){console.warn(`no locale for ${o} (${a}) loading default locale en.`),r=await e(o,"en")}return[r,a]}async function s(t,o){try{l(t,await i(t.el),o)}catch(t){}finally{try{const[a]=await n(["esri/intl"]);a.onLocaleChange(function(t,n){return async o=>{const a=await i(t.el,o);l(t,a,n)}}(t,o))}catch(t){}}}function l(t,n,o){t.messages=n[0],o&&(t.messages=Object.assign(Object.assign({},t.messages),o))}export{r as a,i as b,c,s as g}