@esri/solutions-components 0.4.12 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. package/dist/cjs/buffer-tools_6.cjs.entry.js +2 -1
  2. package/dist/cjs/calcite-combobox_3.cjs.entry.js +61 -61
  3. package/dist/cjs/calcite-input-message_5.cjs.entry.js +282 -282
  4. package/dist/cjs/downloadUtils-415ab342.js +1093 -1093
  5. package/dist/cjs/index.es-98008aa0.js +10682 -10682
  6. package/dist/cjs/layer-table.cjs.entry.js +22 -22
  7. package/dist/cjs/mapViewUtils-f617ae9a.js +24 -24
  8. package/dist/cjs/public-notification.cjs.entry.js +3 -0
  9. package/dist/collection/components/map-draw-tools/map-draw-tools.js +2 -1
  10. package/dist/collection/components/public-notification/public-notification.js +3 -0
  11. package/dist/components/map-draw-tools2.js +17 -16
  12. package/dist/components/public-notification.js +60 -57
  13. package/dist/components/queryUtils.js +10 -10
  14. package/dist/esm/buffer-tools_6.entry.js +2 -1
  15. package/dist/esm/calcite-combobox_3.entry.js +55 -55
  16. package/dist/esm/calcite-input-message_5.entry.js +274 -274
  17. package/dist/esm/downloadUtils-606b0f0e.js +1089 -1089
  18. package/dist/esm/index.es-c736c805.js +10596 -10596
  19. package/dist/esm/layer-table.entry.js +18 -18
  20. package/dist/esm/mapViewUtils-4e945e07.js +12 -12
  21. package/dist/esm/public-notification.entry.js +3 -0
  22. package/dist/solutions-components/{p-570b076b.entry.js → p-4f5641b4.entry.js} +1 -1
  23. package/dist/solutions-components/p-5ee7b022.entry.js +11 -11
  24. package/dist/solutions-components/p-6a657ff6.js +436 -436
  25. package/dist/solutions-components/p-72117a18.js +60 -60
  26. package/dist/solutions-components/p-84bbaebf.entry.js +5 -5
  27. package/dist/solutions-components/p-88e28de2.js +35 -35
  28. package/dist/solutions-components/p-ac76d270.entry.js +16 -16
  29. package/dist/solutions-components/p-e162304e.entry.js +6 -0
  30. package/dist/solutions-components/solutions-components.esm.js +1 -1
  31. package/package.json +1 -1
  32. package/dist/solutions-components/p-308e24cc.entry.js +0 -6
