@tylertech/forge 2.13.0-next.0 → 2.13.0

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 (128) hide show
  1. package/README.md +1 -1
  2. package/custom-elements.json +106 -107
  3. package/dist/esm/app-bar/help-button/index.js +1 -1
  4. package/dist/esm/app-bar/index.js +1 -1
  5. package/dist/esm/autocomplete/index.js +1 -1
  6. package/dist/esm/bottom-sheet/index.js +1 -1
  7. package/dist/esm/chip-field/index.js +1 -1
  8. package/dist/esm/chunks/{chunk.Z5P6EA5L.js → chunk.6QMDYUVT.js} +2 -2
  9. package/dist/esm/chunks/{chunk.Z5P6EA5L.js.map → chunk.6QMDYUVT.js.map} +0 -0
  10. package/dist/esm/chunks/{chunk.VH3PVW2V.js → chunk.6SGRP4FO.js} +2 -2
  11. package/dist/esm/chunks/{chunk.VH3PVW2V.js.map → chunk.6SGRP4FO.js.map} +0 -0
  12. package/dist/esm/chunks/{chunk.SZL74RTY.js → chunk.6XXKSGW5.js} +2 -2
  13. package/dist/esm/chunks/{chunk.SZL74RTY.js.map → chunk.6XXKSGW5.js.map} +0 -0
  14. package/dist/esm/chunks/chunk.75KFBRF6.js +7 -0
  15. package/dist/esm/chunks/{chunk.CYJBOJMX.js.map → chunk.75KFBRF6.js.map} +2 -2
  16. package/dist/esm/chunks/chunk.BX7242PC.js +7 -0
  17. package/dist/esm/chunks/chunk.BX7242PC.js.map +7 -0
  18. package/dist/esm/chunks/{chunk.K32ME33N.js → chunk.DQBSFX46.js} +2 -2
  19. package/dist/esm/chunks/{chunk.K32ME33N.js.map → chunk.DQBSFX46.js.map} +0 -0
  20. package/dist/esm/chunks/chunk.EJ4ASQET.js +7 -0
  21. package/dist/esm/chunks/chunk.EJ4ASQET.js.map +7 -0
  22. package/dist/esm/chunks/{chunk.KGW63HJX.js → chunk.F2TKPPK7.js} +2 -2
  23. package/dist/esm/chunks/{chunk.KGW63HJX.js.map → chunk.F2TKPPK7.js.map} +0 -0
  24. package/dist/esm/chunks/{chunk.DML4YNQF.js → chunk.HSJQA42U.js} +2 -2
  25. package/dist/esm/chunks/{chunk.DML4YNQF.js.map → chunk.HSJQA42U.js.map} +2 -2
  26. package/dist/esm/chunks/{chunk.DGOV5RDW.js → chunk.HUWXZ4ZN.js} +2 -2
  27. package/dist/esm/chunks/{chunk.DGOV5RDW.js.map → chunk.HUWXZ4ZN.js.map} +2 -2
  28. package/dist/esm/chunks/{chunk.D3DLVPPE.js → chunk.J2ODMCFS.js} +2 -2
  29. package/dist/esm/chunks/{chunk.D3DLVPPE.js.map → chunk.J2ODMCFS.js.map} +0 -0
  30. package/dist/esm/chunks/{chunk.E4ZTNVXI.js → chunk.J6CIWTDH.js} +2 -2
  31. package/dist/esm/chunks/{chunk.E4ZTNVXI.js.map → chunk.J6CIWTDH.js.map} +0 -0
  32. package/dist/esm/chunks/chunk.LMOYZQZJ.js +7 -0
  33. package/dist/esm/chunks/chunk.LMOYZQZJ.js.map +7 -0
  34. package/dist/esm/chunks/chunk.NNGE722W.js +7 -0
  35. package/dist/esm/chunks/chunk.NNGE722W.js.map +7 -0
  36. package/dist/esm/chunks/{chunk.32SMESZX.js → chunk.O2XO3IRX.js} +2 -2
  37. package/dist/esm/chunks/{chunk.32SMESZX.js.map → chunk.O2XO3IRX.js.map} +0 -0
  38. package/dist/esm/chunks/{chunk.2ZSAAJDN.js → chunk.ON3JVSSR.js} +2 -2
  39. package/dist/esm/chunks/{chunk.2ZSAAJDN.js.map → chunk.ON3JVSSR.js.map} +0 -0
  40. package/dist/esm/chunks/chunk.PZTAIVJW.js +7 -0
  41. package/dist/esm/chunks/chunk.PZTAIVJW.js.map +7 -0
  42. package/dist/esm/chunks/{chunk.NTFA7FCB.js → chunk.QEHJJKFZ.js} +2 -2
  43. package/dist/esm/chunks/{chunk.NTFA7FCB.js.map → chunk.QEHJJKFZ.js.map} +0 -0
  44. package/dist/esm/chunks/chunk.QOZLQPKE.js +7 -0
  45. package/dist/esm/chunks/chunk.QOZLQPKE.js.map +7 -0
  46. package/dist/esm/chunks/{chunk.G5Q2CUUE.js → chunk.RGWUF3J2.js} +2 -2
  47. package/dist/esm/chunks/{chunk.G5Q2CUUE.js.map → chunk.RGWUF3J2.js.map} +0 -0
  48. package/dist/esm/chunks/{chunk.F3W3XMGT.js → chunk.RST65QIB.js} +2 -2
  49. package/dist/esm/chunks/{chunk.F3W3XMGT.js.map → chunk.RST65QIB.js.map} +0 -0
  50. package/dist/esm/chunks/{chunk.WUIIZZQD.js → chunk.WIUER75G.js} +2 -2
  51. package/dist/esm/chunks/{chunk.WUIIZZQD.js.map → chunk.WIUER75G.js.map} +0 -0
  52. package/dist/esm/chunks/{chunk.V7P3QPNM.js → chunk.Y7Q6QI5V.js} +2 -2
  53. package/dist/esm/chunks/{chunk.V7P3QPNM.js.map → chunk.Y7Q6QI5V.js.map} +2 -2
  54. package/dist/esm/chunks/chunk.YPUWII7L.js +7 -0
  55. package/dist/esm/chunks/{chunk.5PQTSZ7G.js.map → chunk.YPUWII7L.js.map} +2 -2
  56. package/dist/esm/date-picker/index.js +1 -1
  57. package/dist/esm/date-range-picker/index.js +1 -1
  58. package/dist/esm/dialog/index.js +1 -1
  59. package/dist/esm/file-picker/index.js +1 -1
  60. package/dist/esm/index.js +1 -1
  61. package/dist/esm/list/index.js +1 -1
  62. package/dist/esm/list/list/index.js +1 -1
  63. package/dist/esm/list/list-item/index.js +1 -1
  64. package/dist/esm/list-dropdown/index.js +1 -1
  65. package/dist/esm/menu/index.js +1 -1
  66. package/dist/esm/paginator/index.js +1 -1
  67. package/dist/esm/select/core/index.js +1 -1
  68. package/dist/esm/select/index.js +1 -1
  69. package/dist/esm/select/option/index.js +1 -1
  70. package/dist/esm/select/select/index.js +1 -1
  71. package/dist/esm/select/select-dropdown/index.js +1 -1
  72. package/dist/esm/split-view/index.js +1 -1
  73. package/dist/esm/split-view/split-view/index.js +1 -1
  74. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  75. package/dist/esm/switch/index.js +1 -1
  76. package/dist/esm/text-field/index.js +1 -1
  77. package/dist/esm/time-picker/index.js +1 -1
  78. package/esm/chip-field/chip-field.js +1 -1
  79. package/esm/date-range-picker/date-range-picker-foundation.d.ts +1 -0
  80. package/esm/date-range-picker/date-range-picker-foundation.js +13 -1
  81. package/esm/dialog/dialog-adapter.d.ts +5 -5
  82. package/esm/dialog/dialog-adapter.js +31 -30
  83. package/esm/dialog/dialog-foundation.d.ts +2 -4
  84. package/esm/dialog/dialog-foundation.js +38 -55
  85. package/esm/dialog/dialog.d.ts +0 -4
  86. package/esm/dialog/dialog.js +1 -7
  87. package/esm/file-picker/file-picker.js +1 -1
  88. package/esm/list/list-item/list-item-adapter.d.ts +7 -2
  89. package/esm/list/list-item/list-item-adapter.js +10 -4
  90. package/esm/list/list-item/list-item-foundation.js +8 -2
  91. package/esm/list/list-item/list-item.d.ts +1 -1
  92. package/esm/list/list-item/list-item.js +1 -1
  93. package/esm/select/core/base-select-adapter.js +11 -1
  94. package/esm/select/core/base-select-foundation.js +7 -3
  95. package/esm/select/option/option-constants.d.ts +3 -0
  96. package/esm/select/option/option-constants.js +5 -1
  97. package/esm/select/option/option-foundation.d.ts +2 -2
  98. package/esm/select/option/option-foundation.js +1 -0
  99. package/esm/select/select/select.js +1 -1
  100. package/esm/split-view/split-view/split-view-constants.d.ts +0 -1
  101. package/esm/split-view/split-view-panel/split-view-panel-adapter.d.ts +4 -1
  102. package/esm/split-view/split-view-panel/split-view-panel-adapter.js +17 -6
  103. package/esm/split-view/split-view-panel/split-view-panel-constants.d.ts +1 -0
  104. package/esm/split-view/split-view-panel/split-view-panel-constants.js +2 -1
  105. package/esm/split-view/split-view-panel/split-view-panel-foundation.js +1 -4
  106. package/esm/split-view/split-view-panel/split-view-panel-utils.d.ts +6 -0
  107. package/esm/split-view/split-view-panel/split-view-panel-utils.js +17 -0
  108. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  109. package/esm/switch/switch.d.ts +1 -0
  110. package/esm/switch/switch.js +13 -9
  111. package/esm/text-field/text-field.js +1 -1
  112. package/package.json +1 -1
  113. package/styles/field/_base.scss +4 -2
  114. package/styles/field/_variables.scss +0 -3
  115. package/dist/esm/chunks/chunk.5D6UB4DL.js +0 -7
  116. package/dist/esm/chunks/chunk.5D6UB4DL.js.map +0 -7
  117. package/dist/esm/chunks/chunk.5PQTSZ7G.js +0 -7
  118. package/dist/esm/chunks/chunk.7JTKKFL4.js +0 -7
  119. package/dist/esm/chunks/chunk.7JTKKFL4.js.map +0 -7
  120. package/dist/esm/chunks/chunk.CYJBOJMX.js +0 -7
  121. package/dist/esm/chunks/chunk.IGMTMR3D.js +0 -7
  122. package/dist/esm/chunks/chunk.IGMTMR3D.js.map +0 -7
  123. package/dist/esm/chunks/chunk.TCCPCDJK.js +0 -7
  124. package/dist/esm/chunks/chunk.TCCPCDJK.js.map +0 -7
  125. package/dist/esm/chunks/chunk.VQKRN5IQ.js +0 -7
  126. package/dist/esm/chunks/chunk.VQKRN5IQ.js.map +0 -7
  127. package/dist/esm/chunks/chunk.YK2PXI6D.js +0 -7
  128. package/dist/esm/chunks/chunk.YK2PXI6D.js.map +0 -7
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/list/list/list-constants.ts", "../../src/list/list-item/list-item-constants.ts", "../../src/list/list-item/list-item-adapter.ts", "../../src/list/list-item/list-item-foundation.ts", "../../src/list/list-item/list-item.ts", "../../src/list/list-item/index.ts"],
4
+ "sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../../constants';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}list`;\n\nconst attributes = {\n STATIC: 'static',\n DENSE: 'dense',\n PROPAGATE_CLICK: 'propagate-click',\n INDENTED: 'indented',\n SELECTED_VALUE: 'selected-value'\n};\n\nconst selectors = {\n FOCUSABLE_LIST_ITEMS: '.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled)'\n};\n\nexport const LIST_CONSTANTS = {\n elementName,\n attributes,\n selectors\n};\n", "import { COMPONENT_NAME_PREFIX } from '../../constants';\nimport { IListItemComponent } from './list-item';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}list-item`;\n\nconst attributes = {\n STATIC: 'static',\n TWO_LINE: 'two-line',\n THREE_LINE: 'three-line',\n ACTIVE: 'active',\n SELECTED: 'selected',\n VALUE: 'value',\n HREF: 'href',\n TARGET: 'target',\n RIPPLE: 'ripple',\n DISABLED: 'disabled',\n DENSE: 'dense',\n PROPAGATE_CLICK: 'propagate-click',\n INDENTED: 'indented',\n WRAP: 'wrap',\n DRAWER_CONTEXT: 'forge-drawer-context',\n IGNORE: 'forge-ignore'\n};\n\nconst classes = {\n LIST_ITEM: 'forge-list-item',\n STATIC: 'forge-list-item--static',\n TEXT: 'forge-list-item__text',\n TWO_LINE: 'forge-list-item--two-line',\n THREE_LINE: 'forge-list-item--three-line',\n ACTIVE: 'forge-list-item--active',\n ACTIVATED: 'forge-list-item--activated',\n SELECTED: 'forge-list-item--selected',\n DISABLED: 'forge-list-item--disabled',\n DENSE: 'forge-list-item--dense',\n INDENTED: 'forge-list-item--indented',\n WRAP: 'forge-list-item--wrap'\n};\n\nconst selectors = {\n LIST_ITEM: `.${classes.LIST_ITEM}`,\n DEFAULT_SLOT: `.${classes.TEXT} > slot`,\n CHECKBOX_RADIO_SELECTOR: 'input[type=checkbox]:not(:disabled):not([forge-ignore]),input[type=radio]:not(:disabled):not([forge-ignore])'\n};\n\nconst events = {\n SELECT: `${elementName}-select`\n};\n\nconst roles = {\n LINK: 'link',\n LIST_ITEM: 'listitem'\n};\n\nexport const LIST_ITEM_CONSTANTS = {\n elementName,\n attributes,\n classes,\n selectors,\n events,\n roles\n};\n\nexport interface IListItemSelectEventData {\n value: any;\n listItem: IListItemComponent;\n}\n", "import { addClass, getShadowElement, removeClass, requireParent, isDeepEqual, toggleClass } from '@tylertech/forge-core';\nimport { BaseAdapter, IBaseAdapter } from '../../core/base/base-adapter';\nimport { IListComponent } from '../list/list';\nimport { LIST_CONSTANTS } from '../list/list-constants';\nimport { IListItemComponent } from './list-item';\nimport { LIST_ITEM_CONSTANTS } from './list-item-constants';\nimport { ForgeRipple } from '../../ripple';\n\nexport interface IListItemAdapter extends IBaseAdapter {\n initializeAccessibility(): void;\n getListItem(): IListItemComponent;\n addListener(type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions): void;\n removeListener(type: string, listener: (evt: Event) => void): void;\n createRipple(): any;\n setStatic(value: boolean): void;\n setTwoLine(value: boolean): void;\n setThreeLine(value: boolean): void;\n getLineCount(): number;\n setActive(value: boolean): void;\n setSelected(value: boolean): void;\n tryToggleCheckboxRadio(value?: boolean): void;\n setFocus(): void;\n hasFocus(): boolean;\n setRole(role: string): void;\n setDisabled(disabled: boolean): void;\n setDense(dense: boolean): void;\n setIndented(indented: boolean): void;\n setWrap(value: boolean): void;\n trySelect(value: unknown): boolean | null;\n}\n\nexport class ListItemAdapter extends BaseAdapter<IListItemComponent> implements IListItemAdapter {\n private _listItemElement: HTMLElement;\n private _defaultSlot: HTMLSlotElement;\n\n constructor(component: IListItemComponent) {\n super(component);\n this._initialize();\n }\n\n private _initialize(): void {\n this._listItemElement = getShadowElement(this._component, LIST_ITEM_CONSTANTS.selectors.LIST_ITEM);\n this._defaultSlot = getShadowElement(this._component, LIST_ITEM_CONSTANTS.selectors.DEFAULT_SLOT) as HTMLSlotElement;\n }\n \n public initializeAccessibility(): void {\n if (!this._component.hasAttribute('role')) {\n this._component.setAttribute('role', 'listitem');\n }\n }\n\n public getListItem(): IListItemComponent {\n return this._component;\n }\n\n /**\n * Adds an event listener to the `<forge-list-item>` host element.\n * @param {string} type The event type.\n * @param {Function} listener The event callback.\n */\n public addListener(type: string, listener: (evt: Event) => void, options?: AddEventListenerOptions): void {\n this._listItemElement.addEventListener(type, listener, options);\n }\n\n /**\n * Removes an event listener from the `<forge-list-item>` host element.\n * @param {string} type The event type.\n * @param {Function} listener The event callback.\n */\n public removeListener(type: string, listener: (evt: Event) => void): void {\n this._listItemElement.removeEventListener(type, listener);\n }\n\n /**\n * Creates a ripple instance on the list item.\n * @returns {ForgeRipple}\n */\n public createRipple(): any {\n return new ForgeRipple(this._listItemElement);\n }\n\n /**\n * Toggles the static state of this list item.\n * @param {boolean} value The static state.\n */\n public setStatic(value: boolean): void {\n if (value) {\n this._listItemElement.tabIndex = -1;\n addClass(LIST_ITEM_CONSTANTS.classes.STATIC, this._listItemElement);\n } else {\n this._listItemElement.tabIndex = 0;\n removeClass(LIST_ITEM_CONSTANTS.classes.STATIC, this._listItemElement);\n }\n }\n\n /**\n * Sets this list item as a two-line list item.\n * @param {boolean} value The two-line state.\n */\n public setTwoLine(value: boolean): void {\n if (value) {\n addClass(LIST_ITEM_CONSTANTS.classes.TWO_LINE, this._listItemElement);\n } else {\n removeClass(LIST_ITEM_CONSTANTS.classes.TWO_LINE, this._listItemElement);\n }\n }\n\n /**\n * Sets this list item as a three-line list item.\n * @param {boolean} value The three-line state.\n */\n public setThreeLine(value: boolean): void {\n if (value) {\n addClass(LIST_ITEM_CONSTANTS.classes.THREE_LINE, this._listItemElement);\n } else {\n removeClass(LIST_ITEM_CONSTANTS.classes.THREE_LINE, this._listItemElement);\n }\n }\n\n /**\n * Determines how many lines the list item is displaying.\n */\n public getLineCount(): number {\n return this._defaultSlot.assignedNodes().filter(e => e.nodeType === Node.ELEMENT_NODE).length; // assignedElements does not exist in the polyfilled version so filtering nodes instead\n }\n\n /**\n * Toggles the active class of the list item.\n * @param {boolean} value The active state.\n */\n public setActive(value: boolean): void {\n if (value) {\n addClass(LIST_ITEM_CONSTANTS.classes.ACTIVE, this._listItemElement);\n } else {\n removeClass(LIST_ITEM_CONSTANTS.classes.ACTIVE, this._listItemElement);\n }\n }\n\n /**\n * Toggles the selected class of the list item.\n * @param {boolean} value The active state.\n */\n public setSelected(value: boolean): void {\n if (value) {\n addClass(LIST_ITEM_CONSTANTS.classes.SELECTED, this._listItemElement);\n // We are treating selected and activated as the same state, and mdc-states hooks right into --activated\n // addClass(LIST_ITEM_CONSTANTS.classes.ACTIVATED, this._listItemElement);\n } else {\n removeClass(LIST_ITEM_CONSTANTS.classes.SELECTED, this._listItemElement);\n // removeClass(LIST_ITEM_CONSTANTS.classes.ACTIVATED, this._listItemElement);\n }\n }\n\n /**\n * Attemps to toggle a checkbox or radio button within the list item if it can find one.\n */\n public tryToggleCheckboxRadio(value?: boolean): void {\n const checkable = this._component.querySelector(LIST_ITEM_CONSTANTS.selectors.CHECKBOX_RADIO_SELECTOR) as HTMLInputElement;\n if (checkable) {\n const force = typeof value === 'boolean';\n const currentState = checkable.checked;\n \n // Check if we are just toggling or forcing to a specific checked state\n checkable.checked = force ? value as boolean : !checkable.checked;\n\n if (!force || currentState !== value) {\n checkable.dispatchEvent(new Event('change', { bubbles: true }));\n }\n }\n }\n\n /** Attempts to set focus to this list item. */\n public setFocus(): void {\n this._listItemElement.focus();\n }\n\n /** Returns whether the component has focus or not. */\n public hasFocus(): boolean {\n return document.activeElement === this._component || !!this._component.shadowRoot?.activeElement;\n }\n\n /**\n * Sets the role on the list item element.\n * @param role The role.\n */\n public setRole(role: string): void {\n this._listItemElement.setAttribute('role', role);\n }\n\n public setDisabled(disabled: boolean): void {\n toggleClass(this._listItemElement, disabled, LIST_ITEM_CONSTANTS.classes.DISABLED);\n }\n\n public setDense(dense: boolean): void {\n toggleClass(this._listItemElement, dense, LIST_ITEM_CONSTANTS.classes.DENSE);\n }\n\n public setIndented(indented: boolean): void {\n toggleClass(this._listItemElement, indented, LIST_ITEM_CONSTANTS.classes.INDENTED);\n }\n\n public setWrap(value: boolean): void {\n toggleClass(this._listItemElement, value, LIST_ITEM_CONSTANTS.classes.WRAP);\n }\n\n /**\n * Attempts to set the selected state of the list item element and it's visual indicators\n * @param value The value to compare to the parent list element's selected value\n * @returns Returns whether the list item is selected or not\n */\n public trySelect(value: unknown): boolean | null {\n const list = requireParent<IListComponent>(this._component, LIST_CONSTANTS.elementName);\n if (!list || list.selectedValue === undefined) {\n return null;\n }\n\n const listValues = list.selectedValue instanceof Array ? list.selectedValue : [list.selectedValue];\n const isSelected = listValues.some(v => isDeepEqual(v, value));\n\n this.setSelected(isSelected);\n this.tryToggleCheckboxRadio(isSelected);\n return isSelected;\n }\n}\n", "import { ICustomElementFoundation, matchesSelectors } from '@tylertech/forge-core';\nimport { ForgeRipple } from '../../ripple';\nimport { IListItemAdapter } from './list-item-adapter';\nimport { LIST_ITEM_CONSTANTS, IListItemSelectEventData } from './list-item-constants';\n\nexport interface IListItemFoundation extends ICustomElementFoundation {\n static: boolean;\n twoLine: boolean;\n threeLine: boolean;\n active: boolean;\n selected: boolean;\n value: any;\n href: string;\n target: string;\n ripple: boolean;\n disabled: boolean;\n dense: boolean;\n wrap: boolean;\n setFocus(): void;\n}\n\n/**\n * The foundation class behind the `<forge-list-item>` component.\n */\nexport class ListItemFoundation implements IListItemFoundation {\n private _ripple = true;\n private _rippleInstance: ForgeRipple;\n private _static = false;\n private _twoLine = false;\n private _threeLine = false;\n private _active = false;\n private _selected = false;\n private _value: any;\n private _href: string;\n private _target: string;\n private _disabled = false;\n private _dense = false;\n private _propagateClick = true;\n private _indented = false;\n private _wrap = false;\n private _clickListener: (evt: MouseEvent) => void;\n private _mouseDownListener: (evt: MouseEvent) => void;\n private _keydownListener: (evt: KeyboardEvent) => void;\n\n constructor(private _adapter: IListItemAdapter) {\n this._clickListener = (evt: MouseEvent) => this._onClick(evt);\n this._mouseDownListener = (evt: MouseEvent) => this._onMouseDown(evt);\n this._keydownListener = (evt: KeyboardEvent) => this._onKeydown(evt);\n }\n\n public initialize(): void {\n this._adapter.initializeAccessibility();\n this._setRipple();\n this._adapter.setStatic(this._static);\n this._adapter.setDense(this._dense);\n this._adapter.setDisabled(this._disabled);\n this._adapter.setIndented(this._indented);\n this._adapter.setWrap(this._wrap);\n\n if (!this._static) {\n this._adapter.addListener('click', this._clickListener);\n this._adapter.addListener('mousedown', this._mouseDownListener, { passive: false, capture: true });\n this._adapter.addListener('keydown', this._keydownListener);\n }\n\n if (this._threeLine) {\n this._adapter.setThreeLine(this._threeLine);\n } else if (this.twoLine) {\n this._adapter.setTwoLine(this._twoLine);\n }\n\n const isSelected = this._adapter.trySelect(this._value);\n if(isSelected != null) {\n this._selected = isSelected;\n }\n }\n\n public disconnect(): void {\n if (this._rippleInstance) {\n this._rippleInstance.destroy();\n this._rippleInstance = undefined as any;\n }\n }\n\n private _onMouseDown(evt: MouseEvent): void {\n if (this._adapter.hasFocus() || !this._propagateClick) {\n evt.preventDefault();\n }\n }\n\n private _onKeydown(evt: KeyboardEvent): void {\n if (evt.key === 'Enter' || evt.key === ' ') {\n if (evt.key === ' ') {\n evt.preventDefault();\n }\n this._select(evt.target as HTMLElement);\n }\n }\n\n /**\n * Handles clicking a list item.\n * @param evt\n */\n private _onClick(evt: MouseEvent): void {\n this._select(evt.target as HTMLElement);\n }\n\n private _select(targetElement: HTMLElement): void {\n const ignoreElement = targetElement?.hasAttribute(LIST_ITEM_CONSTANTS.attributes.IGNORE);\n if (this._static || this._disabled || ignoreElement) {\n return;\n }\n\n if (!this._adapter.hasFocus() && this._propagateClick) {\n this.setFocus();\n }\n\n if (this._href) {\n if (this._target) {\n window.open(this._href, this._target);\n } else {\n document.location.href = this._href;\n }\n return;\n }\n\n // If the target was not a checkbox or radio button, attempt to find one and toggle its checked state\n if (!matchesSelectors(targetElement, LIST_ITEM_CONSTANTS.selectors.CHECKBOX_RADIO_SELECTOR)) {\n this._adapter.tryToggleCheckboxRadio();\n }\n\n const data: IListItemSelectEventData = {\n value: this._value,\n listItem: this._adapter.getListItem()\n };\n this._adapter.emitHostEvent(LIST_ITEM_CONSTANTS.events.SELECT, data);\n }\n\n /** Gets/sets whether the list item has a ripple or not. */\n public get ripple(): boolean {\n return this._ripple;\n }\n public set ripple(value: boolean) {\n if (this._ripple !== value) {\n // We don't attach ripples to static items\n if (value && this._static) {\n return;\n }\n this._ripple = value;\n this._setRipple();\n\n this._adapter.setHostAttribute(LIST_ITEM_CONSTANTS.attributes.RIPPLE, String(this._ripple));\n }\n }\n\n /** Gets/sets whether the static state of this list item. */\n public get static(): boolean {\n return this._static;\n }\n public set static(value: boolean) {\n if (this._static !== value) {\n this._static = value;\n this._adapter.setStatic(this._static);\n\n // Ensure we either add or remove the ripple\n this._setRipple();\n\n // Toggle the click listener\n if (this._static) {\n this._adapter.removeListener('click', this._clickListener);\n } else {\n this._adapter.addListener('click', this._clickListener);\n }\n\n if (this._static) {\n this._adapter.setHostAttribute(LIST_ITEM_CONSTANTS.attributes.STATIC);\n } else {\n this._adapter.removeHostAttribute(LIST_ITEM_CONSTANTS.attributes.STATIC);\n }\n }\n }\n\n /** Gets/sets whether the list item displays two lines of text. */\n public get twoLine(): boolean {\n return this._twoLine;\n }\n public set twoLine(value: boolean) {\n if (this._twoLine !== value) {\n this._twoLine = value;\n this._adapter.setTwoLine(this._twoLine);\n\n if (this._twoLine) {\n this._adapter.setHostAttribute(LIST_ITEM_CONSTANTS.attributes.TWO_LINE);\n } else {\n this._adapter.removeHostAttribute(LIST_ITEM_CONSTANTS.attributes.TWO_LINE);\n }\n }\n }\n\n /** Gets/sets whether the list item displays two lines of text. */\n public get threeLine(): boolean {\n return this._threeLine;\n }\n public set threeLine(value: boolean) {\n if (this._threeLine !== value) {\n this._threeLine = value;\n\n if (this._threeLine) {\n this._adapter.setHostAttribute(LIST_ITEM_CONSTANTS.attributes.THREE_LINE);\n } else {\n this._adapter.removeHostAttribute(LIST_ITEM_CONSTANTS.attributes.THREE_LINE);\n }\n\n if (this._threeLine) {\n this._twoLine = false;\n }\n\n this._adapter.setTwoLine(this._twoLine);\n this._adapter.setThreeLine(this._threeLine);\n }\n }\n\n /** Gets/sets whether the list item is active or not. */\n public get active(): boolean {\n return this._active;\n }\n public set active(value: boolean) {\n if (this._active !== value) {\n this._active = value;\n this._adapter.setActive(this._active);\n if (this._active) {\n this._adapter.setHostAttribute(LIST_ITEM_CONSTANTS.attributes.ACTIVE);\n } else {\n this._adapter.removeHostAttribute(LIST_ITEM_CONSTANTS.attributes.ACTIVE);\n }\n }\n }\n\n /** Gets/sets whether the list item is selected or not. */\n public get selected(): boolean {\n return this._selected;\n }\n public set selected(value: boolean) {\n if (this._selected !== value) {\n this._selected = value;\n this._adapter.setSelected(this._selected);\n this._adapter.tryToggleCheckboxRadio(this._selected);\n this._adapter.toggleHostAttribute(LIST_ITEM_CONSTANTS.attributes.SELECTED, this._selected);\n }\n }\n\n /** Gets/sets the unique value for this list item. */\n public get value(): any {\n return this._value;\n }\n public set value(value: any) {\n this._value = value;\n const isSelected = this._adapter.trySelect(this._value);\n if(isSelected != null) {\n this._selected = isSelected;\n }\n }\n\n /** Gets/sets the href link that this list item will send the browser to when clicked. */\n public get href(): string {\n return this._href;\n }\n public set href(value: string) {\n if (this._href !== value) {\n this._href = value;\n if (this._href) {\n this._adapter.setRole(LIST_ITEM_CONSTANTS.roles.LINK);\n } else {\n this._adapter.setRole(LIST_ITEM_CONSTANTS.roles.LIST_ITEM);\n }\n this._adapter.setHostAttribute(LIST_ITEM_CONSTANTS.attributes.HREF, this._href);\n }\n }\n\n /** Gets/sets the href link target. */\n public get target(): string {\n return this._target;\n }\n public set target(value: string) {\n this._target = value;\n }\n\n /** Gets/sets the disabled state. */\n public get disabled(): boolean {\n return this._disabled;\n }\n public set disabled(value: boolean) {\n if (this._disabled !== value) {\n this._disabled = value;\n this._adapter.setDisabled(this._disabled);\n this._adapter.toggleHostAttribute(LIST_ITEM_CONSTANTS.attributes.DISABLED, this._disabled);\n }\n }\n\n /** Gets/sets the dense state. */\n public get dense(): boolean {\n return this._dense;\n }\n public set dense(value: boolean) {\n if (this._dense !== value) {\n this._dense = value;\n this._adapter.setDense(this._dense);\n this._adapter.toggleHostAttribute(LIST_ITEM_CONSTANTS.attributes.DENSE, this._dense);\n }\n }\n\n /** Gets/sets the dense state. */\n public get propagateClick(): boolean {\n return this._propagateClick;\n }\n public set propagateClick(value: boolean) {\n if (this._propagateClick !== value) {\n this._propagateClick = value;\n this._adapter.setHostAttribute(LIST_ITEM_CONSTANTS.attributes.PROPAGATE_CLICK, '' + !!this._propagateClick);\n }\n }\n\n public get indented(): boolean {\n return this._indented;\n }\n public set indented(value: boolean) {\n if (this._indented !== value) {\n this._indented = value;\n this._adapter.setIndented(this._indented);\n this._adapter.toggleHostAttribute(LIST_ITEM_CONSTANTS.attributes.INDENTED, this._indented);\n }\n }\n\n public get wrap(): boolean {\n return this._wrap;\n }\n public set wrap(value: boolean) {\n if (this._wrap !== value) {\n this._wrap = value;\n this._adapter.setWrap(this._wrap);\n this._adapter.toggleHostAttribute(LIST_ITEM_CONSTANTS.attributes.WRAP, this._wrap);\n }\n }\n\n private _setRipple(): void {\n if (this._ripple && !this._static && !this._rippleInstance) {\n this._rippleInstance = this._adapter.createRipple();\n } else if ((!this._ripple || this._static) && this._rippleInstance) {\n this._rippleInstance.destroy();\n this._rippleInstance = undefined as any;\n }\n }\n\n /**\n * Sets focus to this list item.\n */\n public setFocus(): void {\n this._adapter.setFocus();\n }\n}\n", "import { CustomElement, attachShadowTemplate, requireParent, elementParents, coerceBoolean, FoundationProperty } from '@tylertech/forge-core';\nimport { ListItemAdapter } from './list-item-adapter';\nimport { ListItemFoundation } from './list-item-foundation';\nimport { IListItemSelectEventData, LIST_ITEM_CONSTANTS } from './list-item-constants';\nimport { LIST_CONSTANTS } from '../list/list-constants';\nimport { IListComponent } from '../list';\nimport { BaseComponent, IBaseComponent } from '../../core/base/base-component';\n\nconst defaultTemplate = '<template><div class=\\\"forge-list-item\\\" tabindex=\\\"0\\\" part=\\\"root\\\"><slot name=\\\"leading\\\"></slot><slot name=\\\"avatar\\\"></slot><div class=\\\"forge-list-item__text\\\" part=\\\"text-container\\\"><slot></slot><slot name=\\\"title\\\"></slot><slot name=\\\"subtitle\\\"></slot><slot name=\\\"tertiary-title\\\"></slot><slot></slot></div><slot name=\\\"trailing\\\"></slot></div></template>';\nconst styles = '@-webkit-keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@keyframes mdc-ripple-fg-radius-in{from{-webkit-animation-timing-function:cubic-bezier(0.4,0,0.2,1);animation-timing-function:cubic-bezier(0.4,0,0.2,1);-webkit-transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1);transform:translate(var(--mdc-ripple-fg-translate-start,0)) scale(1)}to{-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}}@-webkit-keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@keyframes mdc-ripple-fg-opacity-in{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:0}to{opacity:var(--mdc-ripple-fg-opacity, 0)}}@-webkit-keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}@keyframes mdc-ripple-fg-opacity-out{from{-webkit-animation-timing-function:linear;animation-timing-function:linear;opacity:var(--mdc-ripple-fg-opacity, 0)}to{opacity:0}}.mdc-ripple-surface{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity;position:relative;outline:0;overflow:hidden}.mdc-ripple-surface::after,.mdc-ripple-surface::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\\\"\\\"}.mdc-ripple-surface::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.mdc-ripple-surface::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.mdc-ripple-surface.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.mdc-ripple-surface.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.mdc-ripple-surface.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.mdc-ripple-surface::after,.mdc-ripple-surface::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.mdc-ripple-surface.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded],.mdc-ripple-upgraded--unbounded{overflow:visible}.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded]::before,.mdc-ripple-upgraded--unbounded::after,.mdc-ripple-upgraded--unbounded::before{top:calc(50% - 50%);left:calc(50% - 50%);width:100%;height:100%}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::before,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::before{top:var(--mdc-ripple-top,calc(50% - 50%));left:var(--mdc-ripple-left,calc(50% - 50%));width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface[data-mdc-ripple-is-unbounded].mdc-ripple-upgraded::after,.mdc-ripple-upgraded--unbounded.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{background-color:#000;background-color:var(--mdc-ripple-color,#000)}.mdc-ripple-surface.mdc-ripple-surface--hover::before,.mdc-ripple-surface:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.mdc-ripple-surface.mdc-ripple-upgraded--background-focused::before,.mdc-ripple-surface:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.mdc-ripple-surface:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.mdc-ripple-surface:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.mdc-ripple-surface.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.mdc-ripple-surface::after,.mdc-ripple-surface::before{--mdc-ripple-color:var(--mdc-theme-on-surface)}.forge-list-item{min-height:auto;min-height:var(--forge-list-item-min-height,auto);max-height:auto;max-height:var(--forge-list-item-max-height,auto);height:48px;height:var(--forge-list-item-height,48px);padding:0 16px;padding:var(--forge-list-item-padding,0 16px);margin-left:0;margin-left:var(--forge-list-item-indent,0);-webkit-box-align:center;align-items:center;-webkit-box-align:var(--forge-list-item-align-items,center);align-items:var(--forge-list-item-align-items,center);position:relative;display:-webkit-box;display:flex;-webkit-box-pack:start;justify-content:flex-start;overflow:hidden}.forge-list-item:focus{outline:0}.forge-list-item ::slotted([slot=leading]),.forge-list-item ::slotted([slot=trailing]){font-size:1.5rem}.forge-list-item ::slotted([slot=leading]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:0;margin-left:var(--forge-list-item-leading-margin-left,0);margin-right:32px;margin-right:var(--forge-list-item-leading-margin-right,32px);display:-webkit-inline-box;display:inline-flex;flex-shrink:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;fill:currentColor}.forge-list-item ::slotted([slot=trailing]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54))}.forge-list-item ::slotted([slot=avatar]){color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));margin-left:0;margin-left:var(--forge-list-item-leading-margin-left,0);margin-right:32px;margin-right:var(--forge-list-item-leading-margin-right,32px);display:-webkit-inline-box;display:inline-flex;flex-shrink:0;-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;fill:currentColor;margin-left:0;margin-right:16px;min-width:40px;min-height:40px;border-radius:50%;display:inline-flex;background-color:rgba(0,0,0,.54);background-color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));color:#fff;color:var(--mdc-theme-on-primary,#fff)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item{--mdc-ripple-fg-size:0;--mdc-ripple-left:0;--mdc-ripple-top:0;--mdc-ripple-fg-scale:1;--mdc-ripple-fg-translate-end:0;--mdc-ripple-fg-translate-start:0;-webkit-tap-highlight-color:transparent;will-change:transform,opacity}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::after,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::before{position:absolute;border-radius:50%;opacity:0;pointer-events:none;content:\\\"\\\"}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::before{-webkit-transition:opacity 15ms linear,background-color 15ms linear;transition:opacity 15ms linear,background-color 15ms linear;z-index:1;z-index:var(--mdc-ripple-z-index,1)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::after{z-index:0;z-index:var(--mdc-ripple-z-index,0)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded::before{-webkit-transform:scale(var(--mdc-ripple-fg-scale,1));transform:scale(var(--mdc-ripple-fg-scale,1))}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded::after{top:0;left:0;-webkit-transform:scale(0);transform:scale(0);-webkit-transform-origin:center center;transform-origin:center center}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded--unbounded::after{top:var(--mdc-ripple-top,0);left:var(--mdc-ripple-left,0)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded--foreground-activation::after{-webkit-animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards;animation:mdc-ripple-fg-radius-in 225ms forwards,mdc-ripple-fg-opacity-in 75ms forwards}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded--foreground-deactivation::after{-webkit-animation:mdc-ripple-fg-opacity-out 150ms;animation:mdc-ripple-fg-opacity-out 150ms;-webkit-transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1));transform:translate(var(--mdc-ripple-fg-translate-end,0)) scale(var(--mdc-ripple-fg-scale,1))}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::after,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::before{top:calc(50% - 100%);left:calc(50% - 100%);width:200%;height:200%}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded::after{width:var(--mdc-ripple-fg-size,100%);height:var(--mdc-ripple-fg-size,100%)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::after,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::before{background-color:#000;background-color:var(--mdc-ripple-color,var(--mdc-theme-on-surface,#000))}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-surface--hover::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:hover::before{opacity:.04;opacity:var(--mdc-ripple-hover-opacity, .04)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded--background-focused::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-focus-opacity, .12)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.12;opacity:var(--mdc-ripple-press-opacity, .12)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.12)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated::before{opacity:.12;opacity:var(--mdc-ripple-activated-opacity, .12)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated::after,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated.mdc-ripple-surface--hover::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated:hover::before{opacity:.16;opacity:var(--mdc-ripple-hover-opacity, .16)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated.mdc-ripple-upgraded--background-focused::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-focus-opacity, .24)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.24;opacity:var(--mdc-ripple-press-opacity, .24)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--activated.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.24)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected::before{opacity:.08;opacity:var(--mdc-ripple-selected-opacity, .08)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected::after,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected::before{background-color:#3f51b5;background-color:var(--mdc-ripple-color,var(--mdc-theme-primary,#3f51b5))}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected.mdc-ripple-surface--hover::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected:hover::before{opacity:.12;opacity:var(--mdc-ripple-hover-opacity, .12)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected.mdc-ripple-upgraded--background-focused::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected:not(.mdc-ripple-upgraded):focus::before{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.2;opacity:var(--mdc-ripple-focus-opacity, .2)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected:not(.mdc-ripple-upgraded)::after{-webkit-transition:opacity 150ms linear;transition:opacity 150ms linear}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected:not(.mdc-ripple-upgraded):active::after{-webkit-transition-duration:75ms;transition-duration:75ms;opacity:.2;opacity:var(--mdc-ripple-press-opacity, .2)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected.mdc-ripple-upgraded{--mdc-ripple-fg-opacity:var(--mdc-ripple-press-opacity, 0.2)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--selected:focus:hover.mdc-ripple-upgraded--background-focused:not(.mdc-ripple-upgraded--foreground-activation)::before{opacity:.28}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before{opacity:.12}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation):hover::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation):hover::before{opacity:.16}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::after,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--active:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::after,.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:focus:not(.forge-list-item--selected):not(.forge-list-item--activated):not(.mdc-ripple-upgraded--foreground-activation)::before{background-color:#000;background-color:var(--mdc-theme-on-surface,#000)}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--active:focus.forge-list-item--selected.forge-list-item--activated:not(.mdc-ripple-upgraded--foreground-activation)::before{opacity:.24}.forge-list-item:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item--active:focus.forge-list-item--selected.forge-list-item--activated:not(.mdc-ripple-upgraded--foreground-activation):hover::before{opacity:.28}.forge-list-item--wrap .forge-list-item__text{text-overflow:clip;white-space:normal}.forge-list-item__text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden;width:100%}.forge-list-item ::slotted([slot=title]){text-overflow:ellipsis;white-space:nowrap;overflow:hidden;display:block}.forge-list-item ::slotted([slot=subtitle]),.forge-list-item ::slotted([slot=tertiary-title]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);text-overflow:ellipsis;white-space:nowrap;overflow:hidden;color:rgba(0,0,0,.54);color:var(--mdc-theme-text-secondary-on-background,rgba(0,0,0,.54));display:block}.forge-list-item ::slotted([slot=subtitle])::before,.forge-list-item ::slotted([slot=tertiary-title])::before{display:inline-block;width:0;height:20;content:\\\"\\\";vertical-align:0}.forge-list-item--two-line{height:72px;height:var(--forge-list-item-height,72px)}.forge-list-item--three-line{height:88px;height:var(--forge-list-item-height,88px)}.forge-list-item--dense{height:32px;height:var(--forge-list-item-height,32px)}.forge-list-item--dense ::slotted([slot=leading]),.forge-list-item--dense ::slotted([slot=trailing]){font-size:1.25rem}.forge-list-item--dense ::slotted([slot=leading]){margin-right:12px;margin-right:var(--forge-list-item-leading-margin-right,12px)}.forge-list-item--dense ::slotted(.forge-list-item__title){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit)}.forge-list-item--indented{margin-left:56px;margin-left:var(--forge-list-item-indent,56px)}.forge-list-item--active.forge-list-item--activated:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::before,.forge-list-item--active.forge-list-item--selected:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item::before{opacity:.2}.forge-list-item--active.forge-list-item--activated:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:hover::before,.forge-list-item--active.forge-list-item--selected:not(.forge-list-item--static):not(.forge-list-item--disabled).forge-list-item:hover::before{opacity:.24}.forge-list-item--activated,.forge-list-item--selected{color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-list-item--activated .forge-list-item__text .forge-list-item__subtitle,.forge-list-item--activated .forge-list-item__text ::slotted(.forge-list-item__subtitle),.forge-list-item--selected .forge-list-item__text .forge-list-item__subtitle,.forge-list-item--selected .forge-list-item__text ::slotted(.forge-list-item__subtitle){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5);opacity:.87}.forge-list-item--activated .forge-list-item__text .forge-list-item__tertiary-title,.forge-list-item--activated .forge-list-item__text ::slotted(.forge-list-item__tertiary-title),.forge-list-item--selected .forge-list-item__text .forge-list-item__tertiary-title,.forge-list-item--selected .forge-list-item__text ::slotted(.forge-list-item__tertiary-title){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5);opacity:.87}.forge-list-item--activated ::slotted([slot=leading]),.forge-list-item--activated ::slotted([slot=trailing]),.forge-list-item--selected ::slotted([slot=leading]),.forge-list-item--selected ::slotted([slot=trailing]){color:#3f51b5;color:var(--mdc-theme-primary,#3f51b5)}.forge-list-item--activated ::slotted([slot=avatar].forge-list-item__avatar-icon),.forge-list-item--selected ::slotted([slot=avatar].forge-list-item__avatar-icon){background-color:rgba(0,0,0,.12);background-color:var(--mdc-theme-text-disabled-on-background,rgba(0,0,0,.12));color:#000;color:var(--mdc-theme-on-surface,#000)}.forge-list-item--disabled{cursor:not-allowed;cursor:var(--forge-list-item-cursor,not-allowed);color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-list-item--disabled ::slotted([slot=leading]),.forge-list-item--disabled ::slotted([slot=trailing]){cursor:not-allowed;cursor:var(--forge-list-item-cursor,not-allowed);color:rgba(0,0,0,.38);color:var(--mdc-theme-text-disabled-on-light,rgba(0,0,0,.38))}.forge-list-item[role=link]{cursor:pointer}:host{display:block;contain:content}:host([hidden]){display:none}:host([forge-drawer-context=true]) .forge-list-item{margin:8px;margin:var(--forge-list-item-margin,8px);padding:0 8px;padding:var(--forge-list-item-padding,0 8px);border-radius:4px;border-radius:var(--forge-list-item-border-radius,4px);cursor:pointer;cursor:var(--forge-list-item-cursor,pointer);font-size:.875rem;font-weight:500;height:40px}:host([forge-drawer-context=true]) .forge-list-item--static{cursor:initial}:host([forge-drawer-context=true]) .forge-list-item--indented{margin-left:64px;margin-left:var(--forge-list-item-indent,64px)}:host([forge-drawer-context=true]) .forge-list-item--two-line{height:64px}:host([forge-drawer-context=true]) .forge-list-item--three-line{height:80px}:host([forge-drawer-context=true]) .forge-list-item:first-child{margin-top:4px;margin-bottom:4px}:host([forge-drawer-context=true]) .forge-list-item--dense{height:32px;height:var(--forge-list-item-height,32px)}:host([forge-drawer-context=true]) .forge-list-item--dense ::slotted([slot=leading]),:host([forge-drawer-context=true]) .forge-list-item--dense ::slotted([slot=trailing]){font-size:1.25rem}:host([forge-drawer-context=true]) .forge-list-item--dense .forge-list-item__text{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit)}:host([forge-drawer-context=true]) .forge-list-item--disabled{cursor:not-allowed;cursor:var(--forge-list-item-cursor,not-allowed)}:host([dense]){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit)}';\n\nexport interface IListItemComponent extends IBaseComponent {\n static: boolean;\n twoLine: boolean;\n threeLine: boolean;\n active: boolean;\n selected: boolean;\n value: any;\n href: string;\n target: string;\n ripple: boolean;\n disabled: boolean;\n dense: boolean;\n propagateClick: boolean;\n indented: boolean;\n wrap: boolean;\n focus(): void;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-list-item': IListItemComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-list-item-select': CustomEvent<IListItemSelectEventData>;\n }\n}\n\n/**\n * The custom element class behind the `<forge-list-item>` element.\n * \n * @tag forge-list-item\n */\n@CustomElement({\n name: LIST_ITEM_CONSTANTS.elementName\n})\nexport class ListItemComponent extends BaseComponent implements IListItemComponent {\n public static get observedAttributes(): string[] {\n return [\n LIST_ITEM_CONSTANTS.attributes.STATIC,\n LIST_ITEM_CONSTANTS.attributes.TWO_LINE,\n LIST_ITEM_CONSTANTS.attributes.THREE_LINE,\n LIST_ITEM_CONSTANTS.attributes.ACTIVE,\n LIST_ITEM_CONSTANTS.attributes.SELECTED,\n LIST_ITEM_CONSTANTS.attributes.VALUE,\n LIST_ITEM_CONSTANTS.attributes.HREF,\n LIST_ITEM_CONSTANTS.attributes.TARGET,\n LIST_ITEM_CONSTANTS.attributes.RIPPLE,\n LIST_ITEM_CONSTANTS.attributes.DISABLED,\n LIST_ITEM_CONSTANTS.attributes.DENSE,\n LIST_ITEM_CONSTANTS.attributes.PROPAGATE_CLICK,\n LIST_ITEM_CONSTANTS.attributes.INDENTED,\n LIST_ITEM_CONSTANTS.attributes.WRAP\n ];\n }\n\n private _foundation: ListItemFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, defaultTemplate, styles);\n this._foundation = new ListItemFoundation(new ListItemAdapter(this));\n }\n\n public connectedCallback(): void {\n // To simulate the :host-context() selector for Firefox until they implement it, we need to determine if the\n // list item is within a drawer for auto-styling the list item when included within a drawer. Check to see if\n // any of the parents of this element are a drawer.\n if (!this.hasAttribute(LIST_ITEM_CONSTANTS.attributes.DRAWER_CONTEXT) && elementParents(this).some(el => ['forge-drawer', 'forge-modal-drawer', 'forge-mini-drawer'].includes(el.tagName.toLowerCase()))) {\n this.setAttribute(LIST_ITEM_CONSTANTS.attributes.DRAWER_CONTEXT, 'true');\n }\n\n const list = requireParent<IListComponent>(this, LIST_CONSTANTS.elementName);\n if (list) {\n this._inheritParentListProps(list);\n }\n\n this._foundation.initialize();\n }\n\n public disconnectedCallback(): void {\n this._foundation.disconnect();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case LIST_ITEM_CONSTANTS.attributes.STATIC:\n this.static = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.TWO_LINE:\n this.twoLine = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.THREE_LINE:\n this.threeLine = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.ACTIVE:\n this.active = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.SELECTED:\n this.selected = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.VALUE:\n this.value = newValue;\n break;\n case LIST_ITEM_CONSTANTS.attributes.HREF:\n this.href = newValue;\n break;\n case LIST_ITEM_CONSTANTS.attributes.TARGET:\n this.target = newValue;\n break;\n case LIST_ITEM_CONSTANTS.attributes.RIPPLE:\n this.ripple = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.DISABLED:\n this.disabled = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.DENSE:\n this.dense = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.PROPAGATE_CLICK:\n this.propagateClick = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.INDENTED:\n this.indented = coerceBoolean(newValue);\n break;\n case LIST_ITEM_CONSTANTS.attributes.WRAP:\n this.wrap = coerceBoolean(newValue);\n break;\n }\n }\n\n private _inheritParentListProps(list: IListComponent): void {\n if (list.hasAttribute(LIST_CONSTANTS.attributes.STATIC)) {\n this.static = true;\n }\n if (list.hasAttribute(LIST_CONSTANTS.attributes.DENSE)) {\n this.dense = true;\n }\n if (list.getAttribute(LIST_CONSTANTS.attributes.PROPAGATE_CLICK) === 'false') {\n this.propagateClick = false;\n }\n if (list.hasAttribute(LIST_CONSTANTS.attributes.INDENTED)) {\n this.indented = true;\n }\n }\n\n /** Gets/sets whether the static state of this list item. */\n @FoundationProperty()\n public static: boolean;\n\n /** Gets/sets whether the list item displays two lines of text. */\n @FoundationProperty()\n public twoLine: boolean;\n\n /** Gets/sets whether the list item displays three lines of text. */\n @FoundationProperty()\n public threeLine: boolean;\n\n /** Gets/sets whether the list item is active or not. */\n @FoundationProperty()\n public active: boolean;\n\n /** Gets/sets whether the list item is selected or not. */\n @FoundationProperty()\n public selected: boolean;\n\n /** Gets/sets list item value. */\n @FoundationProperty()\n public value: any;\n\n /** Gets/sets the href link that this list item will send the browser to when clicked. */\n @FoundationProperty()\n public href: string;\n\n /** Gets/sets the href link target. Only pertains when `href` is also used. */\n @FoundationProperty()\n public target: string;\n\n /** Gets/sets whether the list item has a ripple or not. */\n @FoundationProperty()\n public ripple: boolean;\n\n /** Gets/sets whether the list item is disabled or not. */\n @FoundationProperty()\n public disabled: boolean;\n\n /** Gets/sets whether the list item is using dense styles or not. */\n @FoundationProperty()\n public dense: boolean;\n\n /** Gets/sets whether the list item allows mousedown events through to the underlying list item element. Default is true. */\n @FoundationProperty()\n public propagateClick: boolean;\n\n /** Gets/sets whether the list item is indented or not. Default is false. */\n @FoundationProperty()\n public indented: boolean;\n\n /** Gets/sets whether the list item content is wrapped or not. Default is true. */\n @FoundationProperty()\n public wrap: boolean;\n\n /** Sets focus to this list item. */\n public override focus(): void {\n this._foundation.setFocus();\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\nimport { ListItemComponent } from './list-item';\n\nexport * from './list-item-adapter';\nexport * from './list-item-constants';\nexport * from './list-item-foundation';\nexport * from './list-item';\n\nexport function defineListItemComponent(): void {\n defineCustomElement(ListItemComponent);\n}\n"],
5
+ "mappings": "kaAEA,GAAM,GAA2C,GAAG,QAE9C,EAAa,CACjB,OAAQ,SACR,MAAO,QACP,gBAAiB,kBACjB,SAAU,WACV,eAAgB,gBAClB,EAEM,EAAY,CAChB,qBAAsB,gFACxB,EAEa,EAAiB,CAC5B,cACA,aACA,WACF,ECjBA,GAAM,GAA2C,GAAG,aAE9C,EAAa,CACjB,OAAQ,SACR,SAAU,WACV,WAAY,aACZ,OAAQ,SACR,SAAU,WACV,MAAO,QACP,KAAM,OACN,OAAQ,SACR,OAAQ,SACR,SAAU,WACV,MAAO,QACP,gBAAiB,kBACjB,SAAU,WACV,KAAM,OACN,eAAgB,uBAChB,OAAQ,cACV,EAEM,EAAU,CACd,UAAW,k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AAC,EAAmB,GACb,AAxJI,EAwJJ,qBAIA,GADP,AAAC,EAAmB,GACb,AA5JI,EA4JJ,8BAIA,GADP,AAAC,EAAmB,GACb,AAhKI,EAgKJ,wBAIA,GADP,AAAC,EAAmB,GACb,AApKI,EAoKJ,oBApKI,EAAN,GAHP,AAAC,EAAc,CACb,KAAM,EAAoB,WAC5B,CAAC,GACY,GCvCN,aAAyC,CAC9C,EAAoB,CAAiB,CACvC",
6
+ "names": []
7
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ import{a as I}from"./chunk.HUWXZ4ZN.js";import{a as P}from"./chunk.NGIBMR3Q.js";import{c as H}from"./chunk.7NXPOEXV.js";import{a as p,d as w}from"./chunk.QJPH24V4.js";import{a as L}from"./chunk.BOENNFXE.js";import{a as O}from"./chunk.A23NSEWA.js";import{a as n}from"./chunk.B3IJU6XJ.js";import{a as M,b as S}from"./chunk.BSZ2LBJX.js";import{a as A}from"./chunk.3E5QKMHL.js";import{a as D,e as x,g as m}from"./chunk.HN4PXH3D.js";import{i as C,r as T,s as y,t as k}from"./chunk.R4NDFXVA.js";import{b,c as f,d as E,k as c}from"./chunk.G76HB2FK.js";import{a as _,f as s}from"./chunk.MCIQXNKY.js";var l=`${S}dialog`,B={ANIMATING:"forge-dialog--animating",OPEN:"forge-dialog--open",ACTION_BUTTON:"forge-dialog__action__button",BUTTON_TEXT:"forge-button__text",SCROLLABLE:"forge-dialog--scrollable",FULLSCREEN:"forge-dialog--fullscreen",MOVEABLE:"forge-dialog--moveable"},v={BACKDROP_CLOSE:"backdrop-close",ESCAPE_CLOSE:"escape-close",FULLSCREEN:"fullscreen",POSITION_TYPE:"position-type",POSITION_X:"position-x",POSITION_Y:"position-y",MOVEABLE:"moveable",MOVE_TARGET:"move-target",OPEN:"forge-dialog-open",INITIAL_FOCUS:"forge-dialog-focus",DFEAULT_MOVE_TARGET:"forge-dialog-move-target"},R={CONTAINER:".forge-dialog",SURFACE:".forge-dialog__surface",BACKDROP:p.elementName,INITIAL_FOCUS:`[${v.INITIAL_FOCUS}]`,DFEAULT_MOVE_TARGET:`[${v.DFEAULT_MOVE_TARGET}]`,CONTENT:".forge-dialog__body"},z={BEFORE_CLOSE:`${l}-before-close`,OPEN:`${l}-open`,CLOSE:`${l}-close`,READY:`${l}-ready`,MOVE_START:`${l}-move-start`,MOVED:`${l}-move`,MOVE_END:`${l}-move-end`},K={ANIMATION_DURATION:150,BACKDROP_MAX_OPACITY:.3},i={elementName:l,classes:B,selectors:R,attributes:v,events:z,numbers:K};var g=class{constructor(e){this._adapter=e;this._open=!1;this._backdropClose=!0;this._escapeClose=!0;this._fullscreen=!1;this._positionType="absolute";this._positionX=null;this._positionY=null;this._moveable=!1;this._moveTarget=i.selectors.DFEAULT_MOVE_TARGET;this._isAnimating=!1;this._isMoving=!1;this._attachedDocumentKeydownHandler=!1;this._attachedBackdropClickHandler=!1;this._transitionEndHandler=t=>this._onTransitionEnd(),this._documentKeydownHandler=t=>this._onDocumentKeydown(t),this._backdropClickHandler=t=>this._onBackdropClick(t),this._moveTargetMouseDownHandler=t=>this._onMoveTargetMouseDown(t),this._moveTargetMouseMoveHandler=t=>this._onMoveTargetMouseMove(t),this._moveTargetMouseUpHandler=t=>this._onMoveTargetMouseUp(t)}initialize(){this._adapter.initializeAccessibility(),this._open&&this._moveable&&(this._adapter.setMoveable(this._moveable),this._initMoveTarget())}destroy(){this._open&&(this._removeDragHandlers(),this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler),this._attachedDocumentKeydownHandler&&this._adapter.removeDocumentListener("keydown",this._documentKeydownHandler),this._attachedBackdropClickHandler&&this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler))}async _applyOpen(e){if(e){if(typeof this._openCallback=="function"&&!await this._executeOpenCallback())return;this._open=e,this._openDialog()}else{if(typeof this._closeCallback=="function"&&!await this._executeCloseCallback())return;this._open=e,this._closeDialog()}this._adapter.toggleHostAttribute(i.attributes.OPEN,this._open)}async _executeOpenCallback(){try{return await Promise.resolve(this._openCallback())!==!1}catch(e){return!1}}async _executeCloseCallback(){try{return await Promise.resolve(this._closeCallback())!==!1}catch(e){return!1}}initializeMoveTarget(){this._moveTarget||(this._moveTarget=i.selectors.DFEAULT_MOVE_TARGET),this._initMoveTarget()}resetPosition(){this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType)}_normalizePositionValue(e){return E(e)?`${e}px`:f(e)?e:null}_openDialog(){this._adapter.attach(),this._fullscreen||(this._moveable&&this._adapter.setMoveable(this._moveable),(this._positionX!=null||this._positionY!=null)&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType)),this._adapter.setBodyAttribute(i.attributes.OPEN,"true"),this._adapter.registerTransitionEndHandler(this._transitionEndHandler),this._setDocumentKeydownListener(this._escapeClose),this._setBackdropClickListener(this._backdropClose),this._adapter.setAnimating(!0),this._isAnimating=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.setVisibility(!0),this._adapter.emitHostEvent(i.events.OPEN),this._adapter.trySetInitialFocus(),this._adapter.isScrollable()&&this._adapter.addRootClass(i.classes.SCROLLABLE)})}),setTimeout(()=>{window.requestAnimationFrame(()=>{this._open&&this._isAnimating&&this._onTransitionEnd()})},i.numbers.ANIMATION_DURATION)}_closeDialog(){this._moveTarget&&this._removeDragHandlers(),this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler),this._attachedDocumentKeydownHandler&&this._adapter.removeDocumentListener("keydown",this._documentKeydownHandler),this._attachedBackdropClickHandler&&this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler),this._isAnimating=!1,this._adapter.setAnimating(!0),this._adapter.setVisibility(!1),setTimeout(()=>{this._adapter.emitHostEvent(i.events.CLOSE),this._adapter.detach(),this._adapter.getOpenDialogs(i.elementName).length||this._adapter.removeBodyAttribute(i.attributes.OPEN)},i.numbers.ANIMATION_DURATION)}_onTransitionEnd(){!this._isAnimating||(this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler),this._adapter.setAnimating(!1),this._adapter.emitHostEvent(i.events.READY),this._adapter.tryLayoutChildren(),this._moveable&&this._initMoveTarget(),this._isAnimating=!1)}_initMoveTarget(){!this._fullscreen&&this._moveable&&this._moveTarget&&this._adapter.setMoveTarget(this._moveTarget)&&this._adapter.setMoveTargetHandler("mousedown",this._moveTargetMouseDownHandler)}_removeDragHandlers(){this._adapter.removeDragTargetHandler("mousedown",this._moveTargetMouseDownHandler),this._adapter.removeDocumentListener("mousemove",this._moveTargetMouseMoveHandler),this._adapter.removeDocumentListener("mouseup",this._moveTargetMouseUpHandler)}_onMoveTargetMouseDown(e){e.preventDefault(),this._adapter.captureActiveElement();let t=this._adapter.getSurfaceBounds();this._moveContext={top:e.clientY-t.top,left:e.clientX-t.left,height:t.height,width:t.width},this._adapter.setDocumentListener("mousemove",this._moveTargetMouseMoveHandler),this._adapter.setDocumentListener("mouseup",this._moveTargetMouseUpHandler)}_onMoveTargetMouseMove(e){e.preventDefault();let t=this._calculateOffsetPosition(e.pageX,e.pageY,this._moveContext);if(!this._isMoving&&(this._isMoving=!0,!this._adapter.emitHostEvent(i.events.MOVE_START,t,!0,!0)))return;let o=this._clampPosition(t,this._moveContext);if((!this._lastPosition||o.x!==this._lastPosition.x||o.y!==this._lastPosition.y)&&this._adapter.emitHostEvent(i.events.MOVED,o,!0,!0)){this._lastPosition=_({},o);let d=this._normalizePositionValue(o.x),N=this._normalizePositionValue(o.y);this._adapter.setSurfacePosition(d,N,"absolute")}}_onMoveTargetMouseUp(e){this._isMoving&&this._adapter.emitHostEvent(i.events.MOVE_END),this._moveComplete()}_moveComplete(){this._adapter.tryRestoreActiveElement(),this._adapter.removeDocumentListener("mousemove",this._moveTargetMouseMoveHandler),this._adapter.removeDocumentListener("mouseup",this._moveTargetMouseUpHandler),this._lastPosition=void 0,this._moveContext=void 0,this._isMoving=!1}_onDocumentKeydown(e){e.stopPropagation(),e.key&&(e.key==="Escape"||e.key==="Esc")&&this._tryClose()}_onBackdropClick(e){e.stopPropagation(),this._tryClose()}async _tryClose(){if(!!this._adapter.emitHostEvent(i.events.BEFORE_CLOSE,void 0,void 0,!0)){if(!this._beforeCloseCallback){this.open=!1;return}try{if(await Promise.resolve(this._beforeCloseCallback())!==!1){this.open=!1;return}}catch(t){return}}}_setBackdropClickListener(e){!this._open||(e&&!this._attachedBackdropClickHandler?(this._adapter.registerBackdropClickHandler(this._backdropClickHandler),this._attachedBackdropClickHandler=!0):!e&&this._attachedBackdropClickHandler&&(this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler),this._attachedBackdropClickHandler=!1))}_setDocumentKeydownListener(e){!this._open||(e&&!this._attachedDocumentKeydownHandler?(this._adapter.setDocumentListener("keydown",this._documentKeydownHandler),this._attachedDocumentKeydownHandler=!0):!e&&this._attachedDocumentKeydownHandler&&(this._adapter.removeDocumentListener("keydown",this._documentKeydownHandler),this._attachedDocumentKeydownHandler=!1))}_calculateOffsetPosition(e,t,o){return{x:e-((o==null?void 0:o.left)||0),y:t-((o==null?void 0:o.top)||0)}}_clampPosition({x:e,y:t},o){let a=0,d=0;return o&&(a=o.width,d=o.height),e<=0?e=0:e+a>=window.innerWidth&&(e=window.innerWidth-a),t<=0?t=0:t+d>=window.innerHeight&&(t=window.innerHeight-d),{x:e,y:t}}set backdropClose(e){e=Boolean(e),this._backdropClose!==e&&(this._backdropClose=e,this._setBackdropClickListener(this._backdropClose),b(this._backdropClose)?this._adapter.setHostAttribute(i.attributes.BACKDROP_CLOSE,this._backdropClose.toString()):this._adapter.removeHostAttribute(i.attributes.BACKDROP_CLOSE))}get backdropClose(){return this._backdropClose}set escapeClose(e){e=Boolean(e),this._escapeClose!==e&&(this._escapeClose=e,this._setDocumentKeydownListener(this._escapeClose),b(this._escapeClose)?this._adapter.setHostAttribute(i.attributes.ESCAPE_CLOSE,this._escapeClose.toString()):this._adapter.removeHostAttribute(i.attributes.ESCAPE_CLOSE))}get escapeClose(){return this._escapeClose}get open(){return this._open}set open(e){this._open!==e&&(e=Boolean(e),e!==this._open&&this._applyOpen(e))}get fullscreen(){return this._fullscreen}set fullscreen(e){this._fullscreen!==e&&(this._fullscreen=e,this._adapter.setFullscreen(this._fullscreen))}get openCallback(){return this._openCallback}set openCallback(e){this._openCallback=e}get closeCallback(){return this._closeCallback}set closeCallback(e){this._closeCallback=e}get beforeCloseCallback(){return this._beforeCloseCallback}set beforeCloseCallback(e){this._beforeCloseCallback=e}get positionType(){return this._positionType}set positionType(e){this._positionType!==e&&(this._positionType=e,this._open&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType))}get positionX(){return this._positionX}set positionX(e){this._positionX!==e&&(this._positionX=this._normalizePositionValue(e),this._open&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType))}get positionY(){return this._positionY}set positionY(e){this._positionY!==e&&(this._positionY=this._normalizePositionValue(e),this._open&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType))}get moveable(){return this._moveable}set moveable(e){this._moveable!==e&&(this._moveable=e,this._open&&(this._adapter.setMoveable(this._moveable),this._moveable?this._initMoveTarget():(this._removeDragHandlers(),this._isMoving=!1)))}get moveTarget(){return this._moveTarget}set moveTarget(e){this._moveTarget=e}};var u=class extends O{constructor(t){super(t);this._backdropElement=m(t,i.selectors.BACKDROP),this._containerElement=m(t,i.selectors.CONTAINER),this._surfaceElement=m(t,i.selectors.SURFACE)}initializeAccessibility(){this._component.hasAttribute("role")||this._component.setAttribute("role","dialog"),this._component.setAttribute("aria-modal","true")}setAnimating(t){t?this._containerElement.classList.add(i.classes.ANIMATING):this._containerElement.classList.remove(i.classes.ANIMATING)}setVisibility(t){t?this._containerElement.classList.add(i.classes.OPEN):this._containerElement.classList.remove(i.classes.OPEN)}attach(){document.body.appendChild(this._component)}detach(){this._activeElement&&(this._activeElement=void 0),C(this._component)}registerTransitionEndHandler(t){this._surfaceElement.addEventListener("transitionend",t)}deregisterTransitionEndHandler(t){this._surfaceElement.removeEventListener("transitionend",t)}setDocumentListener(t,o){document.addEventListener(t,o)}removeDocumentListener(t,o){document.removeEventListener(t,o)}registerBackdropClickHandler(t){this._backdropElement.addEventListener(p.events.BACKDROP_CLICK,t)}deregisterBackdropClickHandler(t){this._backdropElement.removeEventListener(p.events.BACKDROP_CLICK,t)}getOpenDialogs(t){return document.querySelectorAll(t)}setBodyAttribute(t,o){document.body.setAttribute(t,o)}removeBodyAttribute(t){document.body.removeAttribute(t)}trySetInitialFocus(){let t=T(this._component,i.selectors.INITIAL_FOCUS);t&&t.length&&t[t.length-1].focus()}isScrollable(){let t=this._component.querySelector(i.selectors.CONTENT);return t?t.scrollHeight>t.offsetHeight:!1}addRootClass(t){this._component.classList.add(t)}setFullscreen(t){t?this._containerElement.classList.add(i.classes.FULLSCREEN):this._containerElement.classList.remove(i.classes.FULLSCREEN)}setMoveable(t){k(this._containerElement,t,i.classes.MOVEABLE)}tryLayoutChildren(){let t=[L.elementName,I.elementName,H.elementName,P.elementName];Array.from(this._component.querySelectorAll(t.join(","))).filter(a=>typeof a.layout=="function").forEach(a=>a.layout())}setMoveTarget(t){return t?(this._moveTargetElement=this._component.querySelector(t),!!this._moveTargetElement):!1}setMoveTargetHandler(t,o){this._moveTargetElement&&this._moveTargetElement.addEventListener(t,o)}removeDragTargetHandler(t,o){this._moveTargetElement&&this._moveTargetElement.removeEventListener(t,o)}getSurfaceBounds(){return this._surfaceElement.getBoundingClientRect()}setSurfacePosition(t,o,a){this._surfaceElement.style.position=a==="absolute"?a:"relative",o!=null?this._surfaceElement.style.top=o:this._surfaceElement.style.removeProperty("top"),t!=null?this._surfaceElement.style.left=t:this._surfaceElement.style.removeProperty("left")}captureActiveElement(){this._activeElement=y(),this._activeElement&&this._activeElement.blur()}tryRestoreActiveElement(){this._activeElement&&(this._activeElement.isConnected&&this._activeElement.focus(),this._activeElement=void 0)}};var F='<template><div class="forge-dialog" part="root"><forge-backdrop part="scrim"></forge-backdrop><div class="forge-dialog__surface" part="surface"><slot></slot></div></div></template>',U='.forge-dialog{position:fixed;top:0;bottom:0;left:0;right:0;z-index:8;z-index:var(--forge-z-index-dialog,8);-webkit-box-align:center;align-items:center;-webkit-box-align:var(--forge-dialog-align-items,center);align-items:var(--forge-dialog-align-items,center);top:0;top:var(--forge-dialog-top,0);padding:24px;padding:var(--forge-dialog-padding,24px);display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;visibility:hidden}@media (max-width:599px){.forge-dialog{padding:0}}.forge-dialog--moveable:not(.forge-dialog--fullscreen) ::slotted([forge-dialog-move-target]){cursor:move}.forge-dialog--animating{visibility:visible}.forge-dialog--animating .forge-dialog--open .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--animating .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--scrollable .forge-dialog__footer,.forge-dialog--scrollable .forge-dialog__title{border-color:rgba(0,0,0,.12)}.forge-dialog--open{visibility:visible!important}.forge-dialog--open .forge-dialog__surface{-webkit-transform:scale(1);transform:scale(1);opacity:1}.forge-dialog__surface{-webkit-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface,#fff);width:auto;width:var(--forge-dialog-width,auto);height:auto;height:var(--forge-dialog-height,auto);min-width:280px;min-width:var(--forge-dialog-min-width,280px);max-width:100%;max-width:var(--forge-dialog-max-width,100%);max-height:100%;max-height:var(--forge-dialog-max-height,100%);border-radius:4px;border-radius:var(--forge-dialog-border-radius,var(--mdc-shape-medium,4px));display:-webkit-inline-box;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform:scale(.8);transform:scale(.8);opacity:0;overflow:hidden;z-index:inherit}.forge-dialog__header{margin:0;padding:0 24px 9px;border-bottom:1px solid transparent}.forge-dialog__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:1.25rem;font-size:var(--forge-typography-title-font-size, 1.25rem);line-height:2rem;line-height:var(--forge-typography-title-line-height, 2rem);font-weight:400;font-weight:var(--forge-typography-title-font-weight,400);letter-spacing:.0125em;letter-spacing:var(--forge-typography-title-letter-spacing, .0125em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-title-text-decoration,inherit);text-decoration:var(--forge-typography-title-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-title-text-transform,inherit);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0}.forge-dialog__title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.forge-dialog__body{-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-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);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);padding-top:20px;padding:0 24px 24px;overflow:auto}.forge-dialog__body--scrollable{max-height:195px;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1);overflow-x:auto;overflow-y:scroll;-webkit-overflow-scrolling:touch}.forge-dialog__footer{display:-webkit-box;display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;-webkit-box-align:center;align-items:center;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid transparent}.forge-dialog--fullscreen{padding:0}.forge-dialog--fullscreen .forge-dialog__surface{height:100%;width:100%;min-width:auto;max-width:100%;border-radius:0}:host{display:block}:host([hidden]){display:none}',r=class extends A{constructor(){super();x(this,F,U),this._foundation=new g(new u(this))}static get observedAttributes(){return[i.attributes.BACKDROP_CLOSE,i.attributes.ESCAPE_CLOSE,i.attributes.OPEN,i.attributes.FULLSCREEN,i.attributes.POSITION_TYPE,i.attributes.POSITION_X,i.attributes.POSITION_Y,i.attributes.MOVEABLE,i.attributes.MOVE_TARGET]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.destroy()}attributeChangedCallback(t,o,a){switch(t){case i.attributes.BACKDROP_CLOSE:this.backdropClose=a==="true";break;case i.attributes.ESCAPE_CLOSE:this.escapeClose=a==="true";break;case i.attributes.OPEN:this.open=c(a);break;case i.attributes.FULLSCREEN:this.fullscreen=c(a);break;case i.attributes.POSITION_TYPE:this.positionType=a;break;case i.attributes.POSITION_X:this.positionX=a;break;case i.attributes.POSITION_Y:this.positionY=a;break;case i.attributes.MOVEABLE:this.moveable=c(a);break;case i.attributes.MOVE_TARGET:this.moveTarget=a;break}}initializeMoveTarget(){this._foundation.initializeMoveTarget()}resetPosition(){this._foundation.resetPosition()}};s([n()],r.prototype,"backdropClose",2),s([n()],r.prototype,"escapeClose",2),s([n()],r.prototype,"open",2),s([n()],r.prototype,"fullscreen",2),s([n()],r.prototype,"openCallback",2),s([n()],r.prototype,"closeCallback",2),s([n()],r.prototype,"beforeCloseCallback",2),s([n()],r.prototype,"positionType",2),s([n()],r.prototype,"positionX",2),s([n()],r.prototype,"positionY",2),s([n()],r.prototype,"moveable",2),s([n()],r.prototype,"moveTarget",2),r=s([M({name:i.elementName,dependencies:[w]})],r);function xe(){D(r)}export{i as a,g as b,u as c,r as d,xe as e};
7
+ //# sourceMappingURL=chunk.NNGE722W.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dialog/dialog-constants.ts", "../../src/dialog/dialog-foundation.ts", "../../src/dialog/dialog-adapter.ts", "../../src/dialog/dialog.ts", "../../src/dialog/index.ts"],
4
+ "sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\nimport { BACKDROP_CONSTANTS } from '../backdrop';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}dialog`;\n\nconst classes = {\n ANIMATING: 'forge-dialog--animating',\n OPEN: 'forge-dialog--open',\n ACTION_BUTTON: 'forge-dialog__action__button',\n BUTTON_TEXT: 'forge-button__text',\n SCROLLABLE: 'forge-dialog--scrollable',\n FULLSCREEN: 'forge-dialog--fullscreen',\n MOVEABLE: 'forge-dialog--moveable'\n};\n\nconst attributes = {\n BACKDROP_CLOSE: 'backdrop-close',\n ESCAPE_CLOSE: 'escape-close',\n FULLSCREEN: 'fullscreen',\n POSITION_TYPE: 'position-type',\n POSITION_X: 'position-x',\n POSITION_Y: 'position-y',\n MOVEABLE: 'moveable',\n MOVE_TARGET: 'move-target',\n OPEN: 'forge-dialog-open',\n INITIAL_FOCUS: 'forge-dialog-focus',\n DFEAULT_MOVE_TARGET: 'forge-dialog-move-target'\n};\n\nconst selectors = {\n CONTAINER: '.forge-dialog',\n SURFACE: '.forge-dialog__surface',\n BACKDROP: BACKDROP_CONSTANTS.elementName,\n INITIAL_FOCUS: `[${attributes.INITIAL_FOCUS}]`,\n DFEAULT_MOVE_TARGET: `[${attributes.DFEAULT_MOVE_TARGET}]`,\n CONTENT: '.forge-dialog__body'\n};\n\nconst events = {\n BEFORE_CLOSE: `${elementName}-before-close`,\n OPEN: `${elementName}-open`,\n CLOSE: `${elementName}-close`,\n READY: `${elementName}-ready`,\n MOVE_START: `${elementName}-move-start`,\n MOVED: `${elementName}-move`,\n MOVE_END: `${elementName}-move-end`\n};\n\nconst numbers = {\n ANIMATION_DURATION: 150,\n BACKDROP_MAX_OPACITY: 0.3\n};\n\nexport const DIALOG_CONSTANTS = {\n elementName,\n classes,\n selectors,\n attributes,\n events,\n numbers\n};\n\nexport interface IDialogMoveEventData {\n x: number;\n y: number;\n}\n\nexport interface IDialogMoveContext {\n top: number;\n left: number;\n height: number;\n width: number;\n}\n\nexport interface IDialogMoveStartEventData extends IDialogMoveEventData {}\n\nexport type DialogPositionType = 'absolute' | 'relative';\nexport type DialogStateCallback = () => boolean | void | Promise<boolean | void>;\n", "import { ICustomElementFoundation, isDefined, isNumber, isString } from '@tylertech/forge-core';\nimport { IDialogAdapter } from './dialog-adapter';\nimport { DialogPositionType, DialogStateCallback, DIALOG_CONSTANTS, IDialogMoveContext, IDialogMoveStartEventData } from './dialog-constants';\n\nexport interface IDialogFoundation extends ICustomElementFoundation {\n backdropClose: boolean;\n escapeClose: boolean;\n open: boolean;\n fullscreen: boolean;\n openCallback: DialogStateCallback;\n closeCallback: DialogStateCallback;\n beforeCloseCallback: DialogStateCallback;\n positionType: DialogPositionType;\n positionX: number | string | null | undefined;\n positionY: number | string | null | undefined;\n moveable: boolean;\n moveTarget: string;\n initializeMoveTarget(): void;\n resetPosition(): void;\n}\n\nexport class DialogFoundation implements IDialogFoundation {\n // Private vars\n private _open = false;\n private _backdropClose = true;\n private _escapeClose = true;\n private _fullscreen = false;\n private _openCallback: DialogStateCallback;\n private _closeCallback: DialogStateCallback;\n private _beforeCloseCallback: DialogStateCallback;\n private _positionType: DialogPositionType = 'absolute';\n private _positionX: string | null = null;\n private _positionY: string | null = null;\n private _moveable = false;\n private _moveTarget = DIALOG_CONSTANTS.selectors.DFEAULT_MOVE_TARGET;\n private _isAnimating = false;\n private _isMoving = false;\n private _moveContext: IDialogMoveContext | undefined;\n private _lastPosition: { x: number; y: number } | undefined;\n\n // Event handlers\n private _transitionEndHandler: (evt: TransitionEvent) => void;\n private _documentKeydownHandler: (evt: KeyboardEvent) => void;\n private _backdropClickHandler: (evt: CustomEvent) => void;\n private _moveTargetMouseDownHandler: (evt: MouseEvent) => void;\n private _moveTargetMouseMoveHandler: (evt: MouseEvent) => void;\n private _moveTargetMouseUpHandler: (evt: MouseEvent) => void;\n\n // Event handler states\n private _attachedDocumentKeydownHandler = false;\n private _attachedBackdropClickHandler = false;\n\n constructor(public _adapter: IDialogAdapter) {\n this._transitionEndHandler = (evt: TransitionEvent) => this._onTransitionEnd();\n this._documentKeydownHandler = (evt: KeyboardEvent) => this._onDocumentKeydown(evt);\n this._backdropClickHandler = (evt: CustomEvent) => this._onBackdropClick(evt);\n this._moveTargetMouseDownHandler = (evt: MouseEvent) => this._onMoveTargetMouseDown(evt);\n this._moveTargetMouseMoveHandler = (evt: MouseEvent) => this._onMoveTargetMouseMove(evt);\n this._moveTargetMouseUpHandler = (evt: MouseEvent) => this._onMoveTargetMouseUp(evt);\n }\n\n public initialize(): void {\n this._adapter.initializeAccessibility();\n if (this._open) {\n if (this._moveable) {\n this._adapter.setMoveable(this._moveable);\n this._initMoveTarget();\n }\n }\n }\n\n public destroy(): void {\n if (this._open) {\n this._removeDragHandlers();\n this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler);\n if (this._attachedDocumentKeydownHandler) {\n this._adapter.removeDocumentListener('keydown', this._documentKeydownHandler);\n }\n if (this._attachedBackdropClickHandler) {\n this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler);\n }\n }\n }\n\n private async _applyOpen(value: boolean): Promise<void> {\n if (value) {\n if (typeof this._openCallback === 'function' && !await this._executeOpenCallback()) {\n return;\n }\n this._open = value;\n this._openDialog();\n } else {\n if (typeof this._closeCallback === 'function' && !await this._executeCloseCallback()) {\n return;\n }\n this._open = value;\n this._closeDialog();\n }\n \n this._adapter.toggleHostAttribute(DIALOG_CONSTANTS.attributes.OPEN, this._open);\n }\n\n private async _executeOpenCallback(): Promise<boolean> {\n try {\n return await Promise.resolve(this._openCallback()) !== false;\n } catch (e) {\n return false;\n }\n }\n\n private async _executeCloseCallback(): Promise<boolean> {\n try {\n return await Promise.resolve(this._closeCallback()) !== false;\n } catch (e) {\n return false;\n }\n }\n\n public initializeMoveTarget(): void {\n if (!this._moveTarget) {\n this._moveTarget = DIALOG_CONSTANTS.selectors.DFEAULT_MOVE_TARGET;\n }\n this._initMoveTarget();\n }\n\n public resetPosition(): void {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n\n private _normalizePositionValue(value: number | string | null | undefined): string | null {\n if (isNumber(value)) {\n return `${value}px`;\n } else if (isString(value)) {\n return value;\n }\n return null;\n }\n\n private _openDialog(): void {\n this._adapter.attach();\n\n if (!this._fullscreen) {\n if (this._moveable) {\n this._adapter.setMoveable(this._moveable);\n }\n if (this._positionX != null || this._positionY != null) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n\n this._adapter.setBodyAttribute(DIALOG_CONSTANTS.attributes.OPEN, 'true');\n this._adapter.registerTransitionEndHandler(this._transitionEndHandler);\n this._setDocumentKeydownListener(this._escapeClose);\n this._setBackdropClickListener(this._backdropClose);\n this._adapter.setAnimating(true);\n this._isAnimating = true;\n\n // Ensure transitions are triggered properly\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n this._adapter.setVisibility(true);\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.OPEN);\n this._adapter.trySetInitialFocus();\n if (this._adapter.isScrollable()) {\n this._adapter.addRootClass(DIALOG_CONSTANTS.classes.SCROLLABLE);\n }\n });\n });\n\n // Wait for the dialog to finish animating open, then emit the ready event and attach any listeners\n setTimeout(() => {\n window.requestAnimationFrame(() => {\n if (this._open && this._isAnimating) {\n this._onTransitionEnd();\n }\n });\n }, DIALOG_CONSTANTS.numbers.ANIMATION_DURATION);\n }\n\n private _closeDialog(): void {\n if (this._moveTarget) {\n this._removeDragHandlers();\n }\n\n this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler);\n if (this._attachedDocumentKeydownHandler) {\n this._adapter.removeDocumentListener('keydown', this._documentKeydownHandler);\n }\n if (this._attachedBackdropClickHandler) {\n this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler);\n }\n\n this._isAnimating = false;\n this._adapter.setAnimating(true);\n this._adapter.setVisibility(false);\n\n setTimeout(() => {\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.CLOSE);\n this._adapter.detach();\n const openDialogs = this._adapter.getOpenDialogs(DIALOG_CONSTANTS.elementName);\n if (!openDialogs.length) {\n this._adapter.removeBodyAttribute(DIALOG_CONSTANTS.attributes.OPEN);\n }\n }, DIALOG_CONSTANTS.numbers.ANIMATION_DURATION);\n }\n\n private _onTransitionEnd(): void {\n if (!this._isAnimating) {\n return;\n }\n this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler);\n this._adapter.setAnimating(false);\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.READY);\n this._adapter.tryLayoutChildren();\n if (this._moveable) {\n this._initMoveTarget();\n }\n this._isAnimating = false;\n }\n\n private _initMoveTarget(): void {\n if (!this._fullscreen && this._moveable && this._moveTarget && this._adapter.setMoveTarget(this._moveTarget)) {\n this._adapter.setMoveTargetHandler('mousedown', this._moveTargetMouseDownHandler);\n }\n }\n\n private _removeDragHandlers(): void {\n this._adapter.removeDragTargetHandler('mousedown', this._moveTargetMouseDownHandler);\n this._adapter.removeDocumentListener('mousemove', this._moveTargetMouseMoveHandler);\n this._adapter.removeDocumentListener('mouseup', this._moveTargetMouseUpHandler);\n }\n\n private _onMoveTargetMouseDown(evt: MouseEvent): void {\n evt.preventDefault();\n this._adapter.captureActiveElement();\n const bounds = this._adapter.getSurfaceBounds();\n this._moveContext = {\n top: evt.clientY - bounds.top,\n left: evt.clientX - bounds.left,\n height: bounds.height,\n width: bounds.width\n };\n this._adapter.setDocumentListener('mousemove', this._moveTargetMouseMoveHandler);\n this._adapter.setDocumentListener('mouseup', this._moveTargetMouseUpHandler);\n }\n\n private _onMoveTargetMouseMove(evt: MouseEvent): void {\n evt.preventDefault();\n const position = this._calculateOffsetPosition(evt.pageX, evt.pageY, this._moveContext);\n\n // If this is the beginning of the move sequence, we emit the start event (to allow for preventing default) and\n // then update the surface position if not prevented\n if (!this._isMoving) {\n this._isMoving = true;\n const canDrag = this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.MOVE_START, position as IDialogMoveStartEventData, true, true);\n if (!canDrag) {\n return;\n }\n }\n\n // Ensure that the surface position stays within the bounds of the screen\n const newPosition = this._clampPosition(position, this._moveContext);\n\n // Only update the position if it actually changed\n if (!this._lastPosition || newPosition.x !== this._lastPosition.x || newPosition.y !== this._lastPosition.y) {\n const canMove = this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.MOVED, newPosition as IDialogMoveStartEventData, true, true);\n if (canMove) {\n this._lastPosition = { ...newPosition };\n const newX = this._normalizePositionValue(newPosition.x);\n const newY = this._normalizePositionValue(newPosition.y);\n this._adapter.setSurfacePosition(newX, newY, 'absolute');\n }\n }\n }\n\n private _onMoveTargetMouseUp(evt: MouseEvent): void {\n if (this._isMoving) {\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.MOVE_END);\n }\n this._moveComplete();\n }\n\n private _moveComplete(): void {\n this._adapter.tryRestoreActiveElement();\n this._adapter.removeDocumentListener('mousemove', this._moveTargetMouseMoveHandler);\n this._adapter.removeDocumentListener('mouseup', this._moveTargetMouseUpHandler);\n this._lastPosition = undefined;\n this._moveContext = undefined;\n this._isMoving = false;\n }\n\n private _onDocumentKeydown(evt: KeyboardEvent): void {\n evt.stopPropagation();\n if (evt.key && (evt.key === 'Escape' || evt.key === 'Esc')) {\n this._tryClose();\n }\n }\n\n private _onBackdropClick(evt: CustomEvent): void {\n evt.stopPropagation();\n this._tryClose();\n }\n\n private async _tryClose(): Promise<void> {\n const isCancelled = !this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.BEFORE_CLOSE, undefined, undefined, true);\n if (isCancelled) {\n return;\n }\n\n if (!this._beforeCloseCallback) {\n this.open = false;\n return;\n }\n\n try {\n const shouldClose = await Promise.resolve(this._beforeCloseCallback()) !== false;\n if (shouldClose) {\n this.open = false;\n return;\n }\n } catch (err) {\n return;\n }\n }\n\n private _setBackdropClickListener(attach: boolean): void {\n if (!this._open) {\n return;\n }\n\n if (attach && !this._attachedBackdropClickHandler) {\n this._adapter.registerBackdropClickHandler(this._backdropClickHandler);\n this._attachedBackdropClickHandler = true;\n } else if (!attach && this._attachedBackdropClickHandler) {\n this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler);\n this._attachedBackdropClickHandler = false;\n }\n }\n\n private _setDocumentKeydownListener(attach: boolean): void {\n if (!this._open) {\n return;\n }\n\n if (attach && !this._attachedDocumentKeydownHandler) {\n this._adapter.setDocumentListener('keydown', this._documentKeydownHandler);\n this._attachedDocumentKeydownHandler = true;\n } else if (!attach && this._attachedDocumentKeydownHandler) {\n this._adapter.removeDocumentListener('keydown', this._documentKeydownHandler);\n this._attachedDocumentKeydownHandler = false;\n }\n }\n\n private _calculateOffsetPosition(pageX: number, pageY: number, context?: IDialogMoveContext): { x: number; y: number } {\n return {\n x: pageX - (context?.left || 0),\n y: pageY - (context?.top || 0)\n };\n }\n\n private _clampPosition({ x, y }: { x: number; y: number }, context?: IDialogMoveContext): { x: number; y: number } {\n let width = 0;\n let height = 0;\n\n if (context) {\n width = context.width;\n height = context.height;\n }\n\n if (x <= 0) {\n x = 0;\n } else if (x + width >= window.innerWidth) {\n x = window.innerWidth - width;\n }\n\n if (y <= 0) {\n y = 0;\n } else if (y + height >= window.innerHeight) {\n y = window.innerHeight - height;\n }\n\n return { x, y };\n }\n\n /** Controls whether clicking the backdrop closes the dialog or not. */\n public set backdropClose(value: boolean) {\n value = Boolean(value);\n if (this._backdropClose !== value) {\n this._backdropClose = value;\n\n this._setBackdropClickListener(this._backdropClose);\n\n if (isDefined(this._backdropClose)) {\n this._adapter.setHostAttribute(DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE, this._backdropClose.toString());\n } else {\n this._adapter.removeHostAttribute(DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE);\n }\n }\n }\n public get backdropClose(): boolean {\n return this._backdropClose;\n }\n\n /** Controls whether pressing the escape key closes the dialog or not. */\n public set escapeClose(value: boolean) {\n value = Boolean(value);\n if (this._escapeClose !== value) {\n this._escapeClose = value;\n this._setDocumentKeydownListener(this._escapeClose);\n if (isDefined(this._escapeClose)) {\n this._adapter.setHostAttribute(DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE, this._escapeClose.toString());\n } else {\n this._adapter.removeHostAttribute(DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE);\n }\n }\n }\n public get escapeClose(): boolean {\n return this._escapeClose;\n }\n\n public get open(): boolean {\n return this._open;\n }\n public set open(value: boolean) {\n if (this._open !== value) {\n value = Boolean(value);\n if (value !== this._open) {\n this._applyOpen(value);\n }\n }\n }\n\n public get fullscreen(): boolean {\n return this._fullscreen;\n }\n public set fullscreen(value: boolean) {\n if (this._fullscreen !== value) {\n this._fullscreen = value;\n this._adapter.setFullscreen(this._fullscreen);\n }\n }\n\n public get openCallback(): DialogStateCallback {\n return this._openCallback;\n }\n public set openCallback(callback: DialogStateCallback) {\n this._openCallback = callback;\n }\n\n public get closeCallback(): DialogStateCallback {\n return this._closeCallback;\n }\n public set closeCallback(callback: DialogStateCallback) {\n this._closeCallback = callback;\n }\n\n public get beforeCloseCallback(): DialogStateCallback {\n return this._beforeCloseCallback;\n }\n public set beforeCloseCallback(callback: DialogStateCallback) {\n this._beforeCloseCallback = callback;\n }\n\n public get positionType(): DialogPositionType {\n return this._positionType;\n }\n public set positionType(value: DialogPositionType) {\n if (this._positionType !== value) {\n this._positionType = value;\n if (this._open) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n }\n\n public get positionX(): number | string | null | undefined {\n return this._positionX;\n }\n public set positionX(value: number | string | null | undefined) {\n if (this._positionX !== value) {\n this._positionX = this._normalizePositionValue(value);\n if (this._open) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n }\n\n public get positionY(): number | string | null | undefined {\n return this._positionY;\n }\n public set positionY(value: number | string | null | undefined) {\n if (this._positionY !== value) {\n this._positionY = this._normalizePositionValue(value);\n if (this._open) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n }\n\n public get moveable(): boolean {\n return this._moveable;\n }\n public set moveable(value: boolean) {\n if (this._moveable !== value) {\n this._moveable = value;\n if (this._open) {\n this._adapter.setMoveable(this._moveable);\n if (this._moveable) {\n this._initMoveTarget();\n } else {\n this._removeDragHandlers();\n this._isMoving = false;\n }\n }\n }\n }\n\n public get moveTarget(): string {\n return this._moveTarget;\n }\n public set moveTarget(value: string) {\n this._moveTarget = value;\n }\n}\n", "import { getShadowElement, removeElement, deepQuerySelectorAll, getActiveElement, toggleClass } from '@tylertech/forge-core';\nimport { BACKDROP_CONSTANTS, IBackdropComponent } from '../backdrop';\nimport { CHECKBOX_CONSTANTS } from '../checkbox';\nimport { BaseAdapter, IBaseAdapter } from '../core/base/base-adapter';\nimport { ICON_BUTTON_CONSTANTS } from '../icon-button';\nimport { RADIO_CONSTANTS } from '../radio';\nimport { SWITCH_CONSTANTS } from '../switch';\nimport { IDialogComponent } from './dialog';\nimport { DialogPositionType, DIALOG_CONSTANTS } from './dialog-constants';\n\nexport interface IDialogAdapter extends IBaseAdapter {\n initializeAccessibility(): void;\n setAnimating(animating: boolean): void;\n setVisibility(visible: boolean): void;\n attach(): void;\n detach(): void;\n setDocumentListener(type: string, listener: (evt: Event) => void): void;\n removeDocumentListener(type: string, listener: (evt: Event) => void): void;\n registerTransitionEndHandler: (handler: (evt: TransitionEvent) => void) => void;\n deregisterTransitionEndHandler: (handler: (evt: TransitionEvent) => void) => void;\n registerBackdropClickHandler: (handler: (evt: CustomEvent) => void) => void;\n deregisterBackdropClickHandler: (handler: (evt: CustomEvent) => void) => void;\n getOpenDialogs: (selector: string) => NodeListOf<HTMLElement>;\n setBodyAttribute: (name: string, value: string) => void;\n removeBodyAttribute: (name: string) => void;\n trySetInitialFocus: () => void;\n isScrollable(): boolean;\n addRootClass(name: string): void;\n setFullscreen(value: boolean): void;\n setMoveable(value: boolean): void;\n tryLayoutChildren(): void;\n setMoveTarget(selector: string): boolean;\n setMoveTargetHandler(type: string, listener: (evt: MouseEvent) => void): void;\n removeDragTargetHandler(type: string, listener: (evt: MouseEvent) => void): void;\n getSurfaceBounds(): DOMRect;\n setSurfacePosition(x: string | null, y: string | null, positionType: DialogPositionType): void;\n captureActiveElement(): void;\n tryRestoreActiveElement(): void;\n}\n\n/**\n * Provides facilities for interacting with the internal DOM of `DialogComponent`.\n */\nexport class DialogAdapter extends BaseAdapter<IDialogComponent> implements IDialogAdapter {\n private _backdropElement: IBackdropComponent;\n private _containerElement: HTMLElement;\n private _surfaceElement: HTMLElement;\n private _moveTargetElement: HTMLElement | null;\n private _activeElement: HTMLElement | undefined;\n\n constructor(component: IDialogComponent) {\n super(component);\n this._backdropElement = getShadowElement(component, DIALOG_CONSTANTS.selectors.BACKDROP) as IBackdropComponent;\n this._containerElement = getShadowElement(component, DIALOG_CONSTANTS.selectors.CONTAINER);\n this._surfaceElement = getShadowElement(component, DIALOG_CONSTANTS.selectors.SURFACE);\n }\n\n public initializeAccessibility(): void {\n if (!this._component.hasAttribute('role')) {\n this._component.setAttribute('role', 'dialog');\n }\n this._component.setAttribute('aria-modal', 'true');\n }\n\n public setAnimating(animating: boolean): void {\n if (animating) {\n this._containerElement.classList.add(DIALOG_CONSTANTS.classes.ANIMATING);\n } else {\n this._containerElement.classList.remove(DIALOG_CONSTANTS.classes.ANIMATING);\n }\n }\n\n public setVisibility(visible: boolean): void {\n if (visible) {\n this._containerElement.classList.add(DIALOG_CONSTANTS.classes.OPEN);\n } else {\n this._containerElement.classList.remove(DIALOG_CONSTANTS.classes.OPEN);\n }\n }\n\n public attach(): void {\n document.body.appendChild(this._component);\n }\n\n public detach(): void {\n if (this._activeElement) {\n this._activeElement = undefined;\n }\n removeElement(this._component);\n }\n\n public registerTransitionEndHandler(handler: (evt: TransitionEvent) => void): void {\n this._surfaceElement.addEventListener('transitionend', handler);\n }\n\n public deregisterTransitionEndHandler(handler: (evt: TransitionEvent) => void): void {\n this._surfaceElement.removeEventListener('transitionend', handler);\n }\n\n public setDocumentListener(type: string, listener: (evt: Event) => void): void {\n document.addEventListener(type, listener);\n }\n\n public removeDocumentListener(type: string, listener: (evt: Event) => void): void {\n document.removeEventListener(type, listener);\n }\n\n public registerBackdropClickHandler(handler: (evt: CustomEvent) => void): void {\n this._backdropElement.addEventListener(BACKDROP_CONSTANTS.events.BACKDROP_CLICK, handler);\n }\n\n public deregisterBackdropClickHandler(handler: (evt: CustomEvent) => void): void {\n this._backdropElement.removeEventListener(BACKDROP_CONSTANTS.events.BACKDROP_CLICK, handler);\n }\n\n public getOpenDialogs(selector: string): NodeListOf<HTMLElement> {\n return document.querySelectorAll(selector);\n }\n\n public setBodyAttribute(name: string, value: string): void {\n document.body.setAttribute(name, value);\n }\n\n public removeBodyAttribute(name: string): void {\n document.body.removeAttribute(name);\n }\n\n public trySetInitialFocus(): void {\n const elements = deepQuerySelectorAll(this._component, DIALOG_CONSTANTS.selectors.INITIAL_FOCUS);\n if (elements && elements.length) {\n const initialElement = elements[elements.length - 1] as HTMLElement;\n initialElement.focus();\n }\n }\n\n public isScrollable(): boolean {\n const contentElement = this._component.querySelector(DIALOG_CONSTANTS.selectors.CONTENT) as HTMLElement;\n if (contentElement) {\n return contentElement.scrollHeight > contentElement.offsetHeight;\n }\n return false;\n }\n\n public addRootClass(name: string): void {\n this._component.classList.add(name);\n }\n\n public setFullscreen(value: boolean): void {\n if (value) {\n this._containerElement.classList.add(DIALOG_CONSTANTS.classes.FULLSCREEN);\n } else {\n this._containerElement.classList.remove(DIALOG_CONSTANTS.classes.FULLSCREEN);\n }\n }\n\n public setMoveable(value: boolean): void {\n toggleClass(this._containerElement, value, DIALOG_CONSTANTS.classes.MOVEABLE);\n }\n\n public tryLayoutChildren(): void {\n const layoutChildren = [ICON_BUTTON_CONSTANTS.elementName, SWITCH_CONSTANTS.elementName, CHECKBOX_CONSTANTS.elementName, RADIO_CONSTANTS.elementName];\n const commonLayoutElements = Array.from(this._component.querySelectorAll(layoutChildren.join(','))) as any[];\n commonLayoutElements.filter(el => typeof el.layout === 'function').forEach(el => el.layout());\n }\n\n public setMoveTarget(selector: string): boolean {\n if (!selector) {\n return false;\n }\n this._moveTargetElement = this._component.querySelector(selector);\n return !!this._moveTargetElement;\n }\n\n public setMoveTargetHandler(type: string, listener: (evt: MouseEvent) => void): void {\n if (this._moveTargetElement) {\n this._moveTargetElement.addEventListener(type, listener);\n }\n }\n\n public removeDragTargetHandler(type: string, listener: (evt: MouseEvent) => void): void {\n if (this._moveTargetElement) {\n this._moveTargetElement.removeEventListener(type, listener);\n }\n }\n\n public getSurfaceBounds(): DOMRect {\n return this._surfaceElement.getBoundingClientRect() as DOMRect;\n }\n\n public setSurfacePosition(x: string | null, y: string | null, positionType: DialogPositionType): void {\n this._surfaceElement.style.position = positionType === 'absolute' ? positionType : 'relative';\n if (y != null) {\n this._surfaceElement.style.top = y;\n } else {\n this._surfaceElement.style.removeProperty('top');\n }\n if (x != null) {\n this._surfaceElement.style.left = x;\n } else {\n this._surfaceElement.style.removeProperty('left');\n }\n }\n\n public captureActiveElement(): void {\n this._activeElement = getActiveElement() as HTMLElement;\n if (this._activeElement) {\n this._activeElement.blur();\n }\n }\n\n public tryRestoreActiveElement(): void {\n if (this._activeElement) {\n if (this._activeElement.isConnected) {\n this._activeElement.focus();\n }\n this._activeElement = undefined;\n }\n }\n}\n", "import { CustomElement, attachShadowTemplate, coerceBoolean, FoundationProperty } from '@tylertech/forge-core';\n\nimport { DialogFoundation } from './dialog-foundation';\nimport { DialogAdapter } from './dialog-adapter';\nimport { DIALOG_CONSTANTS, DialogPositionType, IDialogMoveStartEventData, IDialogMoveEventData, DialogStateCallback } from './dialog-constants';\nimport { BackdropComponent } from '../backdrop';\nimport { BaseComponent, IBaseComponent } from '../core/base/base-component';\n\nconst template = '<template><div class=\\\"forge-dialog\\\" part=\\\"root\\\"><forge-backdrop part=\\\"scrim\\\"></forge-backdrop><div class=\\\"forge-dialog__surface\\\" part=\\\"surface\\\"><slot></slot></div></div></template>';\nconst styles = '.forge-dialog{position:fixed;top:0;bottom:0;left:0;right:0;z-index:8;z-index:var(--forge-z-index-dialog,8);-webkit-box-align:center;align-items:center;-webkit-box-align:var(--forge-dialog-align-items,center);align-items:var(--forge-dialog-align-items,center);top:0;top:var(--forge-dialog-top,0);padding:24px;padding:var(--forge-dialog-padding,24px);display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;visibility:hidden}@media (max-width:599px){.forge-dialog{padding:0}}.forge-dialog--moveable:not(.forge-dialog--fullscreen) ::slotted([forge-dialog-move-target]){cursor:move}.forge-dialog--animating{visibility:visible}.forge-dialog--animating .forge-dialog--open .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--animating .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--scrollable .forge-dialog__footer,.forge-dialog--scrollable .forge-dialog__title{border-color:rgba(0,0,0,.12)}.forge-dialog--open{visibility:visible!important}.forge-dialog--open .forge-dialog__surface{-webkit-transform:scale(1);transform:scale(1);opacity:1}.forge-dialog__surface{-webkit-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface,#fff);width:auto;width:var(--forge-dialog-width,auto);height:auto;height:var(--forge-dialog-height,auto);min-width:280px;min-width:var(--forge-dialog-min-width,280px);max-width:100%;max-width:var(--forge-dialog-max-width,100%);max-height:100%;max-height:var(--forge-dialog-max-height,100%);border-radius:4px;border-radius:var(--forge-dialog-border-radius,var(--mdc-shape-medium,4px));display:-webkit-inline-box;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform:scale(.8);transform:scale(.8);opacity:0;overflow:hidden;z-index:inherit}.forge-dialog__header{margin:0;padding:0 24px 9px;border-bottom:1px solid transparent}.forge-dialog__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:1.25rem;font-size:var(--forge-typography-title-font-size, 1.25rem);line-height:2rem;line-height:var(--forge-typography-title-line-height, 2rem);font-weight:400;font-weight:var(--forge-typography-title-font-weight,400);letter-spacing:.0125em;letter-spacing:var(--forge-typography-title-letter-spacing, .0125em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-title-text-decoration,inherit);text-decoration:var(--forge-typography-title-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-title-text-transform,inherit);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0}.forge-dialog__title::before{display:inline-block;width:0;height:40px;content:\\\"\\\";vertical-align:0}.forge-dialog__body{-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-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);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);padding-top:20px;padding:0 24px 24px;overflow:auto}.forge-dialog__body--scrollable{max-height:195px;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1);overflow-x:auto;overflow-y:scroll;-webkit-overflow-scrolling:touch}.forge-dialog__footer{display:-webkit-box;display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;-webkit-box-align:center;align-items:center;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid transparent}.forge-dialog--fullscreen{padding:0}.forge-dialog--fullscreen .forge-dialog__surface{height:100%;width:100%;min-width:auto;max-width:100%;border-radius:0}:host{display:block}:host([hidden]){display:none}';\n\nexport interface IDialogComponent extends IBaseComponent {\n backdropClose: boolean;\n escapeClose: boolean;\n open: boolean;\n fullscreen: boolean;\n openCallback: DialogStateCallback;\n closeCallback: DialogStateCallback;\n beforeCloseCallback: () => boolean | Promise<boolean>;\n positionType: DialogPositionType;\n positionX: number | string | null | undefined;\n positionY: number | string | null | undefined;\n moveable: boolean;\n moveTarget: string;\n initializeMoveTarget(): void;\n resetPosition(): void;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-dialog': IDialogComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-dialog-before-close': CustomEvent<void>;\n 'forge-dialog-open': CustomEvent<void>;\n 'forge-dialog-close': CustomEvent<void>;\n 'forge-dialog-ready': CustomEvent<void>;\n 'forge-dialog-move-start': CustomEvent<IDialogMoveStartEventData>;\n 'forge-dialog-move': CustomEvent<IDialogMoveEventData>;\n 'forge-dialog-move-end': CustomEvent<void>;\n }\n}\n\n/**\n * The web component class behind the `<forge-dialog>` custom element.\n * \n * @tag forge-dialog\n */\n@CustomElement({\n name: DIALOG_CONSTANTS.elementName,\n dependencies: [BackdropComponent]\n})\nexport class DialogComponent extends BaseComponent implements IDialogComponent {\n public static get observedAttributes(): string[] {\n return [\n DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE,\n DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE,\n DIALOG_CONSTANTS.attributes.OPEN,\n DIALOG_CONSTANTS.attributes.FULLSCREEN,\n DIALOG_CONSTANTS.attributes.POSITION_TYPE,\n DIALOG_CONSTANTS.attributes.POSITION_X,\n DIALOG_CONSTANTS.attributes.POSITION_Y,\n DIALOG_CONSTANTS.attributes.MOVEABLE,\n DIALOG_CONSTANTS.attributes.MOVE_TARGET\n ];\n }\n\n private _foundation: DialogFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new DialogFoundation(new DialogAdapter(this));\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public disconnectedCallback(): void {\n this._foundation.destroy();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE:\n this.backdropClose = newValue === 'true';\n break;\n case DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE:\n this.escapeClose = newValue === 'true';\n break;\n case DIALOG_CONSTANTS.attributes.OPEN:\n this.open = coerceBoolean(newValue);\n break;\n case DIALOG_CONSTANTS.attributes.FULLSCREEN:\n this.fullscreen = coerceBoolean(newValue);\n break;\n case DIALOG_CONSTANTS.attributes.POSITION_TYPE:\n this.positionType = newValue as DialogPositionType;\n break;\n case DIALOG_CONSTANTS.attributes.POSITION_X:\n this.positionX = newValue;\n break;\n case DIALOG_CONSTANTS.attributes.POSITION_Y:\n this.positionY = newValue;\n break;\n case DIALOG_CONSTANTS.attributes.MOVEABLE:\n this.moveable = coerceBoolean(newValue);\n break;\n case DIALOG_CONSTANTS.attributes.MOVE_TARGET:\n this.moveTarget = newValue;\n break;\n }\n }\n\n /** Controls whether clicking the backdrop closes the dialog or not. Default is true. */\n @FoundationProperty()\n public backdropClose: boolean;\n\n /** Controls whether pressing the escape key closes the dialog or not. Default is true. */\n @FoundationProperty()\n public escapeClose: boolean;\n\n /** Controls whether the dialog is open or not. Default is false. */\n @FoundationProperty()\n public open: boolean;\n\n /** Controls whether the dialog is full screen or not. Default is false. */\n @FoundationProperty()\n public fullscreen: boolean;\n\n /** The function to call when the dialog wants to open. */\n @FoundationProperty()\n public openCallback: DialogStateCallback;\n\n /** the function to call when the dialog wants to close. */\n @FoundationProperty()\n public closeCallback: DialogStateCallback;\n\n /** the function to call when the dialog wants to close. */\n @FoundationProperty()\n public beforeCloseCallback: () => boolean | Promise<boolean>;\n\n /** Gets/sets the position type when using custom positioning values. Default is 'absolute'. */\n @FoundationProperty()\n public positionType: DialogPositionType;\n\n /** Controls the horizontal position of the dialog surface. */\n @FoundationProperty()\n public positionX: number | string | null | undefined;\n\n /** Controls the vertical position of the dialog surface. */\n @FoundationProperty()\n public positionY: number | string | null | undefined;\n\n /** Gets/sets whether the dialog surface can be moved or not. */\n @FoundationProperty()\n public moveable: boolean;\n\n /** Gets/sets the selector used to target the element that is used as the drag target. */\n @FoundationProperty()\n public moveTarget: string;\n\n public initializeMoveTarget(): void {\n this._foundation.initializeMoveTarget();\n }\n\n public resetPosition(): void {\n this._foundation.resetPosition();\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { DialogComponent } from './dialog';\n\nexport * from './dialog-adapter';\nexport * from './dialog-constants';\nexport * from './dialog-foundation';\nexport * from './dialog';\n\nexport function defineDialogComponent(): void {\n defineCustomElement(DialogComponent);\n}\n"],
5
+ "mappings": "glBAGA,GAAM,GAA2C,GAAG,UAE9C,EAAU,CACd,UAAW,0BACX,KAAM,qBACN,cAAe,+BACf,YAAa,qBACb,WAAY,2BACZ,WAAY,2BACZ,SAAU,wBACZ,EAEM,EAAa,CACjB,eAAgB,iBAChB,aAAc,eACd,WAAY,aACZ,cAAe,gBACf,WAAY,aACZ,WAAY,aACZ,SAAU,WACV,YAAa,cACb,KAAM,oBACN,cAAe,qBACf,oBAAqB,0BACvB,EAEM,EAAY,CAChB,UAAW,gBACX,QAAS,yBACT,SAAU,EAAmB,YAC7B,cAAe,IAAI,EAAW,iBAC9B,oBAAqB,IAAI,EAAW,uBACpC,QAAS,qBACX,EAEM,EAAS,CACb,aAAc,GAAG,iBACjB,KAAM,GAAG,SACT,MAAO,GAAG,UACV,MAAO,GAAG,UACV,WAAY,GAAG,eACf,MAAO,GAAG,SACV,SAAU,GAAG,YACf,EAEM,EAAU,CACd,mBAAoB,IACpB,qBAAsB,EACxB,EAEa,EAAmB,CAC9B,cACA,UACA,YACA,aACA,SACA,SACF,ECvCO,GAAM,GAAN,KAAoD,CA+BzD,YAAmB,EAA0B,CAA1B,gBA7BnB,KAAQ,MAAQ,GAChB,KAAQ,eAAiB,GACzB,KAAQ,aAAe,GACvB,KAAQ,YAAc,GAItB,KAAQ,cAAoC,WAC5C,KAAQ,WAA4B,KACpC,KAAQ,WAA4B,KACpC,KAAQ,UAAY,GACpB,KAAQ,YAAc,EAAiB,UAAU,oBACjD,KAAQ,aAAe,GACvB,KAAQ,UAAY,GAapB,KAAQ,gCAAkC,GAC1C,KAAQ,8BAAgC,GAGtC,KAAK,sBAAwB,AAAC,GAAyB,KAAK,iBAAiB,EAC7E,KAAK,wBAA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,aAAe,EACpB,UACG,GAAiB,WAAW,WAC/B,KAAK,UAAY,EACjB,UACG,GAAiB,WAAW,WAC/B,KAAK,UAAY,EACjB,UACG,GAAiB,WAAW,SAC/B,KAAK,SAAW,EAAc,CAAQ,EACtC,UACG,GAAiB,WAAW,YAC/B,KAAK,WAAa,EAClB,MAEN,CAkDA,AAAO,sBAA6B,CAClC,KAAK,YAAY,qBAAqB,CACxC,CAEA,AAAO,eAAsB,CAC3B,KAAK,YAAY,cAAc,CACjC,CACF,EArDS,GADP,AAAC,EAAmB,GACb,AAjEI,EAiEJ,6BAIA,GADP,AAAC,EAAmB,GACb,AArEI,EAqEJ,2BAIA,GADP,AAAC,EAAmB,GACb,AAzEI,EAyEJ,oBAIA,GADP,AAAC,EAAmB,GACb,AA7EI,EA6EJ,0BAIA,GADP,AAAC,EAAmB,GACb,AAjFI,EAiFJ,4BAIA,GADP,AAAC,EAAmB,GACb,AArFI,EAqFJ,6BAIA,GADP,AAAC,EAAmB,GACb,AAzFI,EAyFJ,mCAIA,GADP,AAAC,EAAmB,GACb,AA7FI,EA6FJ,4BAIA,GADP,AAAC,EAAmB,GACb,AAjGI,EAiGJ,yBAIA,GADP,AAAC,EAAmB,GACb,AArGI,EAqGJ,yBAIA,GADP,AAAC,EAAmB,GACb,AAzGI,EAyGJ,wBAIA,GADP,AAAC,EAAmB,GACb,AA7GI,EA6GJ,0BA7GI,EAAN,GAJP,AAAC,EAAc,CACb,KAAM,EAAiB,YACvB,aAAc,CAAC,CAAiB,CAClC,CAAC,GACY,GC5CN,aAAuC,CAC5C,EAAoB,CAAe,CACrC",
6
+ "names": []
7
+ }
@@ -3,5 +3,5 @@
3
3
  * Copyright 2022 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as rt}from"./chunk.E37HEAJ5.js";import{d as at}from"./chunk.VQKRN5IQ.js";import{a as f,b as nt}from"./chunk.IMK2LFWR.js";import{h as st}from"./chunk.KGW63HJX.js";import{c as et}from"./chunk.D3DLVPPE.js";import{e as tt}from"./chunk.7JTKKFL4.js";import{e as it}from"./chunk.3UMBCR4P.js";import{a as E,b as ot}from"./chunk.BOENNFXE.js";import{j as K}from"./chunk.LZMYHIO2.js";import{a as F}from"./chunk.D4SNVKDA.js";import{a as Q,d as Z,l as w}from"./chunk.YAJT3P6V.js";import{a as $}from"./chunk.24D46RLZ.js";import{g as J}from"./chunk.7ZS4N2FT.js";import{j as b,k as X,m as G,n as q,o as Y,p as j}from"./chunk.KYCC3C3M.js";import{a as z}from"./chunk.A23NSEWA.js";import{a as u}from"./chunk.B3IJU6XJ.js";import{a as R,b as B}from"./chunk.BSZ2LBJX.js";import{a as W}from"./chunk.3E5QKMHL.js";import{a as N,e as H,g as V,i as U}from"./chunk.HN4PXH3D.js";import{m as A,s as P,u as x}from"./chunk.R4NDFXVA.js";import{a as S,k as c,l as L,o as y}from"./chunk.G76HB2FK.js";import{a as k,f as p}from"./chunk.MCIQXNKY.js";var h=`${B}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 z{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(`${E.elementName}[slot=trailing]`);if(n||i){this._toggleElement=n||i;return}let l=document.createElement(E.elementName);l.slot="trailing",l.dense=!0,l.densityLevel=3,l.style.marginRight="4px";let o=document.createElement("button");o.type="button",o.tabIndex=-1,o.setAttribute("aria-label","Toggle time dropdown");let d=document.createElement(Q.elementName);d.name="clock_outline",o.appendChild(d),l.appendChild(o),e.appendChild(l),this._toggleElement=l}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)}}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 C(a,t,e){if(!a||/^\s*$/.test(a))return null;let i=0,n=0,l=0;if(b.test(a)){let o=G(a);i=+o.hours||0,n=+o.minutes||0,l=+o.seconds||0}else if(X.test(a)){let o=q(a);i=+o.hours||0,n=+o.minutes||0,l=+o.seconds||0,i===12&&o.meridiem==="AM"&&(i=0),i<12&&o.meridiem==="PM"&&(i+=12)}else return null;return dt(i)+I(n)+(e?O(l):0)}function m(a,t,e){if(typeof a!="number"||a<0)return null;let i=Math.min(pt(a),23),n=Math.min(ut(a),59),o=a/(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(a),59);d+=`:${String(_).padStart(2,"0")}`}return t||(d+=` ${o}`),d}function pt(a){return Math.abs(Math.floor(a/(1e3*60*60)))}function ut(a){return Math.abs(Math.floor(v(a)%60))}function v(a){return a/(1e3*60)}function M(a){return Math.abs(Math.floor(It(a)%60))}function It(a){return a/1e3}function dt(a){return a*60*60*1e3}function I(a){return a*60*1e3}function O(a){return a*1e3}function mt(a){return a-O(M(a))}function D(a){let t=new Date,e=t.getHours(),i=t.getMinutes();return dt(e)+I(i)+(a?O(t.getSeconds()):0)}function Rt(a,t,e=!1){a||(a=new Date);let i=C(t,!0,e);if(!i)return a.setHours(0,0,0),a;let n=pt(i),l=828e5;n>l?n=l:n<0&&(n=0);let o=ut(i),d=e?M(i):0;return a.setHours(n,o,d),a}var T=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=S(),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){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(),this._closeDropdown(!0));break;case"Down":case"ArrowDown":this._allowDropdown&&(t.preventDefault(),this._open?this._adapter.propagateKey(t.code):(this._openDropdown(),this._adapter.activateFirstOption()));break;case"Up":case"ArrowUp":this._allowDropdown&&(t.preventDefault(),this._open&&this._adapter.propagateKey(t.code));break;case"Enter":case"Home":case"End":this._open&&(t.code==="Enter"&&t.stopPropagation(),t.preventDefault(),this._adapter.propagateKey(t.code));break;case"KeyN":t.preventDefault();let e=D(this._allowSeconds);if(this._value!==e){let i=m(e,!0,this._allowSeconds);this._emitChangeEvent(i)&&(this._applyValue(e),this._selectInputText())}break}}_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:y(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=m(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(mt(this._value)),this._isInitialized&&t!==this._value){let e=m(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=m(t,!0,this._allowSeconds);return this._masked&&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=D(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=m(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(o=>!o.divider&&!o.disabled),i=[],n;if(t.length){if(this._value!=null){let o=this._findClosestOptionIndex(this._value,e);o>=0&&(e[o].value.time===this._value?i=[e[o].value]:n=o)}else if(typeof this._startTime=="number"){let o=this._findClosestOptionIndex(this._startTime,e);o>=0&&o<e.length&&(n=o)}}let l={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,activeStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:o=>this._onSelect(o),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:o=>this._adapter.setActiveDescendant(o),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)};this._adapter.attachDropdown(l),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_findClosestOptionIndex(t,e){let i=e.reduce((n,l)=>Math.abs((l.value.time||0)-t)<Math.abs((n.value.time||0)-t)?l: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)}_generateTimeOptions(){let t=this._min!=null?Math.max(v(this._min),0):0,e=this._max!=null?Math.min(v(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],l=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=I(d),_t=this._restrictedTimes.includes(_),ht=m(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let o=n.findIndex(d=>d.value.time/1e3/60>=720);o>=0&&o<n.length-1&&n.splice(o,0,{label:"",value:null,divider:!0})}if(this._showNow){let o={time:null,metadata:"now"};l.push({label:"Now",value:o})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let o=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});l=[...l,...o]}return l.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),l.forEach((o,d)=>n.splice(d,0,o))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),C(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):m(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 m(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 m(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 m(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=>m(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 m(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}",r=class extends W{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new T(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=c(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=c(n);break;case s.attributes.MASKED:this.masked=c(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=c(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=c(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=c(n);break;case s.attributes.SHOW_NOW:this.showNow=c(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=c(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=L(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=c(n);break;case s.attributes.DISABLED:this.disabled=c(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=c(n);break}}};p([u()],r.prototype,"value",2),p([u()],r.prototype,"open",2),p([u()],r.prototype,"allowSeconds",2),p([u()],r.prototype,"masked",2),p([u()],r.prototype,"showMaskFormat",2),p([u()],r.prototype,"use24HourTime",2),p([u()],r.prototype,"allowInvalidTime",2),p([u()],r.prototype,"min",2),p([u()],r.prototype,"max",2),p([u()],r.prototype,"restrictedTimes",2),p([u()],r.prototype,"startTime",2),p([u()],r.prototype,"step",2),p([u()],r.prototype,"allowInput",2),p([u()],r.prototype,"showNow",2),p([u()],r.prototype,"showHourOptions",2),p([u()],r.prototype,"customOptions",2),p([u()],r.prototype,"validationCallback",2),p([u()],r.prototype,"parseCallback",2),p([u()],r.prototype,"formatCallback",2),p([u()],r.prototype,"coercionCallback",2),p([u()],r.prototype,"prepareMaskCallback",2),p([u()],r.prototype,"disabled",2),p([u()],r.prototype,"popupClasses",2),p([u()],r.prototype,"allowDropdown",2),p([u()],r.prototype,"popupTarget",2),r=p([R({name:s.elementName,dependencies:[et,tt,ot,w,it,w,at]})],r);var ct=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.masked?this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")}):this._textFieldDelegate.inputElement.addEventListener("input",i=>e(i.target.value))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,l,o,d;let i={props:k({},(l=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:l.props),options:k({},(d=(o=this._config.options)==null?void 0:o.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function xe(){N(r)}export{s as a,g as b,C as c,m as d,pt as e,ut as f,v as g,M as h,It as i,dt as j,I as k,O as l,mt as m,D as n,Rt as o,T as p,r as q,ct as r,xe as s};
7
- //# sourceMappingURL=chunk.32SMESZX.js.map
6
+ import{a as rt}from"./chunk.E37HEAJ5.js";import{d as at}from"./chunk.NNGE722W.js";import{a as f,b as nt}from"./chunk.IMK2LFWR.js";import{h as st}from"./chunk.F2TKPPK7.js";import{c as et}from"./chunk.J2ODMCFS.js";import{e as tt}from"./chunk.LMOYZQZJ.js";import{e as it}from"./chunk.3UMBCR4P.js";import{a as E,b as ot}from"./chunk.BOENNFXE.js";import{j as K}from"./chunk.LZMYHIO2.js";import{a as F}from"./chunk.D4SNVKDA.js";import{a as Q,d as Z,l as w}from"./chunk.YAJT3P6V.js";import{a as $}from"./chunk.24D46RLZ.js";import{g as J}from"./chunk.7ZS4N2FT.js";import{j as b,k as X,m as G,n as q,o as Y,p as j}from"./chunk.KYCC3C3M.js";import{a as z}from"./chunk.A23NSEWA.js";import{a as u}from"./chunk.B3IJU6XJ.js";import{a as R,b as B}from"./chunk.BSZ2LBJX.js";import{a as W}from"./chunk.3E5QKMHL.js";import{a as N,e as H,g as V,i as U}from"./chunk.HN4PXH3D.js";import{m as A,s as P,u as x}from"./chunk.R4NDFXVA.js";import{a as S,k as c,l as L,o as y}from"./chunk.G76HB2FK.js";import{a as k,f as p}from"./chunk.MCIQXNKY.js";var h=`${B}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 z{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(`${E.elementName}[slot=trailing]`);if(n||i){this._toggleElement=n||i;return}let l=document.createElement(E.elementName);l.slot="trailing",l.dense=!0,l.densityLevel=3,l.style.marginRight="4px";let o=document.createElement("button");o.type="button",o.tabIndex=-1,o.setAttribute("aria-label","Toggle time dropdown");let d=document.createElement(Q.elementName);d.name="clock_outline",o.appendChild(d),l.appendChild(o),e.appendChild(l),this._toggleElement=l}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)}}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 C(a,t,e){if(!a||/^\s*$/.test(a))return null;let i=0,n=0,l=0;if(b.test(a)){let o=G(a);i=+o.hours||0,n=+o.minutes||0,l=+o.seconds||0}else if(X.test(a)){let o=q(a);i=+o.hours||0,n=+o.minutes||0,l=+o.seconds||0,i===12&&o.meridiem==="AM"&&(i=0),i<12&&o.meridiem==="PM"&&(i+=12)}else return null;return dt(i)+I(n)+(e?O(l):0)}function m(a,t,e){if(typeof a!="number"||a<0)return null;let i=Math.min(pt(a),23),n=Math.min(ut(a),59),o=a/(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(a),59);d+=`:${String(_).padStart(2,"0")}`}return t||(d+=` ${o}`),d}function pt(a){return Math.abs(Math.floor(a/(1e3*60*60)))}function ut(a){return Math.abs(Math.floor(v(a)%60))}function v(a){return a/(1e3*60)}function M(a){return Math.abs(Math.floor(It(a)%60))}function It(a){return a/1e3}function dt(a){return a*60*60*1e3}function I(a){return a*60*1e3}function O(a){return a*1e3}function mt(a){return a-O(M(a))}function D(a){let t=new Date,e=t.getHours(),i=t.getMinutes();return dt(e)+I(i)+(a?O(t.getSeconds()):0)}function Rt(a,t,e=!1){a||(a=new Date);let i=C(t,!0,e);if(!i)return a.setHours(0,0,0),a;let n=pt(i),l=828e5;n>l?n=l:n<0&&(n=0);let o=ut(i),d=e?M(i):0;return a.setHours(n,o,d),a}var T=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=S(),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){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(),this._closeDropdown(!0));break;case"Down":case"ArrowDown":this._allowDropdown&&(t.preventDefault(),this._open?this._adapter.propagateKey(t.code):(this._openDropdown(),this._adapter.activateFirstOption()));break;case"Up":case"ArrowUp":this._allowDropdown&&(t.preventDefault(),this._open&&this._adapter.propagateKey(t.code));break;case"Enter":case"Home":case"End":this._open&&(t.code==="Enter"&&t.stopPropagation(),t.preventDefault(),this._adapter.propagateKey(t.code));break;case"KeyN":t.preventDefault();let e=D(this._allowSeconds);if(this._value!==e){let i=m(e,!0,this._allowSeconds);this._emitChangeEvent(i)&&(this._applyValue(e),this._selectInputText())}break}}_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:y(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=m(this._value,!0,!0);this._emitChangeEvent(e)}}else{if(typeof this._value!="number")return;if(this._setValue(mt(this._value)),this._isInitialized&&t!==this._value){let e=m(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=m(t,!0,this._allowSeconds);return this._masked&&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=D(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=m(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(o=>!o.divider&&!o.disabled),i=[],n;if(t.length){if(this._value!=null){let o=this._findClosestOptionIndex(this._value,e);o>=0&&(e[o].value.time===this._value?i=[e[o].value]:n=o)}else if(typeof this._startTime=="number"){let o=this._findClosestOptionIndex(this._startTime,e);o>=0&&o<e.length&&(n=o)}}let l={id:`forge-time-picker-${this._identifier}`,selectedValues:i,syncWidth:!0,activeStartIndex:n,popupClasses:this._popupClasses,popupStatic:!0,type:"standard",options:t,selectCallback:o=>this._onSelect(o),closeCallback:()=>this._closeDropdown(!0),activeChangeCallback:o=>this._adapter.setActiveDescendant(o),targetWidthCallback:()=>this._adapter.getTargetElementWidth(this._popupTarget)};this._adapter.attachDropdown(l),this._adapter.emitHostEvent(s.events.OPEN,void 0,!1)}_closeDropdown(t=!1){this._open=!1,this._adapter.removeHostAttribute(s.attributes.OPEN),this._adapter.detachDropdown(),t&&this._adapter.emitHostEvent(s.events.CLOSE,!0,!1)}_findClosestOptionIndex(t,e){let i=e.reduce((n,l)=>Math.abs((l.value.time||0)-t)<Math.abs((n.value.time||0)-t)?l: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)}_generateTimeOptions(){let t=this._min!=null?Math.max(v(this._min),0):0,e=this._max!=null?Math.min(v(this._max),s.numbers.MAX_DAY_MINUTES):s.numbers.MAX_DAY_MINUTES,i=this._step,n=[],l=[];if(this._showHourOptions){for(let d=t;d<=e&&d!==s.numbers.MAX_DAY_MINUTES;d+=i){let _=I(d),_t=this._restrictedTimes.includes(_),ht=m(_,this._use24HourTime,!1)||"",bt={time:_};n.push({label:ht,value:bt,disabled:_t})}let o=n.findIndex(d=>d.value.time/1e3/60>=720);o>=0&&o<n.length-1&&n.splice(o,0,{label:"",value:null,divider:!0})}if(this._showNow){let o={time:null,metadata:"now"};l.push({label:"Now",value:o})}if(Array.isArray(this._customOptions)&&this._customOptions.length){let o=this._customOptions.map(d=>{let _={time:null,metadata:d.value,isCustom:!0,customCallback:d.toMilliseconds};return{label:d.label,value:_}});l=[...l,...o]}return l.length&&(n.length&&n.splice(0,0,{label:"",value:null,divider:!0}),l.forEach((o,d)=>n.splice(d,0,o))),n}_convertTimeStringToMillis(t,e,i){return(!t||!this._isValidTimeFormat(t))&&(t=""),C(t,e,i)}_formatValue(t){return!this._masked&&typeof this._formatCallback=="function"?this._formatCallback.call(null,t,this._use24HourTime,this._allowSeconds):m(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 m(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 m(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 m(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=>m(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 m(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}",r=class extends W{constructor(){super();Z.define([rt,K]),H(this,Tt,kt),this._foundation=new T(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=c(n);break;case s.attributes.ALLOW_SECONDS:this.allowSeconds=c(n);break;case s.attributes.MASKED:this.masked=c(n);break;case s.attributes.SHOW_MASK_FORMAT:this.showMaskFormat=c(n);break;case s.attributes.USE_24_HOUR_TIME:this.use24HourTime=c(n);break;case s.attributes.ALLOW_INVALID_TIME:this.allowInvalidTime=c(n);break;case s.attributes.SHOW_NOW:this.showNow=c(n);break;case s.attributes.SHOW_HOUR_OPTIONS:this.showHourOptions=c(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=L(n);break;case s.attributes.ALLOW_INPUT:this.allowInput=c(n);break;case s.attributes.DISABLED:this.disabled=c(n);break;case s.attributes.POPUP_CLASSES:this.popupClasses=n;break;case s.attributes.ALLOW_DROPDOWN:this.allowDropdown=c(n);break}}};p([u()],r.prototype,"value",2),p([u()],r.prototype,"open",2),p([u()],r.prototype,"allowSeconds",2),p([u()],r.prototype,"masked",2),p([u()],r.prototype,"showMaskFormat",2),p([u()],r.prototype,"use24HourTime",2),p([u()],r.prototype,"allowInvalidTime",2),p([u()],r.prototype,"min",2),p([u()],r.prototype,"max",2),p([u()],r.prototype,"restrictedTimes",2),p([u()],r.prototype,"startTime",2),p([u()],r.prototype,"step",2),p([u()],r.prototype,"allowInput",2),p([u()],r.prototype,"showNow",2),p([u()],r.prototype,"showHourOptions",2),p([u()],r.prototype,"customOptions",2),p([u()],r.prototype,"validationCallback",2),p([u()],r.prototype,"parseCallback",2),p([u()],r.prototype,"formatCallback",2),p([u()],r.prototype,"coercionCallback",2),p([u()],r.prototype,"prepareMaskCallback",2),p([u()],r.prototype,"disabled",2),p([u()],r.prototype,"popupClasses",2),p([u()],r.prototype,"allowDropdown",2),p([u()],r.prototype,"popupTarget",2),r=p([R({name:s.elementName,dependencies:[et,tt,ot,w,it,w,at]})],r);var ct=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.masked?this._element.addEventListener(s.events.INPUT,i=>{var n;return e((n=i.detail)!=null?n:"")}):this._textFieldDelegate.inputElement.addEventListener("input",i=>e(i.target.value))}onFocus(e){this._textFieldDelegate.inputElement.addEventListener("focus",i=>e(i))}onBlur(e){this._textFieldDelegate.inputElement.addEventListener("blur",i=>e(i))}_attachTextField(e){var n,l,o,d;let i={props:k({},(l=(n=this._config.options)==null?void 0:n.textFieldDelegateConfig)==null?void 0:l.props),options:k({},(d=(o=this._config.options)==null?void 0:o.textFieldDelegateConfig)==null?void 0:d.options)};this._textFieldDelegate=new nt(i),e.appendChild(this._textFieldDelegate.element)}};function xe(){N(r)}export{s as a,g as b,C as c,m as d,pt as e,ut as f,v as g,M as h,It as i,dt as j,I as k,O as l,mt as m,D as n,Rt as o,T as p,r as q,ct as r,xe as s};
7
+ //# sourceMappingURL=chunk.O2XO3IRX.js.map
@@ -3,10 +3,10 @@
3
3
  * Copyright 2022 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{f as To}from"./chunk.33Q5FK2H.js";import{b as go}from"./chunk.DIYJJHWP.js";import{f as So}from"./chunk.YWKKZLZ2.js";import{d as Bo}from"./chunk.OOBE3XRM.js";import{q as so}from"./chunk.32SMESZX.js";import{d as Po}from"./chunk.2SAHWDGJ.js";import{c as ao}from"./chunk.E4ZTNVXI.js";import{d as co}from"./chunk.TLHI6K2R.js";import{d as lo}from"./chunk.SJSLC6XF.js";import{h as uo}from"./chunk.TR64DV3G.js";import{b as xo}from"./chunk.T7ZJDAXV.js";import{d as io}from"./chunk.444GNOS4.js";import{d as Co}from"./chunk.Q6L7T6OJ.js";import{b as ro}from"./chunk.VMWS5OOZ.js";import{d as fo}from"./chunk.K32ME33N.js";import{d as eo}from"./chunk.WUIIZZQD.js";import{d as no}from"./chunk.CYJBOJMX.js";import{b as po}from"./chunk.BCUBTR5O.js";import{b as to}from"./chunk.B5ABD4CZ.js";import{d as mo}from"./chunk.IGMTMR3D.js";import{b as U}from"./chunk.5WMEFHVN.js";import{j as _}from"./chunk.5XQVZQ4U.js";import{d as j}from"./chunk.X77WVI2H.js";import{b as G}from"./chunk.SHT6BCLY.js";import{b as H}from"./chunk.6APYGKNX.js";import{d as N}from"./chunk.URBXDOF7.js";import{d as K}from"./chunk.V7P3QPNM.js";import{b as Q}from"./chunk.XXA6KNXT.js";import{d as y}from"./chunk.4T5TGQFG.js";import{e as v}from"./chunk.5D6UB4DL.js";import{d as R}from"./chunk.VQKRN5IQ.js";import{f as V}from"./chunk.LLHA3SQR.js";import{E as L}from"./chunk.JB2N65SR.js";import{b as O}from"./chunk.MGTNCCW3.js";import{i as B}from"./chunk.NTFA7FCB.js";import{c as l}from"./chunk.DML4YNQF.js";import{b as e}from"./chunk.YHHIPP2F.js";import{d}from"./chunk.5PQTSZ7G.js";import{c as u}from"./chunk.G77PXLAU.js";import{e as c}from"./chunk.Y6MPWPZU.js";import{d as A}from"./chunk.7O7V3N4A.js";import{d as D}from"./chunk.Z5P6EA5L.js";import{b as k}from"./chunk.DGOV5RDW.js";import{b as w}from"./chunk.NGIBMR3Q.js";import{f as h}from"./chunk.7NXPOEXV.js";import{d as M}from"./chunk.I2YRKTG7.js";import{d as s}from"./chunk.QJPH24V4.js";import{d as F}from"./chunk.5K5SIZRX.js";import{d as E}from"./chunk.WNOSTPQQ.js";import{d as p}from"./chunk.IFZXG3LI.js";import{d as t}from"./chunk.OG2BI3UW.js";import{d as m}from"./chunk.P6B3UWJ5.js";import{e as z}from"./chunk.CV5E5W6I.js";import{d as Y}from"./chunk.G5Q2CUUE.js";import{d as q}from"./chunk.SZL74RTY.js";import{b as a}from"./chunk.54QFNVMG.js";import{c as C}from"./chunk.D3DLVPPE.js";import{e as i}from"./chunk.7JTKKFL4.js";import{d as I}from"./chunk.K753A3KI.js";import{b as n}from"./chunk.XYBFFTXS.js";import{b as W}from"./chunk.APGFXXJ7.js";import{d as X}from"./chunk.BFNAQQCU.js";import{d as P}from"./chunk.MNBJMPJ6.js";import{d as oo}from"./chunk.PFD2SVJ4.js";import{d as $}from"./chunk.FPV4XEUK.js";import{b as Z}from"./chunk.JNOCXQVB.js";import{d as S}from"./chunk.35U4OX7S.js";import{b}from"./chunk.OAKTW64X.js";import{e as x}from"./chunk.3UMBCR4P.js";import{b as g}from"./chunk.BOENNFXE.js";import{f}from"./chunk.QXLPBYMX.js";import{e as J}from"./chunk.4KBQ5AJJ.js";import{d as T}from"./chunk.OUEF6VQ6.js";import{l as r}from"./chunk.YAJT3P6V.js";import{b as o}from"./chunk.HN4PXH3D.js";var Ao=[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,w,f,po,no,eo,a,xo,ao,co,lo,k,So,Bo,uo,l,so,Po,Z,T,To,go,B];function Mr(){o(Ao)}export{Mr as a};
6
+ import{f as To}from"./chunk.33Q5FK2H.js";import{b as go}from"./chunk.DIYJJHWP.js";import{f as So}from"./chunk.YWKKZLZ2.js";import{d as Bo}from"./chunk.OOBE3XRM.js";import{q as so}from"./chunk.O2XO3IRX.js";import{d as Po}from"./chunk.2SAHWDGJ.js";import{c as ao}from"./chunk.J6CIWTDH.js";import{d as co}from"./chunk.TLHI6K2R.js";import{d as lo}from"./chunk.SJSLC6XF.js";import{h as uo}from"./chunk.TR64DV3G.js";import{b as xo}from"./chunk.T7ZJDAXV.js";import{d as io}from"./chunk.444GNOS4.js";import{d as Co}from"./chunk.Q6L7T6OJ.js";import{b as ro}from"./chunk.VMWS5OOZ.js";import{d as fo}from"./chunk.DQBSFX46.js";import{d as eo}from"./chunk.WIUER75G.js";import{d as no}from"./chunk.75KFBRF6.js";import{b as po}from"./chunk.BCUBTR5O.js";import{b as to}from"./chunk.B5ABD4CZ.js";import{d as mo}from"./chunk.EJ4ASQET.js";import{b as U}from"./chunk.5WMEFHVN.js";import{j as _}from"./chunk.5XQVZQ4U.js";import{d as j}from"./chunk.X77WVI2H.js";import{b as G}from"./chunk.SHT6BCLY.js";import{b as H}from"./chunk.6APYGKNX.js";import{d as N}from"./chunk.URBXDOF7.js";import{d as K}from"./chunk.Y7Q6QI5V.js";import{b as Q}from"./chunk.XXA6KNXT.js";import{d as y}from"./chunk.4T5TGQFG.js";import{e as v}from"./chunk.QOZLQPKE.js";import{d as R}from"./chunk.NNGE722W.js";import{f as V}from"./chunk.LLHA3SQR.js";import{E as L}from"./chunk.JB2N65SR.js";import{b as O}from"./chunk.MGTNCCW3.js";import{i as B}from"./chunk.QEHJJKFZ.js";import{c as l}from"./chunk.HSJQA42U.js";import{b as e}from"./chunk.YHHIPP2F.js";import{d}from"./chunk.YPUWII7L.js";import{c as u}from"./chunk.G77PXLAU.js";import{e as c}from"./chunk.Y6MPWPZU.js";import{d as A}from"./chunk.7O7V3N4A.js";import{d as D}from"./chunk.6QMDYUVT.js";import{b as k}from"./chunk.HUWXZ4ZN.js";import{b as w}from"./chunk.NGIBMR3Q.js";import{f as h}from"./chunk.7NXPOEXV.js";import{d as M}from"./chunk.I2YRKTG7.js";import{d as s}from"./chunk.QJPH24V4.js";import{d as F}from"./chunk.5K5SIZRX.js";import{d as E}from"./chunk.WNOSTPQQ.js";import{d as p}from"./chunk.IFZXG3LI.js";import{d as t}from"./chunk.OG2BI3UW.js";import{d as m}from"./chunk.P6B3UWJ5.js";import{e as z}from"./chunk.CV5E5W6I.js";import{d as Y}from"./chunk.RGWUF3J2.js";import{d as q}from"./chunk.6XXKSGW5.js";import{b as a}from"./chunk.54QFNVMG.js";import{c as C}from"./chunk.J2ODMCFS.js";import{e as i}from"./chunk.LMOYZQZJ.js";import{d as I}from"./chunk.K753A3KI.js";import{b as n}from"./chunk.XYBFFTXS.js";import{b as W}from"./chunk.APGFXXJ7.js";import{d as X}from"./chunk.BFNAQQCU.js";import{d as P}from"./chunk.MNBJMPJ6.js";import{d as oo}from"./chunk.PFD2SVJ4.js";import{d as $}from"./chunk.FPV4XEUK.js";import{b as Z}from"./chunk.JNOCXQVB.js";import{d as S}from"./chunk.35U4OX7S.js";import{b}from"./chunk.OAKTW64X.js";import{e as x}from"./chunk.3UMBCR4P.js";import{b as g}from"./chunk.BOENNFXE.js";import{f}from"./chunk.QXLPBYMX.js";import{e as J}from"./chunk.4KBQ5AJJ.js";import{d as T}from"./chunk.OUEF6VQ6.js";import{l as r}from"./chunk.YAJT3P6V.js";import{b as o}from"./chunk.HN4PXH3D.js";var Ao=[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,w,f,po,no,eo,a,xo,ao,co,lo,k,So,Bo,uo,l,so,Po,Z,T,To,go,B];function Mr(){o(Ao)}export{Mr 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.2ZSAAJDN.js.map
12
+ //# sourceMappingURL=chunk.ON3JVSSR.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ import{a as C}from"./chunk.B5ABD4CZ.js";import{b as o}from"./chunk.EJ4ASQET.js";import{a as V}from"./chunk.RST65QIB.js";import{h as P,i as N}from"./chunk.F2TKPPK7.js";import{a as k}from"./chunk.3UMBCR4P.js";import{x as L}from"./chunk.KYCC3C3M.js";import{a as G}from"./chunk.A23NSEWA.js";import{a as d}from"./chunk.B3IJU6XJ.js";import{i as S}from"./chunk.R4NDFXVA.js";import{a as y,b as c,j as I,k as x,n as B}from"./chunk.G76HB2FK.js";import{a as O,f as a}from"./chunk.MCIQXNKY.js";var U={VALUE:"value",MULTIPLE:"multiple",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",SYNC_POPUP_WIDTH:"sync-popup-width"},W=O({},U),R={CHANGE:"change"},m={attributes:W,events:R};var H=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(H||{});function D(l,b){let e=l.some(i=>E(i)),t=l.some(i=>z(i));return e&&b===1||t&&b===0}function E(l){return c(l)&&I(l)&&l.hasOwnProperty("options")&&l.hasOwnProperty("text")}function z(l){return c(l)&&I(l)&&l.hasOwnProperty("label")&&l.hasOwnProperty("value")}var F=class extends N{constructor(e){super();this._adapter=e;this._options=[];this._value=[];this._multiple=!1;this._open=!1;this._selectedValues=[];this._selectedLabels=[];this._selectedIndexes=[];this._filterString="";this._focusListener=t=>this._onFocus(t),this._blurListener=t=>this._onBlur(t),this._clickListener=t=>this._onClick(t),this._keydownListener=t=>this._onKeydown(t),this._optionsChangedListener=t=>this._onOptionsChanged(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dismissListener=()=>this._onDismiss(),this._identifier=y()}_onFocus(e){}initialize(){this._optionListenerDestructor&&this._optionListenerDestructor(),this._optionListenerDestructor=this._adapter.setOptionsListener(this._optionsChangedListener),this._initializeValue()}initializeTarget(){this._adapter.initializeAccessibility(),this._adapter.setMultiple(this._multiple),this._adapter.addClickListener(this._clickListener),this._adapter.addTargetListener("blur",this._blurListener),this._adapter.addTargetListener("focus",this._focusListener),this._adapter.addTargetListener("keydown",this._keydownListener)}disconnect(){this._adapter.removeClickListener(this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("focus",this._focusListener),this._adapter.removeTargetListener("keydown",this._keydownListener),this._open&&this._closeDropdown(),this._optionListenerDestructor&&this._optionListenerDestructor()}appendOptions(e){this._adapter.setOptions(e,!1),this._open&&this._adapter.appendDropdownOptions(e)}selectAll(){this._multiple&&(this.value=this._flatOptions.map(e=>e.value))}deselectAll(){this._multiple&&(this.value=[])}get _flatOptions(){return D(this._options,1)?[].concat.apply([],this._options.map(e=>e.options)):this._options}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}_initializeValue(){let e=this._options.length&&this._options||this._adapter.getOptions();c(this._value)&&e.length&&this._applyValue(this._value)}_onClick(e){e.button===0&&(this._open?this._closeDropdown():this._openDropdown())}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._open&&this._closeDropdown()}_openDropdown(){if(this._options=this._adapter.getOptions(),!this._flatOptions.length)return;this._open=!0;let e={options:this._options,multiple:this._multiple,selectedValues:[...this._selectedValues],id:this._identifier,optionBuilder:this._optionBuilder,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,popupClasses:this._popupClasses,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,closeCallback:()=>this._closeDropdown(),selectCallback:t=>{let i=this._flatOptions,n=i.find(r=>r.value===t);if(n){let r=i.indexOf(n);this._onSelect(n,r,!0)}}};this._adapter.open(e),this._adapter.setDismissListener(this._dismissListener)}_closeDropdown(){this._open=!1,this._adapter.close()}async _onSelect(e,t,i=!0){return new Promise(async n=>{if(this._valueChanging)return Promise.resolve(!1);let r=e?e.value:"",u=e?e.label:"",v=[...this._value],f=[...this._selectedValues],g=[...this._selectedLabels],w=[...this._selectedIndexes];if(this._multiple)if(this._selectedValues.includes(r)){let h=this._selectedValues.indexOf(r);this._selectedValues.splice(h,1),this._selectedLabels.splice(h,1),this._selectedIndexes.splice(h,1)}else this._selectedValues.push(r),this._selectedLabels.push(u),this._selectedIndexes.push(t);else c(r)?(this._selectedValues[0]=r,this._selectedLabels[0]=u,this._selectedIndexes[0]=t):(this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]);this._value=[...this._selectedValues];let s=()=>{this._selectedValues=[...f],this._selectedLabels=[...g],this._selectedIndexes=[...w],this._value=[...v]},_=()=>{if(this._multiple){let h=this._selectedIndexes.includes(t);this._adapter.toggleOptionMultiple(t,h)}this._applySelection()},A=this.multiple?[...this._selectedValues]:this._selectedValues[0];if(this._open&&i&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"){this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,A));let h=await this._valueChanging;if(this._valueChanging=void 0,!h)return s(),this._tryUpdateDropdownPosition(),n(!1)}let T=!this._adapter.emitHostEvent(m.events.CHANGE,A,!0,!0);T?s():_(),this._tryUpdateDropdownPosition(),n(!T)})}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._onSelect(this._nonDividerOptions[e],e)}_tryUpdateDropdownPosition(){this._open&&this._adapter.queueDropdownPositionUpdate()}_reset(){this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]}_applyValue(e){this._selectedValues=[],this._selectedLabels=[],this._options=this._adapter.getOptions(),Array.isArray(e)||(e=[e]),this._value=[];for(let t of e){this._value.includes(t)||this._value.push(t);let i=this._flatOptions.find(n=>B(n.value,t));i&&(this._selectedValues.push(i.value),this._selectedLabels.push(i.label))}this._selectedIndexes=this._selectedValues.map(t=>this._flatOptions.findIndex(i=>i.value===t)),this._adapter.patchSelectedValues(this._selectedValues)}_onDismiss(){this._closeDropdown()}_getSelectedText(){if(typeof this._selectedTextBuilder=="function"){let e=this._flatOptions.filter(t=>this._selectedValues.includes(t.value));return this._selectedTextBuilder(e)}return this._multiple?this._selectedLabels.length?`${this._selectedLabels.length} ${this._selectedLabels.length===1?"option":"options"} selected`:"":this._selectedLabels.filter(e=>e&&e.length).join(" ").trim()}_onKeydown(e){let t=e.key==="Escape"||e.keyCode===27,i=e.key==="Enter"||e.keyCode===13,n=e.key==="Space"||e.keyCode===32,r=e.key==="ArrowDown"||e.keyCode===40,u=e.key==="ArrowUp"||e.keyCode===38,v=e.keyCode>=48&&e.keyCode<=90,f=e.key==="Home"||e.keyCode===36,g=e.key==="End"||e.keyCode===35;if(e.key==="Tab"&&this._open&&!this._multiple){this._selectActiveOption();return}if(!v&&this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterString="",this._filterTimeout=void 0),t&&(e.preventDefault(),this._open)){this._closeDropdown();return}if(n)e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();else if(i)this._open&&(e.stopPropagation(),e.preventDefault(),this._options=this._adapter.getOptions(),this._selectActiveOption());else if(u||r){if(e.preventDefault(),this._multiple&&!this._open){this._openDropdown(),this._adapter.activateFirstOption();return}if(this._flatOptions.length===0)return;let s=0;this._open?(s=this._adapter.getActiveOptionIndex(),s===-1&&(s=this._getFirstSelectedOptionIndex())):s=this._getFirstSelectedOptionIndex(),u?s=this._getPreviousHighlightableOptionIndex(s,this._nonDividerOptions):s=this._getNextHighlightableOptionIndex(s,this._nonDividerOptions),this._open?this._adapter.highlightActiveOption(s):this._onSelect(this._nonDividerOptions[s],s)}else if(f)this._open&&(e.preventDefault(),this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(s=>!s.disabled)));else if(g){if(this._open){e.preventDefault();let s=this._nonDividerOptions;for(let _=s.length-1;_>=0;_--)if(!s[_].disabled){this._adapter.highlightActiveOption(_);break}}}else v&&this._filter(e.key)}_getFirstSelectedOptionIndex(){return this._nonDividerOptions.findIndex(e=>this._selectedValues.includes(e.value))}_getPreviousHighlightableOptionIndex(e,t){let i=e;return i<=0?i=t.length-1:i--,t[i].disabled?this._getPreviousHighlightableOptionIndex(i,t):i}_getNextHighlightableOptionIndex(e,t){let i=e;return i===t.length-1?i=0:i++,t[i].disabled?this._getNextHighlightableOptionIndex(i,t):i}_filter(e){this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterTimeout=void 0),this._filterString+=e,this._filterTimeout=window.setTimeout(()=>{this._filterString="",this._filterTimeout=void 0},300),this._options=this._adapter.getOptions();let t=this._flatOptions.find(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._filterString));if(t){let i=this._flatOptions.indexOf(t);this._open?this._adapter.highlightActiveOption(i):this._multiple||this._onSelect(t,i,!1)}}_onOptionsChanged(e){this._options=e,this._applyValue(this._value)}_onActiveOptionChanged(e){this._adapter.updateActiveDescendant(e)}get value(){return this._multiple?[...this._value]:this._value[0]}set value(e){let t;Array.isArray(e)?t=[...e]:t=e,this._applyValue(t)}get selectedIndex(){return this._multiple?[...this._selectedIndexes]:this._selectedIndexes[0]}set selectedIndex(e){this._options=this._adapter.getOptions();let t;if(Array.isArray(e)?t=[...e]:t=[e],t.sort(),this.multiple)this.value=t.map(i=>this._flatOptions[i]).filter(i=>i).map(i=>i.value);else{let i=this._flatOptions[t[t.length-1]];if(!i)return;this.value=i.value}}get options(){return this._adapter.getOptions()}set options(e){let t;D(e,1)?t=e.map(i=>O({},i)):t=e.map(i=>O({},i)),this._options=t,this._adapter.setOptions(t),this._initializeValue(),this._open&&this._adapter.setDropdownOptions(t)}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._reset(),this._open&&this._closeDropdown(),this._adapter.setMultiple(this._multiple))}get open(){return this._open}set open(e){this._open!==e&&(e?this._openDropdown():this._closeDropdown())}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupClasses(){return this._popupClasses}set popupClasses(e){this._popupClasses=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get popupElement(){return this._adapter.popupElement}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){this._beforeValueChange=e}};var p=class extends V{constructor(){super()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case m.attributes.MULTIPLE:this.multiple=x(i);break;case m.attributes.VALUE:this.value=i;break}}appendOptions(e){this._foundation.appendOptions(e)}selectAll(){this._foundation.selectAll()}deselectAll(){this._foundation.deselectAll()}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}};a([d()],p.prototype,"value",2),a([d()],p.prototype,"selectedIndex",2),a([d()],p.prototype,"options",2),a([d()],p.prototype,"multiple",2),a([d()],p.prototype,"open",2),a([d()],p.prototype,"optionBuilder",2),a([d()],p.prototype,"selectedTextBuilder",2),a([d()],p.prototype,"beforeValueChange",2),a([d({set:!1})],p.prototype,"popupElement",2);var M=class extends G{constructor(e){super(e)}get popupElement(){var e;return(e=this._listDropdown)==null?void 0:e.dropdownElement}getOptions(){let e=Array.from(this._component.querySelectorAll(C.elementName));if(e.length)return e.map(t=>{let i=Array.from(t.querySelectorAll(o.elementName)),n=this._createOptionsFromElements(i);return{text:t.label,options:n}});{let t=Array.from(this._component.querySelectorAll(o.elementName));return this._createOptionsFromElements(t)}}_createOptionsFromElements(e){return e.map(t=>{let i=t.hasAttribute(o.attributes.OPTION_CLASS)?t.getAttribute(o.attributes.OPTION_CLASS):t.optionClass;return typeof i=="string"&&(i=i.split(" ")),{label:t.hasAttribute(o.attributes.LABEL)?t.getAttribute(o.attributes.LABEL):c(t.label)?t.label:t.innerText,value:t.hasAttribute(o.attributes.VALUE)?t.getAttribute(o.attributes.VALUE):t.value,disabled:t.hasAttribute(o.attributes.DISABLED),divider:t.hasAttribute(o.attributes.DIVIDER),optionClass:i,leadingIcon:t.hasAttribute(o.attributes.LEADING_ICON)?t.getAttribute(o.attributes.LEADING_ICON):t.leadingIcon,leadingIconClass:t.hasAttribute(o.attributes.LEADING_ICON_CLASS)?t.getAttribute(o.attributes.LEADING_ICON_CLASS):t.leadingIconClass,leadingIconType:t.hasAttribute(o.attributes.LEADING_ICON_TYPE)?t.getAttribute(o.attributes.LEADING_ICON_TYPE):t.leadingIconType,trailingIcon:t.hasAttribute(o.attributes.TRAILING_ICON)?t.getAttribute(o.attributes.TRAILING_ICON):t.trailingIcon,trailingIconClass:t.hasAttribute(o.attributes.TRAILING_ICON_CLASS)?t.getAttribute(o.attributes.TRAILING_ICON_CLASS):t.trailingIconClass,trailingIconType:t.hasAttribute(o.attributes.TRAILING_ICON_TYPE)?t.getAttribute(o.attributes.TRAILING_ICON_TYPE):t.trailingIconType,leadingBuilder:t.leadingBuilder,trailingBuilder:t.trailingBuilder}})}open(e){this._listDropdown=new P(this._targetElement,e),this._listDropdown.open()}close(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(k.events.BLUR,e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}highlightActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}patchSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}setOptionsListener(e){let t=n=>{n.stopPropagation(),e(this.getOptions())};this._component.addEventListener(o.events.VALUE_CHANGE,t);let i=new MutationObserver(()=>e(this.getOptions()));return i.observe(this._component,{childList:!0,subtree:!0}),()=>{this._component.removeEventListener(o.events.VALUE_CHANGE,t),i.disconnect()}}setOptions(e,t=!0){t&&this._clearOptions();for(let i of e)if(E(i)){let n=this._createOptionGroupElement(i);for(let r of i.options){let u=this._createOptionElement(r);n.appendChild(u)}this._component.appendChild(n)}else{let n=this._createOptionElement(i);this._component.appendChild(n)}}appendDropdownOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setDropdownOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}scrollSelectedOptionIntoView(){var e;(e=this._listDropdown)==null||e.scrollSelectedOptionIntoView()}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}queueDropdownPositionUpdate(){!this.popupElement||window.requestAnimationFrame(()=>{let e=this.popupElement;e==null||e.position()})}_clearOptions(){Array.from(this._component.querySelectorAll(C.elementName)).forEach(i=>S(i)),Array.from(this._component.querySelectorAll(o.elementName)).forEach(i=>S(i))}_createOptionGroupElement(e){var i;let t=document.createElement("forge-option-group");return L(e,t),t.label=(i=e.text)!=null?i:"",t}_createOptionElement(e){let t=document.createElement("forge-option");return L(e,t),t.textContent=e.label,t}};export{m as a,H as b,D as c,E as d,z as e,F as f,p as g,M as h};
7
+ //# sourceMappingURL=chunk.PZTAIVJW.js.map