@tylertech/forge 2.14.0 → 3.0.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/custom-elements.json +182 -28
  2. package/dist/esm/app-bar/index.js +1 -1
  3. package/dist/esm/app-bar/profile-button/index.js +1 -1
  4. package/dist/esm/autocomplete/index.js +1 -1
  5. package/dist/esm/chunks/chunk.242YUZKU.js +7 -0
  6. package/dist/esm/chunks/chunk.242YUZKU.js.map +7 -0
  7. package/dist/esm/chunks/{chunk.RHFNK6EE.js → chunk.5WNKQTXX.js} +2 -2
  8. package/dist/esm/chunks/{chunk.LFLREB3C.js → chunk.7BOXIJAM.js} +2 -2
  9. package/dist/esm/chunks/{chunk.DYRY2HWZ.js → chunk.ABLKZXJ3.js} +2 -2
  10. package/dist/esm/chunks/{chunk.DQJPIDVW.js → chunk.CKYHP5MC.js} +2 -2
  11. package/dist/esm/chunks/{chunk.DQJPIDVW.js.map → chunk.CKYHP5MC.js.map} +3 -3
  12. package/dist/esm/chunks/chunk.CLM6MNKC.js +7 -0
  13. package/dist/esm/chunks/chunk.CLM6MNKC.js.map +7 -0
  14. package/dist/esm/chunks/{chunk.DFJUCHEO.js → chunk.IUOBRBDZ.js} +2 -2
  15. package/dist/esm/chunks/{chunk.6RSRYR55.js → chunk.M2QU3LUR.js} +2 -2
  16. package/dist/esm/chunks/{chunk.HU27X3IT.js → chunk.MSF55AA3.js} +2 -2
  17. package/dist/esm/chunks/chunk.Q7LFOS2I.js +7 -0
  18. package/dist/esm/chunks/chunk.Q7LFOS2I.js.map +7 -0
  19. package/dist/esm/chunks/{chunk.OZ5BPXNV.js → chunk.SSRQFKNH.js} +2 -2
  20. package/dist/esm/chunks/chunk.XQ2EQIDS.js +7 -0
  21. package/dist/esm/chunks/chunk.XQ2EQIDS.js.map +7 -0
  22. package/dist/esm/chunks/chunk.Y5A7RQ5M.js +7 -0
  23. package/dist/esm/chunks/chunk.Y5A7RQ5M.js.map +7 -0
  24. package/dist/esm/chunks/{chunk.J6P3GKZM.js → chunk.ZFHPUAYX.js} +2 -2
  25. package/dist/esm/chunks/{chunk.J6P3GKZM.js.map → chunk.ZFHPUAYX.js.map} +1 -1
  26. package/dist/esm/dialog/index.js +1 -1
  27. package/dist/esm/index.js +1 -1
  28. package/dist/esm/paginator/index.js +1 -1
  29. package/dist/esm/profile-card/index.js +1 -1
  30. package/dist/esm/select/core/index.js +1 -1
  31. package/dist/esm/select/index.js +1 -1
  32. package/dist/esm/select/select/index.js +1 -1
  33. package/dist/esm/select/select-dropdown/index.js +1 -1
  34. package/dist/esm/split-view/index.js +1 -1
  35. package/dist/esm/split-view/split-view/index.js +1 -1
  36. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  37. package/dist/esm/stack/index.js +1 -1
  38. package/dist/esm/time-picker/index.js +1 -1
  39. package/esm/app-bar/profile-button/app-bar-profile-button-adapter.d.ts +2 -0
  40. package/esm/app-bar/profile-button/app-bar-profile-button-adapter.js +13 -1
  41. package/esm/app-bar/profile-button/app-bar-profile-button-constants.d.ts +2 -0
  42. package/esm/app-bar/profile-button/app-bar-profile-button-constants.js +1 -0
  43. package/esm/app-bar/profile-button/app-bar-profile-button-foundation.d.ts +4 -0
  44. package/esm/app-bar/profile-button/app-bar-profile-button-foundation.js +15 -1
  45. package/esm/app-bar/profile-button/app-bar-profile-button.d.ts +2 -0
  46. package/esm/app-bar/profile-button/app-bar-profile-button.js +9 -0
  47. package/esm/autocomplete/autocomplete-foundation.js +7 -1
  48. package/esm/dialog/dialog-adapter.d.ts +5 -5
  49. package/esm/dialog/dialog-adapter.js +30 -31
  50. package/esm/dialog/dialog-foundation.d.ts +4 -2
  51. package/esm/dialog/dialog-foundation.js +62 -54
  52. package/esm/dialog/dialog.d.ts +4 -0
  53. package/esm/dialog/dialog.js +7 -1
  54. package/esm/profile-card/profile-card-adapter.d.ts +2 -0
  55. package/esm/profile-card/profile-card-adapter.js +12 -1
  56. package/esm/profile-card/profile-card-constants.d.ts +1 -0
  57. package/esm/profile-card/profile-card-constants.js +1 -0
  58. package/esm/profile-card/profile-card-foundation.d.ts +4 -0
  59. package/esm/profile-card/profile-card-foundation.js +9 -0
  60. package/esm/profile-card/profile-card.d.ts +2 -0
  61. package/esm/profile-card/profile-card.js +7 -0
  62. package/esm/select/core/base-select-foundation.js +8 -3
  63. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  64. package/esm/stack/stack-constants.d.ts +2 -0
  65. package/esm/stack/stack-constants.js +1 -0
  66. package/esm/stack/stack-foundation.d.ts +4 -4
  67. package/esm/stack/stack-foundation.js +2 -2
  68. package/esm/stack/stack.d.ts +3 -3
  69. package/esm/stack/stack.js +1 -1
  70. package/package.json +1 -1
  71. package/styles/stack/_mixins.scss +1 -1
  72. package/styles/stack/stack.scss +4 -1
  73. package/dist/esm/chunks/chunk.4X2OFZDL.js +0 -7
  74. package/dist/esm/chunks/chunk.4X2OFZDL.js.map +0 -7
  75. package/dist/esm/chunks/chunk.73AYD2BF.js +0 -7
  76. package/dist/esm/chunks/chunk.73AYD2BF.js.map +0 -7
  77. package/dist/esm/chunks/chunk.PYIFIHDK.js +0 -7
  78. package/dist/esm/chunks/chunk.PYIFIHDK.js.map +0 -7
  79. package/dist/esm/chunks/chunk.U724KSZU.js +0 -7
  80. package/dist/esm/chunks/chunk.U724KSZU.js.map +0 -7
  81. package/dist/esm/chunks/chunk.ULIFS3UR.js +0 -7
  82. package/dist/esm/chunks/chunk.ULIFS3UR.js.map +0 -7
  83. /package/dist/esm/chunks/{chunk.RHFNK6EE.js.map → chunk.5WNKQTXX.js.map} +0 -0
  84. /package/dist/esm/chunks/{chunk.LFLREB3C.js.map → chunk.7BOXIJAM.js.map} +0 -0
  85. /package/dist/esm/chunks/{chunk.DYRY2HWZ.js.map → chunk.ABLKZXJ3.js.map} +0 -0
  86. /package/dist/esm/chunks/{chunk.DFJUCHEO.js.map → chunk.IUOBRBDZ.js.map} +0 -0
  87. /package/dist/esm/chunks/{chunk.6RSRYR55.js.map → chunk.M2QU3LUR.js.map} +0 -0
  88. /package/dist/esm/chunks/{chunk.HU27X3IT.js.map → chunk.MSF55AA3.js.map} +0 -0
  89. /package/dist/esm/chunks/{chunk.OZ5BPXNV.js.map → chunk.SSRQFKNH.js.map} +0 -0
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{b as W}from"./chunk.WP4QOOIS.js";import{a as c,f as B,g as M,h as Y}from"./chunk.ULIFS3UR.js";import{b as q}from"./chunk.77Y3EABF.js";import{d as H}from"./chunk.LYOQ2RGP.js";import{d as O}from"./chunk.ZUNZKRRK.js";import{a as t}from"./chunk.GO5A4GKZ.js";import{c as I}from"./chunk.KE6GOYAB.js";import{e as z}from"./chunk.RG6CDWEX.js";import{a as L}from"./chunk.4DAIIJ37.js";import{d as N}from"./chunk.TWZXQQQO.js";import{b as P}from"./chunk.HBMNXZES.js";import{e as F}from"./chunk.V7WKXEZC.js";import{b as R}from"./chunk.7A6MX6CS.js";import{c as w,g as A,h as k}from"./chunk.MZLPUI6R.js";import{d as D,l as C}from"./chunk.JHBCYICS.js";import{a as n}from"./chunk.KTGSZEAG.js";import{a as T,b as S}from"./chunk.BE7PZANN.js";import{a as E,e as x,g as f}from"./chunk.Y4GKBJGI.js";import{o as y,t as s,u as d}from"./chunk.PN26D52V.js";import{b as v,k as b}from"./chunk.J2M2MXP2.js";import{f as a}from"./chunk.MCIQXNKY.js";var U=`${S}select`,h={ROOT:"forge-select",OPENED:"forge-select--opened",SELECTED_TEXT:"forge-select__selected-text",DROPDOWN:"forge-select__dropdown",LABEL_FLOAT:"forge-select--label-float",GROUP_WRAPPER:"forge-select__group-wrapper"},V={ROOT:`.${h.ROOT}`,SELECTED_TEXT:`.${h.SELECTED_TEXT}`,LABEL:"label#select-label",LEADING_SLOT:"slot[name=leading]",ADDON_END_SLOT:"slot[name=addon-end]"},G={TYPE:"type",VALUE:"value",LABEL:"label",MULTIPLE:"multiple",DISABLED:"disabled",PLACEHOLDER:"placeholder",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},X={SCROLLED_BOTTOM:`${U}-scrolled-bottom`},o={elementName:U,classes:h,selectors:V,attributes:G,events:X};var g=class extends Y{constructor(e){super(e);this._selectElement=f(e,o.selectors.ROOT),this._leadingSlot=f(e,o.selectors.LEADING_SLOT),this._addonEndSlot=f(this._component,o.selectors.ADDON_END_SLOT),this._selectedTextElement=f(e,o.selectors.SELECTED_TEXT),this._targetElement=this._selectElement}initializeLabel(){this._labelElement=f(this._component,o.selectors.LABEL)}hasLabel(){return!!this._labelElement}initializeAccessibility(){this._component.setAttribute("role","combobox"),this._component.setAttribute("aria-haspopup","true"),this._component.setAttribute("aria-expanded","false"),(!this._component.hasAttribute("tabindex")||this._component.tabIndex===-1)&&(this._component.tabIndex=0)}initializeFloatingLabel(){return new O(this._labelElement)}setLabel(e){(!this._component.hasAttribute("aria-label")||this._component.getAttribute("aria-label")===this._labelElement.textContent)&&this._component.setAttribute("aria-label",e),this._labelElement.textContent=e}addRootClass(e){this._selectElement.classList.add(e)}removeRootClass(e){this._selectElement.classList.remove(e)}setPlaceholderText(e){d(this._selectedTextElement,!!e,"placeholder",e)}addClickListener(e){this._component.addEventListener("click",e)}removeClickListener(e){this._component.removeEventListener("click",e)}addMouseDownListener(e){this._component.addEventListener("mousedown",e)}removeMouseDownListener(e){this._component.removeEventListener("mousedown",e)}addTargetListener(e,i){this._component.addEventListener(e,i)}removeTargetListener(e,i){this._component.removeEventListener(e,i)}open(e){super.open(e),this._component.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._component.setAttribute("aria-expanded","true"),s(this._selectElement,!0,o.classes.OPENED)}close(){this._component.setAttribute("aria-expanded","false"),this._component.removeAttribute("aria-activedescendant"),this._component.removeAttribute("aria-controls"),s(this._selectElement,!1,o.classes.OPENED),super.close()}updateActiveDescendant(e){d(this._component,!!e,"aria-activedescendant",e)}setSelectedText(e){this._selectedTextElement.textContent=e}setLeadingListener(e){this._leadingSlot.addEventListener("slotchange",e)}removeLeadingListener(e){this._leadingSlot.removeEventListener("slotchange",e)}setAddonEndListener(e){this._addonEndSlot.addEventListener("slotchange",e)}removeAddonEndListener(e){this._addonEndSlot.removeEventListener("slotchange",e)}hasLeadingElement(){return this._leadingSlot.assignedNodes().length>0}setDisabled(e){s(this._selectElement,e,t.classes.DISABLED),d(this._component,e,"aria-disabled","true"),this._component.tabIndex=e?-1:0}setInvalid(e){s(this._selectElement,e,t.classes.INVALID),d(this._component,e,"aria-invalid","true")}setRequired(e){s(this._selectElement,e,t.classes.REQUIRED),d(this._component,e,"aria-required","true")}setRoomy(e){s(this._selectElement,e,t.classes.ROOMY)}setDense(e){s(this._selectElement,e,t.classes.DENSE)}setMultiple(e){e?this.setHostAttribute("aria-multiselectable","true"):this.removeHostAttribute("aria-multiselectable")}getLabelWidth(e,i){return y(this._labelElement.innerText,{fontSize:e,fontFamily:i})}getLabelFontMetrics(){let e=getComputedStyle(this._labelElement);return{fontSize:parseInt(e.fontSize||"16",10),fontFamily:e.fontFamily||"Roboto"}}getTargetWidth(){return this._selectElement.getBoundingClientRect().width}hasAddonEndNodes(){return this._addonEndSlot?this._addonEndSlot.assignedNodes().length>0:!1}setFocus(){this._component.focus()}isWithinSelf(e){return!!this._component.shadowRoot&&this._component.shadowRoot.contains(e)||this._component.contains(e)}};var p=class extends B{constructor(e){super(e);this._shape="default";this._label="";this._disabled=!1;this._invalid=!1;this._required=!1;this._floatLabelType="auto";this._density="default";this._isInitialized=!1;this._leadingChangeListener=i=>this._onLeadingSlotChanged(i),this._addonEndChangeListener=i=>this._onAddonEndSlotChanged(i),this._targetWidthCallback=()=>this._adapter.getTargetWidth(),this._mousedownListener=i=>this._onMouseDown(i)}initialize(){super.initialize(),super.initializeTarget(),this._initializeLabel(),this._initializeAccessibility(),this._adapter.setPlaceholderText(this._placeholder),this._applyDensity(),this._setShapeType(),this._detectLeadingElement(),this._detectAddonEndContent(),this._adapter.addMouseDownListener(this._mousedownListener),this._adapter.setLeadingListener(this._leadingChangeListener),this._adapter.setAddonEndListener(this._addonEndChangeListener),this._disabled&&this._adapter.setDisabled(!0),this._invalid&&this._adapter.setInvalid(!0),this._isInitialized=!0}disconnect(){super.disconnect(),this._adapter.removeMouseDownListener(this._mousedownListener),this._adapter.removeLeadingListener(this._leadingChangeListener),this._adapter.removeAddonEndListener(this._leadingChangeListener),this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeLabel(){if(this._adapter.initializeLabel(),this._updateLabel(),this._floatingLabelInstance=this._adapter.initializeFloatingLabel(),this._floatLabelType==="always")this._floatLabel(!0);else{let e=!!this._getSelectedText(),i=!!this._placeholder;this._floatLabel(e||i)}}_destroyLabel(){this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeValue(){super._initializeValue(),this._selectedValues.length&&this._floatLabel(!0)}_initializeAccessibility(){this._adapter.setMultiple(this._multiple),this._required&&this._adapter.setHostAttribute("aria-required","true"),this._disabled&&this._adapter.setHostAttribute("aria-disabled","true"),this._invalid&&this._adapter.setHostAttribute("aria-invalid","true")}_onMouseDown(e){this._adapter.isWithinSelf(e.target)&&e.preventDefault()}_onLeadingSlotChanged(e){this._detectLeadingElement()}_onAddonEndSlotChanged(e){this._detectAddonEndContent()}_detectLeadingElement(){this._adapter.hasLeadingElement()?this._adapter.addRootClass(t.classes.LEADING):this._adapter.removeRootClass(t.classes.LEADING)}_detectAddonEndContent(){this._adapter.hasAddonEndNodes()?this._adapter.addRootClass(t.classes.ADDON_END):this._adapter.removeRootClass(t.classes.ADDON_END)}_onClick(e){this._disabled||L(e).find(r=>r.classList&&r.classList.contains(t.classes.ADDON_END_CONTAINER))||(this.setFocus(),super._onClick(e))}_onFocus(e){this._disabled||(this._setFocused(),super._onFocus(e))}_floatLabel(e){!this._floatingLabelInstance||(e?this._adapter.addRootClass(o.classes.LABEL_FLOAT):this._adapter.removeRootClass(o.classes.LABEL_FLOAT),this._floatLabelType==="always"&&(e=!0),this._floatingLabelInstance.float(e,this._floatLabelType==="always"))}_onBlur(e){super._onBlur(e),this._setBlurred()}_onDismiss(){super._onDismiss(),this._setBlurred()}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}async _onSelect(e,i,r=!0){let u=await super._onSelect(e,i,r);return u&&(this._adapter.setSelectedText(this._getSelectedText()),r&&!this._multiple&&this._adapter.setFocus()),u}_setFocused(){this._adapter.addRootClass(t.classes.FOCUSED),this._floatLabel(!0)}_setBlurred(){var e;this._adapter.removeRootClass(t.classes.FOCUSED),!this._selectedValues.length&&!((e=this._placeholder)!=null&&e.length)&&this._floatLabel(!1)}_reset(){var e;super._reset(),this._adapter.setSelectedText(""),this._floatLabel(!((e=this._placeholder)!=null&&e.length))}_updateLabel(){this._adapter.hasLabel()&&this._adapter.setLabel(this._label),this._label&&this._density!=="dense"?this._adapter.addRootClass(t.classes.LABEL):this._adapter.removeRootClass(t.classes.LABEL)}_applyValue(e){super._applyValue(e);let i=this._getSelectedText();this._adapter.setSelectedText(i),this._open||this._floatLabel(!!i||!!this._placeholder)}_applyDensity(){this._adapter.setRoomy(this._density==="roomy"),this._adapter.setDense(this._density==="dense")}_setShapeType(){this._shape==="rounded"?this._adapter.addRootClass(t.classes.SHAPE_ROUNDED):this._adapter.removeRootClass(t.classes.SHAPE_ROUNDED)}setFocus(){this._adapter.setFocus()}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._updateLabel(),this._label?(this._initializeLabel(),this._adapter.setHostAttribute(o.attributes.LABEL,this._label)):(this._destroyLabel(),this.required=!1,this._adapter.removeHostAttribute(o.attributes.LABEL)))}get shape(){return this._shape}set shape(e){this._shape!==e&&(this._shape=e,this._isInitialized&&this._setShapeType(),this._adapter.setHostAttribute(t.attributes.SHAPE,this._shape))}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._adapter.setDisabled(this._disabled),this._initializeLabel())}get invalid(){return this._invalid}set invalid(e){this._invalid!==e&&(this._invalid=e,this._adapter.setInvalid(this._invalid))}get required(){return this._required}set required(e){this._required!==e&&(this._required=e,this._adapter.setRequired(this._required),this._adapter.toggleHostAttribute(t.attributes.REQUIRED,this._required))}get density(){return this._density}set density(e){this._density!==e&&(this._density=e,this._applyDensity(),this._adapter.setHostAttribute(t.attributes.DENSITY,this._density.toString()),this._initializeLabel())}get floatLabelType(){return this._floatLabelType}set floatLabelType(e){this._floatLabelType!==e&&(this._floatLabelType=e,this._floatLabel(this._floatLabelType==="always"||!!this._placeholder),this._adapter.setHostAttribute(t.attributes.FLOAT_LABEL_TYPE,v(this._floatLabelType)?this._floatLabelType.toString():""))}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&(this._placeholder=e,this._adapter.setPlaceholderText(this._placeholder),this._initializeLabel())}};var $='<template><div class="forge-select__wrapper" part="root"><div class="forge-select forge-field" part="container"><div class="forge-select__leading-container" part="leading-container"><slot name="leading"></slot></div><div class="forge-field__label-input-container" part="label-input-container"><div id="selected-text" class="forge-select__selected-text" part="text" aria-live="assertive" aria-atomic="true"></div><label id="select-label" aria-hidden="true" part="label"></label></div><forge-icon class="forge-select__dropdown-icon" name="arrow_drop_down" part="icon"></forge-icon><div class="forge-field__addon-end-container" part="addon-end-container"><slot name="addon-end"></slot></div></div><slot name="helper-text"></slot></div></template>',Q='.forge-select{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-select-margin-top,0)}.forge-select.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-select:not(.forge-field--dense):not(.forge-field--roomy){height:3rem;height:var(--forge-select-height,3rem)}.forge-select.forge-field--roomy:not(.forge-field--dense){height:3.5rem;height:var(--forge-select-height,3.5rem)}.forge-select.forge-field--dense:not(.forge-field--roomy){height:1.5rem;height:var(--forge-select-height,1.5rem)}.forge-field::before{content:"";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-style:var(--forge-select-border-style,solid);border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-select-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field~::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-select__leading-container{display:-webkit-box;display:flex;align-self:center}.forge-field label{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field label[dir=rtl],[dir=rtl] .forge-field label{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) label{display:none}.forge-field--required label::after{content:none}.forge-field--required label::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{font-size:1rem}.forge-field--roomy:not(.forge-field--dense) label{font-size:1rem}.forge-field--disabled label{color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) label{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{top:1rem}.forge-field--roomy:not(.forge-field--dense) label{top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) label{left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) label{left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) label{padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded label{padding-right:32px}.forge-field label.forge-floating-label--float-above{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled label.forge-floating-label--float-above{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) label.forge-floating-label--float-above{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label.forge-floating-label--float-above{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above{-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above{-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field .forge-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:block;overflow:hidden;text-overflow:ellipsis;align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;white-space:nowrap;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0;font-size:var(--forge-select-font-size, 1rem);padding:0 12px;padding-right:0}.forge-field:not(.forge-field--disabled) .forge-select__selected-text{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled .forge-select__selected-text{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{font-size:.875rem;font-size:var(--forge-select-font-size, .875rem)}.forge-field .forge-select__selected-text{padding:0 12px}.forge-field--label .forge-select__selected-text{padding-top:24px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-top:29px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-select__selected-text{padding-left:32px}.forge-field--leading .forge-select__selected-text{padding-left:0}.forge-field--label .forge-select__selected-text{padding-bottom:3px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-bottom:8px}.forge-field:not(.forge-field--label):not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height, 3rem)}.forge-field:not(.forge-field--label).forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{line-height:var(--forge-select-height-roomy, 3.5rem)}.forge-field:not(.forge-field--label).forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height-dense, 1.5rem)}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{padding:0 8px}.forge-field .forge-select__selected-text:empty::before{content:attr(placeholder);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field .forge-select--label .forge-select__selected-text{padding-top:25px}.forge-field .forge-select__dropdown-icon{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;width:24px;height:100%;-webkit-box-flex:0;flex:none;-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);pointer-events:none;margin-right:8px}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) .forge-select__dropdown-icon{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) .forge-select__dropdown-icon{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled .forge-select__dropdown-icon{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__dropdown-icon{margin-right:4px}:host{display:block;contain:layout}:host(:focus){outline:0}:host([hidden]){display:none}',l=class extends M{constructor(){super();D.define([w,k,A]),x(this,$,Q),this._foundation=new p(new g(this))}static get observedAttributes(){return[t.attributes.DENSITY,t.attributes.FLOAT_LABEL_TYPE,t.attributes.SHAPE,t.attributes.INVALID,t.attributes.REQUIRED,o.attributes.LABEL,o.attributes.MULTIPLE,o.attributes.VALUE,o.attributes.DISABLED,o.attributes.PLACEHOLDER,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,c.attributes.POPUP_CLASSES,c.attributes.OPTION_LIMIT,c.attributes.SYNC_POPUP_WIDTH,c.attributes.CONSTRAIN_POPUP_WIDTH,c.attributes.WRAP_OPTION_TEXT]}attributeChangedCallback(e,i,r){switch(e){case t.attributes.DENSITY:this.density=r;return;case t.attributes.FLOAT_LABEL_TYPE:this.floatLabelType=r;return;case t.attributes.SHAPE:this.shape=r;break;case t.attributes.INVALID:this.invalid=b(r);return;case t.attributes.REQUIRED:this.required=b(r);return;case o.attributes.LABEL:this.label=r;return;case o.attributes.DISABLED:this.disabled=b(r);return;case o.attributes.PLACEHOLDER:this.placeholder=r;return}super.attributeChangedCallback(e,i,r)}};a([n()],l.prototype,"label",2),a([n()],l.prototype,"disabled",2),a([n()],l.prototype,"invalid",2),a([n()],l.prototype,"required",2),a([n()],l.prototype,"density",2),a([n()],l.prototype,"floatLabelType",2),a([n()],l.prototype,"shape",2),a([n()],l.prototype,"placeholder",2),l=a([T({name:o.elementName,dependencies:[H,q,F,I,z,N,C,W,P,R]})],l);function He(){E(l)}export{o as a,g as b,p as c,l as d,He as e};
7
- //# sourceMappingURL=chunk.RHFNK6EE.js.map
6
+ import{b as W}from"./chunk.WP4QOOIS.js";import{a as c,f as B,g as M,h as Y}from"./chunk.CLM6MNKC.js";import{b as q}from"./chunk.77Y3EABF.js";import{d as H}from"./chunk.LYOQ2RGP.js";import{d as O}from"./chunk.ZUNZKRRK.js";import{a as t}from"./chunk.GO5A4GKZ.js";import{c as I}from"./chunk.KE6GOYAB.js";import{e as z}from"./chunk.RG6CDWEX.js";import{a as L}from"./chunk.4DAIIJ37.js";import{d as N}from"./chunk.TWZXQQQO.js";import{b as P}from"./chunk.HBMNXZES.js";import{e as F}from"./chunk.V7WKXEZC.js";import{b as R}from"./chunk.7A6MX6CS.js";import{c as w,g as A,h as k}from"./chunk.MZLPUI6R.js";import{d as D,l as C}from"./chunk.JHBCYICS.js";import{a as n}from"./chunk.KTGSZEAG.js";import{a as T,b as S}from"./chunk.BE7PZANN.js";import{a as E,e as x,g as f}from"./chunk.Y4GKBJGI.js";import{o as y,t as s,u as d}from"./chunk.PN26D52V.js";import{b as v,k as b}from"./chunk.J2M2MXP2.js";import{f as a}from"./chunk.MCIQXNKY.js";var U=`${S}select`,h={ROOT:"forge-select",OPENED:"forge-select--opened",SELECTED_TEXT:"forge-select__selected-text",DROPDOWN:"forge-select__dropdown",LABEL_FLOAT:"forge-select--label-float",GROUP_WRAPPER:"forge-select__group-wrapper"},V={ROOT:`.${h.ROOT}`,SELECTED_TEXT:`.${h.SELECTED_TEXT}`,LABEL:"label#select-label",LEADING_SLOT:"slot[name=leading]",ADDON_END_SLOT:"slot[name=addon-end]"},G={TYPE:"type",VALUE:"value",LABEL:"label",MULTIPLE:"multiple",DISABLED:"disabled",PLACEHOLDER:"placeholder",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},X={SCROLLED_BOTTOM:`${U}-scrolled-bottom`},o={elementName:U,classes:h,selectors:V,attributes:G,events:X};var g=class extends Y{constructor(e){super(e);this._selectElement=f(e,o.selectors.ROOT),this._leadingSlot=f(e,o.selectors.LEADING_SLOT),this._addonEndSlot=f(this._component,o.selectors.ADDON_END_SLOT),this._selectedTextElement=f(e,o.selectors.SELECTED_TEXT),this._targetElement=this._selectElement}initializeLabel(){this._labelElement=f(this._component,o.selectors.LABEL)}hasLabel(){return!!this._labelElement}initializeAccessibility(){this._component.setAttribute("role","combobox"),this._component.setAttribute("aria-haspopup","true"),this._component.setAttribute("aria-expanded","false"),(!this._component.hasAttribute("tabindex")||this._component.tabIndex===-1)&&(this._component.tabIndex=0)}initializeFloatingLabel(){return new O(this._labelElement)}setLabel(e){(!this._component.hasAttribute("aria-label")||this._component.getAttribute("aria-label")===this._labelElement.textContent)&&this._component.setAttribute("aria-label",e),this._labelElement.textContent=e}addRootClass(e){this._selectElement.classList.add(e)}removeRootClass(e){this._selectElement.classList.remove(e)}setPlaceholderText(e){d(this._selectedTextElement,!!e,"placeholder",e)}addClickListener(e){this._component.addEventListener("click",e)}removeClickListener(e){this._component.removeEventListener("click",e)}addMouseDownListener(e){this._component.addEventListener("mousedown",e)}removeMouseDownListener(e){this._component.removeEventListener("mousedown",e)}addTargetListener(e,i){this._component.addEventListener(e,i)}removeTargetListener(e,i){this._component.removeEventListener(e,i)}open(e){super.open(e),this._component.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._component.setAttribute("aria-expanded","true"),s(this._selectElement,!0,o.classes.OPENED)}close(){this._component.setAttribute("aria-expanded","false"),this._component.removeAttribute("aria-activedescendant"),this._component.removeAttribute("aria-controls"),s(this._selectElement,!1,o.classes.OPENED),super.close()}updateActiveDescendant(e){d(this._component,!!e,"aria-activedescendant",e)}setSelectedText(e){this._selectedTextElement.textContent=e}setLeadingListener(e){this._leadingSlot.addEventListener("slotchange",e)}removeLeadingListener(e){this._leadingSlot.removeEventListener("slotchange",e)}setAddonEndListener(e){this._addonEndSlot.addEventListener("slotchange",e)}removeAddonEndListener(e){this._addonEndSlot.removeEventListener("slotchange",e)}hasLeadingElement(){return this._leadingSlot.assignedNodes().length>0}setDisabled(e){s(this._selectElement,e,t.classes.DISABLED),d(this._component,e,"aria-disabled","true"),this._component.tabIndex=e?-1:0}setInvalid(e){s(this._selectElement,e,t.classes.INVALID),d(this._component,e,"aria-invalid","true")}setRequired(e){s(this._selectElement,e,t.classes.REQUIRED),d(this._component,e,"aria-required","true")}setRoomy(e){s(this._selectElement,e,t.classes.ROOMY)}setDense(e){s(this._selectElement,e,t.classes.DENSE)}setMultiple(e){e?this.setHostAttribute("aria-multiselectable","true"):this.removeHostAttribute("aria-multiselectable")}getLabelWidth(e,i){return y(this._labelElement.innerText,{fontSize:e,fontFamily:i})}getLabelFontMetrics(){let e=getComputedStyle(this._labelElement);return{fontSize:parseInt(e.fontSize||"16",10),fontFamily:e.fontFamily||"Roboto"}}getTargetWidth(){return this._selectElement.getBoundingClientRect().width}hasAddonEndNodes(){return this._addonEndSlot?this._addonEndSlot.assignedNodes().length>0:!1}setFocus(){this._component.focus()}isWithinSelf(e){return!!this._component.shadowRoot&&this._component.shadowRoot.contains(e)||this._component.contains(e)}};var p=class extends B{constructor(e){super(e);this._shape="default";this._label="";this._disabled=!1;this._invalid=!1;this._required=!1;this._floatLabelType="auto";this._density="default";this._isInitialized=!1;this._leadingChangeListener=i=>this._onLeadingSlotChanged(i),this._addonEndChangeListener=i=>this._onAddonEndSlotChanged(i),this._targetWidthCallback=()=>this._adapter.getTargetWidth(),this._mousedownListener=i=>this._onMouseDown(i)}initialize(){super.initialize(),super.initializeTarget(),this._initializeLabel(),this._initializeAccessibility(),this._adapter.setPlaceholderText(this._placeholder),this._applyDensity(),this._setShapeType(),this._detectLeadingElement(),this._detectAddonEndContent(),this._adapter.addMouseDownListener(this._mousedownListener),this._adapter.setLeadingListener(this._leadingChangeListener),this._adapter.setAddonEndListener(this._addonEndChangeListener),this._disabled&&this._adapter.setDisabled(!0),this._invalid&&this._adapter.setInvalid(!0),this._isInitialized=!0}disconnect(){super.disconnect(),this._adapter.removeMouseDownListener(this._mousedownListener),this._adapter.removeLeadingListener(this._leadingChangeListener),this._adapter.removeAddonEndListener(this._leadingChangeListener),this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeLabel(){if(this._adapter.initializeLabel(),this._updateLabel(),this._floatingLabelInstance=this._adapter.initializeFloatingLabel(),this._floatLabelType==="always")this._floatLabel(!0);else{let e=!!this._getSelectedText(),i=!!this._placeholder;this._floatLabel(e||i)}}_destroyLabel(){this._floatingLabelInstance&&(this._floatingLabelInstance.destroy(),this._floatingLabelInstance=void 0)}_initializeValue(){super._initializeValue(),this._selectedValues.length&&this._floatLabel(!0)}_initializeAccessibility(){this._adapter.setMultiple(this._multiple),this._required&&this._adapter.setHostAttribute("aria-required","true"),this._disabled&&this._adapter.setHostAttribute("aria-disabled","true"),this._invalid&&this._adapter.setHostAttribute("aria-invalid","true")}_onMouseDown(e){this._adapter.isWithinSelf(e.target)&&e.preventDefault()}_onLeadingSlotChanged(e){this._detectLeadingElement()}_onAddonEndSlotChanged(e){this._detectAddonEndContent()}_detectLeadingElement(){this._adapter.hasLeadingElement()?this._adapter.addRootClass(t.classes.LEADING):this._adapter.removeRootClass(t.classes.LEADING)}_detectAddonEndContent(){this._adapter.hasAddonEndNodes()?this._adapter.addRootClass(t.classes.ADDON_END):this._adapter.removeRootClass(t.classes.ADDON_END)}_onClick(e){this._disabled||L(e).find(r=>r.classList&&r.classList.contains(t.classes.ADDON_END_CONTAINER))||(this.setFocus(),super._onClick(e))}_onFocus(e){this._disabled||(this._setFocused(),super._onFocus(e))}_floatLabel(e){!this._floatingLabelInstance||(e?this._adapter.addRootClass(o.classes.LABEL_FLOAT):this._adapter.removeRootClass(o.classes.LABEL_FLOAT),this._floatLabelType==="always"&&(e=!0),this._floatingLabelInstance.float(e,this._floatLabelType==="always"))}_onBlur(e){super._onBlur(e),this._setBlurred()}_onDismiss(){super._onDismiss(),this._setBlurred()}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}async _onSelect(e,i,r=!0){let u=await super._onSelect(e,i,r);return u&&(this._adapter.setSelectedText(this._getSelectedText()),r&&!this._multiple&&this._adapter.setFocus()),u}_setFocused(){this._adapter.addRootClass(t.classes.FOCUSED),this._floatLabel(!0)}_setBlurred(){var e;this._adapter.removeRootClass(t.classes.FOCUSED),!this._selectedValues.length&&!((e=this._placeholder)!=null&&e.length)&&this._floatLabel(!1)}_reset(){var e;super._reset(),this._adapter.setSelectedText(""),this._floatLabel(!((e=this._placeholder)!=null&&e.length))}_updateLabel(){this._adapter.hasLabel()&&this._adapter.setLabel(this._label),this._label&&this._density!=="dense"?this._adapter.addRootClass(t.classes.LABEL):this._adapter.removeRootClass(t.classes.LABEL)}_applyValue(e){super._applyValue(e);let i=this._getSelectedText();this._adapter.setSelectedText(i),this._open||this._floatLabel(!!i||!!this._placeholder)}_applyDensity(){this._adapter.setRoomy(this._density==="roomy"),this._adapter.setDense(this._density==="dense")}_setShapeType(){this._shape==="rounded"?this._adapter.addRootClass(t.classes.SHAPE_ROUNDED):this._adapter.removeRootClass(t.classes.SHAPE_ROUNDED)}setFocus(){this._adapter.setFocus()}get label(){return this._label}set label(e){this._label!==e&&(this._label=e,this._updateLabel(),this._label?(this._initializeLabel(),this._adapter.setHostAttribute(o.attributes.LABEL,this._label)):(this._destroyLabel(),this.required=!1,this._adapter.removeHostAttribute(o.attributes.LABEL)))}get shape(){return this._shape}set shape(e){this._shape!==e&&(this._shape=e,this._isInitialized&&this._setShapeType(),this._adapter.setHostAttribute(t.attributes.SHAPE,this._shape))}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this._adapter.setDisabled(this._disabled),this._initializeLabel())}get invalid(){return this._invalid}set invalid(e){this._invalid!==e&&(this._invalid=e,this._adapter.setInvalid(this._invalid))}get required(){return this._required}set required(e){this._required!==e&&(this._required=e,this._adapter.setRequired(this._required),this._adapter.toggleHostAttribute(t.attributes.REQUIRED,this._required))}get density(){return this._density}set density(e){this._density!==e&&(this._density=e,this._applyDensity(),this._adapter.setHostAttribute(t.attributes.DENSITY,this._density.toString()),this._initializeLabel())}get floatLabelType(){return this._floatLabelType}set floatLabelType(e){this._floatLabelType!==e&&(this._floatLabelType=e,this._floatLabel(this._floatLabelType==="always"||!!this._placeholder),this._adapter.setHostAttribute(t.attributes.FLOAT_LABEL_TYPE,v(this._floatLabelType)?this._floatLabelType.toString():""))}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder!==e&&(this._placeholder=e,this._adapter.setPlaceholderText(this._placeholder),this._initializeLabel())}};var $='<template><div class="forge-select__wrapper" part="root"><div class="forge-select forge-field" part="container"><div class="forge-select__leading-container" part="leading-container"><slot name="leading"></slot></div><div class="forge-field__label-input-container" part="label-input-container"><div id="selected-text" class="forge-select__selected-text" part="text" aria-live="assertive" aria-atomic="true"></div><label id="select-label" aria-hidden="true" part="label"></label></div><forge-icon class="forge-select__dropdown-icon" name="arrow_drop_down" part="icon"></forge-icon><div class="forge-field__addon-end-container" part="addon-end-container"><slot name="addon-end"></slot></div></div><slot name="helper-text"></slot></div></template>',Q='.forge-select{-webkit-box-sizing:border-box;box-sizing:border-box;display:-webkit-box;display:flex;-webkit-box-align:center;align-items:center;position:relative;z-index:1;z-index:var(--forge-z-index-surface,1);margin-top:0;margin-top:var(--forge-select-margin-top,0)}.forge-select.forge-field--disabled{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5);cursor:not-allowed}.forge-select:not(.forge-field--dense):not(.forge-field--roomy){height:3rem;height:var(--forge-select-height,3rem)}.forge-select.forge-field--roomy:not(.forge-field--dense){height:3.5rem;height:var(--forge-select-height,3.5rem)}.forge-select.forge-field--dense:not(.forge-field--roomy){height:1.5rem;height:var(--forge-select-height,1.5rem)}.forge-field::before{content:"";display:-webkit-box;display:flex;position:absolute;top:0;right:0;left:0;z-index:-1;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;max-width:100%;height:100%;pointer-events:none;border-style:solid;border-style:var(--forge-select-border-style,solid);border-width:1px;-webkit-transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-color .2s 0s cubic-bezier(0, 0, .2, 1);background-color:transparent;background-color:var(--forge-select-theme-background,transparent);text-align:left}.forge-field[dir=rtl]::before,[dir=rtl] .forge-field::before{text-align:right}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused)::before{border-color:rgba(0,0,0,.38);border-color:var(--mdc-theme-text-icon-on-background,rgba(0,0,0,.38))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid):not(.forge-field--focused):hover::before{border-color:rgba(0,0,0,.87);border-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled)::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5)}.forge-field--invalid:not(.forge-field--disabled)::before{border-color:#b00020;border-color:var(--mdc-theme-error,#b00020)}.forge-field--invalid:not(.forge-field--disabled):not(.forge-field--focused):hover::before{border-color:#db8a98;border-color:var(--forge-theme-error-hover,#db8a98)}.forge-field--disabled::before{border-color:rgba(0,0,0,.12);border-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--shape-rounded){border-radius:4px}.forge-field:not(.forge-field--shape-rounded)::before{border-radius:4px}.forge-field--shape-rounded{border-radius:28px}.forge-field--shape-rounded::before{border-radius:28px}.forge-field--disabled::before{background-color:#f5f5f5;background-color:var(--forge-theme-form-field-disabled-on-background,#f5f5f5)}.forge-field--focused::before{border-color:#3f51b5;border-color:var(--mdc-theme-primary,#3f51b5);border-width:2px}.forge-field__label-input-container{position:relative;-webkit-box-flex:1;flex:1 1 0.0001px;height:100%;display:-webkit-box;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;flex-direction:row;-webkit-box-align:center;align-items:center;min-width:0}.forge-field~::slotted([slot=helper-text]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-caption-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));line-height:1.25rem;line-height:var(--mdc-typography-caption-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:.0333333333em;letter-spacing:var(--mdc-typography-caption-letter-spacing, .0333333333em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-caption-text-transform,inherit);display:block;min-height:1.5rem;line-height:normal;padding-top:4px;-webkit-box-sizing:border-box;box-sizing:border-box}.forge-field:not(.forge-field--dense):not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field--roomy:not(.forge-field--dense)~::slotted([slot=helper-text]){font-size:.875rem}.forge-field--dense:not(.forge-field--roomy)~::slotted([slot=helper-text]){font-size:.75rem}.forge-field~::slotted([slot=helper-text]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled)~::slotted([slot=helper-text]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field:not(.forge-field--shape-rounded)~::slotted([slot=helper-text]){margin-left:12px}.forge-field--shape-rounded~::slotted([slot=helper-text]){margin-left:32px}.forge-field ::slotted([slot=leading]){display:-webkit-box;display:flex;align-self:center}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=leading]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=leading]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field ::slotted([slot=leading]){margin:0 4px}.forge-field ::slotted([slot=leading]:not(forge-icon-button)){padding:6px}.forge-field__addon-end-container{display:none}.forge-field--addon-end .forge-field__addon-end-container{height:100%;width:auto;display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;padding:0 4px;border-left-width:1px;border-left-style:solid;-webkit-transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1);transition:border-left-color .2s 0s cubic-bezier(0, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.54);border-left-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field:not(.forge-field--disabled):not(.forge-field--focused):not(.forge-field--invalid) .forge-field__addon-end-container:hover{border-left-color:rgba(0,0,0,.87);border-left-color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#3f51b5;border-left-color:var(--mdc-theme-primary,#3f51b5)}.forge-field.forge-field--invalid:not(.forge-field--disabled) .forge-field__addon-end-container{border-left-color:#b00020;border-left-color:var(--mdc-theme-error,#b00020)}.forge-field.forge-field--invalid:not(.forge-field--focused):not(.forge-field--disabled) .forge-field__addon-end-container:hover{border-left-color:#db8a98;border-left-color:var(--forge-theme-error-hover,#db8a98)}.forge-field.forge-field--disabled .forge-field__addon-end-container{border-left-color:rgba(0,0,0,.12);border-left-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12))}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) ::slotted([slot=addon-end]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) ::slotted([slot=addon-end]){color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled ::slotted([slot=addon-end]){color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-select__leading-container{display:-webkit-box;display:flex;align-self:center}.forge-field label{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65));pointer-events:none;right:0;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-subtitle1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-subtitle1-font-weight,400);letter-spacing:.009375em;letter-spacing:var(--mdc-typography-subtitle1-letter-spacing, .009375em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-decoration:var(--mdc-typography-subtitle1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-subtitle1-text-transform,inherit);font-size:var(--mdc-typography-subtitle1-font-size, 1rem);position:absolute;left:0;-webkit-transform-origin:left top;transform-origin:left top;line-height:1.1rem;text-align:left;text-overflow:ellipsis;white-space:nowrap;cursor:text;overflow:hidden;will-change:transform;-webkit-transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),color 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field label[dir=rtl],[dir=rtl] .forge-field label{right:0;left:auto;-webkit-transform-origin:right top;transform-origin:right top;text-align:right}.forge-field--dense:not(.forge-field--roomy) label{display:none}.forge-field--required label::after{content:none}.forge-field--required label::before{color:#b00020;color:var(--mdc-theme-error,#b00020);content:"*";margin-right:4px}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{font-size:1rem}.forge-field--roomy:not(.forge-field--dense) label{font-size:1rem}.forge-field--disabled label{color:rgba(0,0,0,.38);color:var(--forge-theme-label-disabled-on-background,rgba(0,0,0,.38))}.forge-field--invalid:not(.forge-field--disabled) label{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label{top:1rem}.forge-field--roomy:not(.forge-field--dense) label{top:1.285rem}.forge-field:not(.forge-field--shape-rounded):not(.forge-field--leading) label{left:12px!important}.forge-field--shape-rounded:not(.forge-field--leading) label{left:32px!important}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end):not(.forge-field--shape-rounded) label{padding-right:12px}.forge-field:not(.forge-field--trailing):not(.forge-field--addon-end).forge-field--shape-rounded label{padding-right:32px}.forge-field label.forge-floating-label--float-above{color:rgba(0,0,0,.65);color:var(--forge-theme-form-field-label-on-background,rgba(0,0,0,.65))}.forge-field--disabled label.forge-floating-label--float-above{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6))}.forge-field--invalid:not(.forge-field--disabled) label.forge-floating-label--float-above{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--focused:not(.forge-field--invalid):not(.forge-field--disabled) label.forge-floating-label--float-above{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above{-webkit-transform:translateY(-.54rem) scale(.8125);transform:translateY(-.54rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above{-webkit-transform:translateY(-.72rem) scale(.8125);transform:translateY(-.72rem) scale(.8125);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.62rem) scale(1);transform:translateY(-.62rem) scale(1);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--float-above.forge-floating-label--float-above-end-keyframe{-webkit-transition:none;transition:none;font-size:.8125rem;-webkit-transform:translateY(-.8rem) scale(1);transform:translateY(-.8rem) scale(1);cursor:auto}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.62rem) scale(.8125);transform:translateY(-.62rem) scale(.8125);cursor:auto}.forge-field--roomy:not(.forge-field--dense) label.forge-floating-label--unfloat-above-start-keyframe{-webkit-transition:none;transition:none;font-size:1rem;-webkit-transform:translateY(-.8rem) scale(.8125);transform:translateY(-.8rem) scale(.8125);cursor:auto}.forge-field .forge-select__selected-text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:block;overflow:hidden;text-overflow:ellipsis;align-self:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;height:100%;white-space:nowrap;-webkit-transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);transition:opacity 150ms 0s cubic-bezier(.4, 0, .2, 1);border:none;background:0 0;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;line-height:normal;min-width:0;font-size:var(--forge-select-font-size, 1rem);padding:0 12px;padding-right:0}.forge-field:not(.forge-field--disabled) .forge-select__selected-text{color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}.forge-field--disabled .forge-select__selected-text{color:rgba(0,0,0,.6);color:var(--forge-theme-form-field-text-disabled-on-background,rgba(0,0,0,.6));cursor:not-allowed}.forge-field:not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{font-size:1rem;font-size:var(--forge-select-font-size, 1rem)}.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{font-size:.875rem;font-size:var(--forge-select-font-size, .875rem)}.forge-field .forge-select__selected-text{padding:0 12px}.forge-field--label .forge-select__selected-text{padding-top:24px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-top:29px}.forge-field--shape-rounded:not(.forge-field--leading) .forge-select__selected-text{padding-left:32px}.forge-field--leading .forge-select__selected-text{padding-left:0}.forge-field--label .forge-select__selected-text{padding-bottom:3px}.forge-field--roomy.forge-field--label .forge-select__selected-text{padding-bottom:8px}.forge-field:not(.forge-field--label):not(.forge-field--dense):not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height, 3rem)}.forge-field:not(.forge-field--label).forge-field--roomy:not(.forge-field--dense) .forge-select__selected-text{line-height:var(--forge-select-height-roomy, 3.5rem)}.forge-field:not(.forge-field--label).forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{line-height:var(--forge-select-height-dense, 1.5rem)}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__selected-text{padding:0 8px}.forge-field .forge-select__selected-text:empty::before{content:attr(placeholder);color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));font-size:.875rem}.forge-field .forge-select--label .forge-select__selected-text{padding-top:25px}.forge-field .forge-select__dropdown-icon{display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;-webkit-box-align:center;align-items:center;width:24px;height:100%;-webkit-box-flex:0;flex:none;-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);pointer-events:none;margin-right:8px}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-select--opened .forge-field .forge-select__dropdown-icon{-webkit-transform:rotate(180deg);transform:rotate(180deg);-webkit-transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1);transition:transform 150ms cubic-bezier(.4, 0, .2, 1),-webkit-transform 150ms cubic-bezier(.4, 0, .2, 1)}.forge-field:not(.forge-field--disabled):not(.forge-field--invalid) .forge-select__dropdown-icon{color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-field--invalid:not(.forge-field--disabled) .forge-select__dropdown-icon{color:#b00020;color:var(--mdc-theme-error,#b00020)}.forge-field--disabled .forge-select__dropdown-icon{color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38));cursor:not-allowed;pointer-events:none}.forge-field.forge-field--dense:not(.forge-field--roomy) .forge-select__dropdown-icon{margin-right:4px}:host{display:block;contain:layout}:host(:focus){outline:0}:host([hidden]){display:none}',l=class extends M{constructor(){super();D.define([w,k,A]),x(this,$,Q),this._foundation=new p(new g(this))}static get observedAttributes(){return[t.attributes.DENSITY,t.attributes.FLOAT_LABEL_TYPE,t.attributes.SHAPE,t.attributes.INVALID,t.attributes.REQUIRED,o.attributes.LABEL,o.attributes.MULTIPLE,o.attributes.VALUE,o.attributes.DISABLED,o.attributes.PLACEHOLDER,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,c.attributes.POPUP_CLASSES,c.attributes.OPTION_LIMIT,c.attributes.SYNC_POPUP_WIDTH,c.attributes.CONSTRAIN_POPUP_WIDTH,c.attributes.WRAP_OPTION_TEXT]}attributeChangedCallback(e,i,r){switch(e){case t.attributes.DENSITY:this.density=r;return;case t.attributes.FLOAT_LABEL_TYPE:this.floatLabelType=r;return;case t.attributes.SHAPE:this.shape=r;break;case t.attributes.INVALID:this.invalid=b(r);return;case t.attributes.REQUIRED:this.required=b(r);return;case o.attributes.LABEL:this.label=r;return;case o.attributes.DISABLED:this.disabled=b(r);return;case o.attributes.PLACEHOLDER:this.placeholder=r;return}super.attributeChangedCallback(e,i,r)}};a([n()],l.prototype,"label",2),a([n()],l.prototype,"disabled",2),a([n()],l.prototype,"invalid",2),a([n()],l.prototype,"required",2),a([n()],l.prototype,"density",2),a([n()],l.prototype,"floatLabelType",2),a([n()],l.prototype,"shape",2),a([n()],l.prototype,"placeholder",2),l=a([T({name:o.elementName,dependencies:[H,q,F,I,z,N,C,W,P,R]})],l);function He(){E(l)}export{o as a,g as b,p as c,l as d,He as e};
7
+ //# sourceMappingURL=chunk.5WNKQTXX.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as rt}from"./chunk.LIKJD4SK.js";import{d as at}from"./chunk.PYIFIHDK.js";import{a as f,b as nt}from"./chunk.MLV25D2G.js";import{h as st}from"./chunk.ESR2NHOS.js";import{c as et}from"./chunk.KE6GOYAB.js";import{e as tt}from"./chunk.RG6CDWEX.js";import{e as it}from"./chunk.V7WKXEZC.js";import{a as C,b as ot}from"./chunk.7A6MX6CS.js";import{j as K}from"./chunk.MZLPUI6R.js";import{a as F}from"./chunk.YI4JTY4T.js";import{a as Q,d as Z,l as E}from"./chunk.JHBCYICS.js";import{a as $}from"./chunk.ARJ3EVVO.js";import{g as J}from"./chunk.FVRSGKJD.js";import{j as b,k as X,n as G,o as q,p as Y,q as j}from"./chunk.U6WGJELL.js";import{a as W}from"./chunk.G5MGGEFP.js";import{a as u}from"./chunk.KTGSZEAG.js";import{a as R,b as z}from"./chunk.BE7PZANN.js";import{a as N,e as H,g as V,i as U,l as B}from"./chunk.Y4GKBJGI.js";import{m as A,s as P,u as x}from"./chunk.PN26D52V.js";import{a as D,k as m,l as y,o as L}from"./chunk.J2M2MXP2.js";import{a as w,f as p}from"./chunk.MCIQXNKY.js";var h=`${z}time-picker`,lt={TOGGLE:"forge-time-picker-toggle",VALUE:"value",OPEN:"open",ALLOW_SECONDS:"allow-seconds",MASKED:"masked",SHOW_MASK_FORMAT:"show-mask-format",USE_24_HOUR_TIME:"use-24-hour-time",ALLOW_INVALID_TIME:"allow-invalid-time",MIN:"min",MAX:"max",START_TIME:"start-time",STEP:"step",ALLOW_INPUT:"allow-input",SHOW_NOW:"show-now",SHOW_HOUR_OPTIONS:"show-hour-options",DISABLED:"disabled",POPUP_CLASSES:"popup-classes",ALLOW_DROPDOWN:"allow-dropdown"},ft={INPUT:"input, input[forge-time-picker-input]",TOGGLE:`[${lt.TOGGLE}]`},gt={OPEN:`${h}-open`,CLOSE:`${h}-close`,INPUT:`${h}-input`,CHANGE:`${h}-change`},vt={DEFAULT_MINUTE_STEP:60,MAX_DAY_MILLIS:864e5,MAX_DAY_MINUTES:1440},s={elementName:h,attributes:lt,selectors:ft,events:gt,numbers:vt};var g=class extends W{constructor(e){super(e)}initialize(){this._inputElement=this._component.querySelector(s.selectors.INPUT)}initializeMask(e){this._inputMask&&this._inputMask.destroy(),this._inputMask=new J(this._inputElement,e)}destroy(){this._targetElement=void 0,this._toggleElement=void 0,this._inputElement=void 0}destroyMask(){this._inputMask&&(this._inputMask.destroy(),this._inputMask=void 0)}initializeAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("autocorrect","off"),this._inputElement.setAttribute("autocapitalize","off"),this._inputElement.setAttribute("spellcheck","false"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","assertive"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false")}addInputListener(e,i,n){this._inputElement.addEventListener(e,i,{capture:n})}removeInputListener(e,i,n){this._inputElement&&this._inputElement.removeEventListener(e,i,{capture:n})}addToggleListener(e,i){this._toggleElement&&this._toggleElement.addEventListener(e,i)}removeToggleListener(e,i){this._toggleElement&&this._toggleElement.removeEventListener(e,i)}hasInputElement(){return!!this._inputElement}tryCreateToggle(){let e=this._component.querySelector(f.elementName),i=this._component.querySelector(s.selectors.TOGGLE);if(e){let n=e.querySelector(`${C.elementName}[slot=trailing]`);if(n||i){this._toggleElement=n||i;return}let a=document.createElement(C.elementName);a.slot="trailing",a.dense=!0,a.densityLevel=3,a.style.marginRight="4px";let r=document.createElement("button");r.type="button",r.tabIndex=-1,r.setAttribute("aria-label","Toggle time dropdown");let d=document.createElement(Q.elementName);d.name="clock_outline",r.appendChild(d),a.appendChild(r),e.appendChild(a),this._toggleElement=a}else i&&(this._toggleElement=i)}tryFocusInput(){this._inputElement.select()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return P()===this._inputElement}setInputValue(e,i){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.update(),i&&(this._emitInputEvent("change"),this._emitInputEvent("input")))}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this.setToggleDisabled(e)}attachDropdown(e){this._listDropdown=new st(this._inputElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`)}detachDropdown(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0),this._inputElement.removeAttribute("aria-controls")}propagateKey(e){var i;(i=this._listDropdown)==null||i.handleKey(e)}setActiveDescendant(e){x(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._getTargetElement(e).getBoundingClientRect().width}_emitInputEvent(e){this._inputElement.dispatchEvent(new Event(e))}emitInputEvent(e,i){U(this._inputElement,e,i)}setInputReadonly(e){this._inputElement.readOnly=e}setToggleDisabled(e){if(this._toggleElement)if(this._toggleElement.setAttribute("aria-disabled",e.toString()),"disabled"in this._toggleElement)this._toggleElement.disabled=e;else{let i=this._toggleElement.querySelector("button");i&&(i.disabled=e)}}hasActiveOption(){var e,i;return((i=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?i:-1)>=0}activateOptionByIndex(e){var i;(i=this._listDropdown)==null||i.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}getActiveOption(){var e;return(e=this._listDropdown)==null?void 0:e.getActiveOption()}_getTargetElement(e){return this._targetElement?this._targetElement:(this._targetElement=e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement(),this._targetElement)}_getDefaultTargetElement(){let e=this._component.querySelector(f.elementName);if(e&&e.shadowRoot){let i=V(e,f.selectors.ROOT);if(i)return i}return this._component}};function v(o,t,e){if(!o||/^\s*$/.test(o))return null;let i=0,n=0,a=0;if(b.test(o)){let r=G(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0}else if(X.test(o)){let r=q(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0,i===12&&r.meridiem==="AM"&&(i=0),i<12&&r.meridiem==="PM"&&(i+=12)}else return null;return dt(i)+T(n)+(e?O(a):0)}function c(o,t,e){if(typeof o!="number"||o<0)return null;let i=Math.min(pt(o),23),n=Math.min(ut(o),59),r=o/(1e3*60)<720?"AM":"PM";t||(i=i<=12?i:i-12,i===0&&(i=12));let d=`${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`;if(e){let _=Math.min(M(o),59);d+=`:${String(_).padStart(2,"0")}`}return t||(d+=` ${r}`),d}function pt(o){return Math.abs(Math.floor(o/(1e3*60*60)))}function ut(o){return Math.abs(Math.floor(I(o)%60))}function I(o){return o/(1e3*60)}function M(o){return Math.abs(Math.floor(It(o)%60))}function It(o){return o/1e3}function dt(o){return o*60*60*1e3}function T(o){return o*60*1e3}function O(o){return o*1e3}function ct(o){return o-O(M(o))}function S(o){let t=new Date,e=t.getHours(),i=t.getMinutes();return dt(e)+T(i)+(o?O(t.getSeconds()):0)}function Rt(o,t,e=!1){o||(o=new Date);let i=v(t,!0,e);if(!i)return o.setHours(0,0,0),o;let n=pt(i),a=828e5;n>a?n=a:n<0&&(n=0);let r=ut(i),d=e?M(i):0;return o.setHours(n,r,d),o}var k=class{constructor(t){this._adapter=t;this._value=null;this._masked=!0;this._use24HourTime=!1;this._showMaskFormat=!1;this._min=null;this._max=null;this._restrictedTimes=[];this._startTime=null;this._step=s.numbers.DEFAULT_MINUTE_STEP;this._allowInput=!0;this._open=!1;this._allowSeconds=!1;this._allowInvalidTime=!1;this._showNow=!1;this._showHourOptions=!0;this._customOptions=[];this._disabled=!1;this._popupClasses=[];this._allowDropdown=!0;this._isInitialized=!1;this._identifier=D(),this._inputListener=e=>this._onInput(e),this._inputKeydownListener=e=>this._onInputKeydown(e),this._toggleMousedownListener=e=>this._onToggleMousedown(e),this._inputFocusListener=e=>this._onInputFocus(e),this._inputBlurListener=e=>this._onInputBlur(e),this._inputMousedownListener=e=>this._onInputMousedown(e)}initialize(){if(this._adapter.initialize(),!this._adapter.hasInputElement())throw new Error("Unable to locate <input> element to attach to.");if(this._adapter.initializeAccessibility(this._identifier),!this._value){let t=this._adapter.getInputValue();this._setValue(this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds))}this._adapter.addInputListener("focus",this._inputFocusListener),this._adapter.addInputListener("blur",this._inputBlurListener),this._adapter.addInputListener("keydown",this._inputKeydownListener,!0),this._formatInputValue(!1),typeof this._value=="number"&&this._applyValue(this._value,!1),this._applyAllowInput(),this._applyAllowDropdown(),this._applyDisabled(),this._applyMask(),this._isInitialized=!0}disconnect(){this._isInitialized=!1,this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("focus",this._inputFocusListener),this._adapter.removeInputListener("blur",this._inputBlurListener),this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.removeInputListener("keydown",this._inputKeydownListener,!0),this._masked&&this._adapter.destroyMask(),this._closeDropdown(),this._adapter.destroy()}_onInput(t){this._handleInput(this._adapter.getInputValue())}_onInputKeydown(t){var e,i;if(t.shiftKey)switch(t.code){case"Backspace":case"Delete":t.preventDefault(),this._trySetValue(null)&&this._formatInputValue();return}switch(t.code){case"Tab":this._open&&this._selectActiveOption();break;case"Esc":case"Escape":this._open&&(t.preventDefault(),t.stopPropagation(),this._closeDropdown(!0));break;case"Down":case"ArrowDown":this._allowDropdown&&(t.preventDefault(),this._open?this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption():(this._openDropdown(),typeof((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0?this._adapter.activateOptionByIndex((i=this._dropdownConfig)==null?void 0:i.visibleStartIndex):this._adapter.activateFirstOption()));break;case"ArrowUp":this._allowDropdown&&(t.preventDefault(),this._open&&(this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption()));break;case"Enter":case"NumpadEnter":case"Home":case"End":this._open&&((t.code==="Enter"||t.code==="NumpadEnter")&&t.stopPropagation(),t.preventDefault(),this._adapter.propagateKey(t.code));break;case"KeyN":t.preventDefault();let n=S(this._allowSeconds);if(this._value!==n){let a=c(n,!0,this._allowSeconds);this._emitChangeEvent(a)&&(this._applyValue(n),this._selectInputText())}break}}_trySetActiveOption(){var t,e;!this._adapter.hasActiveOption()&&typeof((t=this._dropdownConfig)==null?void 0:t.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0&&this._adapter.activateOptionByIndex((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)}_selectActiveOption(){let t=this._adapter.getActiveOption();t&&this._onSelect(t.value)}_onToggleMousedown(t){this._disabled||!this.allowDropdown||(t.stopPropagation(),!this._adapter.isInputDisabled()&&(t.preventDefault(),this._open?this._closeDropdown(!0):(F.isMobile?this._adapter.tryBlurInput():this._adapter.tryFocusInput(),this._openDropdown())))}_onInputFocus(t){this._allowInput&&this._adapter.selectInputText()}_onInputBlur(t){this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeDropdown(!0)}_onInputMousedown(t){!this._allowInput&&!this._open&&(this._openDropdown(),this._adapter.tryFocusInput(),window.requestAnimationFrame(()=>this._adapter.selectInputText()))}_applyDisabled(){this._adapter.setDisabled(this._disabled)}_applyMask(){if(this._masked&&this._allowInput){let t={showMaskFormat:this._showMaskFormat,use24HourTime:this._use24HourTime,showSeconds:this._allowSeconds,prepareCallback:this._prepareMaskCallback,onChange:L(e=>this._handleInput(e),0,!0)};this._adapter.initializeMask(t)}else this._adapter.destroyMask(),this._formatInputValue()}_applyAllowInput(){this._adapter.setInputReadonly(!this._allowInput),this._allowInput?(this._adapter.removeInputListener("mousedown",this._inputMousedownListener),this._masked||this._adapter.addInputListener("input",this._inputListener)):(this._adapter.addInputListener("mousedown",this._inputMousedownListener),this._adapter.removeInputListener("input",this._inputListener))}_applyAllowDropdown(){this._adapter.setToggleDisabled(!this._allowDropdown),this._allowDropdown?(this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.tryCreateToggle(),this._adapter.addToggleListener("mousedown",this._toggleMousedownListener)):this._open&&this._closeDropdown(!0)}_applyAllowSeconds(){let t=this._value;if(this._allowSeconds){if(this._isInitialized&&t!==this._value){let e=c(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(ct(this._value)),this._isInitialized&&t!==this._value){let e=c(this._value,!0,!1);this._emitChangeEvent(e)}}}_handleInput(t){let e=t;if(!this._allowInput)return;this._open&&this._closeDropdown(!0),t=j(t,this._use24HourTime,this._allowSeconds),typeof this._coercionCallback=="function"&&(t=this._coercionCallback.call(null,e,t,this._allowSeconds)),this._isValidTimeFormat(t)||(t="");let i;!this._masked&&typeof this._parseCallback=="function"?i=this._parseCallback.call(null,t):i=this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds),i=this._validateMillis(i),this._trySetValue(i)}_emitChangeEvent(t,e=!1){return this._adapter.emitHostEvent(s.events.CHANGE,t,!0,!e)}_trySetValue(t){if(t===this._value)return!1;let e=c(t,!0,this._allowSeconds);return this._adapter.emitInputEvent(s.events.INPUT,e),this._value!==t&&this._emitChangeEvent(e)?(this._setValue(t),!0):!1}_setValue(t){this._value=this._normalizeTimeValue(t)}_validateMillis(t){if(typeof t=="number"){let e=typeof this._min=="number"&&t<this._min,i=typeof this._max=="number"&&t>this._max;(e||i)&&(t=null)}return typeof t=="number"&&this._restrictedTimes.length&&this._restrictedTimes.includes(t)&&(t=null),t}_isValidTimeFormat(t){return!this._masked&&typeof this._validationCallback=="function"?this._validationCallback.call(this,t):Y(t)}_isValidInputValue(t){return b.test(t)}_onSelect(t){if(this._closeDropdown(!0),!t.isCustom&&t.metadata==="now"&&(t.time=S(this._allowSeconds)),t.isCustom)if(typeof t.customCallback=="function"){let n=t.customCallback.call(null,t.metadata);if(typeof n!="number")throw new Error("Custom options must provide a time of day value in milliseconds.");t.time=n}else throw new Error("You must implement a `toMilliseconds` callback that returns the time value to use for this custom option.");if(this._value===t.time)return;let e=c(t.time,!0,this._allowSeconds);!this._emitChangeEvent(e)||(this._applyValue(t.time),this._selectInputText())}_selectInputText(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.isInputFocused()&&this._adapter.selectInputText()})})}_applyValue(t,e=!0){this._setValue(t);let i=this._formatValue(this._value);this._adapter.getInputValue()!==i&&this._adapter.setInputValue(i,e)}_normalizeTimeValue(t){return t==null?null:t<0?0:t>s.numbers.MAX_DAY_MILLIS?s.numbers.MAX_DAY_MILLIS:t}_openDropdown(){let t=this._generateTimeOptions();if(!this.allowDropdown||!t.length)return;this._formatInputValue(),this._open=!0,this._adapter.setHostAttribute(s.attributes.OPEN);let e=t.filter(a=>!a.divider&&!a.disabled),i=[],n=0;if(t.length)if(this._value!=null){let a=this._findClosestOptionIndex(this._value,e);a>=0&&(e[a].value.time===this._value?i=[e[a].value]:n=a)}else if(typeof this._startTime=="number"){let a=this._findClosestOptionIndex(this._startTime,e);a>=0&&a<e.length&&(n=a)}else this._startTime==null&&(n=this._getOptionIndexClosestCurrent(e));this._dropdownConfig={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,visibleStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:a=>this._onSelect(a),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:a=>this._adapter.setActiveDescendant(a),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)},this._adapter.attachDropdown(this._dropdownConfig),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._dropdownConfig=void 0,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_getOptionIndexClosestCurrent(t){let e=new Date,i=`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,n=v(i,!0,!1);return this._findClosestOptionIndex(n,t)}_findClosestOptionIndex(t,e){let i=e.reduce((n,a)=>Math.abs((a.value.time||0)-t)<Math.abs((n.value.time||0)-t)?a:n);return e.indexOf(i)}_formatInputValue(t=!0){let e=this._adapter.getInputValue();if(this._allowInvalidTime&&!this._masked&&e&&!this._value)return;let i=this._formatValue(this._value);e!==i&&(this._adapter.setInputValue(i,t),this._adapter.emitInputEvent(s.events.INPUT,i))}_generateTimeOptions(){let t=this._min!=null?Math.max(I(this._min),0):0,e=this._max!=null?Math.min(I(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],a=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=T(d),_t=this._restrictedTimes.includes(_),ht=c(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let r=n.findIndex(d=>d.value.time/1e3/60>=720);r>=0&&r<n.length-1&&n.splice(r,0,{label:"",value:null,divider:!0})}if(this._showNow){let r={time:null,metadata:"now"};a.push({label:"Now",value:r})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let r=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});a=[...a,...r]}return a.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),a.forEach((r,d)=>n.splice(d,0,r))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),v(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):c(this._value,this._use24HourTime,this._allowSeconds)||""}_warnInvalidFormat(t){console.warn(`The specified value "${t}" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" where HH is 00-23, mm is 00-59, and ss is 00-59.`)}get open(){return this._open}set open(t){this._open!==t&&this._isInitialized&&(this._open=t,this._open?this._openDropdown():this._closeDropdown())}get masked(){return this._masked}set masked(t){this._masked!==t&&(this._masked=t,this._isInitialized&&(this._masked?(this._adapter.removeInputListener("input",this._inputListener),this._applyMask()):(this._adapter.destroyMask(),this._formatInputValue(),this._adapter.addInputListener("input",this._inputListener))))}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(t){this._showMaskFormat!==t&&(this._showMaskFormat=t,this._isInitialized&&this._applyMask())}get allowSeconds(){return this._allowSeconds}set allowSeconds(t){this._allowSeconds!==t&&(this._allowSeconds=!!t,this._applyAllowSeconds(),this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.ALLOW_SECONDS,`${!!t}`))}get use24HourTime(){return this._use24HourTime}set use24HourTime(t){this._use24HourTime!==t&&(this._use24HourTime=!!t,this._isInitialized&&(this._adapter.destroyMask(),this._formatInputValue(),this._applyMask()),this._adapter.setHostAttribute(s.attributes.USE_24_HOUR_TIME,`${!!t}`))}get allowInvalidTime(){return this._allowInvalidTime}set allowInvalidTime(t){this._allowInvalidTime!==t&&(this._allowInvalidTime=!!t,this._adapter.setHostAttribute(s.attributes.ALLOW_INVALID_TIME,`${!!t}`))}get value(){return c(this._value,!0,this._allowSeconds)}set value(t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}let e=this._validateMillis(this._convertTimeStringToMillis(t,!0,!0));this._setValue(e),this._isInitialized&&this._applyValue(this._value)}get min(){return c(this._min,!0,this._allowSeconds)}set min(t){if(this._min!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._min=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get max(){return c(this._max,!0,this._allowSeconds)}set max(t){if(this._max!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._max=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get restrictedTimes(){return this._restrictedTimes.map(t=>c(t,!0,this._allowSeconds)).filter(t=>typeof t=="string")}set restrictedTimes(t){Array.isArray(t)||(t=[]),this._restrictedTimes=t.filter(e=>typeof e=="string").map(e=>this._convertTimeStringToMillis(e,!0,!0)).filter(e=>typeof e=="number")}get startTime(){return c(this._startTime,!0,this._allowSeconds)}set startTime(t){if(this._startTime!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._startTime=this._convertTimeStringToMillis(t,!0,this._allowSeconds)}}get step(){return this._step}set step(t){this._step=t}get allowInput(){return this._allowInput}set allowInput(t){this._allowInput!==t&&(this._allowInput=t,this._isInitialized&&(this._applyAllowInput(),this._applyMask()))}get popupTarget(){return this._popupTarget}set popupTarget(t){this._popupTarget!==t&&(this._popupTarget=t)}get showNow(){return this._showNow}set showNow(t){this._showNow!==t&&(this._showNow=t)}get showHourOptions(){return this._showHourOptions}set showHourOptions(t){this._showHourOptions!==t&&(this._showHourOptions=t)}get customOptions(){return this._customOptions}set customOptions(t){this._customOptions=Array.isArray(t)?t:[]}set validationCallback(t){this._validationCallback=t,this._isInitialized&&this._applyMask()}set parseCallback(t){this._parseCallback=t}set formatCallback(t){this._formatCallback=t}set coercionCallback(t){this._coercionCallback=t}set prepareMaskCallback(t){this._prepareMaskCallback=t,this._isInitialized&&this._applyMask()}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=!!t,this._isInitialized&&this._applyDisabled(),this._adapter.toggleHostAttribute(s.attributes.DISABLED,this._disabled))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(t){Array.isArray(t)?this._popupClasses=[...t]:this._popupClasses=[t]}get allowDropdown(){return this._allowDropdown}set allowDropdown(t){this._allowDropdown!==t&&(this._allowDropdown=t,this._isInitialized&&this._applyAllowDropdown())}};var Tt="<template><slot></slot></template>",kt=":host{display:block}:host([hidden]){display:none}",l=class extends B{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new k(new g(this))}static get observedAttributes(){return[s.attributes.VALUE,s.attributes.OPEN,s.attributes.ALLOW_SECONDS,s.attributes.MASKED,s.attributes.SHOW_MASK_FORMAT,s.attributes.USE_24_HOUR_TIME,s.attributes.ALLOW_INVALID_TIME,s.attributes.MIN,s.attributes.MAX,s.attributes.START_TIME,s.attributes.STEP,s.attributes.ALLOW_INPUT,s.attributes.SHOW_NOW,s.attributes.SHOW_HOUR_OPTIONS,s.attributes.DISABLED,s.attributes.POPUP_CLASSES,s.attributes.ALLOW_DROPDOWN]}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():A(this,s.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,i,n){switch(e){case s.attributes.VALUE:this.value=n;break;case s.attributes.OPEN:this.open=m(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=m(n);break;case s.attributes.MASKED:this.masked=m(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=m(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=m(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=m(n);break;case s.attributes.SHOW_NOW:this.showNow=m(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=m(n);break;case s.attributes.MIN:this.min=n;break;case s.attributes.MAX:this.max=n;break;case s.attributes.START_TIME:this.startTime=n;break;case s.attributes.STEP:this.step=y(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=m(n);break;case s.attributes.DISABLED:this.disabled=m(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=m(n);break}}};p([u()],l.prototype,"value",2),p([u()],l.prototype,"open",2),p([u()],l.prototype,"allowSeconds",2),p([u()],l.prototype,"masked",2),p([u()],l.prototype,"showMaskFormat",2),p([u()],l.prototype,"use24HourTime",2),p([u()],l.prototype,"allowInvalidTime",2),p([u()],l.prototype,"min",2),p([u()],l.prototype,"max",2),p([u()],l.prototype,"restrictedTimes",2),p([u()],l.prototype,"startTime",2),p([u()],l.prototype,"step",2),p([u()],l.prototype,"allowInput",2),p([u()],l.prototype,"showNow",2),p([u()],l.prototype,"showHourOptions",2),p([u()],l.prototype,"customOptions",2),p([u()],l.prototype,"validationCallback",2),p([u()],l.prototype,"parseCallback",2),p([u()],l.prototype,"formatCallback",2),p([u()],l.prototype,"coercionCallback",2),p([u()],l.prototype,"prepareMaskCallback",2),p([u()],l.prototype,"disabled",2),p([u()],l.prototype,"popupClasses",2),p([u()],l.prototype,"allowDropdown",2),p([u()],l.prototype,"popupTarget",2),l=p([R({name:s.elementName,dependencies:[et,tt,ot,E,it,E,at]})],l);var mt=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(s.elementName);return this._attachTextField(e),e}get inputElement(){return this._textFieldDelegate.inputElement}get textFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(s.events.CHANGE,i=>{var n;return e((n=i.detail)!=null?n:"")})}onInput(e){this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")})}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,a,r,d;let i={props:w({},(a=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:a.props),options:w({},(d=(r=this._config.options)==null?void 0:r.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function xe(){N(l)}export{s as a,g as b,v as c,c as d,pt as e,ut as f,I as g,M as h,It as i,dt as j,T as k,O as l,ct as m,S as n,Rt as o,k as p,l as q,mt as r,xe as s};
7
- //# sourceMappingURL=chunk.LFLREB3C.js.map
6
+ import{a as rt}from"./chunk.LIKJD4SK.js";import{d as at}from"./chunk.242YUZKU.js";import{a as f,b as nt}from"./chunk.MLV25D2G.js";import{h as st}from"./chunk.ESR2NHOS.js";import{c as et}from"./chunk.KE6GOYAB.js";import{e as tt}from"./chunk.RG6CDWEX.js";import{e as it}from"./chunk.V7WKXEZC.js";import{a as C,b as ot}from"./chunk.7A6MX6CS.js";import{j as K}from"./chunk.MZLPUI6R.js";import{a as F}from"./chunk.YI4JTY4T.js";import{a as Q,d as Z,l as E}from"./chunk.JHBCYICS.js";import{a as $}from"./chunk.ARJ3EVVO.js";import{g as J}from"./chunk.FVRSGKJD.js";import{j as b,k as X,n as G,o as q,p as Y,q as j}from"./chunk.U6WGJELL.js";import{a as W}from"./chunk.G5MGGEFP.js";import{a as u}from"./chunk.KTGSZEAG.js";import{a as R,b as z}from"./chunk.BE7PZANN.js";import{a as N,e as H,g as V,i as U,l as B}from"./chunk.Y4GKBJGI.js";import{m as A,s as P,u as x}from"./chunk.PN26D52V.js";import{a as D,k as m,l as y,o as L}from"./chunk.J2M2MXP2.js";import{a as w,f as p}from"./chunk.MCIQXNKY.js";var h=`${z}time-picker`,lt={TOGGLE:"forge-time-picker-toggle",VALUE:"value",OPEN:"open",ALLOW_SECONDS:"allow-seconds",MASKED:"masked",SHOW_MASK_FORMAT:"show-mask-format",USE_24_HOUR_TIME:"use-24-hour-time",ALLOW_INVALID_TIME:"allow-invalid-time",MIN:"min",MAX:"max",START_TIME:"start-time",STEP:"step",ALLOW_INPUT:"allow-input",SHOW_NOW:"show-now",SHOW_HOUR_OPTIONS:"show-hour-options",DISABLED:"disabled",POPUP_CLASSES:"popup-classes",ALLOW_DROPDOWN:"allow-dropdown"},ft={INPUT:"input, input[forge-time-picker-input]",TOGGLE:`[${lt.TOGGLE}]`},gt={OPEN:`${h}-open`,CLOSE:`${h}-close`,INPUT:`${h}-input`,CHANGE:`${h}-change`},vt={DEFAULT_MINUTE_STEP:60,MAX_DAY_MILLIS:864e5,MAX_DAY_MINUTES:1440},s={elementName:h,attributes:lt,selectors:ft,events:gt,numbers:vt};var g=class extends W{constructor(e){super(e)}initialize(){this._inputElement=this._component.querySelector(s.selectors.INPUT)}initializeMask(e){this._inputMask&&this._inputMask.destroy(),this._inputMask=new J(this._inputElement,e)}destroy(){this._targetElement=void 0,this._toggleElement=void 0,this._inputElement=void 0}destroyMask(){this._inputMask&&(this._inputMask.destroy(),this._inputMask=void 0)}initializeAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("autocorrect","off"),this._inputElement.setAttribute("autocapitalize","off"),this._inputElement.setAttribute("spellcheck","false"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","assertive"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false")}addInputListener(e,i,n){this._inputElement.addEventListener(e,i,{capture:n})}removeInputListener(e,i,n){this._inputElement&&this._inputElement.removeEventListener(e,i,{capture:n})}addToggleListener(e,i){this._toggleElement&&this._toggleElement.addEventListener(e,i)}removeToggleListener(e,i){this._toggleElement&&this._toggleElement.removeEventListener(e,i)}hasInputElement(){return!!this._inputElement}tryCreateToggle(){let e=this._component.querySelector(f.elementName),i=this._component.querySelector(s.selectors.TOGGLE);if(e){let n=e.querySelector(`${C.elementName}[slot=trailing]`);if(n||i){this._toggleElement=n||i;return}let a=document.createElement(C.elementName);a.slot="trailing",a.dense=!0,a.densityLevel=3,a.style.marginRight="4px";let r=document.createElement("button");r.type="button",r.tabIndex=-1,r.setAttribute("aria-label","Toggle time dropdown");let d=document.createElement(Q.elementName);d.name="clock_outline",r.appendChild(d),a.appendChild(r),e.appendChild(a),this._toggleElement=a}else i&&(this._toggleElement=i)}tryFocusInput(){this._inputElement.select()}tryBlurInput(){this._inputElement.blur()}selectInputText(){this._inputElement.select()}isInputDisabled(){return this._inputElement.disabled}isInputFocused(){return P()===this._inputElement}setInputValue(e,i){this._inputElement.value!==e&&(this._inputElement.value=e,this._inputMask&&this._inputMask.update(),i&&(this._emitInputEvent("change"),this._emitInputEvent("input")))}getInputValue(){return this._inputMask?this._inputMask.maskedValue:this._inputElement.value}setDisabled(e){this._inputElement.disabled=e,this._inputElement.setAttribute("aria-disabled",e.toString()),this.setToggleDisabled(e)}attachDropdown(e){this._listDropdown=new st(this._inputElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`)}detachDropdown(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0),this._inputElement.removeAttribute("aria-controls")}propagateKey(e){var i;(i=this._listDropdown)==null||i.handleKey(e)}setActiveDescendant(e){x(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._getTargetElement(e).getBoundingClientRect().width}_emitInputEvent(e){this._inputElement.dispatchEvent(new Event(e))}emitInputEvent(e,i){U(this._inputElement,e,i)}setInputReadonly(e){this._inputElement.readOnly=e}setToggleDisabled(e){if(this._toggleElement)if(this._toggleElement.setAttribute("aria-disabled",e.toString()),"disabled"in this._toggleElement)this._toggleElement.disabled=e;else{let i=this._toggleElement.querySelector("button");i&&(i.disabled=e)}}hasActiveOption(){var e,i;return((i=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?i:-1)>=0}activateOptionByIndex(e){var i;(i=this._listDropdown)==null||i.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}getActiveOption(){var e;return(e=this._listDropdown)==null?void 0:e.getActiveOption()}_getTargetElement(e){return this._targetElement?this._targetElement:(this._targetElement=e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement(),this._targetElement)}_getDefaultTargetElement(){let e=this._component.querySelector(f.elementName);if(e&&e.shadowRoot){let i=V(e,f.selectors.ROOT);if(i)return i}return this._component}};function v(o,t,e){if(!o||/^\s*$/.test(o))return null;let i=0,n=0,a=0;if(b.test(o)){let r=G(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0}else if(X.test(o)){let r=q(o);i=+r.hours||0,n=+r.minutes||0,a=+r.seconds||0,i===12&&r.meridiem==="AM"&&(i=0),i<12&&r.meridiem==="PM"&&(i+=12)}else return null;return dt(i)+T(n)+(e?O(a):0)}function c(o,t,e){if(typeof o!="number"||o<0)return null;let i=Math.min(pt(o),23),n=Math.min(ut(o),59),r=o/(1e3*60)<720?"AM":"PM";t||(i=i<=12?i:i-12,i===0&&(i=12));let d=`${String(i).padStart(2,"0")}:${String(n).padStart(2,"0")}`;if(e){let _=Math.min(M(o),59);d+=`:${String(_).padStart(2,"0")}`}return t||(d+=` ${r}`),d}function pt(o){return Math.abs(Math.floor(o/(1e3*60*60)))}function ut(o){return Math.abs(Math.floor(I(o)%60))}function I(o){return o/(1e3*60)}function M(o){return Math.abs(Math.floor(It(o)%60))}function It(o){return o/1e3}function dt(o){return o*60*60*1e3}function T(o){return o*60*1e3}function O(o){return o*1e3}function ct(o){return o-O(M(o))}function S(o){let t=new Date,e=t.getHours(),i=t.getMinutes();return dt(e)+T(i)+(o?O(t.getSeconds()):0)}function Rt(o,t,e=!1){o||(o=new Date);let i=v(t,!0,e);if(!i)return o.setHours(0,0,0),o;let n=pt(i),a=828e5;n>a?n=a:n<0&&(n=0);let r=ut(i),d=e?M(i):0;return o.setHours(n,r,d),o}var k=class{constructor(t){this._adapter=t;this._value=null;this._masked=!0;this._use24HourTime=!1;this._showMaskFormat=!1;this._min=null;this._max=null;this._restrictedTimes=[];this._startTime=null;this._step=s.numbers.DEFAULT_MINUTE_STEP;this._allowInput=!0;this._open=!1;this._allowSeconds=!1;this._allowInvalidTime=!1;this._showNow=!1;this._showHourOptions=!0;this._customOptions=[];this._disabled=!1;this._popupClasses=[];this._allowDropdown=!0;this._isInitialized=!1;this._identifier=D(),this._inputListener=e=>this._onInput(e),this._inputKeydownListener=e=>this._onInputKeydown(e),this._toggleMousedownListener=e=>this._onToggleMousedown(e),this._inputFocusListener=e=>this._onInputFocus(e),this._inputBlurListener=e=>this._onInputBlur(e),this._inputMousedownListener=e=>this._onInputMousedown(e)}initialize(){if(this._adapter.initialize(),!this._adapter.hasInputElement())throw new Error("Unable to locate <input> element to attach to.");if(this._adapter.initializeAccessibility(this._identifier),!this._value){let t=this._adapter.getInputValue();this._setValue(this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds))}this._adapter.addInputListener("focus",this._inputFocusListener),this._adapter.addInputListener("blur",this._inputBlurListener),this._adapter.addInputListener("keydown",this._inputKeydownListener,!0),this._formatInputValue(!1),typeof this._value=="number"&&this._applyValue(this._value,!1),this._applyAllowInput(),this._applyAllowDropdown(),this._applyDisabled(),this._applyMask(),this._isInitialized=!0}disconnect(){this._isInitialized=!1,this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("focus",this._inputFocusListener),this._adapter.removeInputListener("blur",this._inputBlurListener),this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.removeInputListener("keydown",this._inputKeydownListener,!0),this._masked&&this._adapter.destroyMask(),this._closeDropdown(),this._adapter.destroy()}_onInput(t){this._handleInput(this._adapter.getInputValue())}_onInputKeydown(t){var e,i;if(t.shiftKey)switch(t.code){case"Backspace":case"Delete":t.preventDefault(),this._trySetValue(null)&&this._formatInputValue();return}switch(t.code){case"Tab":this._open&&this._selectActiveOption();break;case"Esc":case"Escape":this._open&&(t.preventDefault(),t.stopPropagation(),this._closeDropdown(!0));break;case"Down":case"ArrowDown":this._allowDropdown&&(t.preventDefault(),this._open?this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption():(this._openDropdown(),typeof((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0?this._adapter.activateOptionByIndex((i=this._dropdownConfig)==null?void 0:i.visibleStartIndex):this._adapter.activateFirstOption()));break;case"ArrowUp":this._allowDropdown&&(t.preventDefault(),this._open&&(this._adapter.hasActiveOption()?this._adapter.propagateKey(t.code):this._trySetActiveOption()));break;case"Enter":case"NumpadEnter":case"Home":case"End":this._open&&((t.code==="Enter"||t.code==="NumpadEnter")&&t.stopPropagation(),t.preventDefault(),this._adapter.propagateKey(t.code));break;case"KeyN":t.preventDefault();let n=S(this._allowSeconds);if(this._value!==n){let a=c(n,!0,this._allowSeconds);this._emitChangeEvent(a)&&(this._applyValue(n),this._selectInputText())}break}}_trySetActiveOption(){var t,e;!this._adapter.hasActiveOption()&&typeof((t=this._dropdownConfig)==null?void 0:t.visibleStartIndex)=="number"&&this._dropdownConfig.visibleStartIndex>=0&&this._adapter.activateOptionByIndex((e=this._dropdownConfig)==null?void 0:e.visibleStartIndex)}_selectActiveOption(){let t=this._adapter.getActiveOption();t&&this._onSelect(t.value)}_onToggleMousedown(t){this._disabled||!this.allowDropdown||(t.stopPropagation(),!this._adapter.isInputDisabled()&&(t.preventDefault(),this._open?this._closeDropdown(!0):(F.isMobile?this._adapter.tryBlurInput():this._adapter.tryFocusInput(),this._openDropdown())))}_onInputFocus(t){this._allowInput&&this._adapter.selectInputText()}_onInputBlur(t){this._formatInputValue(),this._open&&!this._adapter.isInputFocused()&&this._closeDropdown(!0)}_onInputMousedown(t){!this._allowInput&&!this._open&&(this._openDropdown(),this._adapter.tryFocusInput(),window.requestAnimationFrame(()=>this._adapter.selectInputText()))}_applyDisabled(){this._adapter.setDisabled(this._disabled)}_applyMask(){if(this._masked&&this._allowInput){let t={showMaskFormat:this._showMaskFormat,use24HourTime:this._use24HourTime,showSeconds:this._allowSeconds,prepareCallback:this._prepareMaskCallback,onChange:L(e=>this._handleInput(e),0,!0)};this._adapter.initializeMask(t)}else this._adapter.destroyMask(),this._formatInputValue()}_applyAllowInput(){this._adapter.setInputReadonly(!this._allowInput),this._allowInput?(this._adapter.removeInputListener("mousedown",this._inputMousedownListener),this._masked||this._adapter.addInputListener("input",this._inputListener)):(this._adapter.addInputListener("mousedown",this._inputMousedownListener),this._adapter.removeInputListener("input",this._inputListener))}_applyAllowDropdown(){this._adapter.setToggleDisabled(!this._allowDropdown),this._allowDropdown?(this._adapter.removeToggleListener("mousedown",this._toggleMousedownListener),this._adapter.tryCreateToggle(),this._adapter.addToggleListener("mousedown",this._toggleMousedownListener)):this._open&&this._closeDropdown(!0)}_applyAllowSeconds(){let t=this._value;if(this._allowSeconds){if(this._isInitialized&&t!==this._value){let e=c(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(ct(this._value)),this._isInitialized&&t!==this._value){let e=c(this._value,!0,!1);this._emitChangeEvent(e)}}}_handleInput(t){let e=t;if(!this._allowInput)return;this._open&&this._closeDropdown(!0),t=j(t,this._use24HourTime,this._allowSeconds),typeof this._coercionCallback=="function"&&(t=this._coercionCallback.call(null,e,t,this._allowSeconds)),this._isValidTimeFormat(t)||(t="");let i;!this._masked&&typeof this._parseCallback=="function"?i=this._parseCallback.call(null,t):i=this._convertTimeStringToMillis(t,this._use24HourTime,this._allowSeconds),i=this._validateMillis(i),this._trySetValue(i)}_emitChangeEvent(t,e=!1){return this._adapter.emitHostEvent(s.events.CHANGE,t,!0,!e)}_trySetValue(t){if(t===this._value)return!1;let e=c(t,!0,this._allowSeconds);return this._adapter.emitInputEvent(s.events.INPUT,e),this._value!==t&&this._emitChangeEvent(e)?(this._setValue(t),!0):!1}_setValue(t){this._value=this._normalizeTimeValue(t)}_validateMillis(t){if(typeof t=="number"){let e=typeof this._min=="number"&&t<this._min,i=typeof this._max=="number"&&t>this._max;(e||i)&&(t=null)}return typeof t=="number"&&this._restrictedTimes.length&&this._restrictedTimes.includes(t)&&(t=null),t}_isValidTimeFormat(t){return!this._masked&&typeof this._validationCallback=="function"?this._validationCallback.call(this,t):Y(t)}_isValidInputValue(t){return b.test(t)}_onSelect(t){if(this._closeDropdown(!0),!t.isCustom&&t.metadata==="now"&&(t.time=S(this._allowSeconds)),t.isCustom)if(typeof t.customCallback=="function"){let n=t.customCallback.call(null,t.metadata);if(typeof n!="number")throw new Error("Custom options must provide a time of day value in milliseconds.");t.time=n}else throw new Error("You must implement a `toMilliseconds` callback that returns the time value to use for this custom option.");if(this._value===t.time)return;let e=c(t.time,!0,this._allowSeconds);!this._emitChangeEvent(e)||(this._applyValue(t.time),this._selectInputText())}_selectInputText(){window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.isInputFocused()&&this._adapter.selectInputText()})})}_applyValue(t,e=!0){this._setValue(t);let i=this._formatValue(this._value);this._adapter.getInputValue()!==i&&this._adapter.setInputValue(i,e)}_normalizeTimeValue(t){return t==null?null:t<0?0:t>s.numbers.MAX_DAY_MILLIS?s.numbers.MAX_DAY_MILLIS:t}_openDropdown(){let t=this._generateTimeOptions();if(!this.allowDropdown||!t.length)return;this._formatInputValue(),this._open=!0,this._adapter.setHostAttribute(s.attributes.OPEN);let e=t.filter(a=>!a.divider&&!a.disabled),i=[],n=0;if(t.length)if(this._value!=null){let a=this._findClosestOptionIndex(this._value,e);a>=0&&(e[a].value.time===this._value?i=[e[a].value]:n=a)}else if(typeof this._startTime=="number"){let a=this._findClosestOptionIndex(this._startTime,e);a>=0&&a<e.length&&(n=a)}else this._startTime==null&&(n=this._getOptionIndexClosestCurrent(e));this._dropdownConfig={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,visibleStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:a=>this._onSelect(a),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:a=>this._adapter.setActiveDescendant(a),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)},this._adapter.attachDropdown(this._dropdownConfig),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._dropdownConfig=void 0,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_getOptionIndexClosestCurrent(t){let e=new Date,i=`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`,n=v(i,!0,!1);return this._findClosestOptionIndex(n,t)}_findClosestOptionIndex(t,e){let i=e.reduce((n,a)=>Math.abs((a.value.time||0)-t)<Math.abs((n.value.time||0)-t)?a:n);return e.indexOf(i)}_formatInputValue(t=!0){let e=this._adapter.getInputValue();if(this._allowInvalidTime&&!this._masked&&e&&!this._value)return;let i=this._formatValue(this._value);e!==i&&(this._adapter.setInputValue(i,t),this._adapter.emitInputEvent(s.events.INPUT,i))}_generateTimeOptions(){let t=this._min!=null?Math.max(I(this._min),0):0,e=this._max!=null?Math.min(I(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],a=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=T(d),_t=this._restrictedTimes.includes(_),ht=c(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let r=n.findIndex(d=>d.value.time/1e3/60>=720);r>=0&&r<n.length-1&&n.splice(r,0,{label:"",value:null,divider:!0})}if(this._showNow){let r={time:null,metadata:"now"};a.push({label:"Now",value:r})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let r=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});a=[...a,...r]}return a.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),a.forEach((r,d)=>n.splice(d,0,r))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),v(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):c(this._value,this._use24HourTime,this._allowSeconds)||""}_warnInvalidFormat(t){console.warn(`The specified value "${t}" does not conform to the required format. The format is "HH:mm", "HH:mm:ss" where HH is 00-23, mm is 00-59, and ss is 00-59.`)}get open(){return this._open}set open(t){this._open!==t&&this._isInitialized&&(this._open=t,this._open?this._openDropdown():this._closeDropdown())}get masked(){return this._masked}set masked(t){this._masked!==t&&(this._masked=t,this._isInitialized&&(this._masked?(this._adapter.removeInputListener("input",this._inputListener),this._applyMask()):(this._adapter.destroyMask(),this._formatInputValue(),this._adapter.addInputListener("input",this._inputListener))))}get showMaskFormat(){return this._showMaskFormat}set showMaskFormat(t){this._showMaskFormat!==t&&(this._showMaskFormat=t,this._isInitialized&&this._applyMask())}get allowSeconds(){return this._allowSeconds}set allowSeconds(t){this._allowSeconds!==t&&(this._allowSeconds=!!t,this._applyAllowSeconds(),this._isInitialized&&(this._applyMask(),this._formatInputValue()),this._adapter.setHostAttribute(s.attributes.ALLOW_SECONDS,`${!!t}`))}get use24HourTime(){return this._use24HourTime}set use24HourTime(t){this._use24HourTime!==t&&(this._use24HourTime=!!t,this._isInitialized&&(this._adapter.destroyMask(),this._formatInputValue(),this._applyMask()),this._adapter.setHostAttribute(s.attributes.USE_24_HOUR_TIME,`${!!t}`))}get allowInvalidTime(){return this._allowInvalidTime}set allowInvalidTime(t){this._allowInvalidTime!==t&&(this._allowInvalidTime=!!t,this._adapter.setHostAttribute(s.attributes.ALLOW_INVALID_TIME,`${!!t}`))}get value(){return c(this._value,!0,this._allowSeconds)}set value(t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}let e=this._validateMillis(this._convertTimeStringToMillis(t,!0,!0));this._setValue(e),this._isInitialized&&this._applyValue(this._value)}get min(){return c(this._min,!0,this._allowSeconds)}set min(t){if(this._min!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._min=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get max(){return c(this._max,!0,this._allowSeconds)}set max(t){if(this._max!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._max=this._convertTimeStringToMillis(t,!0,this._allowSeconds);let e=this._validateMillis(this._value);this._setValue(e),this._isInitialized&&this._applyValue(e)}}get restrictedTimes(){return this._restrictedTimes.map(t=>c(t,!0,this._allowSeconds)).filter(t=>typeof t=="string")}set restrictedTimes(t){Array.isArray(t)||(t=[]),this._restrictedTimes=t.filter(e=>typeof e=="string").map(e=>this._convertTimeStringToMillis(e,!0,!0)).filter(e=>typeof e=="number")}get startTime(){return c(this._startTime,!0,this._allowSeconds)}set startTime(t){if(this._startTime!==t){if(t&&!this._isValidInputValue(t)){this._warnInvalidFormat(t);return}this._startTime=this._convertTimeStringToMillis(t,!0,this._allowSeconds)}}get step(){return this._step}set step(t){this._step=t}get allowInput(){return this._allowInput}set allowInput(t){this._allowInput!==t&&(this._allowInput=t,this._isInitialized&&(this._applyAllowInput(),this._applyMask()))}get popupTarget(){return this._popupTarget}set popupTarget(t){this._popupTarget!==t&&(this._popupTarget=t)}get showNow(){return this._showNow}set showNow(t){this._showNow!==t&&(this._showNow=t)}get showHourOptions(){return this._showHourOptions}set showHourOptions(t){this._showHourOptions!==t&&(this._showHourOptions=t)}get customOptions(){return this._customOptions}set customOptions(t){this._customOptions=Array.isArray(t)?t:[]}set validationCallback(t){this._validationCallback=t,this._isInitialized&&this._applyMask()}set parseCallback(t){this._parseCallback=t}set formatCallback(t){this._formatCallback=t}set coercionCallback(t){this._coercionCallback=t}set prepareMaskCallback(t){this._prepareMaskCallback=t,this._isInitialized&&this._applyMask()}get disabled(){return this._disabled}set disabled(t){this._disabled!==t&&(this._disabled=!!t,this._isInitialized&&this._applyDisabled(),this._adapter.toggleHostAttribute(s.attributes.DISABLED,this._disabled))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:this._popupClasses}set popupClasses(t){Array.isArray(t)?this._popupClasses=[...t]:this._popupClasses=[t]}get allowDropdown(){return this._allowDropdown}set allowDropdown(t){this._allowDropdown!==t&&(this._allowDropdown=t,this._isInitialized&&this._applyAllowDropdown())}};var Tt="<template><slot></slot></template>",kt=":host{display:block}:host([hidden]){display:none}",l=class extends B{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new k(new g(this))}static get observedAttributes(){return[s.attributes.VALUE,s.attributes.OPEN,s.attributes.ALLOW_SECONDS,s.attributes.MASKED,s.attributes.SHOW_MASK_FORMAT,s.attributes.USE_24_HOUR_TIME,s.attributes.ALLOW_INVALID_TIME,s.attributes.MIN,s.attributes.MAX,s.attributes.START_TIME,s.attributes.STEP,s.attributes.ALLOW_INPUT,s.attributes.SHOW_NOW,s.attributes.SHOW_HOUR_OPTIONS,s.attributes.DISABLED,s.attributes.POPUP_CLASSES,s.attributes.ALLOW_DROPDOWN]}connectedCallback(){this.querySelector(s.selectors.INPUT)?this._foundation.initialize():A(this,s.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,i,n){switch(e){case s.attributes.VALUE:this.value=n;break;case s.attributes.OPEN:this.open=m(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=m(n);break;case s.attributes.MASKED:this.masked=m(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=m(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=m(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=m(n);break;case s.attributes.SHOW_NOW:this.showNow=m(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=m(n);break;case s.attributes.MIN:this.min=n;break;case s.attributes.MAX:this.max=n;break;case s.attributes.START_TIME:this.startTime=n;break;case s.attributes.STEP:this.step=y(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=m(n);break;case s.attributes.DISABLED:this.disabled=m(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=m(n);break}}};p([u()],l.prototype,"value",2),p([u()],l.prototype,"open",2),p([u()],l.prototype,"allowSeconds",2),p([u()],l.prototype,"masked",2),p([u()],l.prototype,"showMaskFormat",2),p([u()],l.prototype,"use24HourTime",2),p([u()],l.prototype,"allowInvalidTime",2),p([u()],l.prototype,"min",2),p([u()],l.prototype,"max",2),p([u()],l.prototype,"restrictedTimes",2),p([u()],l.prototype,"startTime",2),p([u()],l.prototype,"step",2),p([u()],l.prototype,"allowInput",2),p([u()],l.prototype,"showNow",2),p([u()],l.prototype,"showHourOptions",2),p([u()],l.prototype,"customOptions",2),p([u()],l.prototype,"validationCallback",2),p([u()],l.prototype,"parseCallback",2),p([u()],l.prototype,"formatCallback",2),p([u()],l.prototype,"coercionCallback",2),p([u()],l.prototype,"prepareMaskCallback",2),p([u()],l.prototype,"disabled",2),p([u()],l.prototype,"popupClasses",2),p([u()],l.prototype,"allowDropdown",2),p([u()],l.prototype,"popupTarget",2),l=p([R({name:s.elementName,dependencies:[et,tt,ot,E,it,E,at]})],l);var mt=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(s.elementName);return this._attachTextField(e),e}get inputElement(){return this._textFieldDelegate.inputElement}get textFieldElement(){return this._textFieldDelegate.element}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(s.events.CHANGE,i=>{var n;return e((n=i.detail)!=null?n:"")})}onInput(e){this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")})}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,a,r,d;let i={props:w({},(a=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:a.props),options:w({},(d=(r=this._config.options)==null?void 0:r.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function xe(){N(l)}export{s as a,g as b,v as c,c as d,pt as e,ut as f,I as g,M as h,It as i,dt as j,T as k,O as l,ct as m,S as n,Rt as o,k as p,l as q,mt as r,xe as s};
7
+ //# sourceMappingURL=chunk.7BOXIJAM.js.map
@@ -3,10 +3,10 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{f as To}from"./chunk.P3IA2WTO.js";import{b as go}from"./chunk.EGRUD7S7.js";import{h as uo}from"./chunk.E6CYXNS2.js";import{f as So}from"./chunk.4FSAAN6W.js";import{d as Bo}from"./chunk.HPDBSBQJ.js";import{q as so}from"./chunk.LFLREB3C.js";import{d as Po}from"./chunk.4NI63FGK.js";import{c as ao}from"./chunk.6RSRYR55.js";import{e as Ao}from"./chunk.4X2OFZDL.js";import{d as co}from"./chunk.MXTDW27J.js";import{d as lo}from"./chunk.XHV3GQ7L.js";import{b as xo}from"./chunk.ILRWZHH3.js";import{d as io}from"./chunk.7UKA4E5A.js";import{d as Co}from"./chunk.BTBHIIGI.js";import{b as ro}from"./chunk.AFLH5HUG.js";import{d as fo}from"./chunk.HU27X3IT.js";import{d as eo}from"./chunk.OZ5BPXNV.js";import{d as no}from"./chunk.RHFNK6EE.js";import{b as po}from"./chunk.WP4QOOIS.js";import{b as to}from"./chunk.77Y3EABF.js";import{d as mo}from"./chunk.LYOQ2RGP.js";import{b as U}from"./chunk.H4Z4DHPA.js";import{j as _}from"./chunk.ROR6JMAE.js";import{d as j}from"./chunk.INCKI5IX.js";import{b as G}from"./chunk.RBAVT3XQ.js";import{b as H}from"./chunk.JEN6YP2Q.js";import{d as N}from"./chunk.K2C4W3CO.js";import{d as K}from"./chunk.RYMPSU4J.js";import{b as Q}from"./chunk.VC2BG2RS.js";import{d as y}from"./chunk.UF43SSFY.js";import{e as v}from"./chunk.SAQVWOVK.js";import{d as R}from"./chunk.PYIFIHDK.js";import{f as V}from"./chunk.2BNDXFI5.js";import{E as L}from"./chunk.6OKJPSUE.js";import{b as O}from"./chunk.Y72NANFX.js";import{i as B}from"./chunk.DQJPIDVW.js";import{c as l}from"./chunk.NW7NV2A2.js";import{b as e}from"./chunk.UT7QUGAO.js";import{d}from"./chunk.44IJE5UL.js";import{c as u}from"./chunk.5FPFRE4H.js";import{e as c}from"./chunk.C7AN6FMW.js";import{d as A}from"./chunk.N4PVZUJX.js";import{d as D}from"./chunk.RB5BTA5N.js";import{b as w}from"./chunk.RE5X26QT.js";import{b as k}from"./chunk.72AUOVCD.js";import{f as h}from"./chunk.G3ZTZ4AN.js";import{d as M}from"./chunk.K6AFP52A.js";import{d as s}from"./chunk.F2B24WLK.js";import{d as F}from"./chunk.PALRSBSY.js";import{d as E}from"./chunk.BJE6O5ES.js";import{d as p}from"./chunk.J2H5RXTX.js";import{d as t}from"./chunk.LDN4HLF7.js";import{d as m}from"./chunk.4BEI55KI.js";import{e as z}from"./chunk.T76JYRPR.js";import{d as Y}from"./chunk.O73S5LF3.js";import{d as q}from"./chunk.YBEBD4CN.js";import{b as a}from"./chunk.KU5CXXGS.js";import{c as C}from"./chunk.KE6GOYAB.js";import{e as i}from"./chunk.RG6CDWEX.js";import{d as I}from"./chunk.TWZXQQQO.js";import{b as n}from"./chunk.VAKNDCLP.js";import{b as W}from"./chunk.XUW3GG46.js";import{d as X}from"./chunk.XZ4WI7VK.js";import{d as P}from"./chunk.TR5YMNJJ.js";import{d as oo}from"./chunk.73AYD2BF.js";import{d as $}from"./chunk.U724KSZU.js";import{b as Z}from"./chunk.HBMNXZES.js";import{d as S}from"./chunk.SXTTEIIH.js";import{c as b}from"./chunk.I5BAZWUF.js";import{e as x}from"./chunk.V7WKXEZC.js";import{b as g}from"./chunk.7A6MX6CS.js";import{f}from"./chunk.WY7DECJD.js";import{e as J}from"./chunk.FRYLJWYL.js";import{d as T}from"./chunk.4WPFFNLH.js";import{l as r}from"./chunk.JHBCYICS.js";import{b as o}from"./chunk.Y4GKBJGI.js";var ho=[p,S,s,P,A,D,M,b,E,F,L,O,h,c,u,d,I,V,y,v,R,e,G,H,N,t,K,Q,io,r,g,U,_,j,n,C,i,q,z,J,W,X,Y,oo,$,m,mo,to,ro,fo,x,Co,k,f,po,no,eo,a,xo,ao,Ao,co,lo,w,So,Bo,uo,l,so,Po,Z,T,To,go,B];function Fr(){o(ho)}export{Fr as a};
6
+ import{f as To}from"./chunk.P3IA2WTO.js";import{b as go}from"./chunk.EGRUD7S7.js";import{h as uo}from"./chunk.E6CYXNS2.js";import{f as So}from"./chunk.4FSAAN6W.js";import{d as Bo}from"./chunk.HPDBSBQJ.js";import{q as so}from"./chunk.7BOXIJAM.js";import{d as Po}from"./chunk.4NI63FGK.js";import{c as ao}from"./chunk.M2QU3LUR.js";import{e as Ao}from"./chunk.Y5A7RQ5M.js";import{d as co}from"./chunk.MXTDW27J.js";import{d as lo}from"./chunk.XHV3GQ7L.js";import{b as xo}from"./chunk.ILRWZHH3.js";import{d as io}from"./chunk.7UKA4E5A.js";import{d as Co}from"./chunk.BTBHIIGI.js";import{b as ro}from"./chunk.AFLH5HUG.js";import{d as fo}from"./chunk.MSF55AA3.js";import{d as eo}from"./chunk.SSRQFKNH.js";import{d as no}from"./chunk.5WNKQTXX.js";import{b as po}from"./chunk.WP4QOOIS.js";import{b as to}from"./chunk.77Y3EABF.js";import{d as mo}from"./chunk.LYOQ2RGP.js";import{b as U}from"./chunk.H4Z4DHPA.js";import{j as _}from"./chunk.ROR6JMAE.js";import{d as j}from"./chunk.INCKI5IX.js";import{b as G}from"./chunk.RBAVT3XQ.js";import{b as H}from"./chunk.JEN6YP2Q.js";import{d as N}from"./chunk.K2C4W3CO.js";import{d as K}from"./chunk.RYMPSU4J.js";import{b as Q}from"./chunk.VC2BG2RS.js";import{d as y}from"./chunk.UF43SSFY.js";import{e as v}from"./chunk.SAQVWOVK.js";import{d as R}from"./chunk.242YUZKU.js";import{f as V}from"./chunk.2BNDXFI5.js";import{E as L}from"./chunk.6OKJPSUE.js";import{b as O}from"./chunk.Y72NANFX.js";import{i as B}from"./chunk.CKYHP5MC.js";import{c as l}from"./chunk.NW7NV2A2.js";import{b as e}from"./chunk.UT7QUGAO.js";import{d}from"./chunk.44IJE5UL.js";import{c as u}from"./chunk.5FPFRE4H.js";import{e as c}from"./chunk.C7AN6FMW.js";import{d as A}from"./chunk.N4PVZUJX.js";import{d as D}from"./chunk.RB5BTA5N.js";import{b as w}from"./chunk.RE5X26QT.js";import{b as k}from"./chunk.72AUOVCD.js";import{f as h}from"./chunk.G3ZTZ4AN.js";import{d as M}from"./chunk.K6AFP52A.js";import{d as s}from"./chunk.F2B24WLK.js";import{d as F}from"./chunk.PALRSBSY.js";import{d as E}from"./chunk.BJE6O5ES.js";import{d as p}from"./chunk.J2H5RXTX.js";import{d as t}from"./chunk.LDN4HLF7.js";import{d as m}from"./chunk.4BEI55KI.js";import{e as z}from"./chunk.T76JYRPR.js";import{d as Y}from"./chunk.O73S5LF3.js";import{d as q}from"./chunk.YBEBD4CN.js";import{b as a}from"./chunk.KU5CXXGS.js";import{c as C}from"./chunk.KE6GOYAB.js";import{e as i}from"./chunk.RG6CDWEX.js";import{d as I}from"./chunk.TWZXQQQO.js";import{b as n}from"./chunk.VAKNDCLP.js";import{b as W}from"./chunk.XUW3GG46.js";import{d as X}from"./chunk.XZ4WI7VK.js";import{d as P}from"./chunk.TR5YMNJJ.js";import{d as oo}from"./chunk.Q7LFOS2I.js";import{d as $}from"./chunk.XQ2EQIDS.js";import{b as Z}from"./chunk.HBMNXZES.js";import{d as S}from"./chunk.SXTTEIIH.js";import{c as b}from"./chunk.I5BAZWUF.js";import{e as x}from"./chunk.V7WKXEZC.js";import{b as g}from"./chunk.7A6MX6CS.js";import{f}from"./chunk.WY7DECJD.js";import{e as J}from"./chunk.FRYLJWYL.js";import{d as T}from"./chunk.4WPFFNLH.js";import{l as r}from"./chunk.JHBCYICS.js";import{b as o}from"./chunk.Y4GKBJGI.js";var ho=[p,S,s,P,A,D,M,b,E,F,L,O,h,c,u,d,I,V,y,v,R,e,G,H,N,t,K,Q,io,r,g,U,_,j,n,C,i,q,z,J,W,X,Y,oo,$,m,mo,to,ro,fo,x,Co,k,f,po,no,eo,a,xo,ao,Ao,co,lo,w,So,Bo,uo,l,so,Po,Z,T,To,go,B];function Fr(){o(ho)}export{Fr as a};
7
7
  /**
8
8
  * @license
9
9
  * Copyright (c) 2022 Tyler Technologies, Inc.
10
10
  * License: Apache-2.0
11
11
  */
12
- //# sourceMappingURL=chunk.DYRY2HWZ.js.map
12
+ //# sourceMappingURL=chunk.ABLKZXJ3.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2023 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{c as le}from"./chunk.NW7NV2A2.js";import{a as re,b as pe}from"./chunk.MLV25D2G.js";import{b as Q}from"./chunk.UT7QUGAO.js";import{a as x}from"./chunk.44IJE5UL.js";import{a as se}from"./chunk.GO5A4GKZ.js";import{a as ie}from"./chunk.MHOS3IHQ.js";import{h as ae,i as ue}from"./chunk.ESR2NHOS.js";import{b as ne}from"./chunk.KU5CXXGS.js";import{c as te}from"./chunk.KE6GOYAB.js";import{e as ee}from"./chunk.RG6CDWEX.js";import{b as Z}from"./chunk.VAKNDCLP.js";import{a as y,e as oe}from"./chunk.V7WKXEZC.js";import{c as V,g as q,h as z}from"./chunk.MZLPUI6R.js";import{a as L}from"./chunk.YI4JTY4T.js";import{d as X,l as J,m as j}from"./chunk.JHBCYICS.js";import{a as $}from"./chunk.ARJ3EVVO.js";import{a as Y}from"./chunk.Y66GSZJB.js";import{a as G}from"./chunk.G5MGGEFP.js";import{a}from"./chunk.KTGSZEAG.js";import{a as R,b as K,c as W}from"./chunk.BE7PZANN.js";import{a as U,e as H,g as C}from"./chunk.Y4GKBJGI.js";import{m as M,r as N,s as k,u as A}from"./chunk.PN26D52V.js";import{a as S,b as h,c as F,j as w,k as g,l as P,n as D,o as B}from"./chunk.J2M2MXP2.js";import{a as T,f as p}from"./chunk.MCIQXNKY.js";var O=`${K}autocomplete`,fe={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},ve={INPUT:se.selectors.INPUT,DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},ge={DEFAULT_DEBOUNCE_TIME:500,NUM_SKELETON_ITEMS:3},be={CHANGE:`${O}-change`,SELECT:`${O}-select`,SCROLLED_BOTTOM:`${O}-scrolled-bottom`},o={elementName:O,attributes:fe,selectors:ve,numbers:ge,events:be},de=(e=>(e.Default="default",e.Stateless="stateless",e))(de||{});var I=class extends G{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=N(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list")}isWrappingChipField(){return!!this._component.querySelector(x.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ae(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(y.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(y.events.BLUR,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=k();return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){!this._targetElement||A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){!this.getPopupElement()||window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=C(e,re.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=C(t,x.selectors.ROOT);if(i)return i}return this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var ce=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(ce||{});function b(u,d){let e=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function he(u,d){return u.find(e=>e.value===d)}function v(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:D(u.value[e],d[e]):D(u.value,d)}var E=class extends ue{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=S()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._isDropdownOpen&&this._closeDropdown()}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?B(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return b(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!L.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(s=>{this._options=s,c(this._options)}).catch(s=>_(`An unexpected error occurred while filtering: ${s}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let s=this._optionBuilder;c=(m,f)=>s(m,this._filterText,f)}let _={options:this._options,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:s=>{if(this._filterText){let m=Y(s,this._filterText);if(m)return m}return s},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:s=>this._onSelect(s),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(l)}catch(s){console.error(s)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&b(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>v(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let n=this._flatOptions,l=n.find(s=>v(s,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey));if(s>=0){let f=this._selectedOptions.some(me=>v(me,e,this._matchKey));this._adapter.toggleOptionMultiple(s,f)}let m=he(this._selectedOptions,c);if(m){let f=this._selectedOptions.indexOf(m);this._selectedOptions.splice(f,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");if(this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(s=>s.value),this._adapter.setSelectedText(this._getSelectedText()),!L.isMobile&&t&&this._adapter.selectInputValue(),this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey)),m=this._values.includes(e);this._adapter.toggleOptionMultiple(s,m)}this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?`${this._values.length} ${this._values.length===1?"option":"options"} selected`:"":this._selectedOptions.filter(e=>e&&e.label).map(e=>e.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),b(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&!!this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),b(e,0))for(let i of e){let n=t.find(l=>v(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>v(l,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=JSON.parse(JSON.stringify(e)):F(e)?t=[e]:t=[JSON.parse(JSON.stringify(e))],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&!!this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){!this._isDropdownOpen||(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var Oe="<template><slot></slot></template>",Ie=":host{display:block}:host([hidden]){display:none}",r=class extends ie{constructor(){super();X.define([V,z,q]),H(this,Oe,Ie),this._foundation=new E(new I(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():M(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=g(i);break;case o.attributes.DEBOUNCE:this.debounce=P(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=g(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=g(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=g(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}};p([a()],r.prototype,"mode",2),p([a()],r.prototype,"multiple",2),p([a()],r.prototype,"value",2),p([a()],r.prototype,"debounce",2),p([a()],r.prototype,"filterOnFocus",2),p([a()],r.prototype,"allowUnmatched",2),p([a()],r.prototype,"popupTarget",2),p([a()],r.prototype,"filterText",2),p([a()],r.prototype,"optionBuilder",2),p([a()],r.prototype,"filter",2),p([a()],r.prototype,"selectedTextBuilder",2),p([a()],r.prototype,"open",2),p([a()],r.prototype,"matchKey",2),p([a({set:!1})],r.prototype,"isInitialized",2),p([a({set:!1})],r.prototype,"popupElement",2),p([a()],r.prototype,"beforeValueChange",2),r=p([R({name:o.elementName,dependencies:[le,oe,te,ee,Q,ne,Z,J]})],r);var _e=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,l,c,_,s;let t={props:T({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:T({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((s=t.options)!=null&&s.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new pe(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new j(e).element}};function Rt(){U(r)}export{o as a,de as b,I as c,ce as d,b as e,he as f,v as g,E as h,r as i,_e as j,Rt as k};
7
- //# sourceMappingURL=chunk.DQJPIDVW.js.map
6
+ import{c as le}from"./chunk.NW7NV2A2.js";import{a as re,b as pe}from"./chunk.MLV25D2G.js";import{b as Q}from"./chunk.UT7QUGAO.js";import{a as x}from"./chunk.44IJE5UL.js";import{a as se}from"./chunk.GO5A4GKZ.js";import{a as ie}from"./chunk.MHOS3IHQ.js";import{h as ae,i as ue}from"./chunk.ESR2NHOS.js";import{b as ne}from"./chunk.KU5CXXGS.js";import{c as te}from"./chunk.KE6GOYAB.js";import{e as ee}from"./chunk.RG6CDWEX.js";import{b as Z}from"./chunk.VAKNDCLP.js";import{a as y,e as oe}from"./chunk.V7WKXEZC.js";import{c as V,g as q,h as z}from"./chunk.MZLPUI6R.js";import{a as L}from"./chunk.YI4JTY4T.js";import{d as X,l as J,m as j}from"./chunk.JHBCYICS.js";import{a as $}from"./chunk.ARJ3EVVO.js";import{a as Y}from"./chunk.Y66GSZJB.js";import{a as G}from"./chunk.G5MGGEFP.js";import{a}from"./chunk.KTGSZEAG.js";import{a as R,b as K,c as W}from"./chunk.BE7PZANN.js";import{a as U,e as H,g as C}from"./chunk.Y4GKBJGI.js";import{m as M,r as N,s as k,u as A}from"./chunk.PN26D52V.js";import{a as S,b as h,c as F,j as w,k as g,l as P,n as D,o as B}from"./chunk.J2M2MXP2.js";import{a as T,f as p}from"./chunk.MCIQXNKY.js";var O=`${K}autocomplete`,fe={MODE:"mode",MULTIPLE:"multiple",DEBOUNCE:"debounce",FILTER_ON_FOCUS:"filter-on-focus",ALLOW_UNMATCHED:"allow-unmatched",POPUP_TARGET:"popup-target",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",SYNC_POPUP_WIDTH:"sync-popup-width",OPEN:"open",MATCH_KEY:"match-key",FILTER_TEXT:"filter-text",DROPDOWN_ICON_OPEN:"data-forge-dropdown-icon-open"},ve={INPUT:se.selectors.INPUT,DROPDOWN_ICON:"[data-forge-dropdown-icon],[data-forge-dropdown-icon],[forge-dropdown-icon],.forge-dropdown-icon",CLEAR_BUTTON:"[data-forge-autocomplete-clear],[forge-autocomplete-clear]"},ge={DEFAULT_DEBOUNCE_TIME:500,NUM_SKELETON_ITEMS:3},be={CHANGE:`${O}-change`,SELECT:`${O}-select`,SCROLLED_BOTTOM:`${O}-scrolled-bottom`},o={elementName:O,attributes:fe,selectors:ve,numbers:ge,events:be},de=(e=>(e.Default="default",e.Stateless="stateless",e))(de||{});var I=class extends G{constructor(e){super(e);this.setInputElement()}setInputElement(){let e=N(this._component,o.selectors.INPUT,!1);return e.length&&(this._inputElement=e[0]),this._inputElement}setInputAttribute(e,t){this._inputElement.setAttribute(e,t)}addInputListener(e,t){this._inputElement.addEventListener(e,t)}removeInputListener(e,t){this._inputElement.removeEventListener(e,t)}initializeInputAccessibility(e){this._inputElement.setAttribute("autocomplete","off"),this._inputElement.setAttribute("role","combobox"),this._inputElement.setAttribute("aria-live","polite"),this._inputElement.setAttribute("aria-atomic","true"),this._inputElement.setAttribute("aria-haspopup","true"),this._inputElement.setAttribute("aria-expanded","false"),this._inputElement.setAttribute("aria-autocomplete","list")}isWrappingChipField(){return!!this._component.querySelector(x.elementName)}show(e,t){this._targetElement=this._getTargetElement(t),this._targetElement&&(this._listDropdown=new ae(this._targetElement,e),this._listDropdown.open(),this._inputElement.setAttribute("aria-expanded","true"),this._inputElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._tryToggleDropdownIconRotation(!0))}hide(e){if(!this._listDropdown)return;let{targetElement:t}=this._listDropdown.dropdownElement;t.removeEventListener(y.events.BLUR,e),this.setBusyVisibility(!1),this._tryToggleDropdownIconRotation(!1),this._inputElement.removeAttribute("aria-activedescendant"),this._inputElement.removeAttribute("aria-controls"),this._inputElement.setAttribute("aria-expanded","false"),this._listDropdown.close(),this._listDropdown=void 0}setBusyVisibility(e){var t;(t=this._listDropdown)==null||t.setBusyVisibility(e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(y.events.BLUR,e)}focus(){window.requestAnimationFrame(()=>this._inputElement.focus())}setOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}appendOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setSelectedText(e){this._inputElement.value=e}getInputValue(){return this._inputElement.value}setInputValue(e){this._inputElement.value=e}selectInputValue(){window.requestAnimationFrame(()=>this._inputElement.select())}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}hasFocus(){let e=k();return e===this._inputElement||this.isFocusWithinPopup(e)}hasInputElement(){return!!this._inputElement}setDropdownIconListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.addEventListener(e,t)})}removeDropdownIconListener(e,t){let i=this._component.querySelector(o.selectors.DROPDOWN_ICON);i&&i.removeEventListener(e,t)}setClearButtonListener(e,t){window.requestAnimationFrame(()=>{let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.addEventListener(e,t)})}removeClearButtonListener(e,t){let i=this._component.querySelector(o.selectors.CLEAR_BUTTON);i&&i.removeEventListener(e,t)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}updateActiveDescendant(e){!this._targetElement||A(this._inputElement,!!e,"aria-activedescendant",e)}getTargetElementWidth(e){return this._targetElement||(this._targetElement=this._getTargetElement(e)),this._targetElement.getBoundingClientRect().width}getPopupElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateOptionByIndex(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:null}clearActiveOption(){var e;(e=this._listDropdown)==null||e.clearActiveOption()}setSelectedOptions(e){if(this._listDropdown){let t=e.map(i=>i.value);this._listDropdown.setSelectedValues(t)}}queueDropdownPositionUpdate(){!this.getPopupElement()||window.requestAnimationFrame(()=>{let e=this.getPopupElement();e==null||e.position()})}_getTargetElement(e){return e?this._component.querySelector(e)||this._getDefaultTargetElement():this._getDefaultTargetElement()}_getDefaultTargetElement(){let e=this._component.querySelector("forge-text-field");if(e&&e.shadowRoot){let i=C(e,re.selectors.ROOT);if(i)return i}let t=this._component.querySelector("forge-chip-field");if(t&&t.shadowRoot){let i=C(t,x.selectors.ROOT);if(i)return i}return this._component.querySelector("input")||this._component}_tryToggleDropdownIconRotation(e){let t=this._component.querySelector(o.selectors.DROPDOWN_ICON);t&&A(t,e,o.attributes.DROPDOWN_ICON_OPEN)}};var ce=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(ce||{});function b(u,d){let e=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("options")&&(i.hasOwnProperty("text")||i.hasOwnProperty("builder"))),t=u.some(i=>h(i)&&w(i)&&i.hasOwnProperty("label")&&i.hasOwnProperty("value"));return e&&d===1||t&&d===0}function he(u,d){return u.find(e=>e.value===d)}function v(u,d,e=null){return e?!(e in u.value)||!(e in d)?!1:D(u.value[e],d[e]):D(u.value,d)}var E=class extends ue{constructor(e){super();this._adapter=e;this._isInitialized=!1;this._isDropdownOpen=!1;this._mode="default";this._multiple=!1;this._debounce=o.numbers.DEFAULT_DEBOUNCE_TIME;this._allowUnmatched=!1;this._filterOnFocus=!0;this._options=[];this._filterText="";this._selectedOptions=[];this._values=[];this._pendingFilterPromises=[];this._matchKey=null;this._clickListener=t=>this._onClick(t),this._focusListener=()=>this._onFocus(),this._blurListener=t=>this._onBlur(t),this._keydownListener=t=>this._onKeydown(t),this._dropdownIconClickListener=t=>this._onDropdownIconClick(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dropdownIconMouseDownListener=t=>this._onDropdownIconMouseDown(t),this._clearButtonListener=t=>this._onClear(t),this._dismissListener=()=>this._onDismiss(),this._activeChangeListener=t=>this._adapter.updateActiveDescendant(t),this._targetWidthCallback=()=>this._adapter.getTargetElementWidth(this._popupTarget),this._identifier=S()}async initialize(){if(!this._adapter.hasInputElement()&&!this._adapter.setInputElement())throw new Error("An input element is required as a child of the autocomplete component.");if(this._setInputListener(),this._setFilterCallback(),this._attachListeners(),this._initializeAccessibility(),this._values.length){if(!this._selectedOptions.length){try{await this._executeFilter()}catch(e){console.error(e)}this._updateSelectedOptions(this._values)}this._adapter.setSelectedText(this._getSelectedText())}this._isInitialized=!0}disconnect(){this._isInitialized&&(this._detachListeners(),this._isInitialized=!1),this._isDropdownOpen&&this._closeDropdown()}_attachListeners(){this._adapter.addInputListener("click",this._clickListener),this._adapter.addInputListener("focus",this._focusListener),this._adapter.addInputListener("blur",this._blurListener),this._adapter.addInputListener("input",this._inputListener),this._adapter.addInputListener("keydown",this._keydownListener),this._adapter.setDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.setDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.setClearButtonListener("click",this._clearButtonListener)}_detachListeners(){this._adapter.removeInputListener("click",this._clickListener),this._adapter.removeInputListener("focus",this._focusListener),this._adapter.removeInputListener("blur",this._blurListener),this._adapter.removeInputListener("input",this._inputListener),this._adapter.removeInputListener("keydown",this._keydownListener),this._adapter.removeDropdownIconListener("click",this._dropdownIconClickListener),this._adapter.removeDropdownIconListener("mousedown",this._dropdownIconMouseDownListener),this._adapter.removeClearButtonListener("click",this._clearButtonListener)}_setInputListener(){this._inputListener=e=>this._onInput(e)}_setFilterCallback(){this._filterFn=h(this._debounce)&&this._debounce>0?B(this._debounceFilter,this._debounce,!1):this._debounceFilter}_initializeAccessibility(){this._adapter.initializeInputAccessibility(this._identifier)}get _flatOptions(){return b(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onClick(e){!this._isDropdownOpen&&this._filterOnFocus&&this._showDropdown()}_onDropdownIconMouseDown(e){e.preventDefault()}_onDropdownIconClick(e){this._isDropdownOpen?this._closeDropdown():(this._adapter.focus(),window.requestAnimationFrame(()=>this._showDropdown()))}_onClear(e){this._clearValue(),this._adapter.setSelectedText(this._getSelectedText())}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_onFocus(){!this._isDropdownOpen&&this._adapter.getInputValue()&&!L.isMobile&&this._adapter.selectInputValue()}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._applyBlur()}_applyBlur(){this._isDropdownOpen&&this._closeDropdown(),this._mode!=="stateless"&&(this._selectedOptions.length?this._adapter.setSelectedText(this._getSelectedText()):this._allowUnmatched||(this._filterText="",this._adapter.setSelectedText("")))}_onInput(e){this._selectedOptions.length&&!this._multiple&&(!this._adapter.getInputValue()||this._allowUnmatched)&&!this._adapter.isWrappingChipField()&&(this._selectedOptions=[],this._values=[],this._emitChangeEvent()),this._filterText=this._adapter.getInputValue(),this._filterFn()}async _debounceFilter({checkFocus:e=!0}={}){if(!e&&!this._adapter.hasFocus()){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}let t=this._filterText,i=this._executeFilter();this._pendingFilterPromises.push(i),this._isDropdownOpen?this._adapter.setBusyVisibility(!0):this._showDropdown({filter:!1});try{await i}catch(n){this._pendingFilterPromises=[],this._isDropdownOpen&&this._closeDropdown();return}if(t===this._filterText)this._pendingFilterPromises=[],this._onFilterComplete();else{let n=this._pendingFilterPromises.indexOf(i);n!==-1&&this._pendingFilterPromises.splice(n,1)}}_onKeydown(e){switch(e.key){case"Tab":this._isDropdownOpen&&!this._multiple&&this._selectActiveOption(!1);break;case"Esc":case"Escape":this._isDropdownOpen&&(e.preventDefault(),e.stopPropagation(),this._closeDropdown());break;case"Down":case"ArrowDown":e.preventDefault(),this._isDropdownOpen?this._adapter.propagateKey(e.key):this._showDropdown({activateFirst:!0,activateSelected:!0});break;case"Up":case"ArrowUp":e.preventDefault(),this._isDropdownOpen&&this._adapter.propagateKey(e.key);break;case"Enter":case"Home":case"End":this._isDropdownOpen&&(e.key==="Enter"&&e.stopPropagation(),e.preventDefault(),this._adapter.propagateKey(e.key));break;case"Backspace":case"Delete":let t=e.target,i=this._adapter.getInputValue(),n=t.value.substring(t.selectionStart,t.selectionEnd)===t.value,l=i.length===1&&t.selectionEnd===1,c=i.length===1&&t.selectionEnd===0,_=!i||n||l||c;!this._adapter.isWrappingChipField()&&_&&!this._multiple&&this._values.length&&this._clearValue();break}}_executeFilter(e=!0,t=!1){if(!this._filter||typeof this._filter!="function")throw new Error('A filter callback must be provided. Did you set the "filter" property?');let i=this._filter,n=e?this._filterText:"",l=t?this._getValue():null;return new Promise((c,_)=>Promise.resolve(i(n,l)).then(s=>{this._options=s,c(this._options)}).catch(s=>_(`An unexpected error occurred while filtering: ${s}`)))}_onFilterComplete(){if(!this._adapter.hasFocus()){this._isDropdownOpen&&this._closeDropdown();return}if(this._options.length){let e=this._allowUnmatched&&!this._selectedOptions.length;this._dropdownReady({userTriggered:e}),this._filterText&&this._adapter.activateFirstOption()}else this._closeDropdown()}_clearValue(){this._selectedOptions=[],this._values=[],this._isDropdownOpen&&(this._adapter.setSelectedOptions([]),this._adapter.clearActiveOption()),this._emitChangeEvent()}async _showDropdown({filter:e=!0,userTriggered:t=!0,activateFirst:i=!1,activateSelected:n=!1}={}){let l=this._allowUnmatched&&!this._selectedOptions.length;this._isDropdownOpen=!0;let c;if(this._optionBuilder){let s=this._optionBuilder;c=(m,f)=>s(m,this._filterText,f)}let _={options:this._options,multiple:this._multiple,selectedValues:[...this._values],id:`forge-autocomplete-${this._identifier}`,asyncStyle:"skeleton",optionLimit:this._optionLimit,popupClasses:this._popupClasses,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,transform:s=>{if(this._filterText){let m=Y(s,this._filterText);if(m)return m}return s},allowBusy:!0,optionBuilder:c,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,selectCallback:s=>this._onSelect(s),closeCallback:()=>this._closeDropdown()};if(this._adapter.show(_,this._popupTarget),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen),e){this._options.length&&this._adapter.setBusyVisibility(!0);try{await this._executeFilter(l)}catch(s){console.error(s)}this._updateSelectedOptions(this._values)}this._pendingFilterPromises.length||this._dropdownReady({userTriggered:t,activateFirst:i,activateSelected:n})}_dropdownReady({userTriggered:e=!0,activateFirst:t=!1,activateSelected:i=!1}={}){if(!this._isDropdownOpen||!this._options.length||e&&!this._adapter.hasFocus()){this._closeDropdown();return}this._sortSelectedOptions(),this._adapter.setBusyVisibility(!1),this._adapter.setOptions(this._options),this._adapter.setSelectedOptions(this._selectedOptions),this._adapter.setDismissListener(this._dismissListener),i&&this._selectedOptions.length?this._adapter.activateSelectedOption():t&&this._adapter.activateFirstOption()}_closeDropdown(){this._multiple&&(this._filterText=""),this._isDropdownOpen=!1,this._adapter.hide(this._dismissListener),this._sortSelectedOptions(),this._adapter.toggleHostAttribute(o.attributes.OPEN,this._isDropdownOpen)}_sortSelectedOptions(){if(this._multiple&&this._selectedOptions.length&&b(this._options,0)){let e=[],t=[];this._options.forEach(i=>{this._selectedOptions.find(n=>v(n,i.value,this._matchKey))?e.push(i):t.push(i)}),this._options=[...e,...t]}}async _onSelect(e,t=!0){if(this._valueChanging)return;if(this._mode==="stateless"){let n={value:e};this._adapter.emitHostEvent(o.events.SELECT,n,!0,!0)&&(this._filterText="",this._multiple||this._closeDropdown());return}let i=()=>{let n=this._flatOptions,l=n.find(s=>v(s,e,this._matchKey)),c=l?l.value:"",_=l?l.label:"";if(this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey));if(s>=0){let f=this._selectedOptions.some(me=>v(me,e,this._matchKey));this._adapter.toggleOptionMultiple(s,f)}let m=he(this._selectedOptions,c);if(m){let f=this._selectedOptions.indexOf(m);this._selectedOptions.splice(f,1)}else this._selectedOptions.push(l)}else h(c)?(this._selectedOptions[0]=l,this._filterText=_):(this._selectedOptions=[],this._filterText="");if(this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions),this._values=this._selectedOptions.map(s=>s.value),this._adapter.setSelectedText(this._getSelectedText()),!L.isMobile&&t&&this._adapter.selectInputValue(),this._multiple){let s=n.findIndex(f=>v(f,e,this._matchKey)),m=this._values.includes(e);this._adapter.toggleOptionMultiple(s,m)}this._emitChangeEvent(),this._tryUpdateDropdownPosition()};this._isDropdownOpen&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"?(this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,e,this._matchKey)),await this._valueChanging?i():this._tryUpdateDropdownPosition(),this._valueChanging=void 0):i()}_selectActiveOption(e=!0){let t=this._adapter.getActiveOptionIndex();if(typeof t=="number"&&t>=0){let i=this._flatOptions[t];i&&this._onSelect(i.value,e)}}_emitChangeEvent(){this._adapter.emitHostEvent(o.events.CHANGE,this._getValue(),!0)}_tryUpdateDropdownPosition(){this._isDropdownOpen&&this._adapter.queueDropdownPositionUpdate()}_getValue(){return this._values?this._values.length?this._multiple?[...this._values]:this._values[0]:this._multiple?[]:null:null}_getSelectedText(){var e,t;return this._adapter.isWrappingChipField()?"":this._selectedTextBuilder?this._selectedTextBuilder(this._selectedOptions):this._multiple?this._values.length?this._values.length===1?(t=(e=this._selectedOptions[0])==null?void 0:e.label)!=null?t:"":`${this._values.length} options selected`:"":this._selectedOptions.filter(i=>i&&i.label).map(i=>i.label).join(" ").trim()}_onDismiss(){this._closeDropdown()}async _applyValue(e){let t=[];this._selectedOptions=[],Array.isArray(e)?t=e:t=h(e)?[e]:[],!this._multiple&&t.length>1&&(t=[t[0]]),b(t,0)?(this._values=t.map(n=>n.value),this._selectedOptions=t):this._values=t;let i=this._flatOptions;if(t.length&&i.length&&this._updateSelectedOptions(t),this._values.length&&!this._selectedOptions.length&&!!this._filter&&this._isInitialized){try{await this._executeFilter(!1,!0)}catch(n){console.error(n)}this._updateSelectedOptions(this._values)}this._multiple?this._filterText="":this._filterText=this._selectedOptions.length?this._selectedOptions[0].label:"",this._isInitialized&&this._adapter.setSelectedText(this._getSelectedText()),this._isDropdownOpen&&this._adapter.setSelectedOptions(this._selectedOptions)}_updateSelectedOptions(e){let t=[...this._flatOptions,...this._selectedOptions];if(this._selectedOptions.length&&(this._selectedOptions=[]),b(e,0))for(let i of e){let n=t.find(l=>v(l,i.value,this._matchKey));n?this._selectedOptions.push(n):this._selectedOptions.push(i)}else for(let i of e){let n=t.find(l=>v(l,i,this._matchKey));n?this._selectedOptions.push(n):this._allowUnmatched&&this._selectedOptions.push({label:i,value:i})}}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._mode==="stateless"&&(this._selectedOptions=[],this._isDropdownOpen&&this._closeDropdown()),this._adapter.setHostAttribute(o.attributes.MODE,this._mode))}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._adapter.setHostAttribute(o.attributes.MULTIPLE,h(this._multiple)?this._multiple.toString():""))}get value(){return this._getValue()}set value(e){let t=[];e==null?t=[]:Array.isArray(e)?t=JSON.parse(JSON.stringify(e)):F(e)?t=[e]:t=[JSON.parse(JSON.stringify(e))],(t.length!==this._values.length||t.some(n=>!this._values.includes(n)))&&this._applyValue(e)}get filterOnFocus(){return this._filterOnFocus}set filterOnFocus(e){this._filterOnFocus!==e&&(this._filterOnFocus=e,this._adapter.setHostAttribute(o.attributes.FILTER_ON_FOCUS,h(this._filterOnFocus)?this._filterOnFocus.toString():""))}get allowUnmatched(){return this._allowUnmatched}set allowUnmatched(e){this._allowUnmatched!==e&&(this._allowUnmatched=e,h(this._allowUnmatched)&&this._adapter.setHostAttribute(o.attributes.ALLOW_UNMATCHED,this._allowUnmatched.toString()))}get matchKey(){return this._matchKey}set matchKey(e){this._matchKey!==e&&(this._matchKey=e)}get popupTarget(){return this._popupTarget}set popupTarget(e){this._popupTarget!==e&&(this._popupTarget=e)}get filterText(){return this._filterText}set filterText(e){this._filterText!==e&&(this._filterText=this._allowUnmatched?e:"",this._isInitialized&&this._allowUnmatched&&(this._adapter.setInputValue(this._filterText),this._isDropdownOpen&&this._debounceFilter({checkFocus:!1})))}get popupClasses(){return Array.isArray(this._popupClasses)?[...this._popupClasses]:[this._popupClasses]}set popupClasses(e){this._popupClasses!==e&&(this._popupClasses=Array.isArray(e)?[...e]:[e])}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}set popupFooterBuilder(e){this._popupFooterBuilder=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth!==e&&(this._syncPopupWidth=e)}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit!==e&&(this._optionLimit=e)}get debounce(){return this._debounce}set debounce(e){this._debounce!==e&&(this._debounce=e,this._isInitialized&&this._setFilterCallback(),this._adapter.setHostAttribute(o.attributes.DEBOUNCE,h(this._debounce)?this._debounce.toString():""))}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get filter(){return this._filter}set filter(e){this._filter!==e&&(this._filter=e,this._isInitialized&&this._values.length&&!this._flatOptions.length&&!!this._filter&&this._executeFilter().then(()=>{this._updateSelectedOptions(this._values),this._adapter.setSelectedText(this._getSelectedText())}))}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e,this._selectedOptions.length&&this._adapter.setSelectedText(this._getSelectedText())}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}appendOptions(e){!this._isDropdownOpen||(this._options=[...this._options,...e],this._adapter.appendOptions(e))}get isInitialized(){return this._isInitialized}get open(){return this._isDropdownOpen}set open(e){this._isDropdownOpen!==e&&(e?this._showDropdown({userTriggered:!1}):this._closeDropdown())}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){e!==this._beforeValueChange&&(this._beforeValueChange=e)}get popupElement(){return this._adapter.getPopupElement()}};var Oe="<template><slot></slot></template>",Ie=":host{display:block}:host([hidden]){display:none}",r=class extends ie{constructor(){super();X.define([V,z,q]),H(this,Oe,Ie),this._foundation=new E(new I(this))}static get observedAttributes(){return[o.attributes.MODE,o.attributes.MULTIPLE,o.attributes.DEBOUNCE,o.attributes.FILTER_ON_FOCUS,o.attributes.ALLOW_UNMATCHED,o.attributes.POPUP_TARGET,o.attributes.POPUP_CLASSES,o.attributes.OBSERVE_SCROLL,o.attributes.OBSERVE_SCROLL_THRESHOLD,o.attributes.OPTION_LIMIT,o.attributes.SYNC_POPUP_WIDTH,o.attributes.OPEN,o.attributes.MATCH_KEY,o.attributes.FILTER_TEXT]}connectedCallback(){this.querySelector(o.selectors.INPUT)?this._foundation.initialize():M(this,o.selectors.INPUT).then(()=>this._foundation.initialize())}disconnectedCallback(){this._foundation.disconnect()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case o.attributes.MODE:this.mode=i;break;case o.attributes.MULTIPLE:this.multiple=g(i);break;case o.attributes.DEBOUNCE:this.debounce=P(i);break;case o.attributes.FILTER_ON_FOCUS:this.filterOnFocus=g(i);break;case o.attributes.ALLOW_UNMATCHED:this.allowUnmatched=g(i);break;case o.attributes.POPUP_TARGET:this.popupTarget=i;break;case o.attributes.OPEN:this.open=g(i);break;case o.attributes.MATCH_KEY:this.matchKey=i;break;case o.attributes.FILTER_TEXT:this.filterText=i;break}}appendOptions(e){this._foundation.appendOptions(e)}openDropdown(){this.open=!0}closeDropdown(){this.open=!1}};p([a()],r.prototype,"mode",2),p([a()],r.prototype,"multiple",2),p([a()],r.prototype,"value",2),p([a()],r.prototype,"debounce",2),p([a()],r.prototype,"filterOnFocus",2),p([a()],r.prototype,"allowUnmatched",2),p([a()],r.prototype,"popupTarget",2),p([a()],r.prototype,"filterText",2),p([a()],r.prototype,"optionBuilder",2),p([a()],r.prototype,"filter",2),p([a()],r.prototype,"selectedTextBuilder",2),p([a()],r.prototype,"open",2),p([a()],r.prototype,"matchKey",2),p([a({set:!1})],r.prototype,"isInitialized",2),p([a({set:!1})],r.prototype,"popupElement",2),p([a()],r.prototype,"beforeValueChange",2),r=p([R({name:o.elementName,dependencies:[le,oe,te,ee,Q,ne,Z,J]})],r);var _e=class extends ${constructor(e){super(e)}_build(){let e=document.createElement(o.elementName);return this._attachTextField(e),e}get textFieldDelegate(){return this._textFieldDelegate}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._textFieldDelegate.inputElement.disabled}set disabled(e){this._textFieldDelegate.inputElement.disabled=e}get invalid(){return this._textFieldDelegate.invalid||!1}set invalid(e){this._textFieldDelegate.invalid=e}onChange(e){this._element.addEventListener(o.events.CHANGE,t=>e(t.detail))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",t=>e(t))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",t=>e(t))}_attachTextField(e){var i,n,l,c,_,s;let t={props:T({},(n=(i=this._config.options)==null?void 0:i.textFieldDelegateConfig)==null?void 0:n.props),options:T({},(c=(l=this._config.options)==null?void 0:l.textFieldDelegateConfig)==null?void 0:c.options)};t.options||(t.options={}),((_=this._config.options)==null?void 0:_.useDropdownIcon)!==!1&&!((s=t.options)!=null&&s.trailingElement)&&(t.options.trailingElement=this._createDropdownIconElement()),this._textFieldDelegate=new pe(t),e.appendChild(this._textFieldDelegate.element)}_createDropdownIconElement(){let e={props:{slot:"trailing",name:"arrow_drop_down"},options:{attributes:{"forge-dropdown-icon":""}}};return new j(e).element}};function Rt(){U(r)}export{o as a,de as b,I as c,ce as d,b as e,he as f,v as g,E as h,r as i,_e as j,Rt as k};
7
+ //# sourceMappingURL=chunk.CKYHP5MC.js.map