@@ -1,18 +1,18 @@
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 registerInstance, h, H as Host, g as getElement } from './index-c246d90e.js';
7
- import { g as getLocaleComponentStrings } from './locale-7bf10e0a.js';
8
- import { g as goToSelection, a as getMapLayerView, q as queryAllFeatures } from './mapViewUtils-4e945e07.js';
9
- import { d as downloadCSV } from './downloadUtils-606b0f0e.js';
10
- import './_commonjsHelpers-d5f9d613.js';
11
- import './interfaces-d0d83efa.js';
12
- import './loadModules-b299cd43.js';
13
-
14
- const layerTableCss = ":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";
15
-
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 registerInstance, h, H as Host, g as getElement } from './index-c246d90e.js';
7
+ import { g as getLocaleComponentStrings } from './locale-7bf10e0a.js';
8
+ import { g as goToSelection, a as getMapLayerView, q as queryAllFeatures } from './mapViewUtils-4e945e07.js';
9
+ import { d as downloadCSV } from './downloadUtils-606b0f0e.js';
10
+ import './_commonjsHelpers-d5f9d613.js';
11
+ import './interfaces-d0d83efa.js';
12
+ import './loadModules-b299cd43.js';
13
+
14
+ const layerTableCss = ":host{display:block}.table{display:table;width:100%}.header{display:table-header-group;background-color:#757575;font-weight:500;font-size:var(--calcite-font-size-0);color:var(--calcite-ui-text-inverse);position:sticky;top:0;z-index:1}.table-header-cell{display:table-cell;text-align:justify;border-right:1px solid var(--calcite-ui-border-2);padding:0.5rem}.table-body{display:table-row-group}.row{display:table-row}.table-cell{display:table-cell;padding:0.5rem}.display-table-header{display:table-header-group}.display-flex{display:flex}.table-border{border:1px solid var(--calcite-ui-border-2)}.justify-center{justify-content:center}.table-container{width:100%}.overflow-auto{overflow:auto}.data-container{overflow:auto;height:calc(100% - 35px)}.row:nth-child(odd){background:var(--calcite-ui-foreground-3)}.padding-3-4{padding:0.75rem}.field-width{white-space:nowrap;min-width:300px;max-width:300px;overflow:hidden}";
15
+
16
16
  const LayerTable = class {
17
17
  constructor(hostRef) {
18
18
  registerInstance(this, hostRef);
@@ -308,6 +308,6 @@ const LayerTable = class {
308
308
  }
309
309
  get el() { return getElement(this); }
310
310
  };
311
- LayerTable.style = layerTableCss;
312
-
313
- export { LayerTable as layer_table };
311
+ LayerTable.style = layerTableCss;
312
+
313
+ export { LayerTable as layer_table };
@@ -1,10 +1,10 @@
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 { E as EWorkflowType } from './interfaces-d0d83efa.js';
7
-
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 { E as EWorkflowType } from './interfaces-d0d83efa.js';
7
+
8
8
  /** @license
9
9
  * Copyright 2022 Esri
10
10
  *
@@ -174,8 +174,8 @@ async function _intersectQuery(geometry, layer) {
174
174
  q.spatialRelationship = "intersects";
175
175
  q.geometry = geometry;
176
176
  return layer.queryObjectIds(q);
177
- }
178
-
177
+ }
178
+
179
179
  /** @license
180
180
  * Copyright 2022 Esri
181
181
  *
@@ -314,6 +314,6 @@ async function goToSelection(ids, layerView, mapView, flashFeatures = true, feat
314
314
  if (flashFeatures) {
315
315
  await flashSelection(ids, layerView, featureEffect);
316
316
  }
317
- }
318
-
319
- export { getMapLayerView as a, queryFeaturesByID as b, getSelectionSetQuery as c, queryObjectIds as d, getQueryGeoms as e, queryFeaturesByGeometry as f, goToSelection as g, highlightFeatures as h, getMapLayerIds as i, getMapLayerHash as j, queryAllFeatures as q };
317
+ }
318
+
319
+ export { getMapLayerView as a, queryFeaturesByID as b, getSelectionSetQuery as c, queryObjectIds as d, getQueryGeoms as e, queryFeaturesByGeometry as f, goToSelection as g, highlightFeatures as h, getMapLayerIds as i, getMapLayerHash as j, queryAllFeatures as q };
@@ -69,6 +69,9 @@ const PublicNotification = class {
69
69
  if (s_newValue !== JSON.stringify(oldValue)) {
70
70
  this._searchConfiguration = JSON.parse(s_newValue);
71
71
  this.searchConfigurationChange.emit(this._searchConfiguration);
72
+ // force back to list page before we create Search
73
+ // https://devtopia.esri.com/WebGIS/arcgis-template-configuration/issues/3402
74
+ void this._home();
72
75
  }
73
76
  }
74
77
  /**
@@ -15,4 +15,4 @@ const j="radio-group-item-icon",T=class{constructor(e){i(this,e),this.calciteInt
15
15
  * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details.
16
16
  * v1.0.0-beta.97
17
17
  */
18
- const F="handle__label";function O(i){return Array.isArray(i)}const P=class{constructor(e){i(this,e),this.calciteSliderInput=t(this,"calciteSliderInput",6),this.calciteSliderChange=t(this,"calciteSliderChange",6),this.calciteSliderUpdate=t(this,"calciteSliderUpdate",6),this.disabled=!1,this.groupSeparator=!1,this.hasHistogram=!1,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.min=0,this.mirrored=!1,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.value=0,this.scale="m",this.activeProp="value",this.guid=`calcite-slider-${x()}`,this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[],this.dragUpdate=i=>{if(i.preventDefault(),this.dragProp){const t=this.translate(i.clientX||i.pageX);if(O(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const i=t-this.minValueDragRange,e=t+this.maxValueDragRange;e<=this.max&&i>=this.min&&e-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(e,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.pointerUpDragEnd=i=>{c(i)&&this.dragEnd(i)},this.dragEnd=i=>{this.removeDragListeners(),this.focusActiveHandle(i.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null},this.storeTrackRef=i=>{this.trackEl=i},this.determineGroupSeparator=i=>{if("number"==typeof i)return _.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},_.localize(i.toString())}}histogramWatcher(i){this.hasHistogram=!!i}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){z(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),u(this),p(this)}disconnectedCallback(){m(this),g(this),V(this),this.removeDragListeners()}componentWillLoad(){this.tickValues=this.generateTickValues(),O(this.value)||(this.value=this.clamp(this.value)),b(this,this.value),this.snap&&!O(this.value)&&(this.value=this.getClosestStep(this.value)),this.histogram&&(this.hasHistogram=!0)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),O(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),v(this)}render(){const i=this.el.id||this.guid,t=O(this.value)?"maxValue":"value",s=O(this.value)?this.maxValue:this.value,n=this.determineGroupSeparator(s),l=this.determineGroupSeparator(this.minValue),r=this.minValue||this.min,h=this.shouldUseMinValue(),o=100*this.getUnitInterval(h?this.minValue:r),c=100*this.getUnitInterval(s),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,b=O(this.value),p=`${F} handle__label--minValue`,g=`${F} handle__label--value`,v=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"})),x=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"})),k=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),y=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("div",{class:"handle-extension"})),w=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),_=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"}),e("div",{class:"handle-extension"})),z=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),V=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"})),D=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l),e("div",{class:"handle"})),M=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l)),$=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),C=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l));return e(a,{id:i,onTouchStart:this.handleTouchStart},e("div",{class:{container:!0,"container--range":b,[`scale--${this.scale}`]:!0}},this.renderGraph(),e("div",{class:"track",ref:this.storeTrackRef},e("div",{class:"track__range",onPointerDown:i=>this.pointerDownDragStart(i,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),e("div",{class:"ticks"},this.tickValues.map((i=>{const t=100*this.getUnitInterval(i)+"%";let a=i>=r&&i<=s;return h&&(a=i>=this.minValue&&i<=this.maxValue),e("span",{class:{tick:!0,"tick--active":a},style:{left:d?"":t,right:d?t:""}},this.renderTickLabel(i))})))),e("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&b&&V,!this.hasHistogram&&!this.precise&&this.labelHandles&&b&&D,this.precise&&!this.labelHandles&&b&&$,this.precise&&this.labelHandles&&b&&C,this.hasHistogram&&!this.precise&&this.labelHandles&&b&&M,!this.precise&&!this.labelHandles&&v,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&y,this.hasHistogram&&this.precise&&!this.labelHandles&&w,!this.hasHistogram&&this.precise&&this.labelHandles&&_,this.hasHistogram&&!this.precise&&this.labelHandles&&k,this.hasHistogram&&this.precise&&this.labelHandles&&z,e(f,{component:this}))))}renderGraph(){return this.histogram?e("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:O(this.value)?this.maxValue:this.value,highlightMin:O(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(i){const t=O(this.value),a=i===this.min,s=i===this.max,n=this.determineGroupSeparator(i),l=e("span",{class:{tick__label:!0,"tick__label--min":a,"tick__label--max":s}},n);return this.labelTicks&&!this.hasHistogram&&!t||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&this.precise&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(a||s)?l:null}keyDownHandler(i){const t=this.shouldMirror(),{activeProp:e,max:a,min:s,pageStep:n,step:l}=this,r=this[e],{key:h}=i;if(w(h))return void i.preventDefault();let o;if("ArrowUp"===h||"ArrowRight"===h?o=r+l*(t&&"ArrowRight"===h?-1:1):"ArrowDown"===h||"ArrowLeft"===h?o=r-l*(t&&"ArrowLeft"===h?-1:1):"PageUp"===h?n&&(o=r+n):"PageDown"===h?n&&(o=r-n):"Home"===h?o=s:"End"===h&&(o=a),isNaN(o))return;i.preventDefault();const c=Number(o.toFixed(k(l)));this.setValue({[e]:this.clamp(c,e)})}pointerDownHandler(i){if(!c(i))return;const t=i.clientX||i.pageX,e=this.translate(t);let a="value";O(this.value)&&(a=e>=this.minValue&&e<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-e)<Math.abs(this.minValue-e)||e>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[a]:this.clamp(e,a)}),this.focusActiveHandle(t)}handleTouchStart(i){i.preventDefault()}async setFocus(){const i=this.minHandle?this.minHandle:this.maxHandle;null==i||i.focus()}setValueFromMinMax(){const{minValue:i,maxValue:t}=this;"number"==typeof i&&"number"==typeof t&&(this.value=[i,t])}setMinMaxFromValue(){const{value:i}=this;O(i)&&(this.minValue=i[0],this.maxValue=i[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!O(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}generateTickValues(){const i=[];let t=this.min;for(;this.ticks&&t<this.max+this.ticks;)i.push(Math.min(t,this.max)),t+=this.ticks;return i}pointerDownDragStart(i,t){c(i)&&this.dragStart(t)}dragStart(i){this.dragProp=i,this.lastDragProp=this.dragProp,this.activeProp=i,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(i){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(i).focus()}}emitInput(){this.calciteSliderInput.emit(),this.calciteSliderUpdate.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(i){let t;Object.keys(i).forEach((e=>{const a=i[e];t||(t=this[e]!==a),this[e]=a})),t&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(i,t){return i=y(i,this.min,this.max),"maxValue"===t&&(i=Math.max(i,this.minValue)),"minValue"===t&&(i=Math.min(i,this.maxValue)),i}translate(i){const t=this.max-this.min,{left:e,width:a}=this.trackEl.getBoundingClientRect(),s=(i-e)/a,n=this.shouldMirror(),l=this.clamp(this.min+t*(n?1-s:s));let r=Number(l.toFixed(k(this.step)));return this.snap&&this.step&&(r=this.getClosestStep(r)),r}getClosestStep(i){if(i=Number(this.clamp(i).toFixed(k(this.step))),this.step){const t=Math.round(i/this.step)*this.step;i=Number(this.clamp(t).toFixed(k(this.step)))}return i}getClosestHandle(i){return this.getDistanceX(this.maxHandle,i)>this.getDistanceX(this.minHandle,i)?this.minHandle:this.maxHandle}getDistanceX(i,t){return Math.abs(i.getBoundingClientRect().left-t)}getFontSizeForElement(i){return Number(window.getComputedStyle(i).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(i){return((i=this.clamp(i))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(i){const t=this.el.shadowRoot.querySelector(`.handle__label--${i}`),e=this.el.shadowRoot.querySelector(`.handle__label--${i}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${i}.transformed`),s=e.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:i}=this.el,t=this.shouldMirror(),e=t?"value":"minValue",a=t?"minValue":"value",s=i.querySelector(`.handle__label--${e}`),n=i.querySelector(`.handle__label--${e}.static`),l=i.querySelector(`.handle__label--${e}.transformed`),r=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),h=i.querySelector(`.handle__label--${a}`),o=i.querySelector(`.handle__label--${a}.static`),c=i.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(s),m=this.getRangeLabelOverlap(l,c),b=s,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===r){let i=m/2-p;i=-1===Math.sign(i)?Math.abs(i):-i;const t=this.getHostOffset(l.getBoundingClientRect().left+i-p,l.getBoundingClientRect().right+i-p);let e=m/2;const a=this.getHostOffset(c.getBoundingClientRect().left+e,c.getBoundingClientRect().right+e);0!==t&&(i+=t,e+=t),0!==a&&(i+=a,e+=a),s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`,h.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(r>0||d>0)s.style.transform=`translateX(${r+p}px)`,h.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(r<0||d<0){let i=Math.abs(r)+m-p;i=-1===Math.sign(i)?Math.abs(i):-i,s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),s.style.transform=`translateX(${r}px)`,l.style.transform=`translateX(${r}px)`,h.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const i=O(this.value);if(!(this.hasHistogram||i||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!i&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!i&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!i&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&i&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const t=this.el.shadowRoot.querySelector(".thumb--minValue"),e=this.el.shadowRoot.querySelector(".thumb--value"),a=this.el.shadowRoot.querySelector(".tick__label--min"),s=this.el.shadowRoot.querySelector(".tick__label--max");!t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,e)?"0":"1"),t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,e)&&this.hasHistogram?"0":"1")}getHostOffset(i,t){const e=this.el.getBoundingClientRect();return i+7<e.left?e.left-i-7:t-7>e.right?7-(t-e.right):0}getRangeLabelOverlap(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(i);return Math.max(e.right+s-a.left,0)}isMinTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}isMaxTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}get el(){return s(this)}static get watchers(){return{histogram:["histogramWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};P.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-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-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)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}.scale--s{--calcite-slider-handle-size:10px;--calcite-slider-handle-extension-height:6.5px;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:14px;--calcite-slider-handle-extension-height:8px;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:16px;--calcite-slider-handle-extension-height:10.5px;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n )}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-6px}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-8px}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-9px}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-2px}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-23px}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-30px}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-32px}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{-webkit-margin-before:0.5em;margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{-webkit-margin-after:0.5em;margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-33px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-44px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-49px}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;-webkit-margin-before:0.875rem;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{-webkit-padding-after:calc(0.875rem + var(--calcite-slider-container-font-size));padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + 1em);padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{-webkit-padding-after:calc(var(--calcite-slider-handle-size) * 0.5 + 1em);padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{-webkit-padding-before:var(--calcite-slider-full-handle-height);padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::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 R=class{constructor(e){i(this,e),this.sketchGraphicsChange=t(this,"sketchGraphicsChange",7),this.active=!1,this.border=!1,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.graphics=[],this._translations=void 0}graphicsWatchHandler(i,t){i&&i.length>0&&JSON.stringify(i)!==JSON.stringify(t)&&this._sketchGraphicsLayer&&(this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(i))}mapViewWatchHandler(i,t){i&&i!==t&&this._init()}async clear(){this._clearSketch()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}render(){return e(a,null,e("div",{class:this.border?"border":""},e("div",{ref:i=>{this._sketchElement=i}})))}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch"]);this.GraphicsLayer=i,this.Sketch=t}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initDrawTools())}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initDrawTools(){this._sketchWidget=new this.Sketch({layer:this._sketchGraphicsLayer,view:this.mapView,container:this._sketchElement,creationMode:"single",defaultCreateOptions:{mode:"hybrid"}}),this.pointSymbol=this._sketchWidget.viewModel.pointSymbol,this.polylineSymbol=this._sketchWidget.viewModel.polylineSymbol,this.polygonSymbol=this._sketchWidget.viewModel.polygonSymbol,this._sketchWidget.visibleElements={selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1},this._sketchWidget.on("update",(i=>{"start"===i.state&&(this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)),"active"===i.state&&(clearTimeout(this._selectionTimer),this._selectionTimer=setTimeout((()=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)}),500))})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("undo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("redo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("create",(i=>{"complete"===i.state&&(this.graphics=[i.graphic],this.sketchGraphicsChange.emit(this.graphics))}))}_clearSketch(){this.graphics=[],this._sketchGraphicsLayer.removeAll()}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};R.style=":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}";const X=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.refineSelectionGraphicsChange=t(this,"refineSelectionGraphicsChange",7),this.refineSelectionIdsChange=t(this,"refineSelectionIdsChange",7),this._featuresCollection={},this.active=!1,this.border=!1,this.enabledLayerIds=[],this.graphics=void 0,this.ids=[],this.layerView=void 0,this.layerViews=[],this.mapView=void 0,this.mode=void 0,this.refineMode=void 0,this.refineSelectionSet=void 0,this.useLayerPicker=!0,this._selectEnabled=!1,this._selectionMode=void 0,this._translations=void 0}idsWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&this._highlightFeatures(i)}async reset(){this.ids=[]}async clearHighlight(){this._clearHighlight()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this.active=!1}connectedCallback(){this.active=!0,this.ids.length>0&&(this._selectEnabled=!0,this._highlightFeatures(this.ids))}render(){var i,t;const s=this.border?" border":"",n=this.refineMode===$.ALL?"div-visible":"div-not-visible";return e(a,null,e("div",null,e("map-layer-picker",{class:this.useLayerPicker?"div-visible":"div-not-visible",enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedLayerIds:this.layerViews.map((i=>i.layer.id)),selectionMode:"single"}),e("div",{class:"margin-top-1"+s},e("div",{class:"esri-sketch esri-widget"},e("div",{class:"esri-sketch__panel"},e("div",{class:"esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!this._selectEnabled,icon:"pin",onClick:()=>this._setSelectionMode(M.POINT),scale:"s",text:this._translations.select}),e("calcite-action",{disabled:!this._selectEnabled,icon:"line",onClick:()=>this._setSelectionMode(M.LINE),scale:"s",text:this._translations.selectLine}),e("calcite-action",{disabled:!this._selectEnabled,icon:"polygon",onClick:()=>this._setSelectionMode(M.POLY),scale:"s",text:this._translations.selectPolygon}),e("calcite-action",{disabled:!this._selectEnabled,icon:"rectangle",onClick:()=>this._setSelectionMode(M.RECT),scale:"s",text:this._translations.selectRectangle})),e("div",{class:n+" esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!(null===(i=this.refineSelectionSet)||void 0===i?void 0:i.undoStack)||0===this.refineSelectionSet.undoStack.length,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:!(null===(t=this.refineSelectionSet)||void 0===t?void 0:t.redoStack)||0===this.refineSelectionSet.redoStack.length,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo})))))))}_init(){this._initGraphicsLayer(),this._initSketchViewModel()}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=i,this.SketchViewModel=t}_initSketchViewModel(){this._sketchViewModel=new this.SketchViewModel({layer:this._sketchGraphicsLayer,defaultUpdateOptions:{tool:"reshape",toggleToolOnClick:!1},view:this.mapView}),this._sketchViewModel.on("create",(i=>{"complete"===i.state&&this.active&&(this._featuresCollection={},this._sketchGeometry=i.graphic.geometry,this._selectFeatures(this._sketchGeometry))}))}_clear(){this._sketchGeometry=null,this._sketchViewModel.cancel(),this._sketchGraphicsLayer.removeAll()}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initHitTest(){this._hitTestHandle&&this._hitTestHandle.remove(),this._hitTestHandle=this.mapView.on("click",(i=>{i.stopPropagation();const t={include:this.layerViews.map((i=>i.layer))};this.mapView.hitTest(i,t).then((i=>{let t=[];i.results.length>0&&(t=i.results.reduce(((i,t)=>{const e=null==t?void 0:t.graphic;return e&&i.push(e),i}),[])),this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:!1}),this._clear()}))}))}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){this._selectEnabled=!0;const t=i.detail.map((i=>I(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i}))}this._selectEnabled=!1}_setSelectionMode(i){switch(this._selectionMode=i,this._hitTestHandle&&this._hitTestHandle.remove(),this._selectionMode){case M.POINT:this._sketchViewModel.create("point");break;case M.LINE:this._sketchViewModel.create("polyline");break;case M.POLY:this._sketchViewModel.create("polygon");break;case M.RECT:this._sketchViewModel.create("rectangle")}}async _selectFeatures(i){this.selectionLoadingChange.emit(!0);const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],H(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this.selectionLoadingChange.emit(!1);let t=[];if(i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))})),this.refineMode===$.SUBSET)this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:this.layerViews[0].layer.title===this.layerView.layer.title});else{const i=Array.isArray(t)?t.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(i,this.mode,this.refineSelectionSet.undoStack,this.mode)}this._clear()}))}async _highlightFeatures(i,t=!1){this._clearHighlight(),i.length>0&&(D.highlightHandle=await L(i,this.layerViews[0],this.mapView,t))}_clearHighlight(){var i;null===(i=D.highlightHandle)||void 0===i||i.remove()}async _updateIds(i,t,e,a){const s={addIds:[],removeIds:[]};t===C.ADD?(s.addIds=i.filter((i=>this.ids.indexOf(i)<0)),this.ids=[...this.ids,...s.addIds],s.addIds.length>0&&e.push({mode:a,ids:s.addIds})):(s.removeIds=i.filter((i=>this.ids.indexOf(i)>-1)),this.ids=this.ids.filter((i=>s.removeIds.indexOf(i)<0)),s.removeIds.length>0&&e.push({mode:a,ids:s.removeIds})),await this._highlightFeatures(this.ids).then((()=>{this.refineSelectionIdsChange.emit(s)}))}_undo(){const i=this.refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===C.ADD?C.REMOVE:C.ADD,this.refineSelectionSet.redoStack,i.mode)}_redo(){const i=this.refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode,this.refineSelectionSet.undoStack,i.mode)}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{ids:["idsWatchHandler"]}}};X.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)}';export{S as buffer_tools,A as calcite_radio_group,T as calcite_radio_group_item,P as calcite_slider,R as map_draw_tools,X as refine_selection_tools}
18
+ const F="handle__label";function O(i){return Array.isArray(i)}const P=class{constructor(e){i(this,e),this.calciteSliderInput=t(this,"calciteSliderInput",6),this.calciteSliderChange=t(this,"calciteSliderChange",6),this.calciteSliderUpdate=t(this,"calciteSliderUpdate",6),this.disabled=!1,this.groupSeparator=!1,this.hasHistogram=!1,this.labelHandles=!1,this.labelTicks=!1,this.max=100,this.min=0,this.mirrored=!1,this.precise=!1,this.required=!1,this.snap=!1,this.step=1,this.value=0,this.scale="m",this.activeProp="value",this.guid=`calcite-slider-${x()}`,this.effectiveLocale="",this.minMaxValueRange=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.tickValues=[],this.dragUpdate=i=>{if(i.preventDefault(),this.dragProp){const t=this.translate(i.clientX||i.pageX);if(O(this.value)&&"minMaxValue"===this.dragProp)if(this.minValueDragRange&&this.maxValueDragRange&&this.minMaxValueRange){const i=t-this.minValueDragRange,e=t+this.maxValueDragRange;e<=this.max&&i>=this.min&&e-i===this.minMaxValueRange&&this.setValue({minValue:this.clamp(i,"minValue"),maxValue:this.clamp(e,"maxValue")})}else this.minValueDragRange=t-this.minValue,this.maxValueDragRange=this.maxValue-t,this.minMaxValueRange=this.maxValue-this.minValue;else this.setValue({[this.dragProp]:this.clamp(t,this.dragProp)})}},this.pointerUpDragEnd=i=>{c(i)&&this.dragEnd(i)},this.dragEnd=i=>{this.removeDragListeners(),this.focusActiveHandle(i.clientX),this.lastDragPropValue!=this[this.dragProp]&&this.emitChange(),this.dragProp=null,this.lastDragPropValue=null,this.minValueDragRange=null,this.maxValueDragRange=null,this.minMaxValueRange=null},this.storeTrackRef=i=>{this.trackEl=i},this.determineGroupSeparator=i=>{if("number"==typeof i)return _.numberFormatOptions={locale:this.effectiveLocale,numberingSystem:this.numberingSystem,useGrouping:this.groupSeparator},_.localize(i.toString())}}histogramWatcher(i){this.hasHistogram=!!i}valueHandler(){this.setMinMaxFromValue()}minMaxValueHandler(){this.setValueFromMinMax()}connectedCallback(){z(this),this.setMinMaxFromValue(),this.setValueFromMinMax(),u(this),p(this)}disconnectedCallback(){m(this),g(this),V(this),this.removeDragListeners()}componentWillLoad(){this.tickValues=this.generateTickValues(),O(this.value)||(this.value=this.clamp(this.value)),b(this,this.value),this.snap&&!O(this.value)&&(this.value=this.getClosestStep(this.value)),this.histogram&&(this.hasHistogram=!0)}componentDidRender(){this.labelHandles&&(this.adjustHostObscuredHandleLabel("value"),O(this.value)&&(this.adjustHostObscuredHandleLabel("minValue"),this.precise&&!this.hasHistogram||this.hyphenateCollidingRangeHandleLabels())),this.hideObscuredBoundingTickLabels(),v(this)}render(){const i=this.el.id||this.guid,t=O(this.value)?"maxValue":"value",s=O(this.value)?this.maxValue:this.value,n=this.determineGroupSeparator(s),l=this.determineGroupSeparator(this.minValue),r=this.minValue||this.min,h=this.shouldUseMinValue(),o=100*this.getUnitInterval(h?this.minValue:r),c=100*this.getUnitInterval(s),d=this.shouldMirror(),u=`${d?100-o:o}%`,m=`${d?c:100-c}%`,b=O(this.value),p=`${F} handle__label--minValue`,g=`${F} handle__label--value`,v=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"})),x=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"})),k=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),y=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle"}),e("div",{class:"handle-extension"})),w=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),_=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n),e("div",{class:"handle"}),e("div",{class:"handle-extension"})),z=e("div",{"aria-disabled":this.disabled,"aria-label":b?this.maxLabel:this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":s,class:{thumb:!0,"thumb--value":!0,"thumb--active":"minMaxValue"!==this.lastDragProp&&this.dragProp===t,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp=t,onPointerDown:i=>this.pointerDownDragStart(i,t),ref:i=>this.maxHandle=i,role:"slider",style:{right:m},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:g},n),e("span",{"aria-hidden":"true",class:`${g} static`},n),e("span",{"aria-hidden":"true",class:`${g} transformed`},n)),V=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"})),D=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l),e("div",{class:"handle"})),M=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l)),$=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"})),C=e("div",{"aria-disabled":this.disabled,"aria-label":this.minLabel,"aria-orientation":"horizontal","aria-valuemax":this.max,"aria-valuemin":this.min,"aria-valuenow":this.minValue,class:{thumb:!0,"thumb--minValue":!0,"thumb--active":"minValue"===this.dragProp,"thumb--precise":!0},onBlur:()=>this.activeProp=null,onFocus:()=>this.activeProp="minValue",onPointerDown:i=>this.pointerDownDragStart(i,"minValue"),ref:i=>this.minHandle=i,role:"slider",style:{left:u},tabIndex:0},e("div",{class:"handle-extension"}),e("div",{class:"handle"}),e("span",{"aria-hidden":"true",class:p},l),e("span",{"aria-hidden":"true",class:`${p} static`},l),e("span",{"aria-hidden":"true",class:`${p} transformed`},l));return e(a,{id:i,onTouchStart:this.handleTouchStart},e("div",{class:{container:!0,"container--range":b,[`scale--${this.scale}`]:!0}},this.renderGraph(),e("div",{class:"track",ref:this.storeTrackRef},e("div",{class:"track__range",onPointerDown:i=>this.pointerDownDragStart(i,"minMaxValue"),style:{left:`${d?100-c:o}%`,right:`${d?o:100-c}%`}}),e("div",{class:"ticks"},this.tickValues.map((i=>{const t=100*this.getUnitInterval(i)+"%";let a=i>=r&&i<=s;return h&&(a=i>=this.minValue&&i<=this.maxValue),e("span",{class:{tick:!0,"tick--active":a},style:{left:d?"":t,right:d?t:""}},this.renderTickLabel(i))})))),e("div",{class:"thumb-container"},!this.precise&&!this.labelHandles&&b&&V,!this.hasHistogram&&!this.precise&&this.labelHandles&&b&&D,this.precise&&!this.labelHandles&&b&&$,this.precise&&this.labelHandles&&b&&C,this.hasHistogram&&!this.precise&&this.labelHandles&&b&&M,!this.precise&&!this.labelHandles&&v,!this.hasHistogram&&!this.precise&&this.labelHandles&&x,!this.hasHistogram&&this.precise&&!this.labelHandles&&y,this.hasHistogram&&this.precise&&!this.labelHandles&&w,!this.hasHistogram&&this.precise&&this.labelHandles&&_,this.hasHistogram&&!this.precise&&this.labelHandles&&k,this.hasHistogram&&this.precise&&this.labelHandles&&z,e(f,{component:this}))))}renderGraph(){return this.histogram?e("calcite-graph",{class:"graph",colorStops:this.histogramStops,data:this.histogram,highlightMax:O(this.value)?this.maxValue:this.value,highlightMin:O(this.value)?this.minValue:this.min,max:this.max,min:this.min}):null}renderTickLabel(i){const t=O(this.value),a=i===this.min,s=i===this.max,n=this.determineGroupSeparator(i),l=e("span",{class:{tick__label:!0,"tick__label--min":a,"tick__label--max":s}},n);return this.labelTicks&&!this.hasHistogram&&!t||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&!this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&!this.precise&&this.labelHandles||this.labelTicks&&!this.hasHistogram&&t&&this.precise&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&!this.labelHandles||this.labelTicks&&this.hasHistogram&&this.precise&&!this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&!this.precise&&this.labelHandles&&(a||s)||this.labelTicks&&this.hasHistogram&&this.precise&&this.labelHandles&&(a||s)?l:null}keyDownHandler(i){const t=this.shouldMirror(),{activeProp:e,max:a,min:s,pageStep:n,step:l}=this,r=this[e],{key:h}=i;if(w(h))return void i.preventDefault();let o;if("ArrowUp"===h||"ArrowRight"===h?o=r+l*(t&&"ArrowRight"===h?-1:1):"ArrowDown"===h||"ArrowLeft"===h?o=r-l*(t&&"ArrowLeft"===h?-1:1):"PageUp"===h?n&&(o=r+n):"PageDown"===h?n&&(o=r-n):"Home"===h?o=s:"End"===h&&(o=a),isNaN(o))return;i.preventDefault();const c=Number(o.toFixed(k(l)));this.setValue({[e]:this.clamp(c,e)})}pointerDownHandler(i){if(!c(i))return;const t=i.clientX||i.pageX,e=this.translate(t);let a="value";O(this.value)&&(a=e>=this.minValue&&e<=this.maxValue&&"minMaxValue"===this.lastDragProp?"minMaxValue":Math.abs(this.maxValue-e)<Math.abs(this.minValue-e)||e>this.maxValue?"maxValue":"minValue"),this.lastDragPropValue=this[a],this.dragStart(a),this.el.shadowRoot.querySelector(".thumb:active")||this.setValue({[a]:this.clamp(e,a)}),this.focusActiveHandle(t)}handleTouchStart(i){i.preventDefault()}async setFocus(){const i=this.minHandle?this.minHandle:this.maxHandle;null==i||i.focus()}setValueFromMinMax(){const{minValue:i,maxValue:t}=this;"number"==typeof i&&"number"==typeof t&&(this.value=[i,t])}setMinMaxFromValue(){const{value:i}=this;O(i)&&(this.minValue=i[0],this.maxValue=i[1])}onLabelClick(){this.setFocus()}shouldMirror(){return this.mirrored&&!this.hasHistogram}shouldUseMinValue(){return!!O(this.value)&&(this.hasHistogram&&0===this.maxValue||!this.hasHistogram&&0===this.minValue)}generateTickValues(){const i=[];let t=this.min;for(;this.ticks&&t<this.max+this.ticks;)i.push(Math.min(t,this.max)),t+=this.ticks;return i}pointerDownDragStart(i,t){c(i)&&this.dragStart(t)}dragStart(i){this.dragProp=i,this.lastDragProp=this.dragProp,this.activeProp=i,document.addEventListener("pointermove",this.dragUpdate),document.addEventListener("pointerup",this.pointerUpDragEnd),document.addEventListener("pointercancel",this.dragEnd)}focusActiveHandle(i){switch(this.dragProp){case"minValue":this.minHandle.focus();break;case"maxValue":case"value":this.maxHandle.focus();break;case"minMaxValue":this.getClosestHandle(i).focus()}}emitInput(){this.calciteSliderInput.emit(),this.calciteSliderUpdate.emit()}emitChange(){this.calciteSliderChange.emit()}removeDragListeners(){document.removeEventListener("pointermove",this.dragUpdate),document.removeEventListener("pointerup",this.pointerUpDragEnd),document.removeEventListener("pointercancel",this.dragEnd)}setValue(i){let t;Object.keys(i).forEach((e=>{const a=i[e];t||(t=this[e]!==a),this[e]=a})),t&&(this.dragProp||this.emitChange(),this.emitInput())}clamp(i,t){return i=y(i,this.min,this.max),"maxValue"===t&&(i=Math.max(i,this.minValue)),"minValue"===t&&(i=Math.min(i,this.maxValue)),i}translate(i){const t=this.max-this.min,{left:e,width:a}=this.trackEl.getBoundingClientRect(),s=(i-e)/a,n=this.shouldMirror(),l=this.clamp(this.min+t*(n?1-s:s));let r=Number(l.toFixed(k(this.step)));return this.snap&&this.step&&(r=this.getClosestStep(r)),r}getClosestStep(i){if(i=Number(this.clamp(i).toFixed(k(this.step))),this.step){const t=Math.round(i/this.step)*this.step;i=Number(this.clamp(t).toFixed(k(this.step)))}return i}getClosestHandle(i){return this.getDistanceX(this.maxHandle,i)>this.getDistanceX(this.minHandle,i)?this.minHandle:this.maxHandle}getDistanceX(i,t){return Math.abs(i.getBoundingClientRect().left-t)}getFontSizeForElement(i){return Number(window.getComputedStyle(i).getPropertyValue("font-size").match(/\d+/)[0])}getUnitInterval(i){return((i=this.clamp(i))-this.min)/(this.max-this.min)}adjustHostObscuredHandleLabel(i){const t=this.el.shadowRoot.querySelector(`.handle__label--${i}`),e=this.el.shadowRoot.querySelector(`.handle__label--${i}.static`),a=this.el.shadowRoot.querySelector(`.handle__label--${i}.transformed`),s=e.getBoundingClientRect(),n=this.getHostOffset(s.left,s.right);t.style.transform=`translateX(${n}px)`,a.style.transform=`translateX(${n}px)`}hyphenateCollidingRangeHandleLabels(){const{shadowRoot:i}=this.el,t=this.shouldMirror(),e=t?"value":"minValue",a=t?"minValue":"value",s=i.querySelector(`.handle__label--${e}`),n=i.querySelector(`.handle__label--${e}.static`),l=i.querySelector(`.handle__label--${e}.transformed`),r=this.getHostOffset(n.getBoundingClientRect().left,n.getBoundingClientRect().right),h=i.querySelector(`.handle__label--${a}`),o=i.querySelector(`.handle__label--${a}.static`),c=i.querySelector(`.handle__label--${a}.transformed`),d=this.getHostOffset(o.getBoundingClientRect().left,o.getBoundingClientRect().right),u=this.getFontSizeForElement(s),m=this.getRangeLabelOverlap(l,c),b=s,p=u/2;if(m>0){if(b.classList.add("hyphen","hyphen--wrap"),0===d&&0===r){let i=m/2-p;i=-1===Math.sign(i)?Math.abs(i):-i;const t=this.getHostOffset(l.getBoundingClientRect().left+i-p,l.getBoundingClientRect().right+i-p);let e=m/2;const a=this.getHostOffset(c.getBoundingClientRect().left+e,c.getBoundingClientRect().right+e);0!==t&&(i+=t,e+=t),0!==a&&(i+=a,e+=a),s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`,h.style.transform=`translateX(${e}px)`,c.style.transform=`translateX(${e}px)`}else if(r>0||d>0)s.style.transform=`translateX(${r+p}px)`,h.style.transform=`translateX(${m+d}px)`,c.style.transform=`translateX(${m+d}px)`;else if(r<0||d<0){let i=Math.abs(r)+m-p;i=-1===Math.sign(i)?Math.abs(i):-i,s.style.transform=`translateX(${i}px)`,l.style.transform=`translateX(${i-p}px)`}}else b.classList.remove("hyphen","hyphen--wrap"),s.style.transform=`translateX(${r}px)`,l.style.transform=`translateX(${r}px)`,h.style.transform=`translateX(${d}px)`,c.style.transform=`translateX(${d}px)`}hideObscuredBoundingTickLabels(){const i=O(this.value);if(!(this.hasHistogram||i||this.labelHandles||this.precise))return;if(!this.hasHistogram&&!i&&this.labelHandles&&!this.precise)return;if(!this.hasHistogram&&!i&&!this.labelHandles&&this.precise)return;if(!this.hasHistogram&&!i&&this.labelHandles&&this.precise)return;if(!this.hasHistogram&&i&&!this.precise)return;if(this.hasHistogram&&!this.precise&&!this.labelHandles)return;const t=this.el.shadowRoot.querySelector(".thumb--minValue"),e=this.el.shadowRoot.querySelector(".thumb--value"),a=this.el.shadowRoot.querySelector(".tick__label--min"),s=this.el.shadowRoot.querySelector(".tick__label--max");!t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,e)?"0":"1"),t&&e&&a&&s&&(a.style.opacity=this.isMinTickLabelObscured(a,t)||this.isMinTickLabelObscured(a,e)?"0":"1",s.style.opacity=this.isMaxTickLabelObscured(s,t)||this.isMaxTickLabelObscured(s,e)&&this.hasHistogram?"0":"1")}getHostOffset(i,t){const e=this.el.getBoundingClientRect();return i+7<e.left?e.left-i-7:t-7>e.right?7-(t-e.right):0}getRangeLabelOverlap(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect(),s=this.getFontSizeForElement(i);return Math.max(e.right+s-a.left,0)}isMinTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}isMaxTickLabelObscured(i,t){const e=i.getBoundingClientRect(),a=t.getBoundingClientRect();return d(e,a)}get el(){return s(this)}static get watchers(){return{histogram:["histogramWatcher"],value:["valueHandler"],minValue:["minMaxValueHandler"],maxValue:["minMaxValueHandler"]}}};P.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-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-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)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}.scale--s{--calcite-slider-handle-size:10px;--calcite-slider-handle-extension-height:6.5px;--calcite-slider-container-font-size:var(--calcite-font-size--3)}.scale--s .handle__label,.scale--s .tick__label{line-height:.75rem}.scale--m{--calcite-slider-handle-size:14px;--calcite-slider-handle-extension-height:8px;--calcite-slider-container-font-size:var(--calcite-font-size--2)}.scale--m .handle__label,.scale--m .tick__label{line-height:1rem}.scale--l{--calcite-slider-handle-size:16px;--calcite-slider-handle-extension-height:10.5px;--calcite-slider-container-font-size:var(--calcite-font-size--1)}.scale--l .handle__label,.scale--l .tick__label{line-height:1rem}.handle__label,.tick__label{font-weight:var(--calcite-font-weight-medium);color:var(--calcite-ui-text-2);font-size:var(--calcite-slider-container-font-size)}:host{display:block}.container{position:relative;display:block;overflow-wrap:normal;word-break:normal;padding-inline:calc(var(--calcite-slider-handle-size) * 0.5);padding-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-block:calc(var(--calcite-slider-handle-size) * 0.5);margin-inline:0;--calcite-slider-full-handle-height:calc(\n var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height)\n )}:host([disabled]) .track__range,:host([disabled]) .tick--active{background-color:var(--calcite-ui-text-3)}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}.scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-6px}.scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-8px}.scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-9px}:host([precise]:not([has-histogram])) .container .thumb--value{--calcite-slider-thumb-y-offset:calc(var(--calcite-slider-full-handle-height) * -1)}.thumb-container{position:relative;max-inline-size:100%}.thumb{--calcite-slider-thumb-x-offset:calc(var(--calcite-slider-handle-size) * 0.5);position:absolute;margin:0px;display:flex;cursor:pointer;flex-direction:column;align-items:center;border-style:none;background-color:transparent;padding:0px;font-family:inherit;outline:2px solid transparent;outline-offset:2px;transform:translate(var(--calcite-slider-thumb-x-offset), var(--calcite-slider-thumb-y-offset))}.thumb .handle__label.static,.thumb .handle__label.transformed{position:absolute;inset-block:0px;opacity:0}.thumb .handle__label.hyphen::after{content:"—";display:inline-block;inline-size:1em}.thumb .handle__label.hyphen--wrap{display:flex}.thumb .handle{box-sizing:border-box;border-radius:9999px;background-color:var(--calcite-ui-foreground-1);outline-color:transparent;block-size:var(--calcite-slider-handle-size);inline-size:var(--calcite-slider-handle-size);box-shadow:0 0 0 2px var(--calcite-ui-text-3) inset;transition:border var(--calcite-internal-animation-timing-medium) ease, background-color var(--calcite-internal-animation-timing-medium) ease, box-shadow var(--calcite-animation-timing) ease}.thumb .handle-extension{inline-size:0.125rem;block-size:var(--calcite-slider-handle-extension-height);background-color:var(--calcite-ui-text-3)}.thumb:hover .handle{box-shadow:0 0 0 3px var(--calcite-ui-brand) inset}.thumb:hover .handle-extension{background-color:var(--calcite-ui-brand)}.thumb:focus .handle{outline:2px solid var(--calcite-ui-brand);outline-offset:2px}.thumb:focus .handle-extension{background-color:var(--calcite-ui-brand)}.thumb.thumb--minValue{transform:translate(calc(var(--calcite-slider-thumb-x-offset) * -1), var(--calcite-slider-thumb-y-offset))}.thumb.thumb--precise{--calcite-slider-thumb-y-offset:-2px}:host([label-handles]) .thumb{--calcite-slider-thumb-x-offset:50%}:host([label-handles]):host(:not([has-histogram])) .scale--s .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-23px}:host([label-handles]):host(:not([has-histogram])) .scale--m .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-30px}:host([label-handles]):host(:not([has-histogram])) .scale--l .thumb:not(.thumb--precise){--calcite-slider-thumb-y-offset:-32px}:host([has-histogram][label-handles]) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--minValue.thumb--precise .handle__label{-webkit-margin-before:0.5em;margin-block-start:0.5em}:host(:not([has-histogram]):not([precise])) .handle__label,:host([label-handles]:not([has-histogram])) .thumb--value .handle__label{-webkit-margin-after:0.5em;margin-block-end:0.5em}:host([label-handles][precise]):host(:not([has-histogram])) .scale--s .thumb--value{--calcite-slider-thumb-y-offset:-33px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--m .thumb--value{--calcite-slider-thumb-y-offset:-44px}:host([label-handles][precise]):host(:not([has-histogram])) .scale--l .thumb--value{--calcite-slider-thumb-y-offset:-49px}.thumb:focus .handle,.thumb--active .handle{background-color:var(--calcite-ui-brand);box-shadow:0 0 8px 0 rgba(0, 0, 0, 0.16)}.thumb:hover.thumb--precise:after,.thumb:focus.thumb--precise:after,.thumb--active.thumb--precise:after{background-color:var(--calcite-ui-brand)}.track{position:relative;block-size:0.125rem;border-radius:0px;background-color:var(--calcite-ui-border-2);transition:all var(--calcite-internal-animation-timing-medium) ease-in}.track__range{position:absolute;inset-block-start:0px;block-size:0.125rem;background-color:var(--calcite-ui-brand)}.container--range .track__range:hover{cursor:ew-resize}.container--range .track__range:after{position:absolute;inline-size:100%;content:"";inset-block-start:calc(var(--calcite-slider-full-handle-height) * 0.5 * -1);block-size:calc(var(--calcite-slider-handle-size) + var(--calcite-slider-handle-extension-height))}@media (forced-colors: active){.thumb{outline-width:0;outline-offset:0}.handle{outline:2px solid transparent;outline-offset:2px}.thumb:focus .handle,.thumb .handle-extension,.thumb:hover .handle-extension,.thumb:focus .handle-extension,.thumb:active .handle-extension{background-color:canvasText}.track{background-color:canvasText}.track__range{background-color:highlight}}.tick{position:absolute;block-size:0.25rem;inline-size:0.125rem;border-width:1px;border-style:solid;background-color:var(--calcite-ui-border-input);border-color:var(--calcite-ui-foreground-1);inset-block-start:-2px;pointer-events:none;-webkit-margin-start:calc(-1 * 0.125rem);margin-inline-start:calc(-1 * 0.125rem)}.tick--active{background-color:var(--calcite-ui-brand)}.tick__label{pointer-events:none;-webkit-margin-before:0.875rem;margin-block-start:0.875rem;display:flex;justify-content:center}.tick__label--min{transition:opacity var(--calcite-animation-timing)}.tick__label--max{transition:opacity var(--calcite-internal-animation-timing-fast)}:host([has-histogram][label-handles]) .tick__label--min,:host([has-histogram][label-handles]) .tick__label--max,:host([has-histogram][precise]) .tick__label--min,:host([has-histogram][precise]) .tick__label--max{font-weight:var(--calcite-font-weight-normal);color:var(--calcite-ui-text-3)}.graph{color:var(--calcite-ui-foreground-3);block-size:48px}:host([label-ticks][ticks]) .container{-webkit-padding-after:calc(0.875rem + var(--calcite-slider-container-font-size));padding-block-end:calc(0.875rem + var(--calcite-slider-container-font-size))}:host([has-histogram]):host([precise][label-handles]) .container{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + 1em);padding-block-end:calc(var(--calcite-slider-full-handle-height) + 1em)}:host([has-histogram]):host([label-handles]:not([precise])) .container{-webkit-padding-after:calc(var(--calcite-slider-handle-size) * 0.5 + 1em);padding-block-end:calc(var(--calcite-slider-handle-size) * 0.5 + 1em)}:host([has-histogram]):host([precise]:not([label-handles])) .container{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container{-webkit-padding-before:var(--calcite-slider-full-handle-height);padding-block-start:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([precise]:not([label-handles])) .container--range{-webkit-padding-after:var(--calcite-slider-full-handle-height);padding-block-end:var(--calcite-slider-full-handle-height)}:host(:not([has-histogram])):host([label-handles]:not([precise])) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container{-webkit-padding-before:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-start:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}:host(:not([has-histogram])):host([label-handles][precise]) .container--range{-webkit-padding-after:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px);padding-block-end:calc(var(--calcite-slider-full-handle-height) + var(--calcite-slider-container-font-size) + 4px)}::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 R=class{constructor(e){i(this,e),this.sketchGraphicsChange=t(this,"sketchGraphicsChange",7),this.active=!1,this.border=!1,this.mapView=void 0,this.pointSymbol=void 0,this.polylineSymbol=void 0,this.polygonSymbol=void 0,this.graphics=[],this._translations=void 0}graphicsWatchHandler(i,t){i&&i.length>0&&JSON.stringify(i)!==JSON.stringify(t)&&this._sketchGraphicsLayer&&(this._sketchGraphicsLayer.removeAll(),this._sketchGraphicsLayer.addMany(i))}mapViewWatchHandler(i,t){i&&i!==t&&this._init()}async clear(){this._clearSketch()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}render(){return e(a,null,e("div",{class:this.border?"border":""},e("div",{ref:i=>{this._sketchElement=i}})))}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch"]);this.GraphicsLayer=i,this.Sketch=t}_init(){this.mapView&&this._sketchElement&&(this._initGraphicsLayer(),this._initDrawTools())}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initDrawTools(){this._sketchWidget=new this.Sketch({layer:this._sketchGraphicsLayer,view:this.mapView,container:this._sketchElement,creationMode:"single",defaultCreateOptions:{mode:"hybrid"}}),this.pointSymbol=this._sketchWidget.viewModel.pointSymbol,this.polylineSymbol=this._sketchWidget.viewModel.polylineSymbol,this.polygonSymbol=this._sketchWidget.viewModel.polygonSymbol,this._sketchWidget.visibleElements={selectionTools:{"lasso-selection":!1,"rectangle-selection":!1},createTools:{circle:!1},undoRedoMenu:!1},this._sketchWidget.on("update",(i=>{"start"===i.state&&(this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)),"active"===i.state&&(clearTimeout(this._selectionTimer),this._selectionTimer=setTimeout((()=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)}),500))})),this._sketchWidget.on("delete",(()=>{this.graphics=[],this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("undo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("redo",(i=>{this.graphics=i.graphics,this.sketchGraphicsChange.emit(this.graphics)})),this._sketchWidget.on("create",(i=>{"complete"===i.state&&(this.graphics=[i.graphic],this.sketchGraphicsChange.emit(this.graphics))}))}_clearSketch(){var i;this.graphics=[],null===(i=this._sketchGraphicsLayer)||void 0===i||i.removeAll()}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{graphics:["graphicsWatchHandler"],mapView:["mapViewWatchHandler"]}}};R.style=":host{display:block}.border{outline:1px solid var(--calcite-ui-border-input)}";const X=class{constructor(e){i(this,e),this.selectionLoadingChange=t(this,"selectionLoadingChange",7),this.refineSelectionGraphicsChange=t(this,"refineSelectionGraphicsChange",7),this.refineSelectionIdsChange=t(this,"refineSelectionIdsChange",7),this._featuresCollection={},this.active=!1,this.border=!1,this.enabledLayerIds=[],this.graphics=void 0,this.ids=[],this.layerView=void 0,this.layerViews=[],this.mapView=void 0,this.mode=void 0,this.refineMode=void 0,this.refineSelectionSet=void 0,this.useLayerPicker=!0,this._selectEnabled=!1,this._selectionMode=void 0,this._translations=void 0}idsWatchHandler(i,t){i&&JSON.stringify(i)!==JSON.stringify(t)&&this._highlightFeatures(i)}async reset(){this.ids=[]}async clearHighlight(){this._clearHighlight()}async componentWillLoad(){await this._getTranslations(),await this._initModules()}componentDidLoad(){this._init()}disconnectedCallback(){this.active=!1}connectedCallback(){this.active=!0,this.ids.length>0&&(this._selectEnabled=!0,this._highlightFeatures(this.ids))}render(){var i,t;const s=this.border?" border":"",n=this.refineMode===$.ALL?"div-visible":"div-not-visible";return e(a,null,e("div",null,e("map-layer-picker",{class:this.useLayerPicker?"div-visible":"div-not-visible",enabledLayerIds:this.enabledLayerIds,mapView:this.mapView,onLayerSelectionChange:i=>{this._layerSelectionChange(i)},selectedLayerIds:this.layerViews.map((i=>i.layer.id)),selectionMode:"single"}),e("div",{class:"margin-top-1"+s},e("div",{class:"esri-sketch esri-widget"},e("div",{class:"esri-sketch__panel"},e("div",{class:"esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!this._selectEnabled,icon:"pin",onClick:()=>this._setSelectionMode(M.POINT),scale:"s",text:this._translations.select}),e("calcite-action",{disabled:!this._selectEnabled,icon:"line",onClick:()=>this._setSelectionMode(M.LINE),scale:"s",text:this._translations.selectLine}),e("calcite-action",{disabled:!this._selectEnabled,icon:"polygon",onClick:()=>this._setSelectionMode(M.POLY),scale:"s",text:this._translations.selectPolygon}),e("calcite-action",{disabled:!this._selectEnabled,icon:"rectangle",onClick:()=>this._setSelectionMode(M.RECT),scale:"s",text:this._translations.selectRectangle})),e("div",{class:n+" esri-sketch__tool-section esri-sketch__section"},e("calcite-action",{disabled:!(null===(i=this.refineSelectionSet)||void 0===i?void 0:i.undoStack)||0===this.refineSelectionSet.undoStack.length,icon:"undo",onClick:()=>this._undo(),scale:"s",text:this._translations.undo}),e("calcite-action",{disabled:!(null===(t=this.refineSelectionSet)||void 0===t?void 0:t.redoStack)||0===this.refineSelectionSet.redoStack.length,icon:"redo",onClick:()=>this._redo(),scale:"s",text:this._translations.redo})))))))}_init(){this._initGraphicsLayer(),this._initSketchViewModel()}async _initModules(){const[i,t]=await n(["esri/layers/GraphicsLayer","esri/widgets/Sketch/SketchViewModel"]);this.GraphicsLayer=i,this.SketchViewModel=t}_initSketchViewModel(){this._sketchViewModel=new this.SketchViewModel({layer:this._sketchGraphicsLayer,defaultUpdateOptions:{tool:"reshape",toggleToolOnClick:!1},view:this.mapView}),this._sketchViewModel.on("create",(i=>{"complete"===i.state&&this.active&&(this._featuresCollection={},this._sketchGeometry=i.graphic.geometry,this._selectFeatures(this._sketchGeometry))}))}_clear(){this._sketchGeometry=null,this._sketchViewModel.cancel(),this._sketchGraphicsLayer.removeAll()}_initGraphicsLayer(){const i=this._translations.sketchLayer,t=this.mapView.map.layers.findIndex((t=>t.title===i));t>-1?this._sketchGraphicsLayer=this.mapView.map.layers.getItemAt(t):(this._sketchGraphicsLayer=new this.GraphicsLayer({title:i}),D.managedLayers.push(i),this.mapView.map.layers.add(this._sketchGraphicsLayer)),this.graphics&&this.graphics.length>0&&this._sketchGraphicsLayer.addMany(this.graphics)}_initHitTest(){this._hitTestHandle&&this._hitTestHandle.remove(),this._hitTestHandle=this.mapView.on("click",(i=>{i.stopPropagation();const t={include:this.layerViews.map((i=>i.layer))};this.mapView.hitTest(i,t).then((i=>{let t=[];i.results.length>0&&(t=i.results.reduce(((i,t)=>{const e=null==t?void 0:t.graphic;return e&&i.push(e),i}),[])),this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:!1}),this._clear()}))}))}async _layerSelectionChange(i){if(Array.isArray(i.detail)&&i.detail.length>0){this._selectEnabled=!0;const t=i.detail.map((i=>I(this.mapView,i)));return Promise.all(t).then((i=>{this.layerViews=i}))}this._selectEnabled=!1}_setSelectionMode(i){switch(this._selectionMode=i,this._hitTestHandle&&this._hitTestHandle.remove(),this._selectionMode){case M.POINT:this._sketchViewModel.create("point");break;case M.LINE:this._sketchViewModel.create("polyline");break;case M.POLY:this._sketchViewModel.create("polygon");break;case M.RECT:this._sketchViewModel.create("rectangle")}}async _selectFeatures(i){this.selectionLoadingChange.emit(!0);const t=this.layerViews.map((t=>(this._featuresCollection[t.layer.id]=[],H(0,t.layer,i,this._featuresCollection))));return Promise.all(t).then((async i=>{this.selectionLoadingChange.emit(!1);let t=[];if(i.forEach((i=>{Object.keys(i).forEach((e=>{t=t.concat(i[e])}))})),this.refineMode===$.SUBSET)this.refineSelectionGraphicsChange.emit({graphics:t,useOIDs:this.layerViews[0].layer.title===this.layerView.layer.title});else{const i=Array.isArray(t)?t.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(i,this.mode,this.refineSelectionSet.undoStack,this.mode)}this._clear()}))}async _highlightFeatures(i,t=!1){this._clearHighlight(),i.length>0&&(D.highlightHandle=await L(i,this.layerViews[0],this.mapView,t))}_clearHighlight(){var i;null===(i=D.highlightHandle)||void 0===i||i.remove()}async _updateIds(i,t,e,a){const s={addIds:[],removeIds:[]};t===C.ADD?(s.addIds=i.filter((i=>this.ids.indexOf(i)<0)),this.ids=[...this.ids,...s.addIds],s.addIds.length>0&&e.push({mode:a,ids:s.addIds})):(s.removeIds=i.filter((i=>this.ids.indexOf(i)>-1)),this.ids=this.ids.filter((i=>s.removeIds.indexOf(i)<0)),s.removeIds.length>0&&e.push({mode:a,ids:s.removeIds})),await this._highlightFeatures(this.ids).then((()=>{this.refineSelectionIdsChange.emit(s)}))}_undo(){const i=this.refineSelectionSet.undoStack.pop();this._updateIds(i.ids,i.mode===C.ADD?C.REMOVE:C.ADD,this.refineSelectionSet.redoStack,i.mode)}_redo(){const i=this.refineSelectionSet.redoStack.pop();this._updateIds(i.ids,i.mode,this.refineSelectionSet.undoStack,i.mode)}async _getTranslations(){const i=await l(this.el);this._translations=i[0]}get el(){return s(this)}static get watchers(){return{ids:["idsWatchHandler"]}}};X.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)}';export{S as buffer_tools,A as calcite_radio_group,T as calcite_radio_group_item,P as calcite_slider,R as map_draw_tools,X as refine_selection_tools}
@@ -1,12 +1,12 @@
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-c2f00d41.js";import{f as n}from"./p-d48a24e6.js";import{d as o,f as c,c as l,u as r,r as h,a as d,F as m}from"./p-a9cefd9c.js";import{g as p}from"./p-a80b3880.js";import{T as u,C as b,b as g,c as f,h as v,d as x,e as y,g as w,a as k}from"./p-a5b1ab03.js";import{c as C,d as z,g as I}from"./p-bd67334c.js";import{s as $,c as H,a as _,d as D,H as j}from"./p-a33d73bb.js";import{c as L}from"./p-9a9955db.js";import{u as A}from"./p-7daea1df.js";import{i as E,t as S,g as P,a as F}from"./p-83166522.js";import{c as T,d as B}from"./p-2e9ed892.js";import{d as M}from"./p-4e32bf8c.js";import{c as O,d as R}from"./p-1c247f54.js";import{i as W,j as U}from"./p-88e28de2.js";import{s as V}from"./p-4557d5a8.js";import"./p-729708a3.js";import"./p-dbc9a5a8.js";import"./p-00444009.js";const X="combobox-item-",Y="combobox-chip-",G="combobox-label-",K="combobox-listbox-",N="combobox-input-",q=class{constructor(e){i(this,e),this.calciteLookupChange=t(this,"calciteLookupChange",6),this.calciteComboboxChange=t(this,"calciteComboboxChange",6),this.calciteComboboxFilterChange=t(this,"calciteComboboxFilterChange",6),this.calciteComboboxChipDismiss=t(this,"calciteComboboxChipDismiss",6),this.calciteComboboxBeforeClose=t(this,"calciteComboboxBeforeClose",6),this.calciteComboboxClose=t(this,"calciteComboboxClose",6),this.calciteComboboxBeforeOpen=t(this,"calciteComboboxBeforeOpen",6),this.calciteComboboxOpen=t(this,"calciteComboboxOpen",6),this.active=!1,this.open=!1,this.disabled=!1,this.maxItems=0,this.overlayPositioning="absolute",this.required=!1,this.selectionMode="multi",this.scale="m",this.value=null,this.intlRemoveTag=u.removeTag,this.placement=o,this.internalValueChangeFlag=!1,this.items=[],this.groupItems=[],this.selectedItems=[],this.visibleItems=[],this.activeItemIndex=-1,this.activeChipIndex=-1,this.activeDescendant="",this.text="",this.textInput=null,this.mutationObserver=L("mutation",(()=>this.updateItems())),this.resizeObserver=L("resize",(()=>this.setMaxScrollerHeight())),this.guid=p(),this.inputHeight=0,this.ignoreSelectedEventsFlag=!1,this.openTransitionProp="opacity",this.setFilteredPlacements=()=>{const{el:i,flipPlacements:t}=this;this.filteredFlipPlacements=t?c(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.shiftActiveItemIndex(-1),this.comboboxInViewport()||this.el.scrollIntoView();break;case"ArrowDown":i.preventDefault(),this.open||(this.open=!0),this.shiftActiveItemIndex(1),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.visibleItems.length-1),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":this.open=!1,i.preventDefault();break;case"Enter":this.activeItemIndex>-1?(this.toggleSelection(this.visibleItems[this.activeItemIndex]),i.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(),i.preventDefault()):this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):i.defaultPrevented||$(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 s=this.getMaxScrollerHeight();i.style.maxHeight=s>0?`${s}px`:"",i.style.minWidth=`${e.clientWidth}px`,await this.reposition(!0)},this.calciteChipDismissHandler=(i,t)=>{this.open=!1;const e=this.items.find((i=>i===t));e&&this.toggleSelection(e,!1),this.calciteComboboxChipDismiss.emit(i.detail)},this.clickHandler=i=>{i.composedPath().some((i=>"CALCITE-CHIP"===i.tagName))||(this.open=!this.open,this.updateActiveItemIndex(0),this.setFocus())},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,l(this,this.referenceEl,this.floatingEl)},this.setContainerEl=i=>{this.resizeObserver.observe(i),this.listContainerEl=i,this.transitionEl=i,T(this)},this.setReferenceEl=i=>{this.referenceEl=i,l(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===y?e===i.label:e===i.textLabel||e===i.value||t===i.textLabel||t===i.value));return M((t=>{const e=n(this.data,t);this.getCombinedItems().forEach((t=>{const s=!i(t,e);t.hidden=s;const[a,n]=t.ancestors;(i(a,e)||i(n,e))&&(t.hidden=!1),s||t.ancestors.forEach((i=>i.hidden=!1))})),this.visibleItems=this.getVisibleItems(),this.calciteComboboxFilterChange.emit({visibleItems:[...this.visibleItems],text:t})}),100)})(),this.internalCalciteLookupChangeEvent=()=>{this.calciteLookupChange.emit(this.selectedItems)},this.emitCalciteLookupChange=M(this.internalCalciteLookupChangeEvent,0),this.internalComboboxChangeEvent=()=>{const{selectedItems:i}=this;this.calciteComboboxChange.emit({selectedItems:i})},this.emitComboboxChange=M(this.internalComboboxChangeEvent,0),this.updateItems=()=>{this.items=this.getItems(),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.selectedItems=this.getSelectedItems(),this.visibleItems=this.getVisibleItems(),this.needsIcon=this.getNeedsIcon(),this.allowCustomValues||this.setMaxScrollerHeight()},this.scrollToActiveItem=()=>{const i=this.visibleItems[this.activeItemIndex],t=this.calculateSingleItemHeight(i),{offsetHeight:e,scrollTop:s}=this.listContainerEl;e+s<i.offsetTop+t?this.listContainerEl.scrollTop=i.offsetTop-e+t:i.offsetTop<s&&(this.listContainerEl.scrollTop=i.offsetTop)},this.comboboxFocusHandler=()=>{var i;null===(i=this.textInput)||void 0===i||i.focus()},this.comboboxBlurHandler=i=>{this.setInactiveIfNotContained(i)}}activeHandler(i){if(this.disabled)return this.active=!1,void(this.open=!1);this.open=i}openHandler(i){if(i||r(this.floatingEl),this.disabled)return this.active=!1,void(this.open=!1);this.active=i,this.setMaxScrollerHeight()}handleDisabledChange(i){i||(this.active=!1,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()}}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}documentClickHandler(i){E(i)&&this.setInactiveIfNotContained(i)}calciteComboboxItemChangeHandler(i){if(this.ignoreSelectedEventsFlag)return;const t=i.target,e=this.visibleItems.indexOf(t);this.updateActiveItemIndex(e),this.toggleSelection(t,t.selected)}async reposition(i=!1){const{floatingEl:t,referenceEl:e,placement:s,overlayPositioning:a,filteredFlipPlacements:n}=this;return h(this,{floatingEl:t,referenceEl:e,overlayPositioning:a,placement:s,flipPlacements:n,type:"menu"},i)}async setFocus(){var i;null===(i=this.textInput)||void 0===i||i.focus(),this.activeChipIndex=-1,this.activeItemIndex=-1}connectedCallback(){var i;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}),C(this),H(this),T(this),this.setFilteredPlacements(),this.reposition(!0),this.active&&this.activeHandler(this.active),this.open&&this.openHandler(this.open)}componentWillLoad(){this.updateItems()}componentDidLoad(){_(this,this.getValue()),this.reposition(!0)}componentDidRender(){this.el.offsetHeight!==this.inputHeight&&(this.reposition(!0),this.inputHeight=this.el.offsetHeight),A(this)}disconnectedCallback(){var i,t;null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),z(this),D(this),d(this,this.referenceEl,this.floatingEl),B(this)}selectedItemsHandler(){this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1}textHandler(){this.updateActiveItemIndex(-1)}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.calciteComboboxBeforeOpen.emit()}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit()}getMaxScrollerHeight(){const i=this.getCombinedItems().filter((i=>!i.hidden)),{maxItems:t}=this;let e=0,s=0;return i.length>t&&i.forEach((i=>{if(e<t&&t>0){const t=this.calculateSingleItemHeight(i);t>0&&(s+=t,e++)}})),s}calculateSingleItemHeight(i){let t=i.offsetHeight;return Array.from(i.querySelectorAll(b)).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.emitCalciteLookupChange(),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=g(i),e=f(i);i.selected?t.forEach((i=>{i.selected=!0})):(e.forEach((i=>i.selected=!1)),[...t].forEach((i=>{v(i)||(i.selected=!1)})))}getVisibleItems(){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||!v(i)))).sort(((i,t)=>{const e=this.selectedItems.indexOf(i),s=this.selectedItems.indexOf(t);return e>-1&&s>-1?e-s:s-e}))}getData(){return this.items.map((i=>({constant:i.constant,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(x)).filter((i=>!i.disabled))}getGroupItems(){return Array.from(this.el.querySelectorAll(y))}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(x);e.value=i,e.textLabel=i,e.selected=!0,this.el.appendChild(e),this.resetText(),t&&this.setFocus(),this.updateItems(),this.filterItems(""),this.emitCalciteLookupChange(),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(`#${Y}${t}`):null;null==e||e.setFocus()}shiftActiveItemIndex(i){const{length:t}=this.visibleItems;this.updateActiveItemIndex((this.activeItemIndex+t+i)%t),this.scrollToActiveItem()}updateActiveItemIndex(i){var t;this.activeItemIndex=i;let e=null;this.visibleItems.forEach(((t,s)=>{s===i?(t.active=!0,e=`${X}${t.guid}`):t.active=!1})),this.activeDescendant=e,this.activeItemIndex>-1&&(this.activeChipIndex=-1,null===(t=this.textInput)||void 0===t||t.focus())}isMulti(){return"single"!==this.selectionMode}renderChips(){const{activeChipIndex:i,scale:t,selectionMode:s,intlRemoveTag:a}=this;return this.selectedItems.map(((n,o)=>{const c={chip:!0,"chip--active":i===o},l=[...[...g(n)].reverse(),n].map((i=>i.textLabel)),r="ancestors"!==s?n.textLabel:l.join(" / ");return e("calcite-chip",{class:c,dismissLabel:a,dismissible:!0,icon:n.icon,id:n.guid?`${Y}${n.guid}`:null,key:n.textLabel,onCalciteChipDismiss:i=>this.calciteChipDismissHandler(i,n),scale:t,title:r,value:n.value},r)}))}renderInput(){const{guid:i,active:t,disabled:s,placeholder:a,selectionMode:n,selectedItems:o,open:c}=this,l="single"===n,r=o[0],h=!(c||t)&&l&&!!r;return e("span",{class:{"input-wrap":!0,"input-wrap--single":l}},h&&e("span",{class:{label:!0,"label--icon":!!(null==r?void 0:r.icon)},key:"label"},r.textLabel),e("input",{"aria-activedescendant":this.activeDescendant,"aria-autocomplete":"list","aria-controls":`${K}${i}`,"aria-label":I(this),class:{input:!0,"input--single":!0,"input--transparent":this.activeChipIndex>-1,"input--hidden":h,"input--icon":!!this.placeholderIcon},disabled:s,id:`${N}${i}`,key:"input",onBlur:this.comboboxBlurHandler,onFocus:this.comboboxFocusHandler,onInput:this.inputHandler,placeholder:a,ref:i=>this.textInput=i,type:"text"}))}renderListBoxOptions(){return this.visibleItems.map((i=>e("li",{"aria-selected":S(i.selected),id:i.guid?`${X}${i.guid}`:null,role:"option",tabindex:"-1"},i.textLabel)))}renderFloatingUIContainer(){const{active:i,setFloatingEl:t,setContainerEl:s,open:a}=this;return e("div",{"aria-hidden":"true",class:{"floating-ui-container":!0,"floating-ui-container--active":a||i},ref:t},e("div",{class:{"list-container":!0,[m.animation]:!0,[m.animationActive]:a||i},ref:s},e("ul",{class:{list:!0,"list--hide":!(a||i)}},e("slot",null))))}renderIconStart(){const{selectedItems:i,placeholderIcon:t,selectionMode:s}=this,a=i[0],n=null==a?void 0:a.icon,o="single"===s;return(!this.open&&a?!!n&&o:!!this.placeholderIcon&&(!a||o))&&e("span",{class:"icon-start"},e("calcite-icon",{class:"selected-icon",icon:!this.open&&a?n:t,scale:"s"}))}renderIconEnd(){const{active:i,open:t}=this;return e("span",{class:"icon-end"},e("calcite-icon",{icon:i||t?"chevron-up":"chevron-down",scale:"s"}))}render(){const{active:i,guid:t,label:a,open:n}=this,o="single"===this.selectionMode;return e(s,null,e("div",{"aria-autocomplete":"list","aria-controls":`${K}${t}`,"aria-expanded":S(n||i),"aria-haspopup":"listbox","aria-labelledby":`${G}${t}`,"aria-live":"polite","aria-owns":`${K}${t}`,class:{wrapper:!0,"wrapper--single":o||!this.selectedItems.length,"wrapper--active":n||i},onClick:this.clickHandler,onKeyDown:this.keydownHandler,ref:this.setReferenceEl,role:"combobox"},e("div",{class:"grid-input"},this.renderIconStart(),!o&&this.renderChips(),e("label",{class:"screen-readers-only",htmlFor:`${N}${t}`,id:`${G}${t}`},a),this.renderInput()),this.renderIconEnd()),e("ul",{"aria-labelledby":`${G}${t}`,"aria-multiselectable":"true",class:"screen-readers-only",id:`${K}${t}`,role:"listbox",tabIndex:-1},this.renderListBoxOptions()),this.renderFloatingUIContainer(),e(j,{component:this}))}get el(){return a(this)}static get watchers(){return{active:["activeHandler"],open:["openHandler"],disabled:["handleDisabledChange"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],value:["valueHandler"],flipPlacements:["flipPlacementsHandler"],selectedItems:["selectedItemsHandler"],text:["textHandler"]}}};q.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-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-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)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}: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=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=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}.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-brand);outline-offset:-2px}.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{display:block;position:absolute;z-index:900;visibility:hidden;pointer-events:none;inline-size:0;block-size:0;overflow:hidden}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;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;visibility:visible;transform:translate(0)}.floating-ui-container--active{pointer-events:initial;visibility:visible;inline-size:unset;block-size:unset;overflow:unset}@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}";
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.0.0-beta.97
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-c2f00d41.js";import{f as n}from"./p-d48a24e6.js";import{d as o,f as c,c as l,u as r,r as h,a as d,F as m}from"./p-a9cefd9c.js";import{g as p}from"./p-a80b3880.js";import{T as u,C as b,b as g,c as f,h as v,d as x,e as y,g as w,a as k}from"./p-a5b1ab03.js";import{c as C,d as z,g as I}from"./p-bd67334c.js";import{s as $,c as H,a as _,d as D,H as j}from"./p-a33d73bb.js";import{c as L}from"./p-9a9955db.js";import{u as A}from"./p-7daea1df.js";import{i as E,t as S,g as P,a as F}from"./p-83166522.js";import{c as T,d as B}from"./p-2e9ed892.js";import{d as M}from"./p-4e32bf8c.js";import{c as O,d as R}from"./p-1c247f54.js";import{i as W,j as U}from"./p-88e28de2.js";import{s as V}from"./p-4557d5a8.js";import"./p-729708a3.js";import"./p-dbc9a5a8.js";import"./p-00444009.js";const X="combobox-item-",Y="combobox-chip-",G="combobox-label-",K="combobox-listbox-",N="combobox-input-",q=class{constructor(e){i(this,e),this.calciteLookupChange=t(this,"calciteLookupChange",6),this.calciteComboboxChange=t(this,"calciteComboboxChange",6),this.calciteComboboxFilterChange=t(this,"calciteComboboxFilterChange",6),this.calciteComboboxChipDismiss=t(this,"calciteComboboxChipDismiss",6),this.calciteComboboxBeforeClose=t(this,"calciteComboboxBeforeClose",6),this.calciteComboboxClose=t(this,"calciteComboboxClose",6),this.calciteComboboxBeforeOpen=t(this,"calciteComboboxBeforeOpen",6),this.calciteComboboxOpen=t(this,"calciteComboboxOpen",6),this.active=!1,this.open=!1,this.disabled=!1,this.maxItems=0,this.overlayPositioning="absolute",this.required=!1,this.selectionMode="multi",this.scale="m",this.value=null,this.intlRemoveTag=u.removeTag,this.placement=o,this.internalValueChangeFlag=!1,this.items=[],this.groupItems=[],this.selectedItems=[],this.visibleItems=[],this.activeItemIndex=-1,this.activeChipIndex=-1,this.activeDescendant="",this.text="",this.textInput=null,this.mutationObserver=L("mutation",(()=>this.updateItems())),this.resizeObserver=L("resize",(()=>this.setMaxScrollerHeight())),this.guid=p(),this.inputHeight=0,this.ignoreSelectedEventsFlag=!1,this.openTransitionProp="opacity",this.setFilteredPlacements=()=>{const{el:i,flipPlacements:t}=this;this.filteredFlipPlacements=t?c(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.shiftActiveItemIndex(-1),this.comboboxInViewport()||this.el.scrollIntoView();break;case"ArrowDown":i.preventDefault(),this.open||(this.open=!0),this.shiftActiveItemIndex(1),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.visibleItems.length-1),this.scrollToActiveItem(),this.comboboxInViewport()||this.el.scrollIntoView();break;case"Escape":this.open=!1,i.preventDefault();break;case"Enter":this.activeItemIndex>-1?(this.toggleSelection(this.visibleItems[this.activeItemIndex]),i.preventDefault()):this.activeChipIndex>-1?(this.removeActiveChip(),i.preventDefault()):this.allowCustomValues&&this.text?(this.addCustomChip(this.text,!0),i.preventDefault()):i.defaultPrevented||$(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 s=this.getMaxScrollerHeight();i.style.maxHeight=s>0?`${s}px`:"",i.style.minWidth=`${e.clientWidth}px`,await this.reposition(!0)},this.calciteChipDismissHandler=(i,t)=>{this.open=!1;const e=this.items.find((i=>i===t));e&&this.toggleSelection(e,!1),this.calciteComboboxChipDismiss.emit(i.detail)},this.clickHandler=i=>{i.composedPath().some((i=>"CALCITE-CHIP"===i.tagName))||(this.open=!this.open,this.updateActiveItemIndex(0),this.setFocus())},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,l(this,this.referenceEl,this.floatingEl)},this.setContainerEl=i=>{this.resizeObserver.observe(i),this.listContainerEl=i,this.transitionEl=i,T(this)},this.setReferenceEl=i=>{this.referenceEl=i,l(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===y?e===i.label:e===i.textLabel||e===i.value||t===i.textLabel||t===i.value));return M((t=>{const e=n(this.data,t);this.getCombinedItems().forEach((t=>{const s=!i(t,e);t.hidden=s;const[a,n]=t.ancestors;(i(a,e)||i(n,e))&&(t.hidden=!1),s||t.ancestors.forEach((i=>i.hidden=!1))})),this.visibleItems=this.getVisibleItems(),this.calciteComboboxFilterChange.emit({visibleItems:[...this.visibleItems],text:t})}),100)})(),this.internalCalciteLookupChangeEvent=()=>{this.calciteLookupChange.emit(this.selectedItems)},this.emitCalciteLookupChange=M(this.internalCalciteLookupChangeEvent,0),this.internalComboboxChangeEvent=()=>{const{selectedItems:i}=this;this.calciteComboboxChange.emit({selectedItems:i})},this.emitComboboxChange=M(this.internalComboboxChangeEvent,0),this.updateItems=()=>{this.items=this.getItems(),this.groupItems=this.getGroupItems(),this.data=this.getData(),this.selectedItems=this.getSelectedItems(),this.visibleItems=this.getVisibleItems(),this.needsIcon=this.getNeedsIcon(),this.allowCustomValues||this.setMaxScrollerHeight()},this.scrollToActiveItem=()=>{const i=this.visibleItems[this.activeItemIndex],t=this.calculateSingleItemHeight(i),{offsetHeight:e,scrollTop:s}=this.listContainerEl;e+s<i.offsetTop+t?this.listContainerEl.scrollTop=i.offsetTop-e+t:i.offsetTop<s&&(this.listContainerEl.scrollTop=i.offsetTop)},this.comboboxFocusHandler=()=>{var i;null===(i=this.textInput)||void 0===i||i.focus()},this.comboboxBlurHandler=i=>{this.setInactiveIfNotContained(i)}}activeHandler(i){if(this.disabled)return this.active=!1,void(this.open=!1);this.open=i}openHandler(i){if(i||r(this.floatingEl),this.disabled)return this.active=!1,void(this.open=!1);this.active=i,this.setMaxScrollerHeight()}handleDisabledChange(i){i||(this.active=!1,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()}}flipPlacementsHandler(){this.setFilteredPlacements(),this.reposition(!0)}documentClickHandler(i){E(i)&&this.setInactiveIfNotContained(i)}calciteComboboxItemChangeHandler(i){if(this.ignoreSelectedEventsFlag)return;const t=i.target,e=this.visibleItems.indexOf(t);this.updateActiveItemIndex(e),this.toggleSelection(t,t.selected)}async reposition(i=!1){const{floatingEl:t,referenceEl:e,placement:s,overlayPositioning:a,filteredFlipPlacements:n}=this;return h(this,{floatingEl:t,referenceEl:e,overlayPositioning:a,placement:s,flipPlacements:n,type:"menu"},i)}async setFocus(){var i;null===(i=this.textInput)||void 0===i||i.focus(),this.activeChipIndex=-1,this.activeItemIndex=-1}connectedCallback(){var i;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}),C(this),H(this),T(this),this.setFilteredPlacements(),this.reposition(!0),this.active&&this.activeHandler(this.active),this.open&&this.openHandler(this.open)}componentWillLoad(){this.updateItems()}componentDidLoad(){_(this,this.getValue()),this.reposition(!0)}componentDidRender(){this.el.offsetHeight!==this.inputHeight&&(this.reposition(!0),this.inputHeight=this.el.offsetHeight),A(this)}disconnectedCallback(){var i,t;null===(i=this.mutationObserver)||void 0===i||i.disconnect(),null===(t=this.resizeObserver)||void 0===t||t.disconnect(),z(this),D(this),d(this,this.referenceEl,this.floatingEl),B(this)}selectedItemsHandler(){this.internalValueChangeFlag=!0,this.value=this.getValue(),this.internalValueChangeFlag=!1}textHandler(){this.updateActiveItemIndex(-1)}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.calciteComboboxBeforeOpen.emit()}onOpen(){this.calciteComboboxOpen.emit()}onBeforeClose(){this.calciteComboboxBeforeClose.emit()}onClose(){this.calciteComboboxClose.emit()}getMaxScrollerHeight(){const i=this.getCombinedItems().filter((i=>!i.hidden)),{maxItems:t}=this;let e=0,s=0;return i.length>t&&i.forEach((i=>{if(e<t&&t>0){const t=this.calculateSingleItemHeight(i);t>0&&(s+=t,e++)}})),s}calculateSingleItemHeight(i){let t=i.offsetHeight;return Array.from(i.querySelectorAll(b)).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.emitCalciteLookupChange(),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=g(i),e=f(i);i.selected?t.forEach((i=>{i.selected=!0})):(e.forEach((i=>i.selected=!1)),[...t].forEach((i=>{v(i)||(i.selected=!1)})))}getVisibleItems(){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||!v(i)))).sort(((i,t)=>{const e=this.selectedItems.indexOf(i),s=this.selectedItems.indexOf(t);return e>-1&&s>-1?e-s:s-e}))}getData(){return this.items.map((i=>({constant:i.constant,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(x)).filter((i=>!i.disabled))}getGroupItems(){return Array.from(this.el.querySelectorAll(y))}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(x);e.value=i,e.textLabel=i,e.selected=!0,this.el.appendChild(e),this.resetText(),t&&this.setFocus(),this.updateItems(),this.filterItems(""),this.emitCalciteLookupChange(),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(`#${Y}${t}`):null;null==e||e.setFocus()}shiftActiveItemIndex(i){const{length:t}=this.visibleItems;this.updateActiveItemIndex((this.activeItemIndex+t+i)%t),this.scrollToActiveItem()}updateActiveItemIndex(i){var t;this.activeItemIndex=i;let e=null;this.visibleItems.forEach(((t,s)=>{s===i?(t.active=!0,e=`${X}${t.guid}`):t.active=!1})),this.activeDescendant=e,this.activeItemIndex>-1&&(this.activeChipIndex=-1,null===(t=this.textInput)||void 0===t||t.focus())}isMulti(){return"single"!==this.selectionMode}renderChips(){const{activeChipIndex:i,scale:t,selectionMode:s,intlRemoveTag:a}=this;return this.selectedItems.map(((n,o)=>{const c={chip:!0,"chip--active":i===o},l=[...[...g(n)].reverse(),n].map((i=>i.textLabel)),r="ancestors"!==s?n.textLabel:l.join(" / ");return e("calcite-chip",{class:c,dismissLabel:a,dismissible:!0,icon:n.icon,id:n.guid?`${Y}${n.guid}`:null,key:n.textLabel,onCalciteChipDismiss:i=>this.calciteChipDismissHandler(i,n),scale:t,title:r,value:n.value},r)}))}renderInput(){const{guid:i,active:t,disabled:s,placeholder:a,selectionMode:n,selectedItems:o,open:c}=this,l="single"===n,r=o[0],h=!(c||t)&&l&&!!r;return e("span",{class:{"input-wrap":!0,"input-wrap--single":l}},h&&e("span",{class:{label:!0,"label--icon":!!(null==r?void 0:r.icon)},key:"label"},r.textLabel),e("input",{"aria-activedescendant":this.activeDescendant,"aria-autocomplete":"list","aria-controls":`${K}${i}`,"aria-label":I(this),class:{input:!0,"input--single":!0,"input--transparent":this.activeChipIndex>-1,"input--hidden":h,"input--icon":!!this.placeholderIcon},disabled:s,id:`${N}${i}`,key:"input",onBlur:this.comboboxBlurHandler,onFocus:this.comboboxFocusHandler,onInput:this.inputHandler,placeholder:a,ref:i=>this.textInput=i,type:"text"}))}renderListBoxOptions(){return this.visibleItems.map((i=>e("li",{"aria-selected":S(i.selected),id:i.guid?`${X}${i.guid}`:null,role:"option",tabindex:"-1"},i.textLabel)))}renderFloatingUIContainer(){const{active:i,setFloatingEl:t,setContainerEl:s,open:a}=this;return e("div",{"aria-hidden":"true",class:{"floating-ui-container":!0,"floating-ui-container--active":a||i},ref:t},e("div",{class:{"list-container":!0,[m.animation]:!0,[m.animationActive]:a||i},ref:s},e("ul",{class:{list:!0,"list--hide":!(a||i)}},e("slot",null))))}renderIconStart(){const{selectedItems:i,placeholderIcon:t,selectionMode:s}=this,a=i[0],n=null==a?void 0:a.icon,o="single"===s;return(!this.open&&a?!!n&&o:!!this.placeholderIcon&&(!a||o))&&e("span",{class:"icon-start"},e("calcite-icon",{class:"selected-icon",icon:!this.open&&a?n:t,scale:"s"}))}renderIconEnd(){const{active:i,open:t}=this;return e("span",{class:"icon-end"},e("calcite-icon",{icon:i||t?"chevron-up":"chevron-down",scale:"s"}))}render(){const{active:i,guid:t,label:a,open:n}=this,o="single"===this.selectionMode;return e(s,null,e("div",{"aria-autocomplete":"list","aria-controls":`${K}${t}`,"aria-expanded":S(n||i),"aria-haspopup":"listbox","aria-labelledby":`${G}${t}`,"aria-live":"polite","aria-owns":`${K}${t}`,class:{wrapper:!0,"wrapper--single":o||!this.selectedItems.length,"wrapper--active":n||i},onClick:this.clickHandler,onKeyDown:this.keydownHandler,ref:this.setReferenceEl,role:"combobox"},e("div",{class:"grid-input"},this.renderIconStart(),!o&&this.renderChips(),e("label",{class:"screen-readers-only",htmlFor:`${N}${t}`,id:`${G}${t}`},a),this.renderInput()),this.renderIconEnd()),e("ul",{"aria-labelledby":`${G}${t}`,"aria-multiselectable":"true",class:"screen-readers-only",id:`${K}${t}`,role:"listbox",tabIndex:-1},this.renderListBoxOptions()),this.renderFloatingUIContainer(),e(j,{component:this}))}get el(){return a(this)}static get watchers(){return{active:["activeHandler"],open:["openHandler"],disabled:["handleDisabledChange"],maxItems:["maxItemsHandler"],overlayPositioning:["overlayPositioningHandler"],value:["valueHandler"],flipPlacements:["flipPlacementsHandler"],selectedItems:["selectedItemsHandler"],text:["textHandler"]}}};q.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-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-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)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}:host{position:relative;display:block}:host([disabled]) ::slotted([calcite-hydrated][disabled]),:host([disabled]) [calcite-hydrated][disabled]{opacity:1}: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=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=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}.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-brand);outline-offset:-2px}.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{display:block;position:absolute;z-index:900;visibility:hidden;pointer-events:none;inline-size:0;block-size:0;overflow:hidden}.floating-ui-container .calcite-floating-ui-anim{position:relative;transition:var(--calcite-floating-ui-transition);visibility:hidden;transition-property:transform, visibility, opacity;opacity:0;box-shadow:0 0 16px 0 rgba(0, 0, 0, 0.16);z-index:1;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;visibility:visible;transform:translate(0)}.floating-ui-container--active{pointer-events:initial;visibility:visible;inline-size:unset;block-size:unset;overflow:unset}@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}";
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.0.0-beta.97
11
+ */
12
12
  const J="icon",Q=class{constructor(e){i(this,e),this.calciteComboboxItemChange=t(this,"calciteComboboxItemChange",6),this.disabled=!1,this.selected=!1,this.active=!1,this.guid=p(),this.scale="m",this.itemClickHandler=i=>{i.preventDefault(),this.disabled||(this.selected=!this.selected)}}selectedWatchHandler(){this.calciteComboboxItemChange.emit(this.el)}connectedCallback(){this.ancestors=w(this.el),this.scale=P(this.el,"scale",this.scale),O(this)}disconnectedCallback(){R(this)}componentDidRender(){A(this)}async toggleSelected(i){this.disabled||(this.selected="boolean"==typeof i?i:!this.selected)}renderIcon(i){const{icon:t,disabled:s,selected:a}=this,n=`${J}--indent`;return!i||t||s?e("calcite-icon",{class:{[J]:!t,"icon--custom":!!t,"icon--active":t&&a,[n]:!0},icon:t||(s?"circle-disallowed":i?"dot":"check"),scale:"s"}):e("span",{class:{[J]:!0,"icon--dot":!0,[n]:!0}})}renderChildren(){return F(this.el)?e("ul",{key:"default-slot-container"},e("slot",null)):null}render(){const i="single"===P(this.el,"selection-mode","multi"),t={label:!0,"label--selected":this.selected,"label--active":this.active,"label--single":i},a=k(this.el);return e(s,{"aria-hidden":"true"},e("div",{class:`container scale--${this.scale}`,style:{"--calcite-combobox-item-spacing-indent-multiplier":`${a}`}},e("li",{class:t,id:this.guid,onClick:this.itemClickHandler},this.renderIcon(i),e("span",{class:"title"},this.textLabel)),this.renderChildren()))}get el(){return a(this)}static get watchers(){return{selected:["selectedWatchHandler"]}}};Q.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-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-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)}:host([hidden]){display:none}:host([disabled]){pointer-events:none;cursor:default;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:var(--calcite-ui-opacity-disabled)}.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}.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}.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.75rem;--calcite-combobox-item-spacing-indent:1rem}.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;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-brand);outline-offset:-2px}.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;color:var(--calcite-ui-text-3)}.icon--active{color:var(--calcite-ui-text-1)}.icon--dot{display:flex;justify-content:flex-end;min-inline-size:var(--calcite-combobox-item-spacing-unit-l)}.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}';const Z=class{constructor(e){i(this,e),this.layerSelectionChange=t(this,"layerSelectionChange",7),this.enabledLayerIds=[],this.mapView=void 0,this.selectedLayerIds=[],this.selectionMode="single",this.layerIds=[]}async watchStateHandler(i,t){i!==t&&(await this._setLayers(),"single"===this.selectionMode&&this.layerSelectionChange.emit([this.layerIds[0]]))}async componentWillLoad(){await this._setLayers(),"single"===this.selectionMode&&(this.layerIds.length>0||1===this.selectedLayerIds.length)&&this.layerSelectionChange.emit(1===this.selectedLayerIds.length?[this.selectedLayerIds[0]]:[this.layerIds[0]])}render(){return e(s,null,e("div",{class:"map-layer-picker-container"},e("div",{class:"map-layer-picker"},"multi"===this.selectionMode?this._getCombobox():this._getSelect())))}_getSelect(){return e("calcite-select",{label:"",onCalciteSelectChange:i=>this._layerSelectionChange(i),ref:i=>{this._layerElement=i}},this._addMapLayersOptions())}_getCombobox(){return e("calcite-combobox",{label:"",onCalciteComboboxChange:i=>this._layerSelectionChange(i),"selection-mode":this.selectionMode},this._addMapLayersOptions())}_addMapLayersOptions(){return this.layerIds.reduce(((i,t)=>(V.managedLayers.indexOf(V.layerNameHash[t])<0&&(!(this.enabledLayerIds.length>0)||this.enabledLayerIds.indexOf(t)>-1)&&i.push("multi"===this.selectionMode&&this.selectedLayerIds.indexOf(t)>-1?e("calcite-combobox-item",{selected:!0,textLabel:V.layerNameHash[t],value:t}):"multi"===this.selectionMode?e("calcite-combobox-item",{textLabel:V.layerNameHash[t],value:t}):this.selectedLayerIds.indexOf(t)>-1?e("calcite-option",{label:V.layerNameHash[t],selected:!0,value:t}):e("calcite-option",{label:V.layerNameHash[t],value:t})),i)),[])}async _setLayers(){if(this.mapView){const i=await W(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&&(V.layerNameHash=await U(this.mapView))}_layerSelectionChange(i){var t;this.selectedLayerIds="single"===this.selectionMode?[this._layerElement.value]:(null===(t=i.detail)||void 0===t?void 0:t.selectedItems.map((i=>i.value)))||[],this.layerSelectionChange.emit(this.selectedLayerIds)}get el(){return a(this)}static get watchers(){return{mapView:["watchStateHandler"]}}};Z.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}";export{q as calcite_combobox,Q as calcite_combobox_item,Z as map_layer_picker}