@esri/solutions-components 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/dist/cjs/buffer-tools_4.cjs.entry.js +1 -1
  2. package/dist/cjs/calcite-combobox_6.cjs.entry.js +74 -52
  3. package/dist/cjs/calcite-input-text_4.cjs.entry.js +9 -9
  4. package/dist/cjs/card-manager_3.cjs.entry.js +36 -29
  5. package/dist/cjs/crowdsource-manager.cjs.entry.js +2 -2
  6. package/dist/cjs/{downloadUtils-6d4e269f.js → downloadUtils-4aadf4b0.js} +4 -3
  7. package/dist/cjs/edit-card_2.cjs.entry.js +11 -6
  8. package/dist/cjs/{index.es-fc923796.js → index.es-17db3b89.js} +2 -2
  9. package/dist/cjs/loader.cjs.js +1 -1
  10. package/dist/cjs/{mapViewUtils-efc49df7.js → mapViewUtils-77a1ff88.js} +48 -6
  11. package/dist/cjs/public-notification.cjs.entry.js +3 -3
  12. package/dist/cjs/{publicNotificationStore-cd1a32c3.js → publicNotificationStore-ec1bdd2d.js} +5 -1
  13. package/dist/cjs/solutions-components.cjs.js +1 -1
  14. package/dist/collection/components/card-manager/card-manager.js +8 -8
  15. package/dist/collection/components/crowdsource-manager/crowdsource-manager.css +2 -2
  16. package/dist/collection/components/crowdsource-manager/crowdsource-manager.js +1 -1
  17. package/dist/collection/components/edit-card/edit-card.css +1 -1
  18. package/dist/collection/components/edit-card/edit-card.js +7 -1
  19. package/dist/collection/components/info-card/info-card.js +4 -5
  20. package/dist/collection/components/layer-table/layer-table.js +34 -27
  21. package/dist/collection/components/map-layer-picker/map-layer-picker.js +110 -54
  22. package/dist/collection/components/map-select-tools/map-select-tools.js +5 -5
  23. package/dist/collection/components/refine-selection/refine-selection.js +3 -3
  24. package/dist/collection/demos/crowdsource-manager.html +31 -16
  25. package/dist/collection/utils/downloadUtils.js +2 -1
  26. package/dist/collection/utils/downloadUtils.ts +1 -1
  27. package/dist/collection/utils/interfaces.ts +6 -5
  28. package/dist/collection/utils/mapViewUtils.js +44 -5
  29. package/dist/collection/utils/mapViewUtils.ts +52 -7
  30. package/dist/collection/utils/publicNotificationStore.js +5 -1
  31. package/dist/collection/utils/publicNotificationStore.ts +5 -1
  32. package/dist/components/card-manager2.js +5 -5
  33. package/dist/components/crowdsource-manager.js +2 -2
  34. package/dist/components/downloadUtils.js +2 -1
  35. package/dist/components/edit-card2.js +7 -1
  36. package/dist/components/info-card2.js +4 -5
  37. package/dist/components/layer-table2.js +33 -26
  38. package/dist/components/map-layer-picker2.js +78 -54
  39. package/dist/components/map-select-tools2.js +5 -5
  40. package/dist/components/mapViewUtils.js +45 -6
  41. package/dist/components/publicNotificationStore.js +5 -1
  42. package/dist/components/refine-selection2.js +3 -3
  43. package/dist/esm/buffer-tools_4.entry.js +1 -1
  44. package/dist/esm/calcite-combobox_6.entry.js +74 -52
  45. package/dist/esm/calcite-input-text_4.entry.js +9 -9
  46. package/dist/esm/card-manager_3.entry.js +36 -29
  47. package/dist/esm/crowdsource-manager.entry.js +2 -2
  48. package/dist/esm/{downloadUtils-1092cb0f.js → downloadUtils-3b5f85d9.js} +4 -3
  49. package/dist/esm/edit-card_2.entry.js +11 -6
  50. package/dist/esm/{index.es-08a48fdd.js → index.es-bb9196f6.js} +2 -2
  51. package/dist/esm/loader.js +1 -1
  52. package/dist/esm/{mapViewUtils-a787c6a8.js → mapViewUtils-55ea1e10.js} +45 -6
  53. package/dist/esm/public-notification.entry.js +3 -3
  54. package/dist/esm/{publicNotificationStore-c36d95bf.js → publicNotificationStore-6ef555f3.js} +5 -1
  55. package/dist/esm/solutions-components.js +1 -1
  56. package/dist/solutions-components/demos/crowdsource-manager.html +31 -16
  57. package/dist/solutions-components/{p-841a5f97.entry.js → p-03179924.entry.js} +1 -1
  58. package/dist/solutions-components/{p-a29ba58a.js → p-477ae127.js} +2 -2
  59. package/dist/solutions-components/p-4af3f843.js +36 -0
  60. package/dist/solutions-components/{p-5b260e5f.js → p-6015e2ee.js} +1 -1
  61. package/dist/solutions-components/{p-ad60a547.js → p-9807924d.js} +3 -3
  62. package/dist/solutions-components/{p-781480c2.entry.js → p-a56f965e.entry.js} +1 -1
  63. package/dist/solutions-components/{p-5a6ca63b.entry.js → p-cdc0bb97.entry.js} +6 -6
  64. package/dist/solutions-components/{p-6305f474.entry.js → p-d3fd28e9.entry.js} +1 -1
  65. package/dist/solutions-components/p-d83da8a0.entry.js +11 -0
  66. package/dist/solutions-components/p-d875f38c.entry.js +6 -0
  67. package/dist/solutions-components/p-ef235c88.entry.js +6 -0
  68. package/dist/solutions-components/solutions-components.esm.js +1 -1
  69. package/dist/solutions-components/utils/downloadUtils.ts +1 -1
  70. package/dist/solutions-components/utils/interfaces.ts +6 -5
  71. package/dist/solutions-components/utils/mapViewUtils.ts +52 -7
  72. package/dist/solutions-components/utils/publicNotificationStore.ts +5 -1
  73. package/dist/types/components/card-manager/card-manager.d.ts +2 -2
  74. package/dist/types/components/edit-card/edit-card.d.ts +6 -2
  75. package/dist/types/components/layer-table/layer-table.d.ts +4 -4
  76. package/dist/types/components/map-layer-picker/map-layer-picker.d.ts +34 -19
  77. package/dist/types/components.d.ts +22 -6
  78. package/dist/types/utils/interfaces.d.ts +4 -3
  79. package/dist/types/utils/mapViewUtils.d.ts +22 -5
  80. package/dist/types/utils/publicNotificationStore.d.ts +2 -0
  81. package/package.json +1 -1
  82. package/dist/solutions-components/p-0641aa9b.js +0 -36
  83. package/dist/solutions-components/p-74a2d025.entry.js +0 -6
  84. package/dist/solutions-components/p-a62c1b3c.entry.js +0 -6
  85. package/dist/solutions-components/p-ccf5c0ff.entry.js +0 -11
@@ -3,33 +3,33 @@
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 i,r as t,c as e,H as n,g as a}from"./p-f8be5d5f.js";import{f as s}from"./p-7764def7.js";import{i as o,t as r,g as c,a as l,f as h,e as d}from"./p-1aca2237.js";import{d as m,f as p,c as u,r as b,a as f,F as g}from"./p-d866ff25.js";import{s as v,c as w,a as x,d as y,H as k}from"./p-c844e615.js";import{g as z}from"./p-a738e38f.js";import{c as D,u as C,d as _}from"./p-41f5a5fc.js";import{c as I,d as H,g as E}from"./p-8bf81a2e.js";import{c as $,s as L,a as S}from"./p-5173b841.js";import{c as j,d as A}from"./p-0ff7b311.js";import{c as P}from"./p-99b55177.js";import{c as O,d as F}from"./p-c8835780.js";import{c as R,s as B,d as M,u as T}from"./p-db08ef87.js";import{C as W,b as q,c as N,h as U,d as V,e as G,f as K,g as X,a as Y}from"./p-a74094e4.js";import{d as J}from"./p-4e32bf8c.js";import{c as Q,d as Z}from"./p-7a42ffab.js";import{i as ii}from"./p-40bdd836.js";import{i as ti,k as ei}from"./p-0641aa9b.js";import{s as ni}from"./p-a29ba58a.js";import"./p-c2d148da.js";import"./p-d60a77a4.js";import"./p-9ab03591.js";import"./p-4ff653eb.js";
6
+ import{h as i,r as t,c as e,H as n,g as a}from"./p-f8be5d5f.js";import{f as s}from"./p-7764def7.js";import{i as o,t as r,g as c,a as l,f as h,e as d}from"./p-1aca2237.js";import{d as m,f as p,c as u,r as b,a as f,F as g}from"./p-d866ff25.js";import{s as v,c as w,a as x,d as y,H as k}from"./p-c844e615.js";import{g as z}from"./p-a738e38f.js";import{c as D,u as C,d as _}from"./p-41f5a5fc.js";import{c as I,d as H,g as E}from"./p-8bf81a2e.js";import{c as $,s as j,a as O}from"./p-5173b841.js";import{c as A,d as L}from"./p-0ff7b311.js";import{c as P}from"./p-99b55177.js";import{c as S,d as F}from"./p-c8835780.js";import{c as R,s as B,d as T,u as M}from"./p-db08ef87.js";import{C as W,b as q,c as N,h as U,d as V,e as G,f as K,g as X,a as Y}from"./p-a74094e4.js";import{d as J}from"./p-4e32bf8c.js";import{c as Q,d as Z}from"./p-7a42ffab.js";import{i as ii}from"./p-40bdd836.js";import{j as ti,l as ei,m as ni,n as ai}from"./p-4af3f843.js";import{s as si}from"./p-477ae127.js";import"./p-c2d148da.js";import"./p-d60a77a4.js";import"./p-9ab03591.js";import"./p-4ff653eb.js";
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
10
10
  * v1.4.3
11
- */const ai="x-button";function si({disabled:t,key:e,label:n,onClick:a,ref:s,scale:o}){return i("button",{"aria-label":n,class:ai,disabled:t,key:e,onClick:a,tabIndex:-1,type:"button",ref:s},i("calcite-icon",{icon:"x",scale:"l"===o?"m":"s"}))}const oi="combobox-item-",ri="combobox-chip-",ci="combobox-label-",li="combobox-listbox-",hi="combobox-input-",di=class{constructor(i){t(this,i),this.calciteComboboxChange=e(this,"calciteComboboxChange",6),this.calciteComboboxFilterChange=e(this,"calciteComboboxFilterChange",6),this.calciteComboboxChipClose=e(this,"calciteComboboxChipClose",6),this.calciteComboboxBeforeClose=e(this,"calciteComboboxBeforeClose",6),this.calciteComboboxClose=e(this,"calciteComboboxClose",6),this.calciteComboboxBeforeOpen=e(this,"calciteComboboxBeforeOpen",6),this.calciteComboboxOpen=e(this,"calciteComboboxOpen",6),this.placement=m,this.internalValueChangeFlag=!1,this.textInput=null,this.mutationObserver=P("mutation",(()=>this.updateItems())),this.resizeObserver=P("resize",(()=>this.setMaxScrollerHeight())),this.guid=z(),this.inputHeight=0,this.ignoreSelectedEventsFlag=!1,this.openTransitionProp="opacity",this.setFilteredPlacements=()=>{const{el:i,flipPlacements:t}=this;this.filteredFlipPlacements=t?p(t,i):null},this.getValue=()=>{const i=this.selectedItems.map((i=>{var t;return null===(t=null==i?void 0:i.value)||void 0===t?void 0:t.toString()}));return(null==i?void 0:i.length)?i.length>1?i:i[0]:""},this.onLabelClick=()=>{this.setFocus()},this.keyDownHandler=i=>{const{key:t}=i;switch(t){case"Tab":this.activeChipIndex=-1,this.activeItemIndex=-1,this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):this.open&&(this.open=!1,i.preventDefault());break;case"ArrowLeft":this.previousChip(),i.preventDefault();break;case"ArrowRight":this.nextChip(),i.preventDefault();break;case"ArrowUp":i.preventDefault(),this.open&&this.shiftActiveItemIndex(-1),this.comboboxInViewport()||this.el.scrollIntoView();break;case"ArrowDown":i.preventDefault(),this.open?this.shiftActiveItemIndex(1):(this.open=!0,this.ensureRecentSelectedItemIsActive()),this.comboboxInViewport()||this.el.scrollIntoView();break;case" ":this.textInput.value||(i.preventDefault(),this.open=!0,this.shiftActiveItemIndex(1));break;case"Home":if(!this.open)return;i.preventDefault(),this.updateActiveItemIndex(0),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"End":if(!this.open)return;i.preventDefault(),this.updateActiveItemIndex(this.filteredItems.length-1),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":this.clearDisabled||this.open||this.clearValue(),this.open=!1,i.preventDefault();break;case"Enter":this.activeItemIndex>-1?(this.toggleSelection(this.filteredItems[this.activeItemIndex]),i.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(),i.preventDefault()):this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):i.defaultPrevented||v(this)&&i.preventDefault();break;case"Delete":case"Backspace":this.activeChipIndex>-1?(i.preventDefault(),this.removeActiveChip()):!this.text&&this.isMulti()&&(i.preventDefault(),this.removeLastChip())}},this.toggleCloseEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxClose",this.toggleCloseEnd)},this.toggleOpenEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxOpen",this.toggleOpenEnd)},this.setMaxScrollerHeight=async()=>{const{listContainerEl:i,open:t,referenceEl:e}=this;if(!i||!t)return;await this.reposition(!0);const n=this.getMaxScrollerHeight();i.style.maxHeight=n>0?`${n}px`:"",i.style.minWidth=`${e.clientWidth}px`,await this.reposition(!0)},this.calciteChipCloseHandler=i=>{this.open=!1;const t=this.items.find((t=>t===i));t&&this.toggleSelection(t,!1),this.calciteComboboxChipClose.emit()},this.clickHandler=i=>{const t=i.composedPath();return t.some((i=>"CALCITE-CHIP"===i.tagName))?(this.open=!1,void i.preventDefault()):t.some((i=>{var t;return null===(t=i.classList)||void 0===t?void 0:t.contains(ai)}))?(this.clearValue(),void i.preventDefault()):(this.open=!this.open,void this.ensureRecentSelectedItemIsActive())},this.setInactiveIfNotContained=i=>{const t=i.composedPath();!this.open||t.includes(this.el)||t.includes(this.referenceEl)||(this.allowCustomValues&&this.text.trim().length&&this.addCustomChip(this.text),"single"===this.selectionMode&&(this.textInput&&(this.textInput.value=""),this.text="",this.filterItems(""),this.updateActiveItemIndex(-1)),this.open=!1)},this.setFloatingEl=i=>{this.floatingEl=i,u(this,this.referenceEl,this.floatingEl)},this.setContainerEl=i=>{this.resizeObserver.observe(i),this.listContainerEl=i,this.transitionEl=i,O(this)},this.setReferenceEl=i=>{this.referenceEl=i,u(this,this.referenceEl,this.floatingEl)},this.inputHandler=i=>{const t=i.target.value;this.text=t,this.filterItems(t),t&&(this.activeChipIndex=-1)},this.filterItems=(()=>{const i=(i,t)=>i&&t.some((({label:t,value:e})=>i.tagName===G?e===i.label:e===i.textLabel||e===i.value||t===i.textLabel||t===i.value));return J((t=>{const e=s(this.data,t);this.getCombinedItems().forEach((t=>{const n=!i(t,e);t.hidden=n;const[a,s]=t.ancestors;(i(a,e)||i(s,e))&&(t.hidden=!1),n||t.ancestors.forEach((i=>i.hidden=!1))})),this.filteredItems=this.getfilteredItems(),this.calciteComboboxFilterChange.emit()}),100)})(),this.internalComboboxChangeEvent=()=>{this.calciteComboboxChange.emit()},this.emitComboboxChange=J(this.internalComboboxChangeEvent,0),this.updateItems=()=>{this.items=this.getItems(),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.selectedItems=this.getSelectedItems(),this.filteredItems=this.getfilteredItems(),this.needsIcon=this.getNeedsIcon(),this.allowCustomValues||this.setMaxScrollerHeight()},this.scrollToActiveItem=()=>{const i=this.filteredItems[this.activeItemIndex];if(!i)return;const t=this.calculateSingleItemHeight(i),{offsetHeight:e,scrollTop:n}=this.listContainerEl;e+n<i.offsetTop+t?this.listContainerEl.scrollTop=i.offsetTop-e+t:i.offsetTop<n&&(this.listContainerEl.scrollTop=i.offsetTop)},this.comboboxFocusHandler=()=>{var i;this.disabled||null===(i=this.textInput)||void 0===i||i.focus()},this.comboboxBlurHandler=i=>{this.setInactiveIfNotContained(i)},this.clearDisabled=!1,this.open=!1,this.disabled=!1,this.form=void 0,this.label=void 0,this.placeholder=void 0,this.placeholderIcon=void 0,this.placeholderIconFlipRtl=!1,this.maxItems=0,this.name=void 0,this.allowCustomValues=void 0,this.overlayPositioning="absolute",this.required=!1,this.selectionMode="multiple",this.scale="m",this.value=null,this.flipPlacements=void 0,this.messages=void 0,this.messageOverrides=void 0,this.selectedItems=[],this.filteredItems=[],this.items=[],this.groupItems=[],this.needsIcon=void 0,this.activeItemIndex=-1,this.activeChipIndex=-1,this.activeDescendant="",this.text="",this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){this.disabled?this.open=!1:this.setMaxScrollerHeight()}handleDisabledChange(i){i||(this.open=!1)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}valueHandler(i){if(!this.internalValueChangeFlag){const t=this.getItems();Array.isArray(i)?t.forEach((t=>t.selected=i.includes(t.value))):t.forEach(i?t=>t.selected=i===t.value:i=>i.selected=!1),this.updateItems()}}onMessagesChange(){}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}selectedItemsHandler(){this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1}documentClickHandler(i){!this.disabled&&o(i)&&this.setInactiveIfNotContained(i)}calciteComboboxItemChangeHandler(i){if(this.ignoreSelectedEventsFlag)return;const t=i.target,e=this.filteredItems.indexOf(t);this.updateActiveItemIndex(e),this.toggleSelection(t,t.selected)}async reposition(i=!1){const{floatingEl:t,referenceEl:e,placement:n,overlayPositioning:a,filteredFlipPlacements:s}=this;return b(this,{floatingEl:t,referenceEl:e,overlayPositioning:a,placement:n,flipPlacements:s,type:"menu"},i)}async setFocus(){var i;await $(this),null===(i=this.textInput)||void 0===i||i.focus(),this.activeChipIndex=-1,this.activeItemIndex=-1}connectedCallback(){var i;D(this),j(this),R(this),this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1,null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0,subtree:!0}),I(this),w(this),O(this),this.setFilteredPlacements(),this.reposition(!0),this.open&&this.openHandler()}async componentWillLoad(){L(this),this.updateItems(),await B(this)}componentDidLoad(){x(this,this.getValue()),this.reposition(!0),S(this)}componentDidRender(){this.el.offsetHeight!==this.inputHeight&&(this.reposition(!0),this.inputHeight=this.el.offsetHeight),C(this)}disconnectedCallback(){var i,t;null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),_(this),H(this),y(this),f(this,this.referenceEl,this.floatingEl),F(this),A(this),M(this)}textHandler(){this.updateActiveItemIndex(-1)}effectiveLocaleChange(){T(this,this.effectiveLocale)}clearValue(){this.ignoreSelectedEventsFlag=!0,this.items.forEach((i=>i.selected=!1)),this.ignoreSelectedEventsFlag=!1,this.selectedItems=[],this.emitComboboxChange(),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems(""),this.setFocus()}comboboxInViewport(){const i=this.el.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.right<=(window.innerWidth||document.documentElement.clientWidth)&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)}onBeforeOpen(){this.scrollToActiveItem(),this.calciteComboboxBeforeOpen.emit()}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit()}ensureRecentSelectedItemIsActive(){const{selectedItems:i}=this,t=0===i.length?0:this.items.indexOf(i[i.length-1]);this.updateActiveItemIndex(t)}getMaxScrollerHeight(){const i=this.getCombinedItems().filter((i=>!i.hidden)),{maxItems:t}=this;let e=0,n=0;return i.length>t&&i.forEach((i=>{if(e<t&&t>0){const t=this.calculateSingleItemHeight(i);t>0&&(n+=t,e++)}})),n}calculateSingleItemHeight(i){if(!i)return;let t=i.offsetHeight;return Array.from(i.querySelectorAll(W)).map((i=>null==i?void 0:i.offsetHeight)).forEach((i=>{t-=i})),t}getCombinedItems(){return[...this.groupItems,...this.items]}toggleSelection(i,t=!i.selected){i&&(this.isMulti()?(i.selected=t,this.updateAncestors(i),this.selectedItems=this.getSelectedItems(),this.emitComboboxChange(),this.resetText(),this.filterItems("")):(this.ignoreSelectedEventsFlag=!0,this.items.forEach((e=>e.selected=e===i&&t)),this.ignoreSelectedEventsFlag=!1,this.selectedItems=this.getSelectedItems(),this.emitComboboxChange(),this.textInput&&(this.textInput.value=i.textLabel),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems("")))}updateAncestors(i){if("ancestors"!==this.selectionMode)return;const t=q(i),e=N(i);i.selected?t.forEach((i=>{i.selected=!0})):(e.forEach((i=>i.selected=!1)),[...t].forEach((i=>{U(i)||(i.selected=!1)})))}getfilteredItems(){return this.items.filter((i=>!i.hidden))}getSelectedItems(){if(!this.isMulti()){const i=this.items.find((({selected:i})=>i));return i?[i]:[]}return this.items.filter((i=>i.selected&&("ancestors"!==this.selectionMode||!U(i)))).sort(((i,t)=>{const e=this.selectedItems.indexOf(i),n=this.selectedItems.indexOf(t);return e>-1&&n>-1?e-n:n-e}))}getData(){return this.items.map((i=>({filterDisabled:i.filterDisabled,value:i.value,label:i.textLabel})))}getNeedsIcon(){return"single"===this.selectionMode&&this.items.some((i=>i.icon))}resetText(){this.textInput&&(this.textInput.value=""),this.text=""}getItems(){return Array.from(this.el.querySelectorAll(V)).filter((i=>!i.disabled))}getGroupItems(){return Array.from(this.el.querySelectorAll(G))}addCustomChip(i,t){const e=this.items.find((t=>t.textLabel===i));if(e)this.toggleSelection(e,!0);else{this.isMulti()||this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1);const e=document.createElement(V);e.value=i,e.textLabel=i,e.selected=!0,this.el.appendChild(e),this.resetText(),t&&this.setFocus(),this.updateItems(),this.filterItems(""),this.emitComboboxChange()}}removeActiveChip(){this.toggleSelection(this.selectedItems[this.activeChipIndex],!1),this.setFocus()}removeLastChip(){this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1),this.setFocus()}previousChip(){if(this.text)return;const i=this.activeChipIndex;this.activeChipIndex=-1===i?this.selectedItems.length-1:Math.max(i-1,0),this.updateActiveItemIndex(-1),this.focusChip()}nextChip(){if(this.text||-1===this.activeChipIndex)return;const i=this.activeChipIndex+1;i>this.selectedItems.length-1?(this.activeChipIndex=-1,this.setFocus()):(this.activeChipIndex=i,this.focusChip()),this.updateActiveItemIndex(-1)}focusChip(){var i;const t=null===(i=this.selectedItems[this.activeChipIndex])||void 0===i?void 0:i.guid,e=t?this.referenceEl.querySelector(`#${ri}${t}`):null;null==e||e.setFocus()}shiftActiveItemIndex(i){const{length:t}=this.filteredItems;this.updateActiveItemIndex((this.activeItemIndex+t+i)%t),this.scrollToActiveItem()}updateActiveItemIndex(i){this.activeItemIndex=i;let t=null;this.filteredItems.forEach(((e,n)=>{n===i?(e.active=!0,t=`${oi}${e.guid}`):e.active=!1})),this.activeDescendant=t,this.activeItemIndex>-1&&(this.activeChipIndex=-1)}isMulti(){return"single"!==this.selectionMode}renderChips(){const{activeChipIndex:t,scale:e,selectionMode:n,messages:a}=this;return this.selectedItems.map(((s,o)=>{const r={chip:!0,"chip--active":t===o},c=[...[...q(s)].reverse(),s].map((i=>i.textLabel)),l="ancestors"!==n?s.textLabel:c.join(" / ");return i("calcite-chip",{class:r,closable:!0,icon:s.icon,iconFlipRtl:s.iconFlipRtl,id:s.guid?`${ri}${s.guid}`:null,key:s.textLabel,messageOverrides:{dismissLabel:a.removeTag},onCalciteChipClose:()=>this.calciteChipCloseHandler(s),scale:e,title:l,value:s.value},l)}))}renderInput(){const{guid:t,disabled:e,placeholder:n,selectionMode:a,selectedItems:s,open:o}=this,r="single"===a,c=s[0],l=!o&&r&&!!c;return i("span",{class:{"input-wrap":!0,"input-wrap--single":r}},l&&i("span",{class:{label:!0,"label--icon":!!(null==c?void 0:c.icon)},key:"label"},c.textLabel),i("input",{"aria-activedescendant":this.activeDescendant,"aria-autocomplete":"list","aria-controls":`${li}${t}`,"aria-label":E(this),class:{input:!0,"input--single":!0,"input--transparent":this.activeChipIndex>-1,"input--hidden":l,"input--icon":!!this.placeholderIcon},disabled:e,id:`${hi}${t}`,key:"input",onBlur:this.comboboxBlurHandler,onFocus:this.comboboxFocusHandler,onInput:this.inputHandler,placeholder:n,type:"text",ref:i=>this.textInput=i}))}renderListBoxOptions(){return this.filteredItems.map((t=>i("li",{"aria-selected":r(t.selected),id:t.guid?`${oi}${t.guid}`:null,role:"option",tabindex:"-1"},t.textLabel)))}renderFloatingUIContainer(){const{setFloatingEl:t,setContainerEl:e,open:n}=this;return i("div",{"aria-hidden":"true",class:{"floating-ui-container":!0,"floating-ui-container--active":n},ref:t},i("div",{class:{[K.listContainer]:!0,[g.animation]:!0,[g.animationActive]:n},ref:e},i("ul",{class:{list:!0,"list--hide":!n}},i("slot",null))))}renderIconStart(){const{selectedItems:t,placeholderIcon:e,selectionMode:n,placeholderIconFlipRtl:a}=this,s=t[0],o=null==s?void 0:s.icon,r="single"===n;return(!this.open&&s?!!o&&r:!!this.placeholderIcon&&(!s||r))&&i("span",{class:"icon-start"},i("calcite-icon",{class:"selected-icon",flipRtl:this.open&&s?s.iconFlipRtl:a,icon:!this.open&&s?o:e,scale:"s"}))}renderIconEnd(){const{open:t}=this;return i("span",{class:"icon-end"},i("calcite-icon",{icon:t?"chevron-up":"chevron-down",scale:"s"}))}render(){var t;const{guid:e,label:a,open:s}=this,o="single"===this.selectionMode,c=!this.clearDisabled&&(null===(t=this.value)||void 0===t?void 0:t.length)>0;return i(n,{onClick:this.comboboxFocusHandler},i("div",{"aria-autocomplete":"list","aria-controls":`${li}${e}`,"aria-expanded":r(s),"aria-haspopup":"listbox","aria-label":E(this),"aria-live":"polite","aria-owns":`${li}${e}`,class:{wrapper:!0,"wrapper--single":o||!this.selectedItems.length,"wrapper--active":s},onClick:this.clickHandler,onKeyDown:this.keyDownHandler,role:"combobox",ref:this.setReferenceEl},i("div",{class:"grid-input"},this.renderIconStart(),!o&&this.renderChips(),i("label",{class:"screen-readers-only",htmlFor:`${hi}${e}`,id:`${ci}${e}`},a),this.renderInput()),c?i(si,{disabled:this.disabled,key:"close-button",label:this.messages.clear,scale:this.scale}):null,this.renderIconEnd()),i("ul",{"aria-labelledby":`${ci}${e}`,"aria-multiselectable":"true",class:"screen-readers-only",id:`${li}${e}`,role:"listbox",tabIndex:-1},this.renderListBoxOptions()),this.renderFloatingUIContainer(),i(k,{component:this}))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],value:["valueHandler"],messageOverrides:["onMessagesChange"],flipPlacements:["flipPlacementsHandler"],selectedItems:["selectedItemsHandler"],text:["textHandler"],effectiveLocale:["effectiveLocaleChange"]}}};di.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .x-button{inline-size:1rem;block-size:1rem}:host([scale=m]) .x-button{inline-size:1.5rem;block-size:1.5rem}:host([scale=l]) .x-button{inline-size:2rem;block-size:2rem}.x-button{margin:0px;display:flex;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-content:center;align-items:center;justify-content:center;align-self:center;border-width:2px;background-color:transparent;color:var(--calcite-ui-text-3);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-radius:50%;border-color:transparent;background-color:var(--calcite-ui-foreground-2)}.x-button:active,.x-button:hover{color:var(--calcite-ui-text-1);background-color:var(--calcite-ui-foreground-3)}.x-button:active{border-style:solid;border-color:var(--calcite-ui-brand)}.x-button calcite-icon{color:inherit}:host([scale=s]){font-size:var(--calcite-font-size--2);--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-input-height:1.5rem}:host([scale=s]) .x-button{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-input-height:2rem}:host([scale=m]) .x-button{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.75rem;--calcite-combobox-input-height:2.75rem}:host([scale=l]) .x-button{-webkit-margin-end:1rem;margin-inline-end:1rem}.wrapper{display:flex;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);outline-color:transparent;padding-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host(:focus-within) .wrapper,.wrapper--active{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.wrapper--single{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l);cursor:pointer;flex-wrap:nowrap}.grid-input{display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px}.input{flex-grow:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-style:none;background-color:transparent;padding:0px;font-family:inherit;color:var(--calcite-ui-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);min-inline-size:120px;-webkit-margin-after:var(--calcite-combobox-item-spacing-unit-s);margin-block-end:var(--calcite-combobox-item-spacing-unit-s)}.input:focus{outline:2px solid transparent;outline-offset:2px}.input--transparent{opacity:0}.input--single{margin-block:0px;padding:0px}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;inline-size:0px;min-inline-size:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.input-wrap{display:flex;flex-grow:1}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;display:flex;max-inline-size:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon-end,.icon-start{display:flex;inline-size:1rem;cursor:pointer;align-items:center}.icon-end{flex:none}.floating-ui-container{--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}.floating-ui-container--active{visibility:visible}@media (forced-colors: active){.wrapper,.floating-ui-container--active{border:1px solid canvasText}}.screen-readers-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.list-container{max-block-size:45vh;overflow-y:auto;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.list{margin:0px;display:block;padding:0px}.list--hide{block-size:0px;overflow:hidden}.chip{margin-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);margin-inline:0 var(--calcite-combobox-item-spacing-unit-s);max-inline-size:100%}.chip--active{background-color:var(--calcite-ui-foreground-3)}.item{display:block}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
11
+ */const oi="x-button";function ri({disabled:t,key:e,label:n,onClick:a,ref:s,scale:o}){return i("button",{"aria-label":n,class:oi,disabled:t,key:e,onClick:a,tabIndex:-1,type:"button",ref:s},i("calcite-icon",{icon:"x",scale:"l"===o?"m":"s"}))}const ci="combobox-item-",li="combobox-chip-",hi="combobox-label-",di="combobox-listbox-",mi="combobox-input-",pi=class{constructor(i){t(this,i),this.calciteComboboxChange=e(this,"calciteComboboxChange",6),this.calciteComboboxFilterChange=e(this,"calciteComboboxFilterChange",6),this.calciteComboboxChipClose=e(this,"calciteComboboxChipClose",6),this.calciteComboboxBeforeClose=e(this,"calciteComboboxBeforeClose",6),this.calciteComboboxClose=e(this,"calciteComboboxClose",6),this.calciteComboboxBeforeOpen=e(this,"calciteComboboxBeforeOpen",6),this.calciteComboboxOpen=e(this,"calciteComboboxOpen",6),this.placement=m,this.internalValueChangeFlag=!1,this.textInput=null,this.mutationObserver=P("mutation",(()=>this.updateItems())),this.resizeObserver=P("resize",(()=>this.setMaxScrollerHeight())),this.guid=z(),this.inputHeight=0,this.ignoreSelectedEventsFlag=!1,this.openTransitionProp="opacity",this.setFilteredPlacements=()=>{const{el:i,flipPlacements:t}=this;this.filteredFlipPlacements=t?p(t,i):null},this.getValue=()=>{const i=this.selectedItems.map((i=>{var t;return null===(t=null==i?void 0:i.value)||void 0===t?void 0:t.toString()}));return(null==i?void 0:i.length)?i.length>1?i:i[0]:""},this.onLabelClick=()=>{this.setFocus()},this.keyDownHandler=i=>{const{key:t}=i;switch(t){case"Tab":this.activeChipIndex=-1,this.activeItemIndex=-1,this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):this.open&&(this.open=!1,i.preventDefault());break;case"ArrowLeft":this.previousChip(),i.preventDefault();break;case"ArrowRight":this.nextChip(),i.preventDefault();break;case"ArrowUp":i.preventDefault(),this.open&&this.shiftActiveItemIndex(-1),this.comboboxInViewport()||this.el.scrollIntoView();break;case"ArrowDown":i.preventDefault(),this.open?this.shiftActiveItemIndex(1):(this.open=!0,this.ensureRecentSelectedItemIsActive()),this.comboboxInViewport()||this.el.scrollIntoView();break;case" ":this.textInput.value||(i.preventDefault(),this.open=!0,this.shiftActiveItemIndex(1));break;case"Home":if(!this.open)return;i.preventDefault(),this.updateActiveItemIndex(0),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"End":if(!this.open)return;i.preventDefault(),this.updateActiveItemIndex(this.filteredItems.length-1),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":this.clearDisabled||this.open||this.clearValue(),this.open=!1,i.preventDefault();break;case"Enter":this.activeItemIndex>-1?(this.toggleSelection(this.filteredItems[this.activeItemIndex]),i.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(),i.preventDefault()):this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):i.defaultPrevented||v(this)&&i.preventDefault();break;case"Delete":case"Backspace":this.activeChipIndex>-1?(i.preventDefault(),this.removeActiveChip()):!this.text&&this.isMulti()&&(i.preventDefault(),this.removeLastChip())}},this.toggleCloseEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxClose",this.toggleCloseEnd)},this.toggleOpenEnd=()=>{this.open=!1,this.el.removeEventListener("calciteComboboxOpen",this.toggleOpenEnd)},this.setMaxScrollerHeight=async()=>{const{listContainerEl:i,open:t,referenceEl:e}=this;if(!i||!t)return;await this.reposition(!0);const n=this.getMaxScrollerHeight();i.style.maxHeight=n>0?`${n}px`:"",i.style.minWidth=`${e.clientWidth}px`,await this.reposition(!0)},this.calciteChipCloseHandler=i=>{this.open=!1;const t=this.items.find((t=>t===i));t&&this.toggleSelection(t,!1),this.calciteComboboxChipClose.emit()},this.clickHandler=i=>{const t=i.composedPath();return t.some((i=>"CALCITE-CHIP"===i.tagName))?(this.open=!1,void i.preventDefault()):t.some((i=>{var t;return null===(t=i.classList)||void 0===t?void 0:t.contains(oi)}))?(this.clearValue(),void i.preventDefault()):(this.open=!this.open,void this.ensureRecentSelectedItemIsActive())},this.setInactiveIfNotContained=i=>{const t=i.composedPath();!this.open||t.includes(this.el)||t.includes(this.referenceEl)||(this.allowCustomValues&&this.text.trim().length&&this.addCustomChip(this.text),"single"===this.selectionMode&&(this.textInput&&(this.textInput.value=""),this.text="",this.filterItems(""),this.updateActiveItemIndex(-1)),this.open=!1)},this.setFloatingEl=i=>{this.floatingEl=i,u(this,this.referenceEl,this.floatingEl)},this.setContainerEl=i=>{this.resizeObserver.observe(i),this.listContainerEl=i,this.transitionEl=i,S(this)},this.setReferenceEl=i=>{this.referenceEl=i,u(this,this.referenceEl,this.floatingEl)},this.inputHandler=i=>{const t=i.target.value;this.text=t,this.filterItems(t),t&&(this.activeChipIndex=-1)},this.filterItems=(()=>{const i=(i,t)=>i&&t.some((({label:t,value:e})=>i.tagName===G?e===i.label:e===i.textLabel||e===i.value||t===i.textLabel||t===i.value));return J((t=>{const e=s(this.data,t);this.getCombinedItems().forEach((t=>{const n=!i(t,e);t.hidden=n;const[a,s]=t.ancestors;(i(a,e)||i(s,e))&&(t.hidden=!1),n||t.ancestors.forEach((i=>i.hidden=!1))})),this.filteredItems=this.getfilteredItems(),this.calciteComboboxFilterChange.emit()}),100)})(),this.internalComboboxChangeEvent=()=>{this.calciteComboboxChange.emit()},this.emitComboboxChange=J(this.internalComboboxChangeEvent,0),this.updateItems=()=>{this.items=this.getItems(),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.selectedItems=this.getSelectedItems(),this.filteredItems=this.getfilteredItems(),this.needsIcon=this.getNeedsIcon(),this.allowCustomValues||this.setMaxScrollerHeight()},this.scrollToActiveItem=()=>{const i=this.filteredItems[this.activeItemIndex];if(!i)return;const t=this.calculateSingleItemHeight(i),{offsetHeight:e,scrollTop:n}=this.listContainerEl;e+n<i.offsetTop+t?this.listContainerEl.scrollTop=i.offsetTop-e+t:i.offsetTop<n&&(this.listContainerEl.scrollTop=i.offsetTop)},this.comboboxFocusHandler=()=>{var i;this.disabled||null===(i=this.textInput)||void 0===i||i.focus()},this.comboboxBlurHandler=i=>{this.setInactiveIfNotContained(i)},this.clearDisabled=!1,this.open=!1,this.disabled=!1,this.form=void 0,this.label=void 0,this.placeholder=void 0,this.placeholderIcon=void 0,this.placeholderIconFlipRtl=!1,this.maxItems=0,this.name=void 0,this.allowCustomValues=void 0,this.overlayPositioning="absolute",this.required=!1,this.selectionMode="multiple",this.scale="m",this.value=null,this.flipPlacements=void 0,this.messages=void 0,this.messageOverrides=void 0,this.selectedItems=[],this.filteredItems=[],this.items=[],this.groupItems=[],this.needsIcon=void 0,this.activeItemIndex=-1,this.activeChipIndex=-1,this.activeDescendant="",this.text="",this.effectiveLocale=void 0,this.defaultMessages=void 0}openHandler(){this.disabled?this.open=!1:this.setMaxScrollerHeight()}handleDisabledChange(i){i||(this.open=!1)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}valueHandler(i){if(!this.internalValueChangeFlag){const t=this.getItems();Array.isArray(i)?t.forEach((t=>t.selected=i.includes(t.value))):t.forEach(i?t=>t.selected=i===t.value:i=>i.selected=!1),this.updateItems()}}onMessagesChange(){}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}selectedItemsHandler(){this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1}documentClickHandler(i){!this.disabled&&o(i)&&this.setInactiveIfNotContained(i)}calciteComboboxItemChangeHandler(i){if(this.ignoreSelectedEventsFlag)return;const t=i.target,e=this.filteredItems.indexOf(t);this.updateActiveItemIndex(e),this.toggleSelection(t,t.selected)}async reposition(i=!1){const{floatingEl:t,referenceEl:e,placement:n,overlayPositioning:a,filteredFlipPlacements:s}=this;return b(this,{floatingEl:t,referenceEl:e,overlayPositioning:a,placement:n,flipPlacements:s,type:"menu"},i)}async setFocus(){var i;await $(this),null===(i=this.textInput)||void 0===i||i.focus(),this.activeChipIndex=-1,this.activeItemIndex=-1}connectedCallback(){var i;D(this),A(this),R(this),this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1,null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0,subtree:!0}),I(this),w(this),S(this),this.setFilteredPlacements(),this.reposition(!0),this.open&&this.openHandler()}async componentWillLoad(){j(this),this.updateItems(),await B(this)}componentDidLoad(){x(this,this.getValue()),this.reposition(!0),O(this)}componentDidRender(){this.el.offsetHeight!==this.inputHeight&&(this.reposition(!0),this.inputHeight=this.el.offsetHeight),C(this)}disconnectedCallback(){var i,t;null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),_(this),H(this),y(this),f(this,this.referenceEl,this.floatingEl),F(this),L(this),T(this)}textHandler(){this.updateActiveItemIndex(-1)}effectiveLocaleChange(){M(this,this.effectiveLocale)}clearValue(){this.ignoreSelectedEventsFlag=!0,this.items.forEach((i=>i.selected=!1)),this.ignoreSelectedEventsFlag=!1,this.selectedItems=[],this.emitComboboxChange(),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems(""),this.setFocus()}comboboxInViewport(){const i=this.el.getBoundingClientRect();return i.top>=0&&i.left>=0&&i.right<=(window.innerWidth||document.documentElement.clientWidth)&&i.bottom<=(window.innerHeight||document.documentElement.clientHeight)}onBeforeOpen(){this.scrollToActiveItem(),this.calciteComboboxBeforeOpen.emit()}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit()}ensureRecentSelectedItemIsActive(){const{selectedItems:i}=this,t=0===i.length?0:this.items.indexOf(i[i.length-1]);this.updateActiveItemIndex(t)}getMaxScrollerHeight(){const i=this.getCombinedItems().filter((i=>!i.hidden)),{maxItems:t}=this;let e=0,n=0;return i.length>t&&i.forEach((i=>{if(e<t&&t>0){const t=this.calculateSingleItemHeight(i);t>0&&(n+=t,e++)}})),n}calculateSingleItemHeight(i){if(!i)return;let t=i.offsetHeight;return Array.from(i.querySelectorAll(W)).map((i=>null==i?void 0:i.offsetHeight)).forEach((i=>{t-=i})),t}getCombinedItems(){return[...this.groupItems,...this.items]}toggleSelection(i,t=!i.selected){i&&(this.isMulti()?(i.selected=t,this.updateAncestors(i),this.selectedItems=this.getSelectedItems(),this.emitComboboxChange(),this.resetText(),this.filterItems("")):(this.ignoreSelectedEventsFlag=!0,this.items.forEach((e=>e.selected=e===i&&t)),this.ignoreSelectedEventsFlag=!1,this.selectedItems=this.getSelectedItems(),this.emitComboboxChange(),this.textInput&&(this.textInput.value=i.textLabel),this.open=!1,this.updateActiveItemIndex(-1),this.resetText(),this.filterItems("")))}updateAncestors(i){if("ancestors"!==this.selectionMode)return;const t=q(i),e=N(i);i.selected?t.forEach((i=>{i.selected=!0})):(e.forEach((i=>i.selected=!1)),[...t].forEach((i=>{U(i)||(i.selected=!1)})))}getfilteredItems(){return this.items.filter((i=>!i.hidden))}getSelectedItems(){if(!this.isMulti()){const i=this.items.find((({selected:i})=>i));return i?[i]:[]}return this.items.filter((i=>i.selected&&("ancestors"!==this.selectionMode||!U(i)))).sort(((i,t)=>{const e=this.selectedItems.indexOf(i),n=this.selectedItems.indexOf(t);return e>-1&&n>-1?e-n:n-e}))}getData(){return this.items.map((i=>({filterDisabled:i.filterDisabled,value:i.value,label:i.textLabel})))}getNeedsIcon(){return"single"===this.selectionMode&&this.items.some((i=>i.icon))}resetText(){this.textInput&&(this.textInput.value=""),this.text=""}getItems(){return Array.from(this.el.querySelectorAll(V)).filter((i=>!i.disabled))}getGroupItems(){return Array.from(this.el.querySelectorAll(G))}addCustomChip(i,t){const e=this.items.find((t=>t.textLabel===i));if(e)this.toggleSelection(e,!0);else{this.isMulti()||this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1);const e=document.createElement(V);e.value=i,e.textLabel=i,e.selected=!0,this.el.appendChild(e),this.resetText(),t&&this.setFocus(),this.updateItems(),this.filterItems(""),this.emitComboboxChange()}}removeActiveChip(){this.toggleSelection(this.selectedItems[this.activeChipIndex],!1),this.setFocus()}removeLastChip(){this.toggleSelection(this.selectedItems[this.selectedItems.length-1],!1),this.setFocus()}previousChip(){if(this.text)return;const i=this.activeChipIndex;this.activeChipIndex=-1===i?this.selectedItems.length-1:Math.max(i-1,0),this.updateActiveItemIndex(-1),this.focusChip()}nextChip(){if(this.text||-1===this.activeChipIndex)return;const i=this.activeChipIndex+1;i>this.selectedItems.length-1?(this.activeChipIndex=-1,this.setFocus()):(this.activeChipIndex=i,this.focusChip()),this.updateActiveItemIndex(-1)}focusChip(){var i;const t=null===(i=this.selectedItems[this.activeChipIndex])||void 0===i?void 0:i.guid,e=t?this.referenceEl.querySelector(`#${li}${t}`):null;null==e||e.setFocus()}shiftActiveItemIndex(i){const{length:t}=this.filteredItems;this.updateActiveItemIndex((this.activeItemIndex+t+i)%t),this.scrollToActiveItem()}updateActiveItemIndex(i){this.activeItemIndex=i;let t=null;this.filteredItems.forEach(((e,n)=>{n===i?(e.active=!0,t=`${ci}${e.guid}`):e.active=!1})),this.activeDescendant=t,this.activeItemIndex>-1&&(this.activeChipIndex=-1)}isMulti(){return"single"!==this.selectionMode}renderChips(){const{activeChipIndex:t,scale:e,selectionMode:n,messages:a}=this;return this.selectedItems.map(((s,o)=>{const r={chip:!0,"chip--active":t===o},c=[...[...q(s)].reverse(),s].map((i=>i.textLabel)),l="ancestors"!==n?s.textLabel:c.join(" / ");return i("calcite-chip",{class:r,closable:!0,icon:s.icon,iconFlipRtl:s.iconFlipRtl,id:s.guid?`${li}${s.guid}`:null,key:s.textLabel,messageOverrides:{dismissLabel:a.removeTag},onCalciteChipClose:()=>this.calciteChipCloseHandler(s),scale:e,title:l,value:s.value},l)}))}renderInput(){const{guid:t,disabled:e,placeholder:n,selectionMode:a,selectedItems:s,open:o}=this,r="single"===a,c=s[0],l=!o&&r&&!!c;return i("span",{class:{"input-wrap":!0,"input-wrap--single":r}},l&&i("span",{class:{label:!0,"label--icon":!!(null==c?void 0:c.icon)},key:"label"},c.textLabel),i("input",{"aria-activedescendant":this.activeDescendant,"aria-autocomplete":"list","aria-controls":`${di}${t}`,"aria-label":E(this),class:{input:!0,"input--single":!0,"input--transparent":this.activeChipIndex>-1,"input--hidden":l,"input--icon":!!this.placeholderIcon},disabled:e,id:`${mi}${t}`,key:"input",onBlur:this.comboboxBlurHandler,onFocus:this.comboboxFocusHandler,onInput:this.inputHandler,placeholder:n,type:"text",ref:i=>this.textInput=i}))}renderListBoxOptions(){return this.filteredItems.map((t=>i("li",{"aria-selected":r(t.selected),id:t.guid?`${ci}${t.guid}`:null,role:"option",tabindex:"-1"},t.textLabel)))}renderFloatingUIContainer(){const{setFloatingEl:t,setContainerEl:e,open:n}=this;return i("div",{"aria-hidden":"true",class:{"floating-ui-container":!0,"floating-ui-container--active":n},ref:t},i("div",{class:{[K.listContainer]:!0,[g.animation]:!0,[g.animationActive]:n},ref:e},i("ul",{class:{list:!0,"list--hide":!n}},i("slot",null))))}renderIconStart(){const{selectedItems:t,placeholderIcon:e,selectionMode:n,placeholderIconFlipRtl:a}=this,s=t[0],o=null==s?void 0:s.icon,r="single"===n;return(!this.open&&s?!!o&&r:!!this.placeholderIcon&&(!s||r))&&i("span",{class:"icon-start"},i("calcite-icon",{class:"selected-icon",flipRtl:this.open&&s?s.iconFlipRtl:a,icon:!this.open&&s?o:e,scale:"s"}))}renderIconEnd(){const{open:t}=this;return i("span",{class:"icon-end"},i("calcite-icon",{icon:t?"chevron-up":"chevron-down",scale:"s"}))}render(){var t;const{guid:e,label:a,open:s}=this,o="single"===this.selectionMode,c=!this.clearDisabled&&(null===(t=this.value)||void 0===t?void 0:t.length)>0;return i(n,{onClick:this.comboboxFocusHandler},i("div",{"aria-autocomplete":"list","aria-controls":`${di}${e}`,"aria-expanded":r(s),"aria-haspopup":"listbox","aria-label":E(this),"aria-live":"polite","aria-owns":`${di}${e}`,class:{wrapper:!0,"wrapper--single":o||!this.selectedItems.length,"wrapper--active":s},onClick:this.clickHandler,onKeyDown:this.keyDownHandler,role:"combobox",ref:this.setReferenceEl},i("div",{class:"grid-input"},this.renderIconStart(),!o&&this.renderChips(),i("label",{class:"screen-readers-only",htmlFor:`${mi}${e}`,id:`${hi}${e}`},a),this.renderInput()),c?i(ri,{disabled:this.disabled,key:"close-button",label:this.messages.clear,scale:this.scale}):null,this.renderIconEnd()),i("ul",{"aria-labelledby":`${hi}${e}`,"aria-multiselectable":"true",class:"screen-readers-only",id:`${di}${e}`,role:"listbox",tabIndex:-1},this.renderListBoxOptions()),this.renderFloatingUIContainer(),i(k,{component:this}))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],value:["valueHandler"],messageOverrides:["onMessagesChange"],flipPlacements:["flipPlacementsHandler"],selectedItems:["selectedItemsHandler"],text:["textHandler"],effectiveLocale:["effectiveLocaleChange"]}}};pi.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{position:relative;display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host([scale=s]) .x-button{inline-size:1rem;block-size:1rem}:host([scale=m]) .x-button{inline-size:1.5rem;block-size:1.5rem}:host([scale=l]) .x-button{inline-size:2rem;block-size:2rem}.x-button{margin:0px;display:flex;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-content:center;align-items:center;justify-content:center;align-self:center;border-width:2px;background-color:transparent;color:var(--calcite-ui-text-3);outline-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s;border-radius:50%;border-color:transparent;background-color:var(--calcite-ui-foreground-2)}.x-button:active,.x-button:hover{color:var(--calcite-ui-text-1);background-color:var(--calcite-ui-foreground-3)}.x-button:active{border-style:solid;border-color:var(--calcite-ui-brand)}.x-button calcite-icon{color:inherit}:host([scale=s]){font-size:var(--calcite-font-size--2);--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-input-height:1.5rem}:host([scale=s]) .x-button{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem}:host([scale=m]){font-size:var(--calcite-font-size--1);--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-input-height:2rem}:host([scale=m]) .x-button{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem}:host([scale=l]){font-size:var(--calcite-font-size-0);--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.75rem;--calcite-combobox-input-height:2.75rem}:host([scale=l]) .x-button{-webkit-margin-end:1rem;margin-inline-end:1rem}.wrapper{display:flex;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);color:var(--calcite-ui-text-1);outline-color:transparent;padding-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host(:focus-within) .wrapper,.wrapper--active{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.wrapper--single{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l);cursor:pointer;flex-wrap:nowrap}.grid-input{display:flex;flex-grow:1;flex-wrap:wrap;align-items:center;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px}.input{flex-grow:1;-webkit-appearance:none;-moz-appearance:none;appearance:none;border-style:none;background-color:transparent;padding:0px;font-family:inherit;color:var(--calcite-ui-text-1);font-size:inherit;block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height);min-inline-size:120px;-webkit-margin-after:var(--calcite-combobox-item-spacing-unit-s);margin-block-end:var(--calcite-combobox-item-spacing-unit-s)}.input:focus{outline:2px solid transparent;outline-offset:2px}.input--transparent{opacity:0}.input--single{margin-block:0px;padding:0px}.wrapper--active .input-single{cursor:text}.input--hidden{pointer-events:none;inline-size:0px;min-inline-size:0px;opacity:0}.input--icon{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.input-wrap{display:flex;flex-grow:1}.input-wrap--single{flex:1 1 0%;overflow:hidden}.label{pointer-events:none;display:flex;max-inline-size:100%;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:0px;font-weight:var(--calcite-font-weight-normal);block-size:var(--calcite-combobox-input-height);line-height:var(--calcite-combobox-input-height)}.label--icon{padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon-end,.icon-start{display:flex;inline-size:1rem;cursor:pointer;align-items:center}.icon-end{flex:none}.floating-ui-container{--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}.floating-ui-container[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.floating-ui-container[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.floating-ui-container[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.floating-ui-container[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.floating-ui-container[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}.floating-ui-container--active{visibility:visible}@media (forced-colors: active){.wrapper,.floating-ui-container--active{border:1px solid canvasText}}.screen-readers-only{position:absolute;inline-size:1px;block-size:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);white-space:nowrap;border-width:0}.list-container{max-block-size:45vh;overflow-y:auto;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.list{margin:0px;display:block;padding:0px}.list--hide{block-size:0px;overflow:hidden}.chip{margin-block:calc(var(--calcite-combobox-item-spacing-unit-s) / 4);margin-inline:0 var(--calcite-combobox-item-spacing-unit-s);max-inline-size:100%}.chip--active{background-color:var(--calcite-ui-foreground-3)}.item{display:block}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";
12
12
  /*!
13
13
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
14
14
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
15
15
  * v1.4.3
16
16
  */
17
- const mi="icon",pi="icon--active",ui="icon--indent",bi=class{constructor(i){t(this,i),this.calciteComboboxItemChange=e(this,"calciteComboboxItemChange",6),this.scale="m",this.itemClickHandler=i=>{i.preventDefault(),this.toggleSelected()},this.disabled=!1,this.selected=!1,this.active=!1,this.ancestors=void 0,this.guid=z(),this.icon=void 0,this.iconFlipRtl=!1,this.textLabel=void 0,this.value=void 0,this.filterDisabled=void 0}selectedWatchHandler(){this.calciteComboboxItemChange.emit()}connectedCallback(){this.ancestors=X(this.el),this.scale=c(this.el,"scale",this.scale),Q(this),D(this)}disconnectedCallback(){Z(this),_(this)}componentDidRender(){C(this)}toggleSelected(){this.disabled||(this.selected=!this.selected)}renderIcon(t){return this.icon?i("calcite-icon",{class:{"icon--custom":!!this.icon,[pi]:this.icon&&this.selected,[ui]:!0},flipRtl:this.iconFlipRtl,icon:this.icon||t,key:"icon",scale:"l"===this.scale?"m":"s"}):null}renderSelectIndicator(t,e){return t?i("span",{class:{[mi]:!0,"icon--dot":!0,[ui]:!0}}):i("calcite-icon",{class:{[mi]:!0,[pi]:this.selected,[ui]:!0},flipRtl:this.iconFlipRtl,icon:e,key:"indicator",scale:"l"===this.scale?"m":"s"})}renderChildren(){return l(this.el)?i("ul",{key:"default-slot-container"},i("slot",null)):null}render(){const t="single"===c(this.el,"selection-mode","multiple"),e=t&&!this.disabled,a=this.disabled?"circle-disallowed":t?"dot":"check",s={label:!0,"label--selected":this.selected,"label--active":this.active,"label--single":t},o=Y(this.el);return i(n,{"aria-hidden":"true"},i("div",{class:`container scale--${this.scale}`,style:{"--calcite-combobox-item-spacing-indent-multiplier":`${o}`}},i("li",{class:s,id:this.guid,onClick:this.itemClickHandler},this.renderSelectIndicator(e,a),this.renderIcon(a),i("span",{class:"title"},this.textLabel)),this.renderChildren()))}get el(){return a(this)}static get watchers(){return{selected:["selectedWatchHandler"]}}};bi.style='@charset "UTF-8";@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{font-size:var(--calcite-font-size--2);line-height:1rem;--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-item-spacing-indent:0.5rem;--calcite-combobox-item-selector-icon-size:1rem}.scale--m{font-size:var(--calcite-font-size--1);line-height:1rem;--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-item-spacing-indent:0.75rem;--calcite-combobox-item-selector-icon-size:1rem}.scale--l{font-size:var(--calcite-font-size-0);line-height:1.25rem;--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.625rem;--calcite-combobox-item-spacing-indent:1rem;--calcite-combobox-item-selector-icon-size:1.5rem}.container{--calcite-combobox-item-indent-value:calc(\n var(--calcite-combobox-item-spacing-indent) * var(--calcite-combobox-item-spacing-indent-multiplier)\n )}:host(:focus){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host,ul{margin:0px;display:flex;flex-direction:column;padding:0px}:host(:focus),ul:focus{outline:2px solid transparent;outline-offset:2px}.label{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent;word-wrap:break-word;word-break:break-word;padding-block:var(--calcite-combobox-item-spacing-unit-s);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host([disabled]) .label{cursor:default}.label--selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.label--active{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.label:hover,.label:active{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.title{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon{display:inline-flex;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);color:var(--calcite-ui-border-1)}.icon--indent{-webkit-padding-start:var(--calcite-combobox-item-indent-value);padding-inline-start:var(--calcite-combobox-item-indent-value)}.icon--custom{-webkit-margin-before:-1px;margin-block-start:-1px;-webkit-padding-start:var(--calcite-combobox-item-spacing-unit-l);padding-inline-start:var(--calcite-combobox-item-spacing-unit-l);color:var(--calcite-ui-text-3)}.icon--active{color:var(--calcite-ui-text-1)}.icon--dot{display:flex;justify-content:center;min-inline-size:var(--calcite-combobox-item-selector-icon-size)}.icon--dot:before{text-align:start;content:"•"}.label--active .icon{opacity:1}.label--selected .icon{opacity:1;color:var(--calcite-ui-brand)}:host(:hover[disabled]) .icon{opacity:1}';
17
+ const ui="icon",bi="icon--active",fi="icon--indent",gi=class{constructor(i){t(this,i),this.calciteComboboxItemChange=e(this,"calciteComboboxItemChange",6),this.scale="m",this.itemClickHandler=i=>{i.preventDefault(),this.toggleSelected()},this.disabled=!1,this.selected=!1,this.active=!1,this.ancestors=void 0,this.guid=z(),this.icon=void 0,this.iconFlipRtl=!1,this.textLabel=void 0,this.value=void 0,this.filterDisabled=void 0}selectedWatchHandler(){this.calciteComboboxItemChange.emit()}connectedCallback(){this.ancestors=X(this.el),this.scale=c(this.el,"scale",this.scale),Q(this),D(this)}disconnectedCallback(){Z(this),_(this)}componentDidRender(){C(this)}toggleSelected(){this.disabled||(this.selected=!this.selected)}renderIcon(t){return this.icon?i("calcite-icon",{class:{"icon--custom":!!this.icon,[bi]:this.icon&&this.selected,[fi]:!0},flipRtl:this.iconFlipRtl,icon:this.icon||t,key:"icon",scale:"l"===this.scale?"m":"s"}):null}renderSelectIndicator(t,e){return t?i("span",{class:{[ui]:!0,"icon--dot":!0,[fi]:!0}}):i("calcite-icon",{class:{[ui]:!0,[bi]:this.selected,[fi]:!0},flipRtl:this.iconFlipRtl,icon:e,key:"indicator",scale:"l"===this.scale?"m":"s"})}renderChildren(){return l(this.el)?i("ul",{key:"default-slot-container"},i("slot",null)):null}render(){const t="single"===c(this.el,"selection-mode","multiple"),e=t&&!this.disabled,a=this.disabled?"circle-disallowed":t?"dot":"check",s={label:!0,"label--selected":this.selected,"label--active":this.active,"label--single":t},o=Y(this.el);return i(n,{"aria-hidden":"true"},i("div",{class:`container scale--${this.scale}`,style:{"--calcite-combobox-item-spacing-indent-multiplier":`${o}`}},i("li",{class:s,id:this.guid,onClick:this.itemClickHandler},this.renderSelectIndicator(e,a),this.renderIcon(a),i("span",{class:"title"},this.textLabel)),this.renderChildren()))}get el(){return a(this)}static get watchers(){return{selected:["selectedWatchHandler"]}}};gi.style='@charset "UTF-8";@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}.scale--s{font-size:var(--calcite-font-size--2);line-height:1rem;--calcite-combobox-item-spacing-unit-l:0.5rem;--calcite-combobox-item-spacing-unit-s:0.25rem;--calcite-combobox-item-spacing-indent:0.5rem;--calcite-combobox-item-selector-icon-size:1rem}.scale--m{font-size:var(--calcite-font-size--1);line-height:1rem;--calcite-combobox-item-spacing-unit-l:0.75rem;--calcite-combobox-item-spacing-unit-s:0.5rem;--calcite-combobox-item-spacing-indent:0.75rem;--calcite-combobox-item-selector-icon-size:1rem}.scale--l{font-size:var(--calcite-font-size-0);line-height:1.25rem;--calcite-combobox-item-spacing-unit-l:1rem;--calcite-combobox-item-spacing-unit-s:0.625rem;--calcite-combobox-item-spacing-indent:1rem;--calcite-combobox-item-selector-icon-size:1.5rem}.container{--calcite-combobox-item-indent-value:calc(\n var(--calcite-combobox-item-spacing-indent) * var(--calcite-combobox-item-spacing-indent-multiplier)\n )}:host(:focus){--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host,ul{margin:0px;display:flex;flex-direction:column;padding:0px}:host(:focus),ul:focus{outline:2px solid transparent;outline-offset:2px}.label{position:relative;box-sizing:border-box;display:flex;inline-size:100%;min-inline-size:100%;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);outline-color:transparent;word-wrap:break-word;word-break:break-word;padding-block:var(--calcite-combobox-item-spacing-unit-s);padding-inline:var(--calcite-combobox-item-spacing-unit-l)}:host([disabled]) .label{cursor:default}.label--selected{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}.label--active{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.label:hover,.label:active{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow)}.title{padding-block:0;padding-inline:var(--calcite-combobox-item-spacing-unit-l)}.icon{display:inline-flex;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);color:var(--calcite-ui-border-1)}.icon--indent{-webkit-padding-start:var(--calcite-combobox-item-indent-value);padding-inline-start:var(--calcite-combobox-item-indent-value)}.icon--custom{-webkit-margin-before:-1px;margin-block-start:-1px;-webkit-padding-start:var(--calcite-combobox-item-spacing-unit-l);padding-inline-start:var(--calcite-combobox-item-spacing-unit-l);color:var(--calcite-ui-text-3)}.icon--active{color:var(--calcite-ui-text-1)}.icon--dot{display:flex;justify-content:center;min-inline-size:var(--calcite-combobox-item-selector-icon-size)}.icon--dot:before{text-align:start;content:"•"}.label--active .icon{opacity:1}.label--selected .icon{opacity:1;color:var(--calcite-ui-brand)}:host(:hover[disabled]) .icon{opacity:1}';
18
18
  /*!
19
19
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
20
20
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
21
21
  * v1.4.3
22
22
  */
23
- const fi=class{constructor(i){t(this,i),this.calciteDropdownSelect=e(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=e(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=e(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=e(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=e(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=P("mutation",(()=>this.updateItems())),this.resizeObserver=P("resize",(i=>this.resizeObserverCallback(i))),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${z()}`,this.defaultAssignedElements=[],this.slotChangeHandler=i=>{this.defaultAssignedElements=i.target.assignedElements({flatten:!0}),this.updateItems()},this.setFilteredPlacements=()=>{const{el:i,flipPlacements:t}=this;this.filteredFlipPlacements=t?p(t,i):null},this.updateTriggers=i=>{this.triggers=i.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map((i=>Array.from(null==i?void 0:i.querySelectorAll("calcite-dropdown-item")))).reduce(((i,t)=>[...i,...t]),[]),this.updateSelectedItems(),this.reposition(!0)},this.updateGroups=i=>{const t=i.target.assignedElements({flatten:!0}).filter((i=>null==i?void 0:i.matches("calcite-dropdown-group")));this.groups=t,this.updateItems()},this.resizeObserverCallback=i=>{i.forEach((i=>{const{target:t}=i;t===this.referenceEl?this.setDropdownWidth():t===this.scrollerEl&&this.setMaxScrollerHeight()}))},this.setDropdownWidth=()=>{const{referenceEl:i,scrollerEl:t}=this,e=null==i?void 0:i.clientWidth;e&&t&&(t.style.minWidth=`${e}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:i}=this;if(!i)return;this.reposition(!0);const t=this.getMaxScrollerHeight();i.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=i=>{this.resizeObserver.observe(i),this.scrollerEl=i,this.transitionEl=i,O(this)},this.setReferenceEl=i=>{this.referenceEl=i,u(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(i)},this.setFloatingEl=i=>{this.floatingEl=i,u(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=i=>{if(i.target!==this.referenceEl)return;const{defaultPrevented:t,key:e}=i;if(!t){if(this.open){if("Escape"===e)return this.closeCalciteDropdown(),void i.preventDefault();if(i.shiftKey&&"Tab"===e)return this.closeCalciteDropdown(),void i.preventDefault()}ii(e)?(this.openCalciteDropdown(),i.preventDefault()):"Escape"===e&&(this.closeCalciteDropdown(),i.preventDefault())}},this.focusOnFirstActiveOrFirstItem=()=>{this.getFocusableElement(this.items.find((i=>i.selected))||this.items[0])},this.toggleOpenEnd=()=>{this.focusOnFirstActiveOrFirstItem(),this.el.removeEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.openCalciteDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=m,this.scale="m",this.selectedItems=[],this.type="click",this.width=void 0}openHandler(i){this.disabled?this.open=!1:i&&this.reposition(!0)}handleDisabledChange(i){i||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}async setFocus(){await $(this),this.el.focus()}connectedCallback(){var i;null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.reposition(!0),this.open&&this.openHandler(this.open),D(this),O(this)}componentWillLoad(){L(this)}componentDidLoad(){S(this),this.reposition(!0)}componentDidRender(){C(this)}disconnectedCallback(){var i,t;null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),_(this),f(this,this.referenceEl,this.floatingEl),F(this)}render(){const{open:t,guid:e}=this;return i(n,null,i("div",{class:"calcite-trigger-container",id:`${e}-menubutton`,onClick:this.openCalciteDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},i("slot",{"aria-controls":`${e}-menu`,"aria-expanded":r(t),"aria-haspopup":"menu",name:"trigger",onSlotchange:this.updateTriggers})),i("div",{"aria-hidden":r(!t),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},i("div",{"aria-labelledby":`${e}-menubutton`,class:{"calcite-dropdown-content":!0,[g.animation]:!0,[g.animationActive]:t},id:`${e}-menu`,role:"menu",ref:this.setScrollerAndTransitionEl},i("slot",{onSlotchange:this.updateGroups}))))}async reposition(i=!1){const{floatingEl:t,referenceEl:e,placement:n,overlayPositioning:a,filteredFlipPlacements:s}=this;return b(this,{floatingEl:t,referenceEl:e,overlayPositioning:a,placement:n,flipPlacements:s,type:"menu"},i)}closeCalciteDropdownOnClick(i){!this.disabled&&o(i)&&this.open&&!i.composedPath().includes(this.el)&&this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(i){this.closeCalciteDropdown(),i.stopPropagation()}closeCalciteDropdownOnOpenEvent(i){i.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||"hover"!==this.type||this.openCalciteDropdown()}pointerLeaveHandler(){this.disabled||"hover"!==this.type||this.closeCalciteDropdown()}calciteInternalDropdownItemKeyEvent(i){const{keyboardEvent:t}=i.detail,e=t.target;switch(t.key){case"Tab":this.items.indexOf(e)!==this.items.length-1||t.shiftKey?0===this.items.indexOf(e)&&t.shiftKey&&this.closeCalciteDropdown():this.closeCalciteDropdown();break;case"ArrowDown":h(this.items,e,"next");break;case"ArrowUp":h(this.items,e,"previous");break;case"Home":h(this.items,e,"first");break;case"End":h(this.items,e,"last")}i.stopPropagation()}handleItemSelect(i){this.updateSelectedItems(),i.stopPropagation(),this.calciteDropdownSelect.emit(),this.closeOnSelectDisabled&&"none"!==i.detail.requestedDropdownGroup.selectionMode||this.closeCalciteDropdown(),i.stopPropagation()}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter((i=>i.selected))}getMaxScrollerHeight(){const{maxItems:i,items:t}=this;let e,n=0,a=0;return this.groups.forEach((t=>{i>0&&n<i&&Array.from(t.children).forEach(((t,s)=>{0===s&&(isNaN(e)&&(e=t.offsetTop),a+=e),n<i&&(a+=t.offsetHeight,n+=1)}))})),t.length>i?a:0}closeCalciteDropdown(i=!0){this.open=!1,i&&d(this.triggers[0])}getFocusableElement(i){if(!i)return;const t=i.attributes.isLink?i.shadowRoot.querySelector("a"):i;d(t)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"]}}};fi.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;flex:0 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width=s]){--calcite-dropdown-width:12rem}:host([width=m]){--calcite-dropdown-width:14rem}:host([width=l]){--calcite-dropdown-width:16rem}";
23
+ const vi=class{constructor(i){t(this,i),this.calciteDropdownSelect=e(this,"calciteDropdownSelect",6),this.calciteDropdownBeforeClose=e(this,"calciteDropdownBeforeClose",6),this.calciteDropdownClose=e(this,"calciteDropdownClose",6),this.calciteDropdownBeforeOpen=e(this,"calciteDropdownBeforeOpen",6),this.calciteDropdownOpen=e(this,"calciteDropdownOpen",6),this.items=[],this.groups=[],this.mutationObserver=P("mutation",(()=>this.updateItems())),this.resizeObserver=P("resize",(i=>this.resizeObserverCallback(i))),this.openTransitionProp="opacity",this.guid=`calcite-dropdown-${z()}`,this.defaultAssignedElements=[],this.slotChangeHandler=i=>{this.defaultAssignedElements=i.target.assignedElements({flatten:!0}),this.updateItems()},this.setFilteredPlacements=()=>{const{el:i,flipPlacements:t}=this;this.filteredFlipPlacements=t?p(t,i):null},this.updateTriggers=i=>{this.triggers=i.target.assignedElements({flatten:!0}),this.reposition(!0)},this.updateItems=()=>{this.items=this.groups.map((i=>Array.from(null==i?void 0:i.querySelectorAll("calcite-dropdown-item")))).reduce(((i,t)=>[...i,...t]),[]),this.updateSelectedItems(),this.reposition(!0)},this.updateGroups=i=>{const t=i.target.assignedElements({flatten:!0}).filter((i=>null==i?void 0:i.matches("calcite-dropdown-group")));this.groups=t,this.updateItems()},this.resizeObserverCallback=i=>{i.forEach((i=>{const{target:t}=i;t===this.referenceEl?this.setDropdownWidth():t===this.scrollerEl&&this.setMaxScrollerHeight()}))},this.setDropdownWidth=()=>{const{referenceEl:i,scrollerEl:t}=this,e=null==i?void 0:i.clientWidth;e&&t&&(t.style.minWidth=`${e}px`)},this.setMaxScrollerHeight=()=>{const{scrollerEl:i}=this;if(!i)return;this.reposition(!0);const t=this.getMaxScrollerHeight();i.style.maxHeight=t>0?`${t}px`:"",this.reposition(!0)},this.setScrollerAndTransitionEl=i=>{this.resizeObserver.observe(i),this.scrollerEl=i,this.transitionEl=i,S(this)},this.setReferenceEl=i=>{this.referenceEl=i,u(this,this.referenceEl,this.floatingEl),this.resizeObserver.observe(i)},this.setFloatingEl=i=>{this.floatingEl=i,u(this,this.referenceEl,this.floatingEl)},this.keyDownHandler=i=>{if(i.target!==this.referenceEl)return;const{defaultPrevented:t,key:e}=i;if(!t){if(this.open){if("Escape"===e)return this.closeCalciteDropdown(),void i.preventDefault();if(i.shiftKey&&"Tab"===e)return this.closeCalciteDropdown(),void i.preventDefault()}ii(e)?(this.openCalciteDropdown(),i.preventDefault()):"Escape"===e&&(this.closeCalciteDropdown(),i.preventDefault())}},this.focusOnFirstActiveOrFirstItem=()=>{this.getFocusableElement(this.items.find((i=>i.selected))||this.items[0])},this.toggleOpenEnd=()=>{this.focusOnFirstActiveOrFirstItem(),this.el.removeEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.openCalciteDropdown=()=>{this.open=!this.open,this.open&&this.el.addEventListener("calciteDropdownOpen",this.toggleOpenEnd)},this.open=!1,this.closeOnSelectDisabled=!1,this.disabled=!1,this.flipPlacements=void 0,this.maxItems=0,this.overlayPositioning="absolute",this.placement=m,this.scale="m",this.selectedItems=[],this.type="click",this.width=void 0}openHandler(i){this.disabled?this.open=!1:i&&this.reposition(!0)}handleDisabledChange(i){i||(this.open=!1)}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}maxItemsHandler(){this.setMaxScrollerHeight()}overlayPositioningHandler(){this.reposition(!0)}placementHandler(){this.reposition(!0)}async setFocus(){await $(this),this.el.focus()}connectedCallback(){var i;null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0,subtree:!0}),this.setFilteredPlacements(),this.reposition(!0),this.open&&this.openHandler(this.open),D(this),S(this)}componentWillLoad(){j(this)}componentDidLoad(){O(this),this.reposition(!0)}componentDidRender(){C(this)}disconnectedCallback(){var i,t;null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),_(this),f(this,this.referenceEl,this.floatingEl),F(this)}render(){const{open:t,guid:e}=this;return i(n,null,i("div",{class:"calcite-trigger-container",id:`${e}-menubutton`,onClick:this.openCalciteDropdown,onKeyDown:this.keyDownHandler,ref:this.setReferenceEl},i("slot",{"aria-controls":`${e}-menu`,"aria-expanded":r(t),"aria-haspopup":"menu",name:"trigger",onSlotchange:this.updateTriggers})),i("div",{"aria-hidden":r(!t),class:"calcite-dropdown-wrapper",ref:this.setFloatingEl},i("div",{"aria-labelledby":`${e}-menubutton`,class:{"calcite-dropdown-content":!0,[g.animation]:!0,[g.animationActive]:t},id:`${e}-menu`,role:"menu",ref:this.setScrollerAndTransitionEl},i("slot",{onSlotchange:this.updateGroups}))))}async reposition(i=!1){const{floatingEl:t,referenceEl:e,placement:n,overlayPositioning:a,filteredFlipPlacements:s}=this;return b(this,{floatingEl:t,referenceEl:e,overlayPositioning:a,placement:n,flipPlacements:s,type:"menu"},i)}closeCalciteDropdownOnClick(i){!this.disabled&&o(i)&&this.open&&!i.composedPath().includes(this.el)&&this.closeCalciteDropdown(!1)}closeCalciteDropdownOnEvent(i){this.closeCalciteDropdown(),i.stopPropagation()}closeCalciteDropdownOnOpenEvent(i){i.composedPath().includes(this.el)||(this.open=!1)}pointerEnterHandler(){this.disabled||"hover"!==this.type||this.openCalciteDropdown()}pointerLeaveHandler(){this.disabled||"hover"!==this.type||this.closeCalciteDropdown()}calciteInternalDropdownItemKeyEvent(i){const{keyboardEvent:t}=i.detail,e=t.target;switch(t.key){case"Tab":this.items.indexOf(e)!==this.items.length-1||t.shiftKey?0===this.items.indexOf(e)&&t.shiftKey&&this.closeCalciteDropdown():this.closeCalciteDropdown();break;case"ArrowDown":h(this.items,e,"next");break;case"ArrowUp":h(this.items,e,"previous");break;case"Home":h(this.items,e,"first");break;case"End":h(this.items,e,"last")}i.stopPropagation()}handleItemSelect(i){this.updateSelectedItems(),i.stopPropagation(),this.calciteDropdownSelect.emit(),this.closeOnSelectDisabled&&"none"!==i.detail.requestedDropdownGroup.selectionMode||this.closeCalciteDropdown(),i.stopPropagation()}onBeforeOpen(){this.calciteDropdownBeforeOpen.emit()}onOpen(){this.calciteDropdownOpen.emit()}onBeforeClose(){this.calciteDropdownBeforeClose.emit()}onClose(){this.calciteDropdownClose.emit()}updateSelectedItems(){this.selectedItems=this.items.filter((i=>i.selected))}getMaxScrollerHeight(){const{maxItems:i,items:t}=this;let e,n=0,a=0;return this.groups.forEach((t=>{i>0&&n<i&&Array.from(t.children).forEach(((t,s)=>{0===s&&(isNaN(e)&&(e=t.offsetTop),a+=e),n<i&&(a+=t.offsetHeight,n+=1)}))})),t.length>i?a:0}closeCalciteDropdown(i=!0){this.open=!1,i&&d(this.triggers[0])}getFocusableElement(i){if(!i)return;const t=i.attributes.isLink?i.shadowRoot.querySelector("a"):i;d(t)}static get delegatesFocus(){return!0}get el(){return a(this)}static get watchers(){return{open:["openHandler"],disabled:["handleDisabledChange"],flipPlacements:["flipPlacementsHandler"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],placement:["placementHandler"]}}};vi.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:inline-flex;flex:0 1 auto}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}:host .calcite-dropdown-wrapper{--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown);display:block;position:absolute;z-index:var(--calcite-floating-ui-z-index);visibility:hidden}.calcite-dropdown-wrapper .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:var(--calcite-app-z-index);border-radius:0.25rem}.calcite-dropdown-wrapper[data-placement^=bottom] .calcite-floating-ui-anim{transform:translateY(-5px)}.calcite-dropdown-wrapper[data-placement^=top] .calcite-floating-ui-anim{transform:translateY(5px)}.calcite-dropdown-wrapper[data-placement^=left] .calcite-floating-ui-anim{transform:translateX(5px)}.calcite-dropdown-wrapper[data-placement^=right] .calcite-floating-ui-anim{transform:translateX(-5px)}.calcite-dropdown-wrapper[data-placement] .calcite-floating-ui-anim--active{opacity:1;transform:translate(0)}:host([open]) .calcite-dropdown-wrapper{visibility:visible}:host .calcite-dropdown-content{max-block-size:45vh;inline-size:auto;overflow-y:auto;overflow-x:hidden;background-color:var(--calcite-ui-foreground-1);inline-size:var(--calcite-dropdown-width)}.calcite-trigger-container{position:relative;display:flex;flex:1 1 auto;word-wrap:break-word;word-break:break-word}@media (forced-colors: active){:host([open]) .calcite-dropdown-wrapper{border:1px solid canvasText}}:host([width=s]){--calcite-dropdown-width:12rem}:host([width=m]){--calcite-dropdown-width:14rem}:host([width=l]){--calcite-dropdown-width:16rem}";
24
24
  /*!
25
25
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
26
26
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
27
27
  * v1.4.3
28
28
  */
29
- const gi=class{constructor(i){t(this,i),this.calciteInternalDropdownItemChange=e(this,"calciteInternalDropdownItemChange",6),this.groupTitle=void 0,this.selectionMode="single",this.scale=void 0}componentWillLoad(){this.groupPosition=this.getGroupPosition()}render(){const t=this.scale||c(this.el,"scale","m"),e=this.groupTitle?i("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,a=this.groupPosition>0?i("div",{class:"dropdown-separator",role:"separator"}):null;return i(n,{"aria-label":this.groupTitle,role:"group"},i("div",{class:{container:!0,"container--s":"s"===t,"container--m":"m"===t,"container--l":"l"===t},title:this.groupTitle},a,e,i("slot",null)))}updateActiveItemOnChange(i){this.requestedDropdownGroup=i.detail.requestedDropdownGroup,this.requestedDropdownItem=i.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return a(this)}};gi.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{-webkit-margin-after:-1px;margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-ui-border-3)}";
29
+ const wi=class{constructor(i){t(this,i),this.calciteInternalDropdownItemChange=e(this,"calciteInternalDropdownItemChange",6),this.groupTitle=void 0,this.selectionMode="single",this.scale=void 0}componentWillLoad(){this.groupPosition=this.getGroupPosition()}render(){const t=this.scale||c(this.el,"scale","m"),e=this.groupTitle?i("span",{"aria-hidden":"true",class:"dropdown-title"},this.groupTitle):null,a=this.groupPosition>0?i("div",{class:"dropdown-separator",role:"separator"}):null;return i(n,{"aria-label":this.groupTitle,role:"group"},i("div",{class:{container:!0,"container--s":"s"===t,"container--m":"m"===t,"container--l":"l"===t},title:this.groupTitle},a,e,i("slot",null)))}updateActiveItemOnChange(i){this.requestedDropdownGroup=i.detail.requestedDropdownGroup,this.requestedDropdownItem=i.detail.requestedDropdownItem,this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return a(this)}};wi.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{-webkit-margin-after:-1px;margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-ui-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-ui-border-3)}";
30
30
  /*!
31
31
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
32
32
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
33
33
  * v1.4.3
34
34
  */
35
- const vi=class{constructor(i){t(this,i),this.calciteDropdownItemSelect=e(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=e(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=e(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=e(this,"calciteInternalDropdownCloseRequest",6),this.scale="m",this.selected=!1,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.href=void 0,this.label=void 0,this.rel=void 0,this.target=void 0}async setFocus(){var i;await $(this),null===(i=this.el)||void 0===i||i.focus()}componentWillLoad(){L(this),this.initialize()}componentDidLoad(){S(this)}connectedCallback(){this.initialize()}render(){const t=c(this.el,"scale",this.scale),e=i("calcite-icon",{class:"dropdown-item-icon-start",flipRtl:"start"===this.iconFlipRtl||"both"===this.iconFlipRtl,icon:this.iconStart,scale:"l"===t?"m":"s"}),a=i("span",{class:"dropdown-item-content"},i("slot",null)),s=i("calcite-icon",{class:"dropdown-item-icon-end",flipRtl:"end"===this.iconFlipRtl||"both"===this.iconFlipRtl,icon:this.iconEnd,scale:"l"===t?"m":"s"}),o=this.iconStart&&this.iconEnd?[e,a,s]:this.iconStart?[e,a]:this.iconEnd?[a,s]:a,l=this.href?i("a",{"aria-label":this.label,class:"dropdown-link",href:this.href,rel:this.rel,tabIndex:-1,target:this.target,ref:i=>this.childLink=i},o):o,h=this.href?null:"single"===this.selectionMode?"menuitemradio":"multiple"===this.selectionMode?"menuitemcheckbox":"menuitem",d="none"!==this.selectionMode?r(this.selected):null;return i(n,{"aria-checked":d,role:h,tabindex:"0"},i("div",{class:{container:!0,"container--link":!!this.href,"container--s":"s"===t,"container--m":"m"===t,"container--l":"l"===t,"container--multi-selection":"multiple"===this.selectionMode,"container--single-selection":"single"===this.selectionMode,"container--none-selection":"none"===this.selectionMode}},"none"!==this.selectionMode?i("calcite-icon",{class:"dropdown-item-icon",icon:"multiple"===this.selectionMode?"check":"bullet-point",scale:"l"===t?"m":"s"}):null,l))}onClick(){this.emitRequestedItem()}keyDownHandler(i){switch(i.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),i.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),i.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:i});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":i.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:i})}}updateActiveItemOnChange(i){i.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=i.detail.requestedDropdownGroup,this.requestedDropdownItem=i.detail.requestedDropdownItem,this.determineActiveItem()),i.stopPropagation()}initialize(){this.selectionMode=c(this.el,"selection-mode","single"),this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),"none"===this.selectionMode&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return a(this)}};vi.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}.container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;-webkit-padding-end:0.5rem;padding-inline-end:0.5rem;-webkit-padding-start:1.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;-webkit-padding-end:0.75rem;padding-inline-end:0.75rem;-webkit-padding-start:2rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;-webkit-padding-end:1rem;padding-inline-end:1rem;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}.container--s.container--none-selection{-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{-webkit-padding-start:0px;padding-inline-start:0px}.container--m.container--none-selection{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{-webkit-padding-start:0px;padding-inline-start:0px}.container--l.container--none-selection{-webkit-padding-start:0.75rem;padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{-webkit-padding-start:0px;padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;-webkit-padding-end:auto;padding-inline-end:auto;-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;-webkit-padding-end:0.5rem;padding-inline-end:0.5rem;-webkit-padding-start:1.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;-webkit-padding-end:0.75rem;padding-inline-end:0.75rem;-webkit-padding-start:2rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;-webkit-padding-end:1rem;padding-inline-end:1rem;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}:host(:hover) .container,:host(:active) .container{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:hover) .container--link .dropdown-link,:host(:active) .container--link .dropdown-link{color:var(--calcite-ui-text-1)}:host(:focus) .container{color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:active) .container{background-color:var(--calcite-ui-foreground-3)}:host(:hover) .container:before,:host(:active) .container:before,:host(:focus) .container:before{opacity:1}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}:host([selected]) .container:not(.container--none-selection):before,:host([selected]) .container--link .dropdown-link:before{opacity:1;color:var(--calcite-ui-brand)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-ui-brand)}.container--multi-selection:before,.container--none-selection:before{display:none}.container--s:before{inset-inline-start:0.5rem}.container--m:before{inset-inline-start:0.75rem}.container--l:before{inset-inline-start:1rem}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover) .dropdown-item-icon{color:var(--calcite-ui-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-ui-brand);opacity:1}.container--s .dropdown-item-icon-start{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{-webkit-margin-end:1rem;margin-inline-end:1rem;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{-webkit-margin-start:1rem;margin-inline-start:1rem}";const wi=class{constructor(i){t(this,i),this.layerSelectionChange=e(this,"layerSelectionChange",7),this.appearance="transparent",this.enabledLayerIds=[],this.mapView=void 0,this.placeholderIcon="",this.selectedLayerIds=[],this.scale="m",this.type="select",this.layerIds=[],this.selectedLayerName=""}async mapViewWatchHandler(){await this._setLayers(),this._setSelectedLayer(this.layerIds[0])}async componentWillLoad(){await this._setLayers(),(this.layerIds.length>0||1===this.selectedLayerIds.length)&&this.layerSelectionChange.emit(1===this.selectedLayerIds.length?[this.selectedLayerIds[0]]:[this.layerIds[0]])}render(){return i(n,null,i("div",{class:"map-layer-picker-container"},i("div",{class:"map-layer-picker"},"combobox"===this.type?this._getCombobox():"select"===this.type?this._getSelect():this._getDropdown())))}async componentDidLoad(){if(this.layerIds.length>0||1===this.selectedLayerIds.length){const i=1===this.selectedLayerIds.length?this.selectedLayerIds[0]:this.layerIds[0];"select"===this.type?this._layerElement.value=i:"dropdown"===this.type&&(this.selectedLayerName=ni.layerNameHash[i])}}_getSelect(){return i("calcite-select",{label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:i=>{this._layerElement=i},scale:this.scale},this._addSelectMapLayersOptions())}_getCombobox(){return i("calcite-combobox",{clearDisabled:!0,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:i=>{this._layerElement=i},scale:this.scale,"selection-mode":"single"},this._addComboboxMapLayersOptions())}_getDropdown(){return i("calcite-dropdown",{class:"layer-picker-dropdown"},i("calcite-action",{slot:"trigger",text:""},i("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:"max-width-350",iconEnd:"chevron-down",iconStart:"layers",kind:"neutral",width:"full"},i("div",null,this.selectedLayerName))),i("calcite-dropdown-group",{"selection-mode":"single"},this._getDropdownItems()))}_getDropdownItems(){return this.layerIds.reduce(((t,e)=>(ni.managedLayers.indexOf(ni.layerNameHash[e])<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(e)>-1)&&t.push(i("calcite-dropdown-item",{onClick:()=>{this._setSelectedLayer(e)}},ni.layerNameHash[e])),t)),[])}_setSelectedLayer(i){this.selectedLayerName=ni.layerNameHash[i],this.selectedLayerIds=[i],this.layerSelectionChange.emit(this.selectedLayerIds)}_addSelectMapLayersOptions(){return this.layerIds.reduce(((t,e)=>(ni.managedLayers.indexOf(ni.layerNameHash[e])<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(e)>-1)&&t.push(i("calcite-option",{label:ni.layerNameHash[e],value:e})),t)),[])}_addComboboxMapLayersOptions(){return this.layerIds.reduce(((t,e)=>(ni.managedLayers.indexOf(ni.layerNameHash[e])<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(e)>-1)&&t.push(i("calcite-combobox-item",{textLabel:ni.layerNameHash[e],value:e})),t)),[])}async _setLayers(){if(this.mapView){const i=await ti(this.mapView);this.layerIds=i.filter((i=>{var t;return!((null===(t=this.enabledLayerIds)||void 0===t?void 0:t.length)>0)||this.enabledLayerIds.indexOf(i)>-1})),await this._initLayerHashState()}}async _initLayerHashState(){this.mapView&&(ni.layerNameHash=await ei(this.mapView))}_layerSelectionChange(){const i=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(i)!==JSON.stringify([""])&&(this.selectedLayerIds=i,this.layerSelectionChange.emit(this.selectedLayerIds))}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};wi.style=":host{display:block}.map-layer-picker-container{width:100%}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}";export{di as calcite_combobox,bi as calcite_combobox_item,fi as calcite_dropdown,gi as calcite_dropdown_group,vi as calcite_dropdown_item,wi as map_layer_picker}
35
+ const xi=class{constructor(i){t(this,i),this.calciteDropdownItemSelect=e(this,"calciteDropdownItemSelect",6),this.calciteInternalDropdownItemSelect=e(this,"calciteInternalDropdownItemSelect",6),this.calciteInternalDropdownItemKeyEvent=e(this,"calciteInternalDropdownItemKeyEvent",6),this.calciteInternalDropdownCloseRequest=e(this,"calciteInternalDropdownCloseRequest",6),this.scale="m",this.selected=!1,this.iconFlipRtl=void 0,this.iconStart=void 0,this.iconEnd=void 0,this.href=void 0,this.label=void 0,this.rel=void 0,this.target=void 0}async setFocus(){var i;await $(this),null===(i=this.el)||void 0===i||i.focus()}componentWillLoad(){j(this),this.initialize()}componentDidLoad(){O(this)}connectedCallback(){this.initialize()}render(){const t=c(this.el,"scale",this.scale),e=i("calcite-icon",{class:"dropdown-item-icon-start",flipRtl:"start"===this.iconFlipRtl||"both"===this.iconFlipRtl,icon:this.iconStart,scale:"l"===t?"m":"s"}),a=i("span",{class:"dropdown-item-content"},i("slot",null)),s=i("calcite-icon",{class:"dropdown-item-icon-end",flipRtl:"end"===this.iconFlipRtl||"both"===this.iconFlipRtl,icon:this.iconEnd,scale:"l"===t?"m":"s"}),o=this.iconStart&&this.iconEnd?[e,a,s]:this.iconStart?[e,a]:this.iconEnd?[a,s]:a,l=this.href?i("a",{"aria-label":this.label,class:"dropdown-link",href:this.href,rel:this.rel,tabIndex:-1,target:this.target,ref:i=>this.childLink=i},o):o,h=this.href?null:"single"===this.selectionMode?"menuitemradio":"multiple"===this.selectionMode?"menuitemcheckbox":"menuitem",d="none"!==this.selectionMode?r(this.selected):null;return i(n,{"aria-checked":d,role:h,tabindex:"0"},i("div",{class:{container:!0,"container--link":!!this.href,"container--s":"s"===t,"container--m":"m"===t,"container--l":"l"===t,"container--multi-selection":"multiple"===this.selectionMode,"container--single-selection":"single"===this.selectionMode,"container--none-selection":"none"===this.selectionMode}},"none"!==this.selectionMode?i("calcite-icon",{class:"dropdown-item-icon",icon:"multiple"===this.selectionMode?"check":"bullet-point",scale:"l"===t?"m":"s"}):null,l))}onClick(){this.emitRequestedItem()}keyDownHandler(i){switch(i.key){case" ":case"Enter":this.emitRequestedItem(),this.href&&this.childLink.click(),i.preventDefault();break;case"Escape":this.calciteInternalDropdownCloseRequest.emit(),i.preventDefault();break;case"Tab":this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:i});break;case"ArrowUp":case"ArrowDown":case"Home":case"End":i.preventDefault(),this.calciteInternalDropdownItemKeyEvent.emit({keyboardEvent:i})}}updateActiveItemOnChange(i){i.composedPath().includes(this.parentDropdownGroupEl)&&(this.requestedDropdownGroup=i.detail.requestedDropdownGroup,this.requestedDropdownItem=i.detail.requestedDropdownItem,this.determineActiveItem()),i.stopPropagation()}initialize(){this.selectionMode=c(this.el,"selection-mode","single"),this.parentDropdownGroupEl=this.el.closest("calcite-dropdown-group"),"none"===this.selectionMode&&(this.selected=!1)}determineActiveItem(){switch(this.selectionMode){case"multiple":this.el===this.requestedDropdownItem&&(this.selected=!this.selected);break;case"single":this.el===this.requestedDropdownItem?this.selected=!0:this.requestedDropdownGroup===this.parentDropdownGroupEl&&(this.selected=!1);break;case"none":this.selected=!1}}emitRequestedItem(){this.calciteDropdownItemSelect.emit(),this.calciteInternalDropdownItemSelect.emit({requestedDropdownItem:this.el,requestedDropdownGroup:this.parentDropdownGroupEl})}get el(){return a(this)}};xi.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}.container--s{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;-webkit-padding-end:0.5rem;padding-inline-end:0.5rem;-webkit-padding-start:1.5rem;padding-inline-start:1.5rem}.container--m{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;-webkit-padding-end:0.75rem;padding-inline-end:0.75rem;-webkit-padding-start:2rem;padding-inline-start:2rem}.container--l{padding-block:0.625rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;-webkit-padding-end:1rem;padding-inline-end:1rem;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}.container--s.container--none-selection{-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}.container--s.container--none-selection .dropdown-link{-webkit-padding-start:0px;padding-inline-start:0px}.container--m.container--none-selection{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.container--m.container--none-selection .dropdown-link{-webkit-padding-start:0px;padding-inline-start:0px}.container--l.container--none-selection{-webkit-padding-start:0.75rem;padding-inline-start:0.75rem}.container--l.container--none-selection .dropdown-link{-webkit-padding-start:0px;padding-inline-start:0px}:host{position:relative;display:flex;flex-grow:1;align-items:center}.container{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);text-align:start}.dropdown-item-content{flex:1 1 auto;padding-block:0.125rem;-webkit-padding-end:auto;padding-inline-end:auto;-webkit-padding-start:0.25rem;padding-inline-start:0.25rem}:host,.container--link a{outline-color:transparent}:host(:focus){outline:2px solid transparent;outline-offset:2px;outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.container--link{padding:0px}.container--link a{position:relative;display:flex;flex-grow:1;cursor:pointer;align-items:center;color:var(--calcite-ui-text-3);-webkit-text-decoration-line:none;text-decoration-line:none;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1)}.container--s .dropdown-link{padding-block:0.25rem;font-size:var(--calcite-font-size--2);line-height:1rem;-webkit-padding-end:0.5rem;padding-inline-end:0.5rem;-webkit-padding-start:1.5rem;padding-inline-start:1.5rem}.container--m .dropdown-link{padding-block:0.5rem;font-size:var(--calcite-font-size--1);line-height:1rem;-webkit-padding-end:0.75rem;padding-inline-end:0.75rem;-webkit-padding-start:2rem;padding-inline-start:2rem}.container--l .dropdown-link{padding-block:0.75rem;font-size:var(--calcite-font-size-0);line-height:1.25rem;-webkit-padding-end:1rem;padding-inline-end:1rem;-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}:host(:hover) .container,:host(:active) .container{background-color:var(--calcite-ui-foreground-2);color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:hover) .container--link .dropdown-link,:host(:active) .container--link .dropdown-link{color:var(--calcite-ui-text-1)}:host(:focus) .container{color:var(--calcite-ui-text-1);-webkit-text-decoration-line:none;text-decoration-line:none}:host(:active) .container{background-color:var(--calcite-ui-foreground-3)}:host(:hover) .container:before,:host(:active) .container:before,:host(:focus) .container:before{opacity:1}:host([selected]) .container:not(.container--none-selection),:host([selected]) .container--link .dropdown-link{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-1)}:host([selected]) .container:not(.container--none-selection):before,:host([selected]) .container--link .dropdown-link:before{opacity:1;color:var(--calcite-ui-brand)}:host([selected]) .container:not(.container--none-selection) calcite-icon,:host([selected]) .container--link .dropdown-link calcite-icon{color:var(--calcite-ui-brand)}.container--multi-selection:before,.container--none-selection:before{display:none}.container--s:before{inset-inline-start:0.5rem}.container--m:before{inset-inline-start:0.75rem}.container--l:before{inset-inline-start:1rem}.dropdown-item-icon{position:absolute;opacity:0;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transform:scale(0.9)}.container--s .dropdown-item-icon{inset-inline-start:0.25rem}.container--m .dropdown-item-icon{inset-inline-start:0.5rem}.container--l .dropdown-item-icon{inset-inline-start:0.75rem}:host(:hover) .dropdown-item-icon{color:var(--calcite-ui-border-1);opacity:1}:host([selected]) .dropdown-item-icon{color:var(--calcite-ui-brand);opacity:1}.container--s .dropdown-item-icon-start{-webkit-margin-end:0.5rem;margin-inline-end:0.5rem;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.container--s .dropdown-item-icon-end{-webkit-margin-start:0.5rem;margin-inline-start:0.5rem}.container--m .dropdown-item-icon-start{-webkit-margin-end:0.75rem;margin-inline-end:0.75rem;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.container--m .dropdown-item-icon-end{-webkit-margin-start:0.75rem;margin-inline-start:0.75rem}.container--l .dropdown-item-icon-start{-webkit-margin-end:1rem;margin-inline-end:1rem;-webkit-margin-start:0.25rem;margin-inline-start:0.25rem}.container--l .dropdown-item-icon-end{-webkit-margin-start:1rem;margin-inline-start:1rem}";const yi=class{constructor(i){t(this,i),this.layerSelectionChange=e(this,"layerSelectionChange",7),this.appearance="transparent",this.enabledLayerIds=[],this.enabledTableIds=[],this.mapView=void 0,this.placeholderIcon="",this.selectedIds=[],this.scale="m",this.showTables=!0,this.type="select",this.ids=[],this.selectedName=""}async mapViewWatchHandler(){await this._setLayers();const i=Object.keys(si.layerNameHash).length>0,t=Object.keys(si.tableNameHash).length>0&&this.showTables;(i||t)&&this._setSelectedLayer(this.ids[0],i?"layer":"table")}async componentWillLoad(){await this._setLayers(),(this.ids.length>0||1===this.selectedIds.length)&&this.layerSelectionChange.emit(1===this.selectedIds.length?[this.selectedIds[0]]:[this.ids[0]])}render(){return i(n,null,i("div",{class:"map-layer-picker-container"},i("div",{class:"map-layer-picker"},"combobox"===this.type?this._getCombobox():"select"===this.type?this._getSelect():this._getDropdown())))}async componentDidLoad(){if(this.ids.length>0||1===this.selectedIds.length){const i=1===this.selectedIds.length?this.selectedIds[0]:this.ids[0];"select"===this.type?this._layerElement.value=i:"dropdown"===this.type&&(this.selectedName=Object.keys(si.layerNameHash).indexOf(i)>-1?si.layerNameHash[i]:Object.keys(si.tableNameHash).indexOf(i)>-1?si.tableNameHash[i]:"")}}_getSelect(){return i("calcite-select",{label:"",onCalciteSelectChange:()=>this._layerSelectionChange(),ref:i=>{this._layerElement=i},scale:this.scale},this._getMapLayerOptions())}_getCombobox(){return i("calcite-combobox",{clearDisabled:!0,label:"",onCalciteComboboxChange:()=>this._layerSelectionChange(),"placeholder-icon":this.placeholderIcon,ref:i=>{this._layerElement=i},scale:this.scale,"selection-mode":"single"},this._getMapLayerOptions())}_getDropdown(){return i("calcite-dropdown",{class:"layer-picker-dropdown"},i("calcite-action",{slot:"trigger",text:""},i("calcite-button",{alignment:"icon-end-space-between",appearance:this.appearance,class:"max-width-350",iconEnd:"chevron-down",iconStart:"layers",kind:"neutral",width:"full"},i("div",null,this.selectedName))),i("calcite-dropdown-group",{"selection-mode":"single"},this._getMapLayerOptions()))}_getMapLayerOptions(){return this.ids.reduce(((i,t)=>(this._validLayer(t)?i.push(this._getItem(t,"layer")):this._validTable(t)&&i.push(this._getItem(t,"table")),i)),[])}_getItem(t,e){const n="layer"===e?si.layerNameHash[t]:si.tableNameHash[t];return"combobox"===this.type?i("calcite-combobox-item",{textLabel:n,value:t}):"select"===this.type?i("calcite-option",{label:n,value:t}):i("calcite-dropdown-item",{onClick:()=>{this._setSelectedLayer(t,e)}},n)}_setSelectedLayer(i,t){this.selectedName="layer"===t?si.layerNameHash[i]:si.tableNameHash[i],this.selectedIds=[i],this.layerSelectionChange.emit(this.selectedIds)}async _setLayers(){if(this.mapView){const i=await ti(this.mapView),t=this.showTables?await ei(this.mapView):[];this.ids=[...i.filter((i=>{var t;return!((null===(t=this.enabledLayerIds)||void 0===t?void 0:t.length)>0)||this.enabledLayerIds.indexOf(i)>-1})),...t.filter((i=>{var t;return!((null===(t=this.enabledTableIds)||void 0===t?void 0:t.length)>0)||this.enabledTableIds.indexOf(i)>-1}))],await this._initStateHash()}}async _initStateHash(){this.mapView&&(si.layerNameHash=await ni(this.mapView),si.tableNameHash=this.showTables?await ai(this.mapView):{})}_validLayer(i){const t=si.layerNameHash[i];return t&&si.managedLayers.indexOf(t)<0&&(this.enabledLayerIds.length>0?this.enabledLayerIds.indexOf(i)>-1:t)}_validTable(i){const t=si.tableNameHash[i],e=t&&this.showTables;return e?si.managedTables.indexOf(t)<0&&(!(this.enabledTableIds.length>0)||this.enabledTableIds.indexOf(i)>-1):e}_layerSelectionChange(){const i=Array.isArray(this._layerElement.value)?this._layerElement.value:[this._layerElement.value];JSON.stringify(i)!==JSON.stringify([""])&&(this.selectedIds=i,this.layerSelectionChange.emit(this.selectedIds))}get el(){return a(this)}static get watchers(){return{mapView:["mapViewWatchHandler"]}}};yi.style=":host{display:block}.map-layer-picker-container{width:100%}.map-layer-picker{position:relative;width:100%;display:inline-block}.padding-bottom-1{padding-bottom:1rem}.layer-picker-dropdown{height:100%;width:100%}.max-width-350{max-width:350px}";export{pi as calcite_combobox,gi as calcite_combobox_item,vi as calcite_dropdown,wi as calcite_dropdown_group,xi as calcite_dropdown_item,yi as map_layer_picker}
@@ -3,7 +3,7 @@
3
3
  * Licensed under the Apache License, Version 2.0
4
4
  * http://www.apache.org/licenses/LICENSE-2.0
5
5
  */
6
- import{r as t,c as i,h as a,H as e,g as s}from"./p-f8be5d5f.js";import{l as n}from"./p-d7ddd3a2.js";import{g as l}from"./p-fc2277fe.js";import{v as r,i as h,w as o}from"./p-1aca2237.js";import{g as c}from"./p-a738e38f.js";import{c as d,d as u,a as m,H as b}from"./p-c844e615.js";import{c as p,d as f,u as v}from"./p-41f5a5fc.js";import{i as g}from"./p-40bdd836.js";import{c as x,d as _,g as k}from"./p-8bf81a2e.js";import{s as w,a as y,c as z}from"./p-5173b841.js";import{n as V,c as D,d as $}from"./p-0ff7b311.js";import{d as M,c as H}from"./p-8249c47b.js";import{f as I}from"./p-9ab03591.js";import{s as j}from"./p-a29ba58a.js";import"./p-e1a4994d.js";import"./p-c2d148da.js";import"./p-d60a77a4.js";import"./p-99b55177.js";import"./p-4ff653eb.js";const C=class{constructor(a){t(this,a),this.bufferComplete=i(this,"bufferComplete",7),this.distanceChanged=i(this,"distanceChanged",7),this.unitChanged=i(this,"unitChanged",7),this.appearance="text",this.distance=0,this.geometries=[],this.max=void 0,this.min=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this.disabled=!1,this._translations=void 0}geometriesWatchHandler(){this._buffer()}disabledWatchHandler(){this._buffer()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return a(e,null,"text"===this.appearance?this._getTextBoxDisplay():this._getSliderDisplay())}async _initModules(){const[t]=await n(["esri/geometry/geometryEngine"]);this._geometryEngine=t}_getUnits(){const t={feet:this._translations.feet,meters:this._translations.meters,miles:this._translations.miles,kilometers:this._translations.kilometers};return Object.keys(t).map((i=>a("calcite-option",{label:t[i],selected:this.unit===i,value:i})))}_setDistance(t){const i=parseInt(t.target.value,10);this.distance!==i&&i>=this.min&&(this.distanceChanged.emit({oldValue:this.distance,newValue:i}),this.distance=i,this.distance>0?this._buffer():this.bufferComplete.emit(void 0))}_setUnit(t){this.unitChanged.emit({oldValue:this.unit,newValue:t}),this.unit=t,this._buffer()}_buffer(){this.disabled?this.bufferComplete.emit(void 0):(this._bufferTimeout&&clearTimeout(this._bufferTimeout),this._bufferTimeout=setTimeout((()=>{var t;if((null===(t=this.geometries)||void 0===t?void 0:t.length)>0&&this.unit&&this.distance>0){const t=this._geometryEngine.geodesicBuffer(this.geometries,this.distance,this.unit,this.unionResults);this.bufferComplete.emit(t)}}),400))}_getTextBoxDisplay(){return a("div",{class:"c-container"},a("calcite-input",{class:"padding-end-1 w-50",max:this.max&&this.max>0?this.max:void 0,min:this.min,"number-button-type":"vertical",onCalciteInputInput:t=>this._setDistance(t),placeholder:"0",type:"number",value:this.distance?this.distance.toString():void 0}),a("calcite-select",{class:"flex-1 w-50",label:"label",onCalciteSelectChange:()=>this._setUnit(this._unitElement.value),ref:t=>{this._unitElement=t}},this._getUnits()))}_getSliderDisplay(){return a("div",null,a("calcite-slider",{labelHandles:!0,max:this.max&&this.max>0?this.max:void 0,min:this.min,ticks:this.sliderTicks}))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}_testAccess(t,i){switch(t){case"_setUnit":return this._setUnit(i);case"_setDistance":return this._setDistance(i)}return null}get el(){return s(this)}static get watchers(){return{geometries:["geometriesWatchHandler"],disabled:["disabledWatchHandler"]}}};
6
+ import{r as t,c as i,h as a,H as e,g as s}from"./p-f8be5d5f.js";import{l as n}from"./p-d7ddd3a2.js";import{g as l}from"./p-fc2277fe.js";import{v as r,i as h,w as o}from"./p-1aca2237.js";import{g as c}from"./p-a738e38f.js";import{c as d,d as u,a as m,H as b}from"./p-c844e615.js";import{c as p,d as f,u as v}from"./p-41f5a5fc.js";import{i as g}from"./p-40bdd836.js";import{c as x,d as _,g as k}from"./p-8bf81a2e.js";import{s as w,a as y,c as z}from"./p-5173b841.js";import{n as V,c as D,d as $}from"./p-0ff7b311.js";import{d as M,c as H}from"./p-8249c47b.js";import{f as I}from"./p-9ab03591.js";import{s as j}from"./p-477ae127.js";import"./p-e1a4994d.js";import"./p-c2d148da.js";import"./p-d60a77a4.js";import"./p-99b55177.js";import"./p-4ff653eb.js";const C=class{constructor(a){t(this,a),this.bufferComplete=i(this,"bufferComplete",7),this.distanceChanged=i(this,"distanceChanged",7),this.unitChanged=i(this,"unitChanged",7),this.appearance="text",this.distance=0,this.geometries=[],this.max=void 0,this.min=0,this.sliderTicks=10,this.unionResults=!0,this.unit="meters",this.disabled=!1,this._translations=void 0}geometriesWatchHandler(){this._buffer()}disabledWatchHandler(){this._buffer()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return a(e,null,"text"===this.appearance?this._getTextBoxDisplay():this._getSliderDisplay())}async _initModules(){const[t]=await n(["esri/geometry/geometryEngine"]);this._geometryEngine=t}_getUnits(){const t={feet:this._translations.feet,meters:this._translations.meters,miles:this._translations.miles,kilometers:this._translations.kilometers};return Object.keys(t).map((i=>a("calcite-option",{label:t[i],selected:this.unit===i,value:i})))}_setDistance(t){const i=parseInt(t.target.value,10);this.distance!==i&&i>=this.min&&(this.distanceChanged.emit({oldValue:this.distance,newValue:i}),this.distance=i,this.distance>0?this._buffer():this.bufferComplete.emit(void 0))}_setUnit(t){this.unitChanged.emit({oldValue:this.unit,newValue:t}),this.unit=t,this._buffer()}_buffer(){this.disabled?this.bufferComplete.emit(void 0):(this._bufferTimeout&&clearTimeout(this._bufferTimeout),this._bufferTimeout=setTimeout((()=>{var t;if((null===(t=this.geometries)||void 0===t?void 0:t.length)>0&&this.unit&&this.distance>0){const t=this._geometryEngine.geodesicBuffer(this.geometries,this.distance,this.unit,this.unionResults);this.bufferComplete.emit(t)}}),400))}_getTextBoxDisplay(){return a("div",{class:"c-container"},a("calcite-input",{class:"padding-end-1 w-50",max:this.max&&this.max>0?this.max:void 0,min:this.min,"number-button-type":"vertical",onCalciteInputInput:t=>this._setDistance(t),placeholder:"0",type:"number",value:this.distance?this.distance.toString():void 0}),a("calcite-select",{class:"flex-1 w-50",label:"label",onCalciteSelectChange:()=>this._setUnit(this._unitElement.value),ref:t=>{this._unitElement=t}},this._getUnits()))}_getSliderDisplay(){return a("div",null,a("calcite-slider",{labelHandles:!0,max:this.max&&this.max>0?this.max:void 0,min:this.min,ticks:this.sliderTicks}))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}_testAccess(t,i){switch(t){case"_setUnit":return this._setUnit(i);case"_setDistance":return this._setDistance(i)}return null}get el(){return s(this)}static get watchers(){return{geometries:["geometriesWatchHandler"],disabled:["disabledWatchHandler"]}}};
7
7
  /*!
8
8
  * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
9
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
@@ -0,0 +1,11 @@
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 i,c as t,h as e,H as s,g as a}from"./p-f8be5d5f.js";import{a as n,v as l,b as o}from"./p-1aca2237.js";import{s as r,c as h,d as c,H as d}from"./p-c844e615.js";import{c as p,d as u,u as m}from"./p-41f5a5fc.js";import{c as b,d as g,g as v}from"./p-8bf81a2e.js";import{s as f,a as y,c as w}from"./p-5173b841.js";import{c as x,d as k}from"./p-0ff7b311.js";import{c as _}from"./p-99b55177.js";import{C as S}from"./p-c2d148da.js";import{u as D,c as I,d as L,s as z}from"./p-db08ef87.js";import{l as P}from"./p-d7ddd3a2.js";import{g as C,h as A,a as j,b as M,c as G,d as N,e as O,f as H}from"./p-4af3f843.js";import{c as E,e as W,f as F}from"./p-9ab03591.js";import{s as V}from"./p-477ae127.js";import{a as R,g as T}from"./p-fc2277fe.js";import{d as Y,a as q}from"./p-9807924d.js";import"./p-a738e38f.js";import"./p-d60a77a4.js";import"./p-40bdd836.js";import"./p-4ff653eb.js";import"./p-e1a4994d.js";
7
+ /*!
8
+ * All material copyright ESRI, All Rights Reserved, unless otherwise specified.
9
+ * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
10
+ * v1.4.3
11
+ */const B=class{constructor(e){i(this,e),this.calciteInternalInputTextFocus=t(this,"calciteInternalInputTextFocus",7),this.calciteInternalInputTextBlur=t(this,"calciteInternalInputTextBlur",7),this.calciteInputTextInput=t(this,"calciteInputTextInput",7),this.calciteInputTextChange=t(this,"calciteInputTextChange",7),this.previousValueOrigin="initial",this.mutationObserver=_("mutation",(()=>this.setDisabledAction())),this.userChangedValue=!1,this.keyDownHandler=i=>{this.readOnly||this.disabled||(this.isClearable&&"Escape"===i.key&&(this.clearInputTextValue(i),i.preventDefault()),"Enter"!==i.key||i.defaultPrevented||r(this)&&i.preventDefault())},this.clearInputTextValue=i=>{this.setValue({committing:!0,nativeEvent:i,origin:"user",value:""})},this.emitChangeIfUserModified=()=>{"user"===this.previousValueOrigin&&this.value!==this.previousEmittedValue&&(this.calciteInputTextChange.emit(),this.setPreviousEmittedValue(this.value))},this.inputTextBlurHandler=()=>{this.calciteInternalInputTextBlur.emit({element:this.childEl,value:this.value}),this.emitChangeIfUserModified()},this.clickHandler=i=>{if(this.disabled)return;const t=n(this.el,"action");i.target!==t&&this.setFocus()},this.inputTextFocusHandler=()=>{this.calciteInternalInputTextFocus.emit({element:this.childEl,value:this.value})},this.inputTextInputHandler=i=>{this.disabled||this.readOnly||this.setValue({nativeEvent:i,origin:"user",value:i.target.value})},this.inputTextKeyDownHandler=i=>{this.disabled||this.readOnly||"Enter"===i.key&&this.emitChangeIfUserModified()},this.hiddenInputChangeHandler=i=>{i.target.name===this.name&&this.setValue({value:i.target.value,origin:"direct"}),i.stopPropagation()},this.setChildElRef=i=>{this.childEl=i},this.setInputValue=i=>{this.childEl&&(this.childEl.value=i)},this.setPreviousEmittedValue=i=>{this.previousEmittedValue=i},this.setPreviousValue=i=>{this.previousValue=i},this.setValue=({committing:i=!1,nativeEvent:t,origin:e,previousValue:s,value:a})=>{this.setPreviousValue(null!=s?s:this.value),this.previousValueOrigin=e,this.userChangedValue="user"===e&&a!==this.value,this.value=a,"direct"===e&&(this.setInputValue(a),this.setPreviousEmittedValue(a)),t&&(this.calciteInputTextInput.emit().defaultPrevented?this.value=this.previousValue:i&&this.emitChangeIfUserModified())},this.alignment="start",this.autofocus=!1,this.clearable=!1,this.disabled=!1,this.form=void 0,this.hidden=!1,this.icon=void 0,this.iconFlipRtl=!1,this.label=void 0,this.loading=!1,this.maxLength=void 0,this.minLength=void 0,this.name=void 0,this.placeholder=void 0,this.prefixText=void 0,this.readOnly=!1,this.required=!1,this.scale="m",this.status="idle",this.autocomplete=void 0,this.inputMode="text",this.enterKeyHint=void 0,this.pattern=void 0,this.suffixText=void 0,this.editingEnabled=!1,this.value="",this.messages=void 0,this.messageOverrides=void 0,this.effectiveLocale=void 0,this.defaultMessages=void 0,this.slottedActionElDisabledInternally=!1}disabledWatcher(){this.setDisabledAction()}onMessagesChange(){}valueWatcher(i,t){this.userChangedValue||this.setValue({origin:"direct",previousValue:t,value:i||""}),this.userChangedValue=!1}updateRequestedIcon(){this.requestedIcon=l({},this.icon,"text")}get isClearable(){return this.clearable&&this.value.length>0}effectiveLocaleChange(){D(this,this.effectiveLocale)}connectedCallback(){var i;p(this),x(this),I(this),this.inlineEditableEl=this.el.closest("calcite-inline-editable"),this.inlineEditableEl&&(this.editingEnabled=this.inlineEditableEl.editingEnabled||!1),this.setPreviousEmittedValue(this.value),this.setPreviousValue(this.value),b(this),h(this),null===(i=this.mutationObserver)||void 0===i||i.observe(this.el,{childList:!0}),this.setDisabledAction(),this.el.addEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}disconnectedCallback(){var i;u(this),g(this),c(this),k(this),L(this),null===(i=this.mutationObserver)||void 0===i||i.disconnect(),this.el.removeEventListener("calciteInternalHiddenInputChange",this.hiddenInputChangeHandler)}async componentWillLoad(){f(this),this.requestedIcon=l({},this.icon,"text"),await z(this)}componentDidLoad(){y(this)}componentDidRender(){m(this)}async setFocus(){var i;await w(this),null===(i=this.childEl)||void 0===i||i.focus()}async selectText(){var i;null===(i=this.childEl)||void 0===i||i.select()}onLabelClick(){this.setFocus()}onFormReset(){this.setValue({origin:"reset",value:this.defaultValue})}syncHiddenFormInput(i){null!=this.minLength&&(i.minLength=this.minLength),null!=this.maxLength&&(i.maxLength=this.maxLength)}setDisabledAction(){const i=n(this.el,"action");i&&(this.disabled?(null==i.getAttribute("disabled")&&(this.slottedActionElDisabledInternally=!0),i.setAttribute("disabled","")):this.slottedActionElDisabledInternally&&(i.removeAttribute("disabled"),this.slottedActionElDisabledInternally=!1))}render(){const i=o(this.el),t=e("div",{class:"loader"},e("calcite-progress",{label:this.messages.loading,type:"indeterminate"})),a=e("button",{"aria-label":this.messages.clear,class:"clear-button",disabled:this.disabled||this.readOnly,onClick:this.clearInputTextValue,tabIndex:-1,type:"button"},e("calcite-icon",{icon:"x",scale:"l"===this.scale?"m":"s"})),n=e("calcite-icon",{class:"icon",flipRtl:this.iconFlipRtl,icon:this.requestedIcon,scale:"l"===this.scale?"m":"s"}),l=e("div",{class:"prefix"},this.prefixText),r=e("div",{class:"suffix"},this.suffixText),h=e("input",{"aria-label":v(this),autocomplete:this.autocomplete,autofocus:!!this.autofocus||null,class:{"editing-enabled":this.editingEnabled,"inline-child":!!this.inlineEditableEl},defaultValue:this.defaultValue,disabled:!!this.disabled||null,enterKeyHint:this.enterKeyHint,inputMode:this.inputMode,maxLength:this.maxLength,minLength:this.minLength,name:this.name,onBlur:this.inputTextBlurHandler,onFocus:this.inputTextFocusHandler,onInput:this.inputTextInputHandler,onKeyDown:this.inputTextKeyDownHandler,pattern:this.pattern,placeholder:this.placeholder||"",readOnly:this.readOnly,required:!!this.required||null,tabIndex:this.disabled||this.inlineEditableEl&&!this.editingEnabled?-1:null,type:"text",value:this.value,ref:this.setChildElRef});return e(s,{onClick:this.clickHandler,onKeyDown:this.keyDownHandler},e("div",{class:{wrapper:!0,[S.rtl]:"rtl"===i}},this.prefixText?l:null,e("div",{class:"element-wrapper"},h,this.isClearable?a:null,this.requestedIcon?n:null,this.loading?t:null),e("div",{class:"action-wrapper"},e("slot",{name:"action"})),this.suffixText?r:null,e(d,{component:this})))}static get assetsDirs(){return["assets"]}get el(){return a(this)}static get watchers(){return{disabled:["disabledWatcher"],messageOverrides:["onMessagesChange"],value:["valueWatcher"],icon:["updateRequestedIcon"],effectiveLocale:["effectiveLocaleChange"]}}};B.style="@keyframes in{0%{opacity:0}100%{opacity:1}}@keyframes in-down{0%{opacity:0;transform:translate3D(0, -5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-up{0%{opacity:0;transform:translate3D(0, 5px, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-right{0%{opacity:0;transform:translate3D(-5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-left{0%{opacity:0;transform:translate3D(5px, 0, 0)}100%{opacity:1;transform:translate3D(0, 0, 0)}}@keyframes in-scale{0%{opacity:0;transform:scale3D(0.95, 0.95, 1)}100%{opacity:1;transform:scale3D(1, 1, 1)}}:root{--calcite-animation-timing:calc(150ms * var(--calcite-internal-duration-factor));--calcite-internal-duration-factor:var(--calcite-duration-factor, 1);--calcite-internal-animation-timing-fast:calc(100ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-medium:calc(200ms * var(--calcite-internal-duration-factor));--calcite-internal-animation-timing-slow:calc(300ms * var(--calcite-internal-duration-factor))}.calcite-animate{opacity:0;animation-fill-mode:both;animation-duration:var(--calcite-animation-timing)}.calcite-animate__in{animation-name:in}.calcite-animate__in-down{animation-name:in-down}.calcite-animate__in-up{animation-name:in-up}.calcite-animate__in-right{animation-name:in-right}.calcite-animate__in-left{animation-name:in-left}.calcite-animate__in-scale{animation-name:in-scale}@media (prefers-reduced-motion: reduce){:root{--calcite-internal-duration-factor:0.01}}:root{--calcite-floating-ui-transition:var(--calcite-animation-timing);--calcite-floating-ui-z-index:var(--calcite-app-z-index-dropdown)}:host([hidden]){display:none}:host([disabled]){cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host([disabled]) *,:host([disabled]) ::slotted(*){pointer-events:none}:host{display:block}:host([scale=s]) input,:host([scale=s]) .prefix,:host([scale=s]) .suffix{block-size:1.5rem;padding-inline:0.5rem;font-size:var(--calcite-font-size--2);line-height:1rem}:host([scale=s]) .action-wrapper calcite-button,:host([scale=s]) .action-wrapper calcite-button button{block-size:1.5rem}:host([scale=s]) .clear-button{min-block-size:1.5rem;min-inline-size:1.5rem}:host([scale=m]) input,:host([scale=m]) .prefix,:host([scale=m]) .suffix{block-size:2rem;padding-inline:0.75rem;font-size:var(--calcite-font-size--1);line-height:1rem}:host([scale=m]) .action-wrapper calcite-button,:host([scale=m]) .action-wrapper calcite-button button{block-size:2rem}:host([scale=m]) .clear-button{min-block-size:2rem;min-inline-size:2rem}:host([scale=l]) input,:host([scale=l]) .prefix,:host([scale=l]) .suffix{block-size:2.75rem;padding-inline:1rem;font-size:var(--calcite-font-size-0);line-height:1.25rem}:host([scale=l]) .action-wrapper calcite-button,:host([scale=l]) .action-wrapper calcite-button button{block-size:2.75rem}:host([scale=l]) .clear-button{min-block-size:2.75rem;min-inline-size:2.75rem}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}input{transition:var(--calcite-animation-timing), block-size 0, outline-offset 0s;-webkit-appearance:none;position:relative;margin:0px;box-sizing:border-box;display:flex;max-block-size:100%;inline-size:100%;max-inline-size:100%;flex:1 1 0%;border-radius:0px;background-color:var(--calcite-ui-foreground-1);font-family:inherit;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-1)}:host input{border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);color:var(--calcite-ui-text-1)}:host input::placeholder,:host input:-ms-input-placeholder,:host input::-ms-input-placeholder{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}:host input:focus{border-color:var(--calcite-ui-brand);color:var(--calcite-ui-text-1)}:host input[readonly]{background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium)}:host input[readonly]:focus{color:var(--calcite-ui-text-1)}:host calcite-icon{color:var(--calcite-ui-text-3)}input{outline-color:transparent}input:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}:host([status=invalid]) input{border-color:var(--calcite-ui-danger)}:host([status=invalid]) input:focus{outline:2px solid var(--calcite-ui-danger);outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}:host([scale=s]) .icon{inset-inline-start:0.5rem}:host([scale=m]) .icon{inset-inline-start:0.75rem}:host([scale=l]) .icon{inset-inline-start:1rem}:host([icon][scale=s]) input{-webkit-padding-start:2rem;padding-inline-start:2rem}:host([icon][scale=m]) input{-webkit-padding-start:2.5rem;padding-inline-start:2.5rem}:host([icon][scale=l]) input{-webkit-padding-start:3.5rem;padding-inline-start:3.5rem}.element-wrapper{position:relative;order:3;display:inline-flex;flex:1 1 0%;align-items:center}.icon{pointer-events:none;position:absolute;z-index:var(--calcite-app-z-index);display:block;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}input[type=text]::-ms-clear,input[type=text]::-ms-reveal{display:none;block-size:0px;inline-size:0px}.clear-button{pointer-events:initial;order:4;margin:0px;box-sizing:border-box;display:flex;min-block-size:100%;cursor:pointer;align-items:center;justify-content:center;align-self:stretch;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-foreground-1);outline-color:transparent;border-inline-start-width:0px}.clear-button:hover{background-color:var(--calcite-ui-foreground-2);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:hover calcite-icon{color:var(--calcite-ui-text-1);transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.clear-button:active{background-color:var(--calcite-ui-foreground-3)}.clear-button:active calcite-icon{color:var(--calcite-ui-text-1)}.clear-button:focus{outline:2px solid var(--calcite-ui-focus-color, var(--calcite-ui-brand));outline-offset:calc(\n -2px *\n calc(\n 1 -\n 2 * clamp(\n 0,\n var(--calcite-ui-focus-offset-invert),\n 1\n )\n )\n )}.clear-button:disabled{opacity:var(--calcite-ui-opacity-disabled)}.loader{inset-block-start:1px;inset-inline:1px;pointer-events:none;position:absolute;display:block}.action-wrapper{order:7;display:flex}.prefix,.suffix{box-sizing:border-box;display:flex;block-size:auto;min-block-size:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;align-content:center;align-items:center;overflow-wrap:break-word;border-width:1px;border-style:solid;border-color:var(--calcite-ui-border-input);background-color:var(--calcite-ui-background);font-weight:var(--calcite-font-weight-medium);line-height:1;color:var(--calcite-ui-text-2)}.prefix{order:2;border-inline-end-width:0px}.suffix{order:5;border-inline-start-width:0px}:host([alignment=start]) input{text-align:start}:host([alignment=end]) input{text-align:end}.wrapper{position:relative;display:flex;flex-direction:row;align-items:center}:host(.no-bottom-border) input{border-block-end-width:0px}:host(.border-top-color-one) input{border-block-start-color:var(--calcite-ui-border-1)}.inline-child{background-color:transparent;transition:all var(--calcite-animation-timing) ease-in-out 0s, outline 0s, outline-offset 0s}.inline-child .editing-enabled{background-color:inherit}.inline-child:not(.editing-enabled){display:flex;cursor:pointer;border-color:transparent;-webkit-padding-start:0;padding-inline-start:0}::slotted(input[slot=hidden-form-input]){margin:0 !important;opacity:0 !important;outline:none !important;padding:0 !important;position:absolute !important;inset:0 !important;transform:none !important;-webkit-appearance:none !important;z-index:-1 !important}";const $=class{constructor(e){i(this,e),this.selectionSetChange=t(this,"selectionSetChange",7),this._selectedIds=[],this._selectionLabel="",this._graphics=[],this._featuresCollection={},this.bufferColor=[227,139,79,.8],this.bufferOutlineColor=[255,255,255],this.customLabelEnabled=void 0,this.enabledLayerIds=[],this.defaultBufferDistance=void 0,this.defaultBufferUnit=void 0,this.geometries=[],this.isUpdate=!1,this.layerViews=[],this.mapView=void 0,this.noResultText=void 0,this.searchConfiguration=void 0,this.selectionSet=void 0,this.selectionLayerIds=[],this.selectLayerView=void 0,this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._numSelected=0,this._searchDistanceEnabled=!1,this._searchTerm=void 0,this._selectionLoading=!1,this._translations=void 0,this._useLayerFeaturesEnabled=!1}async watchGeometriesHandler(i,t){if(i!==t){const t=0===i.length;if(await this._clearResults(t,t),i.length>0)return this._highlightWithOIDsOrGeoms()}}async watchSearchConfigurationHandler(i,t){JSON.stringify(i)!==JSON.stringify(t)&&this._initSearchWidget()}async clearSelection(){return this._clearResults(!0,!0)}async getSelection(){return/\S+/gm.test(this._selectionLabel)||this._updateLabel(),{id:this.isUpdate?this.selectionSet.id:Date.now(),searchResult:this._searchResult,buffer:this._bufferGeometry,distance:this._bufferTools.distance,download:!0,unit:this._bufferTools.unit,label:this._selectionLabel,selectedIds:this._selectedIds,layerView:this.selectLayerView,geometries:this.geometries,graphics:this._graphics,selectLayers:this.layerViews,skipGeomOIDs:this._skipGeomOIDs,searchDistanceEnabled:this._searchDistanceEnabled,workflowType:this._workflowType,useLayerFeaturesEnabled:this._useLayerFeaturesEnabled,sketchGraphic:this._sketchGraphic}}searchConfigurationChangeChanged(i){this.searchConfiguration=i.detail}distanceChanged(i){this._distanceChanged(i.detail)}unitChanged(i){i.detail.newValue!==i.detail.oldValue&&(this._unit=i.detail.newValue,this._updateLabel())}async componentWillLoad(){await this._getTranslations(),await this._initModules()}async componentDidLoad(){return this._init()}render(){return e(s,null,this._getMapLayerPicker(),e("div",{class:"border-bottom"}),e("div",{class:"padding-top-sides-1"},e("div",{class:"search-widget",ref:i=>{this._searchElement=i}}),e("div",{class:"padding-top-1"},e("map-draw-tools",{active:!0,editGraphicsEnabled:!this._useLayerFeaturesEnabled,graphics:this._graphics,mapView:this.mapView,onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,ref:i=>{this._drawTools=i}})),this._getBufferOptions(),this._getUseLayerFeaturesOptions(),this._getNumSelected()),e("div",{class:"border-bottom"}),this._getNameInput())}_getBufferOptions(){var i,t;const s=this._searchDistanceEnabled?"search-distance":"div-not-visible",a="number"==typeof(null===(i=this.selectionSet)||void 0===i?void 0:i.distance)?this.selectionSet.distance:this.defaultBufferDistance;return e("div",null,e("div",{class:"padding-top-1 display-flex"},e("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},e("div",{class:"tooltip-container"},this._translations.searchDistance,e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"search-distance-icon",scale:"s"}))),e("calcite-popover",{closable:!0,label:"",referenceElement:"search-distance-icon"},e("span",{class:"tooltip-message"},this._translations.useSearchDistanceTootip)),e("calcite-switch",{checked:this._searchDistanceEnabled,onCalciteSwitchChange:()=>this._searchDistanceEnabled=!this._searchDistanceEnabled})),e("div",{class:s},e("buffer-tools",{disabled:!this._searchDistanceEnabled,distance:a,geometries:this.geometries,onBufferComplete:i=>this._bufferComplete(i),ref:i=>this._bufferTools=i,unit:(null===(t=this.selectionSet)||void 0===t?void 0:t.unit)||this.defaultBufferUnit})))}_getUseLayerFeaturesOptions(){const i=this._useLayerFeaturesEnabled?"div-visible":"div-not-visible";return e("div",null,e("div",{class:"padding-top-1 display-flex"},e("calcite-label",{class:"label-margin-0 w-100",layout:"inline-space-between"},e("div",{class:"tooltip-container"},this._translations.useLayerFeatures,e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"use-layer-features-icon",scale:"s"}))),e("calcite-popover",{closable:!0,label:"",referenceElement:"use-layer-features-icon"},e("span",{class:"tooltip-message"},this._translations.useLayerFeaturesTooltip)),e("calcite-switch",{checked:this._useLayerFeaturesEnabled,onCalciteSwitchChange:()=>{this._useLayerFeaturesEnabledChanged()}})),e("div",{class:i+" padding-top-1"},e("map-layer-picker",{enabledLayerIds:this.selectionLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedIds:this.layerViews.map((i=>i.layer.id))})))}_getNumSelected(){const i=R(this.el),t=i&&"en"===i?`${this._translations.selectionLoading}...`:this._translations.selectionLoading;return e("div",{class:"padding-top-1 padding-bottom-1",style:{"align-items":"end",display:"flex"}},this._selectionLoading?e("div",null,e("calcite-loader",{class:"info-blue",inline:!0,label:t,scale:"m",type:"indeterminate"})):e("calcite-icon",{class:"info-blue padding-end-1-2",icon:"feature-layer",scale:"s"}),e("calcite-input-message",{class:"info-blue",scale:"m"},this._selectionLoading?t:this.noResultText&&0===this._numSelected?this.noResultText:this._translations.selectedFeatures.replace("{{n}}",this._numSelected.toString())))}_getNameInput(){return e("div",{class:"padding-sides-1 padding-top-1 "+(this.customLabelEnabled?"":"display-none")},e("calcite-label",{class:"font-bold"},this._translations.listName,e("calcite-input",{onInput:()=>{this._selectionLabel=this._labelName.value},placeholder:this._translations.listNamePlaceholder,ref:i=>{this._labelName=i},value:this._selectionLabel||""})))}_getMapLayerPicker(){return e("div",{class:"display-flex padding-sides-1 padding-bottom-1"},e("calcite-label",{class:"font-bold width-full label-margin-0"},this._translations.inputLayer,e("map-layer-picker",{enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>this._inputLayerSelectionChange(i),selectedIds:this.selectLayerView?[this.selectLayerView.layer.id]:this.selectionSet?[this.selectionSet.layerView.layer.id]:[]})))}async _initModules(){const[i,t,e,s,a]=await P(["esri/layers/GraphicsLayer","esri/Graphic","esri/widgets/Search","esri/geometry/geometryEngine","esri/layers/FeatureLayer"]);this.GraphicsLayer=i,this.Graphic=t,this.Search=e,this._geometryEngine=s,this.FeatureLayer=a}async _init(){this._initGraphicsLayer(),await this._initSelectionSet(),this._initSearchWidget()}async _initSelectionSet(){var i,t,e,s;this.selectionSet&&(this._searchTerm=null===(i=this.selectionSet.searchResult)||void 0===i?void 0:i.name,this._searchResult=this.selectionSet.searchResult,this._selectLayers=this.selectionSet.selectLayers,this._selectedIds=this.selectionSet.selectedIds,this._skipGeomOIDs=this.selectionSet.skipGeomOIDs,this._searchDistanceEnabled=this.selectionSet.searchDistanceEnabled,this._useLayerFeaturesEnabled=this.selectionSet.useLayerFeaturesEnabled,this._distance=this.selectionSet.searchDistanceEnabled?this.selectionSet.distance:0,this._unit=this.selectionSet.unit,this._workflowType=this.selectionSet.workflowType,this.selectLayerView=this.selectionSet.layerView,this._sketchGraphic=this.selectionSet.sketchGraphic,this.geometries=[...(null===(t=this.selectionSet)||void 0===t?void 0:t.geometries)||[]],this._graphics=this.geometries.map((i=>new this.Graphic({geometry:i,symbol:"point"===i.type?this.sketchPointSymbol:"polyline"===i.type?this.sketchLineSymbol:this.sketchPolygonSymbol}))),this._selectionLabel=null===(e=this.selectionSet)||void 0===e?void 0:e.label,this._useLayerFeaturesEnabled||null===(s=this._drawTools)||void 0===s||s.updateGraphics(),await C(this.selectionSet.selectedIds,this.selectionSet.layerView,this.mapView,!1))}_initSearchWidget(){if(this.mapView&&this._searchElement){const i=this._getSearchConfig(this.searchConfiguration,this.mapView),t=Object.assign({view:this.mapView,container:this._searchElement,searchTerm:this._searchTerm},i);this._searchWidget=new this.Search(t),this._searchWidget.popupEnabled=!1,this._searchWidget.resultGraphicEnabled=!1,this._searchWidget.on("search-clear",(()=>{const i=this._searchClearLabel();this._clearResults(!1,i)})),this._searchWidget.on("select-result",(i=>{var t,e;if(i.result){this._searchResult=i.result;const s=(null===(e=null===(t=i.source)||void 0===t?void 0:t.layer)||void 0===e?void 0:e.id)&&i.source.layer.id===this.selectLayerView.layer.id,a=s?[i.result.feature.getObjectId()]:void 0;this._workflowType=E.SEARCH,this._updateLabel();const n=[i.result.feature];this._updateSelection(n,s,a),this._drawTools.graphics=n,this._searchWidget.resultGraphic.visible=!1}else{const i=this._searchClearLabel();this._clearResults(!1,i)}}))}}_searchClearLabel(){var i;return(null===(i=this._searchResult)||void 0===i?void 0:i.name)&&this._labelName.value.indexOf(this._searchResult.name)>-1}_getSearchConfig(i,t){const e=null==i?void 0:i.sources;return(null==e?void 0:e.length)>0?(i.includeDefaultSources=!1,e.forEach((i=>{var e,s;if(i.hasOwnProperty("layer")){const a=i,n=null===(e=a.layer)||void 0===e?void 0:e.id,l=n?t.map.findLayerById(n):null,o=null===(s=null==a?void 0:a.layer)||void 0===s?void 0:s.url;l?a.layer=l:o&&(a.layer=new this.FeatureLayer(o))}})),null==e||e.forEach((i=>{if(i.hasOwnProperty("locator")){const t=i;"ArcGIS World Geocoding Service"===(null==t?void 0:t.name)&&(t.outFields=t.outFields||["Addr_type","Match_addr","StAddr","City"],t.singleLineFieldName="SingleLine"),t.url=t.url,delete t.url}}))):i=Object.assign(Object.assign({},i),{includeDefaultSources:!0}),i}_initGraphicsLayer(){const i=this._translations.bufferLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));if(t>-1)this._bufferGraphicsLayer=this.mapView.map.layers.getItemAt(t);else{this._bufferGraphicsLayer=new this.GraphicsLayer({title:i,listMode:"hide"}),V.managedLayers.push(i);const t=this.mapView.map.layers.findIndex((i=>i.title===this._translations.sketchLayer));t>-1?this.mapView.map.layers.add(this._bufferGraphicsLayer,t):this.mapView.map.layers.add(this._bufferGraphicsLayer)}}async _sketchGraphicsChanged(i,t=!1){const e=i.detail.graphics;if(e.length>0&&e[0])if(t||(this._sketchGraphic=e[0]),this._workflowType=this._useLayerFeaturesEnabled?E.SELECT:E.SKETCH,this._workflowType===E.SKETCH&&this._drawTools.updateGraphics(),this._updateLabel(),this._clearSearchWidget(),this._useLayerFeaturesEnabled&&!t){const i=Array.isArray(e)?e.map((i=>i.geometry)):this.geometries;await this._selectLayerFeatures(i[0])}else{const t=e.reduce(((i,t)=>{var e;return(null===(e=null==t?void 0:t.layer)||void 0===e?void 0:e.objectIdField)?i.push(t.attributes[t.layer.objectIdField]):t.getObjectId&&i.push(t.getObjectId()),i}),[]),s=i.detail.useOIDs&&t.length>0;this._updateSelection(e,s,t),s&&await this._highlightFeatures(t)}else await this._clearResults(!0,!0)}async _highlightWithOIDsOrGeoms(){var i;return(null===(i=this._skipGeomOIDs)||void 0===i?void 0:i.length)>0?(this._selectedIds=this._skipGeomOIDs,this._highlightFeatures(this._selectedIds)):this._geomQuery(this.geometries)}async _highlightFeatures(i){V.removeHandles(),i.length>0&&V.highlightHandles.push(await A(i,this.selectLayerView,this.mapView)),this._numSelected=i.length,this.selectionSetChange.emit(i.length)}async _selectFeatures(i){this._selectionLoading=!0,this._selectedIds=await j(i,this.selectLayerView.layer),this._selectionLoading=!1,this._drawTools.graphics=this._graphics,await this._highlightFeatures(this._selectedIds)}async _bufferComplete(i){this._bufferGeometry=Array.isArray(i.detail)?i.detail[0]:i.detail;let t=this._bufferTools.distance,e=0;if(this._bufferGeometry){const i=new this.Graphic({geometry:this._bufferGeometry,symbol:{type:"simple-fill",color:this.bufferColor,outline:{color:this.bufferOutlineColor,width:1}}});this._bufferGraphicsLayer.removeAll(),this._bufferGraphicsLayer.add(i),await this._selectFeatures([this._bufferGeometry]),await this.mapView.goTo(i.geometry.extent),e=t,t=0}else this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),await this._highlightWithOIDsOrGeoms();this._distanceChanged({oldValue:t,newValue:e})}_geomQuery(i){const t=M(i,this._geometryEngine);return this._selectFeatures(t)}async _clearResults(i=!0,t=!1){var e;this._selectedIds=[],this._distance=void 0,this._unit=void 0,t&&(this._selectionLabel="",this._labelName.value=""),this._bufferGraphicsLayer&&this._bufferGraphicsLayer.removeAll(),i&&this._searchWidget&&this._clearSearchWidget(),V.removeHandles(),(null===(e=this._drawTools)||void 0===e?void 0:e.clear)&&(this._graphics=[],await this._drawTools.clear()),this.selectionSetChange.emit(this._selectedIds.length)}_clearSearchWidget(){this._searchWidget.clear(),this._searchResult=void 0}_updateSelection(i,t,e){this._selectedIds=t&&e?e:this._selectedIds,this._skipGeomOIDs=t?e:void 0,this.geometries=Array.isArray(i)?i.map((i=>i.geometry)):this.geometries,this._graphics=i}_updateLabel(){var i,t;const e=this._selectionLabel.indexOf(this._translations.sketch)>-1,s=this._selectionLabel.indexOf(this._translations.select)>-1,a=this._selectionLabel.indexOf(null===(i=this._searchResult)||void 0===i?void 0:i.name)>-1,n=this._workflowType===E.SEARCH?null===(t=this._searchResult)||void 0===t?void 0:t.name:this._workflowType===E.SELECT?this._translations.select:this._translations.sketch,l=this._unit?this._unit:this._bufferTools.unit,o=isNaN(this._distance)?this._bufferTools.distance:this._distance;this._selectionLabel=e||s||a||!this._selectionLabel?`${n} ${o} ${l}`:this._selectionLabel,this._labelName.value=this._selectionLabel}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){const t=i.detail.map((i=>G(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i,this._featuresCollection={},this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}))}}async _inputLayerSelectionChange(i){var t;const e=(null===(t=null==i?void 0:i.detail)||void 0===t?void 0:t.length)>0?i.detail[0]:"";this.selectLayerView&&e===this.selectLayerView.layer.id||(this.selectLayerView=await G(this.mapView,e),this._updateLabel(),this._bufferGeometry?await this._selectFeatures([this._bufferGeometry]):await this._highlightWithOIDsOrGeoms())}_distanceChanged(i){i.newValue!==i.oldValue&&(this._distance=i.newValue,this._updateLabel())}async _selectLayerFeatures(i){this._selectionLoading=!0;const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],N(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this._selectionLoading=!1;let t=[];i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))}));let e=!1;t.forEach((i=>{var t;const s=i.geometry;i.symbol="point"===s.type?this.sketchPointSymbol:"polyline"===s.type?this.sketchLineSymbol:"polygon"===s.type?this.sketchPolygonSymbol:void 0,e=(null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.hasOwnProperty("objectIdField"))||i.hasOwnProperty("getObjectId")}));const s=this.layerViews[0].layer.title===this.selectLayerView.layer.title&&e;await this._sketchGraphicsChanged({detail:{graphics:t,useOIDs:s}},!0)}))}_useLayerFeaturesEnabledChanged(){this._useLayerFeaturesEnabled=!this._useLayerFeaturesEnabled,this._sketchGraphic&&this._sketchGraphicsChanged({detail:{graphics:[this._sketchGraphic],useOIDs:!1}})}async _getTranslations(){const i=await T(this.el);this._translations=i[0]}get el(){return a(this)}static get watchers(){return{geometries:["watchGeometriesHandler"],searchConfiguration:["watchSearchConfigurationHandler"]}}};$.style=':host{display:block}.div-visible{display:inherit}.div-visible-search{display:flex;height:44px;align-items:center;padding-bottom:0}.div-not-visible{display:none}.padding-bottom-1{padding-bottom:1rem}.padding-top-1{padding-top:1rem}.search-widget{width:100% !important;border:1px solid var(--calcite-ui-border-input)}.w-100{width:100%}.w-50{width:50%}.search-distance-container{padding-top:"1rem" !important}.end-border{-webkit-border-end:1px solid var(--calcite-ui-border-2);border-inline-end:1px solid var(--calcite-ui-border-2)}.search-distance{display:flex;padding-top:1rem}.font-bold{font:bold}.border-bottom{border-bottom:1px solid var(--calcite-ui-border-2)}.tooltip-container{display:flex}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.icon{--calcite-ui-icon-color:var(--calcite-ui-brand)}.tooltip-message{padding:5px 8px;font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-2)}';const K=Object.freeze({__proto__:null,default:[{descriptionPDF:{labelWidthDisplay:"2-5/8",labelHeightDisplay:"1",labelsPerPageDisplay:"30",averyPartNumber:"*60"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.1875,rightMargin:.1875,topMargin:.5,bottomMargin:.5},numLabelsAcross:3,numLabelsDown:10,labelWidth:2.625,labelHeight:1,horizGapIn:.125,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1",labelsPerPageDisplay:"20",averyPartNumber:"*61"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.47637821,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:10,labelWidth:4,labelHeight:1.0025,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:4}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"1-1/3",labelsPerPageDisplay:"14",averyPartNumber:"*62"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.81889808,bottomMargin:.83464612},numLabelsAcross:2,numLabelsDown:7,labelWidth:4,labelHeight:1.3352,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:11,maxNumLabelLines:6}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"2",labelsPerPageDisplay:"10",averyPartNumber:"*63"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.5,bottomMargin:.5},numLabelsAcross:2,numLabelsDown:5,labelWidth:4,labelHeight:2,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:12,maxNumLabelLines:10}},{descriptionPDF:{labelWidthDisplay:"4",labelHeightDisplay:"3-1/3",labelsPerPageDisplay:"6",averyPartNumber:"*64"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.15625,rightMargin:.15625,topMargin:.4724412,bottomMargin:.50000027},numLabelsAcross:2,numLabelsDown:3,labelWidth:4,labelHeight:3.342,horizGapIn:.1875,vertGapIn:0,labelPadding:.1,fontSizePx:14,maxNumLabelLines:12}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"1/2",labelsPerPageDisplay:"80",averyPartNumber:"*67"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.307086375,rightMargin:.307086375,topMargin:.4724412,bottomMargin:.49606326},numLabelsAcross:4,numLabelsDown:20,labelWidth:1.75,labelHeight:.50155,horizGapIn:.29527575,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:3}},{descriptionPDF:{labelWidthDisplay:"1-3/4",labelHeightDisplay:"2/3",labelsPerPageDisplay:"60",averyPartNumber:"*95"},labelSpec:{type:"AVERY",pageProperties:{pageType:"ANSI A",leftMargin:.28936983,rightMargin:.28936983,topMargin:.53937037,bottomMargin:.5511814},numLabelsAcross:4,numLabelsDown:15,labelWidth:1.75,labelHeight:.6605,horizGapIn:.30708678,vertGapIn:0,labelPadding:.1,fontSizePx:8,maxNumLabelLines:4}}]}),J=class{constructor(t){i(this,t),this.defaultNumLabelsPerPage=void 0,this.disabled=!1,this._translations=void 0}async downloadCSV(i,t,e=!0){return Y(i,!0,t,e)}async downloadPDF(i,t=!1,e="",s=""){var a;return q(i,null===(a=this._labelInfoElement.selectedOption)||void 0===a?void 0:a.value,t,e,s)}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){return e(s,null,e("calcite-select",{disabled:this.disabled,label:"",ref:i=>{this._labelInfoElement=i}}))}componentDidRender(){this._renderOptions()}async _initModules(){const[i]=await P(["esri/intl"]);this._intl=i}_getLabelSizeText(i){const t="&lrm;"+i.descriptionPDF.labelWidthDisplay+" x "+i.descriptionPDF.labelHeightDisplay+"&rlm;";return this._translations.pdfLabel.replace("{{n}}",i.descriptionPDF.labelsPerPageDisplay).replace("{{labelSize}}",t)}async _getTranslations(){const i=await T(this.el);this._translations=i[0]}_renderOptions(){(K.default||K).sort(((i,t)=>{const e=parseInt(i.descriptionPDF.labelsPerPageDisplay,10),s=parseInt(t.descriptionPDF.labelsPerPageDisplay,10);return e<s?-1:e>s?1:0})).forEach(((i,t)=>{const e=document.createElement("calcite-option");e.value=i,e.innerHTML=this._getLabelSizeText(i),this._labelInfoElement.appendChild(e),(this.defaultNumLabelsPerPage?parseInt(i.descriptionPDF.labelsPerPageDisplay,10)===this.defaultNumLabelsPerPage:0===t)&&(e.selected=!0,this._labelInfoElement.selectedOption=e)}))}get el(){return a(this)}};J.style=":host{display:block}";const U=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.selectionSetsChanged=t(this,"selectionSetsChanged",7),this._addEnabled=!0,this._refineSets=[],this._enabledLayerIds=[],this._featuresCollection={},this.addresseeLayer=void 0,this.enabledLayerIds=[],this.mapView=void 0,this.selectionSets=[],this.sketchLineSymbol=void 0,this.sketchPointSymbol=void 0,this.sketchPolygonSymbol=void 0,this._translations=void 0,this._selectionMode=W.ADD,this._refineLayer=void 0}async componentWillLoad(){await this._getTranslations(),this._enabledLayerIds=this._getEnabledLayerIds(),await this._setRefineSet(this._enabledLayerIds[0])}render(){var i,t;return e(s,null,e("div",{class:(this._enabledLayerIds.length>1?"display-block":"display-none")+" padding-top-sides-1"},e("div",{class:"display-flex"},e("calcite-label",{class:"font-bold width-full label-margin-0"},e("div",{class:"display-flex"},this._translations.inputLayer,e("calcite-icon",{class:"padding-start-1-2 icon",icon:"question",id:"refine-input-layer",scale:"s"})),e("map-layer-picker",{enabledLayerIds:this._enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},ref:i=>{this._layerPicker=i},selectedIds:[this._refineLayer.layer.id]})),e("calcite-popover",{closable:!0,label:"",referenceElement:"refine-input-layer"},e("span",{class:"tooltip-message"},this._translations.inputLayerTip)))),e("div",{class:"padding-1"},e("div",{class:"padding-bottom-1"},e("calcite-segmented-control",{class:"w-100"},e("calcite-segmented-control-item",{checked:this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(W.ADD),value:W.ADD},e("span",{class:"font-weight-500"},this._translations.add)),e("calcite-segmented-control-item",{checked:!this._addEnabled,class:"w-50 word-wrap-anywhere",onClick:()=>this._setSelectionMode(W.REMOVE),value:W.REMOVE},e("span",{class:"font-weight-500"},this._translations.remove)))),e("div",null,e("map-draw-tools",{active:!0,drawMode:F.REFINE,mapView:this.mapView,onDrawRedo:()=>this._redo(),onDrawUndo:()=>this._undo(),onSketchGraphicsChange:i=>this._sketchGraphicsChanged(i),pointSymbol:this.sketchPointSymbol,polygonSymbol:this.sketchPolygonSymbol,polylineSymbol:this.sketchLineSymbol,redoEnabled:(null===(i=this._refineSelectionSet)||void 0===i?void 0:i.redoStack.length)>0,ref:i=>{this._drawTools=i},undoEnabled:(null===(t=this._refineSelectionSet)||void 0===t?void 0:t.undoStack.length)>0})),e("br",null),e("calcite-list",{class:"list-border"},this._getRefineSelectionSetList())))}_layerSelectionChange(i){this._setRefineSet(i.detail[0])}_setSelectionMode(i){this._selectionMode=i}_sketchGraphicsChanged(i){var t;const e=null===(t=i.detail)||void 0===t?void 0:t.graphics[0].geometry;this._selectFeatures(e)}_getEnabledLayerIds(){return this.selectionSets.reduce(((i,t)=>{var e;const s=null===(e=null==t?void 0:t.layerView)||void 0===e?void 0:e.layer.id;return s&&i.indexOf(s)<0?i.push(s):t.workflowType===E.REFINE&&Object.keys(t.refineInfos).forEach((t=>{i.indexOf(t)<0&&i.push(t)})),i}),[])}async _setRefineSet(i){this.selectionSets.some((t=>{if(t.workflowType===E.REFINE)return this._refineSelectionSet=t,Object.keys(t.refineInfos).indexOf(i)>-1}))||await this._initRefineSet(i,this._refineSelectionSet),this._refineLayer=this._refineSelectionSet.refineInfos[i].layerView}async _initRefineSet(i,t){const e={};e[i]={addIds:[],removeIds:[],layerView:await G(this.mapView,i)},t?t.refineInfos=Object.assign(Object.assign({},t.refineInfos),e):(this._refineSelectionSet={id:Date.now(),searchResult:void 0,buffer:void 0,distance:0,download:!0,unit:"feet",label:"Refine",selectedIds:[],layerView:void 0,geometries:[],graphics:[],selectLayers:[],workflowType:E.REFINE,searchDistanceEnabled:!1,useLayerFeaturesEnabled:!1,refineInfos:e,redoStack:[],undoStack:[],sketchGraphic:void 0},this.selectionSets.push(this._refineSelectionSet))}_undo(){const i=this._refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===W.ADD?W.REMOVE:W.ADD,this._refineSelectionSet.redoStack,i.layerView)}_redo(){const i=this._refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode===W.ADD?W.REMOVE:W.ADD,this._refineSelectionSet.undoStack,i.layerView)}_getRefineSelectionSetList(){const i=this._getTotal(this.selectionSets);let t;this.selectionSets.some((i=>{if(i.workflowType===E.REFINE)return t=i,!0}));let s=0,a=0;return Object.keys(t.refineInfos).forEach((i=>{s+=t.refineInfos[i].addIds.length,a+=t.refineInfos[i].removeIds.length})),[e("calcite-list-item",{label:this._translations.featuresAdded.replace("{{n}}",s.toString()),"non-interactive":!0}),e("calcite-list-item",{label:this._translations.featuresRemoved.replace("{{n}}",a.toString()),"non-interactive":!0}),e("calcite-list-item",{label:this._translations.totalSelected.replace("{{n}}",i.toString()),"non-interactive":!0})]}_getTotal(i){const t=O(i);return Object.keys(t).reduce(((i,e)=>i+t[e].ids.length),0)}async _getTranslations(){const i=await T(this.el);this._translations=i[0]}async _selectFeatures(i){var t,e;this.selectionLoadingChange.emit(!0),this._featuresCollection[null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id]=[];const s=await N(0,null===(e=this._refineLayer)||void 0===e?void 0:e.layer,i,this._featuresCollection);this.selectionLoadingChange.emit(!1);let a=[];Object.keys(s).forEach((i=>{var t;i===(null===(t=this._refineLayer)||void 0===t?void 0:t.layer.id)&&(a=a.concat(s[i]))}));const n=Array.isArray(a)?a.map((i=>{var t;return i.attributes[null===(t=null==i?void 0:i.layer)||void 0===t?void 0:t.objectIdField]})):[];await this._updateIds(n,this._selectionMode,this._refineSelectionSet.undoStack,this._refineLayer),this._drawTools.clear()}async _highlightFeatures(){this._clearHighlight(),V.highlightHandles=await H(this.selectionSets)}_clearHighlight(){V.removeHandles()}async _updateIds(i,t,e,s){let a=!1;const n=this._refineSelectionSet.refineInfos,l=s.layer.id,o={};o[l]={addIds:[],removeIds:[],layerView:s};const r=Object.keys(n).indexOf(l)>-1?n[l]:o[l];if(t===W.ADD)r.addIds=[...new Set([...i,...r.addIds])],r.addIds.length>0&&e.push({ids:i,mode:t,layerView:s}),r.removeIds.length>0&&(r.removeIds=r.removeIds.filter((t=>i.indexOf(t)<0)));else{const n=this.selectionSets.reduce(((t,e)=>(i.forEach((i=>{e.workflowType!==E.REFINE?e.selectedIds.indexOf(i)>-1&&t.push(i):Object.keys(e.refineInfos).some((a=>{const n=e.refineInfos[a];if(n.layerView.layer.id===s.layer.id&&n.addIds.indexOf(i)>-1)return t.push(i),!0}))})),t)),[]);r.removeIds=[...new Set([...n,...r.removeIds])],r.addIds=r.addIds.filter((i=>n.indexOf(i)<0)),r.removeIds.length>0&&e.push({ids:n,mode:t,layerView:s}),this.selectionSets=this.selectionSets.reduce(((i,t)=>(t.workflowType!==E.REFINE&&t.layerView.layer.id===s.layer.id?(t.selectedIds=t.selectedIds.filter((i=>r.removeIds.indexOf(i)<0)),t.selectedIds.length>0?i.push(t):a=!0):i.push(t),i)),[])}this._refineSelectionSet.refineInfos[l]=r,this.selectionSets=[...this.selectionSets],a&&this.selectionSetsChanged.emit(this.selectionSets),await this._highlightFeatures()}get el(){return a(this)}};U.style=':host{display:block}.div-visible{display:inherit}.div-not-visible{display:none !important}.padding-top-1-2{padding-top:.5rem}.main-label{display:flex;float:left}html[dir="rtl"] .main-label{display:flex;float:right}.border{outline:1px solid var(--calcite-ui-border-input)}.margin-top-1{margin-top:1rem}.esri-sketch{display:flex;flex-flow:column wrap}.esri-widget{box-sizing:border-box;color:#323232;font-size:14px;font-family:"Avenir Next","Helvetica Neue",Helvetica,Arial,sans-serif;line-height:1.3em;background-color:var(--calcite-ui-foreground-1)}.esri-sketch__panel{align-items:center;display:flex;flex-flow:row nowrap;padding:0}*/ .esri-sketch__tool-section{border-right:1px solid rgba(110,110,110,.3)}.esri-sketch__section{align-items:center;display:flex;flex-flow:row nowrap;padding:0 7px;margin:6px 0;border-right:1px solid rgba(110,110,110,.3)}.display-flex{display:flex}.font-bold{font-weight:bold}.width-full{width:100%}.label-margin-0{--calcite-label-margin-bottom:0}.padding-start-1-2{-webkit-padding-start:0.5rem;padding-inline-start:0.5rem}.font-weight-500{font-weight:500}.word-wrap-anywhere{word-wrap:anywhere}';export{B as calcite_input_text,$ as map_select_tools,J as pdf_download,U as refine_selection}
@@ -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 i,h as s,H as e,g as a}from"./p-f8be5d5f.js";import{l as o}from"./p-d7ddd3a2.js";import{g as n}from"./p-fc2277fe.js";import"./p-e1a4994d.js";const l=class{constructor(s){t(this,s),this.closeEdit=i(this,"closeEdit",7),this._shouldClose=!1,this.graphics=void 0,this.mapView=void 0,this.open=!1,this.graphicIndex=0,this._translations=void 0}graphicIndexWatchHandler(){this._initEditorWidget()}graphicsWatchHandler(){this._initEditorWidget()}mapViewWatchHandler(){this._initEditorWidget()}async componentWillLoad(){await this._initModules(),await this._getTranslations()}async componentWillRender(){var t,i;const s=document.getElementsByTagName("layer-table");if(1===s.length){const t=s[0];this.graphics=await t.getSelectedGraphics()}(null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&(null===(i=this.graphics[0])||void 0===i?void 0:i.layer)&&(this._layer=this.graphics[0].layer)}render(){var t;const i=!((null===(t=this.graphics)||void 0===t?void 0:t.length)>0&&this.graphics[0]&&this.graphics[0].layer.editingEnabled);return s(e,null,s("div",{class:"position-relative"},i?s("calcite-notice",{kind:"warning",open:!0,slot:"content-top",width:"full"},s("div",{slot:"message"},this._translations.enableEditing)):void 0,s("div",{slot:"content"},s("div",{id:"feature-form",ref:t=>this._editContainer=t}))))}async _initModules(){const[t,i]=await o(["esri/widgets/Editor","esri/core/reactiveUtils"]);this.Editor=t,this.reactiveUtils=i}_initEditorWidget(){if(this.mapView&&this.graphics&&this.graphics.length>0&&this.graphics[0]){this._editor&&this._editor.destroy();const t=document.createElement("div");this._editor=new this.Editor({allowedWorkflows:"update",view:this.mapView,visibleElements:{snappingControls:!1,sketchTooltipControls:!1},container:t}),this._editHandle&&this._attachmentHandle&&this._activeWorkflowHandle&&(this._editHandle.remove(),this._attachmentHandle.remove(),this._activeWorkflowHandle.remove()),this._attachmentHandle=this.reactiveUtils.when((()=>"adding-attachment"===this._editor.viewModel.state||"editing-attachment"===this._editor.viewModel.state),(()=>{this._shouldClose=!1})),this._editHandle=this.reactiveUtils.when((()=>"ready"===this._editor.viewModel.state),(()=>{this._shouldClose&&(this.closeEdit.emit(),this._shouldClose=!1),this.graphicIndex>-1&&this.graphics.length>0&&this.open&&!this._shouldClose&&(this._editor.startUpdateWorkflowAtFeatureEdit(this.graphics[this.graphicIndex]),this._shouldClose=!0)})),this._activeWorkflowHandle=this.reactiveUtils.watch((()=>{var t;return null===(t=this._editor.viewModel.activeWorkflow)||void 0===t?void 0:t.activeWorkflow}),(t=>{"update-table-record"!==(null==t?void 0:t.type)&&"create-features"!==(null==t?void 0:t.type)||(this._shouldClose=!1)})),this._editContainer.appendChild(t)}}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphicIndex:["graphicIndexWatchHandler"],graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};l.style=":host{display:block}.padding-bottom-1{padding-bottom:1rem}.font-bold{font-weight:var(--calcite-font-weight-bold)}.font-500{font-weight:var(--calcite-font-weight-medium)}.font-italic{font-style:italic}#feature-form{--calcite-ui-background:none;padding-top:0px}.padding-sides-bottom-1{padding:0 1rem 1rem 1rem}.position-relative{position:relative}.esri-editor__prompt--danger{position:relative !important;width:100% !important;background-color:var(--calcite-ui-foreground-1) !important}";const h=class{constructor(i){t(this,i),this.graphics=void 0,this.isLoading=!1,this.mapView=void 0,this._alertOpen=!1,this._editRecordOpen=!1,this._translations=void 0}async graphicsWatchHandler(){var t;this.graphics.length>0&&(this._editEnabled=(null===(t=this.graphics[0])||void 0===t?void 0:t.layer).editingEnabled,this._features.open({features:this.graphics}))}async mapViewWatchHandler(){await this.mapView.when((async()=>{await this._initFeaturesWidget()}))}async getSelectedFeature(){return this._features.selectedFeature}async closeEdit(){this._editRecordOpen=!1}async componentWillLoad(){await this._initModules(),await this._getTranslations()}render(){var t;const i=this.isLoading||this._editRecordOpen?"display-none":"position-absolute",a=!this.isLoading&&this._editRecordOpen?"position-absolute":"display-none",o=!this.isLoading&&this._editRecordOpen?"display-none":"";return s(e,null,s("calcite-shell",null,s("calcite-loader",{class:this.isLoading?"":"display-none",label:this._translations.fetchingData}),s("div",{class:"esri-widget "+i,id:"features-node"}),s("div",{class:"padding-1-2 display-flex "+o,slot:"footer"},s("calcite-button",{appearance:"outline",iconStart:"pencil",id:"solutions-edit",onClick:()=>this._openEditRecord(),width:"full"},this._translations.edit),s("calcite-tooltip",{label:"",placement:"bottom","reference-element":"solutions-edit"},s("span",null,this._translations.edit))),s("edit-card",{class:a,graphicIndex:null===(t=this._features)||void 0===t?void 0:t.selectedFeatureIndex,graphics:this.graphics,mapView:this.mapView,open:this._editRecordOpen}),s("calcite-alert",{icon:"layer-broken",kind:"warning",label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},s("div",{slot:"title"},this._translations.editDisabled),s("div",{slot:"message"},this._translations.enableEditing))))}async _initModules(){const[t]=await o(["esri/widgets/Features"]);this.Features=t}async _initFeaturesWidget(){this._features||(this._features=new this.Features({container:"features-node",visibleElements:{actionBar:!1,closeButton:!1,heading:!0},viewModel:{view:this.mapView}}))}_alertClosed(){this._alertOpen=!1}_editRecordClosed(){this._editRecordOpen=!1}_openEditRecord(){this._editEnabled?this._editRecordOpen=!0:this._alertOpen=!0}async _getTranslations(){const t=await n(this.el);this._translations=t[0]}get el(){return a(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};h.style=":host{display:block;--calcite-label-margin-bottom:0}table{border-collapse:collapse;width:100%}th,td{text-align:left;padding:8px}tr:nth-child(odd){background:var(--calcite-ui-foreground-2)}.bottom-border{padding-bottom:0.5rem;border-bottom:1px solid var(--calcite-ui-border-1)}.padding-1-2{padding:0.5rem}.padding-top-1-2{padding-top:0.5rem}.font-color-3{color:var(--calcite-ui-text-3)}.display-none{display:none}.display-flex{display:flex}.position-absolute{position:absolute;top:0;right:0;bottom:0;left:0;overflow:auto}";export{l as edit_card,h as info_card}
@@ -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,h as i,H as e,g as s,c as a}from"./p-f8be5d5f.js";import{g as l}from"./p-fc2277fe.js";import{q as n,i as o,j as h,k as r}from"./p-4af3f843.js";import{l as c}from"./p-d7ddd3a2.js";import{d}from"./p-9807924d.js";import"./p-e1a4994d.js";import"./p-9ab03591.js";const p=class{constructor(i){t(this,i),this.layer=void 0,this.mapView=void 0,this._cardLoading=!1,this._graphics=void 0,this._translations=void 0}async featureSelectionChange(t){const i=t.detail;this._cardLoading=!0;const e=i.length>0?await n(i,this.layer,[],!1,this.mapView.spatialReference):[];this._graphics=e,this._cardLoading=!1}async layerSelectionChange(t){const i=t.detail[0];this.layer=await o(this.mapView,i)}async componentWillLoad(){await this._getTranslations()}render(){var t,s;const a=(null===(t=this._graphics)||void 0===t?void 0:t.length)>0?"":"display-none",l=(null===(s=this._graphics)||void 0===s?void 0:s.length)>0?"display-none":"";return i(e,null,i("div",{class:"border-rounded overflow-auto"},i("calcite-shell",{class:"position-relative padding-1 "+a},i("div",null,i("info-card",{graphics:this._graphics,isLoading:this._cardLoading,mapView:this.mapView}))),i("div",{class:"padding-1 "+l},i("calcite-notice",{icon:"table",open:!0},i("div",{slot:"message"},this._translations.selectFeaturesToStart)))))}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}};p.style=":host{display:block !important}.display-flex{display:flex}.display-none{display:none}.w-100{width:100%}.padding-bottom-1{padding-bottom:1rem}.padding-1{padding:1rem}.position-relative{position:relative}.focus-margin{margin:1px 1px 0px 1px}.overflow-auto{overflow:auto}.border-rounded{border:1px solid var(--calcite-ui-border-2);border-radius:5px}card-manager{display:block}";const b=class{constructor(i){t(this,i),this.featureSelectionChange=a(this,"featureSelectionChange",7),this._allIds=[],this.onTableNodeCreate=t=>{this._tableNode=t,this._getTable(t)},this.mapView=void 0,this._alertOpen=!1,this._fetchingData=!1,this._layer=void 0,this._selectedIndexes=[],this._showOnlySelected=!1,this._translations=void 0}async mapViewWatchHandler(){this._fetchingData=!0;const t=await h(this.mapView);this._layer=await o(this.mapView,t[0]),this._resetTable(),this.reactiveUtils.on((()=>this.mapView),"click",(t=>{this._mapClicked(t)})),this._fetchingData=!1}async _layerWatchHandler(){this._fetchingData=!0,this._resetTable(),this._fetchingData=!1}async getSelectedGraphics(){return this._selectedIndexes.length>0?await this._getGraphics(this._selectedIndexes):[]}async componentWillLoad(){await this._getTranslations(),await this._initModules()}render(){if(!this._layer)return null;const t=this._fetchingData?"display-none":"",s=this._fetchingData?"":"display-none",a=this._alertShowAction?"":"display-none";return i(e,null,i("calcite-shell",null,this._getTableControlRow("header"),i("div",{class:"height-full width-full"},i("calcite-panel",{class:"height-full width-full"},i("calcite-loader",{class:s,label:this._translations.fetchingData,scale:"l"}),i("div",{class:t,ref:this.onTableNodeCreate}))),i("calcite-alert",{icon:this._alertIcon,kind:this._alertKind,label:"",onCalciteAlertClose:()=>this._alertClosed(),open:this._alertOpen,placement:"top"},i("div",{slot:"title"},this._alertTitle),i("div",{slot:"message"},this._alertMessage),i("calcite-link",{class:a,onClick:this._alertActionFunction,slot:"link"},this._alertActionText))))}async _initModules(){const[t,i]=await c(["esri/widgets/FeatureTable","esri/core/reactiveUtils"]);this.FeatureTable=t,this.reactiveUtils=i}_getTableControlRow(t){const e=this._selectedIndexes.length>0;return i("div",{class:"display-flex table-border height-51",slot:t},i("calcite-action-bar",{expandDisabled:!0,expanded:!0,layout:"horizontal"},i("div",{class:"border-end"},i("map-layer-picker",{appearance:"transparent",mapView:this.mapView,onLayerSelectionChange:t=>this._layerSelectionChanged(t),placeholderIcon:"layers",scale:"l",type:"dropdown"})),i("calcite-action",{appearance:"solid",disabled:!e,icon:"magnifying-glass",id:"magnifying-glass",label:this._translations.zoom,onClick:()=>this._zoom(),text:this._translations.zoom,textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"magnifying-glass"},i("span",null,this._translations.zoom)),i("calcite-action",{appearance:"solid",icon:"filter",id:"filter",onClick:()=>this._filter(),text:this._translations.filters,"text-enabled":"true",textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"filter"},i("span",null,this._translations.filters)),i("calcite-action",{appearance:"solid",disabled:!e,id:"trash",onClick:()=>this._delete(),text:""},i("calcite-button",{appearance:"transparent",iconStart:"trash",kind:"danger"},this._translations.delete)),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"trash"},i("span",null,this._translations.delete)),i("calcite-action",{appearance:"solid",disabled:!e,icon:"erase",id:"erase",onClick:()=>this._clearSelection(),text:this._translations.clearSelection,"text-enabled":"true",textEnabled:!0}),i("calcite-tooltip",{label:"",placement:"bottom","reference-element":"erase"},i("span",null,this._translations.clearSelection))),i("calcite-dropdown",null,i("calcite-action",{appearance:"solid",label:"",slot:"trigger",text:""},i("calcite-button",{appearance:"transparent",iconEnd:"chevron-down",kind:"neutral"},this._translations.more)),i("calcite-dropdown-group",{"selection-mode":"none"},i("calcite-dropdown-item",{iconStart:"list-check-all",onClick:()=>this._selectAll()},this._translations.selectAll),i("calcite-dropdown-item",{iconStart:"selected-items-filter",onClick:()=>this._toggleShowSelected()},this._showOnlySelected?this._translations.showAll:this._translations.showSelected),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._switchSelected()},this._translations.switchSelected),i("calcite-dropdown-item",{iconStart:"refresh",onClick:()=>this._refresh()},this._translations.refresh),i("calcite-dropdown-item",{iconStart:"export",onClick:()=>{this._exportToCSV()}},this._translations.exportCSV))))}_getTable(t){this._layer&&(this._table=new this.FeatureTable({layer:this._layer,view:this.mapView,highlightOnRowSelectEnabled:!0,multiSortEnabled:!1,visibleElements:{header:!1,menu:!1},container:t}),this._table.highlightIds.on("change",(()=>{this._selectedIndexes=this._table.highlightIds.toArray(),this._showOnlySelected&&(this._selectedIndexes.length>0?this._table.filterBySelection():this._toggleShowSelected()),this.featureSelectionChange.emit(this._selectedIndexes)})))}_resetTable(){this._layer&&this._table&&(this._clearSelection(),this.featureSelectionChange.emit(this._selectedIndexes),this._table.layer=this._layer,this._editEnabled=this._layer.editingEnabled,this._table.view=this.mapView,this._table.editingEnabled=this._editEnabled,this._table.clearSelectionFilter(),this._showOnlySelected=!1)}async _mapClicked(t){const i={include:this._layer},e=await this.mapView.hitTest(t.screenPoint,i);e.results.length>0&&(e.results.forEach((t=>{const i=t.graphic.getObjectId(),e=this._table.highlightIds.indexOf(i);e>-1?this._table.highlightIds.removeAt(e):this._table.highlightIds.add(i)})),this._showOnlySelected&&this._table.filterBySelection())}_alertClosed(){this._alertOpen=!1}_selectAll(){const t=this._allIds;this._table.highlightIds.addMany(t),this._selectedIndexes=t}_toggleShowSelected(){this._showOnlySelected=!this._showOnlySelected,this._showOnlySelected?this._table.filterBySelection():this._table.clearSelectionFilter()}_clearSelection(){this._selectedIndexes=[],this._table.highlightIds.removeAll()}_filter(){alert("do whatever this button is supposed to do")}_switchSelected(){const t=[...this._selectedIndexes];this._selectedIndexes=this._allIds.reduce(((i,e,s)=>(t.indexOf(s)<0&&i.push(s),i)),[]),this._table.highlightIds.removeAll(),this._table.highlightIds.addMany(this._selectedIndexes)}async _exportToCSV(){const t={},i=this._table.highlightIds.toArray();t[this._layer.id]={selectionSetNames:[],ids:i,layer:this._layer},d(t,!1,!0)}_refresh(){this._table.refresh()}_zoom(){this._table.zoomToSelection()}_delete(){this._editEnabled?(this._alertIcon="trash",this._alertTitle=this._translations.deleteRows,this._alertActionText=this._translations.delete,this._alertShowAction=!0,this._alertMessage=this._translations.confirm,this._alertKind="danger",this._alertActionFunction=()=>{this._layer.applyEdits({deleteFeatures:this._table.highlightIds.toArray()}),this._alertOpen=!1}):(this._alertIcon="layer-broken",this._alertTitle=this._translations.deleteDisabled,this._alertShowAction=!1,this._alertMessage=this._translations.enableEditing,this._alertKind="warning"),this._alertOpen=!0}async _getGraphics(t){return t.length>0?n(t,this._table.layer,[],!1,this.mapView.spatialReference):[]}async _layerSelectionChanged(t){const i=t.detail[0];i===this._layer.id&&0!==this._allIds.length||(this._fetchingData=!0,this._table.highlightIds.removeAll(),this._layer=await o(this.mapView,i),this._allIds=await r(this._layer),this._selectedIndexes=[],this._table.layer=this._layer,this._table.render(),this._fetchingData=!1)}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{mapView:["mapViewWatchHandler"],_layer:["_layerWatchHandler"]}}};b.style=":host{display:block}.height-full{height:100%}.width-full{width:100%}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.border-end{-webkit-border-end:1px solid var(--calcite-ui-border-2);border-inline-end:1px solid var(--calcite-ui-border-2)}.padding-5{padding:5px}.height-51{height:51px}";const m=class{constructor(i){t(this,i),this.mapChanged=a(this,"mapChanged",7),this._loadedId="",this.mapInfos=[],this.mapView=void 0,this._mapListExpanded=!1,this._translations=void 0,this._webMapInfo=void 0}_webMapInfoWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._loadMap(t)}mapInfosWatchHandler(t,i){t&&JSON.stringify(t)!==JSON.stringify(i)&&this._loadMap(t[0])}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidRender(){this._loadMap(this._webMapInfo)}render(){return i(e,null,this._getToolbar(),this._getMapNameList(this._mapListExpanded),i("div",{class:"map-height",ref:t=>this._mapDiv=t}),i("map-tools",{class:"map-tools"}))}async _initModules(){const[t,i]=await c(["esri/WebMap","esri/views/MapView"]);this.WebMap=t,this.MapView=i}_getToolbar(){return i("div",{class:"display-flex"},i("calcite-action-bar",{class:"border-bottom-1 action-bar-size","expand-disabled":!0,layout:"horizontal",slot:"header"},this._getMapPicker()))}_loadMap(t){const i=null==t?void 0:t.id;if((""===i||!i)&&this.mapInfos.length>0&&(this._webMapInfo=this.mapInfos[0]),this._loadedId!==i){const t=new this.WebMap({portalItem:{id:i}});this.mapView=new this.MapView({container:this._mapDiv,map:t,resizeAlign:"top-left"}),this._loadedId=i,this.mapChanged.emit(this.mapView)}}_getMapPicker(){var t;return i("calcite-button",{alignment:"icon-end-space-between",appearance:"solid",class:"width-full height-full",iconEnd:this._mapListExpanded?"chevron-up":"chevron-down",kind:"neutral",onClick:()=>this._chooseMap(),width:"full"},null===(t=this._webMapInfo)||void 0===t?void 0:t.name)}_getMapNameList(t){return i("div",{class:t?"map-list":"display-none"},i("calcite-list",{id:"mapList"},this.mapInfos.map((t=>i("calcite-list-item",{label:t.name,onClick:()=>this._webMapSelected(t),selected:t.id===this._loadedId,value:t.id})))))}_webMapSelected(t){this._mapListExpanded=!1,this._webMapInfo=t}_chooseMap(){this._mapListExpanded=!this._mapListExpanded}async _getTranslations(){const t=await l(this.el);this._translations=t[0]}get el(){return s(this)}static get watchers(){return{_webMapInfo:["_webMapInfoWatchHandler"],mapInfos:["mapInfosWatchHandler"]}}};m.style=":host{display:block;--calcite-label-margin-bottom:0;--calcite-block-padding:0}.action-bar-size{height:51px;width:100%}.action-center{-webkit-box-align:center;-webkit-align-items:center;-ms-grid-row-align:center;align-items:center;align-content:center;justify-content:center}.border-bottom-1{border-width:0px;border-bottom-width:1px;border-style:solid;border-color:var(--calcite-ui-border-3)}.width-1-7{width:14.28%}.width-1-6{width:16.66%}.width-full{width:100%}.height-full{height:100%}.display-flex{display:flex}.display-grid{display:inline-grid}.block-button{border-bottom:0}.block-button:hover{background-color:var(--calcite-ui-foreground-2)}.block-button:active{background-color:var(--calcite-ui-foreground-3)}.map-list{position:absolute;display:flex;flex-direction:column;overflow:hidden;animation:calcite-scrim-fade-in var(--calcite-internal-animation-timing-medium) ease-in-out;background-color:var(--calcite-scrim-background);z-index:1;width:100%;height:-moz-fit-content;height:fit-content}.map-height{height:calc(100% - 58px)}.display-none{display:none}.esri-zoom{display:none !important}.map-tools{position:absolute;top:40px;right:0px;padding:1rem}";export{p as card_manager,b as layer_table,m as map_card